/* Публичная витрина фестиваля «1+1».
   Фирменный стиль Центра творчества им. А.В. Косарева: тёмно-синий #375C7A,
   малиновый #D32248, голубой #81B4E1, шрифт Fira Sans (лицензия OFL, файлы
   лежат локально — сторонние CDN не используем). */

@font-face { font-family: "Fira Sans"; font-weight: 400; font-display: swap; src: url("../fonts/FiraSans-Regular.woff") format("woff"); }
@font-face { font-family: "Fira Sans"; font-weight: 500; font-display: swap; src: url("../fonts/FiraSans-Medium.woff") format("woff"); }
@font-face { font-family: "Fira Sans"; font-weight: 600; font-display: swap; src: url("../fonts/FiraSans-SemiBold.woff") format("woff"); }
@font-face { font-family: "Fira Sans"; font-weight: 700; font-display: swap; src: url("../fonts/FiraSans-Bold.woff") format("woff"); }

:root {
    --blue: #375C7A;
    --blue-deep: #26445C;
    --ink: #1E3346;
    --muted: #5A6E80;
    --red: #D32248;
    --red-deep: #B01A3B;
    --sky: #81B4E1;
    --sky-pale: #E7F0F9;
    --paper: #F5F8FB;
    --line: #D9E3EC;
    --white: #fff;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(30, 51, 70, .06), 0 8px 24px rgba(30, 51, 70, .07);
    --wrap: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 400 17px/1.6 "Fira Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--ink);
    background: var(--white);
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; color: var(--blue-deep); margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(30px, 5vw, 48px); letter-spacing: -.01em; }
h2 { font-size: clamp(24px, 3.4vw, 32px); }
h3 { font-size: 20px; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--blue); color: #fff; padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { margin-bottom: 6px; }

/* Кнопки */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 10px 22px; border-radius: 999px;
    font: 600 16px/1.2 inherit; font-family: inherit; text-decoration: none;
    border: 2px solid transparent; cursor: pointer; white-space: nowrap;
    transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-deep); color: #fff; }
.btn-outline { border-color: var(--blue); color: var(--blue); background: transparent; }
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-light { background: #fff; color: var(--blue-deep); }
.btn-light:hover { background: var(--sky-pale); color: var(--blue-deep); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Шапка. На широком экране — две строки: логотип, этап со сроком и вход;
   под ними меню. Уже 1180 px меню уходит под кнопку, уже 760 px строка
   этапа опускается под логотип во всю ширину. */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-row {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand when cta" "nav nav nav";
    align-items: center; column-gap: 24px;
}
.brand { grid-area: brand; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--blue-deep); padding: 12px 0; }
.brand:hover { color: var(--blue-deep); }
.mark { flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-weight: 700; font-size: 19px; }
.brand-sub { font-size: 13px; color: var(--muted); }

.when {
    grid-area: when; justify-self: start; display: flex; align-items: center; gap: 12px; min-width: 0;
    padding: 4px 0 4px 24px; border-left: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.when-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--sky); }
.when-registration .when-dot, .when-submission .when-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(211, 34, 72, .15); }
.when-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.when-title { font-weight: 600; font-size: 15px; color: var(--blue-deep); }
.when-detail { font-size: 14px; color: var(--muted); }
.when:hover .when-title { color: var(--red); }
.header-cta { grid-area: cta; min-height: 40px; padding: 8px 18px; font-size: 15px; }

.nav-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nav-toggle-label { display: none; }
.menu { grid-area: nav; border-top: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; margin: 0 -10px; padding: 4px 0; }
.nav a:not(.btn) { padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: 15px; }
.nav a:not(.btn):hover { background: var(--paper); color: var(--blue); }
.nav a.active { color: var(--red); }
.nav-cta { display: none; }

@media (max-width: 1180px) {
    .header-row { grid-template-areas: "brand when menu"; min-height: 72px; }
    .header-cta { display: none; }
    .menu { grid-area: menu; border-top: 0; justify-self: end; }
    .nav-toggle-label {
        display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
        min-height: 44px; padding: 8px 16px; border: 2px solid var(--line); border-radius: 999px; font-weight: 600;
    }
    .nav-toggle:focus-visible + .nav-toggle-label { outline: 3px solid var(--red); outline-offset: 2px; }
    .menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: var(--blue-deep); border-radius: 2px; position: relative; }
    .menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
    .menu-icon::before { top: -6px; }
    .menu-icon::after { top: 6px; }
    .nav { display: none; }
    .nav-toggle:checked ~ .nav {
        display: flex; position: absolute; left: 0; right: 0; top: 100%; margin: 0; background: #fff; border-bottom: 1px solid var(--line);
        flex-direction: column; align-items: stretch; gap: 0; padding: 8px 20px 20px; box-shadow: var(--shadow);
    }
    .nav-toggle:checked ~ .nav a:not(.btn) { padding: 12px 8px; font-size: 17px; border-bottom: 1px solid var(--paper); border-radius: 0; }
    .nav-cta { display: inline-flex; margin: 12px 0 0; min-height: 44px; }
}
@media (max-width: 760px) {
    .header-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand menu" "when when"; column-gap: 12px; min-height: 0; }
    .brand { padding: 10px 0; }
    .when { padding: 7px 0 8px; border-left: 0; border-top: 1px solid var(--line); gap: 10px; }
    .when-dot { width: 8px; height: 8px; }
    .when-text { flex-direction: row; flex-wrap: wrap; column-gap: 6px; }
    .when-title, .when-detail { font-size: 14px; }
    .when-title::after { content: " ·"; color: var(--muted); font-weight: 400; }
}
@media (max-width: 420px) { .brand-sub { display: none; } }

/* Баннер из CMS под шапкой: 1920×400 (24:5) растягивается до 1920 px
   без обрезки; на узком экране не ниже 120 px — края обрезаются, центральные
   1200 px исходника видны от 360 px. Картинка для телефона — 2:1. */
.promo { background: var(--paper); border-bottom: 1px solid var(--line); }
.promo-link, .promo picture { display: block; max-width: 1920px; margin: 0 auto; }
.promo-link:focus-visible { outline-offset: -3px; border-radius: 0; }
/* Естественные пропорции: ширина во всё окно (до 1920 px), высота по картинке, без обрезки */
.promo img { display: block; width: 100%; height: auto; }

/* Боковой баннер (300×600) — в левом поле, только когда оно вмещает 260 px с отступами:
   содержимое 1160 px по центру, поле = (100vw − 1160) / 2 ≥ 300 → окно от 1780 px
   (с запасом на полосу прокрутки). Баннер по центру поля, при прокрутке держится под липкой шапкой (122 px + отступ) до подвала. */
.side-promo { display: none; }
@media (min-width: 1780px) {
    main.has-side-promo { position: relative; }
    .side-promo { display: block; position: absolute; top: 0; bottom: 0; left: calc((100vw - 1680px) / 4); width: 260px; z-index: 2; pointer-events: none; }
    .side-promo-inner { position: sticky; top: 146px; margin-top: 32px; pointer-events: auto; }
    .side-promo img { display: block; width: 260px; height: auto; border-radius: 8px; box-shadow: var(--shadow); }
}

/* Секции */
.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }
.section-paper { background: var(--paper); }
.lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); max-width: 760px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--red); margin-bottom: 12px; }
.page-head { background: var(--paper); padding: 48px 0 40px; border-bottom: 1px solid var(--line); }
.page-head .lead { margin-bottom: 0; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }

/* Главная: первый экран */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--paper), #fff); padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 40px; align-items: center; }
.hero h1 { margin-bottom: 16px; }
.hero h1 .accent { color: var(--red); white-space: nowrap; }
.hero .lead { margin-bottom: 28px; }
/* Ближайшие сроки в правой колонке первого экрана */
.hero-dates { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 26px 22px; align-self: center; }
.hero-dates h2 { font-size: 22px; margin-bottom: 18px; }
.hero-dates .timeline { margin-left: 8px; }
.timeline-compact li { padding-bottom: 16px; }
.timeline-compact li:last-child { padding-bottom: 4px; }
.timeline-compact span { display: block; font-size: 15px; line-height: 1.4; color: var(--muted); }
.hero-dates-note { font-size: 13px; margin: 10px 0 6px; }
.hero-dates-all { font-weight: 600; font-size: 15px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 36px; max-width: 640px; }
.fact { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.fact b { display: block; font-size: 22px; color: var(--blue-deep); line-height: 1.2; }
.fact span { font-size: 14px; color: var(--muted); }
@media (max-width: 860px) {
    .hero { padding: 40px 0; }
    .hero-grid { grid-template-columns: 1fr; gap: 28px; }
    .hero-dates { padding: 20px 18px 18px; }
    .facts { grid-template-columns: 1fr; gap: 10px; }
    .fact { display: flex; align-items: baseline; gap: 10px; }
    .fact b { font-size: 18px; }
}

/* Карточки */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
}
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--muted); }
.card-link { text-decoration: none; color: inherit; transition: transform .15s, border-color .15s; }
.card-link:hover { transform: translateY(-2px); border-color: var(--sky); color: inherit; }
.card-link:hover h3 { color: var(--red); }
.card-icon { width: 52px; height: 52px; }
.card-foot { margin-top: auto; padding-top: 8px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.direction { margin-bottom: 40px; }
.direction:last-child { margin-bottom: 0; }
.direction > h2 { font-size: 22px; margin-bottom: 18px; }

/* Метки статуса */
.tag { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--paper); color: var(--muted); }
.tag-open { background: #E3F4EA; color: #1C6B3D; }
.tag-closed { background: #F3E9EC; color: #8A1F38; }

/* Шаги */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps > li { counter-increment: step; position: relative; padding: 20px 20px 20px 76px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.steps > li::before {
    content: counter(step); position: absolute; left: 20px; top: 18px; width: 40px; height: 40px; border-radius: 50%;
    background: var(--blue); color: #fff; font-weight: 700; display: grid; place-items: center;
}
.steps h3 { margin-bottom: 4px; }
.steps p, .steps ul { margin: 0; color: var(--muted); }
.steps p + p, .steps p + ul, .steps ul + p { margin-top: .6em; }
.steps ul { padding-left: 1.2em; }
.steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .steps-grid { grid-template-columns: 1fr; } }

/* Сроки */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--line); }
.timeline li { position: relative; padding: 0 0 22px 26px; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: 6px; width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); }
.timeline li.passed::before { background: var(--line); border-color: var(--line); }
.timeline li.next::before { background: var(--red); border-color: var(--red); box-shadow: 0 0 0 5px rgba(211, 34, 72, .15); }
.timeline time { display: block; font-weight: 700; color: var(--blue-deep); }
.timeline li.passed time, .timeline li.passed span { color: var(--muted); }

/* Текущий этап на странице «Сроки» */
.stage-now { display: flex; align-items: center; gap: 16px 20px; flex-wrap: wrap; max-width: 760px; margin-bottom: 36px; padding: 18px 20px; border-radius: 12px; background: var(--sky-pale); border-left: 4px solid var(--sky); }
.stage-now p { margin: 0; flex: 1 1 320px; }
.stage-now-registration, .stage-now-submission { border-left-color: var(--red); }

/* Текстовые страницы */
.prose { max-width: 780px; }
.prose h2 { font-size: 24px; margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 16px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--paper); }
.note { background: var(--sky-pale); border-left: 4px solid var(--sky); border-radius: 8px; padding: 14px 18px; margin: 1.2em 0; }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.aside { position: sticky; top: 140px; }
@media (max-width: 900px) { .layout-side { grid-template-columns: 1fr; } .aside { position: static; } }

/* Критерии */
.criteria, .prose .criteria { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: crit; }
.criteria li { counter-increment: crit; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 14px 56px; position: relative; }
.criteria li::before { content: counter(crit); position: absolute; left: 16px; top: 14px; width: 28px; height: 28px; border-radius: 8px; background: var(--sky-pale); color: var(--blue-deep); font-weight: 700; font-size: 15px; display: grid; place-items: center; }
.criteria small { display: block; color: var(--muted); font-size: 15px; }
.score { color: var(--muted); font-size: 14px; }

/* Вопросы */
.faq details { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 12px; }
.faq summary { cursor: pointer; padding: 16px 48px 16px 20px; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 12px; font-size: 24px; color: var(--red); line-height: 1.2; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 20px 16px; margin: 0; color: var(--muted); }

/* Призыв */
.cta-band { background: var(--blue); color: #fff; border-radius: var(--radius); padding: 36px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin: 0 0 6px; }
.cta-band p { margin: 0; opacity: .9; }

/* Документы */
.doc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.doc-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; flex-wrap: wrap; }

/* Формы (обращение по персональным данным) */
.form { display: grid; gap: 18px; max-width: 640px; }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; }
.form-field input[type=text], .form-field input[type=email], .form-field select, .form-field textarea {
    width: 100%; font: inherit; color: var(--ink); background: #fff;
    border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.form-field textarea { min-height: 160px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--sky-pale); }
.form-check { display: flex; gap: 10px; align-items: flex-start; }
.form-check input { margin-top: 6px; width: 18px; height: 18px; flex: none; }
.field-error { color: var(--red-deep); font-size: 15px; margin-top: 4px; }
.is-invalid { border-color: var(--red) !important; }

/* Подвал */
.site-footer { background: var(--blue-deep); color: #DCE6EF; margin-top: 64px; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--sky); }
.site-footer .muted { color: #B9C9D7; font-size: 15px; margin-top: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; padding-top: 44px; padding-bottom: 28px; font-size: 15px; }
.footer-h { color: #fff; font-size: 16px; margin-bottom: 12px; }
.footer-logo { width: 200px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); padding-top: 16px; padding-bottom: 24px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: #B9C9D7; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .site-header, .promo, .side-promo, .site-footer, .btn { display: none !important; } }

/* Архив фестиваля */
.archive-season { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 32px; padding: 36px 0; border-top: 1px solid var(--line); }
.archive-season:first-child { border-top: 0; padding-top: 0; }
.archive-season:not(:has(.archive-cover)) { grid-template-columns: 1fr; }
.archive-cover { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); }
.archive-body h2 { margin-bottom: 14px; }
.archive-files { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.archive-files li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 12px 16px; background: var(--paper); border-radius: 10px; }
.archive-files a { font-weight: 600; }
.archive-files .muted { font-size: 14px; }
.archive-photos { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.archive-photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
@media (max-width: 760px) { .archive-season { grid-template-columns: 1fr; gap: 18px; } }
