/**
 * Amazon Now Selection - Shared Styles
 * Adapted from SSDGrocerySelection design system
 * Import on every page: <link rel="stylesheet" href="/shared/shared.css">
 * Provides: fonts, design tokens, header banner, breadcrumbs, base typography,
 *           nav bar styles, site-directory footer, tab-nav, KPI cards, tables.
 *
 * Font system:
 *   --font-display: Plus Jakarta Sans — titles, headers, section labels
 *   --font-body:    Space Grotesk — body text, tables, KPIs, chart labels, data
 *   --font-serif:   CMU Serif — whitepaper body text (academic/LaTeX feel)
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
    /* Colors */
    --color-orange: #ff9900;
    --color-orange-rgb: 255, 153, 0;
    --color-dark: #16191f;
    --color-dark-secondary: #232f3e;
    --color-text: #16191f;
    --color-text-secondary: #37475a;
    --color-text-muted: #545b64;
    --color-text-light: #687078;
    --color-link: #0073bb;
    --color-bg: #f2f3f3;
    --color-bg-white: #ffffff;
    --color-border: #d5dbdb;
    --color-border-light: #eaeded;
    --color-success: #1d8102;
    --color-error: #d13212;

    /* Fonts */
    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: 'CMU Serif', 'Computer Modern', Georgia, serif;
    --font-sans: var(--font-display);

    /* Layout */
    --max-width: 1100px;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Base body ─────────────────────────────────────────────────────────── */
body {
    margin: 0; padding: 0;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    letter-spacing: 0.005em;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); }
table, .kpi-value { font-variant-numeric: tabular-nums; }
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eaeded; padding: 1px 5px; border-radius: 3px; font-size: 13px; }

/* ── Site header ───────────────────────────────────────────────────────── */
.site-header {
    background: linear-gradient(135deg, #f9f5ee 0%, #f2ece0 100%);
    padding: 14px 32px;
    border-bottom: 3px solid var(--color-orange);
}
.site-header-inner {
    max-width: var(--max-width); margin: 0 auto;
    display: flex; align-items: center; justify-content: center; gap: 24px;
}
.site-header-text { text-align: center; flex: 1; }
.site-header-text h1 {
    margin: 0; font-family: var(--font-display);
    font-size: 26px; font-weight: 800; color: var(--color-dark);
    letter-spacing: 0.5px;
}
.site-header-text p {
    margin: 4px 0 0; font-family: var(--font-body);
    font-size: 12px; color: var(--color-text-muted);
}

/* ── Container ─────────────────────────────────────────────────────────── */
.site-container {
    max-width: var(--max-width); margin: 0 auto;
    padding: 24px 20px 48px;
}

/* ── Breadcrumbs ──────────────────────────────────────────────────────── */
.breadcrumbs {
    font-family: var(--font-body); font-size: 12px;
    color: var(--color-text-light); margin: 0 0 16px;
}
.breadcrumbs a { color: var(--color-link); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 6px; color: #aab7b8; }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
    background: var(--color-bg-white); border: 1px solid var(--color-border);
    border-radius: 8px; padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ── Section headings ──────────────────────────────────────────────────── */
.section { margin-bottom: 32px; }
.section-title {
    font-family: var(--font-display);
    font-size: 20px; font-weight: 700; color: var(--color-text);
    margin: 0 0 4px; padding-bottom: 8px; border-bottom: 2px solid #e8e8e8;
}
.section-subtitle { font-size: 13px; color: var(--color-text-muted); margin: 0 0 16px; }

/* ── Tab navigation ────────────────────────────────────────────────────── */
.tab-nav { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--color-border-light); }
.tab-btn {
    padding: 12px 24px; border: none; background: none; cursor: pointer;
    font-family: var(--font-display); font-size: 14px; font-weight: 500;
    color: var(--color-text-muted); border-bottom: 2px solid transparent;
    margin-bottom: -1px; transition: all 0.15s ease;
}
.tab-btn:hover:not(.active) { color: var(--color-text); }
.tab-btn.active { color: var(--color-orange); border-bottom-color: var(--color-orange); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── KPI cards ─────────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: var(--color-bg-white); border: 1px solid var(--color-border); border-radius: 8px; padding: 18px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); text-align: center; }
.kpi-label {
    font-family: var(--font-body); font-size: 12px;
    color: var(--color-text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.kpi-value {
    font-family: var(--font-display); font-size: 32px; font-weight: 700;
    color: var(--color-orange);
}

/* ── Tables (shared base) ──────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
    background: var(--color-dark-secondary); color: #fff;
    padding: 10px 12px; text-align: left;
    font-weight: 500; font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}
thead th:first-child { border-radius: 6px 0 0 0; }
thead th:last-child { border-radius: 0 6px 0 0; }
tbody td {
    padding: 9px 12px; border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text);
}
tbody tr:nth-child(even) { background: #fafafa; }
tbody tr:hover { background: #f0f5fa; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
    padding: 9px 24px; border: none; border-radius: 4px;
    font-size: 14px; cursor: pointer; font-weight: 600;
    transition: all 0.15s ease; letter-spacing: 0.2px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--color-orange); color: #fff; }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--color-orange) 80%, #000); }
.btn-secondary { background: #e9ebed; color: var(--color-text); }
.btn-secondary:hover:not(:disabled) { background: #d5dbdb; }

/* ── Messages ──────────────────────────────────────────────────────────── */
.message { padding: 14px 18px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; line-height: 1.5; }
.success-message { background: #f2fcf3; border: 1px solid var(--color-success); color: var(--color-success); }
.error-message { background: #fdf3f1; border: 1px solid var(--color-error); color: var(--color-error); }

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block; margin-top: 10px; padding: 2px 9px;
    border-radius: 4px; font-size: 11px; font-weight: 700;
    letter-spacing: 0.3px; text-transform: uppercase;
}
.badge.live { background: #e6f9e6; color: var(--color-success); }
.badge.slack { background: #e8f0fe; color: var(--color-link); }
.badge.coming { background: #fdf3f1; color: var(--color-error); }

/* ── Content page utility classes ──────────────────────────────────────── */
.page-header { margin-bottom: 8px; }
.page-header h1 { font-size: 28px; font-weight: 800; margin: 0 0 4px; }
.page-meta { font-size: 12px; color: var(--color-text-light); margin: 0 0 20px; }

.content-section { margin-bottom: 32px; }
.content-section h2 { font-size: 20px; font-weight: 700; margin: 0 0 4px; padding-bottom: 8px; border-bottom: 2px solid #e8e8e8; }
.content-section h3 { font-size: 16px; font-weight: 700; margin: 20px 0 8px; }
.content-section p { margin: 0 0 12px; line-height: 1.7; }
.content-section ul, .content-section ol { margin: 0 0 12px; padding-left: 24px; }
.content-section li { margin-bottom: 6px; line-height: 1.6; }

.callout { border-radius: 6px; padding: 14px 18px; margin: 16px 0; font-size: 13px; line-height: 1.6; }
.callout-info { background: #e8f4fd; border-left: 4px solid var(--color-link); }
.callout-warn { background: #fef7e0; border-left: 4px solid #d4a017; }
.callout-gap { background: #fdf3f1; border-left: 4px solid var(--color-error); }
.callout-label { font-weight: 700; margin-right: 4px; }

/* ── Team cards ────────────────────────────────────────────────────────── */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 20px; }
.team-card { background: var(--color-bg-white); border: 1px solid var(--color-border); border-radius: 10px; padding: 20px; display: flex; gap: 16px; align-items: flex-start; box-shadow: 0 1px 3px rgba(0,0,0,0.04); transition: box-shadow 0.15s; }
.team-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.team-card img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid #4A90D9; flex-shrink: 0; }
.team-card.badge-orange img { border-color: #FF9900; }
.team-card-info { flex: 1; }
.team-card-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.team-card-name a { color: inherit; text-decoration: none; }
.team-card-name a:hover { color: var(--color-orange); }
.team-card-charter { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }
.team-card-charter a { color: var(--color-orange); font-weight: 500; text-decoration: none; }
.team-card-charter a:hover { text-decoration: underline; }
.team-card-bio { font-size: 12px; color: var(--color-text-muted); margin-top: 8px; font-style: italic; }
.team-card-links { margin-top: 8px; display: flex; gap: 12px; font-size: 12px; }
.team-card-links a { color: var(--color-orange); text-decoration: none; }
.team-card-links a:hover { text-decoration: underline; }
.team-card-links span { color: var(--color-text-muted); }

/* ── Tenets ─────────────────────────────────────────────────────────────── */
.tenets { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.tenet { background: var(--color-bg-white); border: 1px solid var(--color-border-light); border-radius: 6px; padding: 12px 16px; font-size: 13px; }
.tenet strong { color: var(--color-orange); }

/* ── Contact bar ────────────────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.contact-card { background: var(--color-bg-white); border: 1px solid var(--color-border); border-radius: 8px; padding: 14px 18px; text-align: center; }
.contact-card .contact-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--color-text-light); margin: 0 0 4px; }
.contact-card a, .contact-card span { font-size: 13px; }

/* ── Quick links grid ──────────────────────────────────────────────────── */
.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 32px; }
.quick-link { display: flex; align-items: center; gap: 12px; background: var(--color-bg-white); border: 1px solid var(--color-border); border-radius: 8px; padding: 16px 20px; text-decoration: none; color: var(--color-text); transition: all 0.15s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.quick-link:hover { border-color: var(--color-orange); box-shadow: 0 2px 8px rgba(255,153,0,0.12); text-decoration: none; transform: translateY(-1px); }
.quick-link .icon { font-size: 24px; flex-shrink: 0; }
.quick-link .ql-text { flex: 1; }
.quick-link .ql-title { font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.quick-link .ql-desc { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }

/* ── Site Navigation Bar ───────────────────────────────────────────────── */
.site-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: #1a2332;
    height: 48px;
    font-family: var(--font-body);
}
.site-nav-inner {
    max-width: none; margin: 0;
    display: flex; align-items: center;
    height: 100%; padding: 0 30px;
}
.nav-home {
    display: flex; align-items: center; gap: 16px;
    text-decoration: none; color: #fff;
    margin-right: auto;
}
.nav-home:hover { text-decoration: none; }
.nav-icon { font-size: 20px; }
.nav-team {
    font-family: var(--font-display);
    font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.85);
    letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap;
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link-btn {
    background: none; border: none; color: #c8d0d8;
    font-family: var(--font-body); font-size: 13px; font-weight: 500;
    padding: 8px 14px; cursor: pointer; border-radius: 4px;
    transition: all 0.15s ease; text-decoration: none;
    white-space: nowrap;
}
.nav-link-btn:hover { color: #fff; background: rgba(255,255,255,0.08); text-decoration: none; }
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
    background: none; border: none; color: #c8d0d8;
    font-family: var(--font-body); font-size: 13px; font-weight: 500;
    padding: 8px 14px; cursor: pointer; border-radius: 4px;
    transition: all 0.15s ease; letter-spacing: 0.2px;
    white-space: nowrap;
}
.nav-dropdown-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-dropdown-content {
    display: none; position: absolute; top: 100%; left: 0;
    background: #1e2a3a; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px; min-width: 260px; padding: 6px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    margin-top: 4px;
}
.nav-dropdown:last-of-type .nav-dropdown-content { left: auto; right: 0; }
.nav-dropdown-content.open { display: block; }
.nav-dropdown-content a {
    display: block; padding: 9px 18px; color: #c8d0d8;
    font-size: 13px; text-decoration: none;
    transition: all 0.1s ease;
}
.nav-dropdown-content a:hover {
    background: rgba(var(--color-orange-rgb),0.1); color: var(--color-orange);
    text-decoration: none;
}
.nav-section-label {
    padding: 8px 18px 4px; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px; color: #667788;
}
.nav-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 6px 0; }

/* ── Site Directory Footer ─────────────────────────────────────────────── */
.site-directory {
    background: #1e2a3a; color: #8899aa;
    margin-top: 48px; padding: 40px 24px 0;
    font-family: var(--font-body); font-size: 13px;
}
.site-directory-inner {
    max-width: 1100px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.dir-col h4 {
    font-family: var(--font-display);
    font-size: 12px; font-weight: 700; color: #fff;
    text-transform: uppercase; letter-spacing: 0.8px;
    margin: 0 0 12px; padding-bottom: 8px;
    border-bottom: 2px solid var(--color-orange);
    display: inline-block;
}
.dir-col a {
    display: block; color: #8899aa; text-decoration: none;
    padding: 4px 0; font-size: 13px;
    transition: color 0.15s ease;
}
.dir-col a:hover { color: var(--color-orange); text-decoration: none; }
.dir-bottom {
    max-width: 1100px; margin: 0 auto;
    text-align: center; padding: 20px 0;
    color: #556677; font-size: 12px;
}
.dir-bottom p { margin: 0; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .site-header-inner { flex-direction: column; }
    .site-directory-inner { grid-template-columns: repeat(2, 1fr); gap: 24px; }
    .nav-team { display: none; }
    .nav-dropdown-btn { padding: 8px 8px; font-size: 12px; }
    .contact-grid { grid-template-columns: repeat(2, 1fr); }
}
