/*
Theme Name: Open Mountain
Theme URI: https://openmountain.it
Author: Open Mountain Team
Description: Tema Custom 1:1 per l'associazione culturale Open Mountain
Version: 1.14.0
*/

/* WordPress Admin Bar - Offset fixed header and main content when logged in */
.admin-bar #navbar {
    top: 32px !important;
}

.admin-bar main {
    margin-top: calc(4rem + 32px) !important;
}

@media screen and (max-width: 782px) {
    .admin-bar #navbar {
        top: 46px !important;
    }
    .admin-bar main {
        margin-top: calc(4rem + 46px) !important;
    }
}

@media screen and (max-width: 600px) {
    #wpadminbar {
        position: fixed !important;
    }
}

/* Keyboard focus always visible (several buttons and inputs drop the browser outline) */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid #eab308;
    outline-offset: 2px;
}

/* Touch screens: inputs at 16px at least, otherwise iOS zooms the page on focus */
@media (pointer: coarse) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select,
    textarea {
        font-size: max(16px, 1em);
    }
}

/* Form being sent (htmx / omSubmit in footer.php) */
[aria-busy="true"] button {
    opacity: 0.6;
    cursor: progress;
}


/* Phones and tablets follow the system light/dark setting: no theme button (header.php) */
@media (hover: none) and (pointer: coarse) {
    .om-theme-toggle {
        display: none !important;
    }
}

/* Less motion requested: no smooth scrolling (html.scroll-smooth in header.php) */
@media (prefers-reduced-motion: reduce) {
    html.scroll-smooth {
        scroll-behavior: auto;
    }
}


/* ------------------------------------------------------------------
 * Installed app (PWA) mode
 * html.pwa is set in header.php when running standalone.
 * The app is a booking tool: website navigation and footer are hidden,
 * a bottom tab bar takes over, informational blocks (.pwa-hide) disappear.
 * ------------------------------------------------------------------ */
.pwa-only {
    display: none !important;
}

html.pwa .pwa-only {
    display: flex !important;
}

html.pwa .pwa-hide {
    display: none !important;
}

html.pwa body {
    padding-bottom: calc(4.25rem + env(safe-area-inset-bottom));
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
}

html.pwa #navbar {
    padding-top: env(safe-area-inset-top);
}

html.pwa main {
    margin-top: calc(4rem + env(safe-area-inset-top)) !important;
}

html.pwa #pwa-tabbar {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Booking-first pages in the app: tighter spacing */
html.pwa .pwa-compact {
    margin-top: 1.25rem !important;
    margin-bottom: 1.25rem !important;
}

/* "Install app" instructions (footer.php): bottom sheet on phones, centred dialog from sm up.
 * Plain CSS, so it doesn't depend on the compiled Tailwind build. */
.install-sheet {
    margin: auto auto 0;
    max-height: 90vh;
    padding: 0 0 env(safe-area-inset-bottom);
    border-radius: 1.5rem 1.5rem 0 0;
}

.install-sheet ol {
    list-style: decimal;
    padding-left: 1.25rem;
}

.install-sheet-icon {
    width: 3rem;
    height: 3rem;
}

.install-sheet::backdrop {
    background: rgb(0 0 0 / 0.5);
}

@media (min-width: 640px) {
    .install-sheet {
        margin: auto;
        border-radius: 1.5rem;
    }
}

/* Password fields with the show/hide "eye" (assets/js/password-toggle.js). Plain CSS, independent of the Tailwind build. */
.pw-field {
    position: relative;
    display: block;
}

.pw-field > input {
    padding-right: 3rem !important;
}

.pw-toggle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    background: none;
    border: 0;
    border-radius: 0 0.75rem 0.75rem 0;
    cursor: pointer;
}

.pw-toggle:hover,
.pw-toggle:focus-visible {
    color: #ca8a04;
}

.pw-toggle:focus-visible {
    outline: 2px solid #eab308;
    outline-offset: -2px;
}

/* Edge has its own reveal button: keep only ours */
.pw-field > input::-ms-reveal {
    display: none;
}

/* "Password dimenticata?" link under the login password field */
.login-forgot {
    text-align: right;
}

/* "Accedi con Google / Facebook" buttons (inc/social-login.php). Plain CSS, independent of the Tailwind build.
 * Prefix om-sso: .om-social is the footer/contacts social links. */
.om-sso {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.om-sso-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s;
}

.om-sso-btn:focus-visible {
    outline: 2px solid #eab308;
    outline-offset: 2px;
}

/* Google branding: light button with the coloured G, dark variant in dark mode */
.om-sso-btn--google {
    background: #fff;
    color: #1f1f1f;
    border-color: #747775;
}

.om-sso-btn--google:hover {
    background: #f2f2f2;
}

.dark .om-sso-btn--google {
    background: #131314;
    color: #e3e3e3;
    border-color: #8e918f;
}

.dark .om-sso-btn--google:hover {
    background: #2a2a2c;
}

/* Facebook branding: blue button with the white "f" */
.om-sso-btn--facebook {
    background: #1877f2;
    color: #fff;
}

.om-sso-btn--facebook:hover {
    background: #166fe5;
}

.om-sso-note {
    margin: 0;
    font-size: 0.75rem;
    text-align: center;
    color: #6b7280;
}

.om-sso-note a {
    text-decoration: underline;
}

.om-sso-privacy {
    margin-top: 0.75rem;
}

.om-sso-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.om-sso-divider::before,
.om-sso-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid #e5e7eb;
}

.dark .om-sso-divider::before,
.dark .om-sso-divider::after {
    border-color: #1f2937;
}

/* ------------------------------------------------------------------
 * Acrylic surfaces (Windows 11 style): blur + saturation of what is
 * underneath, a translucent tint and a fine grain on top.
 * Plain CSS, independent of the Tailwind build.
 * ------------------------------------------------------------------ */
:root {
    --om-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='.33 .33 .33 0 0 .33 .33 .33 0 0 .33 .33 .33 0 0 0 0 0 0 .07'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    --om-acrylic-filter: blur(22px) saturate(170%);
}

/* Header: the acrylic sits on a pseudo-element, so the header itself has no
 * backdrop-filter and the mobile menu inside it can blur the page too.
 * Less transparent at the top, more at the bottom. */
#navbar.acrylic {
    background: transparent;
    border-bottom-color: rgb(203 213 225 / 0.6);
}

#navbar.acrylic::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: var(--om-grain), linear-gradient(to bottom, rgb(236 241 247 / 0.9), rgb(236 241 247 / 0.6)); /* light blue-grey, like the cards */
    -webkit-backdrop-filter: var(--om-acrylic-filter);
    backdrop-filter: var(--om-acrylic-filter);
}

.dark #navbar.acrylic {
    border-bottom-color: rgb(255 255 255 / 0.06);
}

.dark #navbar.acrylic::before {
    background: var(--om-grain), linear-gradient(to bottom, rgb(17 24 39 / 0.88), rgb(17 24 39 / 0.5));
}

/* Menu dropdown (hamburger below xl, 1280px: header.php) */
@media (max-width: 1279.98px) {
    #mobile-menu {
        background: var(--om-grain), linear-gradient(to bottom, rgb(236 241 247 / 0.6), rgb(236 241 247 / 0.4));
        -webkit-backdrop-filter: var(--om-acrylic-filter);
        backdrop-filter: var(--om-acrylic-filter);
        border-bottom-color: rgb(203 213 225 / 0.6);
    }

    .dark #mobile-menu {
        background: var(--om-grain), linear-gradient(to bottom, rgb(17 24 39 / 0.6), rgb(17 24 39 / 0.4));
        border-bottom-color: rgb(255 255 255 / 0.06);
    }
}

/* App tab bar: mirror of the header (same colour, theme-color in header.php), more opaque at the bottom */
#pwa-tabbar {
    background: var(--om-grain), linear-gradient(to top, rgb(236 241 247 / 0.9), rgb(236 241 247 / 0.6));
    -webkit-backdrop-filter: var(--om-acrylic-filter);
    backdrop-filter: var(--om-acrylic-filter);
    border-top-color: rgb(203 213 225 / 0.6);
}

.dark #pwa-tabbar {
    background: var(--om-grain), linear-gradient(to top, rgb(17 24 39 / 0.9), rgb(17 24 39 / 0.55));
    border-top-color: rgb(255 255 255 / 0.06);
}

/* Confirmation modals: the page behind is blurred by the overlay, the card is a
 * translucent grained tint on top of it (no second backdrop-filter needed). */
.acrylic-overlay {
    background-color: rgb(0 0 0 / 0.35);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
}

.acrylic-card {
    background: var(--om-grain), rgb(255 255 255 / 0.8);
    border-color: rgb(255 255 255 / 0.5);
}

.dark .acrylic-card {
    background: var(--om-grain), rgb(17 24 39 / 0.8);
    border-color: rgb(255 255 255 / 0.08);
}

/* "Install app" sheets (footer.php) */
#install-help,
#install-promo {
    background: var(--om-grain), rgb(255 255 255 / 0.82);
}

.dark #install-help,
.dark #install-promo {
    background: var(--om-grain), rgb(17 24 39 / 0.82);
}

#install-help::backdrop,
#install-promo::backdrop {
    background: rgb(0 0 0 / 0.35);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
}

/* Browsers without backdrop-filter: more opaque tints, still readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    #navbar.acrylic::before { background: rgb(236 241 247 / 0.96); }
    main :is(.rounded-xl, .rounded-2xl, .rounded-3xl).bg-white:not(.acrylic-card) { background: #fff; }
    .dark main :is(.rounded-xl, .rounded-2xl, .rounded-3xl).bg-white:not(.acrylic-card) { background: #111827; }
    .dark #navbar.acrylic::before { background: rgb(17 24 39 / 0.96); }
    #pwa-tabbar { background: rgb(236 241 247 / 0.96); }
    .dark #pwa-tabbar { background: rgb(17 24 39 / 0.96); }
    .acrylic-overlay { background-color: rgb(0 0 0 / 0.6); }
    .acrylic-card { background: #fff; }
    .dark .acrylic-card { background: #111827; }
    #install-help::backdrop, #install-promo::backdrop { background: rgb(0 0 0 / 0.5); }
    @media (max-width: 1279.98px) {
        #mobile-menu { background: rgb(236 241 247); }
        .dark #mobile-menu { background: #111827; }
    }
}

/* ------------------------------------------------------------------
 * Homepage hero: the video fills the whole screen and starts under the
 * header (no top margin on the home). The title sits a bit above the
 * centre so it doesn't cover the captions in the video.
 * ------------------------------------------------------------------ */
body.home main {
    margin-top: 0;
}

body.home.admin-bar main {
    margin-top: 0 !important;
}

/* Phone banner (footer.php): sticky at the bottom of the screen until the footer arrives.
 * In the app it sits on top of the tab bar; things sticky at the bottom of a page move above it. */
.om-phone-banner {
    z-index: 40;
    box-shadow: 0 -4px 12px rgb(0 0 0 / 0.08);
}

html.pwa .om-phone-banner {
    bottom: calc(3.4rem + env(safe-area-inset-bottom)); /* tab bar ~3.5rem tall: tucked just under it */
}

body:has(.om-phone-banner) main .sticky.bottom-4 {
    bottom: 3.75rem;
}

.hero-full {
    height: 100vh;
    height: 100svh;
}

.hero-copy {
    transform: translateY(-20vh);
}

/* Header menu on desktop (xl, 1280px): no background of its own. In dark mode the
 * template's dark:bg-gray-900 outranked xl:bg-transparent (higher specificity). */
@media (min-width: 1280px) {
    #mobile-menu,
    .dark #mobile-menu {
        background: transparent;
    }
}

/* ------------------------------------------------------------------
 * Content cards (white boxes in the pages): acrylic tint over the page,
 * so they let the hero photos and the background show through.
 * ------------------------------------------------------------------ */
main :is(.rounded-xl, .rounded-2xl, .rounded-3xl).bg-white:not(.acrylic-card) {
    background: var(--om-grain), rgb(236 241 247 / 0.8);
    border-color: rgb(203 213 225 / 0.6);
    -webkit-backdrop-filter: var(--om-acrylic-filter);
    backdrop-filter: var(--om-acrylic-filter);
}

.dark main :is(.rounded-xl, .rounded-2xl, .rounded-3xl).bg-white:not(.acrylic-card) {
    background: var(--om-grain), rgb(17 24 39 / 0.7);
    border-color: rgb(255 255 255 / 0.07);
}

/* Cards written without dark: variants (home, contatti, servizi, tirocini,
 * laboratori): light text in dark mode, prose included. */
.dark main :is(.rounded-xl, .rounded-2xl, .rounded-3xl).bg-white:not(.acrylic-card):not(.dark\:bg-gray-900) {
    color: #e5e7eb;
    --tw-prose-body: #d1d5db;
    --tw-prose-headings: #fff;
    --tw-prose-bold: #fff;
    --tw-prose-links: #facc15;
    --tw-prose-hr: rgb(255 255 255 / 0.1);
}

.dark main :is(.rounded-xl, .rounded-2xl, .rounded-3xl).bg-white:not(.acrylic-card):not(.dark\:bg-gray-900) :is(.text-gray-900, .text-gray-800) {
    color: #fff;
}

.dark main :is(.rounded-xl, .rounded-2xl, .rounded-3xl).bg-white:not(.acrylic-card):not(.dark\:bg-gray-900) :is(.text-gray-700, .text-gray-600) {
    color: #d1d5db;
}

.dark main :is(.rounded-xl, .rounded-2xl, .rounded-3xl).bg-white:not(.acrylic-card):not(.dark\:bg-gray-900) :is(.border-t, .border-b, .border-gray-100, .border-gray-200) {
    border-color: rgb(255 255 255 / 0.08);
}

/* Homepage tiles: the coloured veil over the photo is acrylic; on hover it
 * clears up (less blur, the Tailwind tint already fades) and shows the photo. */
.tile-acrylic {
    background-image: var(--om-grain);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
    backdrop-filter: blur(8px) saturate(140%);
    transition-property: background-color, backdrop-filter, -webkit-backdrop-filter;
}

.group:hover .tile-acrylic {
    -webkit-backdrop-filter: blur(1px) saturate(110%);
    backdrop-filter: blur(1px) saturate(110%);
}

/* Tile veils 20% lighter than the /60 of the templates (hover keeps /20) */
.tile-acrylic.bg-yellow-500\/60 { background-color: rgb(234 179 8 / 0.48); }
.tile-acrylic.bg-sky-500\/60 { background-color: rgb(14 165 233 / 0.48); }
.tile-acrylic.bg-red-500\/60 { background-color: rgb(239 68 68 / 0.48); }
.tile-acrylic.bg-pink-500\/60 { background-color: rgb(236 72 153 / 0.48); }
.tile-acrylic.bg-orange-500\/60 { background-color: rgb(249 115 22 / 0.48); }

/* ------------------------------------------------------------------
 * Maps: Google embed in Contatti (openmountain_map_embed()), image in the home
 * ------------------------------------------------------------------ */
.om-map-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Home tile: still satellite image without labels (assets/img/mappa-rosignano.webp,
 * Esri World Imagery), the whole tile links to Google Maps */
.om-map-credit {
    position: absolute;
    right: 0.4rem;
    bottom: 0.25rem;
    font-size: 0.6rem;
    color: rgb(255 255 255 / 0.75);
    pointer-events: none;
}

/* On hover the label goes away too, leaving only the map */
.om-map-tile .tile-acrylic span {
    transition: opacity 0.3s;
}

.om-map-tile:hover .tile-acrylic span {
    opacity: 0;
}

.om-map {
    aspect-ratio: 4 / 3;
    max-height: 450px;
    width: 100%;
    overflow: hidden;
    border-radius: 0.75rem;
    border: 1px solid rgb(203 213 225 / 0.6);
}

.dark .om-map {
    border-color: rgb(255 255 255 / 0.08);
}

@media (min-width: 768px) {
    .om-map {
        aspect-ratio: 16 / 9;
    }
}

/* ------------------------------------------------------------------
 * Social buttons (footer, Contatti): on hover they light up in each
 * network's own colours instead of the site yellow.
 * ------------------------------------------------------------------ */
.om-social {
    transition: background 0.25s, box-shadow 0.25s, transform 0.25s;
}

.om-social:hover,
.om-social:focus-visible {
    transform: translateY(-1px);
}

.om-social--facebook:hover,
.om-social--facebook:focus-visible {
    background: #1877f2;
    box-shadow: 0 0 14px rgb(24 119 242 / 0.55);
}

.om-social--instagram:hover,
.om-social--instagram:focus-visible {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
    box-shadow: 0 0 14px rgb(214 36 159 / 0.55);
}

.om-social--youtube:hover,
.om-social--youtube:focus-visible {
    background: #ff0000;
    box-shadow: 0 0 14px rgb(255 0 0 / 0.5);
}

/* Contatti page: two cards and the map (page-contatti.php) */
.om-contacts {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    grid-template-areas: "main" "map" "legal";
}

.om-contacts-main { grid-area: main; }
.om-contacts-legal { grid-area: legal; }
.om-contacts-map { grid-area: map; }

@media (min-width: 768px) {
    .om-contacts {
        grid-template-columns: 1fr 1fr;
        grid-template-areas: "main legal" "map map";
    }
}

/* OM Live (page-om-live.php): selected video in the list */
.om-live-item.is-active {
    outline: 3px solid rgb(234 179 8);
    outline-offset: 2px;
}
.om-live-poster[hidden] {
    display: none;
}

/* ------------------------------------------------------------------
 * Privacy: consent banner, embed placeholders, policy pages (inc/privacy.php, assets/js/consent.js)
 * Plain CSS, independent of the Tailwind build.
 * ------------------------------------------------------------------ */
.om-consent {
    position: fixed;
    z-index: 60;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: 34rem;
    margin-left: auto;
    padding: 1.25rem 1.25rem 1rem;
    border: 1px solid;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgb(0 0 0 / 0.18);
    color: #1f2937;
    font-size: 0.85rem;
    line-height: 1.5;
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
}

.dark .om-consent {
    color: #e5e7eb;
}

/* Above the app tab bar */
html.pwa .om-consent {
    bottom: calc(4.5rem + env(safe-area-inset-bottom));
}

.om-consent-heading {
    font-weight: 700;
    font-size: 1rem;
    margin: 0 1.5rem 0.4rem 0;
}

.om-consent-close {
    position: absolute;
    top: 0.6rem;
    right: 0.8rem;
    font-size: 1rem;
    line-height: 1;
    padding: 0.25rem;
    opacity: 0.6;
}

.om-consent-close:hover {
    opacity: 1;
}

.om-consent a,
.om-consent-placeholder a,
.om-legal a {
    color: #ca8a04;
    font-weight: 600;
    text-decoration: underline;
}

.om-consent-details {
    margin-top: 0.75rem;
    display: grid;
    gap: 0.5rem;
}

.om-consent-details.hidden {
    display: none;
}

.om-consent-row {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    cursor: pointer;
}

.om-consent-row input {
    margin-top: 0.25rem;
    accent-color: #eab308;
}

.om-consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.9rem;
}

/* Accept and refuse are equally prominent (same size, same weight) */
.om-btn {
    flex: 1 1 auto;
    padding: 0.55rem 1rem;
    border-radius: 0.6rem;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid #eab308;
    transition: background-color 0.15s, color 0.15s;
}

.om-btn.hidden {
    display: none;
}

.om-btn--primary {
    background: #eab308;
    color: #fff;
}

.om-btn--primary:hover {
    background: #ca8a04;
}

.om-btn--ghost {
    background: transparent;
    color: inherit;
}

.om-btn--ghost:hover {
    background: rgb(234 179 8 / 0.12);
}

/* Placeholder in place of an embed until consent (same box as the embed) */
.om-consent-embed {
    position: relative;
    width: 100%;
    height: 100%;
}

.om-consent-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem;
    overflow: auto;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #374151;
    background: var(--om-grain), linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

.dark .om-consent-placeholder {
    color: #d1d5db;
    background: var(--om-grain), linear-gradient(135deg, #1f2937, #111827);
}

.om-consent-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.om-consent-placeholder .om-consent-actions {
    justify-content: center;
    margin-top: 0.25rem;
}

.om-consent-placeholder .om-btn {
    flex: 0 1 auto;
}

/* Policy pages and privacy notes under the forms */
.om-legal h2 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 1.6rem;
    margin: 2rem 0 0.6rem;
}

.om-legal h3 {
    font-weight: 700;
    margin: 1.2rem 0 0.4rem;
}

.om-legal p,
.om-legal li {
    margin-bottom: 0.5rem;
    line-height: 1.65;
}

.om-legal ul {
    list-style: disc;
    padding-left: 1.4rem;
}

.om-legal table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin: 0.5rem 0 1rem;
}

.om-legal th,
.om-legal td {
    text-align: left;
    vertical-align: top;
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid rgb(148 163 184 / 0.35);
}

.om-legal-scroll {
    overflow-x: auto;
}

.om-privacy-note {
    font-size: 0.75rem;
    line-height: 1.5;
    color: #6b7280;
}

.dark .om-privacy-note {
    color: #9ca3af;
}

.om-privacy-note a {
    color: #ca8a04;
    text-decoration: underline;
}

.om-footer-legal a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.om-footer-legal button {
    text-decoration: underline;
    text-underline-offset: 2px;
    color: inherit;
}

/* Consent panel over the OM Live poster (OMConsent.ask) */
.om-consent-ask {
    z-index: 2;
}

/* Event order code (4 digits): same width for every digit, a bit spaced, readable at the counter */
.om-order-code {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.08em;
}

/* Sala prove: week of fixed slots (page-sala-prove.php). One row per day on phones, 7 columns from md. */
.om-week {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.375rem;
}
.om-week-day {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: rgb(243 244 246 / 0.6);
}
.om-week-day.is-holiday {
    border-color: #fcd34d;
    background: #fffbeb;
}
.om-week-day.is-today {
    box-shadow: 0 0 0 2px #facc15;
}
.om-week-head {
    width: 5rem;
    flex-shrink: 0;
    line-height: 1.25;
}
.om-week-wd {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
}
.om-week-date {
    display: block;
    font-weight: 700;
    color: #111827;
}
.om-week-holiday {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    color: #92400e;
}
.om-week-slots {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
    gap: 0.375rem;
}
.om-week-none {
    grid-column: 1 / -1;
    padding: 0.5rem 0;
    font-size: 0.75rem;
    color: #6b7280;
}
.om-slot {
    min-height: 2.75rem;
    padding: 0.375rem 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #fff;
    color: #1f2937;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.25;
    transition: background-color 0.15s;
}
.om-slot.is-free:hover {
    background: #fefce8;
}
.om-slot.is-selected {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 0 0 2px #60a5fa;
}
.om-slot.is-busy {
    border-color: #ef4444;
    background: #ef4444;
    color: #fff;
    cursor: not-allowed;
}
.om-slot.is-past {
    background: #e5e7eb;
    color: #9ca3af;
    text-decoration: line-through;
    cursor: not-allowed;
}
.dark .om-week-day { border-color: #374151; background: rgb(17 24 39 / 0.4); }
.dark .om-week-day.is-holiday { border-color: #b45309; background: rgb(69 26 3 / 0.4); }
.dark .om-week-wd { color: #9ca3af; }
.dark .om-week-date { color: #fff; }
.dark .om-week-holiday { color: #fcd34d; }
.dark .om-week-none { color: #9ca3af; }
.dark .om-slot { border-color: #4b5563; background: #374151; color: #f3f4f6; }
.dark .om-slot.is-free:hover { background: #4b5563; }
.dark .om-slot.is-selected { border-color: #2563eb; background: #2563eb; color: #fff; }
.dark .om-slot.is-busy { border-color: #dc2626; background: #dc2626; color: #fff; }
.dark .om-slot.is-past { background: #1f2937; color: #6b7280; }

@media (min-width: 768px) {
    .om-week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .om-week-day { flex-direction: column; align-items: stretch; gap: 0.375rem; }
    .om-week-head { width: auto; text-align: center; }
    .om-week-slots { grid-template-columns: 1fr; }
    .om-week-none { text-align: center; }
    .om-slot { padding: 0.375rem 0.25rem; font-size: 0.8125rem; }
}

/* Booking: quote, confirmation box and "Prenota" stacked; on wide screens the button sits on the right */
.om-quote-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
@media (min-width: 768px) {
    .om-quote-row .om-quote-btn { width: 18rem; align-self: flex-end; }
    .om-quote-row #room-book-hint { align-self: flex-end; width: 18rem; }
}
.om-quote-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.om-quote-btn:disabled:hover { background-color: #eab308; }


/* "Aggiungi al calendario" (details.om-dropdown, inc/calendar.php): the cards have a backdrop-filter,
 * which makes each card its own stacking layer, so the open menu would slide under the next card.
 * The card holding an open menu is lifted above its neighbours (still below the header, z-50). */
main :is(.rounded-xl, .rounded-2xl, .rounded-3xl):has(details.om-dropdown[open]) {
    position: relative;
    z-index: 40;
}

/* The menu itself is solid, not acrylic (the card rules below would make it see-through:
 * !important beats their longer selectors) */
main details.om-dropdown > .om-dropdown-panel {
    background: #fff !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.dark main details.om-dropdown > .om-dropdown-panel {
    background: #111827 !important;
}

/* Phones: the personal area button takes the room of the "OPEN MOUNTAIN" text, the logo stays */
@media (max-width: 479.98px) {
    #navbar .om-brand-text {
        display: none;
    }
}

/* Installed app on a wide screen: the header row with the personal area button stays visible */
@media (min-width: 1280px) {
    html.pwa #navbar .xl\:hidden {
        display: flex;
    }
}
