/* RC88 · L'opera del giorno: una scena a schermo pieno.
   La foto sta al buio; una luce morbida la rivela dove passa il dito o il
   mouse, e nel frattempo si muove da sola per invitare a toccarla. */

:root {
  --og-ink: #0d0a07;
  --og-paper: #f5ecdb;
  --og-muted: #c9b99c;
  --og-gold: #e7b35a;
  --og-gold-deep: #b97a25;
  --og-line: rgba(245, 236, 219, .22);
  --og-radius: 28px;
  --og-ease: cubic-bezier(.2, .7, .2, 1);
}

[hidden] { display: none !important; }

.og-stage {
  position: relative;
  width: min(1180px, calc(100% - 24px));
  min-height: min(92vh, 780px);
  margin: 18px auto 0;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--og-radius);
  background: var(--og-ink);
  color: var(--og-paper);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  box-shadow: 0 30px 70px rgba(20, 12, 4, .35);
  --x: 50%;
  --y: 42%;
}

.og-layer {
  position: absolute;
  inset: -4%;
  background-color: #2a1d12;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.og-dim {
  filter: grayscale(1) brightness(.34) contrast(1.12);
}

.og-lit {
  mask-image: radial-gradient(circle clamp(180px, 34vw, 340px) at var(--x) var(--y), #000 0%, #000 38%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle clamp(180px, 34vw, 340px) at var(--x) var(--y), #000 0%, #000 38%, transparent 100%);
}

.og-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(10, 7, 4, .94) 0%, rgba(10, 7, 4, .55) 42%, rgba(10, 7, 4, .08) 100%),
    linear-gradient(to bottom, rgba(10, 7, 4, .55) 0%, transparent 26%);
}

.og-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: inherit;
  box-sizing: border-box;
  padding: clamp(20px, 5vw, 56px);
}

.og-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.og-kicker {
  margin: 0;
  color: var(--og-gold);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.og-date {
  margin: 0;
  padding: 7px 12px;
  border: 1px solid var(--og-line);
  border-radius: 999px;
  background: rgba(13, 10, 7, .4);
  color: var(--og-muted);
  font-size: .78rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.og-status {
  margin: auto 0 0;
  color: var(--og-muted);
  font-size: .96rem;
  font-weight: 650;
}

.og-status[data-kind="error"] { color: #f0a58f; }

.og-card {
  display: grid;
  gap: 14px;
  margin-top: auto;
  max-width: 880px;
  padding: clamp(16px, 3vw, 24px);
  border-radius: 22px;
  background: rgba(13, 10, 7, .72);
  backdrop-filter: blur(10px);
}

.og-author {
  margin: 0;
  color: var(--og-gold);
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  animation: og-fade .9s var(--og-ease) both;
}

.og-title {
  margin: 0;
  font: 700 clamp(2.3rem, 7.4vw, 5.4rem)/.96 Georgia, "Times New Roman", serif;
  letter-spacing: -.012em;
  text-wrap: balance;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .45);
}

.og-word {
  display: inline-block;
  margin-right: .22em;
  opacity: 0;
  transform: translateY(.35em);
  animation: og-rise .9s var(--og-ease) forwards;
  animation-delay: calc(var(--i, 0) * 85ms + 180ms);
}

.og-place {
  margin: 0;
  color: var(--og-paper);
  font-size: 1.02rem;
  font-weight: 650;
}

.og-tip {
  margin: 0;
  max-width: 62ch;
  padding-left: 14px;
  border-left: 2px solid var(--og-gold);
  color: var(--og-muted);
  font: italic 500 1.02rem/1.55 Georgia, serif;
}

.og-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.og-btn {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--og-line);
  border-radius: 999px;
  background: rgba(245, 236, 219, .1);
  color: var(--og-paper);
  font: 800 .9rem/1 system-ui, sans-serif;
  letter-spacing: .02em;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}

.og-btn:hover {
  background: rgba(245, 236, 219, .2);
  border-color: rgba(245, 236, 219, .5);
  transform: translateY(-1px);
}

.og-btn-primary {
  border-color: var(--og-gold);
  background: var(--og-gold);
  color: #1a1208;
}

.og-btn-primary:hover {
  background: #f0c06c;
  border-color: #f0c06c;
}

/* «Vedi tutte le opere»: sta sotto gli altri comandi, a tutta larghezza. */
.og-btn-all {
  flex: 1 1 100%;
  border-color: var(--og-gold);
  color: var(--og-gold);
  font-weight: 900;
}

.og-btn-all:hover {
  border-color: var(--og-gold);
  background: rgba(231, 179, 90, .18);
  color: #f5dcae;
}

.og-btn:focus-visible,
.og-fonte:focus-visible,
.og-rail-item:focus-visible {
  outline: 3px solid rgba(231, 179, 90, .6);
  outline-offset: 3px;
}

.og-sheet {
  display: grid;
  gap: 14px;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid var(--og-line);
  border-radius: 22px;
  background: rgba(13, 10, 7, .62);
  backdrop-filter: blur(14px);
  animation: og-fade .5s var(--og-ease) both;
}

.og-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px 18px;
  margin: 0;
}

.og-facts div {
  display: grid;
  gap: 3px;
  padding-top: 10px;
  border-top: 1px solid var(--og-line);
}

.og-facts dt {
  color: var(--og-gold);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.og-facts dd {
  margin: 0;
  font-size: .98rem;
  line-height: 1.4;
}

.og-nota {
  margin: 0;
  font-size: .98rem;
  line-height: 1.65;
  color: #efe4cf;
}

.og-fonte {
  justify-self: start;
  color: var(--og-gold);
  font-size: .86rem;
  font-weight: 750;
  text-underline-offset: 3px;
}

.og-share-status {
  margin: 0;
  min-height: 1.2em;
  color: var(--og-muted);
  font-size: .84rem;
}

.og-archivio {
  display: grid;
  gap: 12px;
  padding-top: 6px;
}

.og-archivio-title {
  margin: 0;
  color: var(--og-paper);
  font: 700 1.2rem/1.2 Georgia, serif;
}

.og-rail {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 4px 2px 12px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(231, 179, 90, .5) transparent;
}

.og-rail li {
  flex: 0 0 150px;
  scroll-snap-align: start;
}

.og-rail-item {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--og-paper);
  text-align: left;
  cursor: pointer;
}

.og-thumb {
  display: block;
  height: 176px;
  border-radius: 16px;
  background-color: #3a2a1a;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--og-line);
  transition: transform .25s var(--og-ease), border-color .25s ease;
}

.og-rail-item:hover .og-thumb {
  transform: translateY(-3px);
  border-color: var(--og-gold);
}

.og-rail-item[aria-current="true"] .og-thumb {
  border-color: var(--og-gold);
  box-shadow: 0 0 0 2px rgba(231, 179, 90, .45);
}

.og-rail-date {
  color: var(--og-gold);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.og-rail-name {
  font: 700 .92rem/1.25 Georgia, serif;
}

.og-grid-section {
  display: grid;
  gap: 18px;
  width: min(1180px, calc(100% - 24px));
  margin: 28px auto 48px;
  color: var(--og-paper);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.og-grid-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
}

.og-grid-title {
  margin: 0;
  font: 700 clamp(1.7rem, 4.6vw, 2.5rem)/1.05 Georgia, "Times New Roman", serif;
}

.og-grid-count {
  margin: 6px 0 0;
  color: var(--og-muted);
  font-size: .9rem;
  font-weight: 650;
}

.og-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.og-grid-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--og-line);
  border-radius: 18px;
  background-color: #2a1d12;
  background-size: cover;
  background-position: center;
  color: var(--og-paper);
  text-align: left;
  cursor: pointer;
  transition: transform .25s var(--og-ease), border-color .25s ease;
}

.og-grid-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 7, 4, .92), rgba(10, 7, 4, 0) 62%);
}

.og-grid-item:hover {
  transform: translateY(-3px);
  border-color: var(--og-gold);
}

.og-grid-item[aria-current="true"] {
  border-color: var(--og-gold);
  box-shadow: 0 0 0 2px rgba(231, 179, 90, .45);
}

.og-grid-item:focus-visible {
  outline: 3px solid rgba(231, 179, 90, .6);
  outline-offset: 3px;
}

.og-grid-cap {
  position: absolute;
  z-index: 1;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  gap: 4px;
}

.og-grid-name {
  font: 700 .98rem/1.2 Georgia, serif;
}

.og-grid-place {
  color: var(--og-muted);
  font-size: .74rem;
  font-weight: 650;
}

@media (max-width: 640px) {
  .og-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@keyframes og-drift {
  from { transform: scale(1.02) translate3d(-1%, 0, 0); }
  to   { transform: scale(1.12) translate3d(1%, -1.5%, 0); }
}

@keyframes og-rise {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes og-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 640px) {
  .og-stage {
    width: calc(100% - 16px);
    min-height: min(90vh, 640px);
    border-radius: 22px;
  }
  .og-actions .og-btn { flex: 1 1 100%; }
  .og-rail li { flex-basis: 132px; }
  .og-thumb { height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .og-layer,
  .og-author,
  .og-sheet,
  .og-word {
    animation: none !important;
  }
  .og-word { opacity: 1; transform: none; }
}
