/* Migliardi Modelli — stylesheet */

:root {
  --color-bg: #faf7f2;
  --color-bg-alt: #f1ebe1;
  --color-surface: #ffffff;
  --color-text: #2a221a;
  --color-text-muted: #6b5d4f;
  --color-border: #e4dbcb;
  --color-wood: #7a4a2b;
  --color-wood-dark: #4a2e1c;
  --color-accent: #b5651d;
  --color-gold: #c9a15a;
  --font-heading: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --nav-height: 76px;
  --container-w: 1180px;
  --radius: 6px;
  --shadow: 0 6px 24px rgba(42, 34, 26, 0.08);
  --shadow-lg: 0 16px 48px rgba(42, 34, 26, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a {
  color: var(--color-wood);
  text-decoration: none;
}
a:hover { color: var(--color-accent); }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-wood-dark);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Top navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--color-wood-dark);
}
.brand:hover { color: var(--color-accent); }
.brand:hover .brand-mark { box-shadow: inset 0 0 0 1.5px var(--color-gold), 0 0 0 3px rgba(201,161,90,0.25); }

.brand-mark {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--color-wood) 0%, var(--color-wood-dark) 100%);
  box-shadow: inset 0 0 0 1.5px rgba(201, 161, 90, 0.55);
  color: #f3e6cf;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: box-shadow 0.2s;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-accent);
  border-bottom-color: var(--color-gold);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}
.lang-switch button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--color-text-muted);
}
.lang-switch button[aria-pressed="true"] {
  background: var(--color-wood-dark);
  color: #fff;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px 0;
  background: var(--color-wood-dark);
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--color-surface);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 24px 16px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { width: 100%; padding: 12px 0; }
  .nav-actions { gap: 12px; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 72px 0;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(250,247,242,0.2), rgba(250,247,242,1)),
    var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

.hero .eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 14px;
}

.hero p.lead {
  max-width: 620px;
  margin: 0 auto;
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

/* two-column hero (home page) */
.hero-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  text-align: left;
}
.hero-split .lead { margin: 0; }
.hero-split .hero-actions { margin-top: 28px; }
.hero-figure {
  position: relative;
  justify-self: center;
}
.hero-figure::before {
  content: "";
  position: absolute;
  inset: -24px -16px auto auto;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(201,161,90,0.35) 0%, rgba(201,161,90,0) 70%);
  z-index: 0;
}
.hero-figure img {
  position: relative;
  z-index: 1;
  width: 380px;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  border: 6px solid var(--color-surface);
}
.hero-figure .tag {
  position: absolute;
  z-index: 2;
  bottom: -18px;
  left: -18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 10px 16px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-wood-dark);
}
.hero-figure .tag span {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

@media (max-width: 860px) {
  .hero-split { grid-template-columns: 1fr; text-align: center; }
  .hero-split .lead { margin: 0 auto; }
  .hero-figure { margin-top: 20px; }
  .hero-figure::before { inset: -24px 0 auto auto; }
}

/* ---------- Gallery grid ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding: 48px 0 72px;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-gold);
}

.gallery-item .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.gallery-item .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover .thumb img { transform: scale(1.06); }

.gallery-item .caption {
  padding: 14px 16px 16px;
}
.gallery-item .caption h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--color-wood-dark);
}

/* plain thumbnail grid used inside a model detail page (no link caption) */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin: 24px 0 8px;
}
.thumb-grid button {
  padding: 0; border: 0; cursor: zoom-in;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--color-bg-alt);
  box-shadow: var(--shadow);
}
.thumb-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.thumb-grid button:hover img { transform: scale(1.08); }

/* ---------- Content sections / cards ---------- */

.section { padding: 64px 0; }
.section-alt { background: var(--color-bg-alt); }

.prose { max-width: 760px; }
.prose p { color: var(--color-text); }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.about-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  align-items: start;
}
.about-layout img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
@media (max-width: 760px) {
  .about-layout { grid-template-columns: 1fr; }
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 8px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-wood-dark);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 6px 14px;
}

/* ---------- Model detail page ---------- */

.model-hero {
  padding: 40px 0 8px;
}
.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--color-text-muted); text-decoration: underline; }

.model-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 0 64px;
  border-top: 1px solid var(--color-border);
  margin-top: 32px;
}
.model-pager a {
  font-weight: 600;
  color: var(--color-wood-dark);
}
.model-pager .dir { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); font-weight: 500; }

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 760px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.contact-list .icon {
  width: 20px; text-align: center;
  color: var(--color-accent);
}
.map-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--color-wood-dark);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: var(--color-accent); color: #fff; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--color-wood-dark);
  border: 1.5px solid var(--color-wood-dark);
}
.btn-outline:hover { background: var(--color-wood-dark); color: #fff; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--color-wood-dark);
  color: #e7dccb;
  padding: 40px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.social-links {
  display: flex;
  gap: 16px;
}
.social-links a {
  color: #e7dccb;
  font-size: 1.15rem;
}
.social-links a:hover { color: var(--color-gold); }
.site-footer .copy {
  font-size: 0.85rem;
  color: #b9a98c;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 6, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 32px;
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 84vh;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox button {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 50%;
  width: 40px; height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
}
.lightbox .lb-close { top: 24px; right: 24px; }
.lightbox .lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lightbox button:hover { background: rgba(255,255,255,0.25); }

@media (max-width: 600px) {
  .lightbox .lb-prev, .lightbox .lb-next { width: 34px; height: 34px; }
}
