/* =================================================================
   Design V3 — Editorial Finance
   "Bloomberg meets personal blog"
   Playfair Display · DM Sans · IBM Plex Mono
   Primary: Amber Gold #D4A017 (dark) / #9A6B00 (light)
   To rollback: change body class back to "design-v2" in index.html
   ================================================================= */

/* ─── Typography overrides ───────────────────────────────────────── */
body.design-v3,
body.design-v3 .mud-typography-body1,
body.design-v3 .mud-typography-body2,
body.design-v3 .mud-typography-caption,
body.design-v3 .mud-typography-subtitle2,
body.design-v3 .mud-button-label,
body.design-v3 .mud-nav-link-text,
body.design-v3 .mud-input-label,
body.design-v3 .mud-table-cell,
body.design-v3 .mud-chip-content {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif !important;
}

body.design-v3 .mud-typography-h1,
body.design-v3 .mud-typography-h2,
body.design-v3 .mud-typography-h3,
body.design-v3 .mud-typography-h4 {
    font-family: 'Playfair Display', Georgia, serif !important;
    letter-spacing: -0.02em;
}

body.design-v3 .mud-typography-h5,
body.design-v3 .mud-typography-h6 {
    font-family: 'DM Sans', sans-serif !important;
    letter-spacing: -0.01em;
}

body.design-v3 .mud-typography-subtitle1 {
    font-family: 'IBM Plex Mono', monospace !important;
}

/* ─── AppBar ─────────────────────────────────────────────────────── */
body.design-v3 .mud-appbar {
    height: 64px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: none !important;
}

body.design-v3 .mud-appbar .mud-toolbar {
    height: 64px;
}

/* Light mode appbar border */
@media (prefers-color-scheme: light) {
    body.design-v3 .mud-appbar {
        border-bottom-color: rgba(0, 0, 0, 0.08);
    }
}

/* Nav text buttons */
body.design-v3 .mud-appbar .mud-button-text-inherit {
    font-family: 'DM Sans', sans-serif !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
    opacity: 0.72;
    transition: opacity 0.2s ease !important;
    padding: 0 14px !important;
}

body.design-v3 .mud-appbar .mud-button-text-inherit:hover {
    opacity: 1 !important;
    background: transparent !important;
}

/* ─── Cards & Papers ─────────────────────────────────────────────── */
body.design-v3 .mud-card,
body.design-v3 .mud-paper.mud-elevation-1,
body.design-v3 .mud-paper.mud-elevation-2,
body.design-v3 .mud-paper.mud-elevation-3 {
    border-radius: 12px !important;
}

body.design-v3 .mud-paper.mud-elevation-1 {
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.14) !important;
}

body.design-v3 .mud-paper.mud-elevation-2 {
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.04) !important;
}

body.design-v3 .mud-paper.mud-elevation-3 {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

/* ─── Buttons ────────────────────────────────────────────────────── */
body.design-v3 .mud-button-root {
    border-radius: 8px !important;
    font-family: 'DM Sans', sans-serif !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
}

body.design-v3 .mud-button-filled {
    box-shadow: none !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease !important;
}

body.design-v3 .mud-button-filled:hover:not(:disabled) {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 18px rgba(212, 160, 23, 0.28) !important;
}

body.design-v3 .mud-button-outlined {
    transition: transform 0.18s ease, background 0.18s ease !important;
}

body.design-v3 .mud-button-outlined:hover:not(:disabled) {
    transform: translateY(-1px) !important;
}

/* ─── Chips ──────────────────────────────────────────────────────── */
body.design-v3 .mud-chip {
    border-radius: 5px !important;
    font-size: 0.71rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.03em !important;
}

/* ─── Input fields ───────────────────────────────────────────────── */
body.design-v3 .mud-input-outlined .mud-input-outlined-border {
    border-radius: 8px !important;
}

/* ─── Tables ─────────────────────────────────────────────────────── */
body.design-v3 .mud-table-cell {
    padding: 13px 16px !important;
    font-family: 'DM Sans', sans-serif !important;
}

body.design-v3 .mud-table-head .mud-table-cell {
    font-weight: 600 !important;
    font-size: 0.7rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    opacity: 0.65;
}

/* ─── Pagination ─────────────────────────────────────────────────── */
body.design-v3 .mud-pagination-item {
    border-radius: 8px !important;
}

/* ─── List items ─────────────────────────────────────────────────── */
body.design-v3 .mud-list-item {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* ─── Card content padding ───────────────────────────────────────── */
body.design-v3 .mud-card-content {
    padding: 1.25rem 1.5rem !important;
}

/* ─── Section containers ─────────────────────────────────────────── */
body.design-v3 .mud-paper[id] > .mud-container {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

/* ─── Dividers ───────────────────────────────────────────────────── */
body.design-v3 .mud-divider {
    opacity: 0.55;
}

/* ─── Post card ──────────────────────────────────────────────────── */
body.design-v3 .post-card {
    border: 1px solid transparent;
    overflow: hidden;
    transition:
        transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.22s ease !important;
}

body.design-v3 .post-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32) !important;
    border-color: var(--mud-palette-primary) !important;
}

/* ─── Section header ─────────────────────────────────────────────── */
.sh-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.9rem;
}

.sh-num {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--mud-palette-primary);
    letter-spacing: 0.12em;
}

.sh-rule {
    display: inline-block;
    width: 44px;
    height: 1px;
    background: var(--mud-palette-primary);
    opacity: 0.45;
}

/* ─── Hero Section ───────────────────────────────────────────────── */
.hero-section {
    position: relative;
    overflow: hidden;
    min-height: 90vh;
    display: flex;
    align-items: center;
    background: var(--mud-palette-background);
}

.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(212, 160, 23, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 160, 23, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    pointer-events: none;
}

.hero-grid-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 130% 70% at 50% 100%,
        transparent 25%,
        var(--mud-palette-background) 72%
    );
}

.hero-inner {
    position: relative;
    z-index: 1;
    padding-top: 7.5rem;
    padding-bottom: 5rem;
}

.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
}

.hero-eyebrow-num {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--mud-palette-primary);
    letter-spacing: 0.14em;
}

.hero-eyebrow-rule {
    display: inline-block;
    width: 40px;
    height: 1px;
    background: var(--mud-palette-primary);
    opacity: 0.48;
}

.hero-eyebrow-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    opacity: 0.75;
}

.hero-h1 {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: clamp(2.4rem, 5.5vw, 4.75rem) !important;
    line-height: 1.06 !important;
    letter-spacing: -0.03em !important;
    font-weight: 700 !important;
    max-width: 840px;
    margin-bottom: 1.75rem !important;
}

.hero-h1 em {
    font-style: italic;
    color: var(--mud-palette-primary);
}

.hero-desc {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 1.08rem !important;
    line-height: 1.72 !important;
    max-width: 560px;
    color: var(--mud-palette-text-secondary) !important;
    margin-bottom: 2.5rem !important;
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 3.75rem;
}

.hero-cta-primary.mud-button-root {
    height: 50px !important;
    padding: 0 30px !important;
    font-size: 0.95rem !important;
}

.hero-cta-secondary.mud-button-root {
    height: 50px !important;
    padding: 0 30px !important;
    font-size: 0.95rem !important;
}

.hero-divider {
    height: 1px;
    background: var(--mud-palette-divider);
    margin-bottom: 2rem;
    opacity: 0.5;
}

.hero-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    align-items: center;
}

.hero-fact {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hero-fact-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--mud-palette-text-secondary);
    opacity: 0.6;
}

.hero-fact-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--mud-palette-text-primary);
    opacity: 0.82;
}

.hero-fact-sep {
    width: 1px;
    height: 30px;
    background: var(--mud-palette-divider);
    opacity: 0.55;
}

/* ─── Post card custom elements ──────────────────────────────────── */
.post-cover-placeholder {
    height: 186px;
    background: var(--mud-palette-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.post-cover-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(212, 160, 23, 0.065) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 160, 23, 0.065) 1px, transparent 1px);
    background-size: 22px 22px;
}

.post-cover-icon {
    position: relative;
    z-index: 1;
    opacity: 0.18;
    font-size: 3.25rem !important;
}

.post-tag-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.63rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--mud-palette-primary);
    border: 1px solid var(--mud-palette-primary);
    opacity: 0.8;
    line-height: 1.6;
}

.post-title-editorial {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: 1.07rem !important;
    line-height: 1.48 !important;
    font-weight: 600 !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.post-summary-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.62 !important;
}

.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px 14px;
    border-top: 1px solid var(--mud-palette-divider);
    opacity: 0.85;
}

.post-card-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
}

.post-card-stats {
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary);
}

.post-card-stats .sep {
    margin: 0 5px;
    opacity: 0.4;
}

/* ─── Footer ─────────────────────────────────────────────────────── */
.footer-brand {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.footer-tagline {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    opacity: 0.55;
    margin-top: 4px;
}

/* ─── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .hero-section { min-height: unset; }
    .hero-inner { padding-top: 5.5rem; padding-bottom: 3rem; }
    .hero-h1 { font-size: 2.1rem !important; }
    .hero-ctas { flex-direction: column; }
    .hero-cta-primary.mud-button-root,
    .hero-cta-secondary.mud-button-root { width: 100%; }
    .hero-facts { gap: 1.5rem; }
    .hero-fact-sep { display: none; }
}
