/* Capo Santa Croce — sito v3
   Palette del sito attuale caposantacroce.com e del gestionale: navy, ambra, crema, carta, pietra.
   Ogni <section> corrisponde a un container Elementor. */



*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--bar); }
/* Elementor rende morbido ogni scroll, anche l'arrivo da un'altra pagina: qui solo dopo il caricamento (site.js). */
html:not(.csc-smooth) { scroll-behavior: auto; }
/* Le ancore delle tipologie portano al titolo, non al margine superiore della sezione. */
.csc-room-group { scroll-margin-top: calc(var(--csc-gap) - var(--csc-section)); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-body)/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
}
/* Public site only: continuous section spacing from phone to wide desktop.
   Native Elementor padding controls already reference this token.
   Keep the canonical brand tokens shared with the kiosk untouched. */
main#contenuto { --csc-section: clamp(48px, 6.25vw, 96px); }
.elementor .csc-catalog > .csc-group { padding-top: var(--csc-section); padding-bottom: var(--csc-section); }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, dl, dd, address { margin: 0; }
h1, h2, h3 { font-family: var(--csc-display); font-weight: 400; }
/* Bodoni a taglio ottico medio e peso 500: filetti più robusti, leggibili anche sul fondo chiaro */
h2, h3 { font-weight: 500; font-variation-settings: "opsz" 28; }
h2 { font-size: var(--t-head); line-height: 1.06; letter-spacing: -.02em; text-wrap: balance; }
h3 { font-size: clamp(30px, 2.6vw, 40px); line-height: 1.08; letter-spacing: -.01em; }
address { font-style: normal; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
/* Preserve focus and keyboard access without a ring after pointer clicks,
   taps or Escape closing a pointer-opened dialog. Tab restores visible focus. */
html.csc-pointer-input :is(a, button, [role="button"]):focus { outline: none; }
::selection { background: var(--gold); color: var(--ink); }
.statement { font-size: var(--t-state); line-height: 1.45; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 30; background: var(--paper); padding: 10px 16px; }
.skip:focus { left: 8px; }

/* Pulsante unico: ambra piena, testo navy, angoli vivi */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 26px;
  background: var(--gold); color: var(--ink);
  font: 600 15px/1.2 var(--text); letter-spacing: .01em; text-decoration: none; white-space: nowrap;
  border: 0; border-radius: 0; cursor: pointer;
  transition: background-color .25s, color .25s, transform .15s;
}
.btn:hover { background: var(--ink); color: var(--on-ink); }
.btn:active { transform: translateY(1px); }
.bar .btn:hover, .light .btn:hover, .hero .btn:hover { background: var(--cream); color: var(--ink); }
.btn-block { display: flex; width: 100%; min-height: 54px; }
.link { font-weight: 600; }

/* ---------- Barra ---------- */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: var(--bar);
  display: flex; align-items: center; gap: clamp(20px, 3vw, 44px);
  padding: 0 var(--csc-m);
  color: var(--on-ink);
}
/* Direct background for the desktop fade; mobile uses solid navy below. */
.bar { background-color: var(--ink); }
.bar.over-hero { background-color: rgb(18 30 44 / var(--bar-fill, 0)); }
.bar.over-hero .bar-nav.open { background: var(--ink); }
.bar.menu-open { background-color: var(--ink); }
.bar-logo img { width: auto; height: 50px; }
.bar-nav { display: flex; gap: clamp(18px, 2.4vw, 36px); margin-left: auto; font-size: 15px; font-weight: 500; }
.bar-nav a { text-decoration: none; padding: 6px 0; }
.bar-nav a:hover { color: var(--gold); }
.bar-toggle { display: none; }

/* ---------- Piede ---------- */
.foot { background: var(--ink); color: var(--on-ink); padding: clamp(72px, 9vw, 130px) var(--csc-m) 40px; }
.foot-brand { position: relative; width: min(520px, 80vw); container-type: inline-size; }
.foot-logo { width: 100%; height: auto; }
/* Keep the lighthouse and lettering intact; replace only the artwork's year line. */
.foot-coordinates {
  position: absolute; left: 14%; right: 0; top: 65%; height: 24%;
  display: flex; align-items: center; justify-content: center; gap: 3.4cqw;
  background: var(--ink); color: var(--logo-gold);
  font: 400 4.3cqw/1 var(--text); letter-spacing: .055em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--csc-gap); margin-top: clamp(48px, 6vw, 80px); }
.foot-cols nav { display: flex; flex-wrap: wrap; gap: 8px 24px; align-content: start; justify-content: flex-end; }
.foot-cols a { text-decoration: none; }
.foot-cols a:hover { color: var(--gold); }
.foot-legal { margin-top: 56px; font-size: var(--t-small); color: var(--on-ink-soft); }



@media(max-width:1080px){.bar-cta{display:none}}
@media(max-width:767px){
  :root { --bar: 68px; }
  .bar-logo img { height: 40px; }
  .bar-toggle {
    /* larghezza fissa: Menu/Chiudi/Close non fanno saltare il pulsante */
    display: inline-flex; align-items: center; justify-content: center; min-width: 5.8em; margin-left: auto; min-height: 44px; padding: 10px 18px;
    background: var(--gold); color: var(--ink); border: 0; font: 600 15px/1.2 var(--text); cursor: pointer;
  }
  .bar-nav {
    display: none; position: absolute; top: var(--bar); left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0; padding: 8px var(--csc-m) 20px;
    background: var(--ink); font-size: 19px;
  }
  .bar-nav.open { display: flex; }
  .bar-nav a { padding: 12px 0; }

.foot-cols{grid-template-columns:1fr}.foot-cols nav{justify-content:flex-start}
}

/* Theme shell only. Content layout, typography and spacing live in Elementor. */
:where(.elementor-widget-heading h2,.elementor-widget-heading h3){text-wrap:balance;font-variation-settings:"opsz" 28}
:where(.elementor-widget-heading div.elementor-heading-title){font-variation-settings:"opsz" 28}
/* Coordinates: primes and degree signs need sturdier hairlines than numerals. */
.csc-coord .elementor-heading-title{font-variation-settings:"opsz" 12;font-variant-numeric:lining-nums}
/* Small Bodoni titles (21–30px): at opsz 28 the hairlines fade on non-retina screens and cream. */
.csc-title-sm .elementor-heading-title{font-variation-settings:"opsz" 14}
:where(.elementor-widget-text-editor p:last-child){margin-bottom:0}
/* Photos beside text: never taller than the screen nor 760px; the crop absorbs the rest. */
.csc-capped img{max-height:min(80svh,760px)}
/* Landscape photo next to a short text: lower cap. */
.csc-capped-short img{max-height:min(80svh,520px)}
/* Photo beside the places list: never longer than the list (about 690px). */
.csc-capped-list img{max-height:min(80svh,640px)}
/* Long legal text: separate paragraphs inside one text block. */
.csc-prose .elementor-widget-text-editor p + p{margin-top:1em}
.csc-hero{isolation:isolate}
/* Home opening photo uses lvh/svh (Elementor); browsers without them (Safari < 15.4, Chrome < 108) would drop both values. */
@supports not (height:1lvh){
.csc-hero-full{--min-height:clamp(640px,100vh,1040px)!important;--padding-bottom:clamp(56px,11vh,130px)!important}
@media (max-width:760px){.csc-hero-full{--min-height:clamp(560px,100vh,1040px)!important}}
}
/* A decorative top scrim protects the navigation. Main overlay uses native controls. */
.csc-hero::after{content:"";position:absolute;inset:0 0 auto;height:200px;pointer-events:none;z-index:1;background:linear-gradient(to bottom, rgb(10 16 24 / .55), transparent)}
:where(.csc-fill-image,.csc-fill-image .elementor-widget-container){height:100%}
:where(.csc-fill-image img){height:100%}
.csc-fallback{padding:calc(var(--bar) + 64px) var(--csc-m) 80px;min-height:60vh}
.csc-fallback article+article{margin-top:48px}
.admin-bar .bar{top:32px}
@media(max-width:782px){.admin-bar .bar{top:46px}}
@media(max-width:600px){.admin-bar .bar{top:var(--csc-admin-offset,46px)}}
@media(max-width:760px){:where(.csc-fill-image,.csc-fill-image .elementor-widget-container,.csc-fill-image img){height:auto}}
/* Elementor resets every link to no underline (.elementor a). Restore the v3 links:
   underlined inside running text and in the breadcrumb, none on heading values. */
.elementor :is(.elementor-widget-text-editor, .csc-breadcrumb) a { text-decoration: underline; text-decoration-thickness: 1px; }
.elementor :is(.elementor-widget-text-editor, .csc-breadcrumb) a:hover { text-decoration-thickness: 2px; }
.elementor .elementor-widget-heading .elementor-heading-title a:hover { color: var(--stone); }
/* The Elementor typography control writes the text-decoration shorthand, which resets thickness. */
.elementor .elementor-widget-button a.elementor-button.elementor-button-link { text-decoration-thickness: 1px; text-underline-offset: .22em; }
.elementor .elementor-widget-button a.elementor-button.elementor-button-link:hover { text-decoration-thickness: 2px; }

/* Galleria camere: foto cliccabili e visualizzatore a schermo intero. */
.csc-photo-open { cursor: zoom-in; }
/* Al passaggio un velo navy appena percettibile: la foto resta ferma. */
.csc-photo-open::after { content: ""; position: absolute; inset: 0; background: var(--ink); opacity: 0; transition: opacity .6s var(--ease); pointer-events: none; }
.csc-photo-open:hover::after { opacity: .14; }
.csc-room-photos { position: relative; }
.csc-gallery-all { position: absolute; right: 12px; bottom: 12px; z-index: 1; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 0; background: var(--paper); color: var(--ink); font: 600 var(--t-small)/1.2 var(--text); letter-spacing: .01em; cursor: pointer; transition: background-color .3s var(--ease), color .3s var(--ease); }
.csc-gallery-all:hover { background: var(--ink); color: var(--on-ink); }
.csc-viewer { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: var(--ink); color: var(--on-ink); overflow: hidden; }
.csc-viewer:focus { outline: none; }
.csc-viewer[open] { display: grid; grid-template: auto minmax(0, 1fr) auto / 72px minmax(0, 1fr) 72px; }
.csc-viewer::backdrop { background: var(--ink); }
/* Safari can temporarily expose the document during native pinch zoom-out.
   Preserve its layout/scroll position, but paint only the gallery and navy canvas. */
html.csc-gallery-open, html.csc-gallery-open body { background: var(--ink); }
html.csc-gallery-open body > :not(.csc-viewer) { visibility: hidden !important; opacity: 0 !important; }
/* Gerarchia: nome della camera centrato dove cade lo sguardo, la foto, il contatore discreto in basso. */
.csc-viewer-label { grid-area: 1 / 1 / 2 / 4; padding: clamp(24px, 4vh, 44px) 120px clamp(20px, 3.5vh, 32px); text-align: center; font: 500 clamp(28px, 2.6vw, 40px)/1.08 var(--csc-display); letter-spacing: -.01em; font-variation-settings: "opsz" 28; }
.csc-viewer-photo { grid-area: 2 / 2; height: 100%; min-height: 0; }
.csc-viewer-photo img { width: 100%; height: 100%; object-fit: contain; }
.csc-viewer-count { grid-area: 3 / 2; padding: 16px 0 clamp(20px, 4vh, 40px); text-align: center; font-size: var(--t-small); color: var(--on-ink-soft); font-variant-numeric: tabular-nums; }
.csc-viewer button { border: 0; background: none; color: var(--on-ink); font: 600 var(--t-small)/1 var(--text); cursor: pointer; }
.csc-viewer-close { position: absolute; top: clamp(20px, 4vh, 40px); right: var(--csc-m); min-height: 44px; padding: 0 4px; text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; }
.csc-viewer-close:hover { text-decoration-thickness: 2px; }
.csc-viewer :is(.csc-viewer-prev, .csc-viewer-next) { grid-row: 2; align-self: stretch; width: 72px; font-size: 0; transition: color .3s var(--ease); }
.csc-viewer-prev { grid-column: 1; }
.csc-viewer-next { grid-column: 3; }
.csc-viewer :is(.csc-viewer-prev, .csc-viewer-next)::before { content: ""; display: block; width: 14px; height: 14px; margin: auto; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); }
.csc-viewer .csc-viewer-next::before { transform: rotate(-135deg); }
.csc-viewer :is(.csc-viewer-prev, .csc-viewer-next):hover { color: var(--gold); }
@media (max-width: 767px) {
  .csc-viewer[open] { grid-template-columns: 0 minmax(0, 1fr) 0; }
  .csc-viewer-label { padding: 72px 20px 20px; }
  .csc-viewer-close { top: 12px; }
  .csc-viewer-count { padding: 22px 72px 22px; }
  .csc-viewer :is(.csc-viewer-prev, .csc-viewer-next) { position: absolute; bottom: 8px; height: 48px; width: 64px; }
  .csc-viewer-prev { left: 8px; }
  .csc-viewer-next { right: 8px; }
  /* Su mobile il link sta sull'ultima foto (ultima colonna, fondo della griglia),
     su una sfumatura navy che lo rende leggibile con qualsiasi foto. */
  .csc-gallery-all, .csc-gallery-all:hover { grid-column: -2 / -1; left: 0; right: 0; bottom: 0; min-height: 0; padding: 72px 14px 18px 8px; text-align: right; background: linear-gradient(transparent, color-mix(in srgb, var(--ink) 72%, transparent)); color: var(--paper); text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; }
  .csc-gallery-all:hover { text-decoration-thickness: 2px; }
}
@media (prefers-reduced-motion: reduce) { .csc-photo-open::after, .csc-gallery-all, .csc-viewer button { transition: none; } }

/* Public experience catalogue: match the native Elementor mobile section rhythm.
   The first group keeps breathing room after the hero; later photos start flush. */
@media (max-width: 760px) {
  .elementor .csc-catalog > .csc-group { padding-top: 48px; padding-bottom: 48px; }
  .elementor .csc-catalog > .csc-group + .csc-group:has(> .csc-photo) { padding-top: 0; }
}
@media (max-width: 767px) {
  /* Match the new section starts when arriving from Home room links. */
  .csc-room-group { scroll-margin-top: calc(var(--csc-gap) - 48px); }
}

/* Stable mobile browser tint: the header and page fallback agree on navy.
   Include touch landscape; preserve paper behind otherwise transparent content. */
@media (max-width: 767px), (hover: none) and (pointer: coarse) {
  html, body { background-color: var(--ink); }
  main#contenuto { background-color: var(--paper); }
  .bar, .bar.over-hero, .bar.menu-open { background-color: var(--ink); }
}

/* Property gallery link: native Elementor button over the introduction photo. */
.csc-property-photo { position: relative; }
.csc-property-photo .csc-property-gallery-trigger { position: absolute; inset: auto 0 0; width: 100%; height: 0; margin: 0; z-index: 1; }
.csc-property-gallery-trigger .elementor-button { position: absolute; right: 12px; bottom: 12px; padding: 10px 16px; min-height: 44px; border: 0; border-radius: 0; background: var(--paper); color: var(--ink); font: 600 var(--t-small)/1.2 var(--text); letter-spacing: .01em; }
.csc-property-gallery-trigger .elementor-button:hover { background: var(--ink); color: var(--on-ink); }
.csc-property-gallery-trigger[hidden] { display: none; }
@media(max-width:767px) {
 .csc-property-gallery-trigger .elementor-button, .csc-property-gallery-trigger .elementor-button:hover { left: 0; right: 0; bottom: 0; min-height: 0; padding: 72px 14px 18px 8px; text-align: right; background: linear-gradient(transparent, color-mix(in srgb, var(--ink) 72%, transparent)); color: var(--paper); text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; }
 .csc-property-gallery-trigger .elementor-button-content-wrapper { justify-content: flex-end; }
}

/* Native buttons and Elementor links share the same desktop gallery box.
   Flex centres the line despite min-height; the 1px padding bias centres Manrope
   optically. Mobile links retain their intentional bottom-right gradient layout. */
@media (min-width: 768px) {
  .csc-gallery-all, .csc-property-gallery-trigger .elementor-button {
    display: inline-flex; align-items: center; justify-content: center;
    padding-top: 9px; padding-bottom: 11px;
  }
}
