/* ==========================================================================
   mundadugu.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 — see mundadugu-brand-identity.md (project root). Three brand
   colors (vermilion red, deep navy, white) plus neutral grays derived from
   them. --brand-red is for buttons/large accents; small text or small UI
   on a red background uses --brand-red-dark instead — white text on plain
   --brand-red is only ~4.0:1 contrast (just short of WCAG AA's 4.5:1 for
   normal-size text); --brand-red-dark clears ~5.4:1. See the contrast
   table in the rebrand report for the full set of ratios checked.
   ========================================================================== */

@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:    #f6f8fa;
    --surface:    #ffffff;

    --accent:      #e63946; /* brand red — buttons, link hover, badges, active states */
    --accent-dk:   #c92d3a; /* darker red — hover/pressed, and small text/UI on a red bg (see file header) */
    --accent-tint: #fdecee; /* light red tint — hover chips, subtle highlights */

    --navy:      #1d3557; /* brand navy — dark backgrounds: nav bar, footer */
    --navy-dark: #14253f; /* darker navy — mobile nav variant, pressed states */

    --ink:        #1d3557; /* all heading/body text — same hex as --navy, different role (text, not backgrounds) */
    --muted:      #4a5d78;
    --line:       #e5e9ef;

    /* Semantic states — deliberately distinct from --accent/--accent-dk so
       an error message is never visually mistaken for brand-red styling. */
    --danger:       #b3261e;
    --danger-tint:  #fdecea;
    --success:      #1e7e34;
    --success-tint: #eaf7ee;

    --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; gap: 14px; }

.visitor-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visitor-auth-link {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--accent-dk);
    text-decoration: none;
}

.visitor-auth-link:hover { text-decoration: underline; }

.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(--navy);
}

.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;
    position: relative;
}

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

/* Vermilion accent for the active/hovered nav item — a bottom bar, not a
   text-color change: plain vermilion TEXT on the navy nav bar is only
   ~3.0:1 contrast (fails WCAG even for large text), so the accent lives in
   this non-text indicator instead and the label itself stays white
   (12.4:1, safe) throughout. */
.nav-item:hover > .nav-item-row > .nav-link::after,
.nav-link.is-active::after,
.nav-link:focus-visible::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 3px;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
}

.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-dk);
    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-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

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

.article-card-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: var(--muted);
}

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

.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 — top story, the two-column "latest news" / "most read" area,
   and the per-category sections below them
   ========================================================================== */

.home-news-heading-row { margin: 32px 0 20px; }

.home-section-heading {
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
}

/* Reused by the top story's clock/views row and the latest-news list's —
   one inline SVG + the formatted text next to it. */
.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.meta-item svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---- Hero: featured story (left) + "latest from all categories" (right) ---- */

.hero-grid {
    display: grid;
    grid-template-columns: 58% 1fr;
    gap: 36px;
    align-items: start;
    margin-bottom: 44px;
}

/* Shared by the top story and every hero-right-list row — a small vermilion
   link naming the article's (top-level) category, same label style in both
   places for visual consistency. */
.hero-category-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-dk);
    letter-spacing: .2px;
    margin-bottom: 8px;
}

.hero-category-label:hover { text-decoration: underline; }

.hero-category-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.top-story-media {
    display: block;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-soft);
}

.top-story-media img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.top-story-media-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--navy);
    color: rgba(255, 255, 255, .5);
}

.top-story-media-placeholder svg { width: 64px; height: 64px; stroke: currentColor; fill: none; stroke-width: 1.3; }

.top-story-body {
    margin-top: 20px;
    /* The vermilion bar runs down the LEFT of the title+summary block as a
       whole (not just the title) — a border on the shared wrapper, not a
       per-element one. */
    border-left: 5px solid var(--accent);
    padding-left: 20px;
}

.top-story-link { display: block; color: inherit; text-decoration: none; }

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

.top-story-link:hover .top-story-title { color: var(--accent-dk); }

.top-story-excerpt {
    margin-top: 10px;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.top-story-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 14px;
    font-size: 13px;
    color: var(--muted);
}

/* ---- Hero right list: "latest from all categories" ---- */

.hero-right-list { list-style: none; }

.hero-right-item + .hero-right-item { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

/* position:relative so .hero-right-row-link (a stretched <a> covering the
   whole row) and .hero-category-label (lifted above it) can both be real,
   independently clickable links without nesting one inside the other. */
.hero-right-item {
    position: relative;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.hero-right-thumb {
    width: 150px;
    height: 85px;
    flex-shrink: 0;
    border-radius: 2px;
    object-fit: cover;
    background: var(--bg-soft);
}

.hero-right-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    color: rgba(255, 255, 255, .5);
}

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

.hero-right-body { min-width: 0; padding-top: 2px; }

.hero-right-body .hero-category-label { position: relative; z-index: 2; }

.hero-right-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-right-item:hover .hero-right-title { color: var(--accent-dk); }

.hero-right-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}

/* The real per-row link: covers the whole <li> (thumbnail + body), sits
   below the category label (z-index 2) so that label stays independently
   clickable. Empty content + aria-label carries the accessible name since
   the row's visible text (title) isn't inside this element. */
.hero-right-row-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ---- Two-column area ---- */

.home-two-col {
    display: grid;
    grid-template-columns: 65% 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 48px;
}

.latest-news-col-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--line);
}

.home-subheading {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
}

.more-news-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
}

.more-news-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: var(--ink);
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.more-news-link:hover { color: var(--accent-dk); }
.more-news-link:hover svg { stroke: var(--accent); }

.latest-news-list { list-style: none; }

.latest-news-item + .latest-news-item { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

.latest-news-link {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    color: inherit;
    text-decoration: none;
}

.latest-news-thumb {
    width: 150px;
    height: 85px;
    flex-shrink: 0;
    border-radius: 4px;
    object-fit: cover;
    background: var(--bg-soft);
}

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

.latest-news-thumb-placeholder svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.5; }

.latest-news-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding-top: 2px;
}

.latest-news-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.latest-news-link:hover .latest-news-title { color: var(--accent-dk); }

.latest-news-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--muted);
}

/* Sticky on desktop only — header-h + a little breathing room, so it never
   tucks under the fixed header. */
.most-read-col {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    background: var(--bg-soft);
    border-radius: 10px;
    padding: 22px;
}

.most-read-heading { font-size: 18px; margin-bottom: 4px; }

.most-read-list { list-style: none; }

.most-read-item + .most-read-item { border-top: 1px solid var(--line); }

.most-read-link {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 13px 0;
    color: inherit;
    text-decoration: none;
}

.most-read-rank {
    flex-shrink: 0;
    width: 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.most-read-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--ink);
}

.most-read-link:hover .most-read-title { color: var(--accent-dk); }

.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 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
}

.category-section-more svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: var(--ink);
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke .15s ease, border-color .15s ease;
}

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

/* ==========================================================================
   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-dk); }

.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-dk); border-color: var(--accent-dk); 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-dk); 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-dk); border-color: var(--accent-dk); color: #fff; }

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

.site-footer {
    background: var(--navy);
    color: #c7d0dc;
    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); }

/* Brand column carries a logo/tagline/about paragraph — needs more room
   than a plain link-list column, so it isn't an even repeat(4, 1fr). */
.footer-row-4 { grid-template-columns: 1.3fr 1fr 1fr 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;
    border-radius: 10px;
}

.footer-logo img { height: 52px; width: auto; filter: brightness(0) invert(1);}

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

.footer-about-text { font-size: 13.5px; line-height: 1.7; color: #96a6c0; 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: #b7c3d6;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-address { color: #b7c3d6; }

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

/* 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(--navy-dark); }

    .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. The
       vermilion ::after bar (defined with .nav-link, above) already marks
       this consistently at every breakpoint; mobile just keeps the text
       white, same as the default state. */
    .nav-link.is-active { color: #fff; }

    .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-4,
    .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; }

    .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; }
}

/* ==========================================================================
   Visitor auth (Account/login.php, Account/register.php) — deliberately
   NOT the admin login's split-screen design (see style.css): one centered
   card inside the normal site layout (header/nav/footer still render), so
   a reader never loses the rest of the site while signing in.
   ========================================================================== */

.auth-page { display: flex; justify-content: center; padding: 48px 20px 64px; }

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .1);
    padding: 32px 28px;
}

.auth-card h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 6px;
}

.auth-card-subtitle { font-size: 14px; color: var(--muted); margin: 0 0 24px; }

.auth-field { margin-bottom: 16px; }

.auth-field label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font: inherit;
    font-size: 14.5px;
    color: var(--ink);
    background: var(--bg-soft);
    outline: none;
}

.auth-field input:focus {
    border-color: var(--accent);
    background: var(--surface);
}

.auth-field-error {
    font-size: 12.5px;
    color: var(--danger);
    margin-top: 5px;
}

.auth-submit {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 999px;
    background: var(--accent-dk);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* Default is already --accent-dk (needed for white-text contrast at this
   button's 15px size — see file header); hover darkens one step further
   via filter rather than a fourth named red shade. */
.auth-submit:hover { filter: brightness(.9); }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 22px 0;
    font-size: 12.5px;
    color: var(--muted);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.auth-google {
    width: 100%;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
}

.auth-google:hover { background: var(--bg-soft); }

.auth-google svg { width: 18px; height: 18px; flex-shrink: 0; }

.auth-switch {
    text-align: center;
    margin-top: 22px;
    font-size: 13.5px;
    color: var(--muted);
}

.auth-switch a { color: var(--accent-dk); font-weight: 600; }

.auth-legal-note {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted);
}

.auth-legal-note a { color: var(--accent-dk); font-weight: 600; }

/* Show/hide toggle (password-toggle.js) — same markup contract as the
   admin login (style.css) and admin Users forms (admin.css); ported here
   so the SAME shared script works unchanged on the public register/login
   password fields too. */
.password-input-wrap { position: relative; }

.password-input-wrap input[type="password"],
.password-input-wrap input[type="text"] { padding-right: 46px; }

.password-toggle {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

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

.password-toggle:hover,
.password-toggle:focus-visible { background: rgba(0, 0, 0, .06); }

.password-toggle .icon-eye-off { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye-off { display: block; }

/* Flash/validation messages — shared by any public-facing form. */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 18px;
}

.alert-danger { background: var(--danger-tint); color: var(--danger); }
.alert-success { background: var(--success-tint); color: var(--success); }

/* ==========================================================================
   Comments (Layout/partials/comments-section.php) — mobile-first, same
   card/typography language as the rest of the public site.
   ========================================================================== */

.comments-section { margin-top: 36px; }

.comments-heading {
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 18px;
}

.comments-empty { color: var(--muted); font-size: 14px; }

.comment-login-prompt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 24px;
}

.comment-login-prompt p { margin: 0; font-size: 14.5px; color: var(--ink); font-weight: 600; }

.comment-login-btn { width: auto; padding: 0 22px; height: 42px; flex-shrink: 0; }

.comment-form-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 24px;
}

.comment-as { font-size: 13px; color: var(--muted); margin: 0 0 10px; }

.comment-textarea {
    width: 100%;
    min-height: 90px;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font: inherit;
    font-size: 14.5px;
    color: var(--ink);
    background: var(--bg-soft);
    resize: vertical;
    outline: none;
}

.comment-textarea:focus { border-color: var(--accent); background: var(--surface); }

.comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.comment-submit { width: auto; padding: 0 24px; height: 42px; }

.comment-textarea-small { min-height: 60px; font-size: 13.5px; }
.comment-submit-small { height: 36px; padding: 0 18px; font-size: 13px; margin-top: 8px; }

/* Honeypot — present in the DOM (so bots that don't execute CSS still find
   and fill it) but invisible and unreachable by keyboard for a real
   visitor; tabindex="-1" + aria-hidden on the wrapper keep it out of tab
   order and screen readers too. */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.comment-list,
.comment-replies {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-replies {
    margin: 4px 0 18px 54px;
    padding-left: 18px;
    border-left: 2px solid var(--line);
}

.comment-item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.comment-replies .comment-item { border-bottom: none; padding: 12px 0; }

.comment-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-tint);
    color: var(--accent-dk);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
}

.comment-body-wrap { flex: 1; min-width: 0; }

.comment-meta { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }

.comment-author { font-size: 14px; font-weight: 700; color: var(--ink); }
.comment-date { font-size: 12.5px; color: var(--muted); }

.comment-text {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--ink);
    margin: 0 0 8px;
    word-break: break-word;
}

.comment-actions { display: flex; gap: 16px; }

.comment-action-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--accent-dk);
    cursor: pointer;
}

.comment-action-btn:hover { color: var(--accent-dk); text-decoration: underline; }
.comment-delete-btn { color: var(--muted); }
.comment-delete-btn:hover { color: var(--accent-dk); }

.comment-reply-form { margin-top: 12px; }

.comments-load-more {
    display: block;
    text-align: center;
    margin-top: 10px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-dk);
    text-decoration: none;
    border: 1.5px solid var(--line);
    border-radius: 999px;
}

.comments-load-more:hover { background: var(--bg-soft); }

@media (max-width: 560px) {
    .comment-replies { margin-left: 24px; padding-left: 12px; }
    .comment-avatar { width: 34px; height: 34px; font-size: 13px; }
    .comment-login-prompt { flex-direction: column; align-items: flex-start; }
    .comment-login-btn { width: 100%; }
}

/* ==========================================================================
   Homepage — mobile (<=768px): single column everywhere. DOM order already
   puts the featured story before the hero's right list, and the
   latest-news list before the most-read box, so collapsing each two-column
   grid to one column alone gives the right visual order (featured story ->
   hero right list -> latest list -> most read -> category sections) with
   no extra reordering.
   ========================================================================== */

@media (max-width: 768px) {
    .home-section-heading { font-size: 20px; }

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

    .top-story-title { font-size: 22px; }
    .top-story-body { padding-left: 14px; border-left-width: 4px; }
    .top-story-excerpt { font-size: 14px; }

    .hero-right-thumb { width: 110px; height: 62px; }
    .hero-right-title { font-size: 15.5px; }

    .home-two-col { grid-template-columns: 1fr; gap: 36px; }

    .most-read-col {
        position: static; /* sticky is a desktop-only nicety */
        padding: 18px;
    }

    .latest-news-thumb { width: 110px; height: 62px; }
    .latest-news-title { font-size: 16px; -webkit-line-clamp: 2; }
}
