/*
Theme Name: A16Z News
Theme URI: https://example.com
Author: AIverse
Description: A clean editorial WordPress theme inspired by a16z.news — serif typography, warm off-white background, magazine layout.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: a16z-news
Tags: news, magazine, blog, responsive, custom-menu
*/

:root {
    --bg:           #f0ede8;
    --bg-card:      #ebe8e2;
    --text:         #1a1a1a;
    --muted:        #6b6b6b;
    --light:        #999;
    --accent:       #8b1a1a;
    --border:       #ddd9d2;
    --serif:        'Playfair Display', Georgia, 'Times New Roman', serif;
    --sans:         'DM Sans', 'Helvetica Neue', Arial, sans-serif;
    --max:          1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

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

/* ── HEADER ───────────────────────────────────── */
#site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.header-top {
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; padding: 0 24px;
    max-width: var(--max); margin: 0 auto; position: relative;
}
.site-logo-circle {
    width: 36px; height: 36px; border-radius: 50%;
    background: #c8a465;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--serif); font-size: 13px; font-weight: 700; color: #fff;
    flex-shrink: 0;
}
.site-tagline {
    font-family: var(--serif); font-style: italic;
    font-size: 22px; font-weight: 400; letter-spacing: -0.2px;
    position: absolute; left: 50%; transform: translateX(-50%);
    white-space: nowrap;
}
.header-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn {
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: 17px; padding: 4px;
    transition: color 0.2s; line-height: 1;
}
.icon-btn:hover { color: var(--text); }
.btn-subscribe {
    background: var(--accent); color: #fff;
    padding: 7px 16px; border-radius: 4px;
    font-family: var(--sans); font-size: 13px; font-weight: 600;
    border: none; cursor: pointer; transition: opacity 0.2s; display: inline-block;
}
.btn-subscribe:hover { opacity: 0.85; color: #fff; }
.btn-signin { font-size: 13px; font-weight: 500; color: var(--text); transition: color 0.2s; }
.btn-signin:hover { color: var(--accent); }

/* Primary Nav */
.primary-nav { border-top: 1px solid var(--border); }
.primary-nav .nav-inner {
    max-width: var(--max); margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: center; height: 42px;
    overflow-x: auto; gap: 0; scrollbar-width: none;
}
.primary-nav .nav-inner::-webkit-scrollbar { display: none; }
.primary-nav a {
    font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--muted);
    padding: 0 14px; height: 42px; display: flex; align-items: center;
    border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s;
    white-space: nowrap; flex-shrink: 0;
}
.primary-nav a:hover, .primary-nav a.current-menu-item {
    color: var(--text); border-bottom-color: var(--text);
}

/* Mobile toggle */
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; font-size: 22px; color: var(--text); }
.mobile-nav { display: none; background: var(--bg); border-top: 1px solid var(--border); padding: 12px 24px 20px; }
.mobile-nav a { display: block; padding: 10px 0; font-size: 15px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--border); }
.mobile-nav.open { display: block; }

/* ── HERO SECTION ─────────────────────────────── */
.hero-section { padding: 30px 0 36px; border-bottom: 1px solid var(--border); }
.hero-inner {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 36px; align-items: start;
}

/* Featured post */
.featured-post__image-wrap { position: relative; overflow: hidden; }
.featured-post__image-wrap img {
    width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block;
    transition: transform 0.4s;
}
.featured-post__image-wrap:hover img { transform: scale(1.02); }
.featured-post__img-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 35%, transparent 70%);
    pointer-events: none;
}
.featured-post__img-title {
    position: absolute; bottom: 22px; left: 22px; right: 22px;
    font-family: var(--serif); font-size: 26px; font-weight: 700;
    color: #fff; line-height: 1.22; text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.featured-post__img-author {
    position: absolute; bottom: 0; left: 22px;
    font-size: 12px; color: rgba(255,255,255,0.75); padding-bottom: 10px;
}
.featured-post__title {
    font-family: var(--serif); font-size: 24px; font-weight: 700;
    line-height: 1.25; margin-top: 16px; color: var(--text);
    transition: color 0.2s;
}
.featured-post__title:hover { color: var(--accent); }
.featured-post__excerpt {
    font-size: 14px; color: var(--muted); margin-top: 7px; line-height: 1.5;
}
.featured-post__meta {
    display: flex; align-items: center; gap: 7px;
    margin-top: 12px; font-size: 11px; color: var(--light);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.meta-avatar {
    width: 18px; height: 18px; border-radius: 50%;
    background: #c8a465; flex-shrink: 0; overflow: hidden;
}
.meta-avatar img { width: 100%; height: 100%; object-fit: cover; }
.featured-post__stats {
    display: flex; align-items: center; gap: 18px;
    margin-top: 12px; font-size: 13px; color: var(--muted);
}
.featured-post__stats span { display: flex; align-items: center; gap: 4px; }

/* Hero sidebar list */
.hero-sidebar__item {
    display: grid; grid-template-columns: 1fr 84px; gap: 14px;
    padding: 16px 0; border-bottom: 1px solid var(--border); align-items: start;
}
.hero-sidebar__item:first-child { border-top: 1px solid var(--border); }
.hero-sidebar__title {
    font-family: var(--serif); font-size: 15px; font-weight: 700;
    line-height: 1.3; color: var(--text); transition: color 0.2s;
}
.hero-sidebar__item:hover .hero-sidebar__title { color: var(--accent); }
.hero-sidebar__excerpt {
    font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-sidebar__meta {
    display: flex; align-items: center; gap: 5px;
    margin-top: 7px; font-size: 11px; color: var(--light);
    text-transform: uppercase; letter-spacing: 0.4px;
}
.hero-sidebar__thumb {
    width: 84px; height: 63px; object-fit: cover; flex-shrink: 0;
}
.thumb-placeholder {
    width: 84px; height: 63px; flex-shrink: 0;
    background: linear-gradient(135deg, #3a3328 0%, #5a5045 100%);
}

/* ── CATEGORY SECTIONS ───────────────────────── */
.category-section { padding: 36px 0; border-bottom: 1px solid var(--border); }
.section-header {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 22px;
}
.section-title { font-family: var(--serif); font-size: 22px; font-weight: 700; }
.view-all {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--muted); transition: color 0.2s;
}
.view-all:hover { color: var(--accent); }

/* 4-col card grid */
.cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }

.article-card { display: block; cursor: pointer; }
.article-card__img-wrap { overflow: hidden; }
.article-card__img-wrap img {
    width: 100%; aspect-ratio: 1/1; object-fit: cover;
    transition: transform 0.4s;
}
.article-card:hover .article-card__img-wrap img { transform: scale(1.03); }

/* placeholder with overlay title */
.card-img-placeholder {
    width: 100%; aspect-ratio: 1/1;
    background: linear-gradient(145deg, #2a2520 0%, #4a4038 100%);
    position: relative; overflow: hidden;
    display: flex; align-items: flex-end;
}
.card-img-placeholder::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 45%, transparent 100%);
}
.card-img-placeholder__title {
    font-family: var(--serif); font-size: 14px; font-weight: 700;
    color: #fff; line-height: 1.28; padding: 14px;
    position: relative; z-index: 1;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.article-card__body { padding: 11px 0 0; }
.article-card__title {
    font-family: var(--serif); font-size: 15px; font-weight: 700;
    line-height: 1.3; color: var(--text); transition: color 0.2s;
}
.article-card:hover .article-card__title { color: var(--accent); }
.article-card__excerpt {
    font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card__meta {
    display: flex; align-items: center; gap: 5px;
    margin-top: 7px; font-size: 11px; color: var(--light);
    text-transform: uppercase; letter-spacing: 0.4px;
}

/* ── SINGLE ARTICLE ──────────────────────────── */
.single-wrap { max-width: 720px; margin: 48px auto; padding: 0 24px; }
.single-category {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--accent); margin-bottom: 14px;
}
.single-title {
    font-family: var(--serif); font-size: 38px; font-weight: 700;
    line-height: 1.15; margin-bottom: 14px;
}
.single-subtitle {
    font-family: var(--serif); font-size: 19px; font-style: italic;
    color: var(--muted); margin-bottom: 22px; line-height: 1.45;
}
.single-meta {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
    color: var(--muted); padding: 14px 0;
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}
.single-meta-avatar { width: 30px; height: 30px; border-radius: 50%; background: #c8a465; flex-shrink: 0; overflow: hidden; }
.single-meta-avatar img { width: 100%; height: 100%; object-fit: cover; }
.single-featured-img { width: 100%; margin-bottom: 30px; }
.single-content {
    font-family: var(--serif); font-size: 18px; line-height: 1.78; color: var(--text);
}
.single-content p { margin-bottom: 1.5em; }
.single-content h2 { font-size: 26px; margin: 1.8em 0 0.7em; }
.single-content h3 { font-size: 22px; margin: 1.5em 0 0.6em; }
.single-content blockquote {
    border-left: 3px solid var(--border); padding-left: 20px;
    color: var(--muted); font-style: italic; margin: 1.5em 0;
}
.single-content img { margin: 1.5em 0; width: 100%; }
.single-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 40px; }
.single-tag {
    font-size: 12px; padding: 4px 10px; border: 1px solid var(--border);
    border-radius: 2px; color: var(--muted); transition: border-color 0.2s;
}
.single-tag:hover { border-color: var(--text); color: var(--text); }

/* ── FOOTER ──────────────────────────────────── */
#site-footer {
    background: var(--bg); border-top: 1px solid var(--border);
    padding: 48px 0 28px; margin-top: 60px;
}
.footer-inner {
    display: grid; grid-template-columns: 200px 1fr 1fr 1fr;
    gap: 40px; margin-bottom: 36px;
}
.footer-logo-circle {
    width: 38px; height: 38px; border-radius: 50%; background: #c8a465;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--serif); font-size: 14px; font-weight: 700; color: #fff;
    margin-bottom: 12px;
}
.footer-brand-name { font-family: var(--serif); font-size: 18px; font-weight: 700; display: block; margin-bottom: 5px; }
.footer-brand-tag { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--muted); }
.footer-col-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--muted); margin-bottom: 14px;
}
.footer-col ul li { margin-bottom: 9px; }
.footer-col ul li a { font-size: 14px; color: var(--muted); transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--text); }
.footer-bottom {
    border-top: 1px solid var(--border); padding-top: 22px;
    display: flex; align-items: center; justify-content: space-between;
}
.footer-copy { font-size: 13px; color: var(--light); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--light); transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }

/* ── SEARCH OVERLAY ──────────────────────────── */
.search-overlay {
    position: fixed; inset: 0; background: rgba(240,237,232,0.96);
    z-index: 200; display: flex; align-items: flex-start;
    justify-content: center; padding-top: 110px;
    opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.search-overlay.active { opacity: 1; pointer-events: all; }
.search-overlay-inner { width: 100%; max-width: 580px; padding: 0 24px; }
.search-form {
    display: flex; align-items: center; gap: 12px;
    border-bottom: 2px solid var(--text); padding-bottom: 10px;
}
.search-input {
    flex: 1; background: none; border: none; outline: none;
    font-family: var(--serif); font-size: 28px; color: var(--text);
    caret-color: var(--accent);
}
.search-input::placeholder { color: var(--light); }
.search-close { background: none; border: none; cursor: pointer; font-size: 22px; color: var(--muted); }

/* ── PAGINATION ──────────────────────────────── */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; padding: 40px 0;
}
.pagination a, .pagination span {
    width: 36px; height: 36px; display: flex; align-items: center;
    justify-content: center; font-size: 14px; color: var(--muted);
    border: 1px solid var(--border); transition: all 0.2s;
}
.pagination a:hover, .pagination .current {
    background: var(--text); color: #fff; border-color: var(--text);
}

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 1024px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-sidebar { display: none; }
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .site-tagline { font-size: 17px; }
    .btn-signin { display: none; }
    .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .single-title { font-size: 28px; }
    .footer-inner { grid-template-columns: 1fr; gap: 24px; }
    .mobile-toggle { display: block; }
}
@media (max-width: 480px) {
    .cards-grid { grid-template-columns: 1fr; }
    .header-top { padding: 0 16px; }
}
