/* ==========================================================================
   Components compartits entre pàgines: maquetació de secció, capçaleres de secció,
   botons, enllaços, etiquetes (chips) i fitxes de personatge.
   ========================================================================== */

/* ---------- Maquetació de secció ---------- */
.section-in { max-width: 1200px; margin: 0 auto; padding: 80px 24px; box-sizing: border-box; }
.section-in--stack { display: flex; flex-direction: column; gap: 32px; }
.section-in--split { display: flex; flex-wrap: wrap; gap: 48px; }

/* ---------- Capçalera de secció ---------- */
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-head--wide { gap: 16px 40px; }
.section-head--center { align-items: center; }
.section-title-group { display: flex; flex-direction: column; gap: 6px; }

.eyebrow { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red-text); }
.eyebrow--deep { color: var(--red-deep); }
.eyebrow--gold { color: var(--gold); }
.eyebrow--icon { display: flex; align-items: center; gap: 8px; }

.section-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 44px; line-height: 1.05; color: var(--forest); }
.section-title--sm { font-size: 40px; }
.section-title--on-dark { font-size: 42px; line-height: 1.1; color: inherit; }

.lead { margin: 0; color: var(--muted); font-size: 17px; }
.lead--narrow { max-width: 440px; }
.lead--soft { color: var(--muted-2); }

/* ---------- Botons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; box-sizing: border-box; border-radius: 999px; font-weight: 700; text-decoration: none; }
.btn--primary { background: var(--red); color: #fff; }
.btn--outline { border: 1.5px solid var(--forest); color: var(--forest); }

/* ---------- Enllaços d'acció ---------- */
.link-arrow { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; font-size: 16px; text-decoration: none; }
.link-on-dark { color: var(--gold); align-self: flex-start; }
.link-on-dark:hover { color: #fff; }
.link-strong { font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.link-strong--icon { gap: 8px; }

/* ---------- Etiquetes ---------- */
.chip { padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.chip--start { align-self: flex-start; }
.chip--gold { background: #F3E3BD; color: #5E4200; }      /* protagonistes, venda */
.chip--hell { background: #F6D9D2; color: #8A2414; }      /* infern */
.chip--sky { background: var(--lavender-2); color: #2E3260; } /* cel, actes */
.chip--pastors { background: #E2EADF; color: #2F4A26; }
.chip--solid { background: var(--red); color: #fff; }

/* ---------- Fitxes de personatge, estil cromo (inici i pàgina de personatges) ----------
   Marc de paper amb ombra, foto encastada amb vora blanca, etiqueta com a segell sobre la foto
   i nom centrat. La graella limita l'amplada perquè la fitxa no creixi més que un cromo. */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px; }
.cards-grid--roster { gap: 28px 24px; }
@media (min-width: 1100px) { .cards-grid { grid-template-columns: repeat(4, minmax(0, 250px)); justify-content: start; } }
.char-card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 10px 10px 18px; box-sizing: border-box; text-align: center;
  background: linear-gradient(180deg, #FFFDF8, #F6F1E6); border: 1px solid #DCD5C6; border-radius: 16px;
  box-shadow: 0 1px 0 #fff inset, 0 2px 4px rgba(30, 53, 69, .06), 0 14px 28px -16px rgba(30, 53, 69, .45);
  /* translate/rotate (no transform): així el gest de passar-hi per sobre no xoca amb el reveal, que fa servir transform */
  transition: translate .35s cubic-bezier(.16, 1, .3, 1), rotate .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s ease;
}
@media (hover: hover) {
  .char-card:hover { translate: 0 -4px; rotate: -.6deg; box-shadow: 0 1px 0 #fff inset, 0 4px 8px rgba(30, 53, 69, .08), 0 22px 36px -18px rgba(30, 53, 69, .5); }
}
.char-photo, .photo-placeholder { margin-bottom: 8px; }
.char-photo { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: var(--focus, 50% 50%); border-radius: 10px; box-shadow: 0 0 0 4px #fff, 0 0 0 5px #E6DFD0; }
/* Enquadrament de les fotos de l’HTML de reserva. Les que genera el panell porten --focus (punt focal triat a la foto) */
.char-photo--ganapia { object-position: 52% 25%; }
.char-photo--cigronet { object-position: 22% 40%; }
.char-photo--llucifer { object-position: 50% 30%; }
.char-photo--dimonis { object-position: 8% 60%; }
.photo-placeholder { aspect-ratio: 3 / 4; border-radius: 10px; border: 2px dashed var(--lavender); background: #E3E3EE; display: flex; align-items: center; justify-content: center; color: var(--muted-2); font-size: 15px; box-sizing: border-box; }
/* L'etiqueta fa de segell a la cantonada de la foto */
.char-card > .chip { position: absolute; top: 20px; left: 20px; box-shadow: 0 2px 6px rgba(30, 53, 69, .2); }
.char-name { margin: 2px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.1; color: var(--forest); }
.char-name--lg { font-size: 26px; }
.char-card .p-muted { font-size: 15px; line-height: 1.45; padding: 0 6px; }
/* Mòbil: dos cromos per fila, com en un àlbum */
@media (max-width: 600px) {
  .cards-grid, .cards-grid--roster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .char-card { padding: 7px 7px 14px; border-radius: 12px; gap: 4px; }
  .char-photo, .photo-placeholder { border-radius: 7px; margin-bottom: 6px; }
  .char-photo { box-shadow: 0 0 0 3px #fff, 0 0 0 4px #E6DFD0; }
  .char-card > .chip { top: 13px; left: 13px; padding: 3px 9px; font-size: 11px; }
  .char-name, .char-name--lg { font-size: 18px; }
  .char-card .p-muted { font-size: 13px; padding: 0 2px; }
}

/* ---------- Capçalera de les pàgines interiors (personatges, històries) ---------- */
.page-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; opacity: .28; }
.page-hero-in { position: relative; max-width: 1200px; margin: 0 auto; padding: 64px 24px 72px; box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; }
.page-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 5vw, 64px); line-height: 1.05; }
.page-hero-lead { margin: 0; max-width: 640px; font-size: 18px; color: var(--on-dark); }


/* ---------- Botó per tornar enrere (a dalt de «Història i arxiu») ---------- */
.tornar { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: -12px 0 6px; padding: 0 16px 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; }
.tornar:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.tornar svg { transition: translate .25s cubic-bezier(.16, 1, .3, 1); }
.tornar:hover svg { translate: -3px 0; }

/* ---------- Fitxa sense foto: ombra misteriosa (la genera tools/build.mjs) ---------- */
.photo-ombra { position: relative; overflow: hidden; flex-direction: column; border: 0; background: radial-gradient(ellipse 75% 60% at 50% 42%, #7FA2B5 0%, #4A6E82 45%, var(--forest) 100%); box-shadow: 0 0 0 4px #fff, 0 0 0 5px #E6DFD0; color: #0E1A22; }
.photo-ombra svg { position: absolute; left: 13%; bottom: 0; width: 74%; height: auto; fill: currentColor; }
.photo-ombra .ombra-estel { fill: var(--gold); }
.photo-ombra-q { position: relative; z-index: 1; margin-top: -18%; font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 9vw, 64px); line-height: 1; color: var(--gold); text-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
.photo-ombra-text { position: absolute; left: 6px; right: 6px; bottom: 10px; z-index: 1; font-size: 12px; font-weight: 700; line-height: 1.25; color: var(--on-dark); }
@media (prefers-reduced-motion: no-preference) {
  .photo-ombra-q { animation: ombra-q 2.6s ease-in-out infinite; }
}
@keyframes ombra-q { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-6px) rotate(6deg); } }
@media (max-width: 600px) { .photo-ombra { box-shadow: 0 0 0 3px #fff, 0 0 0 4px #E6DFD0; } .photo-ombra-text { font-size: 10px; bottom: 7px; } }
