/* mscreativestudio.com - stile responsive (mobile first)
   Mantiene l'aspetto originale: font Courier, sfondo nero, testo #bbb, accento arancio #f93. */

:root {
  --bg: #000;
  --fg: #bbb;
  --link: #fff;
  --accent: #f93;
  --muted: #888;
  --panel: #111;
  --line: #333;
  --gutter: clamp(14px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Courier New", Courier, "Liberation Mono", monospace;
  font-size: clamp(16px, 0.25vw + 15px, 18px);
  line-height: 1.55;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; border: 0; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus-visible { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { color: #ddd; font-weight: bold; line-height: 1.25; }
h1 { font-size: 1em; margin: .5em 0 .4em; }            /* smartphone: metà della misura standard (2em) */
h2 { font-size: 1.25em; margin: 1.4em 0 .5em; }
h3 { font-size: 1.1em; margin: 1em 0 .4em; }
small { color: var(--muted); }

.skip { position: absolute; left: -9999px; top: 0; background: #fff; color: #000; padding: .5em 1em; z-index: 100; }
.skip:focus { left: 0; }

/* ---------- intestazione ---------- */
.site-header {
  display: flex; flex-direction: column; gap: .6rem;
  padding: .8rem var(--gutter) 0;
}
.brand { margin: 0; font-size: 1.5rem; font-weight: normal; text-align: center; line-height: 1.2; }
.brand a { color: var(--fg); text-decoration: none; }
.brand small { display: block; font-size: .65em; }
.brand small a { color: #666; }
.brand a:hover { color: var(--accent); }

.menu ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem;
}
.menu a {
  display: block; padding: .55rem .4rem; min-height: 44px;       /* area tocco comoda */
  text-align: center; text-transform: uppercase; font-weight: bold; text-decoration: none;
  color: #fff; background: #222; border: 2px solid #555;
}
.menu a:hover, .menu a:focus-visible { background: #c63; color: #fff; }
.menu a[aria-current="page"] { color: var(--accent); border-color: var(--accent); }

/* ---------- contenuto ---------- */
main { padding: 1rem var(--gutter) 1rem; max-width: 1400px; margin: 0 auto; }
.narrow { max-width: 62rem; }
.cols { display: grid; gap: 1.5rem; }
.panel { background: var(--panel); padding: 1rem; }
.sub { color: var(--muted); margin-top: -.3em; }
.site-footer { margin: 1rem var(--gutter); padding-top: .8rem; font-size: .9rem; color: var(--muted); border-top: 1px solid #222; }
.site-footer a { text-decoration: none; }
.portrait { float: right; margin: 0 0 1rem 1rem; max-width: 40%; }

ul.plain { list-style: none; padding: 0; }
.nav-others { display: flex; flex-wrap: wrap; gap: .4rem .8rem; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.nav-others a { color: var(--accent); text-decoration: none; }

/* ---------- elenco gallerie ---------- */
.series { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); list-style: none; padding: 0; margin: 1rem 0; }
.series a { display: block; height: 100%; padding: .7rem; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--fg); }
.series a:hover, .series a:focus-visible { border-color: var(--accent); color: var(--fg); }
.series h2, .series h3 { margin: 0 0 .4rem; font-size: 1em; color: #fff; text-transform: uppercase; font-size: 1em; }
.series .thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.series .thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.series .year { color: var(--muted); font-size: .9em; }

/* ---------- gallery (foto a colonne, senza ritagli) ---------- */
.photos { columns: 2 150px; column-gap: 6px; margin: 1.5rem 0; }
.photos a { display: block; break-inside: avoid; margin: 0 0 6px; border: 1px solid var(--line); }
.photos a:hover, .photos a:focus-visible { border-color: var(--accent); }
.photos img { display: block; width: 100%; height: auto; }
.testo { font-size: .95em; }
.testo .en { margin-top: 1.2rem; padding: .8rem 1rem; background: var(--panel); }
.attach { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }

/* ---------- home: slideshow a tutto schermo ---------- */
.home .site-header { position: absolute; z-index: 5; left: 0; right: 0; top: 0; padding-bottom: 2rem; background: linear-gradient(#000c, #0000); }
.hero { position: relative; height: 100vh; height: 100svh; min-height: 440px; background: #000; overflow: hidden; }
.slide { position: absolute; inset: 0; margin: 0; display: none; opacity: 0; transition: opacity .9s ease; }
.slide.on { display: block; }
.slide.in { opacity: 1; }
.slide img { width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; }
/* se l'orientamento non coincide con quello dello schermo la foto si vede intera */
@media (orientation: portrait)  { .slide.land img { object-fit: contain; } }
@media (orientation: landscape) { .slide.port img { object-fit: contain; } }
.slide figcaption { position: absolute; left: 0; right: 0; bottom: 3.4rem; padding: 0 var(--gutter); font-size: .95rem; text-shadow: 0 1px 3px #000; }
.slide figcaption a { color: #fff; }
.hero-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .4rem var(--gutter); background: linear-gradient(#0000, #000c);
}
.hero-bar .count { color: #aaa; font-size: .9rem; }
.hero-bar .ctl { display: flex; gap: .3rem; }
.hero-bar button {
  width: 44px; height: 44px; font: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer;
  color: #fff; background: #0008; border: 1px solid #555; border-radius: 0;
}
.hero-bar button:hover, .hero-bar button:focus-visible { border-color: var(--accent); color: var(--accent); }
.progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); z-index: 5; }
.progress.run { animation: prog var(--dur, 5.5s) linear forwards; }
@keyframes prog { to { transform: scaleX(1); } }
.home .brand, .home .menu a { text-shadow: 0 1px 4px #000, 0 0 10px #000; }
.home .brand small a { color: #bbb; }
.home .site-footer { margin-top: 0; }
.intro { max-width: 52rem; }

/* ---------- lightbox (dialog nativo) ---------- */
dialog.lb { border: 0; padding: 0; background: #000; color: #fff; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; }
dialog.lb::backdrop { background: #000; }
.lb figure { margin: 0; height: 100%; display: flex; flex-direction: column; }
.lb img { flex: 1; min-height: 0; width: 100%; object-fit: contain; max-width: none; }
.lb figcaption { padding: .5rem 4rem; text-align: center; font-size: .9rem; min-height: 2.4rem; }
.lb button { position: absolute; width: 48px; height: 48px; font: inherit; font-size: 1.6rem; color: #fff; background: #000a; border: 1px solid #555; cursor: pointer; }
.lb .x { top: .5rem; right: .5rem; } .lb .p { left: .5rem; top: 50%; } .lb .n { right: .5rem; top: 50%; }
.lb button:hover, .lb button:focus-visible { color: var(--accent); border-color: var(--accent); }

/* ---------- schermi larghi: menu a sinistra, nome a destra come prima ---------- */
@media (min-width: 760px) {
  h1 { font-size: 2em; margin: .67em 0; }
  .site-header { flex-direction: row-reverse; justify-content: space-between; align-items: flex-start; padding-top: 1rem; }
  .brand { text-align: right; }
  .menu ul { display: flex; flex-wrap: wrap; gap: 1.4rem; }
  .menu a { display: inline-block; min-height: 0; padding: .1rem 0; background: none; border: 0; font-size: 1rem; }
  .menu a:hover, .menu a:focus-visible { background: none; color: var(--accent); }
  .menu a[aria-current="page"] { border-bottom: 2px solid var(--accent); }
  .cols { grid-template-columns: 1fr 1fr; }
  .photos { columns: 3 220px; }
  main { padding-top: 2rem; }
  .slide figcaption { bottom: 3.6rem; }
}
@media (min-width: 1200px) { .photos { columns: 4 240px; } }

@media (prefers-reduced-motion: reduce) {
  .slide { transition: none; }
}
/* ---------- menu "altre gallerie" e link di ritorno ---------- */
.crumb { margin: 0 0 .2rem; }
.crumb a { display: inline-block; padding: .4rem 0; color: var(--accent); text-decoration: none; font-weight: bold; }
.crumb a:hover { text-decoration: underline; }
.more { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.series.small { grid-template-columns: repeat(auto-fill, minmax(min(46%, 11rem), 1fr)); gap: .6rem; }
.series.small a { display: flex; flex-direction: column; gap: .4rem; padding: .4rem; text-align: center; }
.series.small img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.series.small .t { color: #fff; font-weight: bold; line-height: 1.25; text-transform: uppercase; font-size: .85em; }
.series.small a:hover .t { color: var(--accent); }
.more .all { display: inline-block; margin-top: .4rem; padding: .6rem 1rem; border: 2px solid #555; background: #222; color: #fff; text-decoration: none; font-weight: bold; text-transform: uppercase; }
.more .all:hover { border-color: var(--accent); color: var(--accent); }

@media print { .site-header, .hero-bar { display: none; } body { background: #fff; color: #000; } }

/* ---------- modulo contatti ---------- */
.contact { margin: 2rem 0; max-width: 40rem; }
.cform p { margin: 0 0 1rem; }
.cform label { display: block; margin-bottom: .3rem; color: #ddd; font-weight: bold; }
.cform input[type="text"], .cform input[type="email"], .cform select, .cform textarea {
  width: 100%; padding: .7rem .6rem; font: inherit; font-size: 16px;            /* 16px: iOS non zooma nel campo */
  color: #fff; background: #111; border: 2px solid #555; border-radius: 0; min-height: 44px;
}
.cform textarea { resize: vertical; min-height: 9rem; }
.cform input:focus, .cform select:focus, .cform textarea:focus { border-color: var(--accent); outline: 0; }
.cform .check label { display: flex; gap: .6rem; align-items: flex-start; font-weight: normal; color: var(--fg); }
.cform .check input { width: 1.4rem; height: 1.4rem; margin-top: .15rem; flex: none; accent-color: var(--accent); }
.cform button { width: 100%; min-height: 48px; padding: .7rem 1.4rem; font: inherit; font-weight: bold; text-transform: uppercase; color: #fff; background: #c63; border: 2px solid #c63; cursor: pointer; border-radius: 0; }
.cform button:hover, .cform button:focus-visible { background: #000; color: var(--accent); border-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }      /* campo trappola anti-robot */
.notice { padding: .8rem 1rem; border: 2px solid; margin: 0 0 1rem; }
.notice.ok { border-color: #4a4; color: #cfc; background: #0a1a0a; }
.notice.err { border-color: #c44; color: #fcc; background: #1a0a0a; }
.notice ul { margin: 0; padding-left: 1.2rem; }
@media (min-width: 760px) { .cform button { width: auto; } }

/* libro in vendita */
.buy { margin: .6rem 0 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.btn { display: inline-block; padding: .6rem 1.1rem; border: 1px solid currentColor; color: var(--accent); font-weight: bold; text-decoration: none; min-height: 44px; box-sizing: border-box; }
.btn:hover, .btn:focus { background: var(--accent); color: #000; }
.price { font-weight: bold; white-space: nowrap; }
.booklist { list-style: none; padding: 0; }
.booklist li { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .4rem 0; border-bottom: 1px solid #333; }
