/*
Theme Name: Blue Ridge
Theme URI: https://valleyfirstnews.com/
Author: David B. Briggman
Author URI: https://davebriggman.com/
Description: A responsive news and commentary theme evoking the Shenandoah Valley of Virginia. Layered rolling-ridge artwork, a pastoral green palette, and a clean reading layout that adapts to desktop, tablet, and phone. Built for accountability journalism and local commentary.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: blue-ridge
Tags: blog, news, two-columns, right-sidebar, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, responsive-layout
*/

/* ============================================================
   Blue Ridge — Shenandoah Valley theme
   Palette: pastoral green (farmland greens, forest, sky, cream)
   ============================================================ */

:root {
    --br-cream:      #f6f3e9;  /* aged paper / valley haze */
    --br-paper:      #fbfaf4;  /* card / content surface */
    --br-ink:        #26302a;  /* body text, near-black green */
    --br-forest:     #1f3d29;  /* deepest green, headings */
    --br-meadow:     #3f6f43;  /* primary green */
    --br-meadow-dk:  #315636;  /* primary green, hover */
    --br-moss:       #6f9459;  /* light accent green */
    --br-sky:        #5f89a8;  /* valley sky blue */
    --br-harvest:    #c69a3e;  /* harvest gold accent */
    --br-barn:       #9c4a2f;  /* muted barn red, sparingly */
    --br-line:       #ddd6c4;  /* hairline borders */
    --br-muted:      #5f6b5d;  /* secondary text */

    --br-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
    --br-sans: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;

    --br-maxwidth: 1180px;
    --br-content: 720px;
    --br-radius: 6px;
    --br-shadow: 0 1px 3px rgba(31, 61, 41, 0.08), 0 6px 20px rgba(31, 61, 41, 0.06);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background-color: var(--br-cream);
    background-image:
        radial-gradient(1200px 300px at 50% -60px, rgba(95, 137, 168, 0.10), transparent 70%);
    color: var(--br-ink);
    font-family: var(--br-serif);
    font-size: 18px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--br-meadow-dk);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover, a:focus { color: var(--br-barn); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--br-serif);
    color: var(--br-forest);
    line-height: 1.22;
    margin: 0 0 0.5em;
    font-weight: 700;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.2em; }

blockquote {
    margin: 1.6em 0;
    padding: 0.4em 1.2em;
    border-left: 4px solid var(--br-moss);
    color: var(--br-muted);
    font-style: italic;
    background: rgba(111, 148, 89, 0.06);
}

code, pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.92em;
    background: rgba(31, 61, 41, 0.06);
    border-radius: 4px;
}
code { padding: 0.1em 0.35em; }
pre { padding: 1em; overflow-x: auto; }

hr { border: 0; border-top: 1px solid var(--br-line); margin: 2em 0; }

/* Accessibility: skip link + screen-reader text */
.screen-reader-text {
    border: 0; clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px; width: 1px; margin: -1px; padding: 0;
    overflow: hidden; position: absolute !important; word-wrap: normal !important;
}
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 1000;
    background: var(--br-forest); color: #fff; padding: 0.6em 1em;
    border-radius: 0 0 var(--br-radius) 0;
}
.skip-link:focus { left: 0; color: #fff; }

:focus-visible { outline: 3px solid var(--br-sky); outline-offset: 2px; }

/* ---------- Layout wrapper ---------- */
.br-container {
    width: 100%;
    max-width: var(--br-maxwidth);
    margin-inline: auto;
    padding-inline: 20px;
}

/* ============================================================
   Site header
   ============================================================ */
.site-header {
    position: relative;
    background: var(--br-forest);
    color: var(--br-cream);
    overflow: hidden;
}

/* Rolling-ridge artwork sits behind the header text */
.site-header__ridge {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    pointer-events: none;
}
.site-header__inner {
    position: relative;
    z-index: 2;
    padding-block: 46px 60px;
    text-align: center;
}

.site-branding { display: inline-block; }
.custom-logo-link img { margin: 0 auto 0.4em; }

.site-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin: 0;
    color: var(--br-cream);
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.site-title a { color: inherit; }
.site-title a:hover { color: #fff; text-decoration: none; }

.site-description {
    margin: 0.35em 0 0;
    font-family: var(--br-sans);
    font-size: 0.95rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(246, 243, 233, 0.85);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   Primary navigation
   ============================================================ */
.site-nav {
    position: relative;
    z-index: 3;
    background: var(--br-meadow-dk);
    border-top: 3px solid var(--br-harvest);
}
.site-nav .br-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.menu-toggle {
    display: none;
    background: transparent;
    color: var(--br-cream);
    border: 1px solid rgba(246, 243, 233, 0.5);
    border-radius: var(--br-radius);
    padding: 0.55em 0.9em;
    margin: 0.6em 0;
    font-family: var(--br-sans);
    font-size: 0.95rem;
    cursor: pointer;
}
.menu-toggle:hover { background: rgba(255, 255, 255, 0.08); }

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.site-nav li { position: relative; }
.site-nav a {
    display: block;
    color: var(--br-cream);
    font-family: var(--br-sans);
    font-size: 0.98rem;
    letter-spacing: 0.03em;
    padding: 0.95em 1.1em;
    text-decoration: none;
}
.site-nav a:hover,
.site-nav .current-menu-item > a {
    background: var(--br-forest);
    color: #fff;
}

/* Sub-menus */
.site-nav ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--br-forest);
    box-shadow: var(--br-shadow);
    z-index: 20;
}
.site-nav li:hover > ul,
.site-nav li:focus-within > ul { display: block; }
.site-nav ul ul li { width: 100%; }
.site-nav ul ul a { padding: 0.7em 1.1em; border-top: 1px solid rgba(255,255,255,0.06); }

/* ============================================================
   Site content grid (main + sidebar)
   ============================================================ */
.site-main-wrap {
    padding-block: 40px 56px;
}
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 44px;
    align-items: start;
}
.content-grid--full { grid-template-columns: minmax(0, 1fr); }

/* ============================================================
   Front page hero + post grid
   ============================================================ */
.hero {
    position: relative;
    background: var(--br-paper);
    border: 1px solid var(--br-line);
    border-radius: var(--br-radius);
    overflow: hidden;
    box-shadow: var(--br-shadow);
    margin-bottom: 40px;
}
.hero__media { position: relative; aspect-ratio: 16 / 8; overflow: hidden; background: var(--br-meadow); }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__body { padding: 26px 30px 30px; }
.hero__kicker {
    font-family: var(--br-sans);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--br-barn);
    margin-bottom: 0.6em;
}
.hero__title { font-size: clamp(1.6rem, 3.2vw, 2.4rem); margin-bottom: 0.35em; }
.hero__title a { color: var(--br-forest); }
.hero__excerpt { color: var(--br-muted); font-size: 1.05rem; }

.section-heading {
    font-family: var(--br-sans);
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--br-meadow-dk);
    border-bottom: 2px solid var(--br-harvest);
    padding-bottom: 0.5em;
    margin: 0 0 26px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
}

/* ============================================================
   Article cards + single article
   ============================================================ */
.card {
    background: var(--br-paper);
    border: 1px solid var(--br-line);
    border-radius: var(--br-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--br-shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 26px rgba(31,61,41,0.14); }
.card__media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--br-moss); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 0.5em; }
.card__title { font-size: 1.28rem; margin: 0; }
.card__title a { color: var(--br-forest); }
.card__excerpt { color: var(--br-muted); font-size: 0.98rem; margin: 0.2em 0 0; }

.entry-meta {
    font-family: var(--br-sans);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: var(--br-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em 1em;
    align-items: center;
}
.entry-meta a { color: var(--br-meadow-dk); }
.entry-meta .cat-link {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--br-barn);
    font-weight: 600;
}

/* Single / page article */
.entry {
    background: var(--br-paper);
    border: 1px solid var(--br-line);
    border-radius: var(--br-radius);
    padding: 34px clamp(20px, 4vw, 48px) 40px;
    box-shadow: var(--br-shadow);
    margin-bottom: 34px;
}
.entry-header { margin-bottom: 1.4em; }
.entry-title { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.entry-featured { margin: 0 0 1.6em; border-radius: var(--br-radius); overflow: hidden; }
.entry-content { max-width: var(--br-content); }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content figure { margin: 1.8em 0; }
.entry-content figcaption {
    font-family: var(--br-sans);
    font-size: 0.82rem;
    color: var(--br-muted);
    text-align: center;
    margin-top: 0.5em;
}
.wp-caption-text { font-family: var(--br-sans); font-size: 0.82rem; color: var(--br-muted); }
.alignleft { float: left; margin: 0.3em 1.6em 1em 0; }
.alignright { float: right; margin: 0.3em 0 1em 1.6em; }
.aligncenter { margin-inline: auto; }

.entry-footer {
    margin-top: 2em;
    padding-top: 1.2em;
    border-top: 1px solid var(--br-line);
    font-family: var(--br-sans);
    font-size: 0.85rem;
    color: var(--br-muted);
}
.tag-links a {
    display: inline-block;
    background: rgba(111, 148, 89, 0.14);
    color: var(--br-meadow-dk);
    border-radius: 999px;
    padding: 0.25em 0.85em;
    margin: 0.2em 0.3em 0.2em 0;
    font-size: 0.8rem;
}
.tag-links a:hover { background: var(--br-moss); color: #fff; text-decoration: none; }

.read-more {
    align-self: flex-start;
    font-family: var(--br-sans);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--br-meadow-dk);
    margin-top: 0.4em;
}
.read-more::after { content: " \203A"; }

/* ============================================================
   Sidebar widgets
   ============================================================ */
.sidebar { font-size: 0.96rem; }
.widget {
    background: var(--br-paper);
    border: 1px solid var(--br-line);
    border-radius: var(--br-radius);
    padding: 22px 22px 24px;
    margin-bottom: 26px;
    box-shadow: var(--br-shadow);
}
.widget-title {
    font-family: var(--br-sans);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--br-meadow-dk);
    border-bottom: 2px solid var(--br-harvest);
    padding-bottom: 0.5em;
    margin: 0 0 1em;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 0.5em 0; border-bottom: 1px dotted var(--br-line); }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--br-ink); }
.widget a:hover { color: var(--br-meadow-dk); }

/* ============================================================
   Search form
   ============================================================ */
.search-form { display: flex; gap: 8px; }
.search-form .search-field {
    flex: 1;
    padding: 0.6em 0.8em;
    border: 1px solid var(--br-line);
    border-radius: var(--br-radius);
    font-family: var(--br-sans);
    font-size: 0.95rem;
    background: #fff;
    color: var(--br-ink);
}
.search-form .search-submit,
.btn {
    background: var(--br-meadow);
    color: #fff;
    border: 0;
    border-radius: var(--br-radius);
    padding: 0.6em 1.1em;
    font-family: var(--br-sans);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.search-form .search-submit:hover,
.btn:hover { background: var(--br-meadow-dk); text-decoration: none; color: #fff; }

/* ============================================================
   Pagination
   ============================================================ */
.navigation.pagination { margin-top: 40px; }
.navigation.pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    font-family: var(--br-sans);
}
.navigation.pagination .page-numbers {
    display: inline-block;
    min-width: 42px;
    text-align: center;
    padding: 0.5em 0.7em;
    background: var(--br-paper);
    border: 1px solid var(--br-line);
    border-radius: var(--br-radius);
    color: var(--br-meadow-dk);
}
.navigation.pagination .page-numbers.current {
    background: var(--br-meadow);
    color: #fff;
    border-color: var(--br-meadow);
}
.navigation.pagination a.page-numbers:hover { background: var(--br-moss); color: #fff; text-decoration: none; }

/* Post-to-post nav (single) */
.post-navigation { margin-top: 8px; }
.post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-family: var(--br-sans);
    font-size: 0.9rem;
}
.post-navigation .nav-links a { display: block; }

/* ============================================================
   Comments
   ============================================================ */
.comments-area { margin-top: 34px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin-left: 1.4em; padding-left: 1em; border-left: 2px solid var(--br-line); }
.comment-body {
    background: var(--br-paper);
    border: 1px solid var(--br-line);
    border-radius: var(--br-radius);
    padding: 16px 18px;
    margin-bottom: 16px;
}
.comment-author { font-family: var(--br-sans); font-weight: 600; }
.comment-metadata { font-family: var(--br-sans); font-size: 0.8rem; color: var(--br-muted); }
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
    width: 100%;
    padding: 0.6em 0.8em;
    border: 1px solid var(--br-line);
    border-radius: var(--br-radius);
    font-family: var(--br-sans);
    margin-bottom: 1em;
    background: #fff;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background: var(--br-forest);
    color: rgba(246, 243, 233, 0.9);
    margin-top: 20px;
    border-top: 3px solid var(--br-harvest);
}
.site-footer a { color: var(--br-cream); }
.site-footer a:hover { color: #fff; }
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    padding-block: 44px;
}
.footer-widgets .widget {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
}
.footer-widgets .widget-title { color: var(--br-cream); border-bottom-color: rgba(198, 154, 62, 0.6); }
.footer-widgets .widget a { color: rgba(246, 243, 233, 0.9); }
.footer-widgets li { border-bottom-color: rgba(255,255,255,0.08); }
.site-info {
    text-align: center;
    font-family: var(--br-sans);
    font-size: 0.85rem;
    padding-block: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(246, 243, 233, 0.7);
}

/* ============================================================
   Page title banner (archives, search, 404)
   ============================================================ */
.page-banner {
    text-align: center;
    margin-bottom: 34px;
}
.page-banner .page-title { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.page-banner .archive-description { color: var(--br-muted); }

/* ============================================================
   Responsive: tablet
   ============================================================ */
@media (max-width: 980px) {
    .content-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
    .sidebar { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
    .sidebar .widget { margin-bottom: 0; }
}

@media (max-width: 820px) {
    body { font-size: 17px; }

    /* Collapse nav into a toggle */
    .site-nav .br-container { justify-content: space-between; }
    .menu-toggle { display: inline-block; }
    .site-nav ul.nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
    }
    .site-nav ul.nav-menu.is-open { display: flex; }
    .site-nav ul.nav-menu li { width: 100%; border-top: 1px solid rgba(255,255,255,0.08); }
    .site-nav ul ul {
        position: static;
        display: block;
        min-width: 0;
        box-shadow: none;
        background: rgba(0,0,0,0.15);
    }
    .site-nav ul ul a { padding-left: 2em; }

    .post-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================
   Responsive: phone
   ============================================================ */
@media (max-width: 520px) {
    body { font-size: 16px; }
    .br-container { padding-inline: 16px; }
    .site-header__inner { padding-block: 34px 42px; }
    .entry { padding: 22px 18px 28px; }
    .hero__body { padding: 20px 18px 24px; }
    .post-navigation .nav-links { flex-direction: column; }
    .sidebar { grid-template-columns: minmax(0, 1fr); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto; transition: none !important; }
    .card:hover { transform: none; }
}
