/* ---------------------------------------------------------------
   Akira Zakamoto — minimal gallery (stile johnbrendanguinan.com)
   Sfondo bianco, tipografia essenziale, masonry, molto respiro.
---------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #111;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(150%) blur(6px);
  border-bottom: 1px solid #eee;
}
.site-header .bar,
.site-footer .bar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1500px; margin: 0 auto;
  padding: 16px 28px;
}
.wordmark {
  font-weight: 600;
  letter-spacing: .14em;
  font-size: 11px;
  text-transform: uppercase;
}
/* ---------- Header right: menu inline / toggle / burger ---------- */
.header-right { display: flex; align-items: center; gap: 20px; }
.wordmark-star { display: inline-flex; align-items: center; }
.wordmark-star svg { fill: #4B0082; display: block; }
html.dark .wordmark-star svg { fill: #7986CB; }

.site-nav-inline { display: none; gap: 22px; }
.site-nav-inline a {
  text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: #555;
  transition: color .15s ease; white-space: nowrap;
}
.site-nav-inline a:hover, .site-nav-inline a.is-active { color: #000; }
.theme-toggle {
  background: none; border: 0; cursor: pointer; color: #111; font-size: 15px; line-height: 1; padding: 0;
}
/* Gruppo di sinistra: wordmark + dado (la .bar resta a due colonne) */
.header-left { display: flex; align-items: center; gap: 12px; }
/* Pulsanti icona del menu: dado (a sinistra) e lente (accanto al chiaro/scuro).
   Stessa grafica piena e stesso colore del toggle chiaro/scuro: sono una famiglia. */
.icon-btn {
  background: none; border: 0; padding: 0; cursor: pointer; color: #111; line-height: 0;
  display: inline-flex; align-items: center; transition: opacity .15s ease;
}
.icon-btn:hover { opacity: .55; }
.icon-btn svg { display: block; }
.theme-toggle { transition: opacity .15s ease; }
.theme-toggle:hover { opacity: .55; }
/* Se c'è spazio in orizzontale -> menu su una riga, niente burger */
@media (min-width: 1000px) {
  .site-nav-inline { display: flex; }
  .nav-toggle { display: none; }
}

/* ---------- Burger ---------- */
.nav-toggle {
  width: 15px; height: 11px; position: relative;
  background: none; border: 0; cursor: pointer; padding: 0;
}
.nav-toggle span {
  position: absolute; left: 0; width: 100%; height: 1.5px; background: #111;
  transition: transform .3s ease, opacity .2s ease;
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 5px; }
.nav-toggle span:nth-child(3) { top: 10px; }
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ---------- Overlay menu ---------- */
.nav-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(255,255,255,.98);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease;
}
body.nav-open .nav-overlay { opacity: 1; visibility: visible; }
.nav-overlay {
  gap: 11px;
}
.nav-overlay a {
  text-transform: uppercase; letter-spacing: .14em; font-size: 11px; color: #444;
  transition: color .15s ease;
}
.nav-overlay a:hover, .nav-overlay a.is-active { color: #000; }

/* ---------- Barra delle serie (filtro su art.php) ---------- */
.series-bar {
  position: sticky; top: 53px; z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 20px; max-width: 1500px; margin: 0 auto; padding: 11px 28px;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(150%) blur(6px);
  border-bottom: 1px solid #eee;
}
.series-link {
  background: none; border: 0; cursor: pointer; padding: 2px 0;
  font-family: inherit; text-transform: uppercase; letter-spacing: .12em;
  font-size: 11px; color: #8a8a8a; white-space: nowrap; transition: color .15s ease;
  border-bottom: 1.5px solid transparent;
}
.series-link:hover { color: #000; }
.series-link.active { color: #000; border-bottom-color: #000; }
html.dark .series-bar { background: rgba(14,14,14,.92); border-bottom-color: #262626; }
html.dark .series-link { color: #999; }
html.dark .series-link:hover, html.dark .series-link.active { color: #fff; }
html.dark .series-link.active { border-bottom-color: #fff; }
@media (max-width: 640px) {
  .series-bar { gap: 14px; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
}

/* ---------- Cappello concettuale di serie (art.php) ---------- */
.series-hat {
  max-width: 720px; margin: 18px auto 0; padding: 0 28px; text-align: center;
}
.series-hat p { font-size: 14px; line-height: 1.7; color: #444; margin: 0 0 8px; }
/* Eteronimo che firma la serie, sotto il cappello (stesso stile di dettaglio/zoom/dado) */
.series-hat .hat-het { margin: 16px 0 0; }
.series-hat .hat-het a {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #111;
  border-bottom: 1px solid rgba(0,0,0,.25); padding-bottom: 2px; transition: border-color .15s ease;
}
.series-hat .hat-het a:hover { border-color: currentColor; }
html.dark .series-hat .hat-het a { color: #fff; border-bottom-color: rgba(255,255,255,.3); }

.series-hat-links { margin-top: 22px; }
.series-hat-link { display: inline-block; margin: 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #3a9bdc; }
.series-hat-link:hover { text-decoration: underline; }
html.dark .series-hat p { color: #ccc; }

/* Eteronimo che firma l'opera, nello zoom. Colore neutro come in dettaglio.php:
   scavalca ".lightbox figcaption a", che altrimenti lo renderebbe azzurro. */
.lb-het { display: block; margin-top: 6px; }
.lightbox .lb-het a {
  color: #111; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  border-bottom: 1px solid rgba(0,0,0,.25); padding-bottom: 1px;
}
.lightbox .lb-het a:hover { color: #111; border-bottom-color: currentColor; }
html.dark .lightbox .lb-het a { color: #fff; border-bottom-color: rgba(255,255,255,.3); }
html.dark .lightbox .lb-het a:hover { color: #fff; }

/* Link al progetto motolese.com nella descrizione dell'opera */
.lb-project { display: block; margin-top: 6px; font-size: 12px; opacity: .9; }
/* Link alla scheda dell'opera, dall'anteprima */
.lb-opera { display: block; margin-top: 8px; font-size: 13px; }
.dm-project { margin-top: 10px; font-size: 13px; color: #888; }
.dm-project a { color: #3a9bdc; }
.dm-project a:hover { text-decoration: underline; }

/* ---------- Galleria masonry (colonne flex, ordine preservato) ---------- */
.gallery-wrap { max-width: 1500px; margin: 0 auto; padding: 40px 28px 40px; }
.masonry { display: flex; gap: 34px; align-items: flex-start; }
.mcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 38px; }
@media (max-width: 1100px) { .masonry { gap: 26px; } .mcol { gap: 26px; } }

/* Layout a righe: ordine rigoroso (più recenti in alto, scroll = più vecchi) */
.masonry-rows { flex-wrap: wrap; align-items: flex-start; }
.masonry-rows .tile { width: calc((100% - 68px) / 3); }
@media (max-width: 1100px) { .masonry-rows .tile { width: calc((100% - 26px) / 2); } }
@media (max-width: 640px)  { .masonry-rows .tile { width: 100%; } }

.tile { margin: 0; }
.loader { text-align: center; color: #aaa; font-size: 12px; padding: 24px 0 70px; }
#sentinel { height: 1px; }
.tile-link { display: block; background: #f4f4f4; overflow: hidden; }
.tile img {
  width: 100%; height: auto;
  transition: opacity .25s ease, transform .4s ease;
}
.tile-link:hover img { opacity: .82; }
.tile figcaption {
  margin-top: 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.tile .t { font-weight: 500; font-style: italic; }
.tile .m { color: #888; font-size: 12px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(255,255,255,.97);
  display: none; padding: 40px;
}
.lightbox.open { display: grid; place-items: center; }
/* Variante scrollabile (galleries): contenuto più alto del viewport scrollabile */
.lightbox-scroll.open { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.lightbox-scroll figure {
  min-height: calc(100vh - 80px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 16px 40px;
}
.lightbox figure {
  margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  max-height: 100%; max-width: 100%;
}
.lightbox img {
  max-width: 90vw; max-height: 70vh; width: auto; height: auto;
  object-fit: contain; margin: 0 auto;
  transition: opacity .35s ease;   /* dissolvenza bianca */
}
.lightbox img.is-fading { opacity: 0; }
.lightbox figcaption {
  margin-top: 16px; font-size: 13px; color: #333; text-align: center;
  transition: opacity .35s ease;
  max-width: 760px; max-height: 24vh; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain; padding: 0 8px;
}
.lightbox figcaption.is-fading { opacity: 0; }
.lightbox figcaption #lb-title { font-style: italic; }
.lightbox figcaption #lb-meta { font-style: normal; color: #999; margin-left: 8px; }
.lightbox .lb-link, .lightbox figcaption a { color: #3a9bdc; }
.lightbox .lb-link:hover { color: #5bb4ee; }
.lb-owner { margin-top: 8px; text-align: center; }
.lb-owner-line { font-size: 13px; color: #333; }
.lb-owner-priv { font-size: 11px; color: #999; margin-top: 3px; font-style: italic; }
.lb-auth-wrap { margin-top: 8px; }
.lb-auth { display: inline-block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid #999; border-radius: 3px; padding: 6px 14px; color: #333; }
.lb-auth:hover { border-color: #111; color: #000; }
html.dark .lb-auth { color: #ccc; border-color: #555; }
html.dark .lb-auth:hover { color: #fff; border-color: #fff; }
html.dark .lb-owner-line { color: #ccc; }
html.dark .lb-owner-priv { color: #888; }

/* Social sharing nel lightbox — accanto alla X di chiusura */
.lb-share-wrap { position: fixed; top: 20px; right: 76px; z-index: 112; }
.lb-share {
  background: none; border: 1px solid #ccc; border-radius: 2px; cursor: pointer;
  font-family: inherit; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: #111; padding: 7px 12px; transition: border-color .15s ease;
}
.lb-share:hover { border-color: #111; }
.lb-share-menu {
  position: absolute; top: 42px; right: 0; min-width: 150px;
  background: #fff; border: 1px solid #ddd; border-radius: 2px;
  display: flex; flex-direction: column; box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.lb-share-menu[hidden] { display: none; }
.lb-share-menu a, .lb-share-menu button {
  text-align: left; background: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: 12px; color: #222; padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
}
.lb-share-menu a:last-child, .lb-share-menu button:last-child { border-bottom: 0; }
.lb-share-menu a:hover, .lb-share-menu button:hover { background: #f6f6f6; }
html.dark .lb-share { color: #eee; border-color: #555; }
html.dark .lb-share:hover { border-color: #fff; }
html.dark .lb-share-menu { background: #1c1c1c; border-color: #333; }
html.dark .lb-share-menu a, html.dark .lb-share-menu button { color: #ddd; border-bottom-color: #2a2a2a; }
html.dark .lb-share-menu a:hover, html.dark .lb-share-menu button:hover { background: #262626; }

/* Frecce navigazione */
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; padding: 0; border: 0; cursor: pointer;
  font-size: 30px; line-height: 1; color: #111; opacity: .9;
  background: rgba(255,255,255,.7); border-radius: 50%;
  transition: opacity .15s ease, background .15s ease; z-index: 115;
  -webkit-user-select: none; user-select: none;
}
.lb-nav:hover { opacity: 1; background: rgba(255,255,255,.9); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
html.dark .lb-nav { background: rgba(0,0,0,.5); color: #fff; }
html.dark .lb-nav:hover { background: rgba(0,0,0,.7); }
@media (max-width: 640px) {
  .lb-nav { width: 42px; height: 42px; font-size: 26px; }
  .lb-prev { left: 10px; } .lb-next { right: 10px; }
  .lightbox { padding: 0; }
  .lightbox img { max-width: 100vw; max-height: 82vh; }
}
.lb-close {
  position: fixed; top: 22px; right: 30px;
  background: none; border: 0; font-size: 34px; font-weight: 300; line-height: 1; cursor: pointer; color: #111;
}

/* ---------- Pagina dettaglio ---------- */
.detail {
  max-width: 1300px; margin: 0 auto; padding: 50px 28px 90px;
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 56px; align-items: start;
}
.detail-img img { width: 100%; height: auto; background: #f4f4f4; }
.detail-meta h1 { font-size: 22px; font-style: italic; font-weight: 500; margin: 0 0 14px; }
.detail-meta p { margin: 2px 0; color: #555; }
/* Eteronimo che firma l'opera: sotto il titolo, porta alle sue sole opere */
.detail-meta .dm-het { margin: -8px 0 12px; }
.detail-meta .dm-het a {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #111;
  border-bottom: 1px solid rgba(0,0,0,.25); padding-bottom: 2px; transition: border-color .15s ease;
}
.detail-meta .dm-het a:hover { border-color: currentColor; }
html.dark .detail-meta .dm-het a { color: #fff; border-bottom-color: rgba(255,255,255,.3); }
.detail-meta .dm-info { margin-top: 18px; color: #333; }
.detail-meta .dm-back { margin-top: 30px; }
.detail-meta .dm-back a { color: #000; border-bottom: 1px solid #000; padding-bottom: 2px; }
@media (max-width: 800px) { .detail { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Pagine semplici ---------- */
.page { max-width: 760px; margin: 0 auto; padding: 70px 28px 100px; }
.page h1 { font-size: 24px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.page .soon { color: #999; }

/* ---------- About ---------- */
.about { max-width: 720px; text-align: center; }
/* Bandierine sotto al titolo About: comandano tutti i testi della pagina */
.about-flags { margin: 14px 0 30px; }
.heteronym {
  max-width: 620px; margin: 0 auto 34px; font-size: 15px; line-height: 1.8; color: #444;
}
html.dark .heteronym { color: #bbb; }
.bio-block p {
  font-size: 16px; line-height: 1.9; color: #111; font-style: italic;
  margin: 0 auto 10px;
}
.bio-block a { color: inherit; border-bottom: 1px solid currentColor; }
html.dark .bio-block a { color: inherit; }
#poem { font-size: 16px; line-height: 1.9; color: #111; font-style: italic; }
html.dark #poem { color: #eee; }
.poem-flags { margin-top: 16px; text-align: center; display: flex; justify-content: center; gap: 9px; }
.poem-flag {
  background: none; border: 0; padding: 0; cursor: pointer; line-height: 0;
  opacity: .45; transition: opacity .15s ease; filter: grayscale(35%);
}
.poem-flag:hover { opacity: .8; }
.poem-flag.active { opacity: 1; filter: none; }
.poem-flag svg { width: 13px; height: 9px; border: 1px solid rgba(0,0,0,.15); border-radius: 2px; display: block; }
html.dark .poem-flag svg { border-color: rgba(255,255,255,.2); }

/* Contact intro */
.contact-intro { color: #555; max-width: 520px; margin: 6px auto 0; }
html.dark .contact-intro { color: #aaa; }
.promo-img { display: block; max-width: 100%; max-height: 60vh; width: auto; margin: 0 auto 26px; border-radius: 4px; }
.cv-section { margin-top: 64px; text-align: left; }
.cv-section h2 {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .18em;
  color: #111; margin: 0 0 18px; padding-bottom: 10px; border-bottom: 1px solid #eee;
}
.cv-list { display: flex; flex-direction: column; }
.cv-group { margin-bottom: 28px; }
.cv-group:last-child { margin-bottom: 0; }
.cv-year {
  font-weight: 600; color: #111; font-variant-numeric: tabular-nums;
  font-size: 13px; margin-bottom: 6px;
}
.cv-items { display: flex; flex-direction: column; gap: 4px; }
.cv-item { color: #333; font-size: 13.5px; line-height: 1.5; }
.cv-star { color: #000; font-size: 9px; margin-right: 7px; vertical-align: middle; }

/* ---------- Files (testi critici) ---------- */
.files-page { max-width: 1100px; }
.file-section { margin-top: 48px; }
.file-section:first-of-type { margin-top: 36px; }
.file-section h2 {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .18em;
  color: #111; margin: 0; padding-bottom: 10px; border-bottom: 1px solid #eee;
}
html.dark .file-section h2 { color: #fff; border-bottom-color: #262626; }
.file-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 28px 18px;
  margin-top: 24px;
}
.file-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  color: #111; transition: transform .2s ease;
}
button.file-card { background: none; border: 0; font: inherit; cursor: pointer; }
.file-card:hover { transform: translateY(-3px); }
.file-card:hover .file-ico svg path[fill="#fff"] { fill: #f5f5f5; }
.file-ico { display: block; }
.file-title {
  margin-top: 10px; font-size: 11.5px; line-height: 1.35; font-weight: 500;
}
.file-author { margin-top: 3px; font-size: 10.5px; color: #999; }
@media (max-width: 900px)  { .file-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px)  { .file-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 380px)  { .file-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Pagina testo critico ---------- */
.text-page { max-width: 720px; text-align: left; }
.text-page .tp-back { margin-bottom: 22px; }
.text-page .tp-back a { color: #000; border-bottom: 1px solid #000; padding-bottom: 2px; }
.text-page .tp-title { font-size: 22px; font-weight: 600; text-transform: none; letter-spacing: 0; margin: 0 0 6px; }
.text-page .tp-author { color: #888; font-size: 13px; margin: 0 0 18px; }
.text-page .tp-author a { color: #3a9bdc; }
.text-page .tp-author a:hover { color: #5bb4ee; }
.tp-flags { justify-content: flex-start; margin: 0 0 22px; }
.text-page .tp-author a { color: #111; }
.text-page .tp-author a:hover { color: #000; }
.text-page .tp-linkico { font-size: 11px; color: #888; }
.text-page .tp-body { font-size: 15px; line-height: 1.75; color: #222; }
.text-page .tp-link { margin-top: 26px; }
.text-page .tp-sep { border: 0; border-top: 1px solid #e2e2e2; margin: 34px 0; }
.text-page .tp-body-en { color: #555; }
html.dark .text-page .tp-sep { border-top-color: #2a2a2a; }
html.dark .text-page .tp-body-en { color: #aaa; }

/* ---------- Contact ---------- */
.contact-page { max-width: 560px; }
.contact-form { display: flex; flex-direction: column; gap: 22px; margin-top: 30px; text-align: left; }
.contact-form label {
  display: flex; flex-direction: column; gap: 8px;
  text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: #555;
}
.contact-form label span { color: #c00; }
.contact-form input,
.contact-form textarea {
  font-family: inherit; font-size: 14px; color: #111;
  border: 1px solid #ccc; border-radius: 0; padding: 11px 12px; background: #fff;
  width: 100%; transition: border-color .15s ease;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: #111; }
.contact-form textarea { resize: vertical; }
.contact-form button {
  align-self: flex-start;
  font-family: inherit; text-transform: uppercase; letter-spacing: .14em; font-size: 12px;
  color: #fff; background: #111; border: 0; padding: 13px 34px; cursor: pointer;
  transition: background .15s ease;
}
.contact-form button:hover { background: #444; }
.form-ok  { margin-top: 30px; color: #157a3f; }
.form-err { margin-top: 20px; color: #c00; }

/* ---------- Barra area riservata gallerie ---------- */
.gate-bar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1500px; margin: 0 auto; padding: 12px 28px;
  font-size: 12px; color: #888; border-bottom: 1px solid #eee;
}
.gate-bar a { color: #000; border-bottom: 1px solid #000; padding-bottom: 1px; }
html.dark .gate-bar { color: #999; border-bottom-color: #262626; }
html.dark .gate-bar a { color: #fff; border-bottom-color: #fff; }

/* ---------- Home hero ---------- */
.hero {
  position: relative; display: flex; align-items: flex-end; justify-content: center;
  height: calc(100vh - 56px); min-height: 420px; overflow: hidden; text-decoration: none;
}
.hero-bg { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.6s ease; transform: scale(1.04);
  will-change: opacity, transform;
}
.hero-slide.active { opacity: 1; }
.hero-slide.zooming { animation: heroZoom 7s ease-out forwards; }
@keyframes heroZoom { from { transform: scale(1.04); } to { transform: scale(1.13); } }
.hero-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.28); }
.hero-title {
  position: absolute; left: 0; right: 0; bottom: 2.5vh;
  width: 100%; height: auto; display: block; z-index: 2;
  filter: drop-shadow(0 1px 12px rgba(0,0,0,.45));
}
html.dark .hero-overlay { background: rgba(0,0,0,.4); }

/* ---------- Gate Galleries & Collectors ---------- */
.gate-page { max-width: 460px; }
.gate-intro { color: #555; margin-top: 8px; }
.gate-intro a { text-decoration: underline; }
.gate-form { margin-top: 26px; }

/* ---------- Catalogo: motore di ricerca ---------- */
.catalog-page { max-width: 1200px; }
.cat-search { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; margin: 6px 0 22px; }
/* campi flessibili: si dividono la riga e stanno tutti su una sola linea,
   invece di avere larghezza fissa e mandare l'ultimo a capo */
.cs-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 130px; min-width: 130px; }
.cs-field label { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: #888; white-space: nowrap; }
.cs-field input, .cs-field select {
  font-family: inherit; font-size: 13px; padding: 7px 9px;
  border: 1px solid #ccc; border-radius: 5px; background: #fff; color: #111; min-width: 0; width: 100%;
}
.cs-reset button {
  font-family: inherit; font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  padding: 8px 14px; border: 1px solid #111; background: #fff; color: #111; cursor: pointer; border-radius: 5px;
}
.cat-count { font-size: 12px; color: #888; margin: 0 0 10px; }
.cat-hint { font-size: 12.5px; color: #666; line-height: 1.6; margin: 0 0 14px; max-width: 760px; }
.cat-hint strong { color: #111; font-weight: 600; }
html.dark .cat-hint { color: #aaa; }
html.dark .cat-hint strong { color: #eee; }
.cat-table-wrap { overflow-x: auto; }
.cat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cat-table th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #888;
  border-bottom: 1px solid #ddd; padding: 8px 10px; position: sticky; top: 0; background: #fff;
}
.cat-table td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.cat-table tbody tr:hover { background: #fafafa; }
html.dark .cs-field input, html.dark .cs-field select { background: #1c1c1c; color: #eee; border-color: #444; }
html.dark .cs-reset button { background: #1c1c1c; color: #eee; border-color: #666; }
html.dark .cat-table th { background: #121212; color: #999; border-bottom-color: #333; }
html.dark .cat-table td { border-bottom-color: #262626; }
html.dark .cat-table tbody tr:hover { background: #1a1a1a; }
.prevbtn {
  font-family: inherit; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  padding: 4px 10px; border: 1px solid #111; background: #fff; color: #111; cursor: pointer; border-radius: 4px; white-space: nowrap;
}
.prevbtn:hover { background: #111; color: #fff; }
.prevbtn:disabled { opacity: .55; cursor: default; }
.prevbtn:disabled:hover { background: #fff; color: #111; }
a.prevbtn { display: inline-block; text-decoration: none; }
.act-cell { white-space: nowrap; }
.act-cell .prevbtn { margin-right: 6px; }
.act-cell .prevbtn:last-child { margin-right: 0; }
html.dark .prevbtn { background: #1c1c1c; color: #eee; border-color: #666; }
html.dark .prevbtn:hover { background: #eee; color: #111; }
/* Opera già registrata sulla blockchain: bordo e testo verdi (anche da disabled) */
.prevbtn.in-chain, .prevbtn.in-chain:disabled, .prevbtn.in-chain:hover {
  opacity: 1; background: #fff; color: #2e7d32; border-color: #2e7d32; cursor: default;
}
html.dark .prevbtn.in-chain, html.dark .prevbtn.in-chain:disabled, html.dark .prevbtn.in-chain:hover {
  background: #14231a; color: #74e08a; border-color: #2c6a39;
}
/* Registra proprietà (trasferimento a pagamento): ambra */
.prevbtn.ownbtn { background: #b7791f; color: #fff; border-color: #b7791f; }
.prevbtn.ownbtn:hover { background: #a06a1a; color: #fff; }
html.dark .prevbtn.ownbtn { background: #7a4b00; border-color: #7a4b00; color: #ffd98a; }
html.dark .prevbtn.ownbtn:hover { background: #915b00; color: #fff; }
/* Anteprima opera */
.cprev { position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.82); display: flex; align-items: center; justify-content: center; padding: 24px; }
.cprev[hidden] { display: none; }
.cprev-box { background: #fff; max-width: 90vw; max-height: 92vh; overflow: auto; border-radius: 6px; position: relative; padding: 18px; text-align: center; }
.cprev-box img { max-width: 100%; max-height: 72vh; display: block; margin: 0 auto; }
.cprev-loading { padding: 40px 20px; color: #888; font-size: 13px; font-style: italic; }
html.dark .cprev-box { background: #1a1a1a; color: #eee; }
html.dark .cprev-close { color: #ccc; }
.cprev-close { position: absolute; top: 6px; right: 12px; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: #333; }
.cprev-info { margin-top: 12px; font-size: 13px; }
.cprev-info #cprevTitle { font-style: italic; font-size: 15px; }
.cprev-info #cprevMeta { color: #888; margin-top: 4px; }
.cprev-info #cprevCode { margin-top: 10px; font-weight: bold; letter-spacing: .03em; }
.cprev-claim {
  margin-top: 16px; font-family: inherit; font-size: 12.5px;
  padding: 10px 18px; border: 1px solid #2e7d32; background: #2e7d32; color: #fff; border-radius: 6px; cursor: pointer;
}
.cprev-claim:hover { background: #357a38; }
.cprev-claim[disabled] { opacity: .55; cursor: default; }
.cprev-claim-msg { margin-top: 8px; font-size: 12px; color: #888; }
.cprev-claim-msg.ok { color: #2e7d32; }
.cprev-claim-msg.err { color: #c0392b; }
.cprev-claim-msg a { color: #3a9bdc; text-decoration: underline; }
.cconfirm-box { max-width: 460px; padding: 26px 24px; text-align: left; }
.cconfirm-text { font-size: 15px; font-weight: 600; line-height: 1.5; margin: 0 0 12px; text-align: center; }
.cconfirm-body { font-size: 13px; line-height: 1.65; color: #444; margin: 0 0 14px; }
html.dark .cconfirm-body { color: #bbb; }
.cconfirm-note { display: block; color: #888; font-size: 12px; line-height: 1.5; margin: 0 0 18px; }
.cconfirm-actions { display: flex; gap: 12px; justify-content: center; align-items: center; }
.cconfirm-actions .cprev-claim { margin-top: 0; }
html.dark .cprev-box { background: #1c1c1c; color: #eee; }
html.dark .cprev-close { color: #ccc; }
.gate-logout { margin-top: 26px; font-size: 12px; }
.gate-logout a { color: #000; border-bottom: 1px solid #000; padding-bottom: 2px; }
html.dark .gate-intro { color: #aaa; }
html.dark .gate-logout a { color: #fff; border-bottom-color: #fff; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid #eee; margin-top: 40px; }
.site-footer .bar { font-size: 12px; color: #888; }
.foot-contacts a { margin-left: 18px; }
.foot-contacts a:hover { color: #000; }

/* ===============================================================
   TEMA SCURO (variante selezionabile: html.dark)
   =============================================================== */
html.dark body { background: #0e0e0e; color: #e8e8e8; }

html.dark .site-header { background: rgba(14,14,14,.92); border-bottom-color: #262626; }
html.dark .wordmark { color: #fff; }
html.dark .site-nav-inline a { color: #999; }
html.dark .site-nav-inline a:hover, html.dark .site-nav-inline a.is-active { color: #fff; }
html.dark .theme-toggle { color: #eee; }
html.dark .icon-btn { color: #eee; }
html.dark .nav-toggle span { background: #eee; }
html.dark .het-list a { color: #fff; }
html.dark .het-list a:hover { color: #999; }
html.dark .het-list span { color: #777; }
html.dark .het-head h1 { color: #fff; }
html.dark .het-head p { color: #999; }

html.dark .nav-overlay { background: rgba(14,14,14,.98); }
html.dark .nav-overlay a { color: #999; }
html.dark .nav-overlay a:hover, html.dark .nav-overlay a.is-active { color: #fff; }

/* Galleria */
html.dark .tile-link { background: #1b1b1b; }
html.dark .tile .t { color: #eee; }
html.dark .tile .m { color: #888; }
html.dark .loader { color: #666; }

/* Lightbox */
html.dark .lightbox { background: rgba(0,0,0,.95); }
html.dark .lb-close, html.dark .lb-nav { color: #eee; }
html.dark .lightbox figcaption { color: #ccc; }
html.dark .lightbox figcaption #lb-meta { color: #888; }

/* Pagine semplici / About */
html.dark .page h1 { color: #fff; }
html.dark .bio-block p { color: #eee; }
html.dark .cv-section h2 { color: #fff; border-bottom-color: #262626; }
html.dark .cv-year { color: #fff; }
html.dark .cv-item { color: #cfcfcf; }
html.dark .cv-star { color: #e8e8e8; }
html.dark .page .soon { color: #777; }

/* Files */
html.dark .file-card { color: #eee; }
html.dark .file-author { color: #999; }
html.dark .file-ico svg path, html.dark .file-ico svg line,
html.dark .file-ico svg rect, html.dark .file-ico svg circle { stroke: #cfcfcf; }
html.dark .file-ico svg [fill="#fff"] { fill: #1b1b1b; }
html.dark .file-card:hover .file-ico svg [fill="#fff"] { fill: #262626; }

/* Pagina testo */
html.dark .text-page .tp-title { color: #fff; }
html.dark .text-page .tp-body { color: #d8d8d8; }
html.dark .text-page .tp-author { color: #999; }
html.dark .text-page .tp-author a { color: #fff; }
html.dark .text-page .tp-back a { color: #fff; border-bottom-color: #fff; }

/* Contact */
html.dark .contact-form input,
html.dark .contact-form textarea { background: #1a1a1a; border-color: #444; color: #eee; }
html.dark .contact-form input:focus,
html.dark .contact-form textarea:focus { border-color: #fff; }
html.dark .contact-form button { background: #eee; color: #111; }
html.dark .contact-form button:hover { background: #fff; }

/* Footer */
html.dark .site-footer { border-top-color: #262626; }
html.dark .site-footer .bar { color: #888; }
html.dark .foot-contacts a:hover { color: #fff; }

/* ---------- Eteronimi: elenco in About e intestazione della loro pagina ---------- */
.het-list {
  list-style: none; margin: 0 0 34px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 24px;
}
.het-list li { display: flex; flex-direction: column; gap: 1px; }
.het-list a {
  font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: #111;
  border-bottom: 1px solid transparent; align-self: start; transition: color .15s ease, border-color .15s ease;
}
.het-list a:hover { color: #666; border-color: currentColor; }
.het-list span { font-size: 11px; color: #999; letter-spacing: .02em; }

.het-head { max-width: 1500px; margin: 0 auto; padding: 26px 28px 0; }
.het-head h1 {
  margin: 0; font-size: 20px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #111;
}
.het-head p { margin: 5px 0 0; font-size: 12px; color: #777; }
.het-head a { text-decoration: underline; }
@media (max-width: 640px) {
  .het-list { grid-template-columns: 1fr 1fr; }
  .het-head { padding: 18px 16px 0; }
}

/* ---------- Atelier: testo di apertura sopra la galleria ---------- */
/* Colonna stretta come le pagine di testo: la galleria sotto e' larga 1500px,
   ma un paragrafo lungo quanto lo schermo non si legge. */
.atelier-intro { max-width: 720px; margin: 0 0 46px; }
.atelier-intro h1 { font-size: 24px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; margin: 0 0 18px; }
/* le bandierine di serie stanno centrate (About): qui il testo e' a sinistra,
   e allineate al centro di una colonna stretta sembrerebbero sfalsate */
.atelier-flags { justify-content: flex-start; margin: 0 0 22px; }
.atelier-intro p { font-size: 15px; line-height: 1.75; color: #222; margin: 0 0 14px; }
/* cinese e giapponese: righe un filo piu' arieggiate, gli ideogrammi lo chiedono */
#atelierTxt[lang="ja"] p, #atelierTxt[lang="zh"] p { line-height: 1.9; }
/* le discipline: un elenco, ma in riga e senza pallini */
.atelier-fields { list-style: none; display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 8px 18px; margin: 20px 0 0; padding: 0; }
/* nowrap: senza, una voce di due parole si spezza al suo interno e trascina in
   basso la riga intera, lasciando il separatore per aria */
.atelier-fields li { font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: #777; white-space: nowrap; }
/* il punto va DOPO la parola, non prima: messo prima, quando l'elenco va a capo
   la riga nuova comincia con un puntino sospeso */
/* fra le due parole ci sono i 18px di gap: 9 prima del punto e 9 dopo, cosi'
   sta in mezzo invece di attaccarsi alla parola seguente */
.atelier-fields li:not(:last-child)::after { content: "·"; color: #bbb;
  margin-left: 9px; margin-right: -9px; }
@media (max-width: 640px) {
  .atelier-intro { margin-bottom: 32px; }
  .atelier-intro p { font-size: 14px; }
}
