/*
 * /Historia: en längre berättelse i kapitel. Egen typografi (serif för läsningen),
 * men samma bruna färger som resten av sajten.
 */
.history {
    --ink: #2f2620;
    --brown: #3f241a;
    --rust: #a0522d;
    --gold: #b98a52;
    --muted: #6d6156;
    --line: #e1d8ca;
    --paper: #faf6ef;
    --paper-dark: #f0e8db;
    --subheading: #384b3d; /* granngrön, som i utkastet */
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.12rem;
    line-height: 1.75;
}
.history h1, .history h2, .history h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    color: var(--brown);
}
/* Rubriken och avslutningen i sajtens skrivstil, så att sidan hör ihop med resten. */
.history h1, .history .history-closing h2 { font-family: 'Pinyon Script', cursive; letter-spacing: 0; }
.history h1 { font-size: clamp(2.8rem, 5.6vw, 5rem); line-height: 1.2; margin: 0.15em 0 0.35em; }
.history .history-closing h2 { font-size: clamp(2.4rem, 4.6vw, 3.8rem); line-height: 1.25; }
.history h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.6em; }
.history h3 { font-size: 1.45rem; line-height: 1.25; margin: 1.6em 0 0.5em; color: var(--subheading); }
.history p { margin: 0 0 1.1em; }
.history a { color: var(--rust); }

.history-eyebrow {
    margin-top: 0 !important;
    margin-bottom: 6px !important;
    color: var(--rust);
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.history-lead { font-size: clamp(1.15rem, 1.7vw, 1.35rem); line-height: 1.6; color: #4a4038; }

/* Sidhuvud: text till vänster, gårdsplanen till höger. */
.history-hero {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    min-height: 520px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.history-hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px clamp(24px, 5vw, 80px) 60px max(24px, calc((100vw - 1280px) / 2));
}
.history-hero-text .history-lead { max-width: 520px; }
.history-hero-image { position: relative; margin: 0; overflow: hidden; background: #2b2a26; }
.history-hero-image img { display: block; width: 100%; height: 100%; object-fit: cover; filter: sepia(.15); }
.history-hero-image figcaption {
    position: absolute;
    right: 20px;
    bottom: 16px;
    color: #fff;
    font: 700 0.7rem 'Montserrat', Arial, sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}

/* Inledning */
.history-intro {
    display: grid;
    grid-template-columns: 240px minmax(0, 760px);
    gap: clamp(30px, 6vw, 100px);
    max-width: 1180px;
    margin: 0 auto;
    padding: 70px 24px;
}
.history-intro-kicker { font-size: 1.5rem; line-height: 1.35; color: var(--rust); }

/* Tidslinje */
.history-timeline { padding: 40px max(24px, calc((100vw - 1180px) / 2)) 34px; color: #fff; background: var(--brown); }
.history-timeline .history-eyebrow { color: #e0b98a; margin-bottom: 18px !important; }
.history-timeline ol { display: grid; grid-template-columns: repeat(7, 1fr); margin: 0; padding: 0; }
.history-timeline li { position: relative; list-style: none; border-top: 1px solid rgba(255, 255, 255, .3); }
.history-timeline li::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 16px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e0b98a;
}
.history-timeline a {
    display: block;
    height: 100%;
    padding: 18px 16px 12px;
    color: #eadfd2;
    font: 0.8rem/1.45 'Montserrat', Arial, sans-serif;
    text-decoration: none;
    transition: background-color .2s;
}
.history-timeline a:hover, .history-timeline a:focus-visible { background: rgba(255, 255, 255, .07); }
.history-timeline .year { display: block; margin-bottom: 6px; color: #fff; font: 1.4rem Georgia, serif; }

/* Kapitellist som ligger fast högst upp medan man läser. */
.history-chapternav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 max(16px, calc((100vw - 1180px) / 2));
    background: rgba(63, 36, 26, .97);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
    transform: translateY(-100%);
    visibility: hidden;
    transition: transform .25s, visibility .25s;
}
.history-chapternav.visible { transform: none; visibility: visible; }
.history-chapternav ol {
    display: flex;
    flex: 1;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
}
.history-chapternav ol::-webkit-scrollbar { display: none; }
.history-chapternav li { flex: none; list-style: none; }
.history-chapternav a {
    display: block;
    padding: 15px 11px 13px;
    color: #d9c9b6;
    border-bottom: 2px solid transparent;
    font: 600 0.74rem/1 'Montserrat', Arial, sans-serif;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}
.history-chapternav a span { color: #b98a52; }
.history-chapternav a:hover, .history-chapternav a:focus-visible { color: #fff; }
.history-chapternav a.active { color: #fff; border-bottom-color: #e0b98a; }
.history-chapternav .history-chapternav-top { flex: none; padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .2); }

/* Kapitel: nummer i marginalen, texten i en läsbar spalt. */
.history-chapter {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: clamp(30px, 6vw, 90px);
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(56px, 7vw, 100px) 24px;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 44px; /* plats för kapitellisten */
}
.history-chapter > aside {
    color: var(--muted);
    font: 0.75rem/1.5 'Montserrat', Arial, sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.history-chapter > aside .number {
    display: block;
    margin-bottom: 4px;
    color: #c9b79c;
    font: 4.6rem/1 Georgia, serif;
    letter-spacing: -0.06em;
}
.history-chapter-main { max-width: 800px; }

/* Bilder */
/* Bilden bestämmer storleken (inga tomma fält runt stående bilder): max 620px hög, aldrig bredare än spalten. */
.history-photo { margin: 30px 0 38px; }
.history-photo a { display: block; width: fit-content; max-width: 100%; overflow: hidden; cursor: zoom-in; }
.history-photo img { display: block; width: auto; max-width: 100%; height: auto; max-height: 620px; transition: transform .4s; }
.history-photo a:hover img { transform: scale(1.015); }
.history-photo figcaption { max-width: 640px; padding-top: 10px; color: var(--muted); font: 0.8rem/1.55 'Montserrat', Arial, sans-serif; }
.history-photo.portrait { max-width: 440px; }
.history-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0; }
.history-pair .history-photo { margin: 0; }
.history-pair .history-photo a { width: auto; }
.history-pair .history-photo img { width: 100%; height: 260px; max-height: none; object-fit: cover; }
.history-pair .history-photo.tall img { height: 400px; }
.history-note {
    padding: 16px 20px;
    color: var(--muted);
    background: var(--paper);
    border-left: 3px solid var(--gold);
    font: 0.9rem/1.6 'Montserrat', Arial, sans-serif;
}
.history blockquote {
    margin: 36px 0;
    padding: 30px 36px;
    color: var(--brown);
    background: var(--paper-dark);
    border-left: 4px solid var(--rust);
    font-size: 1.4rem;
    font-style: italic;
    line-height: 1.5;
}
.history-archive { margin: 36px 0; padding: 24px 26px; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.history-archive-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 !important; }
.history-archive-links a, .history-button {
    display: inline-block;
    padding: 10px 16px;
    color: var(--brown);
    background: #fff;
    border: 1px solid #cdb99c;
    font: 700 0.8rem/1.4 'Montserrat', Arial, sans-serif;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: background-color .2s, color .2s;
}
.history-archive-links a:hover, .history-archive-links a:focus-visible,
.history-button:hover, .history-button:focus-visible { color: #fff; background: var(--rust); border-color: var(--rust); }

/* Avslutning */
.history-closing { padding: 90px 24px; text-align: center; background: var(--paper-dark); }
/* .history .history-closing, så att den vinner över marginalerna i .history p */
.history .history-closing > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.history-closing h2 { margin-top: 12px; }
.history-closing .history-button { margin-top: 10px; }

@media (max-width: 900px) {
    .history-hero { grid-template-columns: 1fr; }
    .history-hero-text { padding: 48px 24px 36px; }
    .history-hero-image { height: 56vw; min-height: 260px; }
    .history-intro, .history-chapter { grid-template-columns: 1fr; gap: 16px; }
    .history-intro { padding: 48px 24px; }
    .history-chapter > aside { display: flex; align-items: center; gap: 16px; }
    .history-chapter > aside .number { margin: 0; font-size: 2.8rem; }
    .history-timeline ol { grid-template-columns: repeat(4, 1fr); row-gap: 20px; }
}
@media (max-width: 600px) {
    .history { font-size: 1.05rem; }
    .history-timeline ol { grid-template-columns: repeat(2, 1fr); }
    .history-pair { grid-template-columns: 1fr; }
    .history-pair .history-photo img, .history-pair .history-photo.tall img { height: auto; }    .history-chapternav { padding: 0; gap: 0; }
    .history-chapternav .history-chapternav-top { padding: 15px 14px 13px; }
    .history blockquote { padding: 22px; font-size: 1.2rem; }
    .history-closing { padding: 64px 22px; }
}
