/*
Theme Name: Agricola Tarantino
Theme URI: https://www.agricolatarantino.com
Author: DG Blend
Description: Tema a blocchi per Azienda Agricola Tarantino — apicoltura a Palermo. Palette miele, tipografia Fraunces/Inter, sezioni per Mielerie Aperte e feed social.
Version: 1.1.0
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: agricola-tarantino
*/

/* ---------- Tipografia (prevale su eventuali global styles
   salvati nel database da versioni precedenti del tema) ---------- */
body,
button,
input,
select,
textarea,
.wp-block-button__link {
  font-family: 'Lora', Georgia, serif;
}
h1, h2, h3, h4, h5, h6,
.wp-block-post-title,
.wp-block-site-title {
  font-family: 'Fraunces', Georgia, serif;
}

/* ---------- Utilità e componenti ---------- */

/* Badge nel hero */
.at-badge {
  display: inline-block;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  padding: .35rem 1rem;
  font-size: .85rem;
  letter-spacing: .03em;
  color: #fffdf9;
}
.at-hero .at-badge { margin-left: auto; margin-right: auto; width: fit-content; }

/* Card (mieli, news) */
.at-card {
  background: #fffdf9;
  border: 1px solid #f3ecdf;
  border-radius: 20px;
  padding: 2rem;
  height: 100%;
  transition: transform .2s, box-shadow .2s;
}
.at-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(61, 43, 31, .08);
}
.at-card h3 { margin-top: 0; }

/* Eyebrow */
.at-eyebrow {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .78rem !important;
  font-weight: 600;
  color: #c07f1d;
}

/* Banner Mielerie Aperte */
.at-ma-banner { border-radius: 24px; overflow: hidden; }
.at-ma-dates {
  background: #fffdf9;
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
}

/* Colonne social */
.at-social-col {
  background: #faf6ef;
  border: 1px solid #f3ecdf;
  border-radius: 20px;
  padding: 1.5rem;
  min-height: 280px;
}
.at-social-col iframe { border-radius: 12px; }

/* Mappa */
.at-map iframe {
  width: 100%;
  min-height: 320px;
  border: 0;
  border-radius: 20px;
}

/* Header ancorato in alto su desktop e mobile.
   Lo sticky va sul wrapper della template part (figlio diretto della
   pagina): applicato solo al gruppo interno non funzionerebbe, perché
   un elemento sticky scorre solo entro l'altezza del proprio genitore.
   Nota: niente backdrop-filter sull'header — crea un containing block
   che intrappola gli overlay position:fixed del blocco Navigation. */
header.wp-block-template-part,
.wp-site-blocks > header {
  position: sticky;
  top: 0;
  z-index: 100;
}
.at-header {
  background: #faf6ef;
  border-bottom: 1px solid #f3ecdf;
  z-index: 100;
}

/* Fallback difensivo: se per qualsiasi motivo l'hamburger non viene
   renderizzato e il menu resta espanso su mobile, le voci vanno a capo
   in modo ordinato invece di traboccare. */
@media (max-width: 599px) {
  .at-header .wp-block-navigation__container {
    flex-wrap: wrap;
    gap: .5rem 1rem;
    font-size: .9rem;
  }
}

/* Pulsante torna su: pillola con freccia ed etichetta */
.at-back-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1.15rem;
  border-radius: 999px;
  background: #e8a13c;
  color: #3d2b1f;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(61, 43, 31, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s, background .2s;
  transform: translateY(8px);
}
.at-back-top svg { flex: 0 0 auto; }
.at-back-top span { white-space: nowrap; display: inline; }
.at-back-top:hover { background: #c07f1d; color: #fffdf9; }
.at-back-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
html { scroll-behavior: smooth; }

/* Overlay menu mobile: scuro semitrasparente, compatto,
   pannello con angoli arrotondati leggermente staccato dai bordi */
.at-overlay {
  background: rgba(61, 43, 31, .92) !important;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  margin: .75rem;
  border-radius: 24px;
  overflow: hidden;
  min-height: 0;
  height: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
/* Contenuti ancorati in alto, niente distribuzione verticale:
   annulla eventuali centrature/espansioni del contenitore overlay di WP */
.at-overlay {
  justify-content: flex-start !important;
  align-content: flex-start !important;
}
.at-overlay > * {
  flex-grow: 0 !important;
  width: 100%;
}
.at-overlay .wp-block-separator {
  margin: 0;
  width: 60px;
}
.at-overlay,
.at-overlay a,
.at-overlay .wp-block-site-title a,
.at-overlay .wp-block-navigation-item__content {
  color: #faf6ef !important;
}
.at-overlay .wp-block-navigation-item__content:hover { color: #e8a13c !important; }
/* Pulsante di chiusura ben visibile */
.at-overlay .wp-block-navigation-overlay-close,
.at-overlay button {
  color: #faf6ef;
}

/* Navigazione */
.at-header .wp-block-navigation a { font-weight: 500; }
.at-header .wp-block-navigation a:hover { color: #c07f1d; }

/* Pulsanti */
.wp-element-button, .wp-block-button__link {
  transition: background .2s, color .2s;
}

/* Hero: pattern esagonale sottile */
.at-hero {
  position: relative;
  background-image:
    linear-gradient(160deg, #3d2b1f 0%, #5a3f28 60%, #c07f1d 130%);
}
.at-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16L28 0zm0 66l28 16v32l-28 16L0 114V82l28-16z' fill='none' stroke='%23ffffff' stroke-width='1'/%3E%3C/svg%3E");
  pointer-events: none;
}
.at-hero > * { position: relative; }

/* Footer */
.at-footer a { color: #e8a13c; }

/* Tipografia fluida titolo hero */
.at-hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); line-height: 1.15; }
