/* ==========================================================================
   Al.Ma. s.n.c. di Matteini M. & C. — Soluzioni per l'abitare
   Ricostruzione HTML5 del sito originale in Flash (2006, design di
   Gianluca Cirulli). Palette, tipografie e struttura ricalcano l'originale.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,opsz,wght@0,6..96,400;0,6..96,500;0,6..96,600;1,6..96,500&family=Jost:wght@400;500;600&family=Caveat:wght@600;700&display=swap');

:root{
  --charcoal: #2e2e2f;
  --charcoal-2: #3a3a3b;
  --slate: #8798a3;
  --slate-dark: #71838f;
  --slate-darker: #5c6d78;
  --cream: #f6f3ec;
  --paper: #eceae6;
  --ink: #26241f;
  --overlay: rgba(32, 27, 22, .74);
  --divider: rgba(255,255,255,.35);
  --accent: #c9a15a;
  --shadow: 0 18px 50px rgba(0,0,0,.28);
  --radius: 2px;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; }

body{
  margin: 0;
  min-height: 100vh;
  font-family: 'Jost', 'Futura', 'Century Gothic', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 15% -10%, #f2eee5 0%, transparent 60%),
    radial-gradient(1200px 800px at 100% 110%, #e7e2d6 0%, transparent 55%),
    #dedad0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.app{
  width: 100%;
  max-width: 1180px;
  min-height: min(720px, 92vh);
  background: var(--paper);
  box-shadow: var(--shadow);
  display: flex;
  overflow: hidden;
  position: relative;
  border-radius: var(--radius);
}

/* ---------------------------------------------------------------- sidebar */

.sidebar{
  flex: 0 0 280px;
  background: linear-gradient(180deg, var(--slate) 0%, var(--slate-dark) 55%, var(--slate-darker) 100%);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 20;
}

.brand{
  background: var(--charcoal);
  padding: 30px 28px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-name{
  font-family: 'Bodoni Moda', serif;
  font-weight: 500;
  font-size: 2.6rem;
  line-height: 1;
  letter-spacing: .5px;
  color: #fff;
  margin: 0 0 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--divider);
}

.brand-tag{
  display: block;
  font-family: 'Caveat', cursive;
  font-weight: 600;
  font-size: 1.5rem;
  color: #fff;
  opacity: .92;
  margin-top: 6px;
}

.nav{
  list-style: none;
  margin: 0;
  padding: 34px 0 0;
  flex: 1;
}

.nav li + li{ margin-top: 4px; }

.nav a, .nav button.navlink{
  appearance: none;
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  font-family: 'Jost', sans-serif;
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(255,255,255,.88);
  padding: 10px 28px;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, padding-left .2s ease;
}

.nav a::before, .nav button.navlink::before{
  content: "";
  width: 14px;
  height: 1px;
  background: rgba(255,255,255,.65);
  flex: 0 0 auto;
  transition: width .2s ease, background .2s ease;
}

.nav a:hover, .nav button.navlink:hover{
  background: rgba(0,0,0,.14);
  padding-left: 33px;
  color: #fff;
}

.nav li.active a, .nav li.active button.navlink{
  background: rgba(0,0,0,.22);
  color: #fff;
}
.nav li.active a::before, .nav li.active button.navlink::before{
  width: 22px;
  background: var(--accent);
}

.sidebar-foot{
  padding: 16px 28px 22px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.music-toggle{
  appearance: none;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.15);
  color: #fff;
  border-radius: 30px;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Jost', sans-serif;
  font-size: .72rem;
  letter-spacing: .08em;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.music-toggle:hover{ background: rgba(0,0,0,.3); border-color: rgba(255,255,255,.6); }
.music-toggle svg{ width: 15px; height: 15px; display: block; }
.music-toggle .state{ min-width: 26px; text-align: left; }

.sidebar-credit{
  font-size: .62rem;
  color: rgba(255,255,255,.55);
  letter-spacing: .03em;
}

/* --------------------------------------------------------------- content */

.stage{
  flex: 1;
  position: relative;
  min-width: 0;
  height: auto;
}

.page{
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease;
  overflow: auto;
}
.page.active{
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

/* ----- home / hero ----- */

.hero{
  height: 100%;
  min-height: 460px;
  display: flex;
  background-size: cover;
  background-position: center;
  position: relative;
}

.hero-strip{
  position: relative;
  flex: 1;
  overflow: hidden;
  cursor: pointer;
}

.hero-strip + .hero-strip{ border-left: 1px solid rgba(255,255,255,.25); }

.hero-strip::after{
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(15,12,9,.85) 100%);
  opacity: 0;
  transition: opacity .3s ease, background .3s ease;
}

.hero-strip:hover::after{ opacity: 1; background: rgba(20,16,12,.38); }

.hero-strip span{
  position: absolute;
  left: 0; right: 0; bottom: 16px;
  text-align: center;
  color: #fff;
  font-family: 'Bodoni Moda', serif;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: .06em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
  padding: 0 8px;
}
.hero-strip:hover span{ opacity: 1; transform: translateY(0); }

.hero-welcome{
  position: absolute;
  top: 26px; left: 26px;
  color: #fff;
  z-index: 3;
  pointer-events: none;
  text-shadow: 0 2px 14px rgba(0,0,0,.55);
}
.hero-welcome small{
  display: block;
  font-family: 'Jost';
  letter-spacing: .18em;
  font-size: .68rem;
  text-transform: uppercase;
  opacity: .9;
  margin-bottom: 6px;
}
.hero-welcome strong{
  font-family: 'Bodoni Moda', serif;
  font-weight: 500;
  font-size: 1.5rem;
  display: block;
  max-width: 260px;
  line-height: 1.25;
}

/* ----- photo sections (chi / filo / servi / dove / foto) ----- */

.section-photo{
  height: 100%;
  min-height: 460px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  padding: 5%;
  position: relative;
}

.panel{
  background: var(--overlay);
  color: #f3efe8;
  padding: 34px 38px;
  max-width: 480px;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
  backdrop-filter: saturate(120%);
}

.panel h2{
  font-family: 'Bodoni Moda', serif;
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: .04em;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.4);
}

.panel p{
  font-size: .92rem;
  line-height: 1.65;
  margin: 0 0 12px;
  font-weight: 400;
  color: #efece5;
}
.panel p:last-child{ margin-bottom: 0; }

.services-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.services-grid li{
  font-size: .88rem;
  padding: 6px 0;
  border-bottom: 1px dotted rgba(255,255,255,.18);
}
.services-grid li::before{
  content: "— ";
  color: var(--accent);
}

.contact-block p{ margin: 0 0 8px; font-size: .9rem; line-height: 1.6; }
.contact-block a{ color: #fff; }
.contact-block strong{ font-weight: 600; }

.map-btn{
  margin-top: 18px;
  display: inline-block;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  font-family: 'Jost';
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 11px 18px;
  cursor: pointer;
  transition: background .2s ease;
}
.map-btn:hover{ background: rgba(255,255,255,.2); }

.map-embed{
  margin-top: 18px;
  width: 100%;
  height: 220px;
  border: 0;
  display: none;
  filter: grayscale(.15) contrast(1.02);
}
.map-embed.shown{ display: block; }

/* ----- gallery ----- */

.gallery-wrap{
  height: 100%;
  min-height: 460px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5%;
}
.gallery-panel{
  background: var(--overlay);
  padding: 30px 34px 34px;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
  width: 100%;
  max-width: 620px;
}
.gallery-panel h2{
  font-family: 'Bodoni Moda', serif;
  font-weight: 500;
  font-size: 1.4rem;
  color: #fff;
  text-align: right;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.4);
}
.gallery-grid{
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.gallery-grid button{
  appearance: none; border: 2px solid rgba(255,255,255,.5); padding: 0;
  aspect-ratio: 1 / 1;
  background: #000;
  cursor: pointer;
  overflow: hidden;
  border-radius: 1px;
}
.gallery-grid img{
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: .88;
  transition: opacity .2s ease, transform .3s ease;
}
.gallery-grid button:hover img{ opacity: 1; transform: scale(1.06); }

/* ----- lightbox ----- */

.lightbox{
  position: fixed; inset: 0;
  background: rgba(10,8,6,.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 40px 20px;
}
.lightbox.open{ display: flex; }
.lightbox img{
  max-width: min(86vw, 640px);
  max-height: 82vh;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  border: 6px solid #fff;
}
.lightbox-close, .lightbox-prev, .lightbox-next{
  position: absolute;
  appearance: none; border: 0;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  font-family: 'Jost';
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover{ background: rgba(255,255,255,.28); }
.lightbox-close{ top: 22px; right: 22px; width: 40px; height: 40px; border-radius: 50%; font-size: 1.1rem; }
.lightbox-prev, .lightbox-next{ top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; font-size: 1.3rem; }
.lightbox-prev{ left: 16px; }
.lightbox-next{ right: 16px; }

/* --------------------------------------------------------------- mobile */

.menu-toggle{
  display: none;
}

@media (max-width: 860px){
  body{ padding: 0; align-items: flex-start; }
  .app{ flex-direction: column; min-height: 100vh; border-radius: 0; }
  .sidebar{ flex: 0 0 auto; }
  .brand{ padding: 18px 20px 14px; display:flex; align-items: baseline; gap: 12px; }
  .brand-name{ font-size: 1.7rem; border: 0; padding: 0; margin: 0; }
  .brand-tag{ font-size: 1.1rem; margin: 0; }
  .menu-toggle{
    display: inline-flex;
    margin-left: auto;
    appearance: none; border: 1px solid rgba(255,255,255,.4); background: rgba(0,0,0,.15);
    color: #fff; width: 38px; height: 34px; align-items: center; justify-content: center;
    cursor: pointer;
  }
  .nav{
    padding: 6px 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }
  .nav.open{ max-height: 360px; }
  .sidebar-foot{ padding: 12px 20px; }
  .hero{ min-height: 0; height: auto; aspect-ratio: 3 / 4; }
  .hero-strip span{ opacity: 1; transform: none; bottom: 6px; font-size: .6rem; letter-spacing: 0; padding: 0 2px; line-height: 1.15; }
  .hero-strip::after{ opacity: .55; }
  .section-photo, .gallery-wrap{ min-height: 0; padding: 26px 18px; }
  .panel, .gallery-panel{ padding: 22px 20px; max-width: none; }
  .services-grid{ grid-template-columns: 1fr; }
  .gallery-grid{ grid-template-columns: repeat(3, 1fr); }
}
