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

:root {
    --bg: #0d1117;
    --bg-card: #161b22;
    --bg-card-hover: #1c2129;
    --text: #e6edf3;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #1f6feb;
    --border: #30363d;
    --max-width: 1200px;
    --article-width: 720px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }

/* ===== Header ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 17, 23, .95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    letter-spacing: -0.02em;
}
.logo:hover { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color .2s;
}
.nav a:hover { color: var(--text); }

.nav a.nav-cta {
    background: var(--accent);
    color: var(--bg);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-weight: 600;
}
.nav a.nav-cta:hover { background: var(--accent-hover); color: #fff; }

/* Burger */
.burger { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
    transition: .3s;
}
.burger--open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger--open span:nth-child(2) { opacity: 0; }
.burger--open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== Main ===== */
.main { flex: 1; padding: 2rem 0; }

/* ===== Hero (Photo of Day on homepage) ===== */
.hero { margin-bottom: 2.5rem; }

.hero-link {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.hero-img {
    width: 100%;
    aspect-ratio: 21/9;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0,0,0,.8));
}

.hero-label {
    display: inline-block;
    background: var(--accent);
    color: var(--bg);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    color: #fff;
    margin-bottom: 0.25rem;
}

.hero-date { color: rgba(255,255,255,.7); font-size: 0.85rem; }

/* ===== Articles Grid ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: border-color .2s, transform .2s;
}
.card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.card-link { display: block; color: inherit; }
.card-link:hover { color: inherit; }

.card-img-wrap { aspect-ratio: 16/9; overflow: hidden; }
.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.card:hover .card-img { transform: scale(1.03); }

.card-body { padding: 1rem 1.25rem; }

.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.tag-badge {
    background: rgba(88, 166, 255, .15);
    color: var(--accent);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
    padding: 1rem 0;
}

.pagination-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
}
.pagination-link:hover { border-color: var(--accent); }

.pagination-info { color: var(--text-secondary); font-size: 0.9rem; }

/* ===== Article Detail ===== */
.article-hero {
    width: 100%;
    max-height: 60vh;
    overflow: hidden;
}

.article-hero-img {
    width: 100%;
    max-height: 60vh;
    object-fit: cover;
}

.article-container { max-width: var(--article-width); padding-top: 2rem; }

.article-header { margin-bottom: 2rem; }

.article-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.article-source {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.tag-link {
    background: rgba(88, 166, 255, .15);
    color: var(--accent);
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
}
.tag-link:hover { background: rgba(88, 166, 255, .25); }

.article-body {
    font-size: 1.05rem;
    line-height: 1.8;
}
.article-body p { margin-bottom: 1.25rem; }
.article-body a { text-decoration: underline; }
.article-body b, .article-body strong { font-weight: 600; }

/* ===== Photo Detail ===== */
.photo-hero {
    width: 100%;
    display: flex;
    justify-content: center;
    background: #000;
}

.photo-hero-img {
    max-height: 80vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    cursor: zoom-in;
}

.photo-credit {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== Article Nav (prev/next) ===== */
.article-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.article-nav-link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    max-width: 48%;
    transition: border-color .2s;
}
.article-nav-link:hover { border-color: var(--accent); }

.article-nav-next { text-align: right; margin-left: auto; }

.article-nav-label { font-size: 0.8rem; color: var(--text-secondary); }
.article-nav-title {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 500;
    line-height: 1.4;
}

/* ===== Page Header (tags, archive) ===== */
.page-header { margin-bottom: 2rem; }
.page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
}

.section { margin-bottom: 2.5rem; }
.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* ===== Archive ===== */
.archive-month { margin-bottom: 2rem; }
.archive-month-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.archive-list { list-style: none; }
.archive-item {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(48, 54, 61, .5);
}

.archive-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
    min-width: 3.5rem;
    font-variant-numeric: tabular-nums;
}

.archive-link {
    color: var(--text);
    font-size: 0.95rem;
}
.archive-link:hover { color: var(--accent); }

.empty-state {
    color: var(--text-secondary);
    text-align: center;
    padding: 3rem 0;
    font-size: 1.1rem;
}

/* ===== CTA Block ===== */
.cta-block {
    text-align: center;
    padding: 2rem;
    margin: 2.5rem 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.cta-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.cta-block .cta-button {
    display: inline-block;
    background: var(--accent);
    color: var(--bg);
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background .2s;
}
.cta-block .cta-button:hover { background: var(--accent-hover); color: #fff; }

/* ===== Footer ===== */
.footer {
    margin-top: auto;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}
.footer-links a { color: var(--text-secondary); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }

.footer-credit {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    .nav--open { display: flex; }
    .burger { display: block; }

    .articles-grid { grid-template-columns: 1fr; }

    .hero-title { font-size: 1.25rem; }
    .hero-img { aspect-ratio: 16/9; }

    .article-title { font-size: 1.5rem; }

    .article-nav { flex-direction: column; }
    .article-nav-link { max-width: 100%; }

}

@media (max-width: 480px) {
    html { font-size: 15px; }
    .hero-overlay { padding: 1rem; }
}
