/* ============================================================
   Sofia Gallo — sofiagallo.it
   Main stylesheet
   Fonts: Pompiere (display), Montserrat (body/UI)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Pompiere&display=swap');

/* ── Variables ──────────────────────────────────────────── */
:root {
  --red:      #e02b20;
  --black:    #000000;
  --white:    #ffffff;
  --grey-lt:  #f5f5f5;
  --grey-md:  #888888;
  --teal:     rgba(126, 190, 197, 0.35);
  --nav-h:    70px;
  --max-w:    1200px;
  --font-display: 'Pompiere', cursive;
  --font-body:    'Montserrat', sans-serif;
  --transition:   0.25s ease;
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--black);
  background: var(--white);
  overflow-x: hidden;
}

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

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

p { line-height: 1.75; margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

ul { list-style: none; }

/* ── Navigation ─────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 1000;
  transition: background var(--transition);
}

.nav__brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--white);
  letter-spacing: 1px;
  white-space: nowrap;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__item {
  position: relative;
}

.nav__link {
  display: block;
  padding: 8px 16px;
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color var(--transition);
}
.nav__link:hover { color: var(--red); }

/* Dropdown */
.nav__dropdown {
  display: none;
  position: absolute;
  top: calc(var(--nav-h) / 2 + 14px);
  left: 0;
  min-width: 220px;
  background: rgba(0, 0, 0, 0.94);
  padding: 8px 0;
  border-top: 2px solid var(--red);
}

.nav__item:hover .nav__dropdown { display: block; }

.nav__dropdown a {
  display: block;
  padding: 10px 20px;
  color: var(--white);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color var(--transition), background var(--transition);
}
.nav__dropdown a:hover {
  color: var(--red);
  background: rgba(255,255,255,0.05);
}

/* Hamburger (mobile) */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: transform var(--transition), opacity var(--transition);
}
.nav__toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.active span:nth-child(2) { opacity: 0; }
.nav__toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.nav__mobile {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: rgba(0,0,0,0.96);
  padding: 20px 0 30px;
  z-index: 999;
  overflow-y: auto;
  max-height: calc(100vh - var(--nav-h));
}
.nav__mobile.open { display: block; }

.nav__mobile a {
  display: block;
  padding: 12px 30px;
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.nav__mobile a:hover { color: var(--red); }
.nav__mobile .mobile-sub a {
  padding-left: 50px;
  font-weight: 400;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
}

/* ── Page offset for fixed nav ───────────────────────────── */
.page-body { padding-top: var(--nav-h); }

/* ── Hero Section ────────────────────────────────────────── */
.hero {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero--full  { min-height: calc(100vh - var(--nav-h)); }
.hero--large { min-height: 580px; }
.hero--medium{ min-height: 480px; }
.hero--small { min-height: 380px; }

.hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}
.hero__overlay--gradient {
  background: radial-gradient(circle at 25% 50%, rgba(0,0,0,0.75) 15%, rgba(0,0,0,0.01) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  padding: 40px 24px;
  max-width: 900px;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  color: var(--white);
  letter-spacing: 3px;
  line-height: 1.05;
  text-shadow: 1px 2px 8px rgba(0,0,0,0.5);
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--white);
  font-weight: 300;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 12px;
  text-shadow: 1px 1px 6px rgba(0,0,0,0.5);
}

.hero__page-title {
  font-family: var(--font-body);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--white);
  letter-spacing: 5px;
  text-transform: uppercase;
  text-shadow: 1px 2px 8px rgba(0,0,0,0.6);
}

/* ── Layout ──────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 30px;
}

.section { padding: 70px 0; }
.section--sm { padding: 40px 0; }
.section--lg { padding: 100px 0; }
.section--grey { background: var(--grey-lt); }
.section--black { background: var(--black); color: var(--white); }
.section--red { background: var(--red); color: var(--white); }

.divider {
  border: none;
  border-top: 1px solid var(--teal);
  margin: 0 auto;
  max-width: 900px;
}

/* ── Typography ──────────────────────────────────────────── */
.section-title {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.section-title--center { text-align: center; }
.section-title--red { color: var(--red); }

.display-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
}

/* ── Book Grid (Libri page) ──────────────────────────────── */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 30px 24px;
}

.book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.book-card:hover .book-card__cover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.18); }

.book-card__cover {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.book-card__title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

/* ── Book Detail Page ────────────────────────────────────── */
.book-detail {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 60px;
  align-items: start;
  padding: 60px 0;
}

.book-detail__cover img {
  max-width: 320px;
  margin: 0 auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.book-detail__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  margin-bottom: 24px;
}

.book-detail__description {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.85;
  margin-bottom: 28px;
  color: #222;
}

.book-detail__meta {
  border-top: 1px solid #e0e0e0;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
}

.book-detail__meta-row {
  display: flex;
  gap: 8px;
}
.book-detail__meta-label { font-weight: 600; min-width: 130px; }
.book-detail__meta-value { color: #444; }

.book-detail__buy {
  display: inline-block;
  margin-top: 28px;
  padding: 12px 30px;
  background: var(--red);
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: background var(--transition);
  min-width: 200px;
  text-align: center;
}
.book-detail__buy:hover { background: #b5221a; }

/* Reviews */
.reviews { margin-top: 50px; }
.reviews__title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
  color: var(--grey-md);
}

.review {
  border-left: 3px solid var(--teal);
  padding: 12px 0 12px 20px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.7;
  color: #333;
}
.review__author {
  display: block;
  margin-top: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--grey-md);
}

/* ── Home Page Sections ──────────────────────────────────── */
.home-bio {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.home-bio__text { font-weight: 300; line-height: 1.85; }
.home-bio__text h2 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.home-bio__image img {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* Featured book */
.featured-book {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 50px;
  align-items: center;
  background: var(--grey-lt);
  padding: 50px 40px;
  border-left: 4px solid var(--red);
}

.featured-book__cover { width: 160px; flex-shrink: 0; }
.featured-book__cover img { box-shadow: 0 6px 20px rgba(0,0,0,0.15); }
.featured-book__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.featured-book__title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 14px;
}
.featured-book__excerpt { font-weight: 300; font-size: 0.95rem; line-height: 1.8; color: #333; }

/* Logos strip */
.logos-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 30px 40px;
}
.logos-strip img {
  height: 40px;
  width: auto;
  object-fit: contain;
  filter: grayscale(1) opacity(0.65);
  transition: filter var(--transition);
}
.logos-strip img:hover { filter: grayscale(0) opacity(1); }

/* Announcements / Lunii */
.announcement {
  background: var(--black);
  color: var(--white);
  padding: 40px;
  border-left: 4px solid var(--red);
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.85;
}
.announcement a { color: var(--red); text-decoration: underline; }

/* ── Laboratori Page ─────────────────────────────────────── */
.lab-section {
  position: relative;
  background-size: cover;
  background-position: center;
  min-height: 400px;
  display: flex;
  align-items: center;
}

.lab-section__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}

.lab-section__content {
  position: relative;
  z-index: 1;
  color: var(--white);
  max-width: 700px;
  padding: 60px 40px;
}

.lab-section__title {
  font-family: var(--font-body);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 20px;
  color: var(--white);
}

.lab-section__body {
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.85;
}

.lab-section__body a {
  color: var(--red);
  font-weight: 600;
  text-decoration: underline;
}

/* Lab downloads */
.lab-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.lab-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid var(--white);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: background var(--transition), color var(--transition);
}
.lab-download:hover { background: var(--white); color: var(--black); }

/* ── Contatti Page ───────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.contact-social {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-social__link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 1px;
  padding: 14px 0;
  border-bottom: 1px solid #e0e0e0;
  transition: color var(--transition);
}
.contact-social__link:hover { color: var(--red); }

.contact-social__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Contact Form */
.contact-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #555;
}

.form-input, .form-textarea, .form-select {
  padding: 12px 16px;
  border: 1px solid #ccc;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
  background: var(--white);
}
.form-input:focus, .form-textarea:focus { border-color: var(--black); }

.form-textarea { resize: vertical; min-height: 130px; }

.form-submit {
  padding: 14px 32px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  align-self: flex-start;
  min-width: 200px;
}
.form-submit:hover { background: var(--red); }

.form-success {
  display: none;
  padding: 16px 20px;
  background: #e8f5e9;
  border-left: 4px solid #4caf50;
  font-size: 0.9rem;
  color: #2e7d32;
}
.form-success.visible { display: block; }

/* ── Anchor sections (Libri) ─────────────────────────────── */
.anchor-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}

.libri-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin-bottom: 40px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--teal);
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  background: var(--black);
  color: rgba(255,255,255,0.7);
  padding: 50px 0 30px;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
}

.footer__brand {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--white);
  letter-spacing: 1px;
}

.footer__tagline {
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
}

.footer__social {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  transition: border-color var(--transition), color var(--transition);
}
.footer__social-link:hover { border-color: var(--red); color: var(--red); }

.footer__nav { display: flex; flex-direction: column; gap: 10px; }
.footer__nav a {
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  transition: color var(--transition);
}
.footer__nav a:hover { color: var(--white); }

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: var(--grey-md);
  padding: 16px 0;
}
.breadcrumb a { color: var(--grey-md); }
.breadcrumb a:hover { color: var(--black); }
.breadcrumb__sep { margin: 0 8px; }

/* ── Utilities ───────────────────────────────────────────── */
.text-center { text-align: center; }
.text-red { color: var(--red); }
.mt-sm { margin-top: 20px; }
.mt-md { margin-top: 40px; }
.mt-lg { margin-top: 70px; }
.mb-sm { margin-bottom: 20px; }
.mb-md { margin-bottom: 40px; }

.btn {
  display: inline-block;
  padding: 12px 32px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  min-width: 200px;
  transition: background var(--transition), color var(--transition);
}
.btn--black { background: var(--black); color: var(--white); }
.btn--black:hover { background: var(--red); }
.btn--red { background: var(--red); color: var(--white); }
.btn--red:hover { background: #b5221a; }
.btn--outline { border: 2px solid var(--black); color: var(--black); }
.btn--outline:hover { background: var(--black); color: var(--white); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
  .nav { padding: 0 20px; }

  .home-bio { grid-template-columns: 1fr; }
  .home-bio__image { order: -1; }

  .book-detail {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .book-detail__cover img { max-width: 200px; }

  .contact-grid { grid-template-columns: 1fr; }

  .featured-book {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .featured-book__cover { width: 120px; margin: 0 auto; }

  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 20px 16px;
  }
}

@media (max-width: 600px) {
  .container { padding: 0 18px; }
  .section { padding: 50px 0; }

  .hero--full { min-height: 75vh; }
  .hero--large { min-height: 380px; }

  .lab-section__content { padding: 40px 20px; }
  .footer__inner { flex-direction: column; }

  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 16px 12px;
  }
}
