/* ==========================================================================
   Artemide Shop — mondo visivo "Il Sigillo di Cera"
   Tutti i colori in OKLCH. Neutri caldi, mai croma zero. La tela non e' bianca.
   ========================================================================== */

/* --- Caratteri ----------------------------------------------------------- */
/* Vollkorn: contrasto basso e aste piene. Un didone (Bodoni) qui era la faccia
   sbagliata — i filetti sparivano e in piccolo il titolo diventava fragile.
   Un conio incide solchi di spessore costante, non capelli.
   Archivo: grottesca da lavoro, con asse di larghezza per i maiuscoletti
   spaziati che il marchio usa gia' in "APICOLTURA DAL 1922". */

@font-face {
  font-family: 'Vollkorn';
  src: url('../fonts/vollkorn-var.woff2') format('woff2-variations');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-var.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

/* --- Token --------------------------------------------------------------- */

:root {
  /* Neutri caldi — la base. Croma bassa ma mai zero. */
  --canvas:            oklch(98.5% 0.008 85);
  --surface:           oklch(96.5% 0.012 84);
  --surface-raised:    oklch(99.2% 0.006 86);
  --border-subtle:     oklch(91.0% 0.016 82);
  --border:            oklch(85.0% 0.022 80);

  /* Testo — bruno caldo, mai nero puro */
  --text:              oklch(26.0% 0.035 58);
  --text-secondary:    oklch(42.0% 0.030 62);
  --text-muted:        oklch(55.0% 0.028 70);

  /* Miele — il colore identitario */
  --honey:             oklch(72.0% 0.155 72);
  --honey-deep:        oklch(45.0% 0.120 60);
  --honey-wash:        oklch(94.0% 0.050 85);
  --gold:              oklch(84.0% 0.145 88);

  /* Cera e favo */
  --wax:               oklch(90.0% 0.060 90);
  --comb:              oklch(78.0% 0.090 85);
  --propoli:           oklch(32.0% 0.055 55);

  /* Bronzo del marchio: campionato dal logo originale (#846C48). E' piu' muto
     dell'oro dei token e va usato per il lettering istituzionale. */
  --bronze:            oklch(54.6% 0.060 77);
  --bronze-deep:       oklch(36.2% 0.041 84);

  /* Ceralacca: il materiale del sigillo. Ambra profonda, non rossa. */
  --seal:              oklch(58.0% 0.150 62);
  --seal-lit:          oklch(74.0% 0.160 74);
  --seal-shadow:       oklch(34.0% 0.100 52);

  /* Stati */
  --success:           oklch(58.0% 0.100 145);
  --warning:           oklch(75.0% 0.150 65);
  --danger:            oklch(55.0% 0.170 28);

  /* Superfici scure usate anche in tema chiaro, per le fasce immersive */
  --deep:              oklch(21.0% 0.030 58);
  --deep-text:         oklch(95.0% 0.014 85);

  /* Tipografia */
  --font-display: 'Vollkorn', 'Iowan Old Style', Georgia, serif;
  --font-ui: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Ritmo verticale unico su tutta la pagina */
  --step-0: 1rem;
  --step-1: 1.5rem;
  --step-2: 2.25rem;
  --step-3: 3.5rem;
  --step-4: 5.5rem;
  --step-5: 8rem;

  --measure: 68ch;
  --shell: 76rem;
  --radius: 0.25rem;

  /* Ombre: sempre offset + sfocatura. Un alone senza offset e' decorazione. */
  --shadow-near: 0 1px 2px oklch(26% 0.035 58 / 0.08), 0 2px 6px oklch(26% 0.035 58 / 0.06);
  --shadow-far:  0 6px 14px oklch(26% 0.035 58 / 0.10), 0 18px 40px oklch(26% 0.035 58 / 0.10);

  --ease-press: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas:          oklch(18.0% 0.020 62);
    --surface:         oklch(23.0% 0.025 60);
    --surface-raised:  oklch(27.0% 0.028 60);
    --border-subtle:   oklch(31.0% 0.030 60);
    --border:          oklch(38.0% 0.035 62);

    --text:            oklch(94.0% 0.014 85);
    --text-secondary:  oklch(80.0% 0.020 80);
    --text-muted:      oklch(66.0% 0.024 75);

    /* Al buio l'ambra torna leggibile come testo: si scambiano i ruoli. */
    --honey:           oklch(78.0% 0.150 75);
    --honey-deep:      oklch(88.0% 0.120 82);
    --honey-wash:      oklch(28.0% 0.045 65);
    --propoli:         oklch(14.0% 0.020 58);

    --bronze:          oklch(76.0% 0.070 80);
    --bronze-deep:     oklch(86.0% 0.050 84);

    --seal:            oklch(62.0% 0.155 64);
    --seal-lit:        oklch(80.0% 0.150 78);
    --seal-shadow:     oklch(26.0% 0.080 50);

    /* La fascia immersiva deve staccarsi dalla tela (18%), non sfumarci
       dentro: a 13% le due si leggevano come un unico campo bruno. */
    --deep:            oklch(9.5% 0.018 58);
    --deep-text:       oklch(94.0% 0.014 85);

    --shadow-near: 0 1px 2px oklch(8% 0.02 58 / 0.5), 0 2px 6px oklch(8% 0.02 58 / 0.4);
    --shadow-far:  0 6px 14px oklch(8% 0.02 58 / 0.5), 0 18px 40px oklch(8% 0.02 58 / 0.45);
  }
}

/* --- Reset misurato ------------------------------------------------------ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.6;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.018em;
  text-wrap: balance;
  margin: 0;
}

h1 { font-size: clamp(2.75rem, 1.6rem + 5vw, 6rem); }
h2 { font-size: clamp(2rem, 1.35rem + 2.8vw, 3.75rem); }
h3 { font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.85rem); }

p { margin: 0 0 var(--step-0); max-width: var(--measure); }

a { color: var(--honey-deep); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--honey-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--honey-wash); color: var(--text); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--step-0); top: -4rem; z-index: 100;
  background: var(--surface-raised); color: var(--text);
  padding: 0.7rem 1.1rem; border-radius: var(--radius);
  box-shadow: var(--shadow-far);
  transition: top 180ms var(--ease-press);
}
.skip-link:focus { top: var(--step-0); }

/* --- Impalcatura --------------------------------------------------------- */

.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin-inline: auto;
}

@media (max-width: 40rem) {
  .shell { width: min(100% - 1.75rem, var(--shell)); }
}

/* Etichetta incisa: i maiuscoletti spaziati del marchio.
   Non e' un occhiello sopra un titolo: marca dati e registri. */
.struck {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  font-stretch: 108%;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bronze);
}

/* --- Favo: la texture di fondo ------------------------------------------ */
/* Rilievo statico, disegnato una volta. La deriva lentissima e' l'unico
   movimento ambientale della pagina: una sola trasformazione compositata. */

.comb-field {
  position: absolute;
  inset: -25% -12%;
  pointer-events: none;
  overflow: hidden;
  -webkit-mask-image: radial-gradient(120% 90% at 70% 18%, black 0%, transparent 72%);
          mask-image: radial-gradient(120% 90% at 70% 18%, black 0%, transparent 72%);
}

/* Esagoni veri, non una griglia di triangoli: il contorno del favo arriva da
   una maschera SVG affiancabile, cosi' il colore resta un token e cambia da
   solo fra chiaro e scuro. */
.comb-field::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--comb);
  opacity: 0.28;
  --hex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34.64' height='60' viewBox='0 0 34.64 60'%3E%3Cg fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M17.32 0 L34.64 10 L34.64 30 L17.32 40 L0 30 L0 10 Z'/%3E%3Cpath d='M0 30 L17.32 40 L17.32 60 L0 70 L-17.32 60 L-17.32 40 Z'/%3E%3Cpath d='M34.64 30 L51.96 40 L51.96 60 L34.64 70 L17.32 60 L17.32 40 Z'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-image: var(--hex);
          mask-image: var(--hex);
  -webkit-mask-size: 34.64px 60px;
          mask-size: 34.64px 60px;
  -webkit-mask-repeat: repeat;
          mask-repeat: repeat;
  will-change: transform;
  animation: comb-drift 120s linear infinite;
}

@keyframes comb-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-34.64px, -60px, 0); }
}

/* La luce che attraversa il favo. E' il miele guardato in controluce: una
   sorgente morbida che scorre lentamente sulle celle. Un solo strato, una sola
   trasformazione compositata, nessun ridisegno per fotogramma. */
.comb-field::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -45%;
  width: 75%;
  height: 220%;
  background: radial-gradient(
    50% 32% at 50% 50%,
    oklch(from var(--gold) l c h / 0.55) 0%,
    oklch(from var(--gold) l c h / 0.22) 42%,
    transparent 72%
  );
  transform: rotate(-18deg);
  will-change: transform;
  animation: comb-light 34s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes comb-light {
  from { transform: translate3d(0, 0, 0) rotate(-18deg); }
  to   { transform: translate3d(115%, 6%, 0) rotate(-18deg); }
}

/* Sul fondo scuro la luce e' l'unica cosa che rende la cera credibile:
   piu' intensa, perche' ha meno da illuminare. */
@media (prefers-color-scheme: dark) {
  .comb-field::after {
    background: radial-gradient(
      50% 32% at 50% 50%,
      oklch(from var(--honey) l c h / 0.30) 0%,
      oklch(from var(--honey) l c h / 0.12) 42%,
      transparent 72%
    );
  }
}

@media (prefers-reduced-motion: reduce) {
  .comb-field::before,
  .comb-field::after { animation: none; }
}

/* --- Bottoni ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.95rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease-press), box-shadow 160ms var(--ease-press),
              background-color 160ms var(--ease-press);
}

.btn--primary {
  background: var(--honey);
  color: oklch(24% 0.04 58);
  box-shadow: var(--shadow-near);
}
.btn--primary:hover { background: var(--gold); box-shadow: var(--shadow-far); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0); box-shadow: var(--shadow-near); }

.btn--quiet {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--quiet:hover { border-color: var(--honey-deep); color: var(--honey-deep); }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none;
}

/* --- Testata ------------------------------------------------------------- */

.masthead {
  position: relative;
  z-index: 20;
  padding-block: var(--step-1);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--canvas);
}

.masthead__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--step-1);
}

.masthead__brand { display: inline-flex; align-items: center; text-decoration: none; }
.masthead__brand img { width: auto; height: clamp(2.4rem, 2rem + 1.4vw, 3.1rem); }

/* Il lettering del marchio e' nero: al buio serve la variante chiara. Sono due
   file distinti e non un filtro CSS, perche' invert() virava l'ape dal bronzo
   al blu. Il bronzo resta identico in entrambe. */
.masthead__brand .logo-chiaro { display: none; }

@media (prefers-color-scheme: dark) {
  .masthead__brand .logo-scuro { display: none; }
  .masthead__brand .logo-chiaro { display: block; }
}

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2rem); }
.nav ul { display: flex; gap: clamp(1rem, 2.2vw, 2rem); list-style: none; margin: 0; padding: 0; }
.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding-block: 0.4rem;
  border-bottom: 1px solid transparent;
}
.nav a:hover, .nav .current-menu-item > a { border-bottom-color: var(--honey); color: var(--honey-deep); }

.nav-toggle { display: none; }

@media (max-width: 52rem) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: transparent; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 0.6rem 0.9rem;
    font: inherit; font-size: 0.9rem; color: var(--text); cursor: pointer;
  }
  .nav {
    position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; align-items: stretch;
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-far);
    padding: var(--step-1);
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav ul { flex-direction: column; gap: 0.25rem; }
  .nav a { display: block; padding: 0.7rem 0; border-bottom: 1px solid var(--border-subtle); }
}

/* --- Chiusura ------------------------------------------------------------ */
/* Non un blocco scuro piatto: il favo e la luce continuano anche qui, e il
   sigillo torna in piccolo a chiudere la pagina. */

.colophon {
  position: relative;
  overflow: clip;
  background: var(--deep);
  color: var(--deep-text);
  padding-block: var(--step-4) var(--step-2);
  margin-top: var(--step-5);
}

.colophon .comb-field::before { opacity: 0.13; }
.colophon .comb-field::after { animation-duration: 46s; }

.colophon__inner { position: relative; z-index: 1; }

.colophon a { color: var(--gold); }

/* Il marchio di chiusura: sigillo a sinistra, dichiarazione di luogo accanto,
   separati dal resto da un filo di bronzo. */
.colophon__mark {
  display: flex;
  align-items: center;
  gap: var(--step-1);
  padding-bottom: var(--step-2);
  margin-bottom: var(--step-3);
  border-bottom: 1px solid oklch(from var(--bronze) l c h / 0.45);
}

.colophon__mark img {
  width: clamp(3.5rem, 7vw, 5.5rem);
  height: auto;
  flex: none;
  filter: drop-shadow(0 4px 10px oklch(8% 0.02 58 / 0.6));
}

.colophon__mark p {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 0.95rem + 0.6vw, 1.5rem);
  line-height: 1.35;
  color: var(--gold);
  max-width: 26ch;
}

.colophon__grid {
  display: grid;
  gap: var(--step-2);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  align-items: start;
}

.colophon h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  margin-bottom: var(--step-0);
}

.colophon p { color: oklch(from var(--deep-text) l c h / 0.88); }

.colophon .struck { color: var(--comb); }

.colophon__legal {
  margin-top: var(--step-3);
  padding-top: var(--step-1);
  border-top: 1px solid oklch(from var(--deep-text) l c h / 0.18);
  font-size: 0.85rem;
  color: oklch(from var(--deep-text) l c h / 0.72);
  display: flex; flex-wrap: wrap; gap: var(--step-1); justify-content: space-between;
}

.colophon address { font-style: normal; }

.colophon__menu { display: flex; flex-wrap: wrap; gap: var(--step-1); list-style: none; margin: 0; padding: 0; }

@media (max-width: 40rem) {
  .colophon__mark { flex-direction: column; align-items: start; text-align: start; }
}

/* --- Pagine interne ------------------------------------------------------ */

/* Fascia del titolo: porta il favo e la luce anche fuori dalla home, cosi' il
   mondo non si ferma al primo schermo. */
.page-band {
  position: relative;
  overflow: clip;
  padding-block: var(--step-4) var(--step-3);
  background:
    radial-gradient(80% 70% at 72% 10%, oklch(from var(--honey-wash) l c h / 0.7) 0%, transparent 60%),
    var(--canvas);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--step-3);
}

.page-band > .shell { position: relative; z-index: 1; }
.page-band .page-title { margin-bottom: 0; }
.page-band .struck { margin-bottom: var(--step-0); }

.stack-page { padding-block: 0 var(--step-4); }

.page-title {
  font-size: clamp(2.25rem, 1.6rem + 2.8vw, 4rem);
  margin-bottom: var(--step-2);
  max-width: 20ch;
}

.stack-page > .struck { margin-bottom: var(--step-0); }

.post-hero {
  margin: 0 0 var(--step-2);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-near);
}

/* Il corpo redazionale: 19 articoli importati dal vecchio sito, con markup
   ripulito ma non normalizzato. Le regole qui devono reggere HTML arbitrario. */
.prose { max-width: var(--measure); }

.prose > * + * { margin-top: var(--step-0); }
.prose h2 { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.25rem); margin-top: var(--step-2); }
.prose h3 { margin-top: var(--step-1); }
.prose h2 + *, .prose h3 + * { margin-top: 0.6rem; }

.prose img {
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  margin-block: var(--step-1);
}

.prose ul, .prose ol { padding-inline-start: 1.35rem; }
.prose li + li { margin-top: 0.35rem; }

.prose blockquote {
  margin: var(--step-1) 0;
  padding: var(--step-0) var(--step-1);
  background: var(--honey-wash);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.45;
}

.prose blockquote p:last-child { margin-bottom: 0; }

.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.prose th, .prose td { text-align: start; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border-subtle); }
.prose th { font-family: var(--font-ui); font-weight: 600; }

/* Le tabelle ereditate possono essere piu' larghe della colonna di lettura:
   scorrono dentro il proprio contenitore invece di allargare la pagina. */
.prose > table { display: block; overflow-x: auto; }

/* --- Paginazione --------------------------------------------------------- */

.pagination {
  margin-top: var(--step-3);
  padding-top: var(--step-1);
  border-top: 1px solid var(--border-subtle);
}

.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
}

.pagination .page-numbers:hover { border-color: var(--honey-deep); color: var(--honey-deep); }

.pagination .page-numbers.current {
  background: var(--honey);
  border-color: var(--honey);
  color: oklch(24% 0.04 58);
  font-weight: 600;
}
