/* ==========================================================================
   HELAMALMÖS HISTORIA – TIDSLINJE (.hm-tl)
   Komponent: src/components/history-timeline.js
   Innehåll:  data/content/history.json
   Alla regler är scopade under .hm-tl / .hm-tl-dialog och påverkar
   inga andra komponenter. Använder webbplatsens färgvariabler och fonter.
   ========================================================================== */

.hm-tl {
    --tl-max: var(--max_width_center, 1200px);
    --tl-gutter: clamp(16px, 5vw, 40px);
    --tl-rail: clamp(34px, 5vw, 64px);
    --tl-node: 14px;
    --tl-radius: 12px;
    --tl-ease: cubic-bezier(.2, .7, .2, 1);

    /* Ton: ljus (standard) */
    --tl-bg: var(--helamalmo_white);
    --tl-head: #141414;
    --tl-accent: var(--helamalmo_purple);
    --tl-soft: #6b6478;
    --tl-track: rgba(84, 49, 119, .14);
    --tl-fill: var(--helamalmo_purple);
    --tl-ghost: rgba(84, 49, 119, .16);
    --tl-compact-bg: #f6f2fa;
    --tl-compact-border: rgba(84, 49, 119, .10);
    --tl-compact-ink: #141414;
    --tl-compact-text: #3b3545;
    --tl-chip-bg: #f3eef8;
    --tl-chip-ink: var(--helamalmo_purple);

    position: relative;
    width: 100%;
    font-family: var(--font-main);
    color: #333;
}

.hm-tl-decade {
    position: relative;
    background: var(--tl-bg);
    padding: clamp(48px, 7vw, 96px) 0 clamp(56px, 8vw, 110px);
    overflow: hidden;
    scroll-margin-top: 0;
}

.hm-tl-decade--purple {
    --tl-bg: var(--helamalmo_purple);
    --tl-head: #fff;
    --tl-accent: #fff;
    --tl-soft: var(--helamalmo_purple_fourth);
    --tl-track: rgba(255, 255, 255, .22);
    --tl-fill: #fff;
    --tl-ghost: rgba(255, 255, 255, .22);
    --tl-compact-bg: rgba(255, 255, 255, .07);
    --tl-compact-border: rgba(255, 255, 255, .16);
    --tl-compact-ink: #fff;
    --tl-compact-text: rgba(255, 255, 255, .86);
    --tl-chip-bg: rgba(255, 255, 255, .1);
    --tl-chip-ink: #fff;
}

.hm-tl-decade--black {
    --tl-bg: var(--helamalmo_black);
    --tl-head: #fff;
    --tl-accent: var(--helamalmo_purple_third);
    --tl-soft: #b9b0c6;
    --tl-track: rgba(255, 255, 255, .16);
    --tl-fill: var(--helamalmo_purple_third);
    --tl-ghost: rgba(158, 134, 190, .3);
    --tl-compact-bg: rgba(255, 255, 255, .06);
    --tl-compact-border: rgba(255, 255, 255, .12);
    --tl-compact-ink: #fff;
    --tl-compact-text: rgba(255, 255, 255, .82);
    --tl-chip-bg: rgba(255, 255, 255, .08);
    --tl-chip-ink: var(--helamalmo_purple_fourth);
}

.hm-tl-inner {
    max-width: var(--tl-max);
    margin: 0 auto;
    padding: 0 var(--tl-gutter);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(28px, 4vw, 48px);
}

/* ---------- Decenniets sidokolumn / rubrik ---------- */
.hm-tl-aside {
    position: relative;
}

.hm-tl-aside-inner {
    position: relative;
}

.hm-tl-kicker {
    font-family: var(--font-condensed);
    font-weight: 600;
    font-style: italic;
    font-size: 1.05rem;
    letter-spacing: .3px;
    color: var(--tl-soft);
    margin-bottom: 4px;
}

.hm-tl-ghost {
    display: block;
    font-family: var(--font-condensed);
    font-weight: 900;
    font-size: clamp(5.5rem, 17vw, 9.5rem);
    line-height: .82;
    letter-spacing: -2px;
    color: transparent;
    -webkit-text-stroke: 2px var(--tl-ghost);
    user-select: none;
    margin: 0 0 -.18em -.04em;
}

.hm-tl-decade-title {
    position: relative;
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: clamp(2rem, 4.4vw, 2.75rem);
    line-height: 1.05;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--tl-head);
}

.hm-tl-decade-meta {
    margin-top: 10px;
    font-size: .95rem;
    color: var(--tl-soft);
    display: flex;
    gap: 6px 14px;
    flex-wrap: wrap;
}

.hm-tl-decade-meta strong {
    color: var(--tl-head);
    font-weight: 600;
}

/* Index över decenniets händelser */
.hm-tl-index {
    list-style: none;
    margin-top: 22px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-bottom: 4px;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
}

.hm-tl-index::-webkit-scrollbar {
    display: none;
}

.hm-tl-index li {
    scroll-snap-align: start;
    flex: 0 0 auto;
}

.hm-tl-index a {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--tl-chip-bg);
    color: var(--tl-chip-ink);
    text-decoration: none;
    font-size: .88rem;
    white-space: nowrap;
    transition: background .2s, color .2s;
}

.hm-tl-index a .y {
    font-family: var(--font-condensed);
    font-weight: 700;
    opacity: .7;
}

.hm-tl-index a.is-current {
    background: var(--tl-accent);
    color: var(--tl-bg);
}

.hm-tl-index a:focus-visible,
.hm-tl-more:focus-visible {
    outline: 3px solid var(--helamalmo_purple_third);
    outline-offset: 2px;
}

/* ---------- Tidslinjens spår ---------- */
.hm-tl-list {
    list-style: none;
    position: relative;
    padding-left: var(--tl-rail);
    display: grid;
    gap: clamp(28px, 4vw, 44px);
    --fill: 0px;
}

.hm-tl-list::before,
.hm-tl-list::after {
    content: "";
    position: absolute;
    left: calc(var(--tl-node) / 2 - 1px);
    top: 10px;
    width: 2px;
    border-radius: 2px;
}

.hm-tl-list::before {
    bottom: 0;
    background: var(--tl-track);
}

.hm-tl-list::after {
    height: var(--fill);
    max-height: calc(100% - 10px);
    background: var(--tl-fill);
}

.hm-tl-item {
    position: relative;
    container-type: inline-size;
    scroll-margin-top: 96px;
}

.hm-tl-stamp {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    min-height: 24px;
}

.hm-tl-node {
    position: absolute;
    left: calc(var(--tl-rail) * -1);
    top: 5px;
    width: var(--tl-node);
    height: var(--tl-node);
    border-radius: 50%;
    background: var(--tl-bg);
    border: 2px solid var(--tl-track);
    box-shadow: 0 0 0 4px var(--tl-bg);
    transition: background .3s, border-color .3s, transform .3s var(--tl-ease);
    z-index: 1;
}

.hm-tl-item.is-passed .hm-tl-node {
    border-color: var(--tl-fill);
    background: var(--tl-fill);
}

.hm-tl-item.is-current .hm-tl-node {
    transform: scale(1.35);
}

.hm-tl-item--compact .hm-tl-node {
    width: 10px;
    height: 10px;
    left: calc(var(--tl-rail) * -1 + 2px);
    top: 7px;
}

.hm-tl-item--undated .hm-tl-node {
    border-style: dashed;
}

.hm-tl-year {
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: clamp(1.35rem, 2.6vw, 1.7rem);
    line-height: 1;
    color: var(--tl-accent);
    letter-spacing: .5px;
}

.hm-tl-item--compact .hm-tl-year {
    font-size: 1.15rem;
}

.hm-tl-year-tick {
    flex: 1;
    height: 1px;
    background: var(--tl-track);
    max-width: 120px;
}

/* ---------- Kort ---------- */
.hm-tl-card {
    position: relative;
    background: #fff;
    border-radius: var(--tl-radius);
    box-shadow: 0 2px 4px rgba(20, 12, 32, .04), 0 10px 30px rgba(20, 12, 32, .07);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
    transition: transform .35s var(--tl-ease), box-shadow .35s var(--tl-ease);
    isolation: isolate;
}

.hm-tl-decade--purple .hm-tl-card,
.hm-tl-decade--black .hm-tl-card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}

.hm-tl-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(20, 12, 32, .05), 0 22px 44px rgba(84, 49, 119, .16);
}

.hm-tl-plate {
    position: relative;
    display: grid;
    place-items: center;
    background: #fff;
    padding: clamp(18px, 3vw, 28px);
    min-height: 150px;
    border-bottom: 1px solid rgba(84, 49, 119, .08);
    overflow: hidden;
}

/* Diskret lila ”hörnstämpel” i logotypytan */
.hm-tl-plate::before {
    content: "";
    position: absolute;
    inset: auto auto -40px -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(219, 203, 229, .55), transparent 70%);
    z-index: -1;
}

.hm-tl-plate img {
    width: auto;
    height: auto;
    max-width: min(78%, 220px);
    max-height: 120px;
    object-fit: contain;
    transition: transform .5s var(--tl-ease);
}

.hm-tl-card:hover .hm-tl-plate img {
    transform: scale(1.05) rotate(-1deg);
}

.hm-tl-body {
    padding: clamp(18px, 2.6vw, 28px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.hm-tl-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: .82rem;
    color: #6b6478;
}

.hm-tl-years {
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--helamalmo_purple);
}

/* Pågående verksamhet: pulserande punkt efter årtalet */
.hm-tl-years.is-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hm-tl-years.is-live::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--helamalmo_purple_second);
    box-shadow: 0 0 0 0 rgba(112, 81, 151, .6);
    animation: hmTlPulse 2s infinite;
}

@keyframes hmTlPulse {
    70% {
        box-shadow: 0 0 0 8px rgba(112, 81, 151, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(112, 81, 151, 0);
    }
}

.hm-tl-title {
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: clamp(1.4rem, 2.6vw, 1.85rem);
    line-height: 1.08;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #141414;
    overflow-wrap: anywhere;
    hyphens: auto;
}

/* Varaktighetsstapel: visar verksamhetens spann mot hela historien */
.hm-tl-span {
    position: relative;
    height: 4px;
    border-radius: 4px;
    background: #eee8f4;
    overflow: hidden;
}

.hm-tl-span i {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--s) * 100%);
    width: max(6px, calc((var(--e) - var(--s)) * 100%));
    border-radius: 4px;
    background: var(--helamalmo_purple);
}

.hm-tl-span.is-open i {
    background: linear-gradient(90deg, var(--helamalmo_purple), rgba(84, 49, 119, 0));
    width: calc(var(--e) * 100% - var(--s) * 100% + 24px);
}

.hm-tl-span.is-live i {
    background: linear-gradient(90deg, var(--helamalmo_purple), var(--helamalmo_purple_third));
}

.hm-tl-teaser {
    font-size: 1rem;
    line-height: 1.6;
    color: #3b3545;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hm-tl-stats {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    padding-top: 4px;
}

.hm-tl-stats li {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hm-tl-stats strong {
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: 1.55rem;
    line-height: 1;
    color: var(--helamalmo_purple);
}

.hm-tl-stats span {
    font-size: .8rem;
    color: #6b6478;
    margin-top: 3px;
}

.hm-tl-more {
    margin-top: auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: 0;
    padding: 6px 0 0;
    cursor: pointer;
    color: var(--helamalmo_purple);
}

/* Hela kortet klickbart via knappen */
.hm-tl-more::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
}

.hm-tl-more-label {
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--helamalmo_purple);
}

.hm-tl-plus {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1.5px solid var(--helamalmo_purple);
    font-family: var(--font-main);
    font-size: 1.15rem;
    line-height: 1;
    color: var(--helamalmo_purple);
    transition: background .25s, color .25s, transform .35s var(--tl-ease);
}

.hm-tl-card:hover .hm-tl-plus,
.hm-tl-more:focus-visible .hm-tl-plus {
    background: var(--helamalmo_purple);
    color: #fff;
    transform: rotate(90deg);
}

/* Bred kortlayout via container queries */
@container (min-width: 560px) {
    .hm-tl-item--feature .hm-tl-card {
        grid-template-columns: clamp(170px, 34%, 260px) minmax(0, 1fr);
    }

    .hm-tl-item--feature .hm-tl-plate {
        border-bottom: 0;
        border-right: 1px solid rgba(84, 49, 119, .08);
        min-height: 100%;
    }
}

/* Kompakta händelser (utan logotyp) */
.hm-tl-item--compact .hm-tl-card {
    background: var(--tl-compact-bg);
    border: 1px solid var(--tl-compact-border);
    box-shadow: none;
}

.hm-tl-item--compact .hm-tl-card:hover {
    box-shadow: 0 14px 30px rgba(20, 12, 32, .10);
}

.hm-tl-item--compact .hm-tl-body {
    padding: clamp(16px, 2.2vw, 22px);
    gap: 8px;
}

.hm-tl-item--compact .hm-tl-title {
    font-size: clamp(1.15rem, 2vw, 1.35rem);
    color: var(--tl-compact-ink);
}

.hm-tl-item--compact .hm-tl-teaser {
    -webkit-line-clamp: 2;
    font-size: .95rem;
    color: var(--tl-compact-text);
}

.hm-tl-item--compact .hm-tl-meta,
.hm-tl-item--compact .hm-tl-stats span {
    color: var(--tl-compact-text);
}

.hm-tl-item--compact .hm-tl-stats strong {
    font-size: 1.25rem;
}

.hm-tl-decade--purple .hm-tl-item--compact :is(.hm-tl-years, .hm-tl-more-label, .hm-tl-stats strong),
.hm-tl-decade--black .hm-tl-item--compact :is(.hm-tl-years, .hm-tl-more-label, .hm-tl-stats strong) {
    color: var(--tl-compact-ink);
}

.hm-tl-decade--purple .hm-tl-item--compact .hm-tl-plus,
.hm-tl-decade--black .hm-tl-item--compact .hm-tl-plus {
    border-color: currentColor;
    color: #fff;
}

.hm-tl-decade--purple .hm-tl-item--compact .hm-tl-card:hover .hm-tl-plus,
.hm-tl-decade--black .hm-tl-item--compact .hm-tl-card:hover .hm-tl-plus {
    background: #fff;
    color: var(--helamalmo_purple);
}

.hm-tl-item--compact .hm-tl-more {
    padding-top: 2px;
}

.hm-tl-item--compact .hm-tl-plus {
    width: 26px;
    height: 26px;
    font-size: 1rem;
}

/* Slut på tidslinjen */
.hm-tl-end {
    position: relative;
    margin-top: clamp(28px, 4vw, 44px);
    display: flex;
}

.hm-tl-end::before {
    content: "";
    width: var(--tl-node);
    height: var(--tl-node);
    border-radius: 50%;
    background: var(--tl-fill);
    box-shadow: 0 0 0 0 rgba(84, 49, 119, .5);
    animation: hmTlPulse 2.2s infinite;
    flex: 0 0 auto;
}

/* Reveal vid scroll */
.hm-tl.is-enhanced .hm-tl-item {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s var(--tl-ease), transform .6s var(--tl-ease);
}

.hm-tl.is-enhanced .hm-tl-item.is-in {
    opacity: 1;
    transform: none;
}

/* ---------- Desktop: två kolumner med fäst sidokolumn ---------- */
@media (min-width: 1024px) {
    .hm-tl-inner {
        grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
        gap: clamp(40px, 5vw, 80px);
        align-items: start;
    }

    .hm-tl-aside {
        align-self: stretch;
    }

    .hm-tl-aside-inner.is-pinned {
        position: fixed;
        top: var(--tl-pin-top, 32px);
    }

    .hm-tl-aside-inner.is-bottom {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
    }

    .hm-tl-ghost {
        font-size: clamp(7rem, 9vw, 8.5rem);
    }

    .hm-tl-index {
        flex-direction: column;
        gap: 2px;
        overflow: visible;
        -webkit-mask-image: none;
        mask-image: none;
        margin-top: 26px;
        border-left: 2px solid var(--tl-track);
    }

    .hm-tl-index a {
        background: none;
        border-radius: 0 6px 6px 0;
        padding: 6px 12px;
        margin-left: -2px;
        border-left: 2px solid transparent;
        white-space: normal;
        color: var(--tl-soft);
    }

    .hm-tl-index a:hover {
        color: var(--tl-head);
    }

    .hm-tl-index a.is-current {
        background: var(--tl-chip-bg);
        color: var(--tl-head);
        border-left-color: var(--tl-fill);
    }

    .hm-tl-index a .y {
        min-width: 2.6em;
        color: var(--tl-accent);
        opacity: 1;
    }
}

/* ---------- Detaljvy (dialog) ---------- */
.hm-tl-dialog {
    --d-pad: clamp(20px, 3.4vw, 40px);
    border: 0;
    padding: 0;
    margin: auto;
    width: min(calc(100% - 48px), 980px);
    max-width: none;
    max-height: min(90vh, 880px);
    height: min(90vh, 880px);
    border-radius: 16px;
    background: #fff;
    color: #333;
    font-family: var(--font-main);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
    overflow: hidden;
}

.hm-tl-dialog[open] {
    display: flex;
    flex-direction: column;
    animation: hmTlIn .38s var(--tl-ease, ease) both;
}

.hm-tl-dialog::backdrop {
    background: rgba(24, 18, 36, .7);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

@keyframes hmTlIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(.985);
    }
}

.hm-tl-d-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px 12px var(--d-pad);
    border-bottom: 1px solid rgba(84, 49, 119, .1);
    flex: 0 0 auto;
}

.hm-tl-d-crumb {
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--helamalmo_purple);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-tl-d-crumb span {
    color: #8b829a;
    font-weight: 500;
    margin-left: 8px;
}

.hm-tl-d-progress {
    height: 3px;
    background: #eee8f4;
    flex: 0 0 auto;
}

.hm-tl-d-progress i {
    display: block;
    height: 100%;
    width: calc(var(--p, 0) * 100%);
    background: var(--helamalmo_purple);
    transition: width .35s var(--tl-ease, ease);
}

.hm-tl-d-close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1.5px solid rgba(84, 49, 119, .25);
    background: #fff;
    color: var(--helamalmo_purple);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.hm-tl-d-close:hover {
    background: var(--helamalmo_purple);
    color: #fff;
}

.hm-tl-d-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.hm-tl-d-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100%;
}

.hm-tl-d-aside {
    background: var(--helamalmo_purple);
    color: #fff;
    padding: var(--d-pad);
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
    overflow: hidden;
}

.hm-tl-d-aside::after {
    content: attr(data-year);
    position: absolute;
    right: -.06em;
    bottom: -.2em;
    font-family: var(--font-condensed);
    font-weight: 900;
    font-size: 9rem;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 255, 255, .14);
    pointer-events: none;
}

.hm-tl-d-plate {
    background: #fff;
    border-radius: 12px;
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    padding: 22px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}

.hm-tl-d-plate img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.hm-tl-d-typemark {
    border-radius: 12px;
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    padding: 20px;
    text-align: center;
    background: rgba(255, 255, 255, .08);
    border: 1.5px solid rgba(255, 255, 255, .25);
    font-family: var(--font-condensed);
    font-weight: 900;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .5px;
    overflow-wrap: anywhere;
}

.hm-tl-d-facts {
    display: grid;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.hm-tl-d-fact small {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--helamalmo_purple_fourth);
    margin-bottom: 2px;
}

.hm-tl-d-fact b {
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: .4px;
}

.hm-tl-d-span {
    position: relative;
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .18);
    margin-top: 8px;
}

.hm-tl-d-span i {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--s) * 100%);
    width: max(8px, calc((var(--e) - var(--s)) * 100%));
    border-radius: 6px;
    background: #fff;
}

.hm-tl-d-span-scale {
    display: flex;
    justify-content: space-between;
    font-size: .72rem;
    color: var(--helamalmo_purple_fourth);
    margin-top: 6px;
}

.hm-tl-d-stats {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 14px;
    position: relative;
    z-index: 1;
}

.hm-tl-d-stats strong {
    display: block;
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: 2rem;
    line-height: 1;
}

.hm-tl-d-stats span {
    font-size: .82rem;
    color: var(--helamalmo_purple_fourth);
}

.hm-tl-d-main {
    padding: var(--d-pad) var(--d-pad) calc(var(--d-pad) * 1.2);
    max-width: 68ch;
}

.hm-tl-d-title {
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: clamp(2rem, 4.4vw, 3rem);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #141414;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.hm-tl-d-years {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
}

.hm-tl-d-lead {
    margin-top: 22px;
    font-family: var(--font-condensed);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.2rem, 2vw, 1.4rem);
    line-height: 1.4;
    color: var(--helamalmo_purple);
}

.hm-tl-d-text p {
    margin-top: 16px;
    font-size: 1.02rem;
    line-height: 1.75;
    color: #333;
}

.hm-tl-d-nav {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid rgba(84, 49, 119, .1);
}

.hm-tl-d-nav button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px var(--d-pad);
    background: #fff;
    border: 0;
    cursor: pointer;
    text-align: left;
    min-width: 0;
    color: var(--helamalmo_purple);
    transition: background .2s;
}

.hm-tl-d-nav button+button {
    border-left: 1px solid rgba(84, 49, 119, .1);
    justify-content: flex-end;
    text-align: right;
}

.hm-tl-d-nav button:hover:not(:disabled) {
    background: #f7f3fa;
}

.hm-tl-d-nav button:disabled {
    opacity: .35;
    cursor: default;
}

.hm-tl-d-nav svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
}

.hm-tl-d-nav-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hm-tl-d-nav-text small {
    font-family: var(--font-main);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8b829a;
}

.hm-tl-d-nav-text b {
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hm-tl-d-scroll.is-switching .hm-tl-d-grid {
    animation: hmTlSwap .32s var(--tl-ease, ease);
}

@keyframes hmTlSwap {
    from {
        opacity: 0;
        transform: translateX(calc(var(--dir, 1) * 18px));
    }
}

@media (min-width: 760px) {
    .hm-tl-d-grid {
        grid-template-columns: minmax(250px, 34%) minmax(0, 1fr);
    }
}

@media (max-width: 759px) {
    .hm-tl-dialog {
        width: 100%;
        height: calc(100dvh - 12px);
        max-height: none;
        margin: 12px 0 0;
        border-radius: 16px 16px 0 0;
    }

    .hm-tl-dialog[open] {
        animation-name: hmTlSheet;
    }

    @keyframes hmTlSheet {
        from {
            transform: translateY(40px);
            opacity: 0;
        }
    }

    .hm-tl-d-aside {
        display: grid;
        grid-template-columns: minmax(96px, 38%) minmax(0, 1fr);
        align-items: center;
        gap: 16px;
    }

    .hm-tl-d-plate,
    .hm-tl-d-typemark {
        aspect-ratio: 1;
        padding: 12px;
    }

    .hm-tl-d-typemark {
        font-size: 1.1rem;
    }

    .hm-tl-d-stats {
        grid-column: 1 / -1;
    }

    .hm-tl-d-stats strong {
        font-size: 1.6rem;
    }

    .hm-tl-d-aside::after {
        font-size: 6rem;
    }

    .hm-tl-d-nav button {
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    }

    .hm-tl-d-nav-text b {
        font-size: .95rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .hm-tl *,
    .hm-tl-dialog,
    .hm-tl-dialog * {
        animation: none !important;
        transition: none !important;
    }

    .hm-tl.is-enhanced .hm-tl-item {
        opacity: 1;
        transform: none;
    }
}

/* Siffror lagras ordagrant ur källtexten (ibland med gemen begynnelsebokstav);
   versal visas endast typografiskt. */
.hm-tl-stats strong::first-letter,
.hm-tl-d-stats strong::first-letter {
    text-transform: uppercase;
}
