/* The Dingo Daily — News Site Styles */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('/fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:             #ffffff;
    --surface:        #f4f4f6;
    --surface2:       #eaeaee;
    --accent:         #e63946;
    --accent2:        #cc0000;
    --accent-dim:     rgba(230, 57, 70, 0.08);
    --text:           #1a1a1a;
    --text-secondary: #444455;
    --muted:          #666677;
    --border:         #dddde8;
    --nav-bg:         #111111;
    --nav-text:       #f0f0f0;
    --nav-hover:      #e63946;
    --shadow-sm:      0 1px 4px rgba(0,0,0,0.07);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.10);
    --radius:         8px;
    --transition:     0.15s ease;
    --max-content:    800px;
    --max-wide:       1100px;
}

[data-theme="dark"] {
    --bg:             #141414;
    --surface:        #1e1e1e;
    --surface2:       #282828;
    --accent2:        #ff4444;
    --accent-dim:     rgba(230, 57, 70, 0.12);
    --text:           #f0f0f0;
    --text-secondary: #ccccdd;
    --muted:          #9ca3af;
    --border:         #333344;
    --nav-bg:         #0d0d0d;
    --shadow-sm:      0 1px 4px rgba(0,0,0,0.3);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; height: auto; }

/* ── Cookie banner ────────────────────────────────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 2px solid var(--border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 9999;
    font-size: 13px;
    color: var(--muted);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.cookie-banner p { margin: 0; }
.cookie-banner a { color: var(--accent); }
.cookie-banner-btns { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-btn {
    padding: 6px 16px; border-radius: 6px;
    border: 1.5px solid var(--border);
    cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit;
}
.cookie-btn-accept { background: var(--accent); color: white; border-color: var(--accent); }
.cookie-btn-accept:hover { opacity: 0.9; }
.cookie-btn-decline { background: none; color: var(--muted); }
.cookie-btn-decline:hover { border-color: var(--muted); }

/* ── Navigation ───────────────────────────────────────────────────────── */
.site-nav {
    background: var(--nav-bg);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow: var(--shadow-sm);
}
.nav-inner {
    max-width: var(--max-wide);
    margin: 0 auto;
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.nav-logo {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.02em;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-logo:hover { color: var(--accent2); }
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.nav-links a {
    color: rgba(240,240,240,0.75);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav-links a.active { color: var(--accent); }

/* Hamburger (mobile) */
.nav-toggle-input { display: none; }
.nav-hamburger {
    display: none;
    cursor: pointer;
    color: rgba(240,240,240,0.8);
    font-size: 22px;
    padding: 4px;
    margin-left: auto;
    line-height: 1;
}

/* Theme toggle */
.theme-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px;
    background: none; border: 1.5px solid rgba(255,255,255,0.2);
    cursor: pointer; color: rgba(240,240,240,0.75);
    transition: all var(--transition); flex-shrink: 0; margin-left: auto;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── Category badge ───────────────────────────────────────────────────── */
.category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: white;
    text-decoration: none;
}
.category-badge:hover { opacity: 0.88; }

/* ── Homepage ─────────────────────────────────────────────────────────── */
.news-homepage { min-height: 100vh; }

.homepage-hero {
    background: var(--nav-bg);
    padding: 52px 24px 48px;
    text-align: center;
    border-bottom: 3px solid var(--accent);
}
.hero-title {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 10px;
}
.hero-title span { color: var(--accent); }
.hero-tagline {
    font-size: clamp(14px, 2vw, 17px);
    color: rgba(240,240,240,0.6);
    font-weight: 400;
    max-width: 480px;
    margin: 0 auto;
}

/* Category landing pages reuse .homepage-hero with a category-color accent */
.category-hero { border-bottom-width: 4px; }
.category-hero-badge { margin-bottom: 14px; }

.homepage-content {
    max-width: var(--max-wide);
    margin: 0 auto;
    padding: 48px 20px 80px;
}

.masthead-date {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 28px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

/* Category badge shown inside article cards */
.card-category {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: white;
    margin-bottom: 10px;
}

/* ── Top stories: lead + secondary ───────────────────────────────────── */
.top-stories {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
    align-items: stretch;
}
.top-stories-solo { grid-template-columns: 1fr; }

.lead-story .card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    transition: box-shadow var(--transition), border-color var(--transition);
}
.lead-story .card-link:hover { box-shadow: var(--shadow-md); border-color: var(--accent); }
.lead-image {
    width: 100%;
    height: 320px;
    object-fit: cover;
    display: block;
}
.top-stories-solo .lead-image { height: 420px; }
.lead-content { padding: 24px 28px; }
.featured-headline {
    font-size: clamp(22px, 3.5vw, 32px);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    margin: 0 0 14px;
    letter-spacing: -0.02em;
}
.featured-excerpt {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 16px;
    max-width: 700px;
}

.secondary-stories {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.secondary-card { flex: 1; }
.secondary-card .card-link {
    display: flex;
    gap: 14px;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    transition: all var(--transition);
}
.secondary-card .card-link:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.secondary-image {
    width: 120px;
    height: 100%;
    min-height: 110px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}
.secondary-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 14px 16px 14px 0;
}
.secondary-content .card-headline {
    font-size: 15px;
    margin: 0 0 8px;
    flex: 0 0 auto;
}
.secondary-excerpt {
    margin-bottom: 10px;
}

/* ── Horizontal scroll section ───────────────────────────────────────── */
.scroll-section { margin-bottom: 40px; }
.scroll-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.scroll-row::-webkit-scrollbar { height: 6px; }
.scroll-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.thumb-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
}
.thumb-card .card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    transition: all var(--transition);
}
.thumb-card .card-link:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.thumb-image {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}
.thumb-content {
    padding: 12px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.thumb-content .card-headline {
    font-size: 14px;
    margin: 0 0 8px;
}

/* ── Article grid ─────────────────────────────────────────────────────── */
.articles-grid { margin-bottom: 40px; }
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
/* Infinite-scroll ad breaks span the full grid width as a banner */
.grid .affiliate-ad {
    grid-column: 1 / -1;
}

.feed-sentinel {
    height: 1px;
}

/* ── Search page ──────────────────────────────────────────────────────── */
.search-page { margin-bottom: 40px; }
.search-input {
    width: 100%;
    font-size: 18px;
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    margin-bottom: 16px;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-meta {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
}

.article-card .card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    transition: all var(--transition);
}
.article-card .card-link:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    transform: translateY(-2px);
}
.card-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}
.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 22px;
}
.card-headline {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
    margin: 0 0 8px;
    flex: 1;
}
.card-excerpt {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 12px;
}
.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}
.card-source { font-weight: 600; }
.card-date   { opacity: 0.75; }

.no-articles {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    font-size: 15px;
}

/* ── Article page ─────────────────────────────────────────────────────── */
.article-wrapper {
    max-width: var(--max-content);
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.article-header {
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}
.article-meta-top { margin-bottom: 14px; }

.article-wrapper h1 {
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--text);
    margin-bottom: 16px;
}

.article-byline {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}
.byline-author { font-weight: 600; color: var(--text-secondary); }
.byline-sep    { margin: 0 3px; }

/* Hero image */
.article-hero {
    margin: 0 0 28px;
}
.article-hero img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius);
}
.article-hero figcaption {
    font-size: 11px;
    color: var(--muted);
    text-align: right;
    margin-top: 6px;
}
.article-hero figcaption a { color: var(--muted); text-decoration: underline; }

/* Article body */
.article-body { line-height: 1.75; }

/* Affiliate ad cards */
.affiliate-ad {
    margin: 32px 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.ad-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}
.ad-card-link {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
}
.ad-image {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}
.ad-content { flex: 1; min-width: 0; }
.ad-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.ad-tagline {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}
.ad-cta {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}
.ad-card-link:hover .ad-cta { text-decoration: underline; }

@media (max-width: 480px) {
    .ad-card-link { flex-direction: column; align-items: flex-start; }
    .ad-image { width: 100%; height: 140px; }
}

.article-lede p {
    font-size: 19px;
    font-weight: 400;
    line-height: 1.65;
    color: var(--text);
    margin-bottom: 28px;
}

.article-section { margin-bottom: 36px; }
.article-section h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
    line-height: 1.3;
}
.article-section p,
.article-body p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.75;
}
[data-theme="dark"] .article-section p,
[data-theme="dark"] .article-body p { color: #c8c8d8; }

/* Dingo Take section */
.dingo-take {
    background: var(--surface);
    border-left: 5px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 28px 32px;
    margin: 40px 0;
}
.dingo-take h2 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}
.dingo-take p {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 14px;
    font-style: italic;
    line-height: 1.7;
}
[data-theme="dark"] .dingo-take p { color: #ddddf0; }

/* Contributor-submitted articles */
.contributor-body h2,
.contributor-body h3 { color: var(--accent); margin: 24px 0 10px; }
.contributor-body ul,
.contributor-body ol { padding-left: 24px; margin-bottom: 16px; }
.contributor-body li { margin-bottom: 6px; font-size: 16px; color: var(--text-secondary); }
.contributor-body blockquote {
    border-left: 4px solid var(--accent);
    padding: 12px 20px;
    margin: 20px 0;
    background: var(--surface);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Sources */
.article-sources {
    margin: 40px 0 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.article-sources h3 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}
.article-sources ul { list-style: none; }
.article-sources li { font-size: 14px; }
.article-sources a { color: var(--accent); text-decoration: none; }
.article-sources a:hover { text-decoration: underline; }

/* Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}
.tag {
    background: var(--surface2);
    color: var(--muted);
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    white-space: nowrap;
}

/* Related articles */
.related-articles {
    margin: 40px 0;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.back-to-news {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.back-to-news a {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
}
.back-to-news a:hover { color: var(--accent); }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--nav-bg);
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 40px 24px;
    text-align: center;
    margin-top: 40px;
}
.footer-inner { max-width: var(--max-wide); margin: 0 auto; }
.footer-brand {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}
.footer-tagline {
    font-size: 13px;
    color: rgba(240,240,240,0.45);
    margin-bottom: 16px;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.footer-links a {
    font-size: 13px;
    color: rgba(240,240,240,0.55);
    text-decoration: none;
}
.footer-links a:hover { color: rgba(240,240,240,0.9); }
.footer-copy {
    font-size: 12px;
    color: rgba(240,240,240,0.3);
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .nav-links { display: none; flex-direction: column; gap: 0; }
    .nav-hamburger { display: block; }
    .nav-toggle-input:checked ~ .nav-links {
        display: flex;
        position: absolute;
        top: 56px; left: 0; right: 0;
        background: var(--nav-bg);
        padding: 8px 0 16px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        z-index: 99;
    }
    .nav-toggle-input:checked ~ .nav-links a {
        padding: 10px 20px;
        border-radius: 0;
    }
    .nav-inner { position: relative; flex-wrap: wrap; height: auto; min-height: 56px; padding: 0 16px; }
    .theme-toggle { margin-left: 0; }

    .homepage-hero { padding: 36px 16px 32px; }
    .homepage-content { padding: 32px 16px 60px; }
    .grid { grid-template-columns: 1fr; }
    .article-wrapper { padding: 28px 16px 60px; }
    .dingo-take { padding: 20px 20px; }

    .top-stories { grid-template-columns: 1fr; }
    .lead-image { height: 220px; }
    .top-stories-solo .lead-image { height: 260px; }
    .secondary-image { width: 96px; min-height: 90px; }
    .thumb-card { flex: 0 0 200px; }
    .thumb-image { height: 110px; }
    .card-thumb { height: 140px; }

    .related-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 480px) {
    .cookie-banner { flex-direction: column; align-items: flex-start; gap: 10px; }
    .footer-links { flex-direction: column; gap: 10px; }
}
