/* ==========================================================
   VILLA SILVANA — Stylesheet condiviso
   Drammatico · Editorial · Hero full-screen
   ========================================================== */

:root {
  --sage-deep: #3a5347;
  --sage-dark: #2b3e35;
  --sage-mid:  #6f8a7a;
  --sage-pale: #b8c9bd;
  --sage-haze: #d8e2db;
  --blue-misty: #7a96a0;
  --blue-dawn:  #c4d3d4;
  --ivory:      #f4f0e8;
  --ivory-warm: #ede6d6;
  --ink:        #1a2620;
  --ink-soft:   #3a4a42;
  --gold-warm:  #b8956a;

  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease-cinema: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --header-h: 76px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  background: var(--ivory);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  background: var(--ivory);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }

/* ==========================================================
   TIPOGRAFIA
   ========================================================== */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 300;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.005em;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--sage-deep);
  font-weight: 400;
  padding-left: 0.35em;
}

.eyebrow--light { color: rgba(244, 240, 232, 0.85); }

a { color: var(--sage-deep); text-decoration: none; transition: color 0.3s var(--ease-smooth); }
a:hover { color: var(--ink); }

/* ==========================================================
   HEADER
   ========================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  transition: background 0.5s var(--ease-smooth),
              backdrop-filter 0.5s var(--ease-smooth),
              border-color 0.5s var(--ease-smooth);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled,
.site-header.is-light-bg {
  background: rgba(244, 240, 232, 0.92);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: rgba(58, 83, 71, 0.12);
}

.site-header__inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 1.1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  z-index: 101;
}

.site-logo svg {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  transition: transform 0.5s var(--ease-smooth);
}

.site-logo:hover svg { transform: rotate(-3deg) scale(1.05); }

.site-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.site-logo__name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--ivory);
  letter-spacing: 0.01em;
  transition: color 0.5s var(--ease-smooth);
}

.site-logo__sub {
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(244, 240, 232, 0.7);
  margin-top: 0.25rem;
  padding-left: 0.3em;
  transition: color 0.5s var(--ease-smooth);
}

.site-header.is-scrolled .site-logo__name,
.site-header.is-light-bg .site-logo__name { color: var(--ink); }

.site-header.is-scrolled .site-logo__sub,
.site-header.is-light-bg .site-logo__sub  { color: var(--sage-deep); }

/* Nav desktop */
.site-nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.site-nav a {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ivory);
  font-weight: 400;
  padding: 0.5rem 0;
  position: relative;
  padding-left: 0.28em;
  transition: color 0.4s var(--ease-smooth);
}

.site-header.is-scrolled .site-nav a,
.site-header.is-light-bg .site-nav a { color: var(--ink-soft); }

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.5s var(--ease-cinema);
}

.site-nav a:hover::after,
.site-nav a.is-active::after { width: calc(100% - 0.28em); }

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 44px;
  height: 44px;
  position: relative;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--ivory);
  margin: 5px auto;
  transition: transform 0.4s var(--ease-cinema),
              opacity 0.3s var(--ease-smooth),
              background-color 0.4s var(--ease-smooth);
}

.site-header.is-scrolled .nav-toggle span,
.site-header.is-light-bg .nav-toggle span { background: var(--ink); }

.nav-toggle[aria-expanded="true"] span { background: var(--ink); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Language switcher */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 1.5rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(244, 240, 232, 0.4);
  border-radius: 999px;
  transition: border-color 0.5s var(--ease-smooth), background 0.5s var(--ease-smooth);
}

.site-header.is-scrolled .lang-switch,
.site-header.is-light-bg .lang-switch {
  border-color: rgba(58, 83, 71, 0.3);
}

.lang-switch button {
  background: none;
  border: none;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  font-weight: 500;
  color: rgba(244, 240, 232, 0.7);
  transition: color 0.3s var(--ease-smooth), background 0.3s var(--ease-smooth);
  border-radius: 999px;
  line-height: 1;
}

.lang-switch button:hover { color: var(--ivory); }
.lang-switch button.is-active {
  color: var(--sage-dark);
  background: var(--ivory);
}

.site-header.is-scrolled .lang-switch button,
.site-header.is-light-bg .lang-switch button { color: rgba(58, 83, 71, 0.7); }
.site-header.is-scrolled .lang-switch button:hover,
.site-header.is-light-bg .lang-switch button:hover { color: var(--ink); }
.site-header.is-scrolled .lang-switch button.is-active,
.site-header.is-light-bg .lang-switch button.is-active {
  color: var(--ivory);
  background: var(--sage-deep);
}

.lang-switch__sep {
  color: rgba(244, 240, 232, 0.3);
  font-size: 0.6rem;
  user-select: none;
  margin: 0 0.1rem;
}

.site-header.is-scrolled .lang-switch__sep,
.site-header.is-light-bg .lang-switch__sep {
  color: rgba(58, 83, 71, 0.25);
}

/* ==========================================================
   FOOTER
   ========================================================== */

.site-footer {
  background: var(--sage-dark);
  color: rgba(244, 240, 232, 0.85);
  padding: 5rem 2.5rem 2.5rem;
  margin-top: 0;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 30%, rgba(184, 201, 189, 0.08), transparent 70%),
    radial-gradient(ellipse 50% 50% at 80% 70%, rgba(122, 150, 160, 0.06), transparent 70%);
  pointer-events: none;
}

.site-footer__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 4rem;
  align-items: start;
  position: relative;
  z-index: 1;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.site-footer__brand-mark {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-footer__brand-mark svg { width: 42px; height: 42px; }

.site-footer__brand-mark-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.7rem;
  color: var(--ivory);
}

.site-footer__brand p {
  color: rgba(244, 240, 232, 0.7);
  line-height: 1.7;
  max-width: 360px;
}

.site-footer__col h4 {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sage-pale);
  margin-bottom: 1.2rem;
  font-weight: 400;
  padding-left: 0.3em;
}

.site-footer__col p,
.site-footer__col a {
  font-size: 0.9rem;
  color: rgba(244, 240, 232, 0.75);
  line-height: 1.8;
  display: block;
}

.site-footer__col a:hover { color: var(--ivory); }

.site-footer__bottom {
  max-width: 1400px;
  margin: 4rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(244, 240, 232, 0.12);
  text-align: center;
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(244, 240, 232, 0.5);
  padding-left: 0.35em;
  position: relative;
  z-index: 1;
}

/* ==========================================================
   CONTAINER E PAGINA
   ========================================================== */

.page-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 5rem 2.5rem;
}

/* Hero standard per pagine interne */
.page-hero {
  min-height: 65vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--header-h) 1.5rem 3rem;
  background: var(--sage-deep);
}

.page-hero__bg {
  position: absolute;
  top: -80px;
  left: 0;
  right: 0;
  bottom: -80px;
  z-index: 0;
}

.page-hero__bg img {
  width: 100%;
  height: 110%;
  object-fit: cover;
  object-position: center;
  will-change: transform;
}

.page-hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(26, 38, 32, 0.25) 0%, rgba(26, 38, 32, 0.5) 60%, rgba(26, 38, 32, 0.85) 100%);
  z-index: 1;
}

.page-hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--ivory);
  max-width: 800px;
  padding-top: 4rem;
}

.page-hero__inner .eyebrow { color: rgba(244, 240, 232, 0.85); }

.page-hero__inner h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-style: italic;
  color: var(--ivory);
  margin: 1.5rem 0 1rem;
  letter-spacing: -0.01em;
}

.page-hero__inner p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: rgba(244, 240, 232, 0.85);
  max-width: 600px;
  margin: 0 auto;
}

/* Divider ornamentale */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 1.5rem auto;
  opacity: 0.7;
}

.ornament--light { color: rgba(244, 240, 232, 0.85); }

.ornament .line {
  width: 60px;
  height: 1px;
  background: currentColor;
  color: var(--sage-deep);
}

.ornament--light .line { color: rgba(244, 240, 232, 0.7); }

.ornament .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  color: var(--sage-deep);
}

.ornament--light .dot { color: rgba(244, 240, 232, 0.85); }

/* ==========================================================
   BOTTONI
   ========================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem 2rem;
  border: 1px solid var(--sage-deep);
  background: transparent;
  color: var(--sage-deep);
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.5s var(--ease-cinema);
  padding-left: calc(2rem + 0.3em);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--sage-deep);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s var(--ease-cinema);
  z-index: -1;
}

.btn:hover { color: var(--ivory); }
.btn:hover::before { transform: scaleX(1); transform-origin: left; }

.btn--solid {
  background: var(--sage-deep);
  color: var(--ivory);
}

.btn--solid::before { background: var(--ink); }
.btn--solid:hover { color: var(--ivory); }

.btn--light {
  border-color: rgba(244, 240, 232, 0.6);
  color: var(--ivory);
}

.btn--light::before { background: var(--ivory); }
.btn--light:hover { color: var(--ink); }

.btn svg { width: 14px; height: 14px; }

/* ==========================================================
   ANIMAZIONI D'ENTRATA
   ========================================================== */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes heroZoom {
  from { transform: scale(1.12); }
  to   { transform: scale(1.02); }
}

@keyframes drawLine {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.reveal {
  opacity: 0;
  animation: fadeUp 1.2s var(--ease-cinema) forwards;
}

.reveal-1 { animation-delay: 0.2s; }
.reveal-2 { animation-delay: 0.4s; }
.reveal-3 { animation-delay: 0.6s; }
.reveal-4 { animation-delay: 0.8s; }
.reveal-5 { animation-delay: 1.0s; }
.reveal-6 { animation-delay: 1.2s; }

/* Scroll-reveal sempre visibile di default (graceful) */
.reveal-on-scroll {
  opacity: 1;
}

.js-reveal-enabled .reveal-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.1s var(--ease-cinema),
              transform 1.1s var(--ease-cinema);
}

.js-reveal-enabled .reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 900px) {
  .site-header__inner {
    padding: 0.9rem 1.25rem;
  }

  .site-logo svg { width: 34px; height: 34px; }
  .site-logo__name { font-size: 1.2rem; }
  .site-logo__sub  { font-size: 0.5rem; letter-spacing: 0.25em; }

  .nav-toggle { display: block; }

  .site-nav {
    position: fixed;
    inset: 0;
    background: var(--sage-dark);
    flex-direction: column;
    justify-content: center;
    gap: 2.5rem;
    z-index: 99;
    transform: translateX(100%);
    transition: transform 0.6s var(--ease-cinema);
    padding-top: 4rem;
  }

  .site-nav.is-open { transform: translateX(0); }

  .site-nav a {
    font-size: 1.1rem;
    letter-spacing: 0.35em;
    color: var(--ivory) !important;
  }

  .site-nav a::after { background: var(--ivory); }

  /* Lang switcher mobile */
  .lang-switch {
    margin-left: 0;
    margin-top: 2.5rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(244, 240, 232, 0.4);
    border-radius: 999px;
  }
  .lang-switch button {
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    padding: 0.4rem 0.8rem;
    color: rgba(244, 240, 232, 0.7) !important;
  }
  .lang-switch button.is-active {
    color: var(--sage-dark) !important;
    background: var(--ivory);
  }
  .lang-switch__sep { color: rgba(244, 240, 232, 0.3) !important; }

  .site-footer { padding: 4rem 1.5rem 2rem; }

  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }

  .site-footer__brand {
    align-items: center;
  }

  .site-footer__brand p { margin: 0 auto; }
  .site-footer__brand-mark { justify-content: center; }

  .page-section { padding: 3rem 1.25rem; }

  .page-hero { min-height: 55vh; padding: var(--header-h) 1.25rem 2rem; }
}

/* ==========================================================
   ACCESSIBILITÀ
   ========================================================== */

.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;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--sage-deep);
  outline-offset: 3px;
}
