:root {
  --bg: #111111;
  --panel: #1d1d1d;
  --text: #f4f2ec;
  --muted: #a5a39c;
  --line: #333333;
  --accent: #d6ff62;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

button { font: inherit; }

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 76px;
  padding: 18px 6%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(17,17,17,.96);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 2px;
}

.logo span { color: var(--muted); font-weight: normal; }

.nav { display: flex; gap: 30px; font-size: 13px; }
.nav a:hover, .footer a:hover { color: var(--accent); }

.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 25px;
  cursor: pointer;
}

.hero {
  position: relative;
  padding: 130px 10% 120px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--accent);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 3px;
}

h1, h2 {
  margin: 0;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -2px;
}

h1 { font-size: clamp(42px, 7vw, 88px); }
h2 { font-size: clamp(36px, 5vw, 62px); }

h1 em, h2 em {
  font-family: Georgia, serif;
  font-weight: normal;
}

.intro {
  max-width: 460px;
  margin: 28px 0;
  color: var(--muted);
  font-size: 15px;
}

.button {
  display: inline-block;
  margin-top: 12px;
  padding: 13px 18px;
  border: 1px solid #77776d;
  font-size: 11px;
  letter-spacing: 1px;
  transition: .2s;
}

.button:hover {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}

.section { padding: 95px 7%; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 32px;
}

.accent { color: var(--accent); }
.muted { color: var(--muted); font-size: 13px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 28px;
}

.filter {
  padding: 8px 16px;
  border: 1px solid #444;
  border-radius: 30px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.filter:hover, .filter.active {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 230px;
  gap: 14px;
}

.photo {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  background: var(--panel);
  text-align: left;
  overflow: hidden;
  cursor: pointer;
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s, opacity .3s;
}

.photo:hover img { transform: scale(1.045); opacity: .8; }
.photo.portrait { grid-row: span 2; }
.photo.landscape { grid-column: span 2; }

.photo-info {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 40px 17px 15px;
  color: white;
  background: linear-gradient(transparent, rgba(0,0,0,.8));
}

.photo-info strong { font-size: 14px; }
.photo-info small {
  color: #d0d0ca;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.gallery-note { margin-top: 20px; color: #888; font-size: 11px; }

.about {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.about h2 { margin-bottom: 24px; }
.about .muted { max-width: 600px; line-height: 1.9; }

.contact { text-align: center; }
.contact .muted { margin: 20px 0; }

.footer {
  padding: 25px 6%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.footer p { margin: 0; }
.footer .logo { color: var(--text); }

.lightbox[hidden] { display: none; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 35px;
  background: rgba(0,0,0,.96);
}

.lightbox figure {
  max-width: 88vw;
  max-height: 88vh;
  margin: 0;
  text-align: center;
}

.lightbox figure img {
  display: block;
  max-width: 85vw;
  max-height: 80vh;
  object-fit: contain;
  margin: auto;
}

.lightbox figcaption {
  padding-top: 12px;
  color: #ddd;
  font-size: 12px;
}

.lightbox button {
  position: absolute;
  width: 44px;
  height: 44px;
  border: 1px solid #555;
  border-radius: 50%;
  background: #202020;
  color: white;
  font-size: 28px;
  cursor: pointer;
}

.lightbox .close { top: 20px; right: 20px; }
.lightbox .previous { left: 18px; top: 50%; }
.lightbox .next { right: 18px; top: 50%; }

@media (max-width: 760px) {
  .header { min-height: 66px; }
  .menu-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 65px;
    left: 0;
    right: 0;
    padding: 22px 6%;
    background: #191919;
    flex-direction: column;
    gap: 16px;
  }
  .nav.open { display: flex; }
  .hero { padding: 90px 7%; }
  .section { padding: 65px 5%; }
  .section-heading { display: block; }
  .section-heading > .muted { margin-top: 15px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 170px; gap: 9px; }
  .photo.portrait { grid-row: span 2; }
  .photo.landscape { grid-column: span 2; }
  .footer { align-items: flex-start; }
  .lightbox { padding: 15px; }
  .lightbox .previous { left: 5px; }
  .lightbox .next { right: 5px; }
}

@media (max-width: 420px) {
  .gallery { grid-auto-rows: 135px; }
  .photo-info { padding: 30px 9px 9px; }
  .photo-info strong { font-size: 12px; }
  .photo-info small { font-size: 9px; }
}

/* ===== CORREZIONE GALLERIA FOTOGRAFICA ===== */

.gallery-section {
    padding: 80px 6%;
}

.gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 1400px;
    margin: 35px auto 0;
    align-items: start;
}

.gallery-grid .photo {
    display: block;
    position: relative;
    width: 100%;
    min-width: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    border: none;
    border-radius: 5px;
    background: #202020;
    cursor: pointer;
    text-align: left;
    aspect-ratio: 4 / 3;
}

.gallery-grid .photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-grid .photo:hover img {
    transform: scale(1.04);
}

.gallery-grid .photo span {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 30px 16px 14px;
    color: #fff;
    font-size: 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

/* Tablet */
@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
}

/* Smartphone */
@media (max-width: 560px) {
    .gallery-section {
        padding: 50px 5%;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

/* ===== FILTRI GALLERIA ===== */

.gallery-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 30px auto;
}

.gallery-filters .filter-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #d5d5d5;
    border-radius: 3px;
    padding: 10px 20px;
    margin: 0;
    background: transparent;
    color: #555;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.2s ease,
                color 0.2s ease,
                border-color 0.2s ease;
}

.gallery-filters .filter-btn:hover,
.gallery-filters .filter-btn.active {
    background: #292929;
    border-color: #292929;
    color: #fff;
}

.gallery-filters .filter-btn:focus-visible {
    outline: 2px solid #777;
    outline-offset: 3px;
}

/* ===== CENTRATURA INTESTAZIONE ===== */

.site-header {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 35px 20px 45px;
    gap: 35px;
}

/* Logo e scritta centrati come un unico elemento */
.site-header .brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
}

/* Dimensioni del logo */
.site-header .brand-logo {
    display: block;
    width: 110px;
    height: 110px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Scritta Michilin Gallery */
.site-header .brand-title {
    display: block;
    margin: 0;
    padding: 0;
    font-size: clamp(30px, 4vw, 56px);
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
}

/* Menu centrato sotto il logo */
.site-header .main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    margin: 0 auto;
    gap: 8px;
}

/* Adattamento per smartphone */
@media (max-width: 600px) {
    .site-header .brand {
        gap: 10px;
    }

    .site-header .brand-logo {
        width: 65px;
        height: 65px;
    }

    .site-header .brand-title {
        font-size: clamp(23px, 6vw, 34px);
    }
}