/**
 * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 *
 * Heritage design system: shared tokens, editorial typography, surfaces, controls,
 * and responsive section navigation. Opt in with .hd-page, or .hd-theme for tokens only.
 */

@import url('./heritage-overlays.css');

.hd-page,
.hd-theme {
    --hd-bg: #faf8f4;
    --hd-surface: #ffffff;
    --hd-sand: #efe6d6;
    --hd-sand-strong: #e3d3b6;
    --hd-ink: #1f2a24;
    --hd-muted: #6b6a63;
    --hd-primary: #213a2f;
    --hd-gold: #b08d4f;
    --hd-border: #ebe4d8;
    --hd-radius: 16px;
    --hd-serif: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
    --hd-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --hd-cream: #f5efe4;
    --hd-charcoal: #25241f;
    --hd-text-muted: #6c6961;
    --hd-forest: #213a2f;
    --hd-sage: #e6ece3;
    --hd-sage-strong: #5f7a68;
    --hd-gold-text: #a4884f;
    --hd-line: #e7e0d3;
    --hd-gap-group: 72px;
    --hd-gap-inner: 28px;
}

.hd-page {
    background: var(--hd-bg);
    color: var(--hd-ink);
    padding-top: calc(var(--nav-height, 72px) + 8px);
    overflow-wrap: anywhere;
}

body:has(.hd-page),
.hd-page #content,
.hd-page .hd-container {
    background: var(--hd-bg) !important;
}

.hd-container {
    padding-bottom: var(--hd-gap-group);
}

.hd-eyebrow {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--hd-gold);
    margin-bottom: 8px;
}

.hd-btn {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.hd-btn:hover { text-decoration: none; }

.hd-btn--primary { background: var(--hd-primary); color: #fff; }

.hd-btn--primary:hover { background: #172a21; color: #fff; }

.hd-btn--ghost { background: rgba(255, 255, 255, 0.9); color: var(--hd-ink); border-color: var(--hd-border); }

.hd-btn--ghost:hover { background: #fff; color: var(--hd-ink); }

.hd-btn--sand { background: var(--hd-sand); color: var(--hd-ink); }

.hd-btn--sand:hover { background: var(--hd-sand-strong); color: var(--hd-ink); }

.hd-btn--sm { padding: 8px 14px; font-size: 0.85rem; }

.hd-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 32px;
    align-items: center;
    min-height: 320px;
    padding: 40px 44px;
    border-radius: var(--hd-radius);
    overflow: hidden;
    background: var(--hd-sand);
    margin-bottom: 24px;
}

.hd-hero__main { max-width: 520px; }

.hd-hero > * {
    position: relative;
    min-width: 0;
    max-width: 100%;
}

.hd-hero__title {
    font-family: var(--hd-serif);
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 500;
    line-height: 1.08;
    color: var(--hd-ink);
    margin: 0 0 14px;
    max-width: 14ch;
}

.hd-hero__subtitle {
    font-size: 1rem;
    color: #3d3d37;
    max-width: 52ch;
    margin-bottom: 24px;
}

.hd-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hd-hero__card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--hd-border);
    border-radius: 14px;
    padding: 20px;
}

.hd-hero__card-title { font-family: var(--hd-serif); font-size: 1.35rem; margin-bottom: 8px; }

.hd-hero__card-text { font-size: 0.88rem; color: var(--hd-muted); margin: 0; }

.hd-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--hd-surface);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius);
    padding: 20px;
    color: var(--hd-ink);
    text-decoration: none;
    transition: border-color 0.2s ease;
}

a.hd-card:hover { border-color: var(--hd-sand-strong); color: var(--hd-ink); text-decoration: none; }

.hd-card__icon {
    flex: 0 0 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--hd-sand);
    color: var(--hd-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.hd-card__title { font-size: 1rem; font-weight: 600; margin: 0 0 4px; }

.hd-card > :not(.hd-card__icon) { min-width: 0; }

.hd-card__text { font-size: 0.83rem; color: var(--hd-muted); margin: 0 0 10px; }

.hd-card__link { font-size: 0.85rem; font-weight: 600; color: var(--hd-gold); }

.hd-section-title {
    font-family: var(--hd-serif);
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    font-weight: 500;
    margin: 0 0 6px;
}

.hd-section-sub { color: var(--hd-muted); margin: 0; }

.hd-section {
    margin-top: var(--hd-gap-group);
    font-family: var(--hd-sans);
    color: var(--hd-charcoal);
}

.hd-section-head { margin-bottom: var(--hd-gap-inner); max-width: 720px; }

.hd-section-head--row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    justify-content: space-between;
    max-width: none;
}

.hd-section-head .hd-section-sub { font-size: 0.95rem; color: var(--hd-text-muted); }

.hd-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--hd-forest);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

.hd-link:hover { color: var(--hd-charcoal); text-decoration: none; }

.hd-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    max-width: 100%;
    white-space: normal;
}

.hd-pill--sage { background: var(--hd-sage); color: var(--hd-forest); }

/* Keep the desktop section links visible below the fixed main navbar. */
.heritage-dashboard .dashboard-section-nav {
    position: sticky;
    top: var(--dashboard-navbar-height, var(--nav-height, 72px));
    z-index: 200;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px;
    margin-bottom: 32px;
    border: 1px solid var(--hd-border);
    border-radius: 12px;
    background: rgba(250, 248, 244, 0.96);
    backdrop-filter: blur(12px);
}
.heritage-dashboard .dashboard-section-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 8px;
    color: var(--hd-ink);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
}
.heritage-dashboard .dashboard-section-link:hover { background: var(--hd-sand); }
.heritage-dashboard .dashboard-section-link.active { background: var(--hd-forest); color: #fff; }

.heritage-dashboard .dbc-bottom-nav {
    z-index: 200;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    background: rgba(250, 248, 244, 0.96);
    border-color: var(--hd-border);
    box-shadow: 0 -4px 20px rgba(31, 42, 36, 0.06);
}
.heritage-dashboard .dbc-bottom-nav-item {
    min-width: 0;
    min-height: 48px;
    max-width: none;
    padding: 6px 2px;
    color: var(--hd-muted);
    font-size: 0.65rem;
}
.heritage-dashboard .dbc-bottom-nav-item span { letter-spacing: 0; }
.heritage-dashboard .dbc-bottom-nav-item:hover { background: var(--hd-sand); color: var(--hd-ink); }
.heritage-dashboard .dbc-bottom-nav-item.active { background: var(--hd-sage); color: var(--hd-forest); }
.heritage-dashboard .dbc-bottom-nav-item.active i { color: var(--hd-forest); transform: none; }

.heritage-dashboard.hd-page :is(.hd-btn, .dashboard-section-link, .dbc-bottom-nav-item, .dbc-card-featured, .dbc-card-visual):focus-visible {
    outline: 2px solid var(--hd-forest);
    outline-offset: 3px;
}

/* Bootstrap resets outlines with !important on programmatic focus targets. */
.heritage-dashboard .dbc-section-title:focus {
    outline: 2px solid var(--hd-forest) !important;
    outline-offset: 3px;
}

/* Reusable dashboard surfaces and controls. */
.hd-page .hd-panel { padding: 24px; border: 1px solid var(--hd-border); border-radius: var(--hd-radius); background: var(--hd-surface); min-width: 0; }
.hd-page .hd-panel__title { margin: 0 0 8px; font-family: var(--hd-serif); font-size: 1.6rem; font-weight: 500; color: var(--hd-ink); }
.hd-page .hd-empty { margin: 0; padding: 24px 0; color: var(--hd-muted); font-size: 0.9rem; }
.hd-page .hd-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--hd-border); border-radius: 10px; background: var(--hd-bg); }
.hd-page .hd-switch button { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--hd-muted); font: 500 0.8rem var(--hd-sans); cursor: pointer; }
.hd-page .hd-switch button:hover { color: var(--hd-forest); background: var(--hd-sand); }
.hd-page .hd-switch button[aria-pressed="true"] { color: #fff; background: var(--hd-forest); }
.hd-page .hd-btn:disabled { opacity: 0.65; cursor: wait; }
.hd-page :is(.hd-btn, .hd-switch button):focus-visible { outline: 2px solid var(--hd-forest); outline-offset: 3px; }

/* Section navigation can be used without dashboard-cinematic.css. */
.heritage-dashboard.hd-page { --dashboard-anchor-offset: calc(var(--nav-height, 72px) + 96px); min-height: 100vh; font-family: var(--hd-sans); }
.heritage-dashboard .hd-btn { min-height: 44px; }
.heritage-dashboard .dbc-bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; border-top: 1px solid var(--hd-border); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.heritage-dashboard .dbc-bottom-nav-item { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 4px; border-radius: var(--dbc-radius-sm, 6px); text-decoration: none; }
.heritage-dashboard .dbc-bottom-nav-item span { font-weight: 500; }
.heritage-dashboard .dbc-bottom-nav-item .dna-icon { width: 18px; height: 18px; color: currentColor; }

@media (max-width: 991.98px) {
    .hd-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 32px; }
    .hd-page { --hd-gap-group: 56px; --hd-gap-inner: 24px; }
}
@media (max-width: 767px) {
    .hd-hero { grid-template-columns: minmax(0, 1fr); padding: 28px 20px; }
    .hd-page { --hd-gap-group: 56px; --hd-gap-inner: 20px; }
    .heritage-dashboard.hd-page { padding-top: calc(var(--nav-height-mobile, 64px) + 8px); }
    .heritage-dashboard .hd-container { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
    .hd-page :is(.hd-btn, .hd-card) { transition: none; }
}
@media print {
    .heritage-dashboard .dashboard-section-nav, .heritage-dashboard .dbc-bottom-nav { display: none !important; }
    .heritage-dashboard.hd-page { padding-top: 0; }
}
