/* ==========================================================================
   ACF Block: Ajalugu (timeline)
   ========================================================================== */

.pv-history {
    margin-top: calc(64px * var(--pv-ui-scale));
}

.pv-history__inner {
    width: 100%;
}

/* ── Heading ── */

.pv-history__heading {
    margin-bottom: calc(64px * var(--pv-ui-scale));
}

.pv-history__eyebrow {
    font-family: var(--wp--preset--font-family--inter, 'Inter', sans-serif);
    font-size: calc(13px * var(--pv-ui-scale));
    font-weight: 600;
    letter-spacing: calc(2px * var(--pv-ui-scale));
    text-transform: uppercase;
    color: var(--wp--preset--color--primary-blue, #0068ff);
    margin: 0 0 calc(12px * var(--pv-ui-scale));
}

.pv-history__title {
    font-family: var(--wp--preset--font-family--plus-jakarta-sans, 'Plus Jakarta Sans', sans-serif);
    font-weight: 700;
    font-size: clamp(calc(28px * var(--pv-ui-scale)), 4vw, calc(44px * var(--pv-ui-scale)));
    letter-spacing: calc(-1px * var(--pv-ui-scale));
    line-height: 1.1;
    color: var(--wp--preset--color--brand-01-dark, #102f5d);
    margin: 0;
}

/* ── Timeline ── */

.pv-history__timeline {
    position: relative;
}

/* Centre vertical line. */
.pv-history__timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: calc(26px * var(--pv-ui-scale));
    bottom: calc(26px * var(--pv-ui-scale));
    width: calc(2px * var(--pv-ui-scale));
    background: #e4e4e7;
    transform: translateX(-50%);
}

.pv-history__item {
    display: grid;
    grid-template-columns: 1fr calc(60px * var(--pv-ui-scale)) 1fr;
    grid-template-rows: auto auto;
    align-items: start;
    margin-bottom: calc(80px * var(--pv-ui-scale));
}

.pv-history__item:last-child {
    margin-bottom: 0;
}

/* Card is a pass-through so header/body become item grid children. */
.pv-history__card {
    display: contents;
}

.pv-history__header {
    grid-row: 1;
    padding: calc(32px * var(--pv-ui-scale));
}

.pv-history__body {
    grid-row: 2;
    padding: 0 calc(32px * var(--pv-ui-scale)) calc(32px * var(--pv-ui-scale));
}

.pv-history__header:has(+ .pv-history__body) {
    padding-bottom: 0;
}

/* Marker shares the header row only — not the expandable body. */
.pv-history__dot-column {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    position: relative;
    z-index: 2;
}

.pv-history__spacer {
    grid-row: 1;
}

.pv-history__item--left .pv-history__header,
.pv-history__item--left .pv-history__body {
    grid-column: 1;
    text-align: right;
}

.pv-history__item--left .pv-history__spacer {
    grid-column: 3;
}

.pv-history__item--right .pv-history__header,
.pv-history__item--right .pv-history__body {
    grid-column: 3;
    text-align: left;
}

.pv-history__item--right .pv-history__spacer {
    grid-column: 1;
}

/* ── Card ── */

.pv-history__year {
    font-family: var(--wp--preset--font-family--plus-jakarta-sans, 'Plus Jakarta Sans', sans-serif);
    font-weight: 700;
    font-size: calc(48px * var(--pv-ui-scale));
    line-height: 1.05;
    letter-spacing: calc(-1.44px * var(--pv-ui-scale));
    color: var(--wp--preset--color--brand-01-dark, #102f5d);
}

.pv-history__card-title {
    font-family: var(--wp--preset--font-family--plus-jakarta-sans, 'Plus Jakarta Sans', sans-serif);
    font-weight: 700;
    font-size: calc(22px * var(--pv-ui-scale));
    letter-spacing: calc(-0.66px * var(--pv-ui-scale));
    line-height: 1.1;
    color: var(--wp--preset--color--brand-01-dark, #102f5d);
    margin: calc(6px * var(--pv-ui-scale)) 0 0;
}

.pv-history__lisainfo {
    margin-top: calc(12px * var(--pv-ui-scale));
}

.pv-history__item--left .pv-history__lisainfo {
    display: flex;
    justify-content: flex-end;
}

.pv-history__disclosure {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 320ms cubic-bezier(0.4, 0, 0.2, 1),
        opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.pv-history__item.is-open .pv-history__disclosure {
    grid-template-rows: 1fr;
    opacity: 1;
}

.pv-history__disclosure-inner {
    overflow: hidden;
    min-height: 0;
}

.pv-history__disclosure-content {
    transform: translateY(calc(-4px * var(--pv-ui-scale)));
    transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

.pv-history__item.is-open .pv-history__disclosure-content {
    transform: translateY(0);
}

.pv-history__text,
.pv-history__text p {
    font-family: var(--wp--preset--font-family--inter, 'Inter', sans-serif);
    font-size: calc(16px * var(--pv-ui-scale));
    line-height: 1.5;
    color: #666666;
    margin: 0;
}

.pv-history__disclosure .pv-history__text {
    margin-top: calc(16px * var(--pv-ui-scale));
}

.pv-history__text p + p {
    margin-top: calc(12px * var(--pv-ui-scale));
}

.pv-history__image {
    margin-top: calc(24px * var(--pv-ui-scale));
    max-width: 50%;
    border-radius: calc(12px * var(--pv-ui-scale));
    overflow: hidden;
}

/* Keep the image aligned to the card's side. */
.pv-history__item--left .pv-history__image {
    margin-left: auto;
}

.pv-history__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pv-history__link {
    display: inline-flex;
    align-items: center;
    gap: calc(6px * var(--pv-ui-scale));
    margin-top: calc(24px * var(--pv-ui-scale));
    color: var(--wp--preset--color--primary-blue, #0068ff);
    font-family: var(--wp--preset--font-family--inter, 'Inter', sans-serif);
    font-weight: 600;
    font-size: calc(16px * var(--pv-ui-scale));
    text-decoration: none;
    transition: gap 0.2s ease;
}

.pv-history__link:hover {
    gap: calc(10px * var(--pv-ui-scale));
}

.pv-history__link-icon {
    flex-shrink: 0;
}

/* Left cards align their inline-flex link to the right edge. */
.pv-history__item--left .pv-history__link {
    flex-direction: row-reverse;
}

/* ── Highlighted card ── */

.pv-history__card--highlight .pv-history__year {
    font-size: clamp(calc(48px * var(--pv-ui-scale)), 6vw, calc(62px * var(--pv-ui-scale)));
    letter-spacing: calc(-1.86px * var(--pv-ui-scale));
}

.pv-history__card--highlight .pv-history__card-title {
    font-size: clamp(calc(28px * var(--pv-ui-scale)), 4vw, calc(38px * var(--pv-ui-scale)));
    letter-spacing: calc(-1px * var(--pv-ui-scale));
}

.pv-history__card--highlight .pv-history__text,
.pv-history__card--highlight .pv-history__text p {
    font-weight: 600;
    color: var(--wp--preset--color--brand-01-dark, #102f5d);
}

/* ── Dots ── */

.pv-history__dot {
    width: calc(30px * var(--pv-ui-scale));
    height: calc(30px * var(--pv-ui-scale));
    border-radius: 50%;
    background: var(--wp--preset--color--brand-01-dark, #102f5d);
    flex-shrink: 0;
}

.pv-history__dot--highlight {
    position: relative;
    width: calc(52px * var(--pv-ui-scale));
    height: calc(52px * var(--pv-ui-scale));
    background: transparent;
}

.pv-history__ring {
    position: absolute;
    border-radius: 50%;
    background: var(--wp--preset--color--primary-blue, #0068ff);
}

.pv-history__ring--1 {
    width: calc(52px * var(--pv-ui-scale));
    height: calc(52px * var(--pv-ui-scale));
    top: 0;
    left: 0;
    opacity: 0.2;
}

.pv-history__ring--2 {
    width: calc(36px * var(--pv-ui-scale));
    height: calc(36px * var(--pv-ui-scale));
    top: calc(8px * var(--pv-ui-scale));
    left: calc(8px * var(--pv-ui-scale));
    opacity: 0.5;
}

.pv-history__ring--3 {
    width: calc(20px * var(--pv-ui-scale));
    height: calc(20px * var(--pv-ui-scale));
    top: calc(16px * var(--pv-ui-scale));
    left: calc(16px * var(--pv-ui-scale));
    opacity: 1;
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .pv-history__heading {
        margin-bottom: calc(40px * var(--pv-ui-scale));
    }

    .pv-history__timeline::before {
        left: calc(26px * var(--pv-ui-scale));
    }

    .pv-history__item {
        grid-template-columns: calc(52px * var(--pv-ui-scale)) 1fr;
        margin-bottom: calc(56px * var(--pv-ui-scale));
    }

    .pv-history__dot-column {
        grid-column: 1;
        grid-row: 1;
    }

    .pv-history__item--left .pv-history__header,
    .pv-history__item--right .pv-history__header,
    .pv-history__item--left .pv-history__body,
    .pv-history__item--right .pv-history__body {
        grid-column: 2;
        text-align: left;
    }

    .pv-history__header {
        grid-row: 1;
        padding: 0 0 0 calc(16px * var(--pv-ui-scale));
    }

    .pv-history__body {
        grid-row: 2;
        padding: 0 0 0 calc(16px * var(--pv-ui-scale));
    }

    .pv-history__header:has(+ .pv-history__body) {
        padding-bottom: 0;
    }

    .pv-history__item--left .pv-history__link {
        flex-direction: row;
    }

    .pv-history__item--left .pv-history__lisainfo {
        justify-content: flex-start;
    }

    .pv-history__item--left .pv-history__image {
        margin-left: 0;
    }

    .pv-history__image {
        max-width: 65%;
    }

    .pv-history__spacer {
        display: none;
    }

    .pv-history__year {
        font-size: calc(36px * var(--pv-ui-scale));
    }

    .pv-history__card--highlight .pv-history__year {
        font-size: calc(40px * var(--pv-ui-scale));
    }
}

@media (prefers-reduced-motion: reduce) {
    .pv-history__disclosure,
    .pv-history__disclosure-content {
        transition: none;
    }

    .pv-history__disclosure-content {
        transform: none;
    }
}
