/* Styles des pages rendues par le Worker (fiches à la demande + acteurs).
   Reprend le look de MediaDetail.astro. Utilise les variables de kino.css. */

/* Tokens de design absents de kino.css (normalement fournis par global.css sur le blog).
   On les redéfinit ici pour que les pages worker aient EXACTEMENT le même rendu. */
:root {
  --kino-red: #E41D31;
  --kino-gold: #e9b949;
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --surface-high: var(--surface-3);
  --text-muted: rgba(var(--text-rgb), .6);
  --bg-raised: var(--bg-2);
}

/* ===== Fiche détail ===== */
.det { color: var(--text); }
.det .hero { position: relative; overflow: hidden; border-bottom: 1px solid rgba(var(--line-rgb),.08); }
.det .hero-bg { position: absolute; inset: 0; z-index: 0; background: linear-gradient(120deg, rgba(var(--line-rgb),.14), rgba(var(--bg-rgb),.6)); }
.det .hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.det .hero::after { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(var(--bg-rgb),.35), rgba(var(--bg-rgb),.82) 70%, var(--bg)); }
.det .hero-in { position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; padding: 40px 24px 44px; display: grid; grid-template-columns: 200px minmax(0,1fr) 240px; gap: 34px; align-items: start; }
.det .pcol { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.det .poster { width: 100%; aspect-ratio: 2/3; border-radius: 14px; overflow: hidden; display: grid; place-items: center; text-align: center; padding: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.5); background: linear-gradient(150deg, rgba(var(--line-rgb),.2), rgba(var(--line-rgb),.06)); border: 1px solid rgba(255,255,255,.1); }
.det .poster img { width: 100%; height: 100%; object-fit: cover; }
.det .poster .pt { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: rgba(255,255,255,.92); }
.det .trailer { font-size: .82rem; font-weight: 600; color: var(--text); text-decoration: none; opacity: .85; }
.det .trailer:hover { opacity: 1; color: var(--kino-red); }
.det .info h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.05; margin: 0 0 8px; }
.det .meta { color: rgba(var(--text-rgb),.75); font-size: .95rem; margin: 0 0 10px; }
.det .stars { display: flex; align-items: center; gap: 3px; margin-bottom: 12px; font-size: 1.05rem; color: rgba(var(--text-rgb),.3); }
.det .stars .on { color: var(--kino-gold); }
.det .stars .score { margin-left: 8px; font-family: var(--font-mono); font-size: .85rem; color: rgba(var(--text-rgb),.8); }
.det .gchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.det .gchip { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: rgba(var(--text-rgb),.8); background: rgba(var(--line-rgb),.1); border: 1px solid rgba(var(--line-rgb),.16); padding: 5px 10px; border-radius: 999px; }
.det .synopsis { max-width: 620px; font-size: 1.02rem; line-height: 1.6; color: rgba(var(--text-rgb),.9); margin: 0; }
.det .side { display: flex; flex-direction: column; gap: 12px; align-self: end; }
.det .stat { background: rgba(var(--bg-rgb),.5); border: 1px solid rgba(var(--line-rgb),.1); border-radius: 14px; padding: 14px; text-align: center; }
.det .stat .num { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; }
.det .stat .lbl { font-size: .78rem; color: rgba(var(--text-rgb),.6); }
.det .btn { display: block; text-align: center; font-weight: 700; font-size: .92rem; padding: 13px 16px; border-radius: 12px; text-decoration: none; transition: transform .15s, filter .15s; }
.det .btn.primary { background: var(--kino-red); color: #fff; }
.det .btn.ghost { background: transparent; color: var(--text); border: 1px solid rgba(var(--line-rgb),.25); }
.det .btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.det .seen { text-align: center; font-size: .82rem; color: var(--kino-red); text-decoration: none; margin-top: 2px; }
.det .seen:hover { text-decoration: underline; }

.block { max-width: 1200px; margin: 0 auto; padding: 34px 24px 0; }
.block h2 { font-size: 1.5rem; margin: 0 0 18px; }
.block-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.block-head h2 { margin: 0; }
.season-sel { font-size: .85rem; color: var(--text-muted); background: var(--surface); border: 1px solid var(--surface-high); padding: 7px 14px; border-radius: 10px; font-family: var(--font-body); }
select.season-sel { color: var(--text); appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.row { transition: opacity .2s; }
.row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.row::-webkit-scrollbar { height: 8px; }
.row::-webkit-scrollbar-thumb { background: var(--surface-high); border-radius: 8px; }
.ep { flex: 0 0 232px; cursor: pointer; }
.ep:hover .ep-still { outline: 2px solid var(--kino-red); outline-offset: -2px; }

/* Modale « donne ton avis » (partagée avec les fiches Astro) */
.k-modal { position: fixed; inset: 0; z-index: 100; }
.k-modal-bd { position: absolute; inset: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.k-modal.open .k-modal-bd { opacity: 1; }
.k-modal-card { position: relative; z-index: 1; width: calc(100% - 40px); max-width: 440px; margin: 14vh auto 0; background: var(--surface); border: 1px solid var(--surface-high); border-radius: 20px; padding: 34px 28px 30px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.55); transform: translateY(12px) scale(.98); opacity: 0; transition: transform .22s, opacity .22s; }
.k-modal.open .k-modal-card { transform: none; opacity: 1; }
.k-modal-x { position: absolute; top: 12px; right: 14px; background: none; border: 0; color: var(--text-muted); font-size: 1.05rem; cursor: pointer; line-height: 1; padding: 4px; }
.k-modal-x:hover { color: var(--text); }
.k-modal-eyebrow { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .18em; color: var(--kino-red); margin: 0 0 10px; }
.k-modal-title { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; margin: 0 0 8px; color: var(--text); }
.k-modal-ep { font-size: .9rem; color: var(--kino-red); font-weight: 600; margin: 0 0 14px; }
.k-modal-body { color: var(--text-muted); line-height: 1.55; font-size: .96rem; margin: 0 0 22px; }
.k-modal-cta { display: inline-block; background: var(--kino-red); color: #fff; font-weight: 600; padding: 13px 26px; border-radius: 12px; text-decoration: none; transition: transform .15s, filter .15s; }
.k-modal-cta:hover { transform: translateY(-2px); filter: brightness(1.07); text-decoration: none; }
.ep-still { position: relative; aspect-ratio: 16/9; border-radius: 12px; margin-bottom: 8px; overflow: hidden; background: linear-gradient(150deg, rgba(var(--line-rgb),.18), rgba(var(--line-rgb),.06)); border: 1px solid rgba(var(--line-rgb),.1); }
.ep-still img { width: 100%; height: 100%; object-fit: cover; }
.ep-tag { display: block; font-family: var(--font-mono); font-size: .72rem; color: var(--kino-red); }
.ep-title { display: block; font-size: .92rem; font-weight: 600; }
.ep-date { display: block; font-size: .78rem; color: rgba(var(--text-rgb),.5); margin-top: 2px; }
.cast .person { flex: 0 0 120px; color: var(--text); text-decoration: none; }
.cast .person:hover .cname { color: var(--kino-red); }
.face { position: relative; aspect-ratio: 1/1; border-radius: 12px; margin-bottom: 9px; overflow: hidden; background: linear-gradient(150deg, rgba(var(--line-rgb),.14), rgba(var(--line-rgb),.05)); border: 1px solid rgba(var(--line-rgb),.1); }
.face img { width: 100%; height: 100%; object-fit: cover; }
.cname { display: block; font-size: .86rem; font-weight: 600; line-height: 1.25; transition: color .15s; }
.crole { display: block; font-size: .78rem; color: rgba(var(--text-rgb),.55); }
.det-wrap { max-width: 1200px; margin: 0 auto; padding: 34px 24px 80px; }
.back { font-size: .95rem; color: var(--text-muted); text-decoration: none; }
.back:hover { color: var(--text); }

/* ===== Page acteur ===== */
.person-page { color: var(--text); }
.phero { max-width: 1200px; margin: 0 auto; padding: 44px 24px 30px; display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 32px; align-items: start; }
.pphoto { aspect-ratio: 2/3; border-radius: 16px; overflow: hidden; background: linear-gradient(150deg, rgba(var(--line-rgb),.18), rgba(var(--line-rgb),.06)); border: 1px solid rgba(var(--line-rgb),.1); box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.pphoto img { width: 100%; height: 100%; object-fit: cover; }
.pmeta h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 8px 0 12px; }
.pborn { color: rgba(var(--text-rgb),.7); font-size: 1rem; margin: 0 0 16px; max-width: 560px; }
.plinks { display: flex; gap: 12px; align-items: center; }
.plink { width: 34px; height: 34px; display: inline-flex; color: rgba(var(--text-rgb),.5); text-decoration: none; transition: color .15s, transform .15s; }
.plink:hover { color: var(--kino-red); transform: translateY(-2px); }
.plink svg { width: 100%; height: 100%; display: block; }

.pfilmo { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 20px 18px; padding-bottom: 40px; }
.fcard { display: flex; flex-direction: column; gap: 9px; color: var(--text); text-decoration: none; min-width: 0; }
.fposter { position: relative; aspect-ratio: 2/3; border-radius: 14px; overflow: hidden; border: 1px solid rgba(var(--line-rgb),.12); background: linear-gradient(150deg, rgba(var(--line-rgb),.18), rgba(var(--line-rgb),.06)); transition: transform .2s, box-shadow .2s; }
.fcard:hover .fposter { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.35); }
.fposter img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fposter .rate { position: absolute; top: 8px; right: 8px; font-family: var(--font-mono); font-size: .72rem; font-weight: 700; color: #fff; background: rgba(12,11,14,.7); border: 1px solid rgba(255,255,255,.14); padding: 3px 7px; border-radius: 7px; }
.ftitle { font-size: .92rem; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fyear { font-size: .8rem; color: rgba(var(--text-rgb),.5); }

@media (max-width: 900px) {
  .det .hero-in { grid-template-columns: 130px 1fr; }
  .det .side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .det .side .stat { flex: 1 1 120px; }
  .det .side .btn { flex: 1 1 100%; }
  .phero { grid-template-columns: 120px 1fr; }
}
@media (max-width: 1080px) { .pfilmo { grid-template-columns: repeat(5, minmax(0,1fr)); } }
@media (max-width: 860px) { .pfilmo { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 640px) { .pfilmo { grid-template-columns: repeat(3, minmax(0,1fr)); } .det .hero-in { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .pfilmo { grid-template-columns: repeat(2, minmax(0,1fr)); } }
