/*
Theme Name: Forestbrief
Theme URI: https://forestbrief.com/
Author: Forestbrief
Description: Modern news WordPress theme for the Forestbrief publication. Forest-green palette, dark-mode toggle, accessible and performant.
Version: 1.1
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 8.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: forestbrief
Tags: news, two-columns, custom-menu, custom-logo, featured-images, translation-ready, dark-mode, threaded-comments
*/

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */

:root {
    --accent:        #1e4d2e;
    --accent-hover:  #2a6a3e;
    --accent-soft:   #e8f0ea;
    --accent-strong: #143822;

    --heading:        #14241b;
    --text:           #1f2a23;
    --text-secondary: #4a5650;
    --text-muted:     #6b7268;
    --on-accent:      #ffffff;

    --bg:        #faf5ec;
    --bg-alt:    #f1ead9;
    --bg-soft:   #ece3d0;
    --card-bg:   #ffffff;

    --border:        #e1e5e0;
    --border-light:  #eef0ec;
    --border-strong: #c9d1cb;

    --shadow-sm: 0 1px 2px rgba(20, 36, 27, .06);
    --shadow-md: 0 4px 14px rgba(20, 36, 27, .08);
    --shadow-lg: 0 12px 40px rgba(20, 36, 27, .12);

    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   8px;
    --radius-btn:  6px;
    --radius-pill: 999px;

    --container-max: 1240px;
    --container-pad: 20px;
    --header-h:      72px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-serif: 'Source Serif Pro', Georgia, 'Times New Roman', serif;

    --transition: 180ms cubic-bezier(.2,.8,.2,1);
}

[data-theme="dark"] {
    --accent:        #4ea069;
    --accent-hover:  #65b87f;
    --accent-soft:   #1a2c20;
    --accent-strong: #75c98d;

    --heading:        #ecf2ee;
    --text:           #d8e0db;
    --text-secondary: #a7b3ac;
    --text-muted:     #8a948e;
    --on-accent:      #0e1a14;

    --bg:        #0e1a14;
    --bg-alt:    #142019;
    --bg-soft:   #18261e;
    --card-bg:   #16241c;

    --border:        #1f2f25;
    --border-light:  #1a271f;
    --border-strong: #2c3e32;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, .35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
}

/* ============================================================
   2. RESET / BASE
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
    background: #1d2327; /* matches WP admin-bar exactly to avoid flash */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover { color: var(--accent-hover); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading);
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 .5em;
}

h1 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: var(--on-accent);
    padding: 12px 18px;
    z-index: 10000;
    border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus { left: 0; color: var(--on-accent); }

.screen-reader-text {
    position: absolute !important; /* hide visually only */
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px; height: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

/* ============================================================
   3. LAYOUT PRIMITIVES
   ============================================================ */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-inline: var(--container-pad);
}

.site-main {
    flex: 1 0 auto;
    padding-block: 32px 64px;
}

.section { margin-bottom: 56px; }
.section:last-child { margin-bottom: 0; }

.section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
}

.section__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--heading);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.section__title::before {
    content: "";
    width: 4px;
    height: 24px;
    background: var(--accent);
    border-radius: 2px;
}

.section__title a { color: inherit; }
.section__title a:hover { color: var(--accent); }

.section__more {
    font-size: .9rem;
    font-weight: 600;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.section__more::after {
    content: "→";
    transition: transform var(--transition);
}
.section__more:hover::after { transform: translateX(4px); }

/* ============================================================
   4. HEADER
   ============================================================ */

.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

/* Keep the sticky header below the WP admin bar for logged-in users. */
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
    .admin-bar .site-header { top: 46px; }
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: var(--header-h);
}

.site-header__logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.site-header__logo img {
    height: 48px;
    width: auto;
}

/* The single dark-green logo asset would vanish on the dark canvas, so
   render it white via a filter in dark mode (same trick as the footer). */
[data-theme="dark"] .site-header__logo img { filter: brightness(0) invert(1); }

.site-header__nav { flex: 1; }

.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.primary-menu a {
    display: inline-block;
    padding: 10px 14px;
    font-size: .92rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .03em;
    border-radius: var(--radius-btn);
    transition: background var(--transition), color var(--transition);
}

.primary-menu a:hover,
.primary-menu .current-menu-item a {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

[data-theme="dark"] .primary-menu .current-menu-item a,
[data-theme="dark"] .primary-menu a:hover {
    color: var(--accent);
}

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

.tool-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    width: 40px; height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.tool-btn:hover {
    background: var(--accent-soft);
    color: var(--accent-strong);
    border-color: var(--accent);
}
.tool-btn svg { width: 18px; height: 18px; }

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.burger {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    width: 40px; height: 40px;
    border-radius: var(--radius-btn);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.burger svg { width: 20px; height: 20px; }

/* Search overlay */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 36, 27, .5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 18vh;
    z-index: 1000;
}
.search-overlay.is-open { display: flex; }

.search-overlay__form {
    width: min(640px, 90vw);
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.search-overlay__form input[type="search"] {
    width: 100%;
    padding: 14px 56px 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
}

.search-overlay__form input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
}

.search-overlay__close {
    position: absolute;
    top: 50%;
    right: 34px;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    width: 32px; height: 32px;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition);
}
.search-overlay__close:hover { color: var(--accent); }

/* Mobile menu drawer */
.mobile-menu {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 240ms cubic-bezier(.2,.8,.2,1);
    overflow-y: auto;
    padding: 80px 24px 32px;
}
.mobile-menu.is-open { transform: translateX(0); }
.mobile-menu__close {
    position: absolute;
    top: 18px; right: 18px;
    background: transparent;
    border: 1px solid var(--border);
    width: 40px; height: 40px;
    border-radius: var(--radius-btn);
    cursor: pointer;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Push the drawer below the WP admin bar so the close button isn't hidden. */
.admin-bar .mobile-menu { padding-top: 112px; }
.admin-bar .mobile-menu__close { top: 50px; }
@media screen and (max-width: 782px) {
    .admin-bar .mobile-menu { padding-top: 126px; }
    .admin-bar .mobile-menu__close { top: 64px; }
}
.mobile-menu ul {
    list-style: none;
    margin: 0; padding: 0;
}
.mobile-menu li { border-bottom: 1px solid var(--border); }
.mobile-menu a {
    display: block;
    padding: 14px 4px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .02em;
}
.mobile-menu a:hover { color: var(--accent); }

/* ============================================================
   5. SLIDER (TOP CATEGORY)
   ============================================================ */

.hero-slider {
    margin-bottom: 48px;
    position: relative;
}

.hero-slider__viewport {
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.hero-slider__track {
    display: flex;
    transition: transform 500ms cubic-bezier(.2,.8,.2,1);
}

.hero-slide {
    flex: 0 0 100%;
    position: relative;
    aspect-ratio: 16 / 7;
    background: var(--bg-alt);
    overflow: hidden;
    display: block;
    color: #fff;
}

.hero-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms ease;
}

.hero-slide:hover img { transform: scale(1.04); }

.hero-slide__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20, 36, 27, .92) 0%, rgba(20, 36, 27, .55) 40%, rgba(20, 36, 27, 0) 70%);
}

.hero-slide__content {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 32px 40px;
    color: #fff;
}

.hero-slide__cat {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 10px;
}

.hero-slide__title {
    color: #fff;
    margin: 0;
    font-size: clamp(1.2rem, 1rem + 1.2vw, 1.9rem);
    font-weight: 800;
    line-height: 1.25;
    max-width: 800px;
    text-shadow: 0 2px 12px rgba(0,0,0,.4);
}

.hero-slider__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.92);
    color: var(--accent-strong);
    border: 0;
    width: 44px; height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity var(--transition), background var(--transition), transform var(--transition);
}
/* Reveal arrows only when hovering the slider (or via keyboard focus). */
.hero-slider:hover .hero-slider__nav,
.hero-slider__nav:focus-visible { opacity: 1; }
.hero-slider__nav:hover { background: #fff; transform: translateY(-50%) scale(1.05); }
.hero-slider__nav--prev { left: 16px; }
.hero-slider__nav--next { right: 16px; }
.hero-slider__nav svg { width: 20px; height: 20px; }

.hero-slider__dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}
.hero-slider__dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--border-strong);
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}
.hero-slider__dot.is-active {
    background: var(--accent);
    transform: scale(1.2);
}

/* ---- Slider Style 2: 3-card carousel (shifts one card at a time) ---- */
.hero-cards {
    position: relative;
    margin-bottom: 48px;
}
.hero-cards__viewport {
    overflow: hidden;
    border-radius: var(--radius-lg);
}
.hero-cards__track {
    display: flex;
    gap: 20px; /* must match GAP in script.js */
    transition: transform 500ms cubic-bezier(.2,.8,.2,1);
    will-change: transform;
}
.hero-cards__card {
    /* 3 visible cards, 2 gaps of 20px */
    flex: 0 0 calc((100% - 40px) / 3);
    min-width: 0;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 12 / 11;
    background: var(--bg-alt);
    color: #fff;
}
.hero-cards__card img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 500ms ease;
}
.hero-cards__card:hover img { transform: scale(1.05); }
.hero-cards__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20, 36, 27, .92), rgba(20, 36, 27, .35) 55%, rgba(20, 36, 27, 0) 80%);
}
.hero-cards__content {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 20px 22px;
}
.hero-cards__cat {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 8px;
}
.hero-cards__title {
    color: #fff;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .4);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-cards__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .92);
    color: var(--accent-strong);
    border: 0;
    width: 44px; height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity var(--transition), background var(--transition), transform var(--transition);
    z-index: 5;
}
/* Reveal arrows only when hovering the carousel (or via keyboard focus). */
.hero-cards:hover .hero-cards__nav,
.hero-cards__nav:focus-visible { opacity: 1; }
.hero-cards__nav:hover { background: #fff; transform: translateY(-50%) scale(1.05); }
.hero-cards__nav--prev { left: 12px; }
.hero-cards__nav--next { right: 12px; }
.hero-cards__nav svg { width: 20px; height: 20px; }
.hero-cards__dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}
.hero-cards__dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--border-strong);
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}
.hero-cards__dot.is-active {
    background: var(--accent);
    transform: scale(1.2);
}

/* ============================================================
   6. CATEGORY BLOCK (homepage)
   ============================================================ */

.cat-block { margin-bottom: 56px; }

.cat-block__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 28px;
}

/* Featured card (left) */
.featured-card {
    display: block;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
    aspect-ratio: 16 / 11;
    color: #fff;
}

.featured-card:hover { box-shadow: var(--shadow-lg); }

.featured-card img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 500ms ease;
}
.featured-card:hover img { transform: scale(1.04); }

.featured-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20, 36, 27, .92), rgba(20, 36, 27, .35) 55%, rgba(20, 36, 27, 0) 80%);
}

.featured-card__content {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 24px 26px;
}

.featured-card__title {
    color: #fff;
    margin: 0 0 8px;
    font-size: clamp(1.1rem, .95rem + .6vw, 1.4rem);
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 1px 8px rgba(0,0,0,.4);
}

.featured-card__excerpt {
    color: rgba(255,255,255,.92);
    margin: 0;
    font-size: .92rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-card__meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.featured-card__meta time {
    color: rgba(255,255,255,.8);
    font-size: .82rem;
}

/* Compact list (right) */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.post-list-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 14px;
    padding: 10px;
    border-radius: var(--radius-md);
    transition: background var(--transition);
    color: var(--text);
}

.post-list-item:hover {
    background: var(--bg-alt);
    color: var(--text);
}

.post-list-item__img {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-alt);
}
.post-list-item__img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 400ms ease;
}
.post-list-item:hover .post-list-item__img img { transform: scale(1.06); }

.post-list-item__title {
    margin: 0;
    font-size: .96rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--heading);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-list-item:hover .post-list-item__title { color: var(--accent); }

.post-list-item__date {
    display: block;
    margin-top: 4px;
    font-size: .78rem;
    color: var(--text-muted);
}

/* ============================================================
   7. ARCHIVE / SEARCH / 404
   ============================================================ */

.page-head {
    margin-bottom: 32px;
    padding-bottom: 22px;
    border-bottom: 2px solid var(--accent);
}
.page-head__title {
    margin: 0;
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem);
    color: var(--heading);
}
.page-head__desc {
    margin: 12px 0 0;
    color: var(--text-secondary);
    max-width: 720px;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

.post-card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
    color: var(--text);
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    transform: translateY(-2px);
    color: var(--text);
}

.post-card__img {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-alt);
}
.post-card__img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 500ms ease;
}
.post-card:hover .post-card__img img { transform: scale(1.05); }

.post-card__body {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card__cat {
    display: inline-block;
    color: var(--accent);
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 8px;
}

.post-card__title {
    margin: 0 0 10px;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--heading);
}
.post-card:hover .post-card__title { color: var(--accent); }

.post-card__excerpt {
    color: var(--text-secondary);
    font-size: .92rem;
    margin: 0 0 14px;
    flex: 1;
}

.post-card__date {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* Load more button */
.load-more-wrap {
    margin-top: 40px;
    text-align: center;
}
.load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    border: 0;
    padding: 12px 28px;
    border-radius: var(--radius-pill);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}
.load-more:hover { background: var(--accent-hover); transform: translateY(-1px); }
.load-more[hidden] { display: none; }
.load-more.is-loading { opacity: .6; pointer-events: none; }

/* Pagination fallback */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.pagination .page-numbers {
    padding: 8px 14px;
    border-radius: var(--radius-btn);
    color: var(--text);
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: .9rem;
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ============================================================
   8. SINGLE POST
   ============================================================ */

.article {
    max-width: 950px;
    margin: 0 auto;
}

.article__header { margin-bottom: 28px; }

.article__meta-top {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    font-size: .85rem;
}

.article__cat {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent-strong);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .75rem;
    transition: background var(--transition), color var(--transition);
}
.article__cat:hover { background: var(--accent); color: #fff; }

[data-theme="dark"] .article__cat { color: var(--accent); }
[data-theme="dark"] .article__cat:hover { color: var(--on-accent); background: var(--accent); }

.article__date { color: var(--text-muted); }

.article__title {
    font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem);
    line-height: 1.2;
    margin: 0 0 16px;
    color: var(--heading);
    font-weight: 800;
}

.article__lead {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 22px;
}

.article__feature-img {
    margin: 0 0 28px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--bg-alt);
}
.article__feature-img img {
    width: 100%; height: 100%; object-fit: cover;
}

.article__caption {
    margin-top: 8px;
    font-size: .85rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

.article__content {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text);
}

.article__content > * + * { margin-top: 1em; }

.article__content h2 {
    margin-top: 1.6em;
    font-size: 1.5rem;
    color: var(--heading);
}
.article__content h3 {
    margin-top: 1.4em;
    font-size: 1.2rem;
    color: var(--heading);
}

.article__content a {
    color: var(--accent);
    border-bottom: 1px solid currentColor;
}
.article__content a:hover { color: var(--accent-hover); }

.article__content blockquote {
    margin: 1.5em 0;
    padding: 16px 22px;
    border-left: 4px solid var(--accent);
    background: var(--bg-alt);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--text-secondary);
}

.article__content img {
    border-radius: var(--radius-md);
    margin-block: 1em;
}

.article__content figure { margin: 1.4em 0; }
.article__content figcaption {
    font-size: .85rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 6px;
    font-style: italic;
}

.article__content ul,
.article__content ol {
    padding-left: 1.4em;
    margin: 1em 0;
}
.article__content li + li { margin-top: 6px; }

/* Tags */
.article-tags {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.article-tags__title {
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 8px 0 0;
    font-size: .9rem;
}
.article-tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--bg-alt);
    border-radius: var(--radius-pill);
    font-size: .82rem;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
}
.article-tag:hover { background: var(--accent); color: #fff; }

/* Author */
/* Share */
.article-share {
    margin: 32px 0;
    padding: 18px 22px;
    background: var(--bg-alt);
    border-radius: var(--radius-md);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}
.article-share__title {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: .9rem;
}
.article-share__list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.article-share__btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}
.article-share__btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-2px);
}
.article-share__btn--facebook:hover  { background: #1877f2; border-color: #1877f2; }
.article-share__btn--telegram:hover  { background: #229ed9; border-color: #229ed9; }
.article-share__btn--viber:hover     { background: #7360f2; border-color: #7360f2; }
.article-share__btn--x:hover         { background: #000;    border-color: #000;    }
.article-share__btn--copied {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Related news */
.related-news { margin-top: 40px; }
.related-news__title {
    margin: 0 0 22px;
    font-size: 1.3rem;
    color: var(--heading);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
}
.related-news__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    color: var(--text);
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.related-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    transform: translateY(-2px);
    color: var(--text);
}
.related-card__img {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-alt);
}
.related-card__img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 500ms ease;
}
.related-card:hover .related-card__img img { transform: scale(1.05); }
.related-card__title {
    margin: 0;
    padding: 14px 16px 18px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--heading);
}
.related-card:hover .related-card__title { color: var(--accent); }

/* ============================================================
   9. FOOTER
   ============================================================ */

.site-footer {
    background: var(--accent-strong);
    color: rgba(255, 255, 255, .85);
    padding: 48px 0 0;
    margin-top: auto;
}

[data-theme="dark"] .site-footer {
    background: #0a1410;
    border-top: 1px solid var(--border);
}

.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--accent-soft); }

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 32px;
}

.footer-brand img { height: 60px; width: auto; margin-bottom: 14px; filter: brightness(0) invert(1); }
.footer-brand p { color: rgba(255,255,255,.7); font-size: .92rem; margin: 0; max-width: 360px; }

.footer-col h3 {
    color: #fff;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,.18);
}

.footer-menu {
    list-style: none;
    margin: 0; padding: 0;
}
.footer-menu li + li { margin-top: 8px; }
.footer-menu a {
    color: rgba(255,255,255,.85);
    font-size: .92rem;
    display: inline-block;
    padding: 2px 0;
    transition: color var(--transition), padding var(--transition);
}
.footer-menu a:hover {
    color: #fff;
    padding-left: 6px;
}

.footer-social {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    gap: 10px;
}
.footer-social a {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background var(--transition), transform var(--transition);
}
.footer-social a:hover {
    background: rgba(255,255,255,.22);
    transform: translateY(-2px);
}
.footer-social svg { width: 18px; height: 18px; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.15);
    padding: 20px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: .85rem;
    color: rgba(255,255,255,.7);
}

/* ============================================================
   10. GO-TO-TOP
   ============================================================ */

.go-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--transition), transform var(--transition), background var(--transition);
    z-index: 90;
    pointer-events: none;
}
.go-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.go-top:hover { background: var(--accent-hover); }
.go-top svg { width: 18px; height: 18px; }

/* ============================================================
   11. COMMENTS / FORMS
   ============================================================ */

.comments {
    max-width: 950px;
    margin: 48px auto 0;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.comment-list li {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.comment-list .children {
    list-style: none;
    padding-left: 24px;
    margin-top: 12px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 14px;
}
.comment-form .submit {
    background: var(--accent);
    color: #fff;
    border: 0;
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    cursor: pointer;
}
.comment-form .submit:hover { background: var(--accent-hover); }

/* ============================================================
   12. UTILITIES
   ============================================================ */

.no-results {
    padding: 32px;
    text-align: center;
    color: var(--text-secondary);
    background: var(--bg-alt);
    border-radius: var(--radius-md);
}

/* Ad banner wrapper — centers the ad content and spaces it from neighbours. */
.ad-banner {
    margin: 32px auto;
    text-align: center;
}
.ad-banner img { display: inline-block; margin: 0 auto; }

/* Rounded corners on banner images to match the news cards. */
.aw-ads-banner img { border-radius: 8px; }

/* ============================================================
   13. RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    :root { --header-h: 64px; }

    .site-header__nav { display: none; }
    .burger { display: inline-flex; }

    .cat-block__grid { grid-template-columns: 1fr; gap: 22px; }

    .featured-card { aspect-ratio: 16 / 10; }

    .hero-slide { aspect-ratio: 16 / 10; }
    .hero-slide__content { padding: 22px 24px; }

    /* Move slider controls below the slide, on one line with the dots, so
       the arrows never overlap long titles or the category badge. */
    .hero-slider {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 14px;
    }
    .hero-slider__viewport { flex: 0 0 100%; }
    .hero-slider__nav {
        position: static;
        transform: none;
        width: 40px; height: 40px;
        background: var(--accent);
        color: #fff;
        box-shadow: none;
        opacity: 1; /* always visible as static controls below the slider */
    }
    .hero-slider__nav:hover { background: var(--accent-hover); transform: scale(1.05); }
    .hero-slider__nav--prev { order: 1; }
    .hero-slider__dots { order: 2; margin-top: 0; }
    .hero-slider__nav--next { order: 3; }

    /* Style 2: 2 visible cards on tablet; controls below the carousel.
       Wider 16/11 ratio on mobile so the full-width card isn't too tall. */
    .hero-cards__card { flex: 0 0 calc((100% - 20px) / 2); aspect-ratio: 16 / 11; }
    .hero-cards {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 14px;
    }
    .hero-cards__viewport { flex: 0 0 100%; }
    .hero-cards__nav {
        position: static;
        transform: none;
        width: 40px; height: 40px;
        background: var(--accent);
        color: #fff;
        box-shadow: none;
        opacity: 1; /* always visible as static controls below the carousel */
    }
    .hero-cards__nav:hover { background: var(--accent-hover); transform: scale(1.05); }
    .hero-cards__nav--prev { order: 1; }
    .hero-cards__dots { order: 2; margin-top: 0; }
    .hero-cards__nav--next { order: 3; }
}

@media (max-width: 600px) {
    :root { --container-pad: 14px; }

    .site-header__inner { gap: 12px; }
    .site-header__logo img { height: 38px; }

    .site-main { padding-block: 24px 48px; }
    .section { margin-bottom: 40px; }

    .section__title { font-size: 1.2rem; }

    .archive-grid { grid-template-columns: 1fr; gap: 18px; }

    .post-list-item { grid-template-columns: 96px 1fr; gap: 12px; }

    .featured-card__content { padding: 18px 20px; }

    .footer-grid { grid-template-columns: 1fr; gap: 28px; }

    .article-share { padding: 14px 16px; }
    .go-top { right: 14px; bottom: 14px; }

    .related-news__grid { grid-template-columns: 1fr; }

    /* Style 2: 1 visible card on phones. */
    .hero-cards__card { flex: 0 0 100%; }
}

/* ============================================================
   14. PRINT
   ============================================================ */

@media print {
    .site-header,
    .site-footer,
    .go-top,
    .article-share,
    .article-tags,
    .related-news,
    .hero-slider,
    .load-more,
    .load-more-wrap,
    .pagination,
    .burger,
    .tool-btn,
    .mobile-menu,
    .search-overlay { display: none !important; }

    body { background: #fff; color: #000; }
    .article { max-width: 100%; }
    .article__content a::after { content: " (" attr(href) ")"; font-size: .85em; color: #555; }
}
