/* ==========================================================================
   Da Maria alla Corricella — Static Export Styles
   Pure CSS + design tokens (works alongside Tailwind CDN)
   ========================================================================== */

:root {
  /* Postcard palette — blue only */
  --postcard-cream: #f2ebdb;
  --postcard-paper: #faf6ec;
  --postcard-paper-2: #ede4ce;
  --ink-dark: #0a1f3d;
  --ink-soft: #2d4a7c;
  --cobalt: #1b4e8a;
  --cobalt-deep: #0e3a6b;
  --azure: #4e89c9;
  --azure-soft: #a8c3e1;
  --coral-faded: #2e78c7;
  --coral-dark: #0e3a6b;
  --postmark-red: #1b4e8a;
  --sun-mustard: #4e89c9;
  --paper-line: rgba(10, 31, 61, 0.12);
}

* { box-sizing: border-box; border-color: rgba(10, 31, 61, 0.15); }

html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }
/* Regole consigliate da Lenis: evita doppio smooth-scroll quando attivo */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background-color: var(--postcard-cream);
  color: var(--ink-dark);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--cobalt); color: var(--postcard-paper); }

/* Typography */
.font-display { font-family: "Fraunces", serif; font-optical-sizing: auto; font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 1; letter-spacing: -0.02em; font-weight: 400; }
.font-display-italic { font-family: "Fraunces", serif; font-style: italic; font-variation-settings: "opsz" 144; font-weight: 400; }
.font-body { font-family: "DM Sans", sans-serif; }
.font-hand { font-family: "Caveat", cursive; }
.font-mono-stamp { font-family: "JetBrains Mono", monospace; letter-spacing: 0.08em; }

.postmark-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--cobalt);
}

/* Paper textures */
.paper-grain { position: relative; }
.paper-grain::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.04   0 0 0 0 0.12   0 0 0 0 0.24   0 0 0 0.65 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/></svg>");
  opacity: 0.55;
  mix-blend-mode: multiply;
}
.paper-fibers {
  background-color: var(--postcard-paper);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(27, 78, 138, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(46, 120, 199, 0.05) 0%, transparent 50%),
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(10, 31, 61, 0.015) 3px 4px);
}

/* Par-Avion striped border (blue-only) */
.par-avion-border {
  background-image: repeating-linear-gradient(
    45deg,
    var(--cobalt) 0 10px,
    transparent 10px 18px,
    var(--azure) 18px 28px,
    transparent 28px 36px
  );
}

/* Postage stamp shape */
.stamp-edge {
  position: relative;
  background: var(--postcard-paper);
  filter: drop-shadow(0 6px 14px rgba(10, 31, 61, 0.15));
  -webkit-mask:
    radial-gradient(circle at 8px 0, transparent 5px, #000 5.5px) 0 0/16px 100% repeat-x,
    radial-gradient(circle at 8px 100%, transparent 5px, #000 5.5px) 0 100%/16px 100% repeat-x,
    radial-gradient(circle at 0 8px, transparent 5px, #000 5.5px) 0 0/100% 16px repeat-y,
    radial-gradient(circle at 100% 8px, transparent 5px, #000 5.5px) 0 0/100% 16px repeat-y,
    linear-gradient(#000, #000);
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
  padding: 14px;
}

/* Postmark circular */
.postmark {
  width: 110px; height: 110px;
  border-radius: 9999px;
  border: 2px solid var(--cobalt);
  color: var(--cobalt);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  opacity: 0.65;
  transform: rotate(-12deg);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.postmark::before { content: ""; position: absolute; inset: 6px; border: 1px dashed currentColor; border-radius: 9999px; }
.postmark span { text-align: center; line-height: 1.1; padding: 6px; }

/* Dashed postal divider */
.postal-divider { border-top: 1px dashed var(--cobalt); opacity: 0.45; }

/* Drop cap */
.drop-cap::first-letter {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 500;
  float: left;
  font-size: 5.5rem;
  line-height: 0.85;
  padding-right: 0.7rem;
  padding-top: 0.4rem;
  color: var(--cobalt);
}

/* Reveal — visible by default; only hidden when JS is confirmed working */
.reveal-up { opacity: 1; transform: translateY(0); transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1), transform 1.1s cubic-bezier(0.22, 1, 0.36, 1); }
html.js .reveal-up:not(.is-visible) { opacity: 0; transform: translateY(36px); }
html.js .reveal-up.is-visible { opacity: 1; transform: translateY(0); }

/* Marquee */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.animate-marquee { animation: marquee 22s linear infinite; }

/* Image zoom on hover */
.img-zoom { transition: transform 1.8s cubic-bezier(0.22, 1, 0.36, 1); }
.group:hover .img-zoom { transform: scale(1.06); }

/* Tilt */
.tilt-left { transform: rotate(-2deg); }
.tilt-right { transform: rotate(2.2deg); }

/* Postcard frame */
.postcard-frame {
  background: var(--postcard-paper);
  padding: 14px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 24px 50px -20px rgba(10, 31, 61, 0.28),
    0 6px 14px -8px rgba(10, 31, 61, 0.2);
}

/* Cobalt button */
.btn-cobalt {
  background: var(--cobalt);
  color: var(--postcard-paper);
  border: none;
  cursor: pointer;
  border-radius: 9999px;
  padding: 0.95rem 1.8rem;
  font-family: "DM Sans", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 500;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-flex; align-items: center; gap: 0.75rem;
}
.btn-cobalt:hover { background: var(--ink-dark); transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(10, 31, 61, 0.4); }

.btn-cobalt-light {
  background: var(--postcard-paper);
  color: var(--cobalt);
}
.btn-cobalt-light:hover { background: var(--azure-soft); }

/* Link with underline animation */
.link-coral { position: relative; display: inline-block; }
.link-coral::after {
  content: ""; position: absolute; left: 0; bottom: -3px;
  width: 100%; height: 1px;
  background-color: var(--coral-faded);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.link-coral:hover::after { transform: scaleX(1); }

/* Wave underline */
.wave-rule {
  height: 12px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='12' viewBox='0 0 40 12'><path d='M0 6 Q 10 0, 20 6 T 40 6' fill='none' stroke='%231B4E8A' stroke-width='1.2' opacity='0.6'/></svg>");
  background-repeat: repeat-x;
  background-size: 40px 12px;
}

/* Spinning ring */
@keyframes spin-slow { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.spin-slow { animation: spin-slow 16s linear infinite; }

/* Bounce arrow */
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
.animate-bounce { animation: bounce 2s infinite; }

/* Ping (location pin) */
@keyframes ping { 75%,100% { transform: scale(2); opacity: 0; } }
.animate-ping { animation: ping 2s cubic-bezier(0,0,0.2,1) infinite; }

/* Color helpers */
.text-cobalt { color: var(--cobalt); }
.text-ink-dark { color: var(--ink-dark); }
.text-ink-soft { color: var(--ink-soft); }
.text-coral-faded { color: var(--coral-faded); }
.text-postcard-paper { color: var(--postcard-paper); }
.bg-postcard-cream { background-color: var(--postcard-cream); }
.bg-postcard-paper { background-color: var(--postcard-paper); }
.bg-cobalt { background-color: var(--cobalt); }
.bg-ink-dark { background-color: var(--ink-dark); }
.bg-coral-faded { background-color: var(--coral-faded); }
.border-cobalt { border-color: var(--cobalt); }

/* Header */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: all 700ms cubic-bezier(0.22, 1, 0.36, 1);
  background: rgba(14, 58, 107, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(250, 246, 236, 0.1);
}
.site-header.scrolled {
  box-shadow: 0 8px 30px -12px rgba(10, 31, 61, 0.45);
}

/* Video modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 31, 61, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  width: 100%; max-width: 1024px;
  background: var(--ink-dark);
  border: 1px solid rgba(250, 246, 236, 0.1);
  color: var(--postcard-paper);
  overflow: hidden;
  border-radius: 4px;
}
.modal-iframe-wrap { aspect-ratio: 16/9; background: #000; }
.modal-iframe-wrap iframe { width: 100%; height: 100%; border: 0; }

/* Mobile menu — fullscreen overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: linear-gradient(160deg, var(--cobalt-deep) 0%, var(--ink-dark) 100%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s linear 0.5s;
}
.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
/* subtle par-avion accents top & bottom */
.mobile-menu::before,
.mobile-menu::after {
  content: "";
  position: absolute; left: 0; right: 0;
  height: 12px;
  opacity: 0.5;
  background-image: repeating-linear-gradient(45deg,
    var(--azure) 0 10px, transparent 10px 18px,
    var(--azure-soft) 18px 28px, transparent 28px 36px);
}
.mobile-menu::before { top: 0; }
.mobile-menu::after { bottom: 0; }

.mobile-menu-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 2rem 3rem;
  max-width: 520px;
  margin: 0 auto;
}
.mobile-link {
  display: block;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.55rem 0;
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 144;
  font-size: clamp(2.2rem, 11vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--postcard-paper);
  border-bottom: 1px solid rgba(250, 246, 236, 0.08);
  transition: color 0.3s ease, padding-left 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  /* entrance animation */
  opacity: 0;
  transform: translateY(24px);
}
.mobile-link:hover,
.mobile-link:active {
  color: var(--azure);
  padding-left: 0.75rem;
}
.mobile-menu-footer {
  margin-top: 3rem;
  opacity: 0;
  transform: translateY(24px);
}
/* staggered reveal once the menu is open */
.mobile-menu.open .mobile-link,
.mobile-menu.open .mobile-menu-footer {
  animation: mobile-link-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(0.06s * var(--i) + 0.15s);
}
@keyframes mobile-link-in {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-menu.open .mobile-link,
  .mobile-menu.open .mobile-menu-footer { animation: none; opacity: 1; transform: none; }
}

/* Legal pages typography */
.legal-body h2 { font-family: "Fraunces", serif; font-size: 1.5rem; color: var(--cobalt); margin: 2.4rem 0 0.8rem; letter-spacing: -0.01em; }
.legal-body h3 { font-family: "DM Sans", sans-serif; font-weight: 500; font-size: 1.05rem; color: var(--ink-dark); margin: 1.6rem 0 0.6rem; }
.legal-body p { color: var(--ink-soft); line-height: 1.8; margin: 0 0 1rem; }
.legal-body ul { color: var(--ink-soft); line-height: 1.8; margin: 0 0 1.2rem; padding-left: 1.2rem; }
.legal-body li { margin-bottom: 0.45rem; }
.legal-body a { color: var(--cobalt); text-decoration: underline; text-underline-offset: 2px; }
.legal-body a:hover { color: var(--coral-faded); }
.legal-body strong { color: var(--ink-dark); font-weight: 500; }
.legal-table-wrap { overflow-x: auto; margin: 0.5rem 0 1.4rem; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.legal-table th { text-align: left; font-family: "JetBrains Mono", monospace; font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cobalt); padding: 0.6rem 0.8rem; border-bottom: 1px solid rgba(27,78,138,0.3); }
.legal-table td { padding: 0.7rem 0.8rem; color: var(--ink-soft); border-bottom: 1px dashed rgba(27,78,138,0.18); vertical-align: top; }
.legal-table a { color: var(--cobalt); }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: 1rem; right: 1rem; bottom: 1rem;
  z-index: 150;
  max-width: 640px;
  margin: 0 auto;
  background: var(--postcard-paper);
  color: var(--ink-dark);
  border: 1px solid rgba(27,78,138,0.18);
  border-radius: 6px;
  box-shadow: 0 18px 50px -18px rgba(10,31,61,0.45);
  padding: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s cubic-bezier(0.22,1,0.36,1), transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.cookie-banner.show { opacity: 1; transform: translateY(0); }
.cookie-banner .cb-stripe { height: 8px; }
.cookie-banner .cb-inner { padding: 1.3rem 1.5rem 1.5rem; }
.cookie-banner h3 { font-family: "Fraunces", serif; font-size: 1.3rem; color: var(--cobalt); margin: 0 0 0.5rem; }
.cookie-banner p { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.6; margin: 0 0 1.1rem; }
.cookie-banner p a { color: var(--cobalt); text-decoration: underline; text-underline-offset: 2px; }
.cookie-banner .cb-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.cookie-banner .cb-actions button { flex: 1 1 auto; min-width: 130px; }
.btn-ghost {
  background: transparent;
  color: var(--cobalt);
  border: 1px solid rgba(27,78,138,0.4);
  cursor: pointer;
  border-radius: 9999px;
  padding: 0.85rem 1.4rem;
  font-family: "DM Sans", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 500;
  transition: all 0.35s cubic-bezier(0.22,1,0.36,1);
}
.btn-ghost:hover { background: rgba(27,78,138,0.08); border-color: var(--cobalt); }
@media (prefers-reduced-motion: reduce) {
  .cookie-banner { transition: none; }
}

/* Footer legal row */
.footer-legal a, .footer-legal button {
  background: none; border: 0; cursor: pointer;
  font: inherit; letter-spacing: inherit; color: inherit;
  transition: color 0.3s ease;
}
.footer-legal a:hover, .footer-legal button:hover { color: var(--coral-faded); }

/* Footer social pill */
.social-pill {
  border: 1px solid rgba(250, 246, 236, 0.2);
  color: inherit;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.social-pill:hover { border-color: var(--coral-faded); color: var(--coral-faded); }

/* Lingua attiva nello switcher */
.active-lang { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
[data-lang]:not(.active-lang) { opacity: 0.55; }

/* Riduzione movimento: spegne marquee, spin, bounce, ping e transizioni lunghe */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .animate-marquee, .spin-slow, .animate-bounce, .animate-ping { animation: none !important; }
  .reveal-up { transition: none !important; opacity: 1 !important; transform: none !important; }
  .img-zoom { transition: none !important; }
}

/* Utility for sr-only */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }