/*
Theme Name: NuciBici Child
Description: Custom NuciBici presentation layer
Author: NuciBici
Template: hello-elementor
Version: 2.8
*/

/* Museum typeface — local WOFF2 files in the child theme's /fonts/ folder. */
@font-face {
    font-family: "Museum";
    src: url("fonts/Museum-Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Museum";
    src: url("fonts/Museum-Medium.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Museum";
    src: url("fonts/Museum-DemiBold.woff2") format("woff2");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "Museum";
    src: url("fonts/Museum-Bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}



:root {
    --welcome: #1380c3;
    --community: #d51e30;
    --museum: #000000;
    --events: #fbdd03;
    --cake: #41ac4a;

    --ypsilon: 2vw;
    --logo-width: 85px;
    --nav-height: 28px;
    --news-size: clamp(14px, 1.2vw, 20px);
    --news-line-height: 1.4;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    background: #fff;
}

body {
    color: #000;
    font-family: "Museum", "Noto Sans", sans-serif;
}

.nucibici-home {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

.logo {
    position: fixed;
    top: var(--ypsilon);
    left: var(--ypsilon);
    width: var(--logo-width);
    z-index: 1000;
}

.logo a {
    display: block;
    width: 100%;
}

.logo img {
    display: block;
    width: 100%;
    height: auto;
}

.landing {
    position: relative;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.landing-content {
    position: absolute;
    left: 50%;
    bottom: var(--ypsilon);
    transform: translateX(-50%);
    width: var(--container-width);
    height: var(--container-height);
    box-sizing: border-box;
    overflow: visible;
}

.bike-frame {
    position: absolute;
    left: 0;
    top: var(--gap);
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    box-sizing: border-box;
}

.bike-link {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    text-decoration: none;
}

.bike-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.2s ease, opacity 1.8s ease;
}

.bike-image-current {
    position: relative;
    z-index: 1;
}

.bike-image-next {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
}

.bike-image-next.is-visible {
    opacity: 1;
}

.bike-image-current.is-fading-out {
    opacity: 0;
}

.bike-link:hover .bike-image-current {
    transform: scale(1.01);
}

.news-wrapper {
    position: absolute;
    left: 0;
    top: var(--news-top);
    width: 100%;
    height: var(--news-height);
    overflow: hidden;
    box-sizing: border-box;
}

.news-link {
    display: flex;
    width: 100%;
    height: 100%;
    min-width: 0;
    align-items: baseline;
    white-space: nowrap;
    overflow: hidden;
    color: #000;
    text-decoration: none;
    font-size: var(--news-size);
    line-height: var(--news-line-height);
}

.news-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    -webkit-mask-image: linear-gradient(to right, black 0%, black 70%, transparent 100%);
    mask-image: linear-gradient(to right, black 0%, black 70%, transparent 100%);
}

.read-more {
    flex: 0 0 auto;
    margin-left: 6px;
    color: #000;
    font-style: italic;
    font-weight: 700;
    white-space: nowrap;
    line-height: inherit;
}

.colour-nav {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: var(--nav-height);
    display: grid;
    grid-template-columns: 1fr var(--ypsilon) 1fr var(--ypsilon) 1fr var(--ypsilon) 1fr var(--ypsilon) 1fr;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.colour-nav a {
    display: block;
    height: 100%;
    text-decoration: none;
    transition: filter 0.2s ease, opacity 0.2s ease;
    border-radius: calc(var(--nav-height) / 2) !important;
}

.nav-welcome { grid-column: 1; background: var(--welcome); }
.nav-community { grid-column: 3; background: var(--community); }
.nav-museum { grid-column: 5; background: var(--museum); }
.nav-events { grid-column: 7; background: var(--events); }
.nav-cake { grid-column: 9; background: var(--cake); }

.colour-nav a:hover {
    filter: brightness(1.12);
}

.language-selector {
    position: fixed !important;
    top: 2vw !important;
    right: 2vw !important;
    z-index: 1100 !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #000 !important;
    font-family: "Museum", "Noto Sans", sans-serif !important;
    font-size: clamp(13px, 1.2vw, 20px) !important;
    line-height: 1.4 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.language-current {
    display: inline !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #000 !important;
    font-family: "Museum", "Noto Sans", sans-serif !important;
    font-size: inherit !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
}

.language-current:hover,
.language-current:focus,
.language-current:focus-visible,
.language-current:active {
    color: #000 !important;
    background: transparent !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.language-arrow {
    display: inline-block;
    margin-left: 2px;
    color: #000 !important;
    font-size: 0.8em !important;
    background: transparent !important;
    transition: transform 0.2s ease;
}

.language-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    display: none;
    min-width: 45px;
    padding: 4px 0 !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
}

.language-menu a {
    display: block;
    padding: 3px 6px;
    color: #000 !important;
    background: transparent !important;
    border: 0 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: 1.4;
    text-decoration: none !important;
    text-align: right;
    white-space: nowrap;
}

.language-menu a:hover {
    color: #000 !important;
    background: #f2f2f2 !important;
}

.language-selector.open .language-menu {
    display: block;
}

.language-selector.open .language-arrow {
    transform: rotate(180deg);
}

/* Landing-page reveal controller. The page loads normally; these states only
   control when already-loaded elements become visually revealed. The initial
   state is established before first paint; the reveal begins only after two
   animation frames, so the browser cannot collapse both states into one. */
html.nucibici-home-reveal .colour-nav,
html.nucibici-home-reveal .logo,
html.nucibici-home-reveal .bike-frame,
html.nucibici-home-reveal .news-wrapper {
    will-change: opacity, transform, clip-path;
}

html.nucibici-home-reveal .colour-nav {
    opacity: 0;
    transform: translateY(-100%);
}

html.nucibici-home-reveal .logo {
    opacity: 0;
}

html.nucibici-home-reveal .bike-frame {
    opacity: 0;
    transform: translateX(-12vw);
}

html.nucibici-home-reveal .news-wrapper {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
}

html.nucibici-home-revealing .colour-nav {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .55s cubic-bezier(.22,.61,.36,1), transform .55s cubic-bezier(.22,.61,.36,1) !important;
}

html.nucibici-home-revealing .logo {
    opacity: 1;
    transition: opacity .45s ease-out .35s !important;
}

html.nucibici-home-revealing .bike-frame {
    opacity: 1;
    transform: translateX(0);
    transition: opacity .70s cubic-bezier(.22,.61,.36,1) .60s, transform .70s cubic-bezier(.22,.61,.36,1) .60s !important;
}

html.nucibici-home-revealing .news-wrapper {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transition: opacity .55s steps(30, end) 1.45s, clip-path .55s steps(30, end) 1.45s !important;
}

.nucibici-home.nucibici-page-leaving {
    opacity: 0;
    transition: opacity 1s linear !important;
}

/* Destination reveal: navigation is never held up. The white layer simply
   reveals the already-loading destination on a fixed one-second timeline. */
.nucibici-page-reveal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: #fff;
    opacity: 0;
    pointer-events: none;
}

html.nucibici-transition-pending .nucibici-page-reveal {
    opacity: 1;
}

html.nucibici-transition-in .nucibici-page-reveal {
    animation: nucibici-page-reveal-out 1s linear both;
}

@keyframes nucibici-page-reveal-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.nucibici-news-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    overflow-y: auto;
    background: #fff;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.nucibici-news-modal.is-open {
    display: block;
    opacity: 1;
}

.nucibici-news-modal-logo {
    position: fixed;
    top: var(--ypsilon);
    left: var(--ypsilon);
    width: var(--logo-width);
    z-index: 2;
    display: block;
    cursor: pointer;
}

.nucibici-news-modal-logo img {
    display: block;
    width: 100%;
    height: auto;
}

.nucibici-news-modal-content {
    width: min(1000px, calc(100vw - (4 * var(--ypsilon))));
    margin: 0 auto;
    padding: calc(var(--ypsilon) * 4) 0 calc(var(--ypsilon) * 2);
    font-family: "Museum", "Noto Sans", sans-serif;
}

.nucibici-news-modal-content h2 {
    margin: 0 0 calc(var(--ypsilon) / 2);
    font-size: clamp(22px, 2vw, 34px);
    line-height: 1.15;
}

.nucibici-news-modal-content time {
    display: block;
    margin-bottom: var(--ypsilon);
}

.nucibici-news-modal-summary,
.nucibici-news-modal-article {
    max-width: 1000px;
    line-height: 1.5;
}

.nucibici-news-modal-related {
    margin-top: calc(var(--ypsilon) * 1.5);
}

.nucibici-news-modal-related h3 {
    margin: 0 0 calc(var(--ypsilon) / 2);
    font-size: 1em;
}

.nucibici-news-modal-related a {
    display: block;
    width: fit-content;
    margin: calc(var(--ypsilon) / 3) 0;
    color: #000;
    text-decoration: underline;
}

.nucibici-news-modal-actions {
    display: flex;
    gap: var(--ypsilon);
    align-items: center;
    flex-wrap: wrap;
    margin-top: calc(var(--ypsilon) * 1.5);
}

.nucibici-news-modal-actions a,
.nucibici-news-modal-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--nav-height);
    padding: 0 calc(var(--ypsilon) * .9);
    margin: 0;
    border: 0 !important;
    border-radius: calc(var(--nav-height) / 2) !important;
    background: transparent !important;
    color: #000 !important;
    font: inherit;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
}

.nucibici-news-modal-actions a:hover,
.nucibici-news-modal-actions a:focus-visible,
.nucibici-news-modal-actions button:hover,
.nucibici-news-modal-actions button:focus-visible {
    background: #fbdd03 !important;
    color: #000 !important;
    outline: none;
}

.nucibici-news-modal-actions button {
    margin-left: auto;
}

.nucibici-modal-open {
    overflow: hidden;
}

@keyframes nucibici-nav-in {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes nucibici-logo-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes nucibici-bike-in {
    from { opacity: 0; transform: translateX(-12vw); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes nucibici-news-in {
    from { opacity: 0; clip-path: inset(0 100% 0 0); }
    to { opacity: 1; clip-path: inset(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
    html.nucibici-home-reveal .colour-nav,
    html.nucibici-home-reveal .logo,
    html.nucibici-home-reveal .bike-frame,
    html.nucibici-home-reveal .news-wrapper {
        opacity: 1;
        transform: none;
        clip-path: none;
    }

    html.nucibici-transition-in .nucibici-page-reveal {
        animation: none;
        opacity: 0;
    }

    .nucibici-home.nucibici-page-leaving,
    .bike-image {
        transition: none;
    }
}

@media (max-width: 1024px) {
    :root {
        --ypsilon: 3vw;
        --logo-width: 70px;
        --nav-height: 25px;
    }

    .language-selector {
        top: 3vw !important;
        right: 3vw !important;
    }
}

@media (max-width: 700px) {
    .language-selector {
        top: 4vw !important;
        right: 4vw !important;
    }
}

@media (max-width: 700px) and (orientation: landscape) {
    :root {
        --ypsilon: 1.333vw;
    }

    .logo {
        top: 1.33vw;
        left: 1.33vw;
        width: 60px;
    }

    .colour-nav {
        height: 23px;
        grid-template-columns: 1fr 1.33vw 1fr 1.33vw 1fr 1.33vw 1fr 1.33vw 1fr;
    }

    .language-selector {
        top: 1.33vw !important;
        right: 1.33vw !important;
    }
}

@media (max-width: 450px) {
    :root {
        --ypsilon: 4vw;
        --logo-width: 55px;
        --nav-height: 22px;
    }
}

/* In portrait phone/tablet layouts, let the news-popup logo scroll with
   the article, matching the behaviour of the site's other content pages.
   Landscape and desktop retain the fixed-logo behaviour. */
@media (max-width: 1100px) and (orientation: portrait) {
    .nucibici-news-modal-logo {
        position: absolute;
    }

    /* Keep one Ypsilon of clear space between the scrolling logo and article text.
       A logo-width-based top inset is used because the logo is an image and its
       rendered height follows its intrinsic aspect ratio. */
    .nucibici-news-modal-content {
        padding-top: calc(var(--logo-width) + (2 * var(--ypsilon)));
    }
}

/* Museum typography for Latin-script site languages.
   Font sizes, weights, spacing, breakpoints and layout remain unchanged.
   Noto Sans / generic sans-serif provide per-glyph fallback where Museum has no glyph. */
html:lang(en) body,
html:lang(pt) body,
html:lang(es) body,
html:lang(fr) body,
html:lang(de) body,
html:lang(it) body {
    font-family: "Museum", "Noto Sans", sans-serif !important;
}

html:lang(en) body :is(h1, h2, h3, h4, h5, h6, p, a, button, input, select, textarea, label, li, time, blockquote, figcaption, td, th, summary),
html:lang(pt) body :is(h1, h2, h3, h4, h5, h6, p, a, button, input, select, textarea, label, li, time, blockquote, figcaption, td, th, summary),
html:lang(es) body :is(h1, h2, h3, h4, h5, h6, p, a, button, input, select, textarea, label, li, time, blockquote, figcaption, td, th, summary),
html:lang(fr) body :is(h1, h2, h3, h4, h5, h6, p, a, button, input, select, textarea, label, li, time, blockquote, figcaption, td, th, summary),
html:lang(de) body :is(h1, h2, h3, h4, h5, h6, p, a, button, input, select, textarea, label, li, time, blockquote, figcaption, td, th, summary),
html:lang(it) body :is(h1, h2, h3, h4, h5, h6, p, a, button, input, select, textarea, label, li, time, blockquote, figcaption, td, th, summary) {
    font-family: "Museum", "Noto Sans", sans-serif !important;
}

html:lang(en) .language-selector,
html:lang(pt) .language-selector,
html:lang(es) .language-selector,
html:lang(fr) .language-selector,
html:lang(de) .language-selector,
html:lang(it) .language-selector,
html:lang(en) .language-current,
html:lang(pt) .language-current,
html:lang(es) .language-current,
html:lang(fr) .language-current,
html:lang(de) .language-current,
html:lang(it) .language-current,
html:lang(en) .nucibici-news-modal-content,
html:lang(pt) .nucibici-news-modal-content,
html:lang(es) .nucibici-news-modal-content,
html:lang(fr) .nucibici-news-modal-content,
html:lang(de) .nucibici-news-modal-content,
html:lang(it) .nucibici-news-modal-content {
    font-family: "Museum", "Noto Sans", sans-serif !important;
}


/* NuciBici content typography controls — shared by the editor and site. */
.museum-weight-400 { font-family: "Museum", Arial, sans-serif; font-weight: 400 !important; }
.museum-weight-500 { font-family: "Museum", Arial, sans-serif; font-weight: 500 !important; }
.museum-weight-600 { font-family: "Museum", Arial, sans-serif; font-weight: 600 !important; }
.museum-weight-700 { font-family: "Museum", Arial, sans-serif; font-weight: 700 !important; }

.museum-size-small { font-size: 0.85em !important; }
.museum-size-normal { font-size: 1em !important; }
.museum-size-large { font-size: 1.25em !important; }

/* Page title headings on these three sections use the supplied bold font. */
.page-welcome .inner-document h1,
.page-museum .inner-document h1,
.page-cake .inner-document h1 {
    font-family: "Museum", Arial, sans-serif;
    font-weight: 700;
}

/* Test: no underline anywhere in the inner-page header links */
.nucibici-inner-page,
.nucibici-inner-page main,
.nucibici-inner-page .inner-content-area,
.nucibici-inner-subnav,
.nucibici-inner-subnav .subnav-item,
.nucibici-inner-subnav a {
    text-decoration: none !important;
    text-decoration-line: none !important;
}
