/* =============================================================================
   AGRICONSULT — header, logo del footer e menu mobile condivisi da tutte le pagine.
   Classi con prefisso .ac- (indipendenti dal resto del foglio di stile agriconsult.css).
   Logo: variante orizzontale di x1 (simbolo + nome) su fondo scuro.
   ============================================================================= */

@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-var.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --ac-h: 76px;
  --ac-pad: clamp(16px, 5vw, 88px);
  --ac-maxw: 1320px;
  --ac-ink: #141210;
  --ac-calce: #FAF7F1;
  --ac-oro: #F0B429;
  --ac-oro-chiaro: #F6C95A;
  --ac-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.ac-header {
  position: fixed; inset: 0 0 auto; z-index: 150;
  height: var(--ac-h);
  padding-inline: var(--ac-pad);
  color: var(--ac-calce);
  font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: linear-gradient(to bottom, rgba(20, 18, 16, .72), rgba(20, 18, 16, 0));
  transition: background-color .35s, box-shadow .35s;
}
.ac-header.is-solid,
.ac-header--solid {
  background: rgba(20, 18, 16, .92);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(250, 247, 241, .08);
}
.ac-header-inner { height: 100%; max-width: var(--ac-maxw); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }

.ac-brand { display: block; flex: none; line-height: 0; border-radius: 4px; }
.ac-brand img { display: block; height: 46px; width: auto; max-width: none; }

.ac-nav ul { display: flex; align-items: center; gap: .3rem 1.6rem; list-style: none; margin: 0; padding: 0; }
.ac-nav a {
  position: relative; display: inline-block;
  font-size: .92rem; font-weight: 500; line-height: 1.2; text-decoration: none;
  color: rgba(250, 247, 241, .82); transition: color .2s;
}
.ac-nav a:hover { color: #fff; }
.ac-nav a[aria-current="page"] { color: #fff; }
.ac-nav a[aria-current="page"]:not(.ac-nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 2px; border-radius: 2px; background: var(--ac-oro);
}
.ac-nav .ac-nav-cta { padding: .62rem 1.1rem; border-radius: 999px; background: var(--ac-oro); color: var(--ac-ink); font-weight: 600; }
.ac-nav .ac-nav-cta:hover { background: var(--ac-oro-chiaro); color: var(--ac-ink); }
.ac-nav .ac-nav-cta[aria-current="page"] { box-shadow: 0 0 0 2px var(--ac-ink), 0 0 0 4px var(--ac-oro); }
.ac-header a:focus-visible, .ac-header button:focus-visible { outline: 2px solid var(--ac-oro); outline-offset: 3px; }

.ac-nav-toggle {
  display: none; position: relative; flex: none;
  width: 46px; height: 46px; padding: 0;
  border: 1px solid rgba(250, 247, 241, .3); border-radius: 50%;
  background: transparent; color: var(--ac-calce); cursor: pointer;
}
.ac-nav-toggle-bar, .ac-nav-toggle-bar::before, .ac-nav-toggle-bar::after {
  position: absolute; left: 50%; width: 18px; height: 1.5px; margin-left: -9px;
  background: currentColor; content: ""; transition: transform .3s var(--ac-ease), background-color .2s;
}
.ac-nav-toggle-bar { top: 50%; }
.ac-nav-toggle-bar::before { top: -6px; left: 0; margin: 0; }
.ac-nav-toggle-bar::after { top: 6px; left: 0; margin: 0; }
.ac-nav-toggle[aria-expanded="true"] .ac-nav-toggle-bar { background: transparent; }
.ac-nav-toggle[aria-expanded="true"] .ac-nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); background: var(--ac-calce); }
.ac-nav-toggle[aria-expanded="true"] .ac-nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); background: var(--ac-calce); }

.ac-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* logo del footer (fondo scuro in tutte le pagine) */
.ac-footer-logo { display: block; width: 210px; max-width: 100%; height: auto; margin-bottom: .9rem; }
.ac-footer-tag { margin: 0 0 1rem; font: 500 .72rem/1.7 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .16em; text-transform: uppercase; color: rgba(250, 247, 241, .6); }

@media (max-width: 1080px) {
  .ac-nav ul { gap: .3rem 1.1rem; }
}
@media (max-width: 960px) {
  :root { --ac-h: 66px; }
  .ac-brand img { height: 36px; }
  .ac-nav-toggle { display: inline-block; }
  .ac-nav {
    position: fixed; inset: var(--ac-h) 0 auto 0; z-index: 149;
    max-height: calc(100vh - var(--ac-h)); overflow-y: auto;
    padding: 1rem var(--ac-pad) 1.6rem;
    background: rgba(20, 18, 16, .98);
    border-bottom: 1px solid rgba(250, 247, 241, .1);
    transform: translateY(-110%); visibility: hidden;
    transition: transform .35s var(--ac-ease), visibility .35s;
  }
  /* in apertura la visibilità è immediata (il focus può entrare subito nel menu), in chiusura segue lo scorrimento */
  .ac-nav.is-open { transform: none; visibility: visible; transition: transform .35s var(--ac-ease), visibility 0s; }
  .ac-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .ac-nav a { display: block; padding: .9rem 0; font-size: 1.1rem; color: var(--ac-calce); border-bottom: 1px solid rgba(250, 247, 241, .08); }
  .ac-nav a[aria-current="page"]:not(.ac-nav-cta) { color: var(--ac-oro); }
  .ac-nav a[aria-current="page"]:not(.ac-nav-cta)::after { left: auto; right: 0; top: 50%; bottom: auto; width: 8px; height: 8px; border-radius: 50%; transform: translateY(-50%); }
  .ac-nav .ac-nav-cta { margin-top: 1rem; text-align: center; border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ac-header, .ac-nav, .ac-nav-toggle-bar, .ac-nav-toggle-bar::before, .ac-nav-toggle-bar::after { transition: none !important; }
}
