/* layout.css: generato dai CSS Modules del demo e poi mantenuto a mano.
   Prefissi: hdr = Header, ftr = Footer, btn = Button, sh = SectionHeading, ph = PageHero, cta = FinalCTA, form = Form */

/* ==========================================================================
   Header: barra fissa, logo, menu desktop e drawer mobile (.hdr-*)
   ========================================================================== */

.hdr-header {
  --focus: var(--c-beige);
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  color: var(--c-ivory);
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.hdr-header::before {
  content: '';
  position: absolute;
  inset: 0 0 -3rem;
  background: linear-gradient(180deg, rgba(18, 16, 15, 0.5), rgba(18, 16, 15, 0));
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}

.hdr-solid {
  --focus: var(--c-wine);
  background: rgba(255, 253, 248, 0.96);
  color: var(--c-ink);
  box-shadow: 0 1px 0 var(--c-line-soft);
  backdrop-filter: blur(10px);
}

.hdr-solid::before,
.hdr-is-open::before {
  opacity: 0;
}

.hdr-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
  height: 100%;
}

.hdr-brand {
  display: flex;
  margin-right: auto;
  /* Il quadrato inclinato del logo arriva al bordo superiore: lo abbassiamo un po' per bilanciarlo */
  padding-top: 0.4rem;
  text-decoration: none;
}

.hdr-logo {
  display: block;
  width: auto;
  height: clamp(3.5rem, 3rem + 1.4vw, 4.3rem);
}

.hdr-logo-color,
.hdr-solid .hdr-logo-light {
  display: none;
}

.hdr-solid .hdr-logo-color {
  display: block;
}

.hdr-nav {
  display: none;
}

.hdr-nav ul {
  list-style: none;
  display: flex;
  gap: clamp(1rem, 1.5vw, 1.75rem);
}

.hdr-nav-link {
  position: relative;
  display: inline-block;
  padding-block: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  white-space: nowrap;
}

.hdr-nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.2rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur) var(--ease);
}

.hdr-nav-link:hover::after,
.hdr-nav-link[aria-current='page']::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hdr-solid .hdr-nav-link[aria-current='page'] {
  color: var(--c-wine);
}

.hdr-toggle {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-right: -0.7rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.hdr-drawer {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-h) + 1.5rem) var(--gutter) 2rem;
  overflow-y: auto;
  background: var(--c-ink);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--dur) var(--ease),
    visibility 0s linear var(--dur);
}

.hdr-drawer-open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur) var(--ease);
}

.hdr-drawer-nav ul {
  list-style: none;
  display: grid;
}

.hdr-drawer-link {
  display: block;
  padding-block: 0.35rem;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 1.6rem + 2vw, 2.75rem);
  line-height: 1.15;
  color: var(--c-ivory);
  text-decoration: none;
  transform: translateY(12px);
  opacity: 0;
  transition:
    transform 400ms var(--ease),
    opacity 400ms var(--ease),
    color var(--dur) var(--ease);
}

.hdr-drawer-open .hdr-drawer-link {
  transform: none;
  opacity: 1;
}

.hdr-drawer-nav li:nth-child(2) .hdr-drawer-link {
  transition-delay: 40ms;
}

.hdr-drawer-nav li:nth-child(3) .hdr-drawer-link {
  transition-delay: 80ms;
}

.hdr-drawer-nav li:nth-child(4) .hdr-drawer-link {
  transition-delay: 120ms;
}

.hdr-drawer-nav li:nth-child(5) .hdr-drawer-link {
  transition-delay: 160ms;
}

.hdr-drawer-nav li:nth-child(6) .hdr-drawer-link {
  transition-delay: 200ms;
}

.hdr-drawer-nav li:nth-child(7) .hdr-drawer-link {
  transition-delay: 240ms;
}

.hdr-drawer-link:hover,
.hdr-drawer-link[aria-current='page'] {
  color: var(--c-beige);
}

.hdr-drawer-link[aria-current='page'] {
  font-style: italic;
}

.hdr-drawer-footer {
  display: grid;
  gap: 1.25rem;
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--c-line-soft);
}

.hdr-drawer-cta {
  width: 100%;
}

.hdr-drawer-mail {
  font-size: 0.9375rem;
  color: var(--c-muted);
  overflow-wrap: anywhere;
}

.hdr-drawer-social {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hdr-social-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  color: var(--c-ivory);
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.hdr-social-link:hover {
  background: var(--c-ivory);
  color: var(--c-ink);
}

@media (min-width: 1320px) {
  .hdr-nav {
    display: block;
  }

  .hdr-toggle,
  .hdr-drawer {
    display: none;
  }
}

/* ==========================================================================
   Footer (.ftr-*)
   ========================================================================== */

.ftr-footer {
  padding-block: clamp(4rem, 8vw, 6.5rem) 2rem;
  background: var(--c-ink);
  color: var(--c-muted);
  font-size: 0.9375rem;
}

.ftr-grid {
  display: grid;
  gap: 2.75rem;
}

.ftr-logo {
  display: block;
  width: auto;
  height: clamp(3.6rem, 3.2rem + 1vw, 4.4rem);
}

.ftr-about {
  max-width: 34ch;
  margin-top: 1.75rem;
}

.ftr-title {
  margin-bottom: 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-ivory);
}

.ftr-list {
  list-style: none;
  display: grid;
  gap: 0.15rem;
}

.ftr-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 36px;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color var(--dur) var(--ease);
}

.ftr-link:hover {
  color: var(--c-ivory);
  text-decoration: underline;
}

.ftr-address {
  display: grid;
  gap: 0.4rem;
  justify-items: start;
}

.ftr-contact-name {
  color: var(--c-ivory);
  font-weight: 600;
}

.ftr-meta {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  line-height: 1.5;
}

.ftr-meta svg {
  flex: none;
  margin-top: 0.1rem;
}

.ftr-vat {
  margin-top: 0.4rem;
  font-size: 0.8125rem;
}

.ftr-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-line-soft);
  font-size: 0.8125rem;
}

.ftr-legal {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

@media (min-width: 640px) {
  .ftr-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .ftr-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
    gap: 3rem;
  }
}

/* ==========================================================================
   Pulsanti e link con aspetto da pulsante (.btn-*)
   ========================================================================== */

.btn-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 50px;
  padding: 0.85rem 1.65rem;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.btn-button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.btn-icon {
  flex: none;
  transition: transform var(--dur) var(--ease);
}

.btn-button:hover .btn-icon {
  transform: translateX(4px);
}

.btn-primary {
  background: var(--c-wine);
  color: var(--c-ivory);
}

.btn-primary:hover {
  background: var(--c-wine-deep);
}

.btn-outline {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}

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

.btn-light:hover {
  background: var(--c-beige);
}

.btn-outline-light {
  border-color: rgba(247, 242, 233, 0.6);
  color: var(--c-ivory);
}

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

.btn-text {
  position: relative;
  min-height: 44px;
  padding: 0.5rem 0;
  color: var(--accent);
}

.btn-text::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.3rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}

.btn-text:hover::after {
  transform: scaleX(1);
}

@media (min-width: 480px) {
  .btn-button {
    white-space: nowrap;
  }
}

/* ==========================================================================
   Intestazione di sezione (.sh-*)
   ========================================================================== */

.sh-heading {
  max-width: 48rem;
}

.sh-title {
  margin-top: 1.1rem;
  font-size: var(--fs-h2);
}

.sh-heading > .sh-title:first-child {
  margin-top: 0;
}

.sh-intro {
  max-width: 40rem;
  margin-top: 1.25rem;
  font-size: 1.0625rem;
  color: var(--c-muted);
}

.sh-center {
  margin-inline: auto;
  text-align: center;
}

.sh-center .sh-intro {
  margin-inline: auto;
}

.sh-center .eyebrow::after {
  content: '';
  flex: none;
  width: 2rem;
  height: 1px;
  background: currentColor;
}

/* ==========================================================================
   Hero delle pagine interne (.ph-*)
   ========================================================================== */

.ph-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: clamp(28rem, 70svh, 42rem);
  padding-top: calc(var(--header-h) + 3rem);
  padding-bottom: clamp(3rem, 6vw, 5.5rem);
  overflow: hidden;
  background: var(--c-ink);
}

.ph-plain {
  min-height: clamp(24rem, 56svh, 34rem);
  background:
    radial-gradient(120% 140% at 90% 0%, rgba(143, 23, 48, 0.9) 0%, rgba(112, 19, 35, 0.95) 40%, #2a0a11 100%),
    var(--c-wine-deep);
}

.ph-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: ph-hero-zoom 1600ms var(--ease) both;
}

.ph-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(18, 16, 15, 0.6) 0%, rgba(18, 16, 15, 0.2) 35%, rgba(18, 16, 15, 0.85) 100%),
    linear-gradient(90deg, rgba(18, 16, 15, 0.55) 0%, rgba(18, 16, 15, 0) 70%);
}

.ph-content > * {
  max-width: 54rem;
  animation: ph-fade-up 800ms var(--ease) both;
}

.ph-content > :nth-child(2) {
  animation-delay: 80ms;
}

.ph-content > :nth-child(3) {
  animation-delay: 160ms;
}

.ph-content > :nth-child(4) {
  animation-delay: 240ms;
}

.ph-title {
  margin-top: 1.1rem;
  font-size: var(--fs-h1);
}

.ph-intro {
  max-width: 40rem;
  margin-top: 1.4rem;
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.2rem);
  color: rgba(247, 242, 233, 0.88);
}

.ph-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

/* Testo a destra (solo desktop): la sfumatura scura segue il testo */
@media (min-width: 1024px) {
  .ph-align-right .ph-overlay {
    background:
      linear-gradient(180deg, rgba(18, 16, 15, 0.6) 0%, rgba(18, 16, 15, 0.15) 35%, rgba(18, 16, 15, 0.75) 100%),
      linear-gradient(270deg, rgba(18, 16, 15, 0.7) 0%, rgba(18, 16, 15, 0.35) 45%, rgba(18, 16, 15, 0) 70%);
  }

  .ph-align-right .ph-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  .ph-align-right .ph-content > * {
    width: min(100%, 36rem);
  }
}

@keyframes ph-fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ph-hero-zoom {
  from {
    transform: scale(1.06);
  }

  to {
    transform: none;
  }
}

/* ==========================================================================
   Blocco contatti finale delle pagine interne (.cta-*)
   ========================================================================== */

.cta-section {
  position: relative;
  isolation: isolate;
  padding-block: clamp(6rem, 12vw, 11rem);
  overflow: hidden;
  background: var(--c-wine-deep);
  text-align: center;
}

.cta-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cta-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(160deg, rgba(112, 19, 35, 0.8) 0%, rgba(84, 14, 27, 0.84) 50%, rgba(34, 9, 14, 0.92) 100%);
}

.cta-content {
  max-width: 54rem;
  margin-inline: auto;
}

.cta-content .eyebrow::after {
  content: '';
  flex: none;
  width: 2rem;
  height: 1px;
  background: currentColor;
}

.cta-title {
  margin-top: 1.25rem;
  font-size: var(--fs-h2);
}

.cta-text {
  max-width: 36rem;
  margin: 1.5rem auto 0;
  font-size: 1.125rem;
  color: rgba(247, 242, 233, 0.88);
}

.cta-text + .cta-text {
  margin-top: 0.9rem;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.5rem;
}

/* ==========================================================================
   Moduli (.form-*)
   ========================================================================== */

.form-form {
  position: relative;
  display: grid;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  gap: 1.25rem;
}

.form-field {
  display: grid;
  gap: 0.45rem;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-heading);
}

.form-optional {
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--c-muted);
}

.form-input {
  width: 100%;
  min-height: 52px;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(36, 27, 23, 0.28);
  border-radius: 0;
  background: var(--c-ivory);
  color: var(--c-text);
  font-size: 1rem;
  appearance: none;
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.form-input:hover {
  border-color: rgba(36, 27, 23, 0.5);
}

.form-input:focus {
  outline: none;
  border-color: var(--c-wine);
  box-shadow: 0 0 0 3px rgba(143, 23, 48, 0.18);
}

.form-textarea {
  min-height: 170px;
  resize: vertical;
}

.form-select {
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238f1730' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--c-muted);
  cursor: pointer;
}

.form-check input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.1rem 0 0;
  accent-color: var(--c-wine);
  cursor: pointer;
}

.form-check a {
  color: var(--c-wine);
}

.form-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  display: flex;
}

.form-status:empty {
  display: none;
}

.form-status-visible {
  padding: 0.9rem 1.15rem;
  border-left: 2px solid var(--c-wine);
  background: var(--c-blush);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--c-text);
}

.form-status-visible a {
  color: var(--c-wine);
  font-weight: 600;
}

.form-status-success {
  border-left-color: #2f6b3f;
  background: #edf4eb;
}

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
