/*
Theme Name: Canada Visa Updates
Theme URI: https://canadavisaupdates.com
Author: Canada Visa Updates
Author URI: https://canadavisaupdates.com
Description: A newspaper-style WordPress theme for Canadian immigration news, IRCC updates, Express Entry draws, and visa policy changes. Features a breaking news ticker, category navigation, and admin-friendly content management.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: canadavisaupdates
Tags: news, newspaper, immigration, canada, blog, custom-menu, featured-images, post-formats, sticky-post, threaded-comments
*/

/* ============================================================
   ROOT TOKENS
============================================================ */
:root {
    --maple:       #C41E3A;
    --maple-dark:  #8B1526;
    --maple-light: #FDF0F2;
    --ink:         #1A1A1A;
    --newsprint:   #FAF8F4;
    --warm-gray:   #6B6560;
    --rule:        #D4CFC8;
    --accent-blue: #185FA5;
    --display:     'Playfair Display', Georgia, serif;
    --body:        'Source Serif 4', Georgia, serif;
    --ui:          'Inter', system-ui, sans-serif;
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--body);
    background: var(--newsprint);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ============================================================
   TYPOGRAPHY
============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--display);
    font-weight: 700;
    line-height: 1.15;
    color: var(--ink);
}

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

.entry-content {
    overflow: visible;        /* never clip content */
    width: 100%;
}
.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content blockquote {
    margin-bottom: 1.2em;
}
.entry-content ul, .entry-content ol {
    padding-left: 1.5em;
    list-style: revert;
}
.entry-content h2 { font-size: 26px; margin: 1.8em 0 0.6em; }
.entry-content h3 { font-size: 20px; margin: 1.4em 0 0.5em; }
.entry-content blockquote {
    border-left: 3px solid var(--maple);
    padding-left: 18px;
    color: var(--warm-gray);
    font-style: italic;
}
.entry-content a { color: var(--maple); text-decoration: underline; }

/* ============================================================
   LAYOUT
============================================================ */
.page-wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-rule {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 28px 0 18px;
}
.section-rule .section-label {
    font-family: var(--ui);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--maple);
    white-space: nowrap;
}
.section-rule .rule-line {
    flex: 1;
    height: 1px;
    background: var(--ink);
}

/* ============================================================
   MASTHEAD
============================================================ */
.masthead-top {
    background: var(--ink);
    color: #EEE8E0;
    font-family: var(--ui);
    font-size: 11px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 24px;
    gap: 12px;
    flex-wrap: wrap;
}
.masthead-top a { color: #AAA49C; margin-left: 14px; transition: color .15s; }
.masthead-top a:hover { color: #EEE8E0; }
.top-links { display: flex; align-items: center; flex-shrink: 0; }
.top-sep { color: #555; margin: 0 6px; }

/* Social media icons — shared between header and footer */
.social-links { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #AAA49C;
    transition: color .15s, background .15s;
}
.social-link svg { width: 14px; height: 14px; }

/* Header variant: sits in the dark top bar */
.social-links--header {
    margin-left: 14px;
    padding-left: 14px;
    border-left: 1px solid #444;
}
.social-links--header .social-link:hover { color: #fff; background: rgba(255,255,255,0.12); }

/* Footer variant: sits under the brand column text */
.social-links--footer { margin-top: 12px; }
.social-links--footer .social-link { background: rgba(255,255,255,0.06); }
.social-links--footer .social-link:hover { color: #EEE8E0; background: var(--maple); }

@media (max-width: 640px) {
    .social-links--header { margin-left: 8px; padding-left: 8px; }
}

.cvu-city-time { color: #AAA49C; font-size: 9px; }

/* Site logo in masthead */
.masthead-logo-link { display: inline-block; text-decoration: none; }
.site-logo-img {
    max-height: 80px;
    max-width: 380px;
    display: block;
    margin: 0 auto;
}

.masthead-main {
    background: var(--newsprint);
    border-bottom: 3px double var(--ink);
    text-align: center;
    padding: 16px 24px 12px;
}

/* Site name text fallback (shown only if no logo) */
.site-flag {
    font-family: var(--display);
    font-size: 52px;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--ink);
    line-height: 1;
}
.site-flag .maple-leaf { color: var(--maple); }

/* Bundled / uploaded header logo */
.masthead-logo-link { display: inline-block; line-height: 0; max-width: 100%; }
.site-logo-img {
    max-height: 90px;
    max-width: min(480px, 100%);
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* More Updates grid (columns set by --mu-cols from admin setting) */
.more-updates-grid {
    display: grid;
    grid-template-columns: repeat(var(--mu-cols, 4), 1fr);
    gap: 0;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 24px;
}

.site-tagline {
    font-family: var(--ui);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--warm-gray);
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.site-tagline::before, .site-tagline::after {
    content: '';
    display: inline-block;
    height: 1px;
    width: 60px;
    background: var(--rule);
}

/* ============================================================
   PRIMARY NAV
============================================================ */
.primary-nav {
    background: var(--maple);
    position: sticky;
    top: 0;
    z-index: 100;
}
.primary-nav .nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
}
.primary-nav .nav-inner::-webkit-scrollbar { display: none; }

/* WordPress renders wp_nav_menu as <ul><li><a> — force horizontal layout */
.primary-nav ul.nav-menu,
.primary-nav ul#primary-menu {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}
.primary-nav ul.nav-menu li,
.primary-nav ul#primary-menu li {
    display: block;
    flex-shrink: 0;
}
.primary-nav a {
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.85);
    padding: 11px 18px;
    white-space: nowrap;
    transition: background .15s;
    display: block;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-cat > a { background: var(--maple-dark); color: #fff; }

/* ── Submenus (dropdowns) ── */
.primary-nav li { position: relative; }
.primary-nav ul .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--maple-dark);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    z-index: 999;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu,
.primary-nav li.sub-open > .sub-menu { display: block; }
.primary-nav .sub-menu li { width: 100%; }
.primary-nav .sub-menu a {
    white-space: normal;
    padding: 10px 16px;
    font-size: 11px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.primary-nav .sub-menu li:last-child a { border-bottom: none; }
/* small arrow on parent items */
.primary-nav li.menu-item-has-children > a::after {
    content: " ▾";
    font-size: 9px;
    opacity: .7;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    padding: 11px 16px;
    font-size: 20px;
    cursor: pointer;
}

/* ============================================================
   BREAKING TICKER
============================================================ */
.ticker-bar {
    background: #F0EBE3;
    border-bottom: 1px solid var(--rule);
    display: flex;
    align-items: center;
    height: 34px;
    overflow: hidden;
}
.ticker-label {
    background: var(--maple);
    color: #fff;
    font-family: var(--ui);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0 14px;
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}
.ticker-scroll { overflow: hidden; flex: 1; }
.ticker-inner {
    display: flex;
    animation: ticker 32s linear infinite;
    white-space: nowrap;
}
.ticker-item {
    font-family: var(--ui);
    font-size: 12px;
    color: var(--ink);
    padding: 0 40px 0 20px;
}
.ticker-item .sep { color: var(--maple); margin-right: 16px; }
@keyframes ticker {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================================
   HERO GRID
============================================================ */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 560px;
    gap: 0;
    border-bottom: 1px solid var(--rule);
    
}
.hero-main { border-right: 1px solid var(--rule); padding-right: 24px; }

.hero-kicker {
    font-family: var(--ui);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--maple);
    margin-bottom: 8px;
}
.hero-headline {
    font-family: var(--display);
    font-size: 40px;
    font-weight: 900;
    line-height: 1.1;
    color: var(--ink);
    margin-bottom: 12px;
}
.hero-headline a { color: inherit; transition: color .15s; }
.hero-headline a:hover { color: var(--maple); }

.hero-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    margin-bottom: 12px;
}
.hero-thumbnail-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: #F0EBE3;
    border: 1px solid var(--rule);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rule);
    font-size: 48px;
    margin-bottom: 12px;
}
.hero-deck {
    font-family: var(--body);
    font-size: 16px;
    font-weight: 300;
    line-height: 1.65;
    color: #3A3530;
    border-top: 1px solid var(--rule);
    padding-top: 10px;
    margin-bottom: 12px;
}
.hero-byline {
    font-family: var(--ui);
    font-size: 11px;
    color: var(--warm-gray);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.hero-byline .dot { color: var(--rule); }
.hero-byline .read-more {
    color: var(--maple);
    font-weight: 600;
}

/* Sidebar */
.hero-sidebar { padding-left: 22px; }
.sidebar-article {
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
}
.sidebar-article:last-child { border-bottom: none; }
.sidebar-kicker {
    font-family: var(--ui);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--maple);
    margin-bottom: 4px;
}
.sidebar-headline {
    font-family: var(--display);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
    margin-bottom: 5px;
    transition: color .15s;
}
.sidebar-headline:hover { color: var(--maple); }
.sidebar-excerpt {
    font-family: var(--body);
    font-size: 13px;
    color: var(--warm-gray);
    line-height: 1.5;
}
.sidebar-time {
    font-family: var(--ui);
    font-size: 10px;
    color: #AAA49C;
    margin-top: 5px;
}

/* ============================================================
   THREE-COLUMN GRID
============================================================ */
.col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 28px;
}
.col-article {
    padding: 18px 22px 0;
    border-right: 1px solid var(--rule);
}
.col-article:first-child { padding-left: 0; }
.col-article:last-child { border-right: none; }

.tag-pill {
    display: inline-block;
    background: var(--maple-light);
    color: var(--maple);
    font-family: var(--ui);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 2px;
    margin-bottom: 6px;
}
.col-kicker {
    font-family: var(--ui);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--maple);
    margin-bottom: 6px;
}
.col-headline {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
    margin-bottom: 8px;
    transition: color .15s;
}
.col-headline a { color: inherit; }
.col-headline:hover, .col-headline a:hover { color: var(--maple); }
.col-excerpt {
    font-family: var(--body);
    font-size: 13px;
    color: #3A3530;
    line-height: 1.6;
}
.col-meta {
    font-family: var(--ui);
    font-size: 10px;
    color: #AAA49C;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.crs-badge {
    background: var(--maple);
    color: #fff;
    font-family: var(--ui);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 7px;
}

/* ============================================================
   POLICY ALERT BAND
============================================================ */
.alert-band {
    background: var(--ink);
    color: #EEE8E0;
    padding: 22px 28px;
    margin-top: 0;
}
.alert-label {
    font-family: var(--ui);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--maple);
    margin-bottom: 6px;
}
.alert-headline {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    color: #EEE8E0;
    margin-bottom: 10px;
    line-height: 1.2;
}
.alert-body {
    font-family: var(--body);
    font-size: 13px;
    color: #A09890;
    line-height: 1.6;
}
.alert-body strong { color: #D4CFC8; font-weight: 400; }
.alert-link {
    display: inline-block;
    margin-top: 12px;
    font-family: var(--ui);
    font-size: 11px;
    font-weight: 600;
    color: var(--maple);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color .15s;
}
.alert-link:hover { color: #E85A70; }

/* ============================================================
   NEWSLETTER BOX
============================================================ */
.newsletter-section {
    display: grid;
    grid-template-columns: 1fr 465px;
    gap: 28px;
    align-items: start;
    padding: 28px 0;
    border-bottom: 1px solid var(--rule);
}
.newsletter-box {
    background: #F0EBE3;
    border: 1px solid var(--rule);
    padding: 22px 24px;
    box-sizing: border-box;
}
.nl-icon {
    font-size: 26px;
    line-height: 1;
    margin-bottom: 8px;
    color: var(--maple);
}
.nl-headline {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
    line-height: 1.2;
}
.nl-sub {
    font-family: var(--body);
    font-size: 13px;
    color: var(--warm-gray);
    margin-bottom: 16px;
    line-height: 1.55;
}
/* The form itself is the flex row */
.nl-form {
    display: flex;
    flex-direction: row;
    gap: 0;
    width: 100%;
    align-items: stretch;
}
.nl-input {
    flex: 1 1 0;
    min-width: 0;           /* prevents overflow */
    padding: 10px 12px;
    font-family: var(--ui);
    font-size: 13px;
    border: 1px solid var(--rule);
    border-right: none;     /* merges visually with button */
    background: #fff;
    color: var(--ink);
    outline: none;
    border-radius: 0;
    -webkit-appearance: none;
}
.nl-input:focus { border-color: var(--maple); }
.nl-btn {
    flex-shrink: 0;
    background: var(--maple);
    color: #fff;
    border: none;
    padding: 10px 18px;
    font-family: var(--ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
    border-radius: 0;
    line-height: 1;
}
.nl-btn:hover { background: var(--maple-dark); }
.nl-hint {
    font-family: var(--ui);
    font-size: 10px;
    color: var(--warm-gray);
    margin-top: 8px;
    line-height: 1.5;
}

/* Quick Links (left of newsletter) */
.quick-links-box h3 {
    font-family: var(--ui);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--warm-gray);
    margin-bottom: 12px;
}
.quick-links-box ul { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-links-box li a {
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-blue);
    padding: 6px 10px;
    border: 1px solid var(--rule);
    display: block;
    transition: border-color .15s, color .15s;
}
.quick-links-box li a:hover { border-color: var(--maple); color: var(--maple); }

/* ============================================================
   SINGLE POST
============================================================ */
.single-post-wrap {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    padding: 28px 0;
    align-items: start;        /* sidebar doesn't force main column height */
}
#primary { min-width: 0; }    /* prevent content overflow in grid */
#secondary { min-width: 0; position: sticky; top: 20px; } /* sidebar sticks while scrolling */
.post-header { margin-bottom: 24px; }
.post-kicker {
    font-family: var(--ui);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--maple);
    margin-bottom: 8px;
}
.post-title {
    font-family: var(--display);
    font-size: 38px;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 12px;
}
.post-meta {
    font-family: var(--ui);
    font-size: 11px;
    color: var(--warm-gray);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    margin-bottom: 20px;
}
.post-featured-image {
    width: 100%;
    margin-bottom: 24px;
}
.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}
/* Draw result images are 1080×1080 — cap at 600px so they don't look huge */
.post-featured-image img[style*="max-width:600px"] {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}

/* Sidebar widgets */
.sidebar-widget {
    background: #F0EBE3;
    border: 1px solid var(--rule);
    padding: 18px;
    margin-bottom: 20px;
}
.widget-title {
    font-family: var(--ui);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--warm-gray);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 12px;
}
.widget-recent-posts li {
    padding: 8px 0;
    border-bottom: 1px solid var(--rule);
    font-family: var(--display);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}
.widget-recent-posts li:last-child { border-bottom: none; }
.widget-recent-posts li a { color: var(--ink); transition: color .15s; }
.widget-recent-posts li a:hover { color: var(--maple); }
.widget-cats li {
    padding: 6px 0;
    border-bottom: 1px solid var(--rule);
    font-family: var(--ui);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}
.widget-cats li:last-child { border-bottom: none; }
.widget-cats li a { color: var(--ink); transition: color .15s; }
.widget-cats li a:hover { color: var(--maple); }
.widget-cats li .count {
    background: var(--maple-light);
    color: var(--maple);
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
}

/* CRS Info Box */
.crs-info-box {
    background: var(--ink);
    color: #EEE8E0;
    padding: 18px;
    margin-bottom: 20px;
}
.crs-info-box .widget-title { color: #AAA49C; border-color: #333; }
.crs-score-big {
    font-family: var(--display);
    font-size: 52px;
    font-weight: 900;
    color: var(--maple);
    line-height: 1;
}
.crs-score-label {
    font-family: var(--ui);
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}
.crs-detail {
    font-family: var(--ui);
    font-size: 11px;
    color: #888;
    margin-top: 10px;
    line-height: 1.7;
}
.crs-detail span { color: #D4CFC8; }

/* ============================================================
   ARCHIVE / CATEGORY PAGE
============================================================ */
.archive-header {
    padding: 20px 0 16px;
    border-bottom: 3px double var(--ink);
    margin-bottom: 24px;
}
.archive-header .cat-name {
    font-family: var(--display);
    font-size: 32px;
    font-weight: 900;
}
.archive-header .cat-desc {
    font-family: var(--body);
    font-size: 14px;
    color: var(--warm-gray);
    margin-top: 4px;
}
.archive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}
.archive-card {
    border-bottom: 1px solid var(--rule);
    padding-bottom: 20px;
}
.archive-card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    margin-bottom: 10px;
}
.archive-card-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: #F0EBE3;
    border: 1px solid var(--rule);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--rule);
    margin-bottom: 10px;
}
.archive-card .col-headline { font-size: 22px; }

/* Pagination */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding: 20px 0;
    font-family: var(--ui);
    font-size: 13px;
}
.pagination .page-numbers {
    padding: 6px 12px;
    border: 1px solid var(--rule);
    color: var(--ink);
    transition: all .15s;
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--maple);
    color: #fff;
    border-color: var(--maple);
}

/* ============================================================
   FOOTER
============================================================ */
.site-footer {
    background: var(--ink);
    color: #6E6860;
    margin-top: 32px;
    padding: 28px 24px 16px;
}
.footer-top {
    max-width: 1080px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr 1fr;
    gap: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
    margin-bottom: 16px;
}
.footer-brand-col .footer-flag {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    color: #EEE8E0;
    margin-bottom: 8px;
}
.footer-brand-col .footer-flag span { color: var(--maple); }

/* Footer logo image — white-bg logo needs a light pill container on dark footer */
.footer-logo-img {
    max-height: 52px;
    max-width: 220px;
    width: auto;
    height: auto;
    display: block;
    margin-bottom: 10px;
}
/* footer-logo-bundled: no white background needed - logo is now transparent */
.footer-logo-bundled {
    background: transparent;
    padding: 0;
}
.footer-brand-col p {
    font-family: var(--ui);
    font-size: 12px;
    color: #6E6860;
    line-height: 1.6;
}
.footer-col-title {
    font-family: var(--ui);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #AAA49C;
    margin-bottom: 12px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 7px; }
.footer-col li a {
    font-family: var(--ui);
    font-size: 12px;
    color: #6E6860;
    transition: color .15s;
}
.footer-col li a:hover { color: #EEE8E0; }
.footer-bottom {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--ui);
    font-size: 11px;
    flex-wrap: wrap;
    gap: 8px;
}
.footer-bottom a { color: #6E6860; }
.footer-bottom a:hover { color: #EEE8E0; }
.disclaimer {
    font-family: var(--ui);
    font-size: 10px;
    color: #444;
    margin-top: 4px;
}

/* ============================================================
   ADMIN BAR OFFSET
============================================================ */
.admin-bar .primary-nav { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar .primary-nav { top: 46px; } }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .more-updates-grid { grid-template-columns: 1fr 1fr; row-gap: 20px; }
    .more-updates-grid .col-article:nth-child(2n) { border-right: none; }
    .hero-main { border-right: none; padding-right: 0; border-bottom: 1px solid var(--rule); padding-bottom: 20px; margin-bottom: 20px; }
    .hero-sidebar { padding-left: 0; }
    .col-grid { grid-template-columns: 1fr; }
    .col-article { padding-left: 0; border-right: none; border-bottom: 1px solid var(--rule); padding-bottom: 16px; }
    .col-article:last-child { border-bottom: none; }
    .newsletter-section { grid-template-columns: 1fr; }
    .single-post-wrap { grid-template-columns: 1fr; }
    .footer-top { grid-template-columns: 1fr 1fr; }
    .footer-top .footer-brand-col { grid-column: span 2; }
    .archive-grid { grid-template-columns: 1fr; }
    .site-flag { font-size: 36px; }
}
@media (max-width: 600px) {
    .site-logo-img { max-height: 56px; }
    .masthead-main { padding: 12px 16px 10px; }
    .more-updates-grid { grid-template-columns: 1fr; }
    .more-updates-grid .col-article { padding: 0; border-right: none; border-bottom: 1px solid var(--rule); padding-bottom: 14px; }
    .more-updates-grid .col-article:last-child { border-bottom: none; }
    .masthead-top .edition-info span:not(:first-child) { display: none; }
    .menu-toggle { display: flex; margin-left: auto; }

    /* Collapse nav to vertical on mobile */
    .primary-nav ul.nav-menu,
    .primary-nav ul#primary-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--maple-dark);
    }
    .primary-nav ul.nav-menu.open,
    .primary-nav ul#primary-menu.open { display: flex; }
    .primary-nav ul.nav-menu li,
    .primary-nav ul#primary-menu li { width: 100%; }
    .primary-nav ul.nav-menu li a,
    .primary-nav ul#primary-menu li a { border-bottom: 1px solid rgba(255,255,255,0.1); }

    /* Mobile submenus: accordion (opened by tap via .sub-open) */
    .primary-nav ul .sub-menu {
        position: static;
        min-width: 0;
        box-shadow: none;
        background: rgba(0,0,0,0.25);
        padding: 0;
    }
    .primary-nav li:hover > .sub-menu,
    .primary-nav li:focus-within > .sub-menu { display: none; }
    .primary-nav li.sub-open > .sub-menu { display: block; }
    .primary-nav .sub-menu a { padding-left: 32px; }

    .nl-form { flex-direction: column; }
    .nl-input { border-right: 1px solid var(--rule); border-bottom: none; }
    .newsletter-section { grid-template-columns: 1fr; }
    .footer-top { grid-template-columns: 1fr; }
    .footer-top .footer-brand-col { grid-column: span 1; }
    .hero-headline { font-size: 28px; }
    .post-title { font-size: 26px; }
}

/* ============================================================
   WORDPRESS CORE CLASSES
============================================================ */
.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin: 0 auto 1em; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-family: var(--ui); font-size: 11px; color: var(--warm-gray); font-style: italic; margin-top: 4px; }

/* ============================================================
   PAGE TEMPLATES (page.php / page-full-width.php)
============================================================ */

/* Default page — same 2-col grid as single post */
.page-article .post-title {
    font-family: var(--display);
    font-size: 34px;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 12px;
    color: var(--ink);
}

/* Full-width page template */
.page-full-wrap {
    max-width: 100%;
    padding: 28px 0;
}
.page-full-wrap #primary {
    width: 100%;
    max-width: 100%;
}
.page-header-full {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--rule);
}
.page-header-full .post-title {
    font-family: var(--display);
    font-size: 36px;
    font-weight: 900;
    line-height: 1.1;
    color: var(--ink);
    margin-bottom: 8px;
}

/* TOC widget auto-numbering */
#cvu-page-toc { counter-reset: toc-counter; }
#cvu-page-toc li { counter-increment: toc-counter; position: relative; padding-left: 22px; }
#cvu-page-toc li::before {
    content: counter(toc-counter) ".";
    position: absolute;
    left: 0;
    font-size: 10px;
    font-weight: 700;
    color: var(--maple);
    top: 3px;
}
.everest-forms .evf-container {
    margin-bottom: 0px !important;
    margin-left: -17px !important;
}