/* ============================================================
   Catalog page styles — loaded in addition to styles.css
   ============================================================ */

.cat-page { padding-top: 80px; }

.cat-header {
  padding: 60px 0 80px;
  border-bottom: 1px solid var(--rule);
}
.cat-back {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color .3s ease;
}
.cat-back:hover { color: var(--accent); }
.cat-title {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: clamp(56px, 10vw, 148px);
  line-height: 0.9;
  letter-spacing: -0.025em;
  margin-top: 12px;
}
.cat-title em { font-style: italic; color: var(--accent); }
.cat-intro {
  max-width: 560px;
  margin-top: 32px;
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.65;
}

.cat-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: end;
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--rule);
}
.cat-tabs {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.cat-tab {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  position: relative;
  color: var(--ink-3);
  transition: color .3s ease;
}
.cat-tab::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s cubic-bezier(.7,0,.2,1);
}
.cat-tab.is-active { color: var(--ink); }
.cat-tab.is-active::after { transform: scaleX(1); }
.cat-tab:hover { color: var(--ink); }
.cat-tab-label {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 26px;
  letter-spacing: -0.01em;
}
.cat-tab-count {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

.cat-search { display: grid; gap: 6px; min-width: 260px; }
.cat-search label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.cat-search input {
  font: inherit;
  font-family: var(--ff-display);
  font-size: 18px;
  padding: 8px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  outline: none;
  transition: border-color .3s ease;
}
.cat-search input:focus { border-bottom-color: var(--accent); }
.cat-search input::placeholder { color: var(--ink-3); font-style: italic; }

.cat-filters {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 0 0;
  flex-wrap: wrap;
}
.cat-filters-label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.cat-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cat-chip {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-3);
  cursor: pointer;
  transition: all .3s ease;
}
.cat-chip:hover {
  color: var(--ink);
  border-color: var(--ink-2);
}
.cat-chip.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.cat-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.cat-status b { color: var(--ink); font-weight: 500; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 48px 28px;
  padding: 40px 0 120px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cat-card-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--paper-2);
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  color: inherit;
}
.cat-card-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.95);
  transition: transform 1.2s cubic-bezier(.2,.7,.2,1), filter .5s ease, opacity .4s ease;
}
.cat-card-frame:hover img {
  transform: scale(1.05);
  filter: saturate(1.05);
}
.cat-card-zoom {
  position: absolute;
  right: 10px; top: 10px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--paper);
  background: color-mix(in oklab, var(--ink) 78%, transparent);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .3s ease;
}
.cat-card-frame:hover .cat-card-zoom { opacity: 1; }

/* Spinner */
.cat-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  pointer-events: none;
  z-index: 1;
}
.cat-spinner svg {
  animation: catspin 0.9s linear infinite;
}
@keyframes catspin { to { transform: rotate(360deg); } }
.cat-card-placeholder {
  width: 100%; height: 100%;
  position: relative;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cat-card-placeholder svg { position: absolute; inset: 0; }
.cat-card-placeholder-label {
  position: relative;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: color-mix(in oklab, var(--paper) 80%, transparent);
  padding: 4px 10px;
}
.cat-card-num {
  position: absolute;
  left: 10px; top: 10px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--paper);
  background: color-mix(in oklab, var(--ink) 78%, transparent);
  padding: 3px 8px;
  backdrop-filter: blur(6px);
}
.cat-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cat-card-title {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 20px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.cat-card-tech {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cat-empty {
  text-align: center;
  padding: 120px 20px;
  max-width: 520px;
  margin: 0 auto;
}
.cat-empty-mark {
  font-family: var(--ff-display);
  font-size: 120px;
  line-height: 1;
  color: var(--ink-3);
  opacity: 0.35;
  margin-bottom: 24px;
}
.cat-empty h3 {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: 40px;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
}
.cat-empty p {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.7;
}
.linklike {
  font: inherit;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding: 0;
  cursor: pointer;
}
.linklike:hover { color: var(--ink); border-bottom-color: var(--ink); }

@media (max-width: 820px) {
  .cat-toolbar { grid-template-columns: 1fr; gap: 20px; }
  .cat-search { min-width: 0; }
  .cat-tabs { gap: 20px; }
  .cat-tab-label { font-size: 20px; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 32px 16px; }
}

/* ---------- Lightbox ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: color-mix(in oklab, #000 94%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vw, 60px);
  animation: lbFadeIn .25s ease;
  cursor: zoom-out;
}
@keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }
.lb-stage {
  position: relative;
  max-width: 1200px;
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  cursor: default;
  animation: lbZoomIn .35s cubic-bezier(.2,.7,.2,1);
}
@keyframes lbZoomIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
.lb-frame {
  position: relative;
  max-width: 100%;
  max-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  min-width: 200px;
}
.lb-frame img {
  max-width: 100%;
  max-height: calc(100vh - 220px);
  object-fit: contain;
  transition: opacity .4s ease;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.6);
}
.lb-frame .cat-spinner { color: #fff; }
.lb-caption {
  color: #fff;
  text-align: center;
  max-width: 600px;
}
.lb-num {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin-bottom: 6px;
}
.lb-title {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 26px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.lb-tech {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,.65);
}
.lb-close, .lb-nav {
  position: absolute;
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-family: var(--ff-display);
  cursor: pointer;
  transition: background .25s ease, transform .25s ease;
  z-index: 2;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.18); }
.lb-close {
  top: 24px; right: 24px;
  font-size: 24px;
}
.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 32px;
  line-height: 1;
}
.lb-prev { left: 24px; }
.lb-next { right: 24px; }
.lb-nav:hover { background: rgba(255,255,255,.18); }

@media (max-width: 700px) {
  .lb-nav { width: 40px; height: 40px; font-size: 24px; }
  .lb-prev { left: 12px; }
  .lb-next { right: 12px; }
  .lb-close { top: 12px; right: 12px; width: 40px; height: 40px; }
  .lb-title { font-size: 20px; }
}

/* ---------- Poem / Pensieri dipinti ---------- */
.cat-card-pbadge {
  position: absolute;
  left: 10px; bottom: 10px;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  background: color-mix(in oklab, var(--accent) 85%, transparent);
  padding: 4px 9px;
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .35s ease, transform .35s ease;
  z-index: 2;
}
.cat-card-frame:hover .cat-card-pbadge { opacity: 1; transform: translateY(0); }

.cat-card-poem-btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule);
  cursor: pointer;
  align-self: flex-start;
  transition: color .3s ease, letter-spacing .3s ease;
}
.cat-card-poem-btn:hover {
  color: var(--ink);
  letter-spacing: 0.22em;
}
.cat-card-poem-ico {
  font-size: 12px;
  letter-spacing: 0;
}
.cat-card-poem-arrow {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  transition: transform .3s ease;
}
.cat-card-poem-btn:hover .cat-card-poem-arrow { transform: translateX(4px); }

.lb-poem-btn {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  cursor: pointer;
  transition: background .3s ease, border-color .3s ease;
}
.lb-poem-btn:hover {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.45);
}
.lb-poem-btn span:first-child { color: var(--accent); font-size: 13px; letter-spacing: 0; }
.lb-poem-btn span:last-child { font-family: var(--ff-display); font-style: italic; font-size: 16px; letter-spacing: 0; text-transform: none; }

/* Poem modal */
.poem-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: color-mix(in oklab, #000 65%, transparent);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(20px, 4vw, 60px);
  overflow-y: auto;
  animation: poemFadeIn .3s ease;
  cursor: zoom-out;
}
@keyframes poemFadeIn { from { opacity: 0; } to { opacity: 1; } }
.poem-sheet {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  max-width: 680px;
  width: 100%;
  padding: clamp(40px, 6vw, 80px) clamp(28px, 5vw, 72px) clamp(32px, 4vw, 56px);
  cursor: default;
  animation: poemSlideIn .45s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.5);
}
@keyframes poemSlideIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

.poem-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 38px; height: 38px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 22px;
  font-family: var(--ff-display);
  line-height: 1;
  cursor: pointer;
  transition: border-color .3s ease, color .3s ease;
  z-index: 2;
}
.poem-close:hover { border-color: var(--ink); color: var(--ink); }

.poem-head { text-align: center; margin-bottom: 28px; }
.poem-eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.poem-title {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 10px;
}
.poem-meta {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.poem-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 28px auto;
  max-width: 280px;
  color: var(--accent);
  font-size: 14px;
  position: relative;
}
.poem-rule::before, .poem-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.poem-body {
  font-family: var(--ff-display);
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.75;
  color: var(--ink);
  text-align: center;
  font-style: italic;
  max-width: 520px;
  margin: 0 auto;
}
.poem-body p {
  margin: 0;
  text-wrap: pretty;
}
.poem-body p.is-blank { height: 0.9em; }

.poem-date {
  margin-top: 28px;
  text-align: center;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-style: normal;
}

.poem-foot {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  text-align: center;
}
.poem-foot .mono {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

@media (max-width: 520px) {
  .poem-body { font-size: 16px; line-height: 1.7; }
  .poem-sheet { padding: 60px 22px 28px; }
}

/* ---------- "Vedi tutte le opere" CTA (in home gallery) ---------- */.gallery-cta-row {
  margin-top: 120px;
  display: flex;
  justify-content: center;
  padding: 40px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.gallery-cta {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 22px 36px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  transition: color .4s ease;
}
.gallery-cta::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--ink);
  transform: translateY(100%);
  transition: transform .5s cubic-bezier(.7,0,.2,1);
  z-index: 0;
}
.gallery-cta:hover { color: var(--paper); }
.gallery-cta:hover::before { transform: translateY(0); }
.gallery-cta span { position: relative; z-index: 1; }
.gallery-cta-arrow {
  position: relative; z-index: 1;
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 20px;
  letter-spacing: 0;
  text-transform: none;
  transition: transform .4s ease;
}
.gallery-cta:hover .gallery-cta-arrow { transform: translateX(6px); }
.gallery-cta-count {
  position: relative; z-index: 1;
  padding-left: 18px;
  border-left: 1px solid currentColor;
  opacity: 0.7;
}
