/* Billetterie Saint-Nicolas : couleurs modifiables ici */
:root {
  --mitre: #A8152E;      /* rouge de la mitre */
  --mitre-deep: #7A0E21;
  --gold: #D6A63A;       /* or de la crosse */
  --ink: #1C2236;        /* texte, bleu nuit */
  --muted: #5B6178;
  --paper: #FFFFFF;
  --mist: #F4F2F0;       /* fond de page */
  --line: #E4E0DC;
  --radius-lg: 18px;
  --radius-sm: 10px;
  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--mist); color: var(--ink);
  font: 16px/1.55 var(--sans);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: var(--mitre); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 400; }

/* ---------- Bannière ---------- */
.hero {
  position: relative; height: clamp(180px, 30vw, 340px); overflow: hidden;
  background: radial-gradient(120% 140% at 15% 0%, var(--mitre) 0%, var(--mitre-deep) 70%);
  color: var(--gold);
}
.hero--img { background: var(--ink) var(--banner) center / cover no-repeat; }
.hero__art { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- En-tête événement ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.event {
  position: relative; margin-top: -72px; background: var(--paper);
  border-radius: var(--radius-lg); padding: 28px 32px 26px;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(28, 34, 54, .35);
}
.event__org { margin: 0 0 6px; color: var(--muted); font-size: 15px; }
.event__title { font-family: var(--serif); font-size: clamp(30px, 5vw, 48px); line-height: 1.08; color: var(--mitre); max-width: 22ch; }
.event__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 32px; margin: 22px 0 0; }
.event__facts div { border-left: 3px solid var(--gold); padding-left: 14px; }
.event__facts dt { font-size: 13px; color: var(--muted); }
.event__facts dd { margin: 2px 0 0; font-weight: 600; }
.event__facts dd span { font-weight: 400; color: var(--muted); }

/* ---------- Mise en page ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; margin: 28px 0 48px; align-items: start; }
.block { background: var(--paper); border-radius: var(--radius-lg); padding: 26px 28px; }
.block + .block { margin-top: 20px; }
.block h2 { font-family: var(--serif); font-size: 24px; margin-bottom: 18px; }
.notice { background: #FFF6E0; border: 1px solid #F0DCA6; border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 0 20px; }

/* ---------- Billets façon ticket de cinéma ---------- */
.tickets { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ticket {
  --notch: var(--paper);
  display: grid; grid-template-columns: 1fr 150px; position: relative;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--paper);
  transition: border-color .15s, background-color .15s;
}
.ticket.is-picked { border-color: var(--mitre); background: #FFF8F6; --notch: var(--paper); }
.ticket__body { padding: 16px 18px; min-width: 0; }
.ticket__name { font-size: 17px; font-weight: 700; font-family: var(--sans); }
.ticket__details { margin: 2px 0 0; color: var(--muted); font-size: 14.5px; }
.ticket__price { margin: 8px 0 0; font-weight: 700; color: var(--mitre); font-variant-numeric: tabular-nums; }
.ticket__left { margin-left: 8px; font-weight: 600; font-size: 13px; color: #8A5A00; background: #FFF0C7; padding: 2px 8px; border-radius: 99px; }
.ticket__stub {
  position: relative; display: flex; align-items: center; justify-content: center;
  border-left: 2px dashed var(--line); padding: 12px;
}
/* encoches de la perforation */
.ticket__stub::before, .ticket__stub::after {
  content: ""; position: absolute; left: -10px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--notch); border: 1.5px solid var(--line);
}
.ticket__stub::before { top: -10px; clip-path: inset(50% 0 0 0); }
.ticket__stub::after { bottom: -10px; clip-path: inset(0 0 50% 0); }
.ticket.is-picked .ticket__stub, .ticket.is-picked .ticket__stub::before, .ticket.is-picked .ticket__stub::after { border-color: var(--mitre); }
.ticket.is-picked .ticket__stub { border-left-color: rgba(168, 21, 46, .45); }
.ticket.is-out { opacity: .6; }
.ticket__out { font-weight: 700; color: var(--muted); transform: rotate(-8deg); border: 2px solid currentColor; padding: 2px 10px; border-radius: 6px; }

.qty { display: flex; align-items: center; gap: 6px; }
.qty__btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--mitre);
  background: var(--paper); color: var(--mitre); font-size: 22px; line-height: 1; cursor: pointer;
}
.qty__btn:hover:not(:disabled) { background: var(--mitre); color: #fff; }
.qty__btn:disabled { border-color: var(--line); color: #B9B4AE; cursor: default; }
.qty__val { min-width: 28px; text-align: center; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }

/* ---------- Formulaire ---------- */
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
.form em { font-style: normal; font-weight: 400; color: var(--muted); }
.form small { font-weight: 400; color: var(--muted); font-size: 13.5px; }
.form input {
  font: inherit; font-weight: 400; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; color: var(--ink);
}
.form input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(214, 166, 58, .45); }
.form input[aria-invalid] { border-color: var(--mitre); }

.prose p { margin: 0 0 12px; max-width: 68ch; }
.prose ul { margin: 0; padding-left: 20px; max-width: 66ch; }
.prose li + li { margin-top: 6px; }

/* ---------- Récapitulatif ---------- */
.summary { position: sticky; top: 20px; }
.summary__inner { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 24px; }
.summary__title { font-family: var(--serif); font-size: 22px; margin-bottom: 14px; }
.summary__lines { list-style: none; margin: 0; padding: 0 0 14px; border-bottom: 1px dashed rgba(255,255,255,.25); display: grid; gap: 8px; font-size: 15px; }
.summary__lines li { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.summary__empty { color: rgba(255,255,255,.6); }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 18px; }
.summary__total strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.summary__error { background: #FFE5E8; color: var(--mitre-deep); border-radius: 8px; padding: 10px 12px; font-size: 14.5px; margin: 0 0 14px; }
.pay {
  width: 100%; padding: 15px; border: 0; border-radius: 99px; cursor: pointer;
  background: var(--gold); color: var(--ink); font: 700 17px var(--sans);
}
.pay:hover:not(:disabled) { background: #E5B84E; }
.pay:disabled { background: rgba(255,255,255,.18); color: rgba(255,255,255,.55); cursor: default; }
.summary__secure { margin: 12px 0 0; font-size: 13px; color: rgba(255,255,255,.65); text-align: center; }

.foot { max-width: 1080px; margin: 0 auto; padding: 0 20px 40px; color: var(--muted); font-size: 14px; }
.foot p { margin: 4px 0; }

/* ---------- Page confirmation ---------- */
.confirm { max-width: 640px; margin: -72px auto 40px; position: relative; }
.confirm .block h1 { font-family: var(--serif); font-size: 32px; color: var(--mitre); margin-bottom: 8px; }
.confirm table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.confirm td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.confirm td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.numbers { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.numbers li { border: 2px dashed var(--mitre); color: var(--mitre); border-radius: 8px; padding: 6px 12px; font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.btn-link { display: inline-block; margin-top: 18px; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; margin-bottom: 120px; }
  .event { padding: 22px 20px; margin-top: -48px; }
  .block { padding: 22px 18px; }
  .ticket { grid-template-columns: 1fr 128px; }
  .summary { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 10; }
  .summary__inner { border-radius: 18px 18px 0 0; padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 14px; }
  .summary__title, .summary__lines, .summary__secure { display: none; }
  .summary__total { margin: 0; flex-direction: column; gap: 0; font-size: 13px; }
  .summary__total strong { font-size: 21px; }
  .summary__error { grid-column: 1 / -1; order: -1; }
  .pay { width: auto; padding: 13px 22px; }
}
@media (max-width: 420px) {
  .ticket { grid-template-columns: 1fr; }
  .ticket__stub { border-left: 0; border-top: 2px dashed var(--line); justify-content: flex-end; }
  .ticket__stub::before, .ticket__stub::after { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Projet soutenu & programme ---------- */
.event__cause { margin: 8px 0 0; font-size: 17px; color: var(--ink); max-width: 60ch; }
.schedule { list-style: none; margin: 0; padding: 0; position: relative; }
.schedule::before { content: ""; position: absolute; left: 69px; top: 10px; bottom: 10px; border-left: 2px dashed var(--line); }
.schedule li { display: grid; grid-template-columns: 52px 1fr; gap: 36px; align-items: center; padding: 8px 0; position: relative; }
.schedule li::after { content: ""; position: absolute; left: 64px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); }
.schedule time { font-weight: 700; color: var(--mitre); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Billets électroniques ---------- */
.billets { max-width: 640px; margin-top: -72px; position: relative; }
.billets__head { background: var(--paper); border-radius: var(--radius-lg); padding: 24px 26px; margin-bottom: 18px; }
.billets__head h1 { font-family: var(--serif); color: var(--mitre); font-size: 30px; margin-bottom: 6px; }
.billets__head p { margin: 0; color: var(--muted); }
.print { margin-top: 16px; font: 600 15px var(--sans); padding: 10px 18px; border-radius: 99px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; }
.back { display: inline-block; margin-left: 8px; text-decoration: none; }
.back:hover { background: var(--ink); color: var(--paper); }
.eticket { display: grid; grid-template-columns: 196px 1fr; gap: 0; background: var(--paper); border: 2px dashed var(--mitre); border-radius: var(--radius-lg); margin-bottom: 14px; break-inside: avoid; }
.eticket__qr { padding: 8px; border-right: 2px dashed var(--line); display: grid; place-items: center; }
.eticket__qr svg { display: block; width: 180px; height: 180px; }
.eticket__info { padding: 18px 20px; align-self: center; }
.eticket__info h2 { font-family: var(--serif); font-size: 22px; margin: 2px 0 4px; }
.eticket__info p { margin: 0; }
.eticket__count { font-size: 13px; color: var(--muted); }
.eticket__code { margin-top: 8px !important; font: 700 17px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 2px; color: var(--mitre); }
.eticket__used { margin-top: 8px !important; font-weight: 700; color: #B5660A; }
.eticket.is-used { opacity: .55; }
.billets .block + .block, .eticket + .block { margin-top: 14px; }
@media (max-width: 520px) {
  .eticket { grid-template-columns: 1fr; text-align: center; }
  .eticket__qr { border-right: 0; border-bottom: 2px dashed var(--line); padding: 14px; }
}
@media print {
  body { background: #fff; }
  .hero, .foot, .print { display: none; }
  .billets { margin-top: 0; }
}

/* --- Film + logo CHIREC (maj 15/10) --- */
.event { position: relative; }
.event__logo { float: right; width: 120px; height: auto; margin: 0 0 12px 16px; }
@media (max-width: 600px) { .event__logo { width: 90px; } }
.film__wrap { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 20px; align-items: center; }
@media (max-width: 560px) { .film__wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.film__poster { position: relative; display: block; border-radius: var(--radius-sm); overflow: hidden; box-shadow: 0 6px 18px rgba(28,34,54,.18); max-width: 220px; }
.film__poster img { display: block; width: 100%; height: auto; transition: transform .25s ease; }
.film__poster:hover img, .film__poster:focus-visible img { transform: scale(1.04); }
.film__play { position: absolute; inset: 50% auto auto 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: rgba(168,21,46,.92); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.film__play::after { content: ""; position: absolute; left: 23px; top: 18px; border-style: solid; border-width: 11px 0 11px 17px; border-color: transparent transparent transparent #fff; }
.film__text h3 { font-family: var(--serif); font-size: 20px; margin: 0 0 6px; }
.film__text p { color: var(--muted); margin: 0 0 14px; }
.film__btn { display: inline-block; background: var(--mitre); color: #fff; text-decoration: none; font-weight: 600; padding: 10px 18px; border-radius: 999px; }
.film__btn:hover, .film__btn:focus-visible { background: var(--mitre-deep); color: #fff; }
.trailer { padding: 0; border: 0; background: #000; width: min(92vw, 960px); border-radius: var(--radius-sm); overflow: visible; }
.trailer::backdrop { background: rgba(10,12,20,.8); }
.trailer__frame { position: relative; aspect-ratio: 16 / 9; }
.trailer__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.trailer__close { position: absolute; top: -44px; right: 0; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #fff; color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; }
.foot__partner { display: flex; align-items: center; justify-content: center; gap: 12px; }
.foot__partner img { width: 120px; height: auto; background: #fff; border-radius: 8px; padding: 4px; }
.billets__logo { display: block; width: 130px; height: auto; margin: 0 auto 8px; }
.eticket__logo { float: right; width: 84px; height: auto; margin: 0 0 6px 10px; }
@media print { .film, .trailer { display: none !important; } .eticket__logo, .billets__logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
