/* ==========================================================================
   Studio Dentistico Graziano Fele — main stylesheet
   Replaces normalize + Bootstrap 3 + styles.css + queries-2.css + animate.css
   + owl.carousel.css + etline-font.css + Font Awesome.

   Mobile-first. Breakpoints:
     40em  (640px)  small tablets
     62em  (992px)  desktop navigation + multi-column layouts
     64em  (1024px) wide container
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand palette */
  --teal: #0f827f;          /* backgrounds, lines, large shapes */
  --teal-ink: #0d7572;      /* small text: 5.0:1 on pink, 4.6:1 on grey (original #0f827f fails) */
  --green: #a0b95f;         /* decorative surfaces only */
  --green-strong: #a0b95f;  /* Use #637533 for surfaces that carry white text: 5.1:1 (original #a0b95f is 2.2:1).
                               To restore the original look, set this to #a0b95f. */
  --pink: #fef1ed;
  --grey: #ebebeb;
  --white: #fff;

  /* Type */
  --font: "futura-pt", "Futura", "Century Gothic", "Avenir Next", "Trebuchet MS", sans-serif;
  --fs-body: 18px;          /* paragraphs and labels */
  --fs-ui: 15px;            /* header wordmark and desktop menu, sized to fit the 80px bar */
  --fw-text: 400;           /* running text (Futura PT Book) */
  --fw-strong: 500;         /* <strong>/<b>: the heaviest weight in the Adobe Fonts project */
  /* Extra emphasis for <strong> in text boxes, since the font project has no
     heavier weight: a darker ink (the CSS version of Sass's darken()) and a
     hairline outline that thickens the letters slightly. */
  --strong-ink: color-mix(in srgb, var(--teal-ink) 70%, #000);
  --strong-stroke: 0.4px;
  --fw-on-green: 500;       /* heavier white text on the light green, for legibility */
  --fs-small: 11px;
  --fs-display: 30px;       /* 40px on desktop */
  --tracking: 2px;

  /* Layout */
  --header-h: 80px;
  --header-shift: 35px;     /* how far the header slides up on scroll */
  --container: 970px;
  --tile-h: 120px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

@media (min-width: 40em) {
  :root { --tile-h: 150px; }
}

@media (min-width: 62em) {
  :root { --fs-display: 40px; }
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: var(--tracking);
  color: var(--teal-ink);
  background-color: var(--pink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; padding: 0; }
h1, h2, h3, h4 { font-weight: 400; }
ul, ol { list-style: none; }
img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; letter-spacing: inherit; color: inherit; }

p { padding-bottom: 20px; }
p:last-child { padding-bottom: 0; }
strong, b { font-weight: var(--fw-strong); }

a {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease, background-color .2s ease, opacity .2s ease;
}
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  padding: .75rem 1rem;
  background: var(--white);
  color: var(--teal-ink);
}
.skip-link:focus { top: 1rem; }

.text-display {
  font-size: var(--fs-display);
  line-height: 1.15;
  text-transform: uppercase;
}

.text-label {
  font-size: var(--fs-body);
  line-height: 1.3;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  margin-inline: auto;
}

@media (min-width: 62em) {
  .container {
    max-width: calc(var(--container) + 30px);
    padding-inline: 15px;
  }
  .container--narrow { max-width: 820px; }
}

.site-main {
  padding-top: var(--header-h);
}

@media (min-width: 62em) {
  .site-main { padding-top: max(calc(var(--header-h) + 2rem), 18vh); }
}

/* --------------------------------------------------------------------------
   4. Header & navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  height: var(--header-h);
  background: var(--teal);
  color: var(--white);
  /* Always transformed, so the mobile menu (position: fixed) is laid out
     relative to the header in both states. */
  transform: translateY(0);
  transition: transform .3s var(--ease);
}

.site-header.is-scrolled { transform: translateY(calc(-1 * var(--header-shift))); }

.site-header a { color: var(--white); }

/* Logo / wordmark */
.brand {
  position: relative;
  flex: 1 0 auto;
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  padding: 0 100px 10px 20px;
  font-size: var(--fs-ui);
  line-height: 1.2;
  text-transform: uppercase;
  background: var(--teal);
}
.brand:hover { text-decoration: none; }

.brand__full,
.brand__short { transition: opacity .15s linear; }

.brand__short {
  position: absolute;
  bottom: 10px;
  left: 20px;
  opacity: 0;
}

.is-scrolled .brand__full { opacity: 0; }
.is-scrolled .brand__short { opacity: 1; }

/* Burger button */
.nav-toggle {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: var(--header-h);
  height: var(--header-h);
  padding: 0;
  border: 0;
  background: var(--grey);
  cursor: pointer;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  position: absolute;
  left: 25px;
  width: 30px;
  height: 2px;
  background: var(--teal);
  transition: transform .3s ease-in-out, background-color .3s ease-in-out, top .3s ease-in-out;
}

.nav-toggle__bars { top: calc(50% - 1px); }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; left: 0; }
.nav-toggle__bars::before { top: -10px; }
.nav-toggle__bars::after { top: 10px; }

/* Keep the bars centred in the part of the header that stays visible */
.is-scrolled .nav-toggle__bars { top: calc(50% + var(--header-shift) / 2 - 1px); }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background-color: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

/* Mobile menu panel */
.site-nav {
  position: fixed;
  top: 100%;
  left: 0;
  width: 100%;
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--green-strong);
  visibility: hidden;
  opacity: 0;
  transition: opacity .5s, visibility 0s .5s;
}

.is-scrolled .site-nav {
  height: calc(100vh - var(--header-h) + var(--header-shift));
  height: calc(100dvh - var(--header-h) + var(--header-shift));
}

.site-nav.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity .5s;
}

.primary-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 5px 60px;
}

.primary-nav a,
.lang-switch a {
  display: inline-block;
  padding: 15px 10px;
  font-size: 18px;
  font-weight: var(--fw-on-green);
  text-transform: uppercase;
}

.primary-nav a[aria-current="page"],
.lang-switch a[aria-current="true"] { text-decoration: underline; text-underline-offset: 4px; }

.lang-switch {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100px;
  background: var(--teal);
}

/* Staggered entrance of menu items */
.site-nav li {
  opacity: 0;
  transform: translateY(-40px);
  transition: transform .5s, opacity .5s;
}
.site-nav.is-open li { opacity: 1; transform: none; }
.primary-nav li:nth-child(1) { transition-delay: .05s; }
.primary-nav li:nth-child(2) { transition-delay: .10s; }
.primary-nav li:nth-child(3) { transition-delay: .15s; }
.primary-nav li:nth-child(4) { transition-delay: .20s; }
.primary-nav li:nth-child(5) { transition-delay: .25s; }
.lang-switch li:nth-child(1) { transition-delay: .25s; }
.lang-switch li:nth-child(2) { transition-delay: .30s; }

body.nav-open { overflow: hidden; }

/* Desktop navigation */
@media (min-width: 62em) {
  .site-header { background: var(--green-strong); }

  .brand {
    flex: 0 0 auto;
    padding-right: 30px;
  }

  .nav-toggle { display: none; }

  .site-nav,
  .is-scrolled .site-nav {
    position: static;
    flex: 1;
    flex-direction: row;
    align-items: flex-end;
    width: auto;
    height: auto;
    background: none;
    visibility: visible;
    opacity: 1;
    transition: none;
  }

  .site-nav li {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .site-nav > nav {
    flex: 1;
    display: flex;
    justify-content: center;
    padding-right: 130px; /* room for the language switch */
  }

  .primary-nav {
    flex: 0 1 820px;
    flex-direction: row;
    justify-content: space-around;
    gap: 25px;
    padding: 0 0 10px;
  }

  .primary-nav a,
  .lang-switch a {
    padding: 0;
    font-size: var(--fs-ui);
  }

  .lang-switch {
    position: absolute;
    top: 0;
    right: 0;
    gap: 20px;
    height: var(--header-h);
    align-items: flex-end;
    padding: 0 10px 10px;
  }
}

/* --------------------------------------------------------------------------
   5. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 10px 15px;
  text-align: center;
  font-size: var(--fs-small);
  line-height: 1.6;
  letter-spacing: 1px;
}

.site-footer p { padding: 0; }

.site-footer span {
  display: inline-block;
}

@media (min-width: 40em) {
  .site-footer span:not(:last-child) {
    margin-right: 6px;
    padding-right: 10px;
    border-right: 1px solid currentColor;
  }
}

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

/* VAT number + privacy link: their own line on phones and tablets,
   the end of the single footer line on desktop. */
.site-footer__legal span:not(:last-child) {
  margin-right: 6px;
  padding-right: 10px;
  border-right: 1px solid currentColor;
}

@media (min-width: 62em) {
  .site-footer p { display: inline; }

  .site-footer p:not(:last-child) span:last-child {
    margin-right: 6px;
    padding-right: 10px;
    border-right: 1px solid currentColor;
  }
}

.page-contatti .site-footer { background: var(--grey); }

/* --------------------------------------------------------------------------
   6. Home
   -------------------------------------------------------------------------- */
.page-home .site-main { padding-top: 0; }

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

.hero__slides {
  position: absolute;
  inset: var(--header-h) 0 0;
}

.hero__slide,
.hero__slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__slide img {
  object-fit: cover;
  object-position: var(--focus, center);
}

.hero__slide--top {
  opacity: 0;
  animation: hero-fade 10s infinite;
  will-change: opacity;
}

@keyframes hero-fade {
  0%, 40% { opacity: 0; }
  50%, 90% { opacity: 1; }
  100% { opacity: 0; }
}

/* Soft fade behind the headline on small screens, where it overlaps the photo */
.hero__slides::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(254, 241, 237, .92) 0%, rgba(254, 241, 237, .75) 30%, rgba(254, 241, 237, 0) 55%);
}

@media (min-width: 62em) {
  .hero__slides::after { content: none; }
}

.hero__payoff {
  position: relative;
  z-index: 1;
  padding: 25vh 15px 0;
}

.hero__line,
.hero__line span { display: block; }

@media (min-width: 62em) {
  .hero__payoff { padding-left: calc(5vw + 15px); }
  .hero__line span { display: inline; }

  .page-home .site-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
  }
}

/* --------------------------------------------------------------------------
   7. Studio
   -------------------------------------------------------------------------- */
.story { margin-bottom: 100px; }

.story__title {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: var(--tile-h);
  padding: 20px;
  background: var(--teal);
  color: var(--white);
}

.story__text {
  padding: 25px;
  background: var(--white);
}

.story__text p { font-weight: var(--fw-text); }

.story__text :is(strong, b),
.panel__text :is(strong, b) {
  color: var(--strong-ink);
  -webkit-text-stroke: var(--strong-stroke) currentColor;
}

@media (min-width: 40em) {
  .story__title { width: 33%; }
  .story__text { width: 67%; margin-left: 33%; }
}

/* --------------------------------------------------------------------------
   8. Tiles (index grid on Trattamenti / Tecnologia)
   -------------------------------------------------------------------------- */
.page-trattamenti,
.page-promozioni { background-color: var(--grey); }

.tiles {
  display: grid;
  grid-template-columns: 1fr;
}

.tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  min-height: var(--tile-h);
  padding: 0 5%;
  text-align: left;
  text-transform: uppercase;
  overflow: hidden;
}

.tile:hover { text-decoration: none; }
.tile:hover .tile__label,
.tile:focus-visible .tile__label { text-decoration: underline; text-underline-offset: 4px; }
.tile:focus-visible { outline-offset: -6px; }

.tile__icon {
  flex: 0 0 auto;
  width: 70px;
  height: 45px;
  object-fit: contain;
  object-position: center;
}

.tile--deco { display: none; }

/* Colours: Trattamenti */
.tiles--trattamenti .tile:nth-child(odd) { background: var(--pink); }
.tiles--trattamenti .tile:nth-child(even) { background: var(--grey); }

/* Colours: Tecnologia */
.tiles--tecnologia .tile:nth-child(odd) { background: var(--green-strong); color: var(--white); font-weight: var(--fw-on-green); }
.tiles--tecnologia .tile:nth-child(even) { background: var(--grey); color: var(--green-strong); }

.tiles-figure { display: none; }

@media (min-width: 62em) {
  .tiles { grid-template-columns: 33fr 34fr 33fr; }

  .tile {
    justify-content: center;
    padding: 0 20px;
  }

  .tiles--tecnologia .tile { text-align: center; }

  .tile--deco { display: block; overflow: visible; }

  /* The two horizontal strokes that cross the last row */
  .tile--deco-pre::before,
  .tile--deco-post::before {
    content: "";
    position: absolute;
    top: 50%;
    width: 100px;
    height: 2px;
    background: var(--teal);
    transition: width .3s ease-out;
  }
  .tile--deco-pre::before { left: -50px; }
  .tile--deco-post::after { right: -50px; }
  .tiles.is-leaving .tile--deco::before { width: 0; }

  .tiles-figure {
    display: block;
    height: 350px;
  }
  .tiles-figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
  }
}

/* Wipe animation played on every tile before the detail view opens.
   Direction comes from data-wipe, colour from --wipe. */
.tile > * { position: relative; z-index: 1; }

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--wipe, var(--pink));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .5s ease-out;
}

.tile[data-wipe="left"]::after   { transform-origin: right center; }
.tile[data-wipe="down"]::after   { transform: scaleY(0); transform-origin: center top; }
.tile[data-wipe="up"]::after     { transform: scaleY(0); transform-origin: center bottom; }

.tiles.is-leaving .tile::after { transform: none; }
.tiles.is-leaving .tile:nth-child(3n+2)::after { transition-delay: .1s; }
.tiles.is-leaving .tile:nth-child(3n)::after   { transition-delay: .2s; }

.tiles--trattamenti .tile:nth-child(odd)  { --wipe: var(--grey); }
.tiles--trattamenti .tile:nth-child(even) { --wipe: var(--pink); }
.tiles--tecnologia .tile                  { --wipe: var(--pink); }

.tiles.is-hidden,
.tiles-figure.is-hidden { display: none; }

/* --------------------------------------------------------------------------
   9. Detail panels (one per treatment / technology)
   Without JS every panel is shown in sequence below the tiles. With JS
   (.panels.is-enhanced) only the active one is visible.
   -------------------------------------------------------------------------- */
.panels { padding-bottom: 100px; }

.panel {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "title"
    "text"
    "nav";
  margin-top: 40px;
}

.panels.is-enhanced .panel { display: none; margin-top: 0; }
.panels.is-enhanced .panel.is-active {
  display: grid;
  animation: panel-in .4s ease-out both;
}

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

/* Moving to the next / previous panel (arrows, keys, swipe): slide in from
   the side the visitor is heading towards. */
.panels.is-enhanced .panel.is-active.is-from-right { animation: panel-in-right .35s ease-out both; }
.panels.is-enhanced .panel.is-active.is-from-left  { animation: panel-in-left .35s ease-out both; }

@keyframes panel-in-right {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: none; }
}

@keyframes panel-in-left {
  from { opacity: 0; transform: translateX(-60px); }
  to   { opacity: 1; transform: none; }
}

/* No horizontal scrollbar while a panel slides in; vertical scrolling and
   pinch-zoom stay with the browser, sideways gestures go to the swipe. */
.panels.is-enhanced {
  overflow-x: clip;
  touch-action: pan-y pinch-zoom;
}

.panel__title {
  grid-area: title;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tile-h);
  padding: 20px 90px 20px 20px;
  text-align: center;
  background: var(--pink);
  color: var(--teal-ink);
}
.panel__title:focus { outline: none; }
.panel__title:focus-visible { outline: 2px solid currentColor; outline-offset: -6px; }

.page-trattamenti .panel:nth-child(even) .panel__title { background: var(--grey); }

.panel__text {
  grid-area: text;
  padding: 25px;
  background: var(--white);
}
.panel__text p { font-weight: var(--fw-text); }
.panel__text h3 {
  padding-bottom: 10px;
  text-transform: uppercase;
}
.panel__text ul { padding-bottom: 20px; }
.panel__text li {
  position: relative;
  padding: 0 0 8px 18px;
  font-weight: var(--fw-text);
}
.panel__text li::before {
  content: "–";
  position: absolute;
  left: 0;
}

.panel__media { display: none; }

/* Panel controls (injected by JS) */
.panel__close {
  grid-area: title;
  justify-self: end;
  align-self: start;
  display: grid;
  place-items: center;
  width: 70px;
  height: var(--tile-h);
  border: 0;
  background: transparent;
  cursor: pointer;
}

.panel__nav {
  grid-area: nav;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.panel__nav button {
  display: grid;
  place-items: center;
  height: 70px;
  border: 0;
  background: var(--pink);
  cursor: pointer;
}

.page-tecnologia .panel__nav button { background: var(--grey); }

.panel__nav button:disabled { cursor: default; }
.panel__nav button:disabled svg { opacity: .2; }

.panel__close svg,
.panel__nav svg {
  width: 30px;
  height: 30px;
  fill: var(--green-strong);
}

.panel__close:hover svg,
.panel__nav button:not(:disabled):hover svg { fill: var(--teal); }

@media (min-width: 62em) {
  .panel {
    grid-template-columns: 1fr 2fr;
    grid-template-rows: var(--tile-h) auto auto;
    grid-template-areas:
      "title close"
      "nav   text"
      ".     media";
    margin-top: 0;
  }

  .panel + .panel { margin-top: 60px; }

  .panel__title {
    padding: 20px;
    background: var(--green-strong);
    color: var(--white);
    font-weight: var(--fw-on-green);
  }
  .page-trattamenti .panel:nth-child(even) .panel__title { background: var(--green-strong); }

  .panel__text { min-height: 280px; }

  .panel__media { display: block; grid-area: media; }
  .panel__media img { width: 100%; }

  .panel__close {
    grid-area: close;
    width: 144px;
    height: var(--tile-h);
    background: var(--grey);
  }
  .page-trattamenti .panel__close { background: var(--pink); }

  .panel__nav {
    align-self: end;
  }
  .panel__nav button { height: 144px; }
}

/* --------------------------------------------------------------------------
   10. Promozioni
   -------------------------------------------------------------------------- */
.promo { margin-bottom: 100px; }

.promo__grid {
  display: grid;
  grid-template-columns: 1fr;
}

.quad {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 20px;
  text-align: left;
}

.quad h2 {
  font-size: var(--fs-display);
  line-height: 1.15;
  text-transform: uppercase;
}

.quad p {
  padding: 0;
  font-size: 20px;
}

.quad__line {
  width: 100px;
  height: 2px;
  margin: 30px 0;
  background: currentColor;
}

.quad--a { background: var(--pink); }
.quad--b { background: var(--white); }
.quad--c { background: var(--teal); color: var(--white); }
.quad--d { background: var(--pink); }

.quad--deco { display: none; }

/* Alternate colourway for a second promo block */
.promo--alt .quad--a,
.promo--alt .quad--d { background: var(--green-strong); color: var(--white); }
.promo--alt .quad--deco-1 { background: var(--pink); }

@media (min-width: 62em) {
  .promo__grid {
    grid-template-columns: 33fr 33fr 1fr 33fr;
    grid-auto-rows: 165px;
  }

  .quad--a { grid-column: 1; grid-row: 1 / span 2; }
  .quad--b { grid-column: 2 / -1; grid-row: 1 / span 2; }
  .quad--deco {
    display: block;
    position: relative;
    padding: 0;
  }
  .quad--deco-1 { grid-column: 1; grid-row: 3; background: var(--white); }
  .quad--deco-2 { grid-column: 2; grid-row: 3; background: var(--grey); }
  .quad--deco-1::after {
    content: "";
    position: absolute;
    top: 53px;
    right: -50px;
    z-index: 1;
    width: 100px;
    height: 2px;
    background: var(--teal);
  }
  .quad--c { grid-column: 4; grid-row: 3 / span 2; }
  .quad--d { grid-column: 1 / span 3; grid-row: 4 / span 2; }
}

/* --------------------------------------------------------------------------
   11. Contatti
   -------------------------------------------------------------------------- */
.location__label {
  display: flex;
  align-items: center;
  min-height: 100px;
  padding: 0 20px;
  background: var(--teal);
  color: var(--white);
}

.location__map {
  position: relative;
}

.map {
  position: relative;
  height: 420px;
  background:
    url("../img/pin-olbia.png") center 22% / 42px auto no-repeat,
    repeating-linear-gradient(45deg, #e2e2e2 0 2px, #ececec 2px 14px);
}

.map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(1) contrast(.9) brightness(1.05);
}

.map__consent {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 20px;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 1px;
  background: rgba(255, 255, 255, .9);
}

.map__consent p { flex-basis: 100%; padding: 0; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: 0;
  background: var(--teal);
  color: var(--white);
  font-size: 13px;
  text-transform: uppercase;
  cursor: pointer;
}
.btn:hover { background: var(--teal-ink); text-decoration: none; }

.map__consent a { text-decoration: underline; }

.location__hours,
.location__card {
  text-align: center;
}

.location__hours {
  padding: 15px;
  background: var(--pink);
}

.location__hours p { padding-bottom: 6px; letter-spacing: 1px; }

.location__card {
  display: flex;
  flex-direction: column;
  font-style: normal;
}

.location__phones,
.location__address {
  padding: 15px 15px 10px;
}

.location__phones { background: var(--pink); }
.location__address { background: var(--teal); color: var(--white); }

.location__card p { padding-bottom: 10px; letter-spacing: 1px; line-height: 1.1; }

.location__card a { text-decoration: none; }
.location__card a:hover { text-decoration: underline; }

.divider {
  display: block;
  width: 40px;
  height: 1px;
  margin: 0 auto 10px;
  background: currentColor;
}

@media (min-width: 62em) {
  .location .container { display: flex; align-items: flex-start; }
  .location__label {
    flex: 0 0 20%;
    justify-content: center;
  }
  .location__map { flex: 1 1 80%; }
  .map { height: 500px; }

  .map__consent {
    inset: auto auto 50% 50%;
    transform: translate(-50%, 50%);
    width: min(420px, 80%);
  }

  .location__hours {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 35px 35px 10px;
  }

  .location__card {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 2;
    flex-direction: row;
    align-items: stretch;
  }

  /* Make room for the overlays above the consent box */
  .map.is-loaded ~ .location__hours,
  .map.is-loaded ~ .location__card { pointer-events: auto; }
}

/* Contact info block */
.contact-info {
  position: relative;
  margin-top: 0;
  padding: 40px 0 0;
  background: var(--grey);
}

.contact-info h2 {
  padding: 0 15px 20px;
  text-transform: uppercase;
}

.contact-info__phones {
  padding: 0 15px 30px;
}

.contact-info__row {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.contact-info__row p { padding: 0; }

.contact-info__links {
  display: grid;
  grid-template-columns: 70% 30%;
  margin-bottom: 60px;
}

.contact-info__mail {
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  padding: 10px;
  background: var(--teal);
  color: var(--white);
  overflow-wrap: anywhere;
}

.contact-info__social {
  grid-column: 2;
  display: grid;
  place-items: center;
  min-height: 100px;
  background: var(--green-strong);
}

.contact-info__social svg { width: 40px; height: 40px; fill: var(--white); }

.careers {
  padding-bottom: 100px;
}

.careers__box {
  padding: 30px 15px;
  background: var(--pink);
}

.careers__box a { text-decoration: underline; }

@media (min-width: 62em) {
  .contact-info {
    margin-top: 100px;
    padding-top: 100px;
  }

  .contact-info::before {
    content: "";
    position: absolute;
    top: -50px;
    right: 50px;
    width: 2px;
    height: 100px;
    background: var(--teal);
  }

  .contact-info h2 { padding: 0 0 20px; }

  .contact-info__phones {
    width: 70%;
    padding: 30px 50px;
    background: var(--pink);
  }

  .contact-info__row {
    flex-direction: row;
    justify-content: space-between;
    margin-bottom: 5px;
  }

  /* Staircase: phones box → e-mail box → Facebook square */
  .contact-info__links {
    grid-template-columns: 70% 30%;
    grid-template-rows: 100px 100px;
    margin-bottom: 0;
  }

  .contact-info__mail { grid-column: 2; grid-row: 1; }

  .contact-info__social {
    grid-column: 1;
    grid-row: 2;
    justify-self: end;
    width: 100px;
  }

  .careers { margin-top: 50px; }
  .careers h2 { padding: 0 0 20px; }
  .careers__box { padding: 30px 50px; }
}

/* --------------------------------------------------------------------------
   12. Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .hero__slide--top { opacity: 0; }
}

/* --------------------------------------------------------------------------
   13. Contact form (Contact Form 7) — same design as the static site's
   commented-out form: pink box, label left / grey field right (70%),
   square green "INVIA" button below the box on the right.
   Markup: docs/modulo-contatti.md.
   -------------------------------------------------------------------------- */
.contact-form { margin-top: 50px; }

.contact-form h2 { padding: 0 15px 20px; }

.cf-fields {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 30px 15px;
  background: var(--pink);
}

.cf-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cf-row > label {
  text-transform: uppercase;
}

.cf-row .wpcf7-form-control-wrap { display: block; }

.cf-fields input[type="text"],
.cf-fields input[type="email"],
.cf-fields input[type="tel"],
.cf-fields textarea {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 0;
  background: var(--grey);
  box-shadow: none;
  color: var(--teal-ink);
  font: inherit;
  letter-spacing: 1px;
  -webkit-appearance: none;
  appearance: none;
}

.cf-fields textarea {
  min-height: 150px;
  resize: vertical;
}

.cf-fields input:focus-visible,
.cf-fields textarea:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 0;
}

.cf-fields [aria-invalid="true"] {
  outline: 2px solid #a1251b;
  outline-offset: 0;
}

/* Privacy checkbox */
.cf-privacy {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px 10px;
  padding-top: 5px;
  font-size: 15px;
  letter-spacing: 1px;
}
/* Let the checkbox, the text and CF7's error message sit as siblings:
   checkbox + text on one line, the error on its own line below. */
.cf-privacy .wpcf7-form-control-wrap,
.cf-privacy .wpcf7-acceptance { display: contents; }
.cf-privacy .wpcf7-list-item { flex: 0 0 auto; margin: 0; }
.cf-privacy > label { flex: 1 1 0; min-width: 0; }
.cf-privacy .wpcf7-not-valid-tip { order: 3; flex-basis: 100%; margin-top: 0; }
.cf-privacy input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--teal);
}
.cf-privacy a { text-decoration: underline; }

/* Button: the static site's 100 × 100 green square, outside the box */
.cf-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
}

.cf-actions .cf-submit,
.cf-actions input[type="submit"] {
  width: 100px;
  height: 100px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--green-strong);
  color: var(--white);
  font: inherit;
  font-size: 14px;
  font-weight: var(--fw-on-green, 500);
  letter-spacing: var(--tracking);
  text-transform: uppercase;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color .2s ease;
}
.cf-actions input[type="submit"]:hover { background: var(--teal); }
.cf-actions input[type="submit"]:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.cf-actions input[type="submit"]:disabled { cursor: progress; opacity: .7; }

/* CF7's spinner, shown while sending: left of the button */
.cf-actions .wpcf7-spinner {
  order: -1;
  display: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--teal);
  border-right-color: transparent;
  border-radius: 50%;
  animation: cf-spin .8s linear infinite;
}
.wpcf7-form.submitting .cf-actions .wpcf7-spinner { display: block; }
@keyframes cf-spin { to { transform: rotate(360deg); } }

/* Field errors */
.cf-fields .wpcf7-not-valid-tip {
  display: block;
  margin-top: 4px;
  color: #a1251b;
  font-size: 14px;
  letter-spacing: 1px;
}

/* Result message after sending */
.contact-form .wpcf7-response-output {
  margin: 15px 0 0;
  padding: 12px 15px;
  border: 2px solid var(--teal);
  color: var(--teal-ink);
  letter-spacing: 1px;
}
.contact-form .wpcf7-form.init .wpcf7-response-output,
.contact-form .wpcf7-form.resetting .wpcf7-response-output,
.contact-form .wpcf7-form.submitting .wpcf7-response-output { display: none; }
.contact-form .wpcf7-form.invalid .wpcf7-response-output,
.contact-form .wpcf7-form.unaccepted .wpcf7-response-output,
.contact-form .wpcf7-form.payment-required .wpcf7-response-output { border-color: #a1251b; color: #a1251b; }
.contact-form .wpcf7-form.failed .wpcf7-response-output,
.contact-form .wpcf7-form.aborted .wpcf7-response-output,
.contact-form .wpcf7-form.spam .wpcf7-response-output { border-color: #a1251b; color: #a1251b; }

/* Hidden helpers CF7 prints (honeypot-style fields, screen-reader status) */
.contact-form .screen-reader-response {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.contact-form .hidden-fields-container { display: none; }

.contact-info__extra { margin: 0 0 60px; }

@media (min-width: 62em) {
  .contact-form h2 { padding: 0 0 20px; }

  .cf-fields { padding: 30px 50px; gap: 10px; }

  .cf-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
  }

  /* 15px like the static form, so the labels fit the 30% column on one line */
  .cf-row > label {
    flex: 1 1 auto;
    padding-top: 7px;
    font-size: var(--fs-ui, 15px);
    letter-spacing: 1px;
  }

  .cf-row .wpcf7-form-control-wrap { flex: 0 0 70%; }

  .cf-privacy { margin-left: 30%; padding-left: 0; }
}

/* --------------------------------------------------------------------------
   14. Gallery above page text (Studio): one 16:9 image, or a carousel
   -------------------------------------------------------------------------- */
.gallery {
  position: relative;
  margin-bottom: 25px;
}

.gallery__track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.gallery__slide {
  flex: 0 0 100%;
  aspect-ratio: 16 / 9;
  scroll-snap-align: start;
  background: var(--grey);
}

.gallery__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__nav {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}
.gallery__nav--prev { left: 4px; }
.gallery__nav--next { right: 4px; }

.gallery__nav svg {
  width: 30px;
  height: 30px;
  fill: var(--white);
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, .45));
  transition: opacity .2s ease;
}
.gallery__nav:hover svg { opacity: .75; }
.gallery__nav:disabled { cursor: default; }
.gallery__nav:disabled svg { opacity: .3; }
.gallery__nav:focus-visible { outline: 2px solid var(--white); outline-offset: -4px; }

/* Without JavaScript the arrows can't work: swipe/scroll instead. */
.no-js .gallery__nav { display: none; }
