/**
 * Watch atelier & goldsmith page (CMS "uhrenatelier-goldschmiede", de 7 / en 8; menu link menu-uhrenatelier-gold.html,
 * layout "Page -- Full Width"). Loaded only via Magento_Cms/layout/cms_page_view_id_uhrenatelier-goldschmiede.xml,
 * after the shared kz-brand.css. Same look as the Partnerringe page (kz-partnerringe.css).
 *
 * Content is native Page Builder. Styling hooks are the row CSS classes set in Page Builder
 * (full-bleed rows: on the row, contained rows: on its inner element):
 * kz-at + kz-at-split (text + photo rows: kz-at-opener, kz-at-goldsmith) | kz-at-services |
 * kz-at-band (two-column text rows: kz-at-certified, kz-at-closing) | kz-at-portrait,
 * column class kz-at-photo (column background image = photo), text classes kz-at-kicker, kz-at-caption.
 * Ivory and #111 are row background colours set in Page Builder; gold only for kicker lines and list dashes.
 * Photos: CSS parallax (off for reduced motion).
 */

.kz-at {
    --kz-muted: #595959; /* secondary text on white and ivory, >= 6.5:1 */
    --kz-gold: #b39b5f;
    line-height: 1.7;

    & p {
        margin: 0 0 1rem;
        color: var(--kz-muted);
    }

    & p:last-child {
        margin-bottom: 0;
    }

    & h2 {
        margin: 0 0 1rem;
        font-size: clamp(1.75rem, 3vw, 2.5rem);
        font-weight: 400;
        line-height: 1.2;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        text-wrap: balance;
    }

    & h3 {
        margin: 0 0 0.75rem;
        font-size: 0.8125rem;
        font-weight: 600;
        letter-spacing: 0.15em;
        text-transform: uppercase;
    }

    & a:not([class*="pagebuilder-button"]) {
        color: #111;
        text-decoration: underline;
        text-underline-offset: 0.25em;
    }

    & [data-content-type="buttons"] {
        margin-top: 1.75rem;
    }
}

/* Small uppercase line above a heading */
.kz-at .kz-at-kicker p {
    margin-bottom: 1rem;
    color: #111;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.kz-at .kz-at-caption {
    margin-top: 1rem;

    & p {
        font-size: 0.8125rem;
    }
}

/* ---- Text + photo rows (opener, goldsmith): photo first and 4:5 on phones ---- */
.kz-at-split {
    & .kz-at-photo {
        order: -1;
        aspect-ratio: 4 / 5;
        background-size: cover;
    }

    & .pagebuilder-column:not(.kz-at-photo) {
        padding: 2.5rem var(--kz-edge) 3rem;
    }

    & .kz-at-kicker::before {
        content: "";
        display: block;
        width: 3rem;
        height: 1px;
        margin-bottom: 1rem;
        background: var(--kz-gold);
    }
}

/* watchmaker photo: cropped to the movement (Page Builder sets "center center" inline). The photo is landscape,
   so "cover" leaves no height to move for the parallax: at least 125 % high (30vw keeps it wide enough on desktop) */
.kz-at-opener .kz-at-photo {
    background-position-x: 62% !important;
    background-size: auto max(125%, 30vw) !important;
}

/* Parallax: the photos move slower than the page while scrolling (CSS scroll timeline, no script;
   off for reduced motion, static where the browser has no scroll timelines) - same as the pre-owned page */
@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
        .kz-at-photo {
            animation: kz-at-parallax linear both;
            animation-timeline: view();
        }
    }
}

@keyframes kz-at-parallax {
    from {
        background-position-y: 25%;
    }

    to {
        background-position-y: 75%;
    }
}

/* ---- Services: heading, three lists with short gold dashes ---- */
[data-content-type="row"][data-appearance="contained"]:has(> .kz-at-services) {
    margin-block: 0;
    padding-block: 2.5rem;
}

.kz-at-services {
    & .pagebuilder-column-line {
        gap: 2rem;
    }

    & .pagebuilder-column:not(:first-child) {
        padding-top: 1rem;
        border-top: 1px solid #e5e5e5;
    }

    & h2 {
        margin-bottom: 0;
    }

    & ul {
        display: grid;
        gap: 0.5rem;
        margin: 0;
        padding: 0;
        list-style: none;
        color: var(--kz-muted);
    }

    & li {
        display: grid;
        grid-template-columns: 1.25rem minmax(0, 1fr);
        line-height: 1.5;

        &::before {
            content: "";
            width: 0.6rem;
            height: 1px;
            margin-top: 0.75em;
            background: var(--kz-gold);
        }
    }
}

/* ---- Two-column text bands (certified on #111, contact on ivory) ---- */
.kz-at-band {
    padding: 3rem var(--kz-edge);

    & .pagebuilder-column-line {
        gap: 0.25rem;
    }
}

.kz-at-certified {
    color: #fff;

    & p {
        color: #c9c9c9;
    }

    & .kz-at-kicker p {
        color: var(--kz-gold);
    }
}

/* ---- Watch atelier: portrait flush with the ivory band (phones: edge to edge, then the text) ---- */
.kz-at-portrait {
    & figure {
        margin: 0;
    }

    & img {
        display: block;
        width: 100%;
    }

    & .pagebuilder-column:not(:first-child) {
        padding: 2.5rem var(--kz-edge) 3rem;
    }
}

@media (min-width: 48rem) {
    /* photo and text side by side, text column at the page edge; the photo fills the row height */
    .kz-at-split {
        & .kz-at-photo {
            order: 0;
            aspect-ratio: auto;
            min-height: 36rem;
        }

        & .pagebuilder-column:not(.kz-at-photo) {
            padding: 4rem 5rem 4rem var(--kz-edge);

            & > * {
                max-width: 32rem;
            }
        }
    }

    .kz-at-goldsmith .kz-at-photo {
        min-height: 40rem;
    }

    [data-content-type="row"][data-appearance="contained"]:has(> .kz-at-services) {
        padding-block: 4rem;
    }

    .kz-at-services .pagebuilder-column-line {
        gap: 2.5rem;
    }

    .kz-at-band {
        padding-block: 4rem;

        & .pagebuilder-column-line {
            gap: 6rem;
        }
    }

    .kz-at-closing .pagebuilder-column-line {
        align-items: center;
    }

    /* portrait at its own width (396px, never upscaled): on the left screen edge up to the page width,
       on wider screens on the page's content edge, so the block stays together with the rest of the page */
    .kz-at-portrait {
        & .pagebuilder-column:first-child {
            flex: 0 0 24.75rem;
            margin-left: calc(var(--kz-edge) - var(--kz-gutter));
        }

        & .pagebuilder-column:not(:first-child) {
            flex: 1 1 0;
            padding: 3rem var(--kz-edge) 3rem 6rem;

            & > * {
                max-width: 36rem;
            }
        }
    }
}
