/* Site-owned page-builder templates (see content-templates.js).
   Loaded by the builder and by every public page whose body was authored in it, so what a
   template looks like while editing is what it looks like once published. Each template is
   styled through its own classes instead of inline styles: the layout needs media queries,
   and the builder's own style panel still overrides any of it per instance. */

/* Oswald — self-hosted from Google Fonts (SIL Open Font License 1.1). Variable 300–700. */
@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/oswald/oswald-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/oswald/oswald-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Hero: photo with text over it ───────────────────────────────────────────────────────
   A full-cover photo shown exactly as uploaded (no tint over it), an outlined button in
   the top start corner and a condensed headline with a paragraph on the end side. Logical
   properties throughout, so an RTL page mirrors it: button on the right, text on the left.
   The photo is a real <img> rather than a CSS background so the builder's image tool can
   replace it, and so it carries alt text. White text stays legible on lighter photos through a
   soft shadow rather than a dark layer over the whole picture. */
.cms-hero {
    --cms-pad: clamp(24px, 3.6vw, 48px);
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-height: clamp(440px, 46vw, 620px);
    padding: var(--cms-pad);
    overflow: hidden;
    color: #fff;
    background: #0b0d14;
}

.cms-hero .cms-hero__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    object-fit: cover;
    object-position: 25% center;
}

.cms-hero .cms-hero__back {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    min-height: 60px;
    padding: 0 28px;
    border: 1px solid rgba(255, 255, 255, .9);
    color: #fff;
    font-size: 1rem;
    letter-spacing: .02em;
    text-decoration: none;
    background: transparent;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
    box-shadow: 0 0 6px rgba(0, 0, 0, .15);
    transition: background-color .2s ease, color .2s ease;
}
.cms-hero .cms-hero__back:hover,
.cms-hero .cms-hero__back:focus-visible {
    background: #fff;
    color: #0b0d14;
    text-shadow: none;
}

.cms-hero .cms-hero__text {
    align-self: flex-end;
    width: min(100%, 400px);
    margin-block: auto;
    margin-inline-end: clamp(0px, 6vw, 96px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 2px 14px rgba(0, 0, 0, .35);
}

.cms-hero .cms-hero__title {
    margin: 0 0 clamp(20px, 3vw, 40px);
    color: #fff;
    font-family: 'Oswald', var(--font-base, 'Heebo'), sans-serif;
    font-size: clamp(3rem, 6.4vw, 5.25rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: .01em;
    text-transform: uppercase;
}

.cms-hero .cms-hero__text p {
    margin: 0 0 1em;
    color: rgba(255, 255, 255, .92);
    font-size: 1rem;
    line-height: 1.6;
}
.cms-hero .cms-hero__text p:last-child { margin-bottom: 0; }
/* The builder rewrites <b> as <span class="font-semibold"> on insert. */
.cms-hero .cms-hero__text b,
.cms-hero .cms-hero__text strong,
.cms-hero .cms-hero__text .font-semibold,
.cms-hero .cms-hero__text .font-bold { color: #fff; font-weight: 700; }

/* ── Free placement ─────────────────────────────────────────────────────────────────────
   Any item in a hero can be dragged to a spot of its own in the builder
   (content-templates-editor.js), which marks it .cms-placed and stores where it went as two
   fractions of the free space: --cms-x / --cms-y, 0 = start edge, 1 = far edge. Offsetting
   by that fraction of the hero and pulling back by the same fraction of the item itself
   keeps the item inside the photo at any width — the same position on a 1920px and a 900px
   screen, never pushed off the side. Only from tablet width up: a phone keeps the stacked
   layout below, because a spot chosen on a wide photo has no meaningful equivalent there. */
@media (min-width: 768px) {
    .cms-hero > .cms-placed {
        position: absolute;
        left: calc(var(--cms-pad) + var(--cms-x, 0) * (100% - 2 * var(--cms-pad)));
        top: calc(var(--cms-pad) + var(--cms-y, 0) * (100% - 2 * var(--cms-pad)));
        transform: translate(calc(var(--cms-x, 0) * -100%), calc(var(--cms-y, 0) * -100%));
        margin: 0;
    }
}

/* On a phone the photo stays the backdrop and the text drops to the bottom of it. */
@media (max-width: 767.98px) {
    .cms-hero { min-height: 560px; }
    .cms-hero .cms-hero__text { align-self: stretch; margin-block: auto 0; margin-inline-end: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cms-hero .cms-hero__back { transition: none; }
}
