/* Copyright (c) 2026 DNA Genics, S.L. All rights reserved. */
.historical-evidence,
.historical-methods {
    background: var(--hpa-ivory, #faf8f4);
    color: var(--hpa-ink, #203c31);
}

.historical-evidence h2,
.historical-methods h2 {
    margin: 0 0 .55rem;
    font-size: clamp(2rem, 3.6vw, 3rem);
    font-weight: 500;
    line-height: 1.08;
}

.historical-evidence-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, .78fr);
    align-items: center;
    gap: clamp(1rem, 4vw, 4rem);
    margin-block-end: 1.8rem;
}
.historical-evidence-intro p { max-width: 56ch; margin: 0; }
.historical-evidence-intro figure { margin: 0; }
.historical-evidence-intro img {
    width: 100%;
    height: clamp(110px, 12vw, 180px);
    display: block;
    object-fit: cover;
    object-position: 50% 42%;
    border: 1px solid var(--hpa-border);
}
.historical-evidence-intro figcaption,
.historical-event-count,
.historical-event-evidence,
.historical-event-identity small,
.historical-references span { font: 400 .875rem/1.5 var(--hpa-sans); color: var(--hpa-muted, #56645c); }
.historical-evidence-intro figcaption { margin-block-start: .3rem; }

.historical-evidence-controls {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}
.historical-evidence [hidden] { display: none; }

.historical-eras { flex: 1 1 25rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.historical-eras legend,
.historical-population-filter { margin: 0 0 .4rem; font: 600 .875rem/1.5 var(--hpa-sans); }
.historical-era-choices { display: flex; flex-wrap: wrap; }
.historical-era-choices label { position: relative; flex: 1 1 6.2rem; margin: 0; }
.historical-era-choices input {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
}
.historical-era-choices label > span {
    display: grid;
    align-content: center;
    min-height: 52px;
    padding: .32rem .7rem;
    border-block-end: 2px solid var(--hpa-border);
    cursor: pointer;
}
.historical-era-choices strong { font: 600 1rem/1.4 var(--hpa-sans); }
.historical-era-choices small { font: 400 .8rem/1.45 var(--hpa-sans); }
.historical-era-choices input:checked + span { background: #e7ebdf; border-color: var(--hpa-ink); }
.historical-era-choices input:disabled + span { color: #687268; border-style: dotted; cursor: default; }
.historical-era-choices input:focus-visible + span,
.historical-event summary:focus-visible,
.historical-methods summary:focus-visible { outline: 2px solid var(--hpa-ink); outline-offset: 2px; }
.historical-population-filter { min-width: 0; margin: 0; max-width: 100%; }
.historical-population-filter select {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: .5rem;
    margin-block-start: .38rem;
    color: inherit;
    background: var(--hpa-ivory);
    border: 1px solid var(--hpa-border);
    border-radius: 3px;
}
.historical-event-count { margin: 1.3rem 0 .45rem; }
.historical-event { border-block-start: 1px solid var(--hpa-border); }
.historical-event-list { border-block-end: 1px solid var(--hpa-border); }
.historical-event summary {
    display: grid;
    grid-template-columns: minmax(6rem, 9rem) minmax(0, 1fr) auto;
    align-items: baseline;
    gap: .2rem 1.2rem;
    padding: .85rem .2rem;
    cursor: pointer;
}
.historical-event summary::-webkit-details-marker { display: none; }
.historical-event summary::after {
    content: '';
    display: inline-block;
    align-self: center;
    width: .55rem;
    height: .55rem;
    margin-inline-end: .5rem;
    border-inline-end: 1.5px solid currentColor;
    border-block-end: 1.5px solid currentColor;
    transform: rotate(45deg);
}
.historical-event[open] summary::after { transform: rotate(225deg); }
.historical-event-date { font: 600 .92rem/1.5 var(--hpa-sans); font-variant-numeric: tabular-nums; }
.historical-event-identity { min-width: 0; }
.historical-event-identity strong { font: 600 clamp(1.25rem, 2vw, 1.55rem)/1.18 var(--hpa-serif); }
.historical-event-identity small { display: block; margin-top: .23rem; }
.historical-event-body { max-width: 78ch; margin: 0 0 1.05rem; padding-inline-start: min(10.4rem, 20%); }
.historical-event-body p { margin: 0 0 .5rem; }
.historical-show-more {
    display: block;
    margin-top: .55rem;
    padding: .65rem 0;
    border: 0;
    background: transparent;
    color: var(--hpa-ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: .2em;
}

.historical-methods-list { margin-block: 1.4rem; border-block-end: 1px solid var(--hpa-border); }
.historical-methods-list details { padding: 0 0 0 .15rem; border-block-start: 1px solid var(--hpa-border); }
.historical-methods-list summary { padding-block: .85rem; cursor: pointer; font-weight: 600; }
.historical-methods-list p { max-width: 78ch; margin-block: 0 .9rem; }
.historical-methods-list details > a { display: inline-block; margin-block-end: .9rem; text-decoration: underline; }
.historical-references { padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); list-style: none; gap: .65rem 2rem; }
.historical-references li { display: grid; }
.historical-version {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem 2.4rem;
    padding: .8rem 0;
    font-size: .9rem;
}
.historical-version dt { font-weight: 500; color: var(--hpa-muted); }
.historical-version dd { margin: .1rem 0 0; font-variant-numeric: tabular-nums; }

@media (max-width: 700px) {
    .historical-evidence-intro { grid-template-columns: minmax(0, 1fr); }
    .historical-evidence-intro img { height: clamp(112px, 29vw, 160px); }
    .historical-population-filter { width: 100%; }
    .historical-event summary { grid-template-columns: minmax(0, 1fr) auto; }
    .historical-event-date { grid-column: 1; }
    .historical-event-identity { grid-column: 1; }
    .historical-event summary::after { grid-column: 2; grid-row: 1 / 3; }
    .historical-event-body { padding: 0; }
}

body.dna-printing .historical-event[hidden] { display: block !important; }
body.dna-printing .historical-evidence-controls,
body.dna-printing .historical-event-count,
body.dna-printing .historical-show-more { display: none !important; }

@media print {
    .historical-event[hidden] { display: block !important; }
    .historical-evidence-controls, .historical-event-count, .historical-show-more { display: none !important; }
    .historical-event { break-inside: avoid; }
}
