/* ============================================================
   layout.css: шапка, поиск, бургер-панель, hero, блоки, футер
   ============================================================ */

/* ---------- Шапка (липкая) ---------- */
.site-header {
    position: sticky; top: 0; z-index: 90;
    background: linear-gradient(180deg, var(--head) 0%, var(--head-2) 100%);
    color: var(--header-ink);
    box-shadow: var(--shadow-sm);
    border-bottom: 3px solid var(--accent);
}
.header__row {
    display: flex; align-items: center; gap: 14px;
    padding-top: 10px; padding-bottom: 8px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--header-ink); font-weight: 800; font-size: 1.14rem; letter-spacing: 0.01em; white-space: nowrap; }
.brand:hover { color: #fff; }
.brand__mark {
    width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px var(--glow);
}
.brand__mark svg { width: 24px; height: 24px; }
.brand__mark i { font-size: 19px; line-height: 1; }
.brand b { color: var(--accent); }
html[data-theme='dark'] .brand b { color: var(--accent); }

.header__nav { display: none; gap: 4px; margin-left: 10px; }
.header__nav a {
    color: var(--header-ink); opacity: 0.85; font-weight: 600; font-size: 0.97rem;
    padding: 8px 12px; border-radius: 9px; transition: background 0.2s ease, opacity 0.2s ease;
}
.header__nav a:hover { opacity: 1; background: rgba(255, 255, 255, 0.08); color: #fff; }
.header__nav a[aria-current='page'] { background: var(--accent-soft); opacity: 1; }

.header__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06); color: var(--header-ink);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.02rem; transition: background 0.2s ease, transform 0.2s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-1px); }

/* Переключатель темы: видим только нужную иконку */
#themeToggle .fa-moon { display: none; }
html[data-theme='dark'] #themeToggle .fa-moon { display: inline-block; }
html[data-theme='dark'] #themeToggle .fa-sun { display: none; }

/* Бургер */
.burger { display: inline-flex; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.burger span { display: block; width: 19px; height: 2px; border-radius: 2px; background: var(--header-ink); transition: transform 0.3s ease, opacity 0.3s ease; }

/* ---------- Строка поиска в шапке ---------- */
.header__search { padding: 2px 0 12px; position: relative; }
.search-form {
    display: flex; align-items: center; gap: 8px; max-width: 860px; margin: 0 auto;
    background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px; padding: 5px 6px 5px 14px;
}
.search-form__ico { opacity: 0.7; color: var(--header-ink); }
.search-form input[type='search'] {
    flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: var(--header-ink);
    font: inherit; font-size: 0.98rem; padding: 9px 4px;
}
.search-form input[type='search']::placeholder { color: rgba(255, 255, 255, 0.55); }
.search-form input[type='search']:focus-visible { box-shadow: none; outline: none; }
.search-form--page { background: var(--surface); border-color: var(--line); margin: 0 0 18px; }
.search-form--page input[type='search'] { color: var(--ink); }
.search-form--page input[type='search']::placeholder { color: var(--muted); }
.search-form--page .search-form__ico { color: var(--muted); }
.search-form--page select { max-width: 170px; }
.header__search-note { display: none; text-align: center; color: rgba(255, 255, 255, 0.55); font-size: 0.76rem; margin-top: 5px; }

/* ---------- Бургер-панель ---------- */
.burger-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(4, 13, 8, 0.62); backdrop-filter: blur(2px);
    opacity: 0; transition: opacity 0.3s ease;
}
.burger-overlay.is-open { opacity: 1; }
.burger-panel {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 110;
    width: min(370px, 92vw);
    background: var(--head-2);
    color: var(--header-ink);
    transform: translateX(102%);
    transition: transform 0.38s cubic-bezier(0.22, 0.9, 0.3, 1);
    display: flex; flex-direction: column; gap: 6px;
    padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    box-shadow: -18px 0 50px rgba(0, 0, 0, 0.4);
}
.burger-panel.is-open { transform: translateX(0); }
.burger-panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.burger-panel__title { font-weight: 800; font-size: 1.05rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.burger-panel__nav { display: flex; flex-direction: column; }
.burger-panel__nav a {
    display: flex; align-items: center; gap: 12px;
    color: var(--header-ink); padding: 13px 10px; border-radius: 10px; font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    transition: background 0.2s ease, padding-left 0.2s ease;
}
.burger-panel__nav a i { color: var(--accent); width: 20px; text-align: center; }
.burger-panel__nav a:hover { background: rgba(255, 255, 255, 0.07); padding-left: 16px; color: #fff; }
.burger-panel__auth { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.burger-panel__social { display: flex; gap: 10px; margin-top: auto; padding-top: 18px; }
.burger-panel__social a {
    width: 42px; height: 42px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.08); color: var(--header-ink); font-size: 1.15rem;
    transition: background 0.2s ease, transform 0.2s ease;
}
.burger-panel__social a:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }

/* ---------- Строка региона в шапке (на всех устройствах) ---------- */
.header__geo {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}
.header__geo-row {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px;
    padding: 7px 16px; color: var(--header-ink);
}
.geo-label { display: inline-flex; align-items: center; gap: 7px; font-size: 0.9rem; color: rgba(255, 255, 255, 0.82); }
.geo-label b { color: #fff; font-weight: 700; }
.geo-label__ico { color: var(--accent); }
.geo-btn { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.25); color: #fff; margin-left: auto; }
.geo-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Оверлей выбора региона ---------- */
.region-overlay {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(4, 13, 8, 0.64); opacity: 0; transition: opacity 0.28s ease;
}
.region-overlay.is-open { opacity: 1; }
.region-panel {
    position: fixed; z-index: 95; left: 50%; top: 50%; transform: translate(-50%, -46%);
    width: min(720px, calc(100vw - 24px)); max-height: min(660px, calc(100vh - 32px));
    display: flex; flex-direction: column;
    background: var(--surface); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    opacity: 0; transition: opacity 0.28s ease, transform 0.28s ease;
    overflow: hidden;
}
.region-panel.is-open { opacity: 1; transform: translate(-50%, -50%); }
.region-panel__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px 8px;
}
.region-panel__head h2 { margin: 0; font-size: 1.15rem; display: inline-flex; align-items: center; gap: 9px; }
.region-panel__head h2 i { color: var(--accent); }
.region-panel__sub { margin: 0; padding: 0 18px 10px; color: var(--muted); font-size: 0.85rem; line-height: 1.45; }
.region-panel__search {
    display: flex; align-items: center; gap: 9px;
    margin: 0 18px 12px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 11px; background: var(--bg);
}
.region-panel__search i { color: var(--muted); }
.region-panel__search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 2px; font: inherit; color: var(--ink); outline: none; }
.region-list {
    overflow-y: auto; padding: 0 10px 14px;
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
}
.region-item {
    text-align: left; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
    border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.region-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.region-item.is-current { border-color: var(--accent); background: var(--accent-soft); }
.region-item.is-current::after { content: ' ✓'; color: var(--accent); font-weight: 800; }
.region-item--all { grid-column: 1 / -1; background: var(--accent-soft); }
.region-item--all i { color: var(--accent); }
.region-item__note { color: var(--muted); font-weight: 500; }

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(900px 320px at 85% -60px, var(--accent-soft), transparent 60%),
        radial-gradient(700px 260px at 5% 120%, var(--green-soft), transparent 60%),
        linear-gradient(160deg, var(--head) 0%, var(--head-2) 100%);
    color: var(--header-ink);
    border-radius: 18px;
    padding: 34px 22px 30px;
    margin: 6px 0 22px;
    position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.7), transparent 75%);
}
.hero__inner { position: relative; max-width: 900px; margin: 0 auto; text-align: center; }
.hero__title { color: #fff; font-size: clamp(1.6rem, 4.6vw, 2.6rem); margin-bottom: 10px; }
html[data-theme='dark'] .hero__title { color: var(--ink-2); }
.hero__accent { color: var(--accent); }
.hero__sub { color: rgba(255, 255, 255, 0.82); max-width: 640px; margin: 0 auto 20px; font-size: 1.02rem; }
html[data-theme='dark'] .hero__sub { color: var(--muted); }
.hero__search {
    display: flex; align-items: center; gap: 8px; max-width: 640px; margin: 0 auto 18px;
    background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 13px; padding: 6px 6px 6px 14px;
}
.hero__search i { color: rgba(255, 255, 255, 0.6); }
.hero__search input {
    flex: 1; min-width: 0; background: transparent; border: 0; color: #fff; font: inherit; padding: 10px 4px;
}
.hero__search input::placeholder { color: rgba(255, 255, 255, 0.55); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- Категории: компактная сетка без горизонтального скролла ---------- */
.cats-strip { margin: 0 0 22px; }
.cats-strip__scroll {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px;
    padding: 2px 0;
}
.cats-strip__item {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--line); color: var(--ink);
    padding: 10px 12px; border-radius: 12px; font-weight: 700; font-size: 0.88rem;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.cats-strip__item .ico { color: var(--accent); font-size: 1.15em; }
.cats-strip__item:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); color: var(--ink); }

/* ---------- Блоки ---------- */
.block { margin: 0 0 30px; }
.block__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 16px; }
.block__title { font-size: clamp(1.22rem, 2.6vw, 1.6rem); margin: 0; display: inline-flex; align-items: center; gap: 10px; }
.block__ico { font-size: 0.9em; }
.block__ico--accent { color: var(--accent); }
.block__ico--green { color: var(--green); }
.block__sub { margin: 0; color: var(--muted); font-size: 0.92rem; flex: 1 1 100%; }
.block__head .btn { margin-left: auto; }

/* ---------- Баннеры ---------- */
.banner { display: block; margin: 0 0 26px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.banner img { width: 100%; height: auto; }
.banner:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* ---------- Footer ---------- */
.site-footer {
    flex-shrink: 0; background: var(--footer); color: var(--footer-ink); margin-top: 10px;
    border-top: 1px solid rgba(126, 211, 33, 0.28);   /* кислотная линия — фокус подвал-контент */
}
html[data-theme='dark'] .site-footer { border-top-color: rgba(156, 250, 26, 0.30); }
.footer__grid {
    display: grid; gap: 26px; grid-template-columns: 1fr;
    padding: 34px 16px 26px;
}
.footer__col h3 { color: #fff; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.footer__col a { color: var(--footer-ink); font-size: 0.93rem; }
.footer__col a:hover { color: var(--accent); }
.footer__about p { font-size: 0.9rem; line-height: 1.6; margin-top: 10px; max-width: 40ch; }
.brand--footer { font-size: 1.2rem; }
.footer__social { display: flex; gap: 9px; margin-bottom: 14px; }
.footer__social a {
    width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.08); color: var(--footer-ink); font-size: 1.08rem;
    transition: background 0.2s ease, transform 0.2s ease;
}
.footer__social a:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.footer__bar { border-top: 1px solid rgba(255, 255, 255, 0.1); padding: 14px 0; }
.footer__bar-inner { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; font-size: 0.84rem; color: var(--footer-ink-dim); }
.footer__bar-note::before { content: '— '; opacity: 0.6; }

/* ---------- Иконка MAX (официальный SVG с max.ru) ---------- */
.soc-img {
    width: 1.15em; height: 1.15em; border-radius: 4px;
    display: inline-block; vertical-align: -0.2em; object-fit: contain;
}
.btn--contact .soc-img, .footer__social .soc-img, .burger-panel__social .soc-img { width: 1.3em; height: 1.3em; }

/* ---------- Honeypot-ловушка для ботов (невидима человеку) ---------- */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
}

/* ---------- Типографика статьи блога (мини-Markdown: .post__content) ---------- */
.post__content p { margin: 0 0 1em; }
.post__content p:last-child { margin-bottom: 0; }
.post__content h2 { font-size: 1.35rem; margin: 1.4em 0 0.55em; }
.post__content h3 { font-size: 1.13rem; margin: 1.25em 0 0.45em; }
.post__content ul, .post__content ol { margin: 0 0 1em; padding-left: 1.45em; }
.post__content li { margin: 0 0 0.35em; }
.post__content li > ul, .post__content li > ol { margin-top: 0.35em; }
.post__content blockquote {
    margin: 0 0 1em; padding: 12px 16px; border-left: 4px solid var(--accent);
    background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--ink-2);
}
.post__content blockquote p:last-child { margin-bottom: 0; }
.post__content code {
    font-family: 'Sarasa Mono SC', 'Consolas', 'Courier New', monospace; font-size: 0.88em;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px;
}
.post__content hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }
.post__content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 0.4em 0; }
.post__content a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
.post__content a:hover { color: var(--accent-dark); }
