/* ============================================================
   TAKEAWAY — Font: Gill Sans self-hosted
   Percorso: /wp-content/themes/takeaway/assets/fonts/
   ============================================================ */

@font-face {
  font-family: 'Gill Sans';
  src: url('../fonts/Gill Sans.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gill Sans';
  src: url('../fonts/Gill Sans Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Gill Sans';
  src: url('../fonts/Gill Sans Medium.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gill Sans';
  src: url('../fonts/Gill Sans Medium Italic.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

/* ============================================================
   TAKEAWAY — Base
   Reset completo + defaults globali
   Sostituisce normalize.css e i CSS globali di _s 
   ============================================================ */

/* ── Box sizing ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Document ── */
html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden; /* previene scroll orizzontale globale */
}

/* ── Body ── */
body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  font-size: var(--text-body-md);
  font-weight: var(--fw-regular);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Headings — reset margini _s ── */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--fw-regular);
  font-size: inherit;
  line-height: inherit;
}

/* ── Paragrafi — reset margin-bottom _s ── */
p {
  margin: 0;
}

/* ── Link — reset colori _s ── */
a {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
}

a:visited {
  color: inherit;
}

a:hover,
a:focus,
a:active {
  color: inherit;
  outline: 0;
}

/* ── Liste — reset _s ── */
ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Figure ── */
figure {
  margin: 0;
}

/* ── Immagini ── */
img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
  border-style: none;
}

/* ── Tabelle ── */
table {
  border-collapse: collapse;
  width: 100%;
}

/* ── Form elements — reset _s ── */
button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
}

button {
  cursor: pointer;
  overflow: visible;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

textarea {
  overflow: auto;
  resize: vertical;
  width: 100%;
}

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box;
  padding: 0;
}

/* ── Main, details ── */
main    { display: block; }
details { display: block; }
summary { display: list-item; }

/* ── HR ── */
hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible;
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 0;
}

/* ── Pre / Code ── */
pre,
code,
kbd,
samp {
  font-family: monospace, monospace;
  font-size: 1em;
}

/* ── Sub / Sup ── */
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sub { bottom: -0.25em; }
sup { top: -0.5em; }

/* ── Hidden ── */
[hidden],
template {
  display: none;
}

/* ── Accessibility: screen reader only ── */
.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;
}

/* ── WordPress admin bar fix ── */
html.admin-bar body {
  padding-top: 32px;
}

@media screen and (max-width: 782px) {
  html.admin-bar body {
    padding-top: 46px;
  }
}

/* ── WordPress alignment utilities (manteniamo compatibilità) ── */
.alignleft  { float: left;  margin-right: 1.5em; margin-bottom: 1em; }
.alignright { float: right; margin-left: 1.5em;  margin-bottom: 1em; }
.aligncenter {
  clear: both;
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1em;
}

/* ── Accessibilità — Skip link ── */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 12px 24px;
  background: #fff;
  color: #000;
  font-family: var(--font, 'Gill Sans', sans-serif);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition: top 0.2s;
}

.skip-to-content:focus {
  top: 16px;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* ── Accessibilità — Focus visibile ── */
:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
  border-radius: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 4px;
}

/* Rimuovi outline solo quando non è focus da tastiera */
:focus:not(:focus-visible) {
  outline: none;
}

/* ── Screen reader only ── */
.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;
}
