/* ARCHIVE — panel, grid, cards, filters */
.archive-section { padding: 34px 0 24px; }
.archive-panel { border-radius: 28px; background: linear-gradient(180deg,var(--panel) 0%,var(--panel-2) 100%); color: var(--text-dark); border: 1px solid rgba(18,18,18,.08); padding: 22px; }
.archive-topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.archive-topbar-right { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.filter-btn-all { text-align: center; }
.archive-title { color: #111; font-family: Inter, system-ui, sans-serif; font-size: clamp(26px,2.8vw,38px); font-weight: 300; letter-spacing: -.03em; line-height: .96; white-space: nowrap; }
@media (max-width: 430px) { .archive-title { font-size: 26px; white-space: nowrap; } }
.randomshot-panel .archive-title { color: #111; white-space: normal; overflow-wrap: break-word; font-size: clamp(22px, 2.4vw, 32px); }
.archive-controls { display: flex; justify-content: flex-start; align-items: center; gap: 14px; margin-bottom: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-btn { white-space: nowrap; }
.filter-btn, .nsfw-toggle { appearance: none; font: inherit; font-size: 11px; padding: 7px 11px; border-radius: 999px; border: 1px solid rgba(18,18,18,.12); background: rgba(255,255,255,.55); color: #111; cursor: pointer; transition: transform .2s ease, background .2s ease, color .2s ease; }
.filter-btn:hover, .nsfw-toggle:hover { transform: translateY(-1px); }
.filter-btn.active, .nsfw-toggle.active { background: #111; color: #fff; border-color: #111; }
.nsfw-toggle { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px; margin-left: 0; padding: 7px 10px; width: 100%; }
.nsfw-toggle-text { font-size: 10px; letter-spacing: .06em; line-height: 1.4; }
.nsfw-line-1, .nsfw-line-2 { font-size: 10px; letter-spacing: .06em; line-height: 1.4; display: inline; }
.nsfw-desktop-only { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.nsfw-desktop-only .nsfw-line-1,
.nsfw-desktop-only .nsfw-line-2 { font-size: 10px; letter-spacing: .06em; line-height: 1.3; display: block; text-align: center; }
.nsfw-desktop-only .nsfw-icon { width: 24px; height: 24px; margin-top: 2px; }
.nsfw-mobile-only { display: none; font-size: 10px; letter-spacing: .06em; }
.nsfw-icon { width: 24px; height: 24px; flex-shrink: 0; }
.archive-grid { columns: 4 280px; column-gap: 14px; }
@media (max-width: 600px) {
  .archive-grid {
    columns: 2 auto !important;
    column-gap: 8px !important;
    display: block !important;
  }
}

/* ============================================================
   COMBO: Color Pop (saturate) + micro-zoom su card
   La rotazione organica è sull'img interno (overflow:hidden la taglia)
   randomshot-card esclusa — sfondo panel colorato, effetto indesiderato
   ============================================================ */
@media (hover: hover) and (pointer: fine) {
  .archive-card,
  .topshot-card {
    filter: brightness(0.87) saturate(0.85);
    transition: filter 0.40s ease;
    will-change: filter;
  }
  .archive-card:hover,
  .topshot-card:hover {
    filter: brightness(1.0) saturate(1.0);
  }

  .category-card {
    filter: brightness(0.88) saturate(0.85);
    transition: filter 0.4s ease;
  }
  .category-card:hover {
    filter: brightness(1.0) saturate(1.0);
  }

}

/* Micro-rotazione: regole img in patches.css — serve specificità su .progressive-img.high-ready */

/* ============================================================
   ARCHIVE CARD (sezione Portfolio)
   card-meta: titolo visibile al hover — no zoom, solo brightness
   ============================================================ */
.archive-card { position: relative; overflow: hidden; display: inline-block; width: 100%; margin: 0 0 14px; border-radius: 18px; background: #d9d0c4; border: 1px solid rgba(18,18,18,.07); cursor: pointer; }
.archive-card img { width: 100%; height: auto; display: block; }
.archive-card .card-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 34px 18px 18px; border-radius: 0 0 14px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
  opacity: 0; transform: translateY(4px);
  transition: opacity .55s ease, transform .55s ease;
}
.archive-card:hover .card-meta { opacity: 1; transform: translateY(0); }
.archive-card .card-title { font-size: 10px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.68); text-shadow: 0 1px 6px rgba(0,0,0,.32); }

/* card-meta e topshot-rank sopra progressive-img (z-index 1) */
:where(.archive-card, .category-card, .topshot-card, .randomshot-card) .card-meta,
.topshot-rank {
  z-index: 2;
}

/* NSFW */
.is-nsfw img { filter: blur(15px); transition: filter 1.4s ease; }
.is-nsfw:hover img { filter: blur(0); }
body.reveal-nsfw .is-nsfw img { filter: none; transition: filter 1.4s ease; }

.is-nsfw::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.22);
  z-index: 1;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.nsfw-overlay-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  text-align: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease;
  max-width: min(92%, 200px);
  padding: 0 8px;
}

.nsfw-overlay-panel {
  --nsfw-bracket: rgba(255, 255, 255, 0.36);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem 0.9rem;
  color: var(--nsfw-bracket);
  background: transparent;
}

.nsfw-eye {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.52);
  filter: drop-shadow(0 1px 10px rgba(0, 0, 0, 0.28));
}

.nsfw-overlay-title {
  margin: 0;
  font-family: var(--font-mono-a);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
  padding-left: 0.38em;
}

.nsfw-overlay-subtitle {
  margin: 0;
  font-family: var(--font-mono-a);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.24em;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.42);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.28);
  padding-left: 0.24em;
}

.is-nsfw:hover::before,
.is-nsfw:hover .nsfw-overlay-text,
body.reveal-nsfw .is-nsfw::before,
body.reveal-nsfw .is-nsfw .nsfw-overlay-text {
  opacity: 0;
}

/* ============================================================
   CATEGORIE — desktop (>= 769px)
   ============================================================ */
.selected-grid-wrap { position: relative; }
.selected-grid-categories { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }

.category-card { position: relative; overflow: hidden; background: #121212; border: 1px solid rgba(255,255,255,.07); cursor: pointer; aspect-ratio: 16/10; border-radius: 24px; }
.category-card img { width: 100%; height: 100%; object-fit: cover; }
.category-card.cat-0 img { object-position: center 30%; }
.category-card .card-meta { position: absolute; bottom: 16px; padding: 0; background: none; border: none; backdrop-filter: none; }
.category-card .card-title { font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 10px rgba(0,0,0,.42); line-height: 1.3; }

.category-card.cat-0 { clip-path: polygon(0 0,100% 0,100% calc(100% - var(--notch)),calc(100% - var(--notch)) calc(100% - var(--notch)),calc(100% - var(--notch)) 100%,0 100%); border-bottom-right-radius: 0; }
.category-card.cat-1 { clip-path: polygon(0 0,100% 0,100% 100%,var(--notch) 100%,var(--notch) calc(100% - var(--notch)),0 calc(100% - var(--notch))); border-bottom-left-radius: 0; }
.category-card.cat-2 { clip-path: polygon(0 0,calc(100% - var(--notch)) 0,calc(100% - var(--notch)) var(--notch),100% var(--notch),100% 100%,0 100%); border-top-right-radius: 0; }
.category-card.cat-3 { clip-path: polygon(0 var(--notch),var(--notch) var(--notch),var(--notch) 0,100% 0,100% 100%,0 100%); border-top-left-radius: 0; }

.category-card.cat-0 .card-meta, .category-card.cat-2 .card-meta { left: 18px; right: calc(var(--center-size) + 26px); text-align: left; }
.category-card.cat-1 .card-meta, .category-card.cat-3 .card-meta { right: 18px; left: calc(var(--center-size) + 26px); text-align: right; }

.center-mark {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: var(--center-size); height: var(--center-size);
  border-radius: 0; background: #0b0b0b; border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 4; box-shadow: 0 20px 36px rgba(0,0,0,.28);
}
.center-mark img { width: 70px; height: auto; filter: none; }

@media (max-width: 768px) {
  :root { --notch: 44px; --center-size: 86px; }
  .selected-grid-categories { gap: 8px; }
  .category-card { aspect-ratio: 4/5; border-radius: 16px; }
  .category-card.cat-0 img { object-position: center; }
  .category-card .card-title { font-size: 10px; letter-spacing: .18em; }
  .category-card.cat-0 .card-meta, .category-card.cat-2 .card-meta { left: 12px; right: calc(var(--center-size) + 16px); }
  .category-card.cat-1 .card-meta, .category-card.cat-3 .card-meta { right: 12px; left: auto; text-align: right; }
  .center-mark { width: var(--center-size); height: var(--center-size); }
  .center-mark img { width: 42px; }
}

@media (max-width: 430px) {
  :root { --notch: 34px; --center-size: 68px; }
  .category-card { aspect-ratio: 1/1; border-radius: 14px; }
  .category-card .card-title { font-size: 9px; letter-spacing: .14em; }
  .center-mark img { width: 34px; }
}

/* ============================================================
   TOP SHOTS / LATEST — griglia condivisa
   ============================================================ */
.topshots-section { padding: 10px 0; }
.geo-tagline { margin: 6px 0 0; font-size: 13px; font-weight: 300; line-height: 1.6; letter-spacing: .04em; color: rgba(246,242,234,.56); font-family: Inter, sans-serif; }
.topshots-grid { display: grid !important; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; }
.topshot-card { position: relative; overflow: hidden; border-radius: 14px; background: #d9d0c4; border: 1px solid rgba(18,18,18,.07); cursor: pointer; aspect-ratio: 1/1; }
.topshot-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.topshot-rank { position: absolute; bottom: 6px; left: 10px; font-size: clamp(42px, 5vw, 72px); font-weight: 800; line-height: 1; color: rgba(255,255,255,.18); letter-spacing: -.04em; text-shadow: 0 2px 8px rgba(0,0,0,.18); }

/* card-meta topshot: presente nel DOM ma nascosta (no titoli su questi blocchi) */
.topshot-card .card-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 10px 10px;
  border-radius: 0 0 14px 14px;
  opacity: 0;
  pointer-events: none;
}
.topshot-card .card-title {
  font-size: 10px; font-weight: 400;
  letter-spacing: .10em; text-transform: uppercase;
  color: rgba(255,255,255,.82);
}

/* NSFW topshot */
.is-nsfw.topshot-card img { filter: blur(15px); transition: filter 1.4s ease; }
.is-nsfw.topshot-card:hover img { filter: blur(0); transition: filter 1.4s ease; }
body.reveal-nsfw .is-nsfw.topshot-card img { filter: none; transition: filter 1.4s ease; }

.is-nsfw.topshot-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  z-index: 1;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease;
  border-radius: inherit;
}
.is-nsfw.topshot-card:hover::before,
.is-nsfw.topshot-card:hover .nsfw-overlay-text,
body.reveal-nsfw .is-nsfw.topshot-card::before,
body.reveal-nsfw .is-nsfw.topshot-card .nsfw-overlay-text {
  opacity: 0;
}

@media (max-width: 768px) {
  .topshots-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 8px; }
  .topshot-rank { font-size: 38px; }
}
@media (max-width: 430px) {
  .topshots-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}

/* ============================================================
   SPAZIATURA — Latest / Random shot / Top shots
   "abbassare leggermente" = margin-top su #latest
   "aumentare spaziatura tra essi" = margin-bottom aumentato
   ============================================================ */
.randomshot-section { padding: 10px 0; }

#latest     { margin-top: 48px;  margin-bottom: 36px; }
#randomshot {                    margin-bottom: 36px; }
#topshots   { margin-top: 0;     margin-bottom: 0;    }

/* ============================================================
   RANDOM SHOT OF THE DAY — nessun filtro brightness
   ============================================================ */
.randomshot-panel {
  background: #af8570;
  color: #111;
  border-radius: 26px;
  padding: 28px;
  border: 1px solid rgba(18,18,18,.08);
  display: flex;
  gap: 28px;
  align-items: center;
  box-shadow: 0 12px 32px rgba(0,0,0,.08);
}
@media (max-width: 768px) {
  .randomshot-panel { flex-direction: column; text-align: center; padding: 22px; gap: 20px; }
}
.randomshot-wrap {
  flex: 0 0 auto;
  width: clamp(320px, 42vw, 540px);
}
@media (max-width: 768px) {
  .randomshot-wrap { width: 100%; max-width: none; }
}
.randomshot-card {
  width: 100%;
  border-radius: 18px; overflow: hidden;
  cursor: pointer; position: relative;
  box-shadow: 0 12px 36px rgba(0,0,0,.18);
  border: 1px solid rgba(0,0,0,.08);
}
.randomshot-card::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 70px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.08);
  pointer-events: none;
  z-index: 5;
  border-radius: inherit;
}
.randomshot-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: unset;
}
.randomshot-section .eyebrow {
  color: #111;
  opacity: .72;
}

/* NSFW randomshot */
.is-nsfw.randomshot-card img { filter: blur(15px); transition: filter 1.4s ease; }
.is-nsfw.randomshot-card:hover img { filter: blur(0); }
body.reveal-nsfw .is-nsfw.randomshot-card img { filter: none; }

/* ============================================================
   SCROLL INDICATOR HERO
   ============================================================ */
.hero-scroll-indicator {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 6px; opacity: 1; transition: opacity .6s ease; pointer-events: none; animation: scrollPulse 2.4s ease-in-out infinite;
}
.hero-scroll-indicator span { font-size: 9px; letter-spacing: .28em; text-transform: uppercase; color: rgba(255,255,255,.60); font-family: Inter, sans-serif; }
.scroll-arrow { width: 16px; height: 16px; border-right: 1.5px solid rgba(255,255,255,.60); border-bottom: 1.5px solid rgba(255,255,255,.60); transform: rotate(45deg); }
@keyframes scrollPulse { 0%, 100% { transform: translateX(-50%) translateY(0); opacity: .65; } 50% { transform: translateX(-50%) translateY(7px); opacity: 1; } }

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
  position: fixed; bottom: 28px; right: 28px; z-index: 100; width: 44px; height: 44px; border-radius: 999px; background: rgba(18,18,18,.72); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(12px); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1; opacity: 0; transform: translateY(10px); transition: opacity .3s ease, transform .3s ease, background .2s ease; pointer-events: none;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: rgba(40,40,40,.9); }

/* ============================================================
   ARCHIVE PHOTO COUNT
   ============================================================ */
.archive-count {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted-dark); margin-bottom: 14px;
}

/* ============================================================
   FADE IN CARDS — triggered by IntersectionObserver
   ============================================================ */
.archive-card, .topshot-card {
  opacity: 0;
  transform: translateY(18px);
}
.archive-card.card-visible, .topshot-card.card-visible {
  animation: cardFadeIn 1.1s cubic-bezier(.16,1,.3,1) forwards;
}
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   VIGNETTATURA ESTETICA — topshot-card + category-card
   Stesso pattern del randomshot-card (::after, inset shadow).
   z-index: 1 — sopra immagine, sotto card-meta (z-index 2).
   ============================================================ */

.topshot-card::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 38px rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(255, 255, 255, .05);
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}

.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 52px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255, 255, 255, .05);
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}
