/* Data Stories Lab — shared portfolio stylesheet (Version C theme)
   Used by top-level navigation pages: index, case-studies, interactive-dashboard,
   ai-assistant, contact, about-this-work, and 6 category pages.
   Does NOT affect /case-studies/*.html or /dashboards/*.html (which use style.css). */

:root {
    --navy: #1A1F3A;
    --navy-dark: #111526;
    --gold: #C9A84C;
    --gold-soft: #D4B660;
    --cream: #FAF6EE;
    --cream-alt: #F2EDE0;
    --text: #2A2F4A;
    --text-soft: #5A5F7A;
    --border: #E5DFD0;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--cream);
    line-height: 1.65;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* ── Topbar ── */
.navbar {
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.brand {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--navy);
    letter-spacing: 0.01em;
}
.brand a { color: inherit; text-decoration: none; }
.topnav { display: flex; gap: 1.8rem; }
.topnav a {
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.2s ease;
}
.topnav a:hover { color: var(--navy); }

/* ── Search ── */
.search-section {
    background: var(--cream);
    padding: 1.4rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: center;
}
.search-container {
    position: relative;
    width: 100%;
    max-width: 520px;
}
.search-input {
    width: 100%;
    padding: 12px 44px 12px 18px;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 0.92rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color 0.2s ease;
}
.search-input::placeholder { color: var(--text-soft); }
.search-input:focus { outline: none; border-color: var(--gold); }
.search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-soft);
    pointer-events: none;
}
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(26,31,58,0.08);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    margin-top: 6px;
}
.search-result-item {
    padding: 14px 18px;
    border-bottom: 1px solid var(--cream-alt);
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.search-result-item:hover { background-color: var(--cream-alt); }
.search-result-item:last-child { border-bottom: none; }
.search-result-category {
    font-size: 0.66rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 700;
    margin-bottom: 5px;
}
.search-result-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
    font-size: 1rem;
}
.search-result-description {
    color: var(--text-soft);
    font-size: 0.84rem;
    margin-bottom: 10px;
    line-height: 1.5;
}
.search-result-buttons { display: flex; gap: 8px; }
.search-result-btn {
    padding: 5px 12px;
    border: 1px solid var(--border);
    background: var(--cream);
    color: var(--navy);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all 0.2s ease;
}
.search-result-btn:hover {
    background: var(--navy);
    color: var(--cream);
    border-color: var(--navy);
}
.no-results {
    padding: 22px;
    text-align: center;
    color: var(--text-soft);
    font-style: italic;
}
.search-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26,31,58,0.05);
    z-index: 99;
    display: none;
}

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 4rem 2rem 2rem;
    background: var(--cream);
}
.hero-eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 1rem;
}
.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.1;
    color: var(--navy);
    font-weight: 900;
    margin: 0 0 1.2rem 0;
}
.hero-title em { color: var(--gold); font-style: normal; }
.hero-tagline {
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    color: var(--text-soft);
    font-weight: 400;
    margin: 0 auto;
    max-width: 580px;
}

/* Legacy header support: pages using <header><h1>...<p class="tagline"> structure */
body > header {
    text-align: center;
    padding: 4rem 2rem 2rem;
    background: var(--cream);
}
body > header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.6rem, 3vw, 2rem);
    color: var(--navy);
    font-weight: 700;
    margin: 0 0 0.4rem 0;
    opacity: 0.55;
    letter-spacing: 0.02em;
}
body > header .category-title,
body > header .portfolio-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: var(--navy);
    font-weight: 900;
    margin: 0 0 1.2rem 0;
    line-height: 1.1;
}
body > header .tagline {
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    color: var(--text-soft);
    font-weight: 400;
    margin: 0 auto;
    max-width: 580px;
}

/* ── Container & Cards ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 18px;
}
td {
    padding: 1.6rem;
    vertical-align: top;
    text-align: left;
    background: #fff;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}
td:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(26,31,58,0.06);
}
.card-tag {
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 0.7rem;
}
td h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    line-height: 1.3;
}
td h3 a {
    color: var(--navy);
    text-decoration: none;
    transition: color 0.2s ease;
}
td h3 a:hover { color: var(--gold); }
td p {
    font-size: 0.95rem;
    color: var(--text-soft);
    margin: 0 0 1rem 0;
    line-height: 1.55;
}

/* Card buttons (case-study-links pattern) */
.case-study-links { display: flex; gap: 10px; flex-wrap: wrap; }
.case-study-links a {
    display: inline-block;
    padding: 8px 14px;
    background: var(--cream);
    color: var(--navy);
    text-decoration: none;
    border: 1px solid var(--border);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.2s ease;
}
.case-study-links a:hover {
    background: var(--navy);
    color: var(--cream);
    border-color: var(--navy);
}

/* Sort controls (legacy compatibility) */
.sort-controls { margin-bottom: 1.5rem; padding: 0; background: transparent; }
.sort-label {
    font-size: 0.7rem;
    color: var(--text-soft);
    margin-bottom: 8px;
    display: block;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.sort-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.sort-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    background: var(--cream);
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}
.sort-btn:hover, .sort-btn.active {
    background: var(--navy);
    color: var(--cream);
    border-color: var(--navy);
}

.case-study-date {
    font-size: 0.7rem;
    color: var(--text-soft);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

/* ── Footer ── */
footer {
    background: var(--navy);
    color: var(--cream);
    padding: 2.4rem 2rem 1.8rem;
    text-align: center;
    font-size: 0.85rem;
}
footer a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.2s ease;
}
footer a:hover { color: var(--gold-soft); }
footer p { margin: 0; opacity: 0.85; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 1.2rem;
        gap: 0.8rem;
    }
    .topnav { flex-wrap: wrap; gap: 0.4rem 1rem; }
    .topnav a { font-size: 0.78rem; }
    .search-section { padding: 1.2rem; }
    .hero, body > header { padding: 2.5rem 1.2rem 1.5rem; }
    .container { padding: 1rem 1.2rem 2.5rem; }
    table { display: block; }
    tr { display: block; margin-bottom: 16px; }
    td { display: block; width: 100%; padding: 1.2rem; }
    td h3 { font-size: 1.1rem; }
    .case-study-links { flex-direction: column; gap: 6px; }
    .case-study-links a { text-align: center; }
}
