/* ==========================================================================
   PANELL DE CONTROL DE MIDES I COLORS
   ========================================================================== */
:root {
  /* MIDA DE LES IMATGES DEL LLIBRE (Totes comparteixen aquesta alçada!) */
  --mida-imatge-principal: 440px;
  --alcada-peces-llibre: 250px; /* Més recollit i proporcionat */

  /* COLORS */
  --paper: #f5eee7;
  --paper-deep: #eadfd4;
  --ink: #292a27;
  --muted: #77736c;
  --red: #b94d48;
  --red-dark: #963d3a;
  --salmon: #e8b7a7;
  --sage: #8d9781;
  --cream: #fffaf4;

  /* TIPOGRAFIES */
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); }
a { color: inherit; text-decoration: none; }

.top-note { text-align: center; padding: 9px 16px; background: var(--ink); color: #f8eee5; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.site-header { height: 82px; padding: 0 7.2%; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(41,42,39,.12); }
.brand { display: inline-flex; gap: 10px; align-items: center; font-family: var(--serif); font-size: 20px; font-weight: 600; }
.brand-mark { color: var(--red); font-size: 23px; }
.main-nav { display: flex; align-items: center; gap: 34px; font-size: 12px; color: #55534e; }
.main-nav a { transition: color .2s; }
.main-nav a:hover, .text-link:hover { color: var(--red); }
.main-nav .nav-cta { padding: 12px 19px; border: 1px solid var(--ink); border-radius: 2px; color: var(--ink); }
.menu-toggle { display: none; border: 0; background: none; font-size: 24px; color: var(--ink); cursor: pointer; }

/* HERO I TÍTOLS GROSSOS */
.hero { position: relative; min-height: 610px; padding: 85px 7.2% 74px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; overflow: hidden; }
.hero-copy { position: relative; z-index: 2; max-width: 570px; padding-bottom: 30px; }
.eyebrow, .section-kicker { font-size: 10px; letter-spacing: .19em; text-transform: uppercase; font-weight: 700; color: var(--red); }
.eyebrow { display: flex; gap: 10px; align-items: center; margin: 0 0 26px; }
.eyebrow span { width: 23px; height: 1px; background: var(--red); }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -.045em; }
h1 { font-size: clamp(48px, 5.5vw, 76px); line-height: 1.06; margin: 0 0 24px; }
h1 em, h2 em { color: var(--red); font-weight: 500; }
.hero-lead { max-width: 420px; color: #6d6962; font-size: 15px; line-height: 1.8; }
.hero-actions { display: flex; align-items: center; gap: 27px; margin-top: 32px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 22px; border: 0; border-radius: 2px; padding: 16px 21px; font: 600 12px var(--sans); cursor: pointer; transition: transform .2s, background .2s; }
.button:hover { transform: translateY(-2px); }
.button-dark { background: var(--ink); color: var(--cream); }
.button-dark:hover { background: #41423c; }
.button span { font-size: 17px; }
.text-link { font-size: 12px; font-weight: 600; }
.text-link span { margin-left: 7px; color: var(--red); }
.hero-footnote { margin-top: 55px; color: #8a837a; font-size: 10px; letter-spacing: .08em; }
.little-star { color: var(--red); margin-right: 8px; font-size: 15px; }

.hero-art { position: relative; height: 455px; display: flex; align-items: center; justify-content: center; }
.sun-disc { position: absolute; width: min(36vw, 400px); height: min(36vw, 400px); border-radius: 50%; background: #e8c9b9; opacity: .7; }
.hero-art img { position: relative; z-index: 1; width: min(85%, 475px); max-height: var(--mida-imatge-principal); object-fit: contain; filter: drop-shadow(0 19px 16px rgba(80,53,43,.12)); border-radius: 6px; }
.art-label { position: absolute; z-index: 2; padding: 9px 14px; border: 1px solid rgba(41,42,39,.28); background: rgba(245,238,231,.75); border-radius: 30px; font-family: var(--serif); font-style: italic; font-size: 13px; }
.label-one { top: 52px; left: 3%; transform: rotate(-8deg); }
.label-two { bottom: 60px; right: 3%; transform: rotate(7deg); }
.floating-note { position: absolute; z-index: 2; color: var(--red); font-family: var(--serif); }
.note-one { top: 14%; right: 15%; font-size: 45px; transform: rotate(13deg); }
.note-two { bottom: 17%; left: 8%; font-size: 35px; transform: rotate(-12deg); }
.postmark { position: absolute; z-index: 2; right: 5%; top: 10%; width: 66px; height: 66px; border: 1px solid rgba(185,77,72,.5); border-radius: 50%; display: grid; place-content: center; text-align: center; color: var(--red); font-size: 10px; letter-spacing: .13em; transform: rotate(12deg); }
.postmark small { font-size: 7px; margin-top: 3px; }
.hero-bottom-line { position: absolute; bottom: 25px; left: 7.2%; right: 7.2%; display: flex; justify-content: space-between; color: #9a9187; font-size: 8px; letter-spacing: .17em; }

/* PECES FÍSIQUES DEL LLIBRE */
.peca-llibre {
  margin: 0;
  height: var(--alcada-peces-llibre);
  background: var(--paper-deep);
  box-shadow: 0 12px 22px rgba(54,44,37,.15);
  border-radius: 2px 6px 6px 2px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(41,42,39,.12);
}

/* Aspecte de llibre a portada i contraportada (plec del llom i vora de pàgines) */
.peca-portada {
  aspect-ratio: 3 / 4;
}

.llibre-físic::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 9px;
  background: linear-gradient(90deg, rgba(41,42,39,.22), rgba(255,250,244,.25), rgba(41,42,39,.08));
  z-index: 2;
  pointer-events: none;
}

/* Lloms interiors: mateixa alçada, meitat d'ample (1.5:4) */
.peca-llom {
  aspect-ratio: 1.5 / 4;
  border-radius: 2px;
}

.peca-llibre img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.peca-llibre figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(41,42,39,.78);
  color: var(--cream);
  font-size: 8.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;
  padding: 4px 3px;
  z-index: 3;
}

.placeholder-box {
  display: none;
  width: 100%;
  height: 100%;
  padding: 8px;
  text-align: center;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 10px;
  border: 1px dashed rgba(41,42,39,.25);
}
.placeholder-box small { font-size: 8.5px; opacity: .8; }

/* SECCIÓ 1: EL CONTE + LLOM 1 */
.section-wrap { padding: 105px 10%; }
.intro { background: var(--cream); }
.intro-grid { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 6%; margin-top: 38px; align-items: center; }
h2 { font-size: clamp(39px, 4.5vw, 59px); line-height: 1.12; margin: 0; }
.intro-text { margin-top: 24px; max-width: 520px; }
.intro-text p { color: var(--muted); font-size: 13px; line-height: 1.9; }
.intro-text .large-copy { color: var(--ink); font-family: var(--serif); font-size: 21px; line-height: 1.55; margin-top: 0; }
.bookmark-slot { display: flex; justify-content: center; }

/* SECCIÓ 2: EL SEU MÓN */
.adventure { background: #8e9782; color: #fffaf4; padding: 93px 10% 105px; }
.section-kicker.light { color: #f0c8b7; }
.adventure h2 { margin-top: 32px; }
.adventure h2 em { color: #f0c8b7; }
.adventure-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 38px; margin-top: 67px; }
.adventure-card { border-top: 1px solid rgba(255,250,244,.38); padding-top: 22px; }
.card-symbol { font-size: 27px; color: #f0c8b7; }
.adventure-card h3 { font: 500 21px var(--serif); margin: 19px 0 10px; }
.adventure-card p { color: rgba(255,250,244,.77); font-size: 12px; line-height: 1.8; max-width: 260px; }

.quote-band { text-align: center; padding: 85px 20px 82px; background: #eadfd4; }
.quote-mark { font: 70px var(--serif); color: var(--red); line-height: .7; }
.quote-band p { font: italic 29px/1.4 var(--serif); margin: 18px 0 20px; }
.quote-caption { color: #8b8076; font-size: 8px; letter-spacing: .2em; }

/* SECCIÓ 3: EL LLIBRE (CENTRAT I MÉS PETIT) */
.books { background: var(--paper); text-align: center; }
.centered-kicker { display: block; text-align: center; }
.books-heading.centered-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  margin: 28px auto 42px;
}
.books-heading.centered-heading p {
  max-width: 420px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  margin: 0;
}

.book-showcase {
  max-width: 780px;
  margin: 0 auto 28px;
  background: var(--cream);
  border: 1px solid rgba(41,42,39,.09);
  border-radius: 6px;
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  box-shadow: 0 10px 28px rgba(41,42,39,.05);
}

.book-side-by-side {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.book-details {
  max-width: 500px;
  text-align: center;
}
.book-details .status, .coming-book-banner .status { color: var(--red); font-size: 9px; letter-spacing: .17em; font-weight: 700; }
.book-details h3 { font: 500 25px var(--serif); margin: 8px 0 10px; }
.book-details p { color: var(--muted); font-size: 12.5px; line-height: 1.8; margin: 0; }
.inline-arrow { display: inline-block; margin-top: 14px; font-size: 11px; font-weight: 700; border-bottom: 1px solid var(--red); padding-bottom: 6px; }
.inline-arrow span { color: var(--red); margin-left: 8px; }

.coming-book-banner {
  max-width: 780px;
  margin: 0 auto;
  border: 1px dashed #c7b8aa;
  border-radius: 6px;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
  gap: 18px;
}
.coming-icon { color: var(--red); font-size: 24px; }
.coming-book-banner h3 { font: 500 19px var(--serif); margin: 4px 0; }
.coming-book-banner p { color: var(--muted); font-size: 12px; margin: 0; }

/* SECCIÓ 4: COMANDES */
.order-section { position: relative; overflow: hidden; background: #343832; color: var(--cream); padding: 100px 10% 95px; }
.order-content { max-width: 800px; margin: auto; position: relative; z-index: 1; }
.order-section h2 { margin-top: 30px; }
.order-section h2 em { color: #e8b7a7; }
.order-content > p { max-width: 590px; color: rgba(255,250,244,.7); font-size: 12px; line-height: 1.8; margin: 22px 0 35px; }
.order-decoration { position: absolute; right: 7%; top: 5%; color: rgba(232,183,167,.13); font-size: 240px; pointer-events: none; }
.order-form { display: grid; gap: 19px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.order-form label { display: flex; flex-direction: column; gap: 9px; font-size: 10px; color: rgba(255,250,244,.85); letter-spacing: .04em; }
.order-form input, .order-form textarea, .order-form select { width: 100%; padding: 13px 12px; border: 1px solid rgba(255,250,244,.25); background: rgba(255,255,255,.05); color: white; border-radius: 1px; font: 12px var(--sans); outline: none; }
.order-form select option { background: #343832; color: white; }
.order-form input:focus, .order-form textarea:focus, .order-form select:focus { border-color: #e8b7a7; }
.order-form input::placeholder, .order-form textarea::placeholder { color: rgba(255,250,244,.38); }
.order-form textarea { resize: vertical; }
.button-light { justify-self: start; background: #e8b7a7; color: #302f2b; margin-top: 5px; }
.button-light:hover { background: #f0c9bb; }
.form-feedback { min-height: 18px; margin: 0 !important; color: #f0c8b7 !important; font-size: 12px; }
.order-small { font-size: 9px !important; margin-top: 18px !important; color: rgba(255,250,244,.48) !important; }

/* FOOTER I 3 XARXES SOCIALS */
.site-footer { padding: 30px 7.2%; display: grid; grid-template-columns: 1.2fr 1fr auto auto; align-items: center; gap: 18px; background: #282b27; color: #f8eee5; }
.footer-brand { font-size: 16px; }
.site-footer p { text-align: center; color: #bcb4aa; font: italic 13px var(--serif); margin: 0; }
.social-links { display: inline-flex; align-items: center; gap: 10px; justify-self: center; }
.social-links a { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(248,238,229,.25); display: inline-flex; align-items: center; justify-content: center; color: #f8eee5; transition: background .2s, border-color .2s, color .2s, transform .2s; }
.social-links a:hover { background: var(--salmon); border-color: var(--salmon); color: #282b27; transform: translateY(-2px); }
.back-top { justify-self: end; font-size: 10px; }
.site-footer small { grid-column: 1/-1; text-align: center; color: #8c8981; font-size: 8px; letter-spacing: .1em; margin-top: 10px; }

@media (max-width: 900px) {
  .site-footer { grid-template-columns: 1fr auto; }
  .site-footer p { display: none; }
  .social-links { justify-self: start; }
}

@media (max-width: 850px) {
  :root {
    --alcada-peces-llibre: 205px;
  }
  .site-header { padding: 0 6%; height: 72px; }
  .menu-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 111px; left: 0; right: 0; z-index: 10; padding: 22px 6%; background: var(--cream); border-bottom: 1px solid #ddd0c4; flex-direction: column; align-items: flex-start; gap: 20px; }
  .main-nav.open { display: flex; }
  .hero { padding: 65px 7% 75px; grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 0; }
  .hero-art { height: 370px; margin-top: 15px; }
  .sun-disc { width: 320px; height: 320px; }
  .hero-art img { max-height: 360px; }
  .section-wrap { padding: 78px 7%; }
  .intro-grid { grid-template-columns: 1fr; gap: 36px; }
  .adventure { padding: 78px 7%; }
  .adventure-cards { grid-template-columns: 1fr; gap: 28px; margin-top: 42px; }
  .book-showcase { padding: 22px 18px; gap: 20px; }
  .coming-book-banner { flex-direction: column; text-align: center; gap: 10px; }
  .order-section { padding: 78px 7%; }
}

@media (max-width: 560px) {
  :root {
    --alcada-peces-llibre: 150px;
  }
  .book-side-by-side { gap: 7px; }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .site-footer { grid-template-columns: 1fr 1fr; }
  .social-links { grid-column: 1 / -1; justify-content: center; margin-top: 6px; }
  .back-top { grid-column: 2; grid-row: 1; }
}
/* Cursor d'ampliació a les imatges clicables */
.hero-art img,
.peca-llibre img {
  cursor: zoom-in;
}

/* Cursor d'ampliació a les imatges clicables */
.hero-art img,
.peca-llibre img {
  cursor: zoom-in;
}

/* Finestra modal per veure les imatges en gran */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(25, 26, 24, 0.88);
  backdrop-filter: blur(4px);
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: min(92vw, 900px);
  max-height: 78vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  background: var(--cream);
}

.lightbox-caption {
  margin: 14px 0 0;
  color: var(--cream);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.03em;
  text-align: center;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 250, 244, 0.35);
  border-radius: 50%;
  background: rgba(41, 42, 39, 0.7);
  color: var(--cream);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background 0.2s, transform 0.2s;
}

.lightbox-close:hover {
  background: var(--red);
  border-color: var(--red);
  transform: scale(1.05);
}
.hero-art {
  height: auto;
  min-height: 455px;
}

.hero-art img[src*="vaca-placeholder"] {
  width: min(150%, 560px);
  max-width: none;
  max-height: 540px;
  position: relative;
  z-index: 2;
}