:root {
  --ink: #111827;
  --muted: #6b625f;
  --paper: #faf8f4;
  --card: #ffffff;
  --line: #e8e1da;
  --accent: #0b1a2f;
  --accent-soft: #f0ede8;
  --shadow: 0 18px 45px rgba(17, 24, 39, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.container { width: min(1120px, calc(100% - 36px)); margin-inline: auto; }

.site-header {
  background: rgba(250, 248, 244, .95);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 92px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-logo { width: 174px; height: 54px; object-fit: contain; object-position: left center; mix-blend-mode: multiply; }
.brand-text { display: none; flex-direction: column; letter-spacing: .03em; }
.brand-text strong { font-family: Georgia, serif; font-size: 1.25rem; text-transform: uppercase; letter-spacing: .16em; }
.brand-text small { color: var(--muted); }
.main-nav { display: flex; align-items: center; gap: 22px; font-size: .95rem; }
.main-nav a { text-decoration: none; color: var(--accent); }
.main-nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.contact-link { border: 1px solid var(--accent); border-radius: 999px; padding: 9px 15px; }
.contact-link:hover { background: var(--accent); color: #fff; text-decoration: none !important; }

.intro { padding: 64px 0 36px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .18em; font-size: .76rem; font-weight: 700; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(2.3rem, 7vw, 5.4rem); max-width: 850px; letter-spacing: -.04em; }
@media (min-width: 821px) {
  .intro h1 {
    font-size: clamp(2.8rem, 4.5vw, 3.8rem);
    max-width: none;
    white-space: nowrap;
  }
}
.intro p:last-child { max-width: 640px; color: var(--muted); font-size: 1.12rem; }

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin: 22px auto 74px; }
.choice-card { min-height: 300px; position: relative; overflow: hidden; border-radius: 18px; box-shadow: var(--shadow); text-decoration: none; background: var(--accent); }
.choice-card img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; transition: transform .45s ease; }
.choice-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 10, 18, .12), rgba(4, 10, 18, .58)); }
.choice-card span { position: absolute; left: 28px; bottom: 24px; z-index: 1; color: #fff; font-size: clamp(1.8rem, 4vw, 3rem); font-family: Georgia, serif; letter-spacing: .05em; text-transform: uppercase; }
.choice-card:hover img { transform: scale(1.045); }

.books-section { padding: 0 0 82px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.section-heading h2 { font-size: clamp(2rem, 4vw, 3.3rem); }
.books-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px; }
.book-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: 0 8px 24px rgba(17, 24, 39, .05); }
.book-cover-link { display: block; border-radius: 12px; overflow: hidden; background: var(--accent-soft); }
.book-cover-link img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; transition: transform .35s ease; }
.book-cover-link:hover img { transform: scale(1.035); }
.book-card h3 { font-size: 1.05rem; margin: 14px 0 4px; font-family: Georgia, serif; }
.book-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.book-card .price { margin-top: 9px; color: var(--accent); font-weight: 800; }

.page-hero { position: relative; min-height: 360px; display: grid; place-items: center; overflow: hidden; margin-bottom: 64px; }
.page-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-hero::after { content: ""; position: absolute; inset: 0; background: rgba(5, 11, 19, .48); }
.page-hero-content { position: relative; z-index: 1; text-align: center; color: #fff; padding: 30px; }
.page-hero-content .eyebrow { color: rgba(255,255,255,.78); }
.page-hero-content h1 { font-size: clamp(3rem, 8vw, 6rem); }
.content-panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 34px; margin-bottom: 76px; box-shadow: var(--shadow); }
.button { display: inline-block; margin-top: 14px; background: var(--accent); color: #fff; text-decoration: none; padding: 12px 18px; border-radius: 999px; }

.back-link { display: inline-block; margin: 34px 0 22px; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--accent); }
.book-detail { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: 46px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); margin-bottom: 76px; }
.book-detail img { width: 100%; border-radius: 14px; box-shadow: 0 20px 42px rgba(17, 24, 39, .18); }
.book-detail h1 { font-size: clamp(2.3rem, 5vw, 4.4rem); margin-bottom: 16px; }
.meta-list { display: grid; gap: 10px; margin: 0 0 24px; }
.meta-row { display: grid; grid-template-columns: 110px 1fr; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.meta-row dt { color: var(--muted); font-weight: 700; }
.meta-row dd { margin: 0; }
.description { color: #302b29; white-space: pre-line; }

.site-footer { border-top: 1px solid var(--line); background: #f1eee8; padding: 34px 0; color: var(--muted); font-size: .94rem; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.notice { color: var(--muted); padding: 18px; border: 1px dashed var(--line); border-radius: 12px; background: rgba(255,255,255,.5); }

@media (max-width: 820px) {
  .header-inner { align-items: flex-start; flex-direction: column; padding: 16px 0; }
  .main-nav { flex-wrap: wrap; gap: 14px; }
  .brand-logo { width: 148px; }
  .choice-grid, .book-detail { grid-template-columns: 1fr; }
  .books-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .container { width: min(100% - 26px, 1120px); }
  .books-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 230px; }
  .book-detail { padding: 18px; }
  .meta-row { grid-template-columns: 1fr; gap: 2px; }
}

/* Stamperia: menu verticale e sottopagine */
.print-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-bottom: 76px;
}
.print-sidebar,
.print-content {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.print-sidebar {
  padding: 22px;
  position: sticky;
  top: 116px;
}
.print-sidebar h2 {
  font-size: 1.55rem;
  margin-bottom: 16px;
}
.print-menu {
  display: grid;
  gap: 8px;
}
.print-menu-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  display: block;
  font: inherit;
  line-height: 1.35;
  padding: 12px 13px;
  text-align: left;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.print-menu-item:hover,
.print-menu-item.is-active {
  background: var(--accent-soft);
  border-color: var(--line);
  transform: translateX(2px);
}
.print-menu-item.is-active {
  font-weight: 800;
}
.print-menu-home {
  margin-top: 12px;
  border-color: var(--accent);
  text-align: center;
}
.print-content {
  min-height: 520px;
  padding: 34px;
}
.print-panel {
  display: none;
  animation: panelFade .22s ease;
}
.print-panel.is-active {
  display: block;
}
.print-panel h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  margin-bottom: 24px;
}
.print-panel img {
  width: min(100%, 720px);
  margin: 0 auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.print-panel p {
  color: var(--muted);
  font-size: 1.12rem;
  font-weight: 700;
  text-align: center;
}
@keyframes panelFade {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 820px) {
  .print-layout { grid-template-columns: 1fr; }
  .print-sidebar { position: static; }
  .print-content { padding: 22px; min-height: auto; }
}

/* Correzione v4: menu servizi sempre verticale e contenuto singolo */
.print-layout {
  display: grid !important;
  grid-template-columns: 290px minmax(0, 1fr) !important;
  gap: 28px !important;
  align-items: start !important;
}
.print-menu {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
}
.print-menu-item {
  display: block !important;
  width: 100% !important;
  text-align: left !important;
}
.print-panel {
  display: none !important;
}
.print-panel.is-active {
  display: block !important;
}
@media (max-width: 820px) {
  .print-layout {
    grid-template-columns: 1fr !important;
  }
}

/* Versione v6: pagine servizio separate nella sezione Stamperia */
.print-frame-wrap {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.service-page-body {
  margin: 0;
  background: #fff;
  color: #172033;
}

.service-page {
  padding: 34px 38px 42px;
  line-height: 1.75;
}

.service-page h1 {
  margin: 4px 0 20px;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.05;
  color: #101827;
}

.service-page h2 {
  margin: 34px 0 18px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  color: #101827;
}

.service-page p {
  max-width: 920px;
  margin: 0 0 18px;
  color: #3d4554;
  font-size: 1.03rem;
}

.service-main-image {
  display: block;
  width: min(100%, 760px);
  height: auto;
  margin: 14px 0 28px;
  border-radius: 16px;
  border: 1px solid rgba(17,24,39,.08);
}

.work-progress-image {
  display: block;
  width: min(100%, 420px);
  height: auto;
  margin: 24px 0 18px;
}

.work-progress-text {
  font-weight: 700;
  font-size: 1.25rem !important;
  color: #101827 !important;
}

.about-publisher {
    max-width: 1100px;
    margin: 60px auto;
}

.about-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: #444;
}

.about-content p {
    margin-bottom: 20px;
}



@media (max-width: 820px) {
  .service-page { padding: 26px 22px 34px; }
}
