/* Azienda Agricola Trianiello — sito informativo */

:root {
  --color-bg: #1a2318;
  --color-bg-soft: #243022;
  --color-cream: #f4f0e6;
  --color-cream-muted: #c9c4b8;
  --color-gold: #c4a35a;
  --color-gold-soft: rgba(196, 163, 90, 0.35);
  --color-olive: #3d5c3a;
  --font-display: "Cormorant Infant", "Cormorant Garamond", Georgia, serif;
  --font-body: "Literata", Georgia, serif;
  --header-h: 6rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.06rem;
  line-height: 1.75;
  color: var(--color-cream);
  background: var(--color-bg);
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
}

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

a {
  color: var(--color-gold);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #e8d49a;
}

/* —— Header —— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: linear-gradient(
    180deg,
    rgba(26, 35, 24, 0.92) 0%,
    rgba(26, 35, 24, 0.65) 70%,
    transparent 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

/* Logo circolare, senza cornice */
.brand__logo-frame {
  flex-shrink: 0;
  width: 5.25rem;
  height: 5.25rem;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.brand__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-cream);
  line-height: 1.15;
}

.brand__subtitle {
  display: block;
  font-size: 0.65rem;
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-cream-muted);
  margin-top: 0.15rem;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-gold-soft);
  color: var(--color-cream);
  padding: 0;
  border-radius: 4px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle__icon {
  display: block;
  pointer-events: none;
}

.nav-list {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-list a {
  color: var(--color-cream-muted);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.nav-list a:hover,
.nav-list a[aria-current="true"] {
  color: var(--color-cream);
}

.nav-shop {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--color-gold-soft);
  border-radius: 999px;
  font-size: 0.8rem !important;
  color: var(--color-cream-muted) !important;
  cursor: not-allowed;
  opacity: 0.85;
}

.nav-shop[aria-disabled="true"] {
  pointer-events: none;
}

@media (max-width: 768px) {
  .site-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 0.75rem;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .nav-toggle {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    display: inline-flex;
    width: 2.75rem;
    height: 2.75rem;
  }

  #site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .nav-list {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 1rem 1.5rem 1.5rem;
    background: rgba(26, 35, 24, 0.97);
    border-bottom: 1px solid var(--color-gold-soft);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s var(--ease-out), opacity 0.25s ease,
      visibility 0.25s;
  }

  .nav-list.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-list li {
    width: 100%;
    border-bottom: 1px solid rgba(196, 163, 90, 0.12);
  }

  .nav-list a {
    display: block;
    padding: 0.85rem 0;
  }
}

/* —— Hero carosello (stesse foto della galleria) —— */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--header-h) + 2rem) 1.5rem 4rem;
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__carousel {
  position: absolute;
  inset: 0;
}

.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.15s ease;
  pointer-events: none;
}

.hero__slide.is-active {
  opacity: 1;
  z-index: 1;
}

.hero__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
      180deg,
      rgba(26, 35, 24, 0.45) 0%,
      rgba(26, 35, 24, 0.55) 40%,
      rgba(26, 35, 24, 0.85) 100%
    ),
    radial-gradient(
      ellipse 80% 60% at 50% 40%,
      rgba(61, 92, 58, 0.25) 0%,
      transparent 70%
    );
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 52rem;
}

.hero__tag {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-gold-soft);
  padding-bottom: 0.35rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 500;
  line-height: 1.12;
  margin: 0 0 1rem;
  color: var(--color-cream);
}

.hero__lead {
  font-size: 1.15rem;
  color: var(--color-cream-muted);
  max-width: 36rem;
  margin: 0 auto 2rem;
}

.hero__cta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn--primary {
  background: var(--color-gold);
  color: var(--color-bg);
  border: 1px solid var(--color-gold);
}

.btn--primary:hover {
  background: #d4b56a;
  color: var(--color-bg);
}

.btn--ghost {
  background: transparent;
  color: var(--color-cream);
  border: 1px solid var(--color-gold-soft);
}

.btn--ghost:hover {
  border-color: var(--color-gold);
  color: var(--color-cream);
}

.hero__scroll {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  color: var(--color-cream-muted);
  text-decoration: none;
  border: 1px solid var(--color-gold-soft);
  border-radius: 50%;
  background: rgba(26, 35, 24, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.hero__scroll:hover,
.hero__scroll:focus-visible {
  color: var(--color-gold);
  border-color: var(--color-gold);
  background: rgba(26, 35, 24, 0.55);
  outline: none;
}

/* Movimento solo sulla freccia: il pulsante resta centrato con translateX(-50%) */
.hero__scroll-icon {
  display: block;
  pointer-events: none;
  animation: hero-arrow-nudge 2s ease-in-out infinite;
  will-change: transform;
}

@keyframes hero-arrow-nudge {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.85;
  }
  50% {
    transform: translateY(8px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__scroll-icon {
    animation: none;
  }

  .hero__slide {
    transition: none;
  }

  .hero__carousel .hero__slide:not(:first-child) {
    opacity: 0 !important;
    visibility: hidden;
  }

  .hero__carousel .hero__slide:first-child {
    opacity: 1 !important;
    z-index: 1;
  }
}

/* —— Sections —— */
section[id] {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.section {
  padding: 5rem 1.5rem;
  position: relative;
}

.section--alt {
  background: var(--color-bg-soft);
}

.section__inner {
  max-width: 58rem;
  margin: 0 auto;
}

.section__label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin: 0 0 0.5rem;
  font-weight: 500;
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 500;
  margin: 0 0 1.5rem;
  color: var(--color-cream);
}

.prose {
  color: var(--color-cream-muted);
}

.prose p {
  margin: 0 0 1.25rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* —— Mission cards —— */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.value-card {
  background: rgba(36, 48, 34, 0.6);
  border: 1px solid var(--color-gold-soft);
  padding: 1.5rem;
  border-radius: 4px;
  transition: border-color 0.25s ease, transform 0.25s var(--ease-out);
}

.value-card:hover {
  border-color: rgba(196, 163, 90, 0.5);
  transform: translateY(-2px);
}

.value-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.65rem;
  color: var(--color-cream);
}

.value-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-cream-muted);
  line-height: 1.55;
}

/* —— Products —— */
.products-note {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.65rem 1rem;
  background: rgba(196, 163, 90, 0.12);
  border: 1px dashed var(--color-gold-soft);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--color-cream-muted);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  list-style: none;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
}

.product-pill {
  text-align: center;
  padding: 1.25rem 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-gold-soft);
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-cream);
}

.product-pill small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-top: 0.35rem;
}

/* —— Gallery —— */
.gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-top: 2.5rem;
}

.gallery__item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--color-gold-soft);
  cursor: pointer;
}

.gallery__item--wide {
  grid-column: span 2;
  aspect-ratio: 2 / 1;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}

.gallery__item:hover img {
  transform: scale(1.05);
}

@media (max-width: 900px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery__item--wide {
    grid-column: span 3;
  }
}

@media (max-width: 520px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery__item--wide {
    grid-column: span 2;
  }
}

/* —— Torna in alto —— */
.scroll-top {
  position: fixed;
  right: calc(1.25rem + env(safe-area-inset-right, 0px));
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 50%;
  border: 1px solid var(--color-gold-soft);
  background: rgba(26, 35, 24, 0.92);
  color: var(--color-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.35rem);
  transition: opacity 0.28s ease, visibility 0.28s, transform 0.28s var(--ease-out),
    background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.scroll-top.scroll-top--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top:hover,
.scroll-top:focus-visible {
  color: #e8d49a;
  border-color: var(--color-gold);
  background: rgba(36, 48, 34, 0.96);
}

.scroll-top:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

.scroll-top__icon {
  display: block;
  margin-top: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-top {
    transition: none;
  }
}

/* —— Lightbox galleria —— */
body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 4rem 4rem;
  box-sizing: border-box;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.lightbox--open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 9, 0.94);
  cursor: zoom-out;
}

.lightbox__stage {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  max-height: calc(100vh - 6.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 6.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  user-select: none;
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid var(--color-gold-soft);
  border-radius: 4px;
  background: rgba(26, 35, 24, 0.85);
  color: var(--color-cream);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  color: var(--color-gold);
  border-color: var(--color-gold);
  outline: none;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3.5rem;
  padding: 0;
  border: 1px solid var(--color-gold-soft);
  border-radius: 4px;
  background: rgba(26, 35, 24, 0.85);
  color: var(--color-cream);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.lightbox__nav:hover,
.lightbox__nav:focus-visible {
  color: var(--color-gold);
  border-color: var(--color-gold);
  outline: none;
}

.lightbox__nav--prev {
  left: 0.75rem;
}

.lightbox__nav--next {
  right: 0.75rem;
}

.lightbox__counter {
  position: relative;
  z-index: 3;
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--color-cream-muted);
  text-align: center;
}

@media (max-width: 640px) {
  .lightbox {
    padding: 3.25rem 0.5rem 3rem;
  }

  .lightbox__nav--prev {
    left: 0.35rem;
  }

  .lightbox__nav--next {
    right: 0.35rem;
  }

  .lightbox__nav {
    width: 2.5rem;
    height: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox {
    transition: none;
  }
}

/* —— Musica di sottofondo (file audio, nessun controllo visibile) —— */
.site-bg-audio {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Footer / Contact —— */
.site-footer {
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--color-gold-soft);
  text-align: center;
  color: var(--color-cream-muted);
  font-size: 0.9rem;
}

.site-footer strong {
  color: var(--color-cream);
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.footer-meta {
  margin-top: 1rem;
  font-size: 0.8rem;
  opacity: 0.85;
}
