/**
 * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 *
 * Historical Atlas shared foundation and landing-page styling.
 */

.hat-page {
    --hat-bg: #0d1210;
    --hat-bg-raised: #141b17;
    --hat-bg-card: #1a231e;
    --hat-bg-soft: #202b24;
    --hat-gold: #d4a017;
    --hat-gold-light: #e7bd4d;
    --hat-gold-dark: #9d7410;
    --hat-jade: #2a8072;
    --hat-text: #eee8dc;
    --hat-text-soft: #c7c0b3;
    --hat-muted: #9d998f;
    --hat-border: rgba(212, 160, 23, 0.22);
    --hat-border-strong: rgba(212, 160, 23, 0.42);
    min-height: 100vh;
    padding-top: 80px;
    overflow-x: hidden;
    background: var(--hat-bg);
    color: var(--hat-text);
    font-family: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.65;
}

.hat-page *,
.hat-page *::before,
.hat-page *::after {
    box-sizing: border-box;
}

.hat-page h1,
.hat-page h2,
.hat-page h3,
.hat-page h4 {
    margin-top: 0;
    color: var(--hat-text);
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 600;
    line-height: 1.12;
}

.hat-page p {
    color: var(--hat-text-soft);
}

.hat-page a {
    color: var(--hat-gold-light);
}

.hat-page a:hover,
.hat-page a:focus {
    color: #f0cd76;
}

.hat-page .breadcrumb {
    margin: 0;
    padding: 0.9rem 0;
    background: transparent;
}

.hat-page .breadcrumb a,
.hat-page .breadcrumb-item,
.hat-page .breadcrumb-item.active {
    color: var(--hat-muted);
}

.hat-page .breadcrumb-item + .breadcrumb-item::before {
    color: #706d65;
}

.hat-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--hat-gold-light);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hat-kicker .dna-icon {
    width: 1rem;
    height: 1rem;
}

.hat-hero {
    position: relative;
    isolation: isolate;
    min-height: 620px;
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--hat-border);
    overflow: hidden;
}

.hat-hero__media {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-color: #111813;
    background-image: url('/img/ui/backgrounds/homepage-deep-time-hero.webp');
    background-position: center;
    background-size: cover;
    opacity: 0.34;
}

.hat-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: #080b09;
    opacity: 0.68;
}

.hat-hero__content {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.hat-hero h1 {
    max-width: 820px;
    margin: 1.1rem 0 1.5rem;
    font-size: clamp(3rem, 6.5vw, 6.25rem);
    letter-spacing: -0.045em;
}

.hat-hero h1 span {
    color: var(--hat-gold-light);
}

.hat-hero__lead {
    max-width: 720px;
    margin: 0;
    color: #ddd6c9;
    font-size: clamp(1.12rem, 2vw, 1.42rem);
    line-height: 1.55;
}

.hat-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.hat-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.72rem 1.15rem;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none !important;
    transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.hat-button:hover,
.hat-button:focus {
    transform: translateY(-1px);
}

.hat-button--primary {
    border-color: var(--hat-gold);
    background: var(--hat-gold);
    color: #19150b !important;
}

.hat-button--primary:hover,
.hat-button--primary:focus {
    border-color: var(--hat-gold-light);
    background: var(--hat-gold-light);
}

.hat-button--quiet {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(10, 14, 12, 0.72);
    color: var(--hat-text) !important;
}

.hat-button--quiet:hover,
.hat-button--quiet:focus {
    border-color: var(--hat-gold);
    background: #151b17;
}

.hat-statbar {
    display: grid;
    max-width: 920px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 3.5rem 0 0;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.hat-statbar > div {
    min-width: 0;
    padding: 1.35rem 1.25rem 0 0;
}

.hat-statbar dt {
    color: var(--hat-gold-light);
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.75rem;
    font-weight: 600;
}

.hat-statbar dd {
    margin: 0.1rem 0 0;
    color: var(--hat-muted);
    font-size: 0.82rem;
    line-height: 1.25;
    text-transform: uppercase;
}

.hat-section {
    padding: 6.5rem 0;
}

.hat-section--muted {
    border-top: 1px solid var(--hat-border);
    background: var(--hat-bg-raised);
}

.hat-section-heading {
    max-width: 760px;
    margin-bottom: 2.75rem;
}

.hat-section-heading--center {
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

.hat-section-heading h2 {
    margin: 0.7rem 0 1rem;
    font-size: clamp(2rem, 4vw, 3.3rem);
}

.hat-section-heading p {
    margin: 0;
    font-size: 1.12rem;
}

.hat-collection-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
}

.hat-collection-card {
    position: relative;
    padding: clamp(1.5rem, 4vw, 3rem);
    overflow: hidden;
    border: 1px solid var(--hat-border);
    border-radius: 10px;
    background: var(--hat-bg-card);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.hat-collection-card__topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--hat-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hat-status {
    padding: 0.28rem 0.55rem;
    border: 1px solid rgba(42, 128, 114, 0.5);
    border-radius: 999px;
    color: #9bd7cd;
    letter-spacing: 0;
    text-transform: none;
}

.hat-collection-card__icon {
    display: grid;
    width: 70px;
    height: 70px;
    margin: 2rem 0 1.4rem;
    place-items: center;
    border: 1px solid var(--hat-border-strong);
    border-radius: 50%;
    background: #121813;
    color: var(--hat-gold-light);
    font-size: 2rem;
}

.hat-collection-card h3 {
    max-width: 720px;
    margin-bottom: 1rem;
    font-size: clamp(1.8rem, 3vw, 2.65rem);
}

.hat-collection-card > p {
    max-width: 850px;
    margin-bottom: 1.8rem;
    font-size: 1.06rem;
}

.hat-collection-card__meta {
    display: grid;
    max-width: 760px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 1.8rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hat-collection-card__meta div {
    padding-right: 1rem;
}

.hat-collection-card__meta dt {
    color: var(--hat-muted);
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
}

.hat-collection-card__meta dd {
    margin: 0.2rem 0 0;
    color: var(--hat-text);
    font-weight: 600;
}

.hat-text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    text-decoration: none !important;
}

.hat-method-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--hat-border);
    border-radius: 8px;
    background: var(--hat-border);
}

.hat-method-grid article {
    padding: 1.75rem;
    background: var(--hat-bg-card);
}

.hat-method-grid article > .dna-icon {
    margin-bottom: 1rem;
    color: var(--hat-gold-light);
    font-size: 1.6rem;
}

.hat-method-grid h3 {
    margin-bottom: 0.65rem;
    font-size: 1.25rem;
}

.hat-method-grid p {
    margin: 0;
    color: var(--hat-muted);
    font-size: 0.94rem;
}

.hat-editorial-note,
.hat-empty {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-top: 2rem;
    padding: 1.15rem 1.3rem;
    border-left: 3px solid var(--hat-gold);
    background: #111713;
    color: var(--hat-text-soft);
}

.hat-empty {
    border: 1px solid var(--hat-border);
    border-left: 3px solid var(--hat-gold);
}

.hat-empty .dna-icon {
    flex: 0 0 auto;
    margin-top: 0.2rem;
    color: var(--hat-gold-light);
    font-size: 1.5rem;
}

.hat-empty h3,
.hat-empty p {
    margin-bottom: 0.2rem;
}

@media (max-width: 991.98px) {
    .hat-method-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hat-statbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .hat-page {
        padding-top: 72px;
    }

    .hat-hero {
        min-height: auto;
    }

    .hat-hero__content {
        padding-top: 4.5rem;
        padding-bottom: 4.5rem;
    }

    .hat-hero h1 {
        font-size: clamp(2.55rem, 14vw, 4.2rem);
    }

    .hat-statbar {
        margin-top: 2.6rem;
    }

    .hat-section {
        padding: 4.2rem 0;
    }

    .hat-collection-card__meta {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .hat-method-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hat-hero__actions,
    .hat-button {
        width: 100%;
    }

    .hat-statbar {
        grid-template-columns: 1fr 1fr;
    }

    .hat-statbar > div {
        padding-right: 0.6rem;
    }

    .hat-collection-card__topline {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hat-button {
        transition: none;
    }
}

@media print {
    .hat-page {
        padding-top: 0;
        background: #fff;
        color: #111;
    }

    .hat-hero__media,
    .hat-hero::after,
    .hat-hero__actions {
        display: none;
    }
}
