/* Um Ferðina — editorial layout: hero, timeline, three sections, stats, myndir preview */

:root {
    --uf-accent: #84886B;
    --uf-accent-soft: rgba(132, 136, 107, 0.35);
    --uf-line: rgba(132, 136, 107, 0.45);
    --uf-text: #3a3a3a;
    --uf-muted: #7a7a7a;
    --uf-heading: #4B3D32;
    --uf-bg: #ffffff;
}

.uf-page {
    background-color: var(--uf-bg);
    overflow-x: hidden;
}

.uf {
    max-width: 1280px;
    margin: 0 auto;
    padding: 56px clamp(20px, 4vw, 56px) 96px;
    box-sizing: border-box;
}

.uf-page,
.uf-page * {
    min-width: 0;
}

/* ============================================
   HERO: title + dates
   ============================================ */

.uf-hero {
    text-align: center;
    padding: 0 16px 28px;
}

.uf-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4.6vw, 3rem);
    font-weight: 500;
    color: var(--uf-heading);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.uf-dates {
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    color: var(--uf-accent);
    letter-spacing: 0.18em;
    margin: 0;
}

/* ============================================
   TIMELINE
   ============================================ */

.uf-timeline--full {
    margin: 60px 0 88px;
    padding: 0;
}

/* Per-country mini timelines — mobile only */
.uf-timeline--section {
    display: none;
    margin: 6px 0 10px;
    padding: 0 4px;
}

.uf-timeline--section .uf-timeline-track {
    grid-template-columns: repeat(var(--stop-count, 1), minmax(0, 1fr));
}

.uf-timeline-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: stretch;
    padding: 6px 0;
    gap: 2px;
}

.uf-timeline-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 1px;
    background: var(--uf-line);
    z-index: 0;
    pointer-events: none;
}

.uf-timeline-stop {
    position: relative;
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    align-items: center;
    z-index: 1;
    min-width: 0;
}

.uf-timeline-name {
    grid-row: 1;
    align-self: end;
    font-family: 'Playfair Display', serif;
    font-size: clamp(0.6rem, 1.05vw, 0.85rem);
    color: var(--uf-heading);
    letter-spacing: 0.02em;
    margin: 0 0 clamp(8px, 1vw, 12px);
    text-align: center;
    line-height: 1.2;
    word-break: normal;
    overflow-wrap: anywhere;
    hyphens: none;
    max-width: 100%;
}

.uf-timeline-dot {
    grid-row: 2;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--uf-accent);
    box-shadow: 0 0 0 4px var(--uf-bg);
    flex-shrink: 0;
    justify-self: center;
}

.uf-timeline-date {
    grid-row: 3;
    align-self: start;
    font-family: 'Playfair Display', serif;
    font-size: clamp(0.58rem, 1.05vw, 0.8rem);
    color: var(--uf-muted);
    letter-spacing: 0.04em;
    margin: clamp(8px, 1vw, 12px) 0 0;
    white-space: nowrap;
    justify-self: center;
}

/* ============================================
   THREE DESTINATION SECTIONS
   ============================================ */

.uf-sections {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(28px, 4vw, 56px);
    margin-bottom: 112px;
}

.uf-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
}

/* Desktop: image → title → text */
.uf-section-media {
    order: 1;
}

.uf-section-head {
    order: 2;
    margin-bottom: 0;
    text-align: center;
}

.uf-section-body {
    order: 3;
    padding: 8px 0;
}

.uf-section-media {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: rgba(132, 136, 107, 0.08);
    margin-bottom: 28px;
}

.uf-section-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.uf-section:hover .uf-section-media img {
    transform: scale(1.02);
}

.uf-section-heading {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.6rem, 2.6vw, 2rem);
    font-weight: 600;
    color: var(--uf-heading);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin: 0 0 8px;
    text-align: center;
}

.uf-section-subtitle {
    font-family: 'Playfair Display', serif;
    font-size: 0.78rem;
    color: var(--uf-accent);
    letter-spacing: 0.05em;
    margin: 0 0 18px;
    text-align: center;
}

.uf-section-rule {
    display: block;
    width: 48px;
    height: 1px;
    background: var(--uf-accent-soft);
    margin: 0 auto 22px;
}

.uf-section-text {
    font-family: 'Playfair Display', serif;
    font-size: 0.98rem;
    color: var(--uf-text);
    line-height: 1.8;
    margin: 0 auto;
    max-width: 36rem;
    text-align: center;
}

/* Collage section: image grid fills the same media frame as single images */
.uf-section--collage .uf-section-media {
    background: transparent;
}

.uf-section-collage {
    display: grid;
    gap: 6px;
    width: 100%;
    aspect-ratio: 4 / 3;
}

.uf-section--collage-4 .uf-section-collage {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.uf-section--collage-6 .uf-section-collage {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.uf-collage-cell {
    overflow: hidden;
    background: rgba(132, 136, 107, 0.08);
    min-width: 0;
    min-height: 0;
    position: relative;
}

.uf-collage-cell img {
    position: absolute;
    inset: 0;
}

.uf-collage-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.uf-collage-cell:hover img {
    transform: scale(1.04);
}

/* ============================================
   STATS ROW
   ============================================ */

.uf-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 52px 0;
    margin-bottom: 96px;
    border-top: 1px solid var(--uf-accent-soft);
    border-bottom: 1px solid var(--uf-accent-soft);
}

.uf-stat {
    text-align: center;
}

.uf-stat-number {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 400;
    color: var(--uf-heading);
    line-height: 1;
    margin-bottom: 12px;
}

.uf-stat-label {
    font-family: 'Playfair Display', serif;
    font-size: 0.82rem;
    color: var(--uf-muted);
    text-transform: uppercase;
    letter-spacing: 0.22em;
}

/* ============================================
   MYNDIR PREVIEW
   ============================================ */

.uf-myndir {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(0, 2.4fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
}

.uf-myndir-intro {
    padding: 12px 0;
}

.uf-myndir-heading {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 2.4vw, 1.9rem);
    font-weight: 500;
    color: var(--uf-heading);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.uf-myndir-text {
    font-family: 'Playfair Display', serif;
    font-size: 0.92rem;
    color: var(--uf-muted);
    line-height: 1.65;
    margin: 0 0 22px;
    max-width: 22rem;
}

.uf-myndir-button {
    display: inline-block;
    padding: 12px 30px;
    border: 2px solid var(--uf-accent);
    border-radius: 30px;
    color: var(--uf-accent);
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-decoration: none;
    background-color: transparent;
    transition: all 0.3s ease;
}

.uf-myndir-button:hover {
    background-color: var(--uf-accent);
    color: #fff;
}

.uf-myndir-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.uf-myndir-cell {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: rgba(132, 136, 107, 0.08);
}

.uf-myndir-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.uf-myndir-cell:hover img {
    transform: scale(1.05);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet & smaller laptops: 3 columns → 1 column, hide timeline */
@media (max-width: 960px) {
    .uf {
        padding: 44px 20px 72px;
    }

    .uf-timeline--full {
        display: none;
    }

    .uf-timeline--section {
        display: block;
    }

    .uf-section-subtitle {
        display: none;
    }

    .uf-section-rule {
        display: none;
    }

    .uf-hero {
        padding-bottom: 44px;
    }

    .uf-sections {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 80px;
        padding-top: 40px;
        border-top: 1px solid var(--uf-accent-soft);
    }

    /* Mobile: title → image → timeline → text */
    .uf-section-head {
        order: 1;
        margin-bottom: 16px;
    }

    .uf-section-media {
        order: 2;
    }

    .uf-timeline--section {
        order: 3;
        width: min(88%, 600px);
        margin-left: auto;
        margin-right: auto;
    }

    .uf-section-body {
        order: 4;
        padding: 4px 0 0;
    }

    .uf-section {
        padding-top: 48px;
    }

    .uf-section:first-child {
        padding-top: 0;
    }

    .uf-section + .uf-section {
        margin-top: 48px;
        border-top: 1px solid var(--uf-accent-soft);
    }

    .uf-section-media {
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
        margin-bottom: 10px;
    }

    .uf-section-text {
        max-width: 38rem;
    }

    .uf-myndir {
        grid-template-columns: 1fr;
        gap: 28px;
        text-align: center;
    }

    .uf-myndir-intro {
        padding: 0;
    }

    .uf-myndir-text {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Phones */
@media (max-width: 720px) {
    .uf-title {
        letter-spacing: 0.12em;
    }

    .uf-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 36px 16px;
        padding: 40px 0;
        margin-bottom: 72px;
    }

    .uf-myndir-grid {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .uf {
        padding: 36px 16px 56px;
    }

    .uf-title {
        font-size: 1.7rem;
    }

    .uf-dates {
        font-size: 0.85rem;
    }

    .uf-section-heading {
        letter-spacing: 0.12em;
    }

    .uf-timeline--section {
        margin: 4px auto 8px;
    }

    .uf-timeline--section .uf-timeline-track {
        padding: 2px 0 4px;
        gap: 1px;
    }

    .uf-timeline--section .uf-timeline-name {
        font-size: 0.55rem;
        letter-spacing: 0;
        margin-bottom: 8px;
    }

    .uf-timeline--section .uf-timeline-date {
        font-size: 0.55rem;
        margin-top: 8px;
    }

    .uf-timeline--section .uf-timeline-dot {
        width: 6px;
        height: 6px;
        box-shadow: 0 0 0 3px var(--uf-bg);
    }

    .uf-myndir-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
