/* ==========================================================================
   etharam.com — PUBLIC site styles (visitors, not the admin panel).
   Deliberately separate from admin.css and its own file, per the same
   "separate stylesheet per surface" principle already used there.

   PALETTE
   A deep editorial maroon/crimson accent on a clean white/warm-white
   background — reads as a credible, serious news outlet (the kind of
   confident red-on-white used by many respected papers and portals) rather
   than the admin panel's softer yellow-accent utility-tool look. One
   accent color, used consistently, rather than a busy multi-color scheme.
   ========================================================================== */

@font-face {
    font-family: 'Noto Sans Telugu';
    src: url('fonts/noto-sans-telugu/NotoSansTelugu-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Noto Sans Telugu';
    src: url('fonts/noto-sans-telugu/NotoSansTelugu-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Noto Sans Telugu';
    src: url('fonts/noto-sans-telugu/NotoSansTelugu-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Noto Sans Telugu';
    src: url('fonts/noto-sans-telugu/NotoSansTelugu-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg:         #ffffff;
    --bg-soft:    #f7f5f1;
    --surface:    #ffffff;
    --accent:     #9c2b2b;
    --accent-dk:  #7a2020;
    --accent-tint: #faeceb;
    --ink:        #211f1d;
    --muted:      #6b6560;
    --line:       #e8e2d8;
    --header-h:   72px;
    /* Fixed height enforced on the mobile scrollable category bar (see the
       max-width query) — .submenu's fixed positioning there is anchored off
       header-h + this, so it has to be a real, not approximate, value. */
    --mobile-nav-h: 48px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    /* Noto Sans Telugu first — it carries both Telugu and a usable Latin
       set, so Telugu/English mixed text (category names next to English
       UI chrome) doesn't visibly switch typefaces mid-line. Poppins and
       system sans are the fallback for anything it's missing. */
    font-family: 'Noto Sans Telugu', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Visually hidden but present for screen readers/SEO — used for the
   homepage's page-level <h1> (see Pages/home.php): real content, just not
   meant to visually compete with the hero article below it. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

img { max-width: 100%; display: block; }

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: relative; /* anchors .search-panel below */
    /* Neutral on every width — an earlier mobile-only override made this bar
       var(--accent) (red), which combined with the logo's own red artwork
       read as too much red around the logo; removed rather than swapped for
       a different color, per the actual fix requested. */
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.site-header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-brand { display: inline-flex; align-items: center; }

.site-logo { height: 56px; width: auto; }

.site-header-actions { display: flex; align-items: center; }

.search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: none;
    color: var(--ink);
    cursor: pointer;
}

.search-toggle svg {
    width: 21px;
    height: 21px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.search-toggle:hover,
.search-toggle:focus-visible,
.search-toggle.is-open { background: var(--accent-tint); color: var(--accent-dk); }

/* Dropdown panel opened by .search-toggle; [hidden] is the closed state
   (site.js toggles the attribute, not a class), so no display:none rule is
   needed here for it. */
.search-panel {
    position: absolute;
    top: 100%;
    right: 20px;
    z-index: 80;
    width: 340px;
    max-width: calc(100% - 40px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .14);
    padding: 14px;
}

.search-form { display: flex; gap: 8px; }

.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    background: var(--bg-soft);
}

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

.search-form-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

.search-form-submit:hover { background: var(--accent-dk); }

.search-form-submit svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* The same search-form partial, placed inline at the top of the results
   page rather than in the dropdown panel. */
.search-page-form { max-width: 480px; margin: 4px 0 28px; }

.site-name-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -.2px;
}

/* ==========================================================================
   Nav
   ========================================================================== */

.site-nav {
    background: var(--accent);
}

.site-nav-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 48px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

.nav-item { position: relative; }

.nav-item-row { display: flex; align-items: stretch; }

.nav-link {
    display: flex;
    align-items: center;
    padding: 13px 16px;
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    white-space: nowrap;
}

.nav-item:hover > .nav-item-row > .nav-link,
.nav-link:focus-visible {
    background: rgba(255, 255, 255, .12);
}

.nav-toggle-sub {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle-sub svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .15s ease;
}

.nav-item.has-children.is-open > .nav-item-row .nav-toggle-sub svg {
    transform: rotate(180deg);
}

/* Dropdown — hidden by default; revealed by hover, keyboard focus-within,
   or the .is-open class the toggle button applies via JS (the touch/click
   fallback — see nav.php's docblock and site.js). Desktop: floating panel. */
.submenu {
    display: none;
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .12);
    padding: 8px;
    z-index: 60;
}

.nav-item.has-children:hover > .submenu,
.nav-item.has-children:focus-within > .submenu,
.nav-item.has-children.is-open > .submenu {
    display: block;
}

.submenu-link {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
}

.submenu-link:hover,
.submenu-link:focus-visible {
    background: var(--accent-tint);
    color: var(--accent-dk);
}

.submenu-connector {
    color: var(--muted);
    margin-right: 4px;
}

/* ==========================================================================
   Main content
   ========================================================================== */

.site-main { min-height: 50vh; padding: 36px 0 56px; }

.page-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
}

.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 15px;
    background: var(--bg-soft);
    border-radius: 14px;
}

/* ==========================================================================
   Article cards (homepage teaser grid)
   ========================================================================== */

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.article-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease;
}

.article-card:hover {
    box-shadow: 0 16px 34px rgba(0, 0, 0, .1);
    transform: translateY(-2px);
}

.article-card-thumb {
    width: 100%;
    height: 170px;
    object-fit: cover;
    background: var(--bg-soft);
}

.article-card-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.article-card-thumb-placeholder svg {
    width: 40px;
    height: 40px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.article-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }

.article-card-category {
    align-self: flex-start;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--accent);
    background: var(--accent-tint);
    padding: 4px 10px;
    border-radius: 999px;
}

.article-card-title {
    font-size: 16.5px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
}

.article-card-date { font-size: 12.5px; color: var(--muted); }

.article-card-excerpt {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   Homepage — hero (featured article + "latest news" sidebar) and the
   per-category sections below it
   ========================================================================== */

.hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
    margin: 36px 0 52px;
}

.hero-featured {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease;
}

.hero-featured:hover {
    box-shadow: 0 20px 44px rgba(0, 0, 0, .12);
    transform: translateY(-2px);
}

.hero-featured-thumb {
    width: 100%;
    height: 360px;
    object-fit: cover;
    background: var(--bg-soft);
}

.hero-featured-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.hero-featured-thumb-placeholder svg {
    width: 56px;
    height: 56px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.hero-featured-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hero-featured-title {
    font-size: 27px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ink);
}

.hero-featured-excerpt {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.6;
}

.hero-sidebar {
    background: var(--bg-soft);
    border-radius: 16px;
    padding: 20px;
    height: fit-content;
}

.hero-sidebar-heading {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--accent);
    margin-bottom: 16px;
}

.hero-sidebar-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-sidebar-item + .hero-sidebar-item {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.hero-sidebar-link {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.hero-sidebar-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface);
}

.hero-sidebar-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.hero-sidebar-thumb-placeholder svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.hero-sidebar-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.hero-sidebar-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-sidebar-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--muted);
}

.hero-sidebar-category { color: var(--accent); font-weight: 600; }

.category-section { margin-bottom: 52px; }

.category-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--line);
}

.category-section-title {
    font-size: 21px;
    font-weight: 700;
    color: var(--ink);
}

.category-section-more {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

.category-section-more:hover { color: var(--accent-dk); }

/* ==========================================================================
   Breadcrumb (category archive page)
   ========================================================================== */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 28px 0 10px;
    font-size: 13.5px;
    color: var(--muted);
}

.breadcrumb-link { color: var(--muted); font-weight: 500; }

.breadcrumb-link:hover { color: var(--accent); }

.breadcrumb-sep { color: var(--line); }

.breadcrumb-current { color: var(--ink); font-weight: 600; }

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 40px 0 16px;
}

.pagination li a,
.pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 6px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    border: 1px solid var(--line);
}

.pagination li a:hover { background: var(--accent-tint); color: var(--accent-dk); border-color: var(--accent-tint); }

.pagination li.active a { background: var(--accent); border-color: var(--accent); color: #fff; }

.pagination li.disabled span { color: var(--muted); background: var(--bg-soft); }

/* ==========================================================================
   Article detail page
   ========================================================================== */

.article-page {
    display: flex;
    flex-direction: column;
    gap: 56px;
    padding-top: 28px;
    padding-bottom: 16px;
}

.article-detail {
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
}

.article-detail-image {
    width: 100%;
    /* aspect-ratio reserves the box's height from layout (before the image
       loads) using the width alone — the actual CLS fix; max-height is a
       secondary cap so a very tall source image still can't blow past it. */
    aspect-ratio: 16 / 9;
    max-height: 460px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 20px;
}

.article-detail-title {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.35;
    margin: 14px 0 14px;
    color: var(--ink);
}

.article-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: var(--muted);
    margin-bottom: 22px;
}

.article-detail-meta-sep { color: var(--line); }

.article-detail-author { font-weight: 600; color: var(--ink); }

.article-detail-views {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.article-detail-views svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Readable long-form Telugu body copy — generous line-height and a slightly
   larger base size than the UI chrome, since this is the text visitors are
   actually here to read. */
.article-body {
    font-size: 17px;
    line-height: 1.9;
    color: var(--ink);
}

.article-body p { margin-bottom: 20px; }

.article-body h2, .article-body h3 {
    font-weight: 700;
    line-height: 1.4;
    margin: 32px 0 14px;
    color: var(--ink);
}

.article-body h2 { font-size: 23px; }
.article-body h3 { font-size: 19px; }

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
}

.article-body ul, .article-body ol { margin: 0 0 20px 22px; }
.article-body li { margin-bottom: 8px; }

.article-body a { color: var(--accent); text-decoration: underline; }

.article-body blockquote {
    border-left: 4px solid var(--accent);
    background: var(--bg-soft);
    padding: 14px 20px;
    margin: 24px 0;
    color: var(--muted);
    border-radius: 0 10px 10px 0;
}

/* ==========================================================================
   Social share buttons
   ========================================================================== */

.share-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 22px 0;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.share-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    margin-right: 2px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.share-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.share-btn:hover { background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent-dk); }

.share-btn.is-copied { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--ink);
    color: #d9d4cd;
    margin-top: 40px;
}

.site-footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 44px 20px 32px;
}

/* Two rows of equal columns: 3 across, then 2 across (all stack at <=900px). */
.footer-row { display: grid; gap: 32px; }

.footer-row-3 { grid-template-columns: repeat(3, 1fr); }

.footer-row-2 { grid-template-columns: repeat(2, 1fr); }

.footer-row + .footer-row {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

/* min-width:0 lets long link text wrap/clamp instead of stretching its column. */
.footer-col { min-width: 0; }

.footer-brand-link { display: inline-block; }

.footer-brand { display: block; font-size: 20px; font-weight: 700; color: #fff; }

/* The logo sits on a light chip: it's designed for the white header, and a
   dark logo would vanish against the dark footer. */
.footer-logo {
    display: inline-flex;
    background: #fff;
    padding: 8px 12px;
    border-radius: 10px;
}

.footer-logo img { height: 52px; width: auto; }

.footer-tagline { font-size: 14px; color: #b8b2a8; margin-top: 12px; }

.footer-about-text { font-size: 13.5px; line-height: 1.7; color: #a39d92; margin-top: 10px; }

.footer-social { display: flex; gap: 10px; }

.footer-social-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.footer-social-link:hover { background: var(--accent); }

.footer-social-link svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Larger and bolder than the links under it, with a short accent rule. No
   uppercase/letter-spacing: neither means anything for Telugu, and
   letter-spacing can pull apart Telugu conjunct shaping. */
.footer-heading {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
    margin-bottom: 16px;
}

.footer-heading::after {
    content: '';
    display: block;
    width: 28px;
    height: 3px;
    margin-top: 8px;
    border-radius: 2px;
    background: var(--accent);
}

.footer-link-list { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }

.footer-link-list a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.footer-link-list a:hover,
.footer-contact-list a:hover { color: #fff; }

.footer-contact-list { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }

.footer-contact-list li { display: flex; align-items: flex-start; gap: 10px; }

.footer-contact-list svg {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    margin-top: 3px;
    stroke: #b8b2a8;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-address { color: #b8b2a8; }

.site-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding: 16px 20px;
    text-align: center;
    font-size: 12.5px;
    color: #a39d92;
}

/* Developer credit under the copyright line: smaller and more muted (the
   footer's own text colour at reduced opacity, no new colour), but the link
   is underlined so it reads as tappable, and brightens on hover/focus. */
.footer-credit {
    font-size: 11.5px;
    color: rgba(217, 212, 205, .6);
}

.footer-copyright + .footer-credit { margin-top: 6px; }

.footer-credit a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-credit a:hover,
.footer-credit a:focus-visible { color: #fff; }

/* ==========================================================================
   Responsive — hamburger + accordion submenus below 900px
   ========================================================================== */

@media (max-width: 900px) {
    /* Mobile header: the top bar (logo + search) stays the same neutral
       background as desktop — see the color-correction note above .site-header
       further up this file — with the always-visible, horizontally
       scrollable single-row category bar below it, in place of the old
       hamburger + stacked accordion menu. .search-toggle also needs no
       override here any more: its desktop rule (var(--ink), i.e. black)
       already applies on the now-matching white background. Nothing in
       this file above this query is touched, so desktop is unaffected.
       .site-name-text keeps its desktop rule too — the same dormant
       no-logo fallback that was always red-on-white on desktop. */

    .site-nav { background: var(--accent-dk); }

    .site-nav-inner { padding: 0; }

    /* The hamburger toggle has nothing left to open — the row below is
       always visible — so it's just hidden rather than removed from the
       page (site.js's listener on it becomes an inert no-op). */
    .nav-toggle { display: none; }

    .nav-menu {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        width: 100%;
        height: var(--mobile-nav-h);
        padding: 0 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }

    .nav-menu::-webkit-scrollbar { display: none; } /* Chrome/Safari/Edge */

    .nav-item { width: auto; flex: 0 0 auto; }

    .nav-item-row { width: auto; }

    .nav-link {
        width: auto;
        padding: 8px 12px;
        font-size: 14px;
        gap: 6px;
    }

    /* Home: icon-only here (the label stays in the DOM/visible on desktop
       for accessibility and SEO — see nav.php). */
    .nav-home-icon {
        display: inline-flex;
        width: 18px;
        height: 18px;
        stroke: currentColor;
        fill: none;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        flex-shrink: 0;
    }

    .nav-home-label { display: none; }

    /* The visitor's current top-level category (or the parent of whichever
       sub-category they're actually on) — see nav.php's $isActive. */
    .nav-link.is-active {
        color: #fff;
        text-decoration: underline;
        text-underline-offset: 4px;
        text-decoration-thickness: 2px;
    }

    .nav-toggle-sub { width: 32px; height: 32px; }

    /* Submenu: a fixed-position card below the two bars, not positioned
       relative to its own (horizontally scrolling) nav-item — an
       absolutely-positioned dropdown would be clipped by nav-menu's own
       overflow-x:auto, since a scrolling ancestor clips overflow on BOTH
       axes for its descendants, per spec. position:fixed escapes that
       clipping entirely, at the cost of the panel staying put on screen
       (not scrolling away) if the page is scrolled while it's open — an
       accepted, common trade-off for a mobile dropdown, and header+nav
       aren't sticky here, so that's the only time it applies. */
    .submenu {
        display: none;
        position: fixed;
        top: calc(var(--header-h) + var(--mobile-nav-h));
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - var(--header-h) - var(--mobile-nav-h) - 16px);
        overflow-y: auto;
        margin: 0;
        z-index: 65;
    }

    /* On touch/small screens, only the explicit .is-open toggle opens a
       submenu — :hover on a touchscreen is unreliable/sticky, so it's
       intentionally not relied on here (focus-within still applies, for
       anyone tabbing through with a keyboard on a small viewport). */
    .nav-item.has-children:hover > .submenu { display: none; }
    .nav-item.has-children:focus-within > .submenu,
    .nav-item.has-children.is-open > .submenu { display: block; }

    /* Footer: every column stacks into one, in reading order. */
    .footer-row-3,
    .footer-row-2 { grid-template-columns: 1fr; gap: 28px; }

    .footer-row + .footer-row { margin-top: 28px; padding-top: 28px; }

    /* Bottom bar: copyright + developer credit share one centered row,
       divided by a bullet, and wrap onto two centered lines only when they
       don't fit. Desktop keeps the stacked layout.
       The spacing is a constant column-gap (it only applies between items on
       the SAME row, so a wrapped line stays exactly centered). The bullet is
       absolutely positioned in that gap, so it takes no space; site.js hides
       it (visibility) when the items wrap. Because showing/hiding it never
       changes the layout, the "did it wrap?" check can't feed back on itself. */
    .site-footer-bottom {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        column-gap: 24px;
        row-gap: 6px;
    }

    .footer-copyright + .footer-credit { margin-top: 0; }

    .footer-credit { position: relative; }

    .footer-credit::before {
        content: '•';
        position: absolute;
        left: -12px;
        top: 0;
        transform: translateX(-50%);
    }

    .site-footer-bottom.is-wrapped .footer-credit::before { visibility: hidden; }

    /* Hero collapses to a single column — featured article on top, the
       "latest news" list stacked below it instead of beside it. */
    .hero { grid-template-columns: 1fr; margin: 20px 0 40px; }

    .hero-featured-thumb { height: 220px; }

    .hero-featured-title { font-size: 21px; }

    .hero-featured-body { padding: 18px; }

    .article-page { gap: 40px; padding-top: 12px; }

    .article-detail-image { max-height: 240px; border-radius: 12px; }

    .article-detail-title { font-size: 22px; }

    .article-body { font-size: 16px; }

    .share-bar { gap: 8px; }

    .share-label { width: 100%; margin-bottom: 2px; }
}
