/* ============================================================
   ARCHIVE PANEL — Redesign (frontispizio + control bar)
   Carica dopo portfolio.css per sovrascriverne il layout.
   Mantiene tutti gli ID e classi pubbliche
   (#archiveCount, #filters, .filter-btn, .nsfw-toggle, .archive-grid)
   per non rompere script.js.
   ============================================================ */

/* ---- Panel base ---- */
.archive-panel {
  padding: 0;                              /* il padding ora vive nei sotto-blocchi */
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  color: var(--text-dark);
  border: 1px solid rgba(18, 18, 18, .08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .18);
}

/* ============================================================
   FRONTISPIECE — sostituisce la vecchia topbar a due colonne
   ============================================================ */
.archive-topbar {
  display: block;
  text-align: center;
  padding: 72px 32px 36px;
  margin-bottom: 0;
}
.archive-topbar > div { width: 100%; }       /* annulla il vecchio flex layout */
.archive-topbar-right { display: none; }     /* non serve più: All e NSFW migrano */

/* Dot rame come "incipit" del frontispizio */
.archive-topbar > div::before {
  content: "";
  display: block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent, #af8570);
  margin: 0 auto 28px;
}

/* Eyebrow — mono, tracciato, sobrio */
.archive-topbar .eyebrow,
.archive-topbar .eyebrow-dark {
  font-family: var(--font-mono-a);
  font-size: 10.5px;
  letter-spacing: .32em;
  text-transform: uppercase;
  font-weight: 400;
  color: rgba(17, 17, 17, .62);
  margin: 0 0 32px;
  text-align: center;
}

/* PORTFOLIO — Inter 200 uppercase tracciato (logotipo) */
.archive-title {
  font-family: var(--font-sans);
  font-weight: 200;
  font-size: clamp(38px, 7vw, 96px);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #111;
  line-height: 1;
  white-space: nowrap;
  text-indent: .24em;                      /* compensa il tracking per il centro ottico */
  margin: 0;
}

/* ============================================================
   TOPSHOTS / LATEST + RANDOMSHOT — override frontispiece
   Testate di sezione: compatte, allineate a sinistra,
   eyebrow colore accento, senza dot da copertina.
   ============================================================ */

.topshots-section .archive-topbar,
.randomshot-section .archive-topbar {
  padding: 32px 28px 12px;
  text-align: left;
}

.topshots-section .archive-grid {
  padding-top: 14px;
}

.topshots-section .archive-topbar > div::before,
.randomshot-section .archive-topbar > div::before {
  display: none;
}

.topshots-section .archive-topbar .eyebrow,
.topshots-section .archive-topbar .eyebrow-dark,
.randomshot-section .archive-topbar .eyebrow,
.randomshot-section .archive-topbar .eyebrow-dark {
  color: #af8570;
  margin: 0 0 10px;
  text-align: left;
}

.topshots-section .archive-title,
.randomshot-section .archive-title {
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: .18em;
  text-indent: 0;
  white-space: nowrap;
}

/* Parent del topbar deve fare da contesto per il mese assoluto */
.topshots-section .archive-topbar > div,
.randomshot-section .archive-topbar > div {
  position: relative;
}

/* Mese — fuori dal flusso verticale: stessa altezza topbar di Just added */
.topshots-month {
  position: absolute;
  right: 0;
  bottom: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-family: var(--font-mono-a);
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(17, 17, 17, .38);
  line-height: 1;
}
.topshots-month svg {
  opacity: .45;
  flex-shrink: 0;
}

/* archive-count spostato nel foot — azzero stili da frontespizio */
.archive-foot .archive-count {
  margin: 0;
  text-align: right;
  font-size: 9.5px;
  letter-spacing: .22em;
}

/* MMXXVI — sub-line ancora più sottile */
.archive-roman {
  font-family: var(--font-sans);
  font-weight: 200;
  font-size: clamp(18px, 2.6vw, 32px);
  letter-spacing: .42em;
  text-transform: uppercase;
  color: rgba(17, 17, 17, .62);
  line-height: 1;
  text-indent: .42em;
  margin: 22px 0 0;
  text-align: center;
}

/* Count dinamica + nome filtro attivo */
.archive-count {
  margin: 30px 0 0;
  padding: 0;                              /* annullo eventuale padding ereditato */
  font-family: var(--font-mono-a);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(17, 17, 17, .42);
  font-weight: 400;
  text-align: center;
}
.archive-count .num {
  color: #111;
  font-weight: 500;
}
.archive-count-sep {
  margin: 0 .6em;
  color: var(--accent, #af8570);
  opacity: .55;
}

/* ============================================================
   CONTROL BAR — sostituisce .archive-controls
   ============================================================ */
.archive-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 32px;
  margin-bottom: 0;
  border-top: 1px solid rgba(17, 17, 17, .18);
  border-bottom: 1px solid rgba(17, 17, 17, .18);
}

/* Filter row — indice editoriale, non più chip */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;                                  /* spazi gestiti dai separatori */
  row-gap: 6px;                            /* aria verticale quando wrappa */
}

.filter-btn,
.filter-btn-all {
  appearance: none;
  font-family: var(--font-mono-a);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  background: none;
  border: none;
  border-radius: 0;
  padding: 6px 0;
  color: rgba(17, 17, 17, .42);
  cursor: pointer;
  transition: color .25s ease;
  position: relative;
  white-space: nowrap;
}
.filter-btn:hover,
.filter-btn-all:hover {
  color: #111;
  transform: none;
  background: none;
}
.filter-btn::after,
.filter-btn-all::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 1px;
  height: 1px;
  background: #111;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .35s cubic-bezier(.2, .7, .1, 1);
}
.filter-btn.active,
.filter-btn-all.active {
  color: #111;
  font-weight: 500;
  background: none;
  border-color: transparent;
}
.filter-btn.active::after,
.filter-btn-all.active::after {
  transform: scaleX(1);
}

/* Separatore puntato tra filtri */
.filter-sep {
  display: inline-block;
  color: var(--accent, #af8570);
  opacity: .5;
  margin: 0 14px;
  font-family: var(--font-mono-a);
  font-size: 10.5px;
  user-select: none;
  pointer-events: none;
  align-self: center;
}

/* ============================================================
   NSFW TOGGLE — pallino mono, niente icona
   ============================================================ */
.nsfw-toggle {
  appearance: none;
  background: none;
  border: none;
  border-radius: 0;
  padding: 6px 0;
  width: auto;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono-a);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(17, 17, 17, .62);
  font-weight: 400;
  cursor: pointer;
  transition: color .25s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;   /* via il flash nero al tap su mobile */
  outline: none;                              /* via il ring di default del browser */
}
.nsfw-toggle:focus { outline: none; }
.nsfw-toggle:focus-visible {                  /* outline solo da tastiera, mai dal click */
  outline: 1px solid rgba(17, 17, 17, .25);
  outline-offset: 4px;
}
.nsfw-toggle:hover {
  color: #111;
  transform: none;
}
.nsfw-toggle.active {
  color: #111;
  background: none;             /* override portfolio.css: .nsfw-toggle.active { background: #111 } */
  border-color: transparent;    /* idem */
}

/* Nascondo i vecchi figli (icona, righe Reveal/NSFW desktop, span mobile) */
.nsfw-toggle .nsfw-desktop-only,
.nsfw-toggle .nsfw-mobile-only,
.nsfw-toggle .nsfw-icon,
.nsfw-toggle .nsfw-line-1,
.nsfw-toggle .nsfw-line-2 {
  display: none !important;
}

/* I nuovi figli */
.nsfw-toggle .nsfw-label {
  display: inline-block;
  font-weight: 400;
}
/* Occhio SVG (rimpiazza il vecchio .nsfw-dot) — stessa famiglia di icone dell'overlay sulle card */
.nsfw-toggle .nsfw-toggle-eye {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: rgba(17, 17, 17, .68);
  transition: color .25s ease;
}
.nsfw-toggle:hover .nsfw-toggle-eye { color: #111; }

.nsfw-toggle .nsfw-toggle-eye-slash {
  transition: opacity .3s ease;
  opacity: 1;                              /* slash visibile = NSFW nascosto */
}
.nsfw-toggle.active .nsfw-toggle-eye-slash {
  opacity: 0;                              /* slash via = NSFW visibile */
}
.nsfw-toggle.active .nsfw-toggle-eye {
  color: var(--accent, #af8570);
}
.nsfw-toggle .nsfw-state {
  color: rgba(17, 17, 17, .42);
  font-weight: 400;
  transition: color .25s ease;
}
.nsfw-toggle.active .nsfw-state { color: #111; }

/* ============================================================
   GRID — padding del wrapper, le card restano come prima
   ============================================================ */
.archive-grid {
  padding: 28px 22px;
  columns: 4 280px;
  column-gap: 14px;
}

/* ============================================================
   FOOT — chiude il pannello come una quarta di copertina
   ============================================================ */
.archive-foot {
  border-top: 1px solid rgba(17, 17, 17, .10);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono-a);
  font-size: 9.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(17, 17, 17, .42);
  font-weight: 400;
}
.archive-foot b {
  color: rgba(17, 17, 17, .62);
  font-weight: 500;
}

/* ============================================================
   Card meta — mono uppercase su hover
   ============================================================ */
.archive-card .card-title {
  font-family: var(--font-mono-a);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .82);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  line-height: 1.3;
}

/* ============================================================
   MOBILE — compattazione progressiva
   768 → 540 → 380
   ============================================================ */
@media (max-width: 768px) {
  .archive-topbar { padding: 52px 18px 24px; }
  .archive-topbar > div::before { margin-bottom: 22px; }

  .archive-topbar .eyebrow,
  .archive-topbar .eyebrow-dark {
    font-size: 9.5px;
    letter-spacing: .26em;
    margin-bottom: 24px;
  }
  .archive-title {
    font-size: clamp(32px, 9.5vw, 56px);
    letter-spacing: .18em;
    text-indent: .18em;
  }
  .archive-roman {
    font-size: clamp(15px, 4.4vw, 22px);
    letter-spacing: .34em;
    text-indent: .34em;
    margin-top: 18px;
  }
  .archive-count {
    margin-top: 22px;
    font-size: 10px;
    letter-spacing: .14em;
    line-height: 1.6;
  }
  .archive-count-sep { margin: 0 .4em; }

  /* Control bar a colonna: filtri sopra, NSFW sotto */
  .archive-controls {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 18px;
  }
  .filters {
    justify-content: flex-start;
    row-gap: 4px;
  }
  .filter-btn,
  .filter-btn-all,
  .nsfw-toggle {
    font-size: 10.5px;
    letter-spacing: .14em;
    padding: 8px 0;                      /* tap target più alto */
  }
  .filter-sep { margin: 0 10px; }

  .archive-grid { padding: 20px 12px; }

  .archive-foot {
    flex-direction: column;
    gap: 6px;
    padding: 14px 18px 16px;
    font-size: 9px;
    letter-spacing: .22em;
    text-align: center;
  }
}

@media (max-width: 540px) {
  .archive-topbar { padding: 44px 16px 22px; }

  .archive-title {
    font-size: clamp(28px, 10vw, 44px);
    letter-spacing: .14em;
    text-indent: .14em;
  }
  .archive-roman {
    font-size: clamp(13px, 4vw, 18px);
    letter-spacing: .28em;
    text-indent: .28em;
  }
  .archive-count {
    font-size: 9.5px;
    letter-spacing: .12em;
  }
  .filter-sep { margin: 0 8px; }
  .filter-btn,
  .filter-btn-all,
  .nsfw-toggle {
    font-size: 10px;
    letter-spacing: .12em;
  }
}

@media (max-width: 380px) {
  .archive-title {
    font-size: 26px;
    letter-spacing: .12em;
    text-indent: .12em;
  }
  .archive-roman {
    font-size: 13px;
    letter-spacing: .24em;
    text-indent: .24em;
  }
  .filter-sep { margin: 0 6px; }
}
