/* ===========================
   FONT: UNION
   =========================== */
@font-face {
  font-family: "Union";
  src: url("../fonts/Union-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Union";
  src: url("../fonts/Union-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Union";
  src: url("../fonts/Union-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Union";
  src: url("../fonts/Union-BoldItalic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* ===========================
   BASE — stessi token di index.html
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-bg: #f0ece5;
  --wall-bg:    #f8f8f6;
  --black:      #0d0d0d;
  --border:     rgba(13,13,13,0.08);
  --sidebar-w:  220px;
}

html, body {
  background: var(--wall-bg);
  color: var(--black);
  font-family: "Union", system-ui, sans-serif;
}

/* muro — texture leggera */
body {
  background-color: var(--wall-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23f8f8f6'/%3E%3Crect width='1' height='1' fill='rgba(0,0,0,0.022)'/%3E%3C/svg%3E");
}

/* ===========================
   SIDEBAR
   =========================== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 44px 36px 36px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  z-index: 10;
}

.brand {
  display: block;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--black);
  text-decoration: none;
  margin-bottom: 56px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav a {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--black);
  text-decoration: none;
  padding: 7px 0;
  opacity: 0.35;
  border-bottom: 1px solid transparent;
  transition: opacity 0.2s, border-color 0.2s;
}
.nav a:hover,
.nav a.active { opacity: 1; border-bottom-color: var(--black); }

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lang {
  display: flex;
  gap: 14px;
}
.lang a {
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--black);
  text-decoration: none;
  opacity: 0.3;
  transition: opacity 0.2s;
}
.lang a.active, .lang a:hover { opacity: 1; }

.site-footer {
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  opacity: 0.25;
}

/* ===========================
   CONTENT
   =========================== */
.content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

.wrap {
  max-width: 780px;
  padding: 40px 72px 120px;
}

.page-title {
  font-weight: 400;
  font-style: italic;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.38;
  padding: 44px 72px 0;
}
/* quando .page-title è dentro .wrap (niente doppio padding) */
.wrap .page-title { padding: 0 0 8px; }

/* ===========================
   PROSA — Mostre / Info
   =========================== */
.prose {
  margin-top: 32px;
}

.prose h3 {
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 32px 0 10px;
}
.prose h3:first-child { margin-top: 0; }

.prose p {
  font-size: 0.85rem;
  line-height: 1.7;
  opacity: 0.75;
  margin-bottom: 10px;
}

.prose em {
  font-style: italic;
  opacity: 0.5;
}

.prose ul {
  list-style: none;
  margin-top: 4px;
}

.prose li {
  font-size: 0.8rem;
  line-height: 2;
  opacity: 0.75;
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}
.prose li:first-child { border-top: 1px solid var(--border); }

.prose li strong {
  font-weight: 700;
  opacity: 1;
  margin-right: 6px;
}

.prose a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.85;
}
.prose a:hover { opacity: 1; }

/* ===========================
   OPERE — griglia (legacy, usata solo se richiamata da renderWorks)
   =========================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 40px;
  justify-items: start;
}

.card {
  width: 100%;
  max-width: 380px;
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
}
.card:hover { transform: translateY(-2px); opacity: .97; }
.card img { width: 100%; height: auto; display: block; object-fit: contain; margin-bottom: 10px; }
.card figcaption strong { display: block; font-weight: 700; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.card figcaption .meta { display: block; font-weight: 400; font-style: italic; font-size: 0.62rem; letter-spacing: 0.08em; opacity: 0.42; margin-top: 4px; }

/* ===========================
   LIGHTBOX (condiviso)
   =========================== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,13,13,0.97);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: min(88vw, 1100px); max-height: 84vh; object-fit: contain; display: block; }
.lightbox figcaption { position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.lightbox figcaption strong { font-weight: 700; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: #f8f8f6; display: block; }
.lightbox figcaption .meta { font-style: italic; font-size: 0.56rem; letter-spacing: 0.1em; color: rgba(248,248,246,0.38); margin-top: 4px; }

.lightbox .nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(248,248,246,0.28);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 24px;
  transition: color 0.2s;
  min-width: 60px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox .nav-btn:hover { color: #f8f8f6; }
.lightbox .prev { left: 12px; }
.lightbox .next { right: 12px; }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 620px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 18px 20px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .brand { margin-bottom: 0; font-size: 0.95rem; flex: 1; }
  .nav { flex-direction: row; flex: none; gap: 0; }
  .nav a { padding: 6px 10px; }
  .sidebar-bottom { flex-direction: row; gap: 16px; align-items: center; }
  .site-footer { display: none; }
  .content { margin-left: 0; }
  .page-title { padding: 28px 20px 0; }
  .wrap { padding: 24px 20px 80px; }
  .grid { grid-template-columns: 1fr; gap: 32px; }
  .card { max-width: 100%; }
}
