/* ==========================================================================
   ASGroup 2026 — Base: @font-face Satoshi, reset SCOPATO, tipografia
   IMPORTANTE (isolamento configuratore):
   - Tutto è scopato sotto .asgroup-theme (classe sul <body>).
   - I reset usano :where() => specificità 0 => le regole .asg-* del plugin
     vincono SEMPRE dentro #asg-configuratore-wrapper.
   - Le poche regole "aggressive" (img, button, a) escludono esplicitamente
     il sottoalbero del configuratore (.asg-plugin-container).
   - Nessun reset globale `*`. Nessun !important.
   ========================================================================== */

/* ---- Satoshi self-hosted (copia locale nel tema) ---- */
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/satoshi/Satoshi-Regular.woff2") format("woff2"),
       url("../fonts/satoshi/Satoshi-Regular.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/satoshi/Satoshi-Medium.woff2") format("woff2"),
       url("../fonts/satoshi/Satoshi-Medium.woff") format("woff");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/satoshi/Satoshi-Bold.woff2") format("woff2"),
       url("../fonts/satoshi/Satoshi-Bold.woff") format("woff");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---- box-sizing: stesso valore del plugin (border-box), nessun conflitto ---- */
.asgroup-theme,
.asgroup-theme *,
.asgroup-theme *::before,
.asgroup-theme *::after { box-sizing: border-box; }

/* ---- Reset elementi (specificità 0, esclude il DOM del configuratore) ---- */
.asgroup-theme :where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd):not(.asg-plugin-container *) {
  margin: 0;
}
.asgroup-theme :where(ul, ol):not(.asg-plugin-container *) {
  margin: 0; padding: 0; list-style: none;
}

/* ---- Tipografia base del tema ---- */
.asgroup-theme {
  font-family: var(--ag-font-sans);
  font-weight: var(--ag-fw-regular);
  font-size: var(--ag-fs-body);
  line-height: var(--ag-lh-normal);
  color: var(--ag-ink);
  background-color: var(--ag-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html { scroll-behavior: smooth; }
body.asgroup-theme { margin: 0; overflow-x: hidden; }

.asgroup-theme :where(h1, h2, h3, h4):not(.asg-plugin-container *) {
  font-weight: var(--ag-fw-bold);
  line-height: var(--ag-lh-tight);
  letter-spacing: var(--ag-tracking-tight);
  color: var(--ag-ink);
  text-wrap: balance;
}

.asgroup-theme :where(a):not(.asg-plugin-container *) {
  color: inherit;
  text-decoration: none;
  transition: color var(--ag-dur-fast) var(--ag-ease-standard);
}

.asgroup-theme :where(img, picture, video, svg):not(.asg-plugin-container *) {
  display: block;
  max-width: 100%;
  height: auto;
}

.asgroup-theme :where(button, input, select, textarea):not(.asg-plugin-container *) {
  font: inherit;
  color: inherit;
}
.asgroup-theme :where(button):not(.asg-plugin-container *) {
  cursor: pointer;
  background: none;
  border: none;
}

.asgroup-theme :where(strong, b):not(.asg-plugin-container *) { font-weight: var(--ag-fw-bold); }

/* ---- Accessibilità ---- */
.asgroup-theme :where(:focus-visible):not(.asg-plugin-container *) {
  outline: 2px solid var(--ag-accent);
  outline-offset: 2px;
  border-radius: 3px;
}
.ag-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--ag-z-modal);
  background: var(--ag-ink);
  color: var(--ag-on-ink);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--ag-radius-sm) 0;
}
.ag-skip-link:focus { left: 0; }

.ag-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
