*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f3ecdc;
    color: #29241f;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.7;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

/* ======================================================
   HEADER
   ====================================================== */

.site-header {
    position: relative;
    z-index: 20;
    background: #29241f;
    color: #fff;
    padding: 18px 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-title {
    color: #fff;
    font-size: 1.35rem;
    font-weight: bold;
    line-height: 1.2;
    text-decoration: none;
}

.site-title:hover {
    color: #eadfca;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.site-nav a {
    position: relative;
    color: #fff;
    font-size: 1rem;
    text-decoration: none;
}

.site-nav a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -5px;
    left: 0;
    height: 2px;
    background: #b6403f;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
    transform: scaleX(1);
}

/* ======================================================
   HERO / TOPSEKTION
   ====================================================== */

.hero {
    position: relative;
    min-height: 485px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: #fff;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            90deg,
            rgba(25, 21, 18, 0.8) 0%,
            rgba(25, 21, 18, 0.58) 42%,
            rgba(25, 21, 18, 0.2) 72%,
            rgba(25, 21, 18, 0.08) 100%
        );
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 700px;
    padding: 70px 0;
}

.hero-kicker {
    margin-bottom: 14px;
    color: #e8b3a5;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.78rem;
    font-weight: bold;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 760px;
    margin-bottom: 20px;
    color: #fff;
    font-size: clamp(3.2rem, 7vw, 5.9rem);
    line-height: 0.96;
    letter-spacing: -0.03em;
}

.hero-text {
    max-width: 650px;
    margin-bottom: 28px;
    color: rgba(255, 255, 255, 0.94);
    font-size: 1.15rem;
    line-height: 1.6;
}

/* ======================================================
   KNAPPER
   ====================================================== */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 25px;
    border: 0;
    border-radius: 999px;
    background: #a63736;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
    font-weight: bold;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(50, 20, 20, 0.2);
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.button:hover {
    background: #832927;
    transform: translateY(-2px);
    box-shadow: 0 11px 26px rgba(50, 20, 20, 0.28);
}

.button:active {
    transform: translateY(0);
}

/* ======================================================
   GENERELLE SEKTIONER
   ====================================================== */

.section {
    padding: 82px 0;
}

.section-heading {
    max-width: 740px;
    margin: 0 auto 42px;
    text-align: center;
}

.section-title {
    margin-bottom: 18px;
    color: #29241f;
    font-size: clamp(2.4rem, 5vw, 3.65rem);
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.section-intro {
    max-width: 720px;
    margin: 0 auto;
    color: #5b5147;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ======================================================
   BREV-KORT
   ====================================================== */

.letter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 24px;
}

.letter-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 27px 25px 26px;
    border: 1px solid rgba(82, 64, 48, 0.16);
    border-radius: 14px;
    background: rgba(255, 252, 245, 0.93);
    box-shadow: 0 14px 32px rgba(64, 48, 34, 0.09);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.letter-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 47, 47, 0.35);
    box-shadow: 0 19px 40px rgba(64, 48, 34, 0.14);
}

.letter-number {
    margin-bottom: 8px;
    color: #9b3a37;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.76rem;
    font-weight: bold;
    letter-spacing: 0.11em;
    line-height: 1.3;
    text-transform: uppercase;
}

.letter-card h2,
.letter-card h3 {
    margin-bottom: 16px;
    color: #2e2823;
    font-size: 1.22rem;
    line-height: 1.35;
}

.letter-card h2 a,
.letter-card h3 a {
    text-decoration: none;
}

.letter-card h2 a:hover,
.letter-card h3 a:hover {
    color: #8b2f2f;
}

.letter-summary,
.letter-card .summary {
    display: -webkit-box;
    margin-bottom: 18px;
    overflow: hidden;
    color: #433a33;
    font-size: 0.97rem;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
}

.letter-people {
    margin-bottom: 0;
    color: #76695e;
    font-size: 0.92rem;
    line-height: 1.55;
}

.text-link {
    display: inline-block;
    align-self: flex-start;
    margin-top: auto;
    padding-top: 20px;
    color: #8b2f2f;
    font-weight: bold;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.text-link:hover {
    color: #5f1f1f;
}

/* ======================================================
   FREMHÆVEDE BREVE
   ====================================================== */

.letter-card-highlighted {
    border: 2px solid #8b2f2f;
    background:
        linear-gradient(
            135deg,
            #fffaf0 0%,
            #f8eddd 100%
        );
    box-shadow: 0 18px 42px rgba(100, 32, 32, 0.16);
}

.letter-card-highlighted::before {
    content: "";
    position: absolute;
    top: -2px;
    right: 26px;
    width: 34px;
    height: 9px;
    border-radius: 0 0 8px 8px;
    background: #8b2f2f;
}

.letter-highlight {
    display: inline-block;
    align-self: flex-start;
    margin: 2px 0 12px;
    padding: 5px 11px;
    border-radius: 999px;
    background: #8b2f2f;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.055em;
    line-height: 1.35;
    text-transform: uppercase;
}

/* ======================================================
   OVERSIGT OVER ALLE BREVE
   ====================================================== */

.page-header {
    padding: 50px 0 22px;
    text-align: center;
}

.page-header h1 {
    margin-bottom: 14px;
    font-size: clamp(2.7rem, 6vw, 4.3rem);
    line-height: 1.1;
}

.page-header p {
    max-width: 720px;
    margin-right: auto;
    margin-bottom: 0;
    margin-left: auto;
    color: #665a50;
    font-size: 1.05rem;
}

/* ======================================================
   ENKELT BREV
   ====================================================== */

.letter-page {
    padding: 60px 0 80px;
}

.letter-header {
    max-width: 850px;
    margin: 0 auto 38px;
    text-align: center;
}

.letter-header h1 {
    margin-bottom: 14px;
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1.12;
}

.letter-meta {
    color: #786b60;
    font-size: 0.98rem;
}

.letter-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 34px;
}

.letter-original,
.letter-transcription {
    min-width: 0;
    padding: 26px;
    border: 1px solid rgba(82, 64, 48, 0.16);
    border-radius: 14px;
    background: rgba(255, 252, 245, 0.94);
    box-shadow: 0 14px 32px rgba(64, 48, 34, 0.08);
}

.letter-original h2,
.letter-transcription h2 {
    margin-bottom: 20px;
    font-size: 1.45rem;
}

.letter-transcription {
    font-size: 1.03rem;
    line-height: 1.85;
}

.letter-transcription p:last-child {
    margin-bottom: 0;
}

.letter-page-image {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 7px;
    box-shadow: 0 8px 20px rgba(51, 39, 28, 0.14);
}

.letter-page-image:last-child {
    margin-bottom: 0;
}

/* ======================================================
   NAVIGATION MELLEM BREVE
   ====================================================== */

.letter-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 850px;
    margin: 45px auto 0;
    padding-top: 24px;
    border-top: 1px solid rgba(82, 64, 48, 0.2);
}

.letter-navigation a {
    color: #8b2f2f;
    font-weight: bold;
    text-decoration: none;
}

.letter-navigation a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ======================================================
   FOOTER
   ====================================================== */

.site-footer {
    margin-top: 60px;
    padding: 38px 0;
    background: #29241f;
    color: rgba(255, 255, 255, 0.9);
}

.site-footer p {
    margin: 0;
    font-size: 0.92rem;
}

/* ======================================================
   FOKUS OG TILGÆNGELIGHED
   ====================================================== */

a:focus-visible,
button:focus-visible {
    outline: 3px solid #d9a65f;
    outline-offset: 4px;
}

/* ======================================================
   TABLET
   ====================================================== */

@media (max-width: 900px) {
    .hero {
        min-height: 450px;
    }

    .hero::before {
        background:
            linear-gradient(
                90deg,
                rgba(25, 21, 18, 0.82) 0%,
                rgba(25, 21, 18, 0.62) 60%,
                rgba(25, 21, 18, 0.3) 100%
            );
    }

    .letter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .letter-layout {
        grid-template-columns: 1fr;
    }
}

/* ======================================================
   MOBIL
   ====================================================== */

@media (max-width: 700px) {
    .container {
        width: min(100% - 28px, 1180px);
    }

    .site-header {
        padding: 15px 0;
    }

    .site-header .container {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
    }

    .site-title {
        font-size: 1.2rem;
    }

    .site-nav {
        width: 100%;
        gap: 22px;
    }

    .site-nav a {
        font-size: 0.95rem;
    }

    .hero {
        min-height: 470px;
        background-position: 60% center;
    }

    .hero::before {
        background: rgba(25, 21, 18, 0.66);
    }

    .hero-content {
        padding: 58px 0;
    }

    .hero-kicker {
        font-size: 0.7rem;
    }

    .hero h1 {
        font-size: clamp(3rem, 15vw, 4.3rem);
        line-height: 1;
    }

    .hero-text {
        font-size: 1rem;
    }

    .section {
        padding: 52px 0;
    }

    .section-heading {
        margin-bottom: 30px;
    }

    .section-title {
        font-size: 2.4rem;
    }

    .letter-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .letter-card {
        padding: 24px 21px;
    }

    .letter-summary,
    .letter-card .summary {
        -webkit-line-clamp: initial;
    }

    .page-header {
        padding: 48px 0 25px;
    }

    .letter-page {
        padding: 40px 0 60px;
    }

    .letter-original,
    .letter-transcription {
        padding: 21px;
    }

    .letter-navigation {
        align-items: stretch;
        flex-direction: column;
    }
}

/* ======================================================
   MEGET SMÅ SKÆRME
   ====================================================== */

@media (max-width: 420px) {
    .hero h1 {
        font-size: 2.8rem;
    }

    .button {
        width: 100%;
    }

    .section-title {
        font-size: 2.1rem;
    }
}

/* ======================================================
   SIDE OM TREÅRSKRIGEN
   ====================================================== */

.war-content {
    max-width: 900px;
}

.war-section {
    margin-bottom: 55px;
}

.war-section:last-child {
    margin-bottom: 0;
}

.war-section h2 {
    margin-bottom: 18px;
    color: #29241f;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    line-height: 1.2;
}

.war-section p {
    max-width: 780px;
    margin-bottom: 18px;
    color: #433a33;
    font-size: 1.05rem;
    line-height: 1.85;
}

.war-section p:last-child {
    margin-bottom: 0;
}

.page-header .section-kicker {
    color: #8b2f2f;
}

@media (max-width: 700px) {
    .war-section {
        margin-bottom: 40px;
    }

    .war-section p {
        font-size: 1rem;
        line-height: 1.75;
    }
}

/* ======================================================
   TIDSLINJE
   ====================================================== */

.war-timeline {
    position: relative;
    margin-top: 35px;
}

.war-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 72px;
    width: 2px;
    background: rgba(139, 47, 47, 0.25);
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 28px;
    padding-bottom: 38px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-year {
    position: relative;
    z-index: 1;
    align-self: start;
    width: 74px;
    padding: 9px 8px;
    border-radius: 999px;
    background: #8b2f2f;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.92rem;
    font-weight: bold;
    line-height: 1;
    text-align: center;
}

.timeline-content {
    padding: 0 0 4px;
}

.timeline-content h3 {
    margin-bottom: 8px;
    font-size: 1.35rem;
    line-height: 1.3;
}

.timeline-content p {
    margin-bottom: 0;
}

@media (max-width: 700px) {
    .war-timeline::before {
        left: 35px;
    }

    .timeline-item {
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 18px;
    }

    .timeline-year {
        width: 70px;
        font-size: 0.82rem;
    }

    .timeline-content h3 {
        font-size: 1.2rem;
    }
}

/* ======================================================
   KORT OVER KRIGEN
   ====================================================== */

.map-section {
    max-width: 900px;
}

.war-map {
    margin: 30px 0 0;
}

.war-map img {
    display: block;
    width: 50%;
    height: auto;
    margin: 0 auto;
    border: 1px solid rgba(82, 64, 48, 0.2);
    border-radius: 12px;
    background: #eee4ce;
}

.war-map figcaption {
    margin-top: 12px;
    color: #76695e;
    font-size: 0.9rem;
    line-height: 1.55;
    text-align: center;
}

@media (max-width: 700px) {
    .war-map img {
        width: 100%;
    }
}

/* ======================================================
   FAMILIESIDEN
   ====================================================== */

.family-content {
    max-width: 1000px;
}

.family-section {
    margin-bottom: 75px;
}

.family-section:last-child {
    margin-bottom: 0;
}

.family-photo {
    margin: 28px 0 0;
}

.family-photo img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.family-photo figcaption {
    margin-top: 10px;
    color: #76695e;
    font-size: 0.9rem;
    line-height: 1.5;
}

.family-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    align-items: start;
    gap: 48px;
}

.family-photo-portrait {
    margin-top: 0;
}

@media (max-width: 800px) {
    .family-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .family-section {
        margin-bottom: 55px;
    }
}

.family-gallery {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.75fr);
    align-items: start;
    gap: 30px;
    margin-top: 28px;
}

.family-gallery .family-photo {
    margin-top: 0;
}

.family-photo-narrow img {
    max-height: 560px;
    object-fit: cover;
}

@media (max-width: 800px) {
    .family-gallery {
        grid-template-columns: 1fr;
    }

    .family-photo-narrow img {
        max-height: none;
    }
}

.family-gallery {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    align-items: start;
    gap: 30px;
    margin-top: 28px;
}

.family-gallery .family-photo {
    margin: 0;
}

.family-gallery img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.family-photo-narrow img {
    max-height: 620px;
}

@media (max-width: 800px) {
    .family-gallery {
        grid-template-columns: 1fr;
    }

    .family-photo-narrow img {
        max-height: none;
    }
}

.page-header {
    padding: 42px 0 14px;
}

.section {
    padding-top: 32px;
}

/* ======================================================
   BENGAARDS HISTORIE
   ====================================================== */

.family-timeline {
    position: relative;
    margin-top: 36px;
}

.family-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 47px;
    width: 2px;
    background: rgba(139, 47, 47, 0.25);
}

.family-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 30px;
    padding-bottom: 40px;
}

.family-timeline-item:last-child {
    padding-bottom: 0;
}

.family-timeline-year {
    position: relative;
    z-index: 1;
    align-self: start;
    width: 96px;
    padding: 9px 8px;
    border-radius: 999px;
    background: #8b2f2f;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.82rem;
    font-weight: bold;
    line-height: 1;
    text-align: center;
}

.family-timeline-content h3 {
    margin: 0 0 8px;
    font-size: 1.3rem;
    line-height: 1.3;
}

.family-timeline-content p {
    margin: 0;
    color: #4d433a;
}

@media (max-width: 700px) {
    .family-timeline::before {
        left: 36px;
    }

    .family-timeline-item {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 18px;
    }

    .family-timeline-year {
        width: 72px;
        font-size: 0.72rem;
    }

    .family-timeline-content h3 {
        font-size: 1.15rem;
    }
}

.memorial-section {
    max-width: 900px;
}

.memorial-photo {
    margin-top: 28px;
}

.memorial-photo img {
    display: block;
    width: 55%;
    height: auto;
    margin: 0 auto;
    border: 1px solid rgba(82, 64, 48, 0.18);
    border-radius: 10px;
    background: #f5eddd;
}

.memorial-photo figcaption {
    max-width: 560px;
    margin: 10px auto 0;
    color: #76695e;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

@media (max-width: 700px) {
    .memorial-photo img {
        width: 100%;
    }
}

.memorial-poem {
    max-width: 680px;
    margin: 45px auto 0;
    padding: 34px 38px;
    border-left: 4px solid #8b2f2f;
    background: rgba(255, 252, 245, 0.78);
}

.memorial-poem h3 {
    margin: 0 0 30px;
    font-size: 1.65rem;
    line-height: 1.3;
}

.poem-verses p {
    margin: 0 0 28px;
    font-size: 1.06rem;
    font-style: italic;
    line-height: 1.85;
}

.poem-verses p:last-child {
    margin-bottom: 0;
}

.poem-note {
    margin: 30px 0 0;
    padding-top: 18px;
    border-top: 1px solid rgba(82, 64, 48, 0.18);
    color: #76695e;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.82rem;
    line-height: 1.55;
}

@media (max-width: 700px) {
    .memorial-poem {
        padding: 26px 22px;
    }

    .poem-verses p {
        font-size: 1rem;
    }
}

.family-photo-knud {
    max-width: 520px;
    margin: 42px auto 0;
}

.family-photo-knud img {
    width: 100%;
    height: auto;
}

.generation-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 28px;
    margin-top: 30px;
}

.generation-gallery .family-photo {
    margin: 0;
}

.generation-gallery img {
    display: block;
    width: 100%;
    height: auto;
}

@media (max-width: 800px) {
    .generation-gallery {
        grid-template-columns: 1fr;
    }
}