/* Componenti WordPress-specifici, sopra il design system del mock (base.css) */

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus,
.skip-link:focus-visible {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: auto;
  height: auto;
  padding: .75rem 1rem;
  background: #1a1614;
  color: #faf8f5;
  z-index: 9999;
  text-decoration: none;
  border-radius: .5rem;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  width: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  word-wrap: normal !important;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  font-size: .9rem;
}
.breadcrumbs li + li::before {
  content: "/";
  margin-right: .5rem;
  opacity: .5;
}

.gr-contact .hp { display: none !important; }
.form-errors { background: #fff0f0; border-left: 4px solid #c0392b; padding: .75rem 1rem; border-radius: 4px; }
.form-success { background: #f0fff4; border-left: 4px solid #2ecc71; padding: .75rem 1rem; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Admin Edit Overlay — pulsanti "Modifica" sul front-end.
   Attivo solo se body ha .gr-can-edit (utente loggato con capability).
   Vedi inc/admin-edit-links.php.
   ============================================================ */

/* Visitatore anonimo: nessuna regola caricata effettivamente,
   le selettori che seguono richiedono .gr-can-edit. */

.gr-can-edit .gr-editable {
  position: relative;
}

.gr-can-edit .gr-edit {
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .65rem;
  background: var(--ink, #1a1614);
  color: var(--paper, #faf8f5);
  border-radius: 999px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: .68rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
  cursor: pointer !important; /* anti-override: forza il cursore "mano" in ogni caso */
  pointer-events: auto !important; /* anti-override: garantisce che il click arrivi al link */
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  /* Stato nascosto: visibility hidden anziché opacity:0 + pointer-events:none.
     Visibility nasconde e disabilita l'interazione in un colpo solo, ed è
     trasferibile via transizione. Niente più stati intermedi "vedo ma non
     clicco" che producevano cursore "non disponibile". */
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}
.gr-can-edit .gr-edit svg {
  width: 14px;
  height: 14px;
  pointer-events: none !important;
}
.gr-can-edit .gr-edit span {
  pointer-events: none !important;
}
/* Bersaglio nucleare: niente, MA proprio niente al mondo, può
   sovrascrivere il cursore "mano" e il click su questo link. */
.gr-can-edit a.gr-edit,
.gr-can-edit a.gr-edit:link,
.gr-can-edit a.gr-edit:visited {
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* Mostra il pulsante quando l'utente passa sopra la sezione,
   quando la sezione contiene un elemento con focus,
   o quando il bottone stesso riceve focus da tastiera. */
.gr-can-edit .gr-editable:hover > .gr-edit,
.gr-can-edit .gr-editable:focus-within > .gr-edit,
.gr-can-edit .gr-edit:focus-visible,
.gr-can-edit .gr-edit:hover {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear 0s;
}

/* Hover stato del bottone (colore accent) */
.gr-can-edit .gr-edit:hover,
.gr-can-edit .gr-edit:focus-visible {
  background: var(--accent, #b8541a);
  color: var(--paper, #faf8f5);
}

/* Bordo tratteggiato leggero sulla sezione in hover — feedback visivo */
.gr-can-edit .gr-editable:hover {
  outline: 1px dashed var(--accent, #b8541a);
  outline-offset: -4px;
}

/* Su sezioni scure (--ink) la pillola inverte */
.gr-can-edit .section--ink .gr-edit,
.gr-can-edit .gr-editable.is-dark .gr-edit {
  background: var(--paper, #faf8f5);
  color: var(--ink, #1a1614);
}

/* Touch: niente :hover funzionante → mostra sempre */
@media (hover: none) {
  .gr-can-edit .gr-edit {
    visibility: visible;
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Service pages (laboratori, ghostwriting, formazione professionale)
   Riusa il design system .service-hero + .section--ink/paper-2,
   aggiunge le card espanse per descrivere ogni corso/servizio.
   ============================================================ */

.services-list-expanded {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
@media (min-width: 860px) {
  .services-list-expanded { gap: var(--space-4); }
}

.service-card-expanded {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--rule);
}
.service-card-expanded:last-child { border-bottom: 1px solid var(--rule); }

.service-card-expanded .num {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}
.service-card-expanded h3 {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3.4vw, 1.95rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}
.service-card-expanded .lead {
  color: var(--ink);
  font-size: 1rem;
  margin: 0;
}
.service-card-expanded ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.95rem;
  display: grid;
  gap: 0.4rem;
}
.service-card-expanded .meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--rule);
}

@media (min-width: 860px) {
  .service-card-expanded {
    grid-template-columns: 80px 1fr;
    column-gap: var(--space-3);
  }
  .service-card-expanded .num { padding-top: 0.5rem; }
  /* Tutto tranne .num finisce nella colonna destra.
     Include paragrafi "link" generici e qualunque blocco aggiuntivo. */
  .service-card-expanded > *:not(.num) { grid-column: 2 / 3; }
}

/* CTA finale pagina servizio */
.service-cta {
  text-align: left;
}
.service-cta h2 { font-size: clamp(1.8rem, 5vw, 3.2rem); margin: 0 0 1rem; }
.service-cta .lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 var(--space-3); }
.service-cta a[href^="mailto:"] {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3.5vw, 2rem);
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.1rem;
  text-decoration: none;
  word-break: break-word;
}
.service-cta a[href^="mailto:"]:hover { color: var(--ink); border-color: var(--ink); }

/* ---- Service-page template (full-bleed) ---- */
.service-page-content { display: block; }

/* Riassicura color inheritance dentro section--ink anche se nidificata
   in .entry-content / .prose (alcuni page template lo wrappano). */
.service-page-content .section--ink,
.service-page-content .section--ink p,
.service-page-content .section--ink li,
.service-page-content .section--ink strong { color: var(--paper); }
.service-page-content .section--ink h2,
.service-page-content .section--ink h3 { color: var(--paper); }
.service-page-content .section--ink a:not(.btn) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Stessa attenzione per paper-2: il testo deve restare ink scuro */
.service-page-content .section--paper-2 p,
.service-page-content .section--paper-2 li { color: var(--ink); }

/* Sezioni del service-page hanno padding verticale generoso */
.service-page-content > section.section { padding: var(--space-5) 0; }
@media (min-width: 860px) {
  .service-page-content > section.section { padding: var(--space-6) 0; }
}

/* ---- Testimonials grid (pagina "Hanno scritto con me") ---- */
.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
@media (min-width: 720px) {
  .testimonials-grid { grid-template-columns: 1fr 1fr; gap: var(--space-3); }
}
@media (min-width: 1080px) {
  .testimonials-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.testimonial-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: var(--space-3);
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 4px;
  position: relative;
}
.testimonial-card::before {
  content: "\201C"; /* "left double quotation mark" */
  position: absolute;
  top: 8px;
  left: 14px;
  font-family: var(--serif);
  font-size: 3rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.4;
}
.testimonial-card__quote {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink);
  margin: 0;
  font-style: italic;
}
.testimonial-card__cite {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
  border-top: 1px solid var(--rule);
  padding-top: 0.8rem;
}
.testimonial-card__cite strong {
  color: var(--ink);
  letter-spacing: 0.06em;
}

/* ============================================================
   Menu principale con sub-menu (dropdown)
   ============================================================ */

/* Reset list dell'ul wrapper del menu principale */
.nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-3);
  align-items: center;
}
.nav__list > li {
  position: relative;
}
.nav__list > li > a {
  display: inline-block;
  padding: 0.4rem 0;
}
/* Indicatore "ha figli": piccola freccia "▾" */
.nav__list .menu-item-has-children > a::after {
  content: " ▾";
  font-size: 0.7em;
  color: var(--muted);
  margin-left: 0.2em;
  vertical-align: 1px;
}

/* Sotto-menu: nascosto, posizionato sotto, appare al hover/focus */
.nav .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  position: absolute;
  top: 100%;
  left: -1rem;
  min-width: 240px;
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 0s linear 140ms;
  z-index: 100;
}
.nav .sub-menu li { margin: 0; }
.nav .sub-menu a {
  display: block;
  padding: 0.6rem 1.2rem;
  font-size: 0.92rem;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
}
.nav .sub-menu a:hover,
.nav .sub-menu a:focus-visible {
  background: var(--paper-2);
  color: var(--accent);
}

/* Mostra il sub-menu quando il genitore è hover/focus oppure ha data-open */
.nav__list > li:hover > .sub-menu,
.nav__list > li:focus-within > .sub-menu,
.nav__list > li[data-open="true"] > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 140ms ease, transform 140ms ease, visibility 0s;
}

/* ============================================================
   Drawer mobile — sub-menu come accordion (sempre visibile)
   ============================================================ */
.drawer__list,
.drawer .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.drawer__list > li { border-top: 1px solid var(--rule); }
.drawer__list > li:last-child { border-bottom: 1px solid var(--rule); }
.drawer__list > li > a {
  display: block;
  padding: 1rem 0;
  font-family: var(--serif);
  font-size: 1.4rem;
}
.drawer .sub-menu {
  padding: 0 0 1rem 1rem;
  display: grid;
  gap: 0.4rem;
}
.drawer .sub-menu a {
  display: block;
  padding: 0.3rem 0;
  font-size: 0.95rem;
  color: var(--muted);
}
.drawer .sub-menu a:hover { color: var(--accent); }

/* ============================================================
   Brand logo — variante .brand--logo
   Sostituisce il .brand testuale con <img> del lockup
   "VR + Vania Russo Comunicazione".
   ============================================================ */
.brand.brand--logo {
  display: inline-flex;
  align-items: center;
  padding: 0; /* override del baseline gap del .brand testuale */
}
.brand.brand--logo img {
  display: block;
  height: 56px;          /* ~ stessa altezza visiva del .brand testuale */
  width: auto;           /* aspect ratio preservato */
  max-width: 220px;
}
@media (max-width: 700px) {
  .brand.brand--logo img { height: 44px; max-width: 160px; }
}
/* Drawer mobile: leggermente più piccolo per coerenza */
.drawer .brand.brand--logo img { height: 48px; }

/* Variante footer: lockup chiaro su sfondo ink */
.brand.brand--inverted img {
  height: auto;
  width: 200px;
  max-width: 100%;
  margin-bottom: 0.6rem;
  display: block;
}
@media (max-width: 700px) {
  .brand.brand--inverted img { width: 160px; }
}

/* ============================================================
   A11y: footer column headings & sidebar headings
   Semanticamente H2 (per heading-order WCAG 1.3.1), stilisticamente
   uguali agli H4/H5 originali del design system.
   ============================================================ */
.site-footer__heading {
  color: var(--accent-soft);
  margin-bottom: 1rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.article-aside__heading {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.8rem;
  font-weight: 400;
}
