/*
Theme Name: AS Theme 8
Theme URI: https://albertosolazzo.it
Author: Dr. Alberto Solazzo
Description: Struttura del sito: testata, menu, piè di pagina e pulsante "torna su". Nessuno stile di pagina: ogni pagina porta il suo CSS dentro il proprio HTML.
Version: 8.8
Text Domain: as-theme
*/

/* I colori e i caratteri qui servono solo a testata, menu e piè di pagina. */
:root {
  --t-sfondo:    #FDFAF6;
  --t-testo:     #1A1A18;
  --t-primario:  #1E3A2F;
  --t-oro:       #B8955A;
  --t-oro-rgb:   184, 149, 90;
  --t-serif:     'Cormorant Garamond', Georgia, serif;
  --t-sans:      'DM Sans', system-ui, sans-serif;
  --t-testata-h: 68px;
  --t-larghezza: 1200px;

  /* La cornice del sito (testata, menu per telefono, piè di pagina). Un articolo con una grafica propria cambia queste variabili
     con una riga (body { --as-cornice-sfondo: ...; }) e non riscrive mai le classi della testata o del piede. */
  --as-cornice-sfondo:      var(--t-primario);
  --as-cornice-bordo:       rgba(var(--t-oro-rgb), 0.2);
  --as-cornice-testo:       rgba(255, 255, 255, 0.72);
  --as-cornice-testo-tenue: rgba(255, 255, 255, 0.45);
  --as-cornice-accento:     var(--t-oro);
  --as-cornice-font:        var(--t-sans);

  /* Nomi usati da pagine e plugin già esistenti (il funnel «consulenza-relazioni-uomo», AS Creator): non si perdono */
  --sans:     var(--t-sans);
  --serif:    var(--t-serif);
  --header-h: var(--t-testata-h);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip; /* clip e non hidden: mantiene la testata sticky */
}

body {
  margin: 0;
  font-family: var(--t-sans);
  background: var(--t-sfondo);
  color: var(--t-testo);
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a      { color: inherit; text-decoration: none; }
img    { max-width: 100%; display: block; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button { cursor: pointer; border: none; background: none; padding: 0; font-family: inherit; }

.as-main {
  flex: 1;
  width: 100%;
  max-width: var(--t-larghezza);
  margin: 0 auto;
  background: var(--t-sfondo);
}

/* Le pagine sono blocchi HTML: WordPress non deve aggiungere margini intorno */
.entry-content, .wp-block-group, .wp-block-html { max-width: none; margin: 0; padding: 0; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--t-oro);
  color: var(--t-primario);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ── TESTATA ─────────────────────────────────────────────── */
.as-header {
  position: sticky;
  top: 0;
  z-index: 500;
  width: 100%;
  max-width: var(--t-larghezza);
  margin: 0 auto;
  background: var(--as-cornice-sfondo);
  border-bottom: 1px solid var(--as-cornice-bordo);
}
.as-header-inner {
  padding: 0 40px;
  height: var(--t-testata-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.as-logo { display: flex; align-items: center; flex-shrink: 0; transition: opacity 0.2s; }
.as-logo:hover { opacity: 0.75; }

/* ── MENU (computer) ─────────────────────────────────────── */
.as-nav-list { display: flex; align-items: center; gap: 32px; }
.as-nav-list a {
  font-family: var(--as-cornice-font);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--as-cornice-testo);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.as-nav-list a:hover,
.as-nav-list .current-menu-item > a,
.as-nav-list .current-menu-ancestor > a {
  color: var(--as-cornice-accento);
  border-bottom-color: var(--as-cornice-accento);
}
/* un livello di sottomenu */
.as-nav-list .menu-item-has-children { position: relative; }
.as-nav-list .menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  margin-left: 8px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: translateY(-2px) rotate(45deg);
}
.as-nav-list .sub-menu {
  position: absolute;
  top: 100%;
  left: -16px;
  min-width: 240px;
  padding: 10px 0;
  background: var(--as-cornice-sfondo);
  border: 1px solid var(--as-cornice-bordo);
  display: none;
}
.as-nav-list .is-open > .sub-menu { display: block; }
.as-nav-list .sub-menu a { display: block; padding: 10px 20px; border: 0; white-space: nowrap; }

/* ── HAMBURGER E MENU (telefono) ─────────────────────────── */
.as-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  touch-action: manipulation;
}
.as-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--as-cornice-testo);
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
}
.as-hamburger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.as-hamburger.is-open span:nth-child(2) { opacity: 0; }
.as-hamburger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.as-overlay {
  position: fixed;
  inset: var(--t-testata-h) 0 0 0;
  background: rgba(10, 20, 15, 0.55);
  z-index: 400;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}
.as-overlay.is-open { opacity: 1; visibility: visible; }

.as-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(360px, 92vw);
  background: var(--as-cornice-sfondo);
  z-index: 600;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 1px solid var(--as-cornice-bordo);
}
.as-drawer.is-open { transform: translateX(0); }
.as-drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: var(--t-testata-h);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.as-drawer-close {
  width: 44px; height: 44px;
  font-size: 18px;
  color: var(--as-cornice-testo);
}
.as-drawer-close:hover { color: var(--t-oro); }
.as-drawer-list { flex: 1; padding: 28px 0; overflow-y: auto; }
.as-drawer-list a {
  display: block;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--as-cornice-testo);
  padding: 14px 20px;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.as-drawer-list a:hover,
.as-drawer-list .current-menu-item > a {
  color: var(--t-oro);
  border-left-color: var(--t-oro);
}
.as-drawer-list .menu-item-has-children > a::after {
  content: '+';
  float: right;
  font-size: 18px;
  line-height: 1;
}
.as-drawer-list .menu-item-has-children.is-open > a::after { content: '\2212'; }
.as-drawer-list .sub-menu { display: none; }
.as-drawer-list .is-open > .sub-menu { display: block; }
.as-drawer-list .sub-menu a { font-size: 13px; padding: 11px 20px 11px 36px; }
.as-drawer-fine {
  padding: 20px 28px 32px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--as-cornice-testo-tenue);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ── PIÈ DI PAGINA ───────────────────────────────────────── */
.as-footer {
  width: 100%;
  max-width: var(--t-larghezza);
  margin: 0 auto;
  background: var(--as-cornice-sfondo);
  border-top: 1px solid var(--as-cornice-bordo);
  padding: 24px 40px;
}
.as-footer-inner {
  font-family: var(--as-cornice-font);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.as-footer a { color: var(--as-cornice-testo-tenue); transition: color 0.2s; }
.as-footer a:hover { color: var(--as-cornice-accento); }
.as-footer-privacy { text-align: center; }
.as-footer-copy {
  text-align: right;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.04em;
  color: var(--as-cornice-testo-tenue);
  white-space: nowrap;
}

/* ── TORNA SU (solo telefono) ────────────────────────────── */
.as-su {
  position: fixed;
  right: 15px;
  bottom: 15px;
  width: 44px; height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--t-oro);
  border-radius: 50%;
  color: var(--t-oro);
  z-index: 450;
  opacity: 0;
  visibility: hidden;
  transform: translateY(40px);
  transition: opacity 0.4s, transform 0.4s, visibility 0.4s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}
.as-su.is-visible { opacity: 1; visibility: visible; transform: none; }

/* ── ELENCHI (categorie, tag, ricerca) ───────────────────── */
.as-elenco { max-width: 760px; margin: 0 auto; padding: 64px 24px; }
.as-elenco-t { font-family: var(--t-serif); font-size: clamp(32px, 5vw, 52px); font-weight: 300; color: var(--t-primario); margin: 0 0 32px; }
.as-elenco-l li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(var(--t-oro-rgb), 0.3); }
.as-elenco-l a { font-size: 18px; color: var(--t-primario); }
.as-elenco-l a:hover { color: var(--t-oro); }
.as-elenco-l span { font-size: 13px; color: #8A8A82; white-space: nowrap; }
.as-elenco .navigation { margin-top: 32px; text-align: center; }
.as-elenco .page-numbers { padding: 6px 10px; }

/* ── 404 ─────────────────────────────────────────────────── */
.as-404 {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
}
.as-404 h1 {
  font-family: var(--t-serif);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 300;
  color: var(--t-primario);
  margin: 0 0 16px;
}
.as-404 p { max-width: 440px; line-height: 1.8; color: #4A4A44; margin: 0 0 32px; }
.as-404 a {
  background: var(--t-primario);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 15px 32px;
  border-radius: 2px;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 899px) {
  .as-header-inner { padding: 0 20px; }
  .as-nav          { display: none; }
  .as-hamburger    { display: flex; }
  .as-su           { display: flex; }
  .as-footer       { padding: 16px 20px; }
  .as-footer-inner { grid-template-columns: auto 1fr auto; gap: 12px; }
  .as-footer-copy  { font-size: 12px; }
}

/* La voce «Accedi» (poi «Profilo»): una persona prima della parola. Icone Tabler (MIT). La classe la mette il plugin Gestione Studio. */
.as-nav-list .preno-voce-accesso > a,
.as-drawer-list .preno-voce-accesso > a { display: inline-flex; align-items: center; gap: 8px; }
.as-drawer-list .preno-voce-accesso > a { display: flex; }
.preno-voce-accesso > a::before {
  content: ''; flex: none; width: 16px; height: 16px; background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0'/%3E%3Cpath d='M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0'/%3E%3Cpath d='M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.preno-voce-accesso > a[data-preno-nav]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0'/%3E%3Cpath d='M6 21v-2a4 4 0 0 1 4 -4h4'/%3E%3Cpath d='M15 19l2 2l4 -4'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0'/%3E%3Cpath d='M6 21v-2a4 4 0 0 1 4 -4h4'/%3E%3Cpath d='M15 19l2 2l4 -4'/%3E%3C/svg%3E");
}


/* AS Articoli: palette di albertosolazzo.it sulle variabili del plugin (nel plugin i colori sono neutri) */
body {
  --asa-testata:#1E3A2F; --asa-testo-testata:#F7F3EE; --asa-sfondo:#F7F3EE; --asa-scheda:#FDFAF6; --asa-bordo:#E2DBD0;
  --asa-testo:#1A1A18; --asa-tenue:#6f6f68; --asa-accento:#1E3A2F; --asa-pulsante:#B85530; --asa-testo-pulsante:#fff;
  --asa-fondo:#1E3A2F; --asa-testo-fondo:#F7F3EE;
}
/* AS Articoli, layout degli articoli: palette e caratteri del sito */
body {
  --asa-serif:'Cormorant Garamond',Georgia,serif; --asa-sans:'DM Sans',system-ui,sans-serif;
  --asa-primario:#1E3A2F; --asa-oro:#B8955A; --asa-crema:#F5EDD8; --asa-sezione:#F7F3EE; --asa-carta:#FDFAF6; --asa-testo2:#4A4A44;
}
.asa-pagina, .asa-chiusura { font-family:'DM Sans',sans-serif; }
.asa-testata h1, .asa-titolo, .asa-fondo p, .asa-chiusura h2 { font-family:'Cormorant Garamond',serif; }
.asa-testata h1 { font-size:2.4rem; }
.asa-titolo { font-size:1.45rem; }

/* La testata resta sticky anche se il codice di un articolo scrive body{overflow-x:hidden} (specificità più alta, vale per ogni articolo, anche quelli scritti da un LLM) */
html body { overflow-x: clip; overflow-y: visible; }
