/* КРЯКК — оформление страниц ярмарки */
:root {
  color-scheme: light;
  --bg: #f6f2e9;
  --bg-2: #ece5d6;
  --card: #fffdf8;
  --tx: #1c2230;
  --tx-2: #4d5466;
  --teal: #0f4c5c;
  --teal-2: #16697a;
  --coral: #d9541e;
  --sun: #f2b134;
  --line: #d8cfbd;
  --rad: 14px;
  --f-head: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "PT Serif", serif;
  --f-body: "Segoe UI", Roboto, "PT Sans", "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 17px/1.65 var(--f-body); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--teal-2); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--coral); }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 700; color: var(--tx); margin: 0 0 .6em; line-height: 1.18; }
p { margin: 0 0 1em; }
.shell { width: min(100% - 2.5rem, 74rem); margin-inline: auto; }
.jump { position: absolute; left: -999px; top: .5rem; padding: .5rem 1rem; background: var(--card); z-index: 50; }
.jump:focus { left: .5rem; }

/* шапка */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(246, 242, 233, .96); backdrop-filter: saturate(1.4) blur(6px); border-bottom: 2px solid var(--teal); }
.topbar-row { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }
.logo { display: inline-flex; align-items: center; gap: .55rem; font: 800 1.35rem/1 var(--f-head); letter-spacing: .02em; color: var(--teal); text-decoration: none; white-space: nowrap; }
.logo:hover { color: var(--teal); }
.logo-glyph { width: 30px; height: 30px; flex: none; border-radius: 9px 9px 9px 2px; background: var(--teal); position: relative; }
.logo-glyph::before { content: ""; position: absolute; inset: 7px 6px; border-left: 3px solid var(--sun); border-right: 3px solid var(--sun); border-radius: 2px; }
.logo-glyph::after { content: ""; position: absolute; left: 50%; top: 6px; bottom: 6px; width: 2px; margin-left: -1px; background: var(--bg); }
.menu { display: flex; align-items: center; gap: .1rem; flex-wrap: wrap; margin-left: auto; font-size: .93rem; font-weight: 600; }
.menu a { color: var(--tx); text-decoration: none; padding: .45rem .6rem; white-space: nowrap; border-radius: 999px; }
.menu a:hover { background: var(--bg-2); color: var(--tx); }
.menu a[aria-current] { background: var(--teal); color: #fff; }
.nav-find::before { content: "⌕ "; }
.burger { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; padding: 0; }
.burger span, .burger span::before, .burger span::after { display: block; width: 20px; height: 2px; background: var(--tx); margin: 0 auto; position: relative; transition: transform .2s; }
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; }
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }
.topbar.is-open .burger span { background: transparent; }
.topbar.is-open .burger span::before { transform: translateY(6px) rotate(45deg); }
.topbar.is-open .burger span::after { transform: translateY(-6px) rotate(-45deg); }

/* первый экран */
.lead { background: linear-gradient(135deg, var(--teal) 0%, #0b3540 100%); color: #f6f2e9; overflow: hidden; }
.lead-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(12rem, 1fr); gap: 2rem; align-items: center; padding-block: clamp(2.5rem, 7vw, 5.5rem); }
.lead-dates { display: inline-block; background: var(--sun); color: var(--tx); font-weight: 700; font-size: .85rem; letter-spacing: .04em; padding: .3rem .8rem; border-radius: 999px; margin-bottom: 1.2rem; }
.lead-dates span::before { content: " · "; }
.lead h1 { color: #fff; font-size: clamp(2.2rem, 5.5vw, 4.2rem); line-height: 1.05; margin-bottom: 1rem; max-width: 14em; }
.lead-sub { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #cfe3e6; max-width: 40ch; margin-bottom: 1.8rem; }
.lead-btns { display: flex; gap: .7rem; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: .5rem; min-height: 46px; padding: .6rem 1.2rem; border-radius: 10px; border: 2px solid var(--coral); background: var(--coral); color: #fff; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; }
.btn:hover { background: #b8410f; border-color: #b8410f; color: #fff; }
.btn-line { background: transparent; border-color: #9cc5cc; color: #fff; }
.btn-line:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.page .btn-line, .block .btn-line { color: var(--teal); border-color: var(--teal); }
.page .btn-line:hover, .block .btn-line:hover { background: var(--teal); color: #fff; }
.bk-pic { width: 100%; max-width: 22rem; margin-inline: auto; }
.bk-pic svg { width: 100%; height: auto; display: block; }

/* секции */
.block { margin-block: clamp(2.5rem, 6vw, 4.5rem); }
.block-top { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; margin-bottom: 1.2rem; }
.block-top h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); margin: 0; }
.block-top h2::after { content: ""; display: block; width: 3rem; height: 4px; border-radius: 2px; background: var(--coral); margin-top: .5rem; }
.block-top a { font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--rad); padding: 1.3rem 1.3rem 1.1rem; box-shadow: 0 1px 0 var(--line); transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15, 76, 92, .12); }
.tile h3 { font-size: 1.2rem; line-height: 1.25; overflow-wrap: anywhere; }
.tile h3 a, .row-item h2 a, .row-item h3 a { color: var(--tx); text-decoration: none; }
.tile h3 a:hover, .row-item h2 a:hover, .row-item h3 a:hover { color: var(--coral); }
.tile p:last-child, .row-item p:last-child { margin-bottom: 0; }
.tile img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border-radius: 10px; margin-bottom: 1rem; background: var(--bg-2); }
.tile-story { border-top: 4px solid var(--sun); }
.meta { display: block; color: var(--teal-2); font-size: .82rem; font-weight: 700; letter-spacing: .02em; margin-bottom: .45rem; }

/* внутренние страницы */
.page { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(2.5rem, 6vw, 4.5rem); min-height: 60vh; }
.crumbs { display: flex; flex-wrap: wrap; gap: .25rem; font-size: .85rem; margin-bottom: 1.4rem; color: var(--tx-2); }
.crumbs a { color: var(--tx-2); }
.crumbs > * + *::before { content: "›"; margin: 0 .45rem 0 .2rem; color: var(--line); }
.crumbs .here { color: var(--tx); }
.page-head { max-width: 52rem; margin-bottom: 1.8rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(1.8rem, 4.4vw, 3rem); overflow-wrap: anywhere; margin-bottom: .3rem; }
.txt { max-width: 46rem; font-size: 1.05rem; overflow-wrap: anywhere; }
.txt h2, .txt h3 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin-top: 1.8em; }
.txt h4 { font-size: 1.15rem; margin-top: 1.5em; }
.txt ul, .txt ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.txt li { margin-bottom: .35em; }
.txt blockquote { margin: 1.5em 0; padding: .8em 1.2em; border-left: 4px solid var(--sun); background: var(--card); border-radius: 0 10px 10px 0; }
.txt img, .page-pic { max-height: 36rem; width: auto; object-fit: contain; border-radius: 10px; margin: 0 0 1.3rem; }
.txt figure { margin: 1.5rem 0; }
.txt iframe { max-width: 100%; border: 0; border-radius: 10px; }
.txt .vid { position: relative; aspect-ratio: 16 / 9; margin: 1.5rem 0; }
.txt .vid iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.2rem 0 1.6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.tbl table, .txt table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: .95rem; }
.txt td, .txt th, .tbl td, .tbl th { padding: .55rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th, .txt th { background: var(--bg-2); font-weight: 700; }
.rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1.4rem; margin-top: 1.2rem; }
.row-item { display: flex; align-items: center; gap: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.1rem; }
.row-item img { width: 4.5rem; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--bg-2); flex: none; }
.row-item h2, .row-item h3 { font-size: 1.12rem; margin-bottom: .25rem; line-height: 1.28; overflow-wrap: anywhere; }
.row-item p { color: var(--tx-2); font-size: .92rem; }
.row-item[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1.2rem 0; }
.chips a, .chips button { padding: .3rem .85rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--tx); text-decoration: none; font-size: .88rem; cursor: pointer; }
.chips a:hover, .chips button:hover { border-color: var(--teal); color: var(--teal); }
.chips .on, .chips button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.sub-h { margin: 2.2rem 0 .6rem; font-size: 1.5rem; }
.ed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1rem; list-style: none; margin: 0 0 2.4rem; padding: 0; }
.ed-grid li { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 10px; padding: 1rem; }
.ed-grid h2 { font-size: 1.15rem; margin-bottom: .6rem; }
.ed-grid a { font-size: .9rem; font-weight: 600; }
.cal-day { margin-top: 1.6rem; }
.pager { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.6rem 0 0; }
.pager button { min-width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--tx); cursor: pointer; font-weight: 600; }
.pager button[aria-current="page"] { background: var(--teal); border-color: var(--teal); color: #fff; }

/* поиск */
.find-form { max-width: 40rem; margin-bottom: 1.5rem; }
.find-form label { display: block; margin-bottom: .5rem; font-weight: 600; }
.find-form div { display: flex; gap: .6rem; }
.find-form input, .tool select, .tool input { min-width: 0; width: 100%; padding: .6rem .85rem; border: 1px solid #b9ae98; border-radius: 10px; background: #fff; color: var(--tx); min-height: 46px; }
.find-list { list-style: none; padding: 0; max-width: 40rem; }
.find-list li { border-bottom: 1px solid var(--line); padding: .85rem 0; overflow-wrap: anywhere; }
.find-list p { margin: .35rem 0 0; color: var(--tx-2); }

/* инструменты */
.tool { background: var(--card); border: 1px solid var(--line); border-radius: var(--rad); padding: clamp(1rem, 3vw, 1.6rem); margin: 1.5rem 0 2rem; max-width: 52rem; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .9rem; margin-bottom: 1rem; }
.tool label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .3rem; }
.tool-out { background: var(--bg); border-radius: 10px; padding: 1rem 1.2rem; font-size: 1.05rem; }
.tool-out strong { color: var(--teal); font-size: 1.3em; }
.plan-list { list-style: none; padding: 0; margin: 0; }
.plan-list li { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: .8rem; align-items: start; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.plan-list .t { font-weight: 700; color: var(--teal); font-size: .9rem; }
.plan-list .p { display: block; color: var(--tx-2); font-size: .85rem; }
.plan-list button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: .3rem .6rem; cursor: pointer; font-size: .85rem; white-space: nowrap; }
.plan-list button[aria-pressed="true"] { background: var(--sun); border-color: var(--sun); }
.plan-list li.clash .t::after { content: " ⚠"; color: var(--coral); }
.note { font-size: .9rem; color: var(--tx-2); }
.pic-ph { background: var(--bg-2); }

/* подвал */
.bottom { margin-top: 2rem; background: #13232a; color: #c9d6d8; }
.bottom a { color: #f6f2e9; }
.bottom a:hover { color: var(--sun); }
.bottom-row { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 1.5rem 2rem; padding-block: 2.4rem 1.6rem; font-size: .9rem; }
.bottom-row h2 { color: #fff; font-size: .95rem; font-family: var(--f-body); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .7rem; }
.bottom-row ul { list-style: none; padding: 0; margin: 0; }
.bottom-row li { margin-bottom: .35rem; }
.bottom .logo { color: #fff; margin-bottom: .8rem; }
.bottom-end { border-top: 1px solid #2a3d44; padding-block: 1rem 1.4rem; font-size: .82rem; color: #8fa3a7; }

@media (max-width: 1120px) {
  .burger { display: block; }
  .topbar-row { flex-wrap: wrap; }
  .menu { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-bottom: .8rem; margin-left: 0; }
  .topbar.is-open .menu { display: flex; }
  .menu a { padding: .75rem .6rem; border-radius: 8px; border-bottom: 1px solid var(--line); }
  .bottom-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .shell { width: min(100% - 2rem, 74rem); }
  .lead-grid { grid-template-columns: 1fr; }
  .bk-pic { max-width: 13rem; margin: 0; }
  .rows { grid-template-columns: 1fr; }
  .bottom-row { grid-template-columns: 1fr; }
  .plan-list li { grid-template-columns: 1fr; gap: .3rem; }
  .find-form div { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
