/* =========================
EDITORIAL IDENTITY SYSTEM (GLOBAL THEME CSS)
Moved from index.hbs for site-wide consistency
========================= */

/* =========================
BRAND TOKENS — nomadianation
Change a value here and it updates everywhere below.
========================= */
:root {
    --nn-bg: #0e0e0d;              /* page background, brand near-black */
    --nn-bg-raised: #1a1917;       /* submenu / raised surfaces */
    --nn-border: #2a2824;          /* hairline borders, dividers */
    --nn-border-strong: #3a372f;   /* emphasized borders (first grid item, etc.) */

    --nn-text-primary: #f2f0ea;    /* brand off-white — headings, emphasis */
    --nn-text-body: #d9d6ce;       /* paragraph copy */
    --nn-text-muted: #a39d8f;      /* captions, meta, timestamps */
    --nn-text-faint: #766f60;      /* least prominent labels, carets */

    --nn-accent: #c9a24b;          /* brass gold — the ONE accent color */
}

/* BASE IDENTITY */
body {
    background: var(--nn-bg);
    color: var(--nn-text-body);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.75;
}

/* GLOBAL LAYOUT CONTAINER */
.site-main .inner {
    max-width: 940px;
    margin: 0 auto;
}

/* TYPOGRAPHY SYSTEM */
h1, h2, h3 {
    font-family: Georgia, serif;
    letter-spacing: -0.4px;
    color: var(--nn-text-primary);
}

section h2 {
    font-size: 10px;
    letter-spacing: 2.6px;
    text-transform: uppercase;
    color: var(--nn-text-muted);
    margin-bottom: 30px;
}

p {
    font-size: 16.5px;
    color: var(--nn-text-body);
}

/* GLOBAL SECTION RHYTHM */
section {
    margin: 120px 0;
    position: relative;
}

section::before {
    content: "";
    display: block;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--nn-border), transparent);
    margin-bottom: 48px;
    opacity: 0.9;
}

/* EDITOR'S DESK */
.editor-desk-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.editor-desk-photo-wrap {
    flex: 0 0 auto;
}

.editor-desk-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--nn-border-strong);
}

.editor-desk-text {
    flex: 1;
}

.editor-desk p {
    font-size: 18px;
    max-width: 720px;
    color: var(--nn-text-body);
}

.editor-desk-social-links {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 20px;
}

.editor-desk-social-links a {
    color: var(--nn-text-muted);
    display: inline-flex;
    transition: color 0.15s ease;
}

.editor-desk-social-links a:hover {
    color: var(--nn-accent);
}

.editor-desk-social-links svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 600px) {
    .editor-desk-layout {
        flex-direction: column;
        gap: 20px;
    }

    .editor-desk-photo {
        width: 90px;
        height: 90px;
    }
}

/* FEATURED STORY */
.featured-story img {
    width: 100%;
    height: 620px;
    object-fit: cover;
    border-radius: 18px;
    filter: contrast(1.08) brightness(0.76);
}

.featured-story h3 {
    font-size: 52px;
    line-height: 1.05;
    margin: 22px 0 12px;
    letter-spacing: -0.9px;
    color: var(--nn-text-primary);
}

.featured-story p {
    font-size: 16px;
    max-width: 760px;
    color: var(--nn-text-body);
}

/* GRID SYSTEM */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.grid article {
    border: none;
}

.grid article a {
    display: block;
    padding-top: 14px;
    border-top: 1px solid var(--nn-border);
}

.grid h3 {
    font-size: 15px;
    line-height: 1.35;
    color: var(--nn-text-primary);
}

.grid time {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--nn-text-muted);
}

.grid p {
    font-size: 13px;
    color: var(--nn-text-muted);
}

.grid article:first-child a {
    border-top: 2px solid var(--nn-border-strong);
    padding-top: 16px;
}

.recommendations .grid article a {
    opacity: 0.94;
}

/* =========================
SECTION LEAD/FEED — three-tier weight system
Tier 1: Featured Story (site-wide hero)
Tier 2: .lead-card (first item per section — image + larger title)
Tier 3: .feed-card (remaining items — small, text-only)
========================= */

.section-lead-feed {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.lead-card-image {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 18px;
    filter: contrast(1.06) brightness(0.82);
}

.lead-card h3 {
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: -0.5px;
    color: var(--nn-text-primary);
    margin-bottom: 8px;
}

.lead-card p {
    font-size: 15px;
    color: var(--nn-text-body);
    max-width: 640px;
}

.feed-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.feed-card a {
    display: block;
    padding-top: 12px;
    border-top: 1px solid var(--nn-border);
}

.feed-card h3 {
    font-size: 15px;
    line-height: 1.35;
    color: var(--nn-text-primary);
    margin-bottom: 4px;
}

.feed-card p {
    font-size: 13px;
    color: var(--nn-text-muted);
}

@media (max-width: 900px) {
    .lead-card-image {
        height: 240px;
    }

    .lead-card h3 {
        font-size: 24px;
    }

    .feed-row {
        grid-template-columns: 1fr;
    }
}

/* STUB / EMPTY-STATE NOTE (shown via {{else}} when a section has no posts yet) */
.section-stub-note {
    font-style: italic;
    font-size: 14px;
    color: var(--nn-text-muted);
    grid-column: 1 / -1;
}

/* SECTION CTA LINK (e.g. "See the full series →") */
.section-cta {
    display: inline-block;
    margin-top: 28px;
    font-size: 13px;
    letter-spacing: 0.4px;
    color: var(--nn-accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.section-cta:hover {
    border-color: var(--nn-accent);
}

/* COLLECTIONS (not used anymore as section, but kept for safety) */
.collections ul {
    list-style: none;
    padding: 0;
    max-width: 660px;
}

.collections li {
    font-size: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--nn-border);
    color: var(--nn-text-body);
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .featured-story img {
        height: 500px;
    }

    .featured-story h3 {
        font-size: 40px;
    }
}

@media (max-width: 600px) {
    .grid {
        grid-template-columns: 1fr;
    }

    section {
        margin: 85px 0;
    }
}

/* =========================
TAG ARCHIVE PAGES (tag.hbs)
========================= */

.archive-header {
    max-width: 720px;
    margin: 0 auto 60px;
    text-align: center;
}

.archive-title {
    font-size: 44px;
    line-height: 1.1;
    letter-spacing: -0.7px;
    color: var(--nn-text-primary);
    margin-bottom: 14px;
}

.archive-description {
    font-size: 17px;
    color: var(--nn-text-body);
}

.archive-count {
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--nn-text-muted);
    margin-top: 14px;
}

.archive-card-image {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 14px;
    filter: contrast(1.05) brightness(0.85);
}

.archive-grid h3 {
    font-size: 18px;
}

.archive-grid p {
    font-size: 15px;
    line-height: 1.55;
    margin-top: 8px;
}

/* =========================
ERROR PAGE (error-404.hbs)
========================= */

.error-content {
    max-width: 560px;
    margin: 100px auto;
    text-align: center;
}

.error-code {
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--nn-accent);
    margin-bottom: 18px;
}

.error-title {
    font-size: 40px;
    color: var(--nn-text-primary);
    margin-bottom: 20px;
}

.error-description {
    font-size: 16px;
    color: var(--nn-text-body);
    margin-bottom: 32px;
}

.error-more-reading {
    max-width: 940px;
    margin: 80px auto 0;
}

.error-more-label {
    text-align: center;
    font-size: 10px;
    letter-spacing: 2.6px;
    text-transform: uppercase;
    color: var(--nn-text-muted);
    margin-bottom: 30px;
}

/* =========================
AUTHOR BIO HEADER (author.hbs)
Reuses .editor-desk-layout / .editor-desk-photo from Editor's Desk
========================= */

.author-bio-layout {
    max-width: 720px;
    margin: 0 auto 20px;
    text-align: left;
}

.author-location {
    font-size: 13px;
    color: var(--nn-text-muted);
    margin-top: 6px;
}

.author-social-links {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
}

.author-social-links a {
    color: var(--nn-text-muted);
    text-decoration: none;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s ease;
}

.author-social-links a:hover {
    color: var(--nn-accent);
}

.author-social-links svg {
    width: 18px;
    height: 18px;
}

/* =========================
PROJECTS COLLECTION — ordered series (collection-projects.hbs)
========================= */

.series-list {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 780px;
}

.series-item {
    border-top: 1px solid var(--nn-border);
    padding: 32px 0;
}

.series-item:first-child {
    border-top: 2px solid var(--nn-border-strong);
}

.series-item a {
    display: block;
    text-decoration: none;
}

.series-item .archive-card-image {
    height: 260px;
    margin-bottom: 18px;
}

.series-number {
    display: block;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--nn-accent);
    margin-bottom: 8px;
}

.series-item h3 {
    font-size: 24px;
    line-height: 1.25;
    margin-bottom: 8px;
}

.series-item p {
    font-size: 15px;
    color: var(--nn-text-muted);
}

/* =========================
POST HEADER — EYEBROW + BYLINE (post.hbs)
========================= */

.post-eyebrow {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--nn-accent);
    text-decoration: none;
    margin-bottom: 18px;
}

.post-eyebrow:hover {
    text-decoration: underline;
}

.post-author {
    color: var(--nn-text-muted);
}

.post-meta-divider {
    margin: 0 8px;
    color: var(--nn-text-faint);
}

.post-author-social-links {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-left: 14px;
}

.post-author-social-links a {
    color: var(--nn-text-muted);
    display: inline-flex;
    transition: color 0.15s ease;
}

.post-author-social-links a:hover {
    color: var(--nn-accent);
}

.post-author-social-links svg {
    width: 15px;
    height: 15px;
}

/* POST PAGE CONSISTENCY LAYER */

.post-inner {
    max-width: 760px;
    margin: 0 auto;
}

.post-title {
    font-size: 48px;
    line-height: 1.1;
    margin: 30px 0 20px;
    color: var(--nn-text-primary);
}

.post-meta {
    font-size: 13px;
    color: var(--nn-text-muted);
    margin-bottom: 40px;
}

.post-feature-image {
    width: 100%;
    height: auto;
    border-radius: 14px;
    margin-bottom: 30px;
}

.post-body {
    font-size: 18px;
    line-height: 1.8;
    color: var(--nn-text-body);
}

.post-body p {
    text-align: left !important;
    margin: 0 0 28px;
}

/* Real article headings — overrides the .post-body-scoped h2 away from
   the global "section h2" eyebrow-label rule (higher specificity wins) */
.post-body h2 {
    font-size: 30px;
    line-height: 1.25;
    letter-spacing: -0.4px;
    text-transform: none;
    color: var(--nn-text-primary);
    margin: 56px 0 20px;
}

.post-body h3 {
    font-size: 23px;
    line-height: 1.3;
    text-transform: none;
    color: var(--nn-text-primary);
    margin: 44px 0 16px;
}

.post-body h4 {
    font-size: 19px;
    color: var(--nn-text-primary);
    margin: 32px 0 14px;
}

.post-body a {
    color: var(--nn-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-body ul,
.post-body ol {
    margin: 0 0 28px;
    padding-left: 28px;
}

.post-body li {
    margin-bottom: 10px;
}

.post-body blockquote {
    margin: 40px 0;
    padding-left: 24px;
    border-left: 3px solid var(--nn-accent);
    font-style: italic;
    color: var(--nn-text-primary);
}

.post-body hr {
    border: none;
    border-top: 1px solid var(--nn-border);
    margin: 56px 0;
}

.post-body figure {
    margin: 30px 0;
}

.post-body figcaption {
    font-size: 13px;
    color: var(--nn-text-muted);
    text-align: center;
    margin-top: 10px;
}

.post-body code {
    font-family: "SF Mono", Consolas, monospace;
    font-size: 0.85em;
    background: var(--nn-bg-raised);
    padding: 2px 6px;
    border-radius: 4px;
}

.post-body pre {
    background: var(--nn-bg-raised);
    border: 1px solid var(--nn-border);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin: 30px 0;
}

.post-body pre code {
    background: none;
    padding: 0;
}

.post-body img {
    max-width: 100%;
    border-radius: 12px;
    margin: 30px 0;
}

/* =========================
HEADER ALIGNMENT FIX (CASPER INTEGRATION)
========================= */

.gh-head {
    background: transparent;
    border-bottom: 1px solid var(--nn-border);
}

.gh-head-inner {
    max-width: 940px;
    margin: 0 auto;
    padding: 18px 0;
}

/* align header with magazine typography system */
.gh-head a,
.gh-head button {
    font-family: Georgia, "Times New Roman", serif;
    color: var(--nn-text-body);
}

/* reduce Casper visual dominance */
.gh-head-logo {
    letter-spacing: -0.3px;
}

/* ensure header doesn't feel like separate UI layer */
.site-content {
    padding-top: 0;
}

/* =========================
PRIMARY NAV — DROPDOWN SYSTEM
Sport, Tech etc. reveal sub-sections on hover (desktop)
or tap (touch, handled by the small script in default.hbs)
========================= */

.magazine-nav-list {
    display: flex;
    align-items: center;
    gap: 34px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.magazine-nav-list > li {
    position: relative;
}

.magazine-nav-list > li > a {
    display: inline-block;
    padding: 10px 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 14px;
    letter-spacing: 0.3px;
    color: var(--nn-text-body);
    text-decoration: none;
    transition: color 0.15s ease;
}

.magazine-nav-list > li > a:hover,
.magazine-nav-list > li > a:focus {
    color: var(--nn-accent);
}

/* small caret to hint a submenu exists */
.has-submenu > a::after {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-left: 6px;
    margin-bottom: 1px;
    border-right: 1px solid var(--nn-text-muted);
    border-bottom: 1px solid var(--nn-text-muted);
    transform: rotate(45deg);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.has-submenu:hover > a::after,
.has-submenu.is-open > a::after {
    transform: rotate(225deg);
    border-color: var(--nn-accent);
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 190px;
    margin: 0;
    padding: 10px 0;
    list-style: none;
    background: var(--nn-bg-raised);
    border: 1px solid var(--nn-border);
    border-radius: 8px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
    z-index: 60;
}

.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.has-submenu.is-open > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li a {
    display: block;
    padding: 8px 18px;
    font-size: 13px;
    color: var(--nn-text-body);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.12s ease, color 0.12s ease;
}

.submenu li a:hover,
.submenu li a:focus {
    background: var(--nn-border);
    color: var(--nn-text-primary);
}

@media (max-width: 900px) {
    .magazine-nav-list {
        flex-wrap: wrap;
        gap: 20px;
    }
}

/* =========================
COLLECTIONS SUB-HEADER (CENTERED FIX)
========================= */

.collections-bar {
    border-bottom: 1px solid var(--nn-border);
    background: var(--nn-bg);
}

.collections-bar-inner {
    max-width: 940px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 18px;
    padding: 10px 0;

    overflow-x: auto;
    white-space: nowrap;
}

.collections-bar-inner a {
    font-size: 13px;
    color: var(--nn-text-muted);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.collections-bar-inner a:hover {
    color: var(--nn-text-primary);
    background: var(--nn-border);
}

/* =========================
LOGO SIZE FIX
Casper's default logo height is too small for the horizontal
icon+wordmark lockup — bump it up so the wordmark is legible.
========================= */

.gh-head-logo img {
    max-height: 112px;
    width: auto;
}

/* =========================
STACKS CATEGORY FILTER (collection-stacks.hbs)
Same visual language as .collections-bar — a pill-link row,
just scoped to one collection's landing page instead of every page.
========================= */

.stacks-category-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 48px;
}

.stacks-category-filter a {
    font-size: 13px;
    color: var(--nn-text-muted);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--nn-border);
    border-radius: 999px;
    transition: all 0.2s ease;
}

.stacks-category-filter a:hover {
    color: var(--nn-text-primary);
    background: var(--nn-border);
}

/* =========================
EMPTY SUBMENU STUB (default.hbs)
Shown when a dynamic {{#get "tags"}} section-loop (e.g. Health & Fitness)
has no matching sub-tags yet — a growing section starts empty, not broken.
========================= */

.submenu-empty span {
    display: block;
    padding: 8px 18px;
    font-size: 13px;
    font-style: italic;
    color: var(--nn-text-faint);
    white-space: nowrap;
}