/* martellotta.it – stile pubblico */
:root {
  --bg: #1d1d1d;
  --ink: #1d1d1d;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --nav: #bdbdbd;
  --panel: #ffffff;
  --gap: 24px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Lato, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--muted); }
:focus-visible { outline: 2px solid #4a90d9; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- barra superiore: social a sinistra, logo al centro, menu a destra ---------- */
.topnav {
  position: sticky; top: 0; z-index: 20;
  min-height: 84px;
  background: var(--bg);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  padding: 10px 24px;
  font-family: Montserrat, sans-serif; font-weight: 500; font-size: 15px;
  letter-spacing: .5px; text-transform: uppercase;
}
.social { display: flex; gap: 8px; justify-self: start; }
.social a {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid #3a3a3a; color: var(--nav);
  display: flex; align-items: center; justify-content: center;
}
.social a:hover { color: #fff; border-color: #fff; }
.brand { justify-self: center; display: block; }
.brand img { height: 64px; width: auto; max-width: min(320px, 50vw); object-fit: contain; }
.brand-text { font-family: "Mrs Saint Delafield", cursive; font-size: 46px; line-height: 1; color: #fff; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.brand:hover { color: #fff; opacity: .85; }
.nav-right { justify-self: end; display: flex; align-items: center; gap: 12px; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 0; }
.menu li + li::before { content: "/"; color: #555; margin: 0 14px; }
.menu a { color: var(--nav); white-space: nowrap; }
.menu a:hover, .menu a[aria-current] { color: #fff; }
.menu-toggle { display: none; }
.search { display: flex; align-items: center; }
.search input {
  width: 0; padding: 0; border: 0; opacity: 0;
  background: #2b2b2b; color: #fff; font: inherit; text-transform: none; letter-spacing: 0;
  height: 36px; border-radius: 18px;
  transition: width .25s ease, opacity .25s ease, padding .25s ease;
}
.search.open input, .search input:focus { width: 200px; padding: 0 14px; opacity: 1; }
.search-btn {
  width: 44px; height: 44px; border: 0; background: transparent; color: var(--nav);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.search-btn:hover { color: #fff; }

/* ---------- immagine di copertina: sempre intera ---------- */
.hero { position: relative; background: #2c3440; color: #fff; text-align: center; }
.hero-img { width: 100%; height: auto; display: block; }
.hero.no-image { padding: 56px 20px 72px; }
.hero:not(.no-image) .hero-heading {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 60px 20px 28px;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
}
.hero-heading { display: flex; flex-direction: column; gap: 6px; }
.hero-kicker { font-family: Montserrat, sans-serif; font-weight: 600; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: #ddd; }
.hero-heading h1 { margin: 0; font-family: Montserrat, sans-serif; font-weight: 700; font-size: clamp(26px, 4vw, 36px); letter-spacing: 1px; text-transform: uppercase; }

/* ---------- pannello bianco ---------- */
.panel {
  position: relative;
  max-width: 1304px;
  margin: 0 auto;
  background: var(--panel);
  padding: 72px 64px 80px;
}
.empty { text-align: center; color: var(--muted); margin: 40px 0; }

/* ---------- righe della home ---------- */
.row + .row { margin-top: 80px; }
.row-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 24px;
}
.row-title {
  grid-column: 2; margin: 0;
  font-family: Montserrat, sans-serif; font-weight: 700; font-size: 30px; letter-spacing: 1px; text-transform: uppercase; text-align: center;
}
.row-title a { display: inline-flex; align-items: center; gap: 10px; }
.row-title svg { transition: transform .2s ease; }
.row-title a:hover svg { transform: translateX(4px); }
.row-nav { grid-column: 3; justify-self: end; display: flex; gap: 12px; }
.arrow {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid #cfcfcf; background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.arrow:hover { border-color: var(--ink); }
.arrow:disabled { opacity: .35; cursor: default; border-color: #cfcfcf; }
.track {
  display: flex; gap: var(--gap);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none;
  cursor: grab;
}
.track::-webkit-scrollbar { display: none; }
.track.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.track.dragging .card { pointer-events: none; }
.track .card { flex: 0 0 calc((100% - 3 * var(--gap)) / 4); scroll-snap-align: start; }

/* ---------- schede ---------- */
.card { display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.card-img { display: block; aspect-ratio: 1 / 1; background: #eee; overflow: hidden; margin-bottom: 10px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s ease; }
.card:hover .card-img img { opacity: .85; }
.card:hover { color: var(--ink); }
.card-empty { display: flex; height: 100%; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.card-date { font-size: 13px; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; }
.card-title { font-family: Montserrat, sans-serif; font-weight: 700; font-size: 17px; line-height: 1.3; text-transform: uppercase; }

/* ---------- pagina categoria ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 32px; row-gap: 56px; }
.grid .card-title { font-size: 18px; }
.more-wrap { display: flex; justify-content: center; margin-top: 64px; }
.more {
  display: inline-flex; align-items: center; height: 52px; padding: 0 36px;
  border: 1px solid var(--ink); background: #fff; color: var(--ink);
  font-family: Montserrat, sans-serif; font-weight: 600; font-size: 14px; letter-spacing: 1px; text-transform: uppercase;
}
.more:hover { background: var(--ink); color: #fff; }
.more.loading { opacity: .5; pointer-events: none; }

/* ---------- galleria ---------- */
.gallery { text-align: center; }
.gallery-date { margin: 0; font-family: Montserrat, sans-serif; font-size: 14px; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; }
.gallery-title { margin: 8px 0 0; font-family: Montserrat, sans-serif; font-weight: 700; font-size: clamp(28px, 4vw, 44px); line-height: 1.15; text-transform: uppercase; }
.gallery-cat { margin: 10px 0 0; font-size: 15px; }
.gallery-cat a { color: var(--muted); border-bottom: 1px solid var(--line); }
.photos { margin-top: 48px; columns: 3; column-gap: 12px; text-align: left; }
.gallery-section {
  margin: 72px 0 0; padding-top: 28px; border-top: 1px solid var(--line);
  font-family: Montserrat, sans-serif; font-weight: 700; font-size: clamp(20px, 2.4vw, 28px); letter-spacing: 1px; text-transform: uppercase;
}
.gallery-section + .photos { margin-top: 28px; }
.photo { display: block; margin-bottom: 12px; break-inside: avoid; background: #eee; }
.photo img { width: 100%; height: auto; }
.photo:hover img { opacity: .9; }

/* ---------- pagine di testo ---------- */
.page { max-width: 720px; margin: 0 auto; }
.page-title { text-align: center; margin: 0 0 40px; font-family: Montserrat, sans-serif; font-weight: 700; font-size: clamp(28px, 4vw, 40px); text-transform: uppercase; }
.page-content a { border-bottom: 1px solid #bbb; }
.page-content img { height: auto; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 15, 15, .96);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 88vh; width: auto; height: auto; object-fit: contain; user-select: none; }
.lightbox button {
  position: absolute; width: 56px; height: 56px; border: 0; border-radius: 50%;
  background: transparent; color: #eee; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lightbox button:hover { background: rgba(255,255,255,.08); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: #aaa; font-size: 14px; }

/* ---------- piè di pagina ---------- */
.footer {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 24px;
  padding: 48px 20px; color: #a8a8a8; font-size: 14px;
}
.footer a { color: #a8a8a8; }
.footer a:hover { color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .panel { margin: 0 24px; padding: 56px 40px 64px; }
  .menu li + li::before { margin: 0 10px; }
  .track .card { flex-basis: calc((100% - 2 * var(--gap)) / 3); }
}
@media (max-width: 800px) {
  .topnav { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 8px 10px; min-height: 64px; }
  .social { gap: 0; }
  .social a { width: 32px; height: 32px; border: 0; }
  .brand { min-width: 0; max-width: 100%; }
  .brand img { height: 44px; max-width: 100%; }
  .brand-text { font-size: 30px; }
  .search-btn, .menu-toggle { width: 38px !important; }
  .nav-right { gap: 0; }
  .menu-toggle {
    display: flex; width: 44px; height: 44px; border: 0; background: transparent; color: #fff;
    align-items: center; justify-content: center; cursor: pointer;
  }
  .menu {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: var(--bg); padding: 8px 24px 20px;
  }
  .menu.open { display: flex; }
  .menu li + li::before { display: none; }
  .menu a { display: block; padding: 12px 0; }
  .search.open input, .search input:focus { width: 140px; }
  .search.open ~ .menu-toggle { display: none; }
  .panel { margin: 0; padding: 40px 20px 56px; }
  .row + .row { margin-top: 56px; }
  .row-head { grid-template-columns: 1fr auto; }
  .row-title { grid-column: 1; text-align: left; font-size: 24px; }
  .row-nav { grid-column: 2; }
  .track .card { flex-basis: 72%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; row-gap: 36px; }
  .grid .card-title, .card-title { font-size: 15px; }
  .photos { columns: 2; column-gap: 8px; }
  .photo { margin-bottom: 8px; }
  .gallery-section { margin-top: 48px; padding-top: 20px; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .row-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
