/* Culture cinéma — base de visionnage : feuille de style de la page.
   Reprend la charte de la base de chansons (Cormorant Garamond + Montserrat,
   palette papier/or) et ajoute les commandes de suivi « Vu » par film. */

:root {
    --ink: #1a1814;
    --paper: #f2f5fa;
    --paper-dark: #e6ecf6;
    --brand: #1d3a5f;
    --gold: #b89a5a;
    --gold-light: #d4b87a;
    --muted: #7a7060;
    --heart: #c0473b;
    --seen: #4f8a5b;
    --nav-h: 72px;
    --line: rgba(184, 154, 90, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

/* ── EN-TÊTE ── */
.entete {
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 3.5rem) 2rem 1.5rem;
  text-align: center;
}
.eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.8rem;
}
.entete h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 1.02;
  margin: 0;
  letter-spacing: 0.01em;
}
.entete h1 em { font-style: italic; color: var(--gold); }
.accroche {
  max-width: 640px;
  margin: 1.1rem auto 0;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--muted);
}
.filet { width: 60px; height: 1px; background: var(--gold); margin: 1.8rem auto 0; }

/* ── SCÈNE ── */
.scene { max-width: 1180px; margin: 0 auto; padding: 1rem 2rem 2rem; }

/* ── BANDEAU DE SUIVI (connexion / lien vers stats) ── */
.suivi-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.1rem;
  background: var(--brand);
  color: #eef3fa;
  border-radius: 4px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.suivi-bar .suivi-ic { font-size: 1.15rem; }
.suivi-bar p { margin: 0; flex: 1 1 260px; }
.suivi-bar a { color: #fff; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.suivi-bar a.suivi-btn {
  text-decoration: none;
  background: var(--gold);
  color: #1a1814;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.suivi-bar a.suivi-btn:hover { background: var(--gold-light); }
.suivi-bar.is-auth { background: var(--paper-dark); color: var(--ink); }
.suivi-bar.is-auth a { color: var(--brand); }

/* ── BARRE DE CONTRÔLE ── */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.9rem 1.1rem;
  padding: 1.2rem 1.3rem;
  background: var(--paper-dark);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 1.2rem;
}
.ctrl { display: flex; flex-direction: column; gap: 0.35rem; }
.ctrl-search { flex: 1 1 260px; }
.ctrl label {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.controls input[type="search"],
.controls select {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.55rem 0.7rem;
  min-height: 40px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.controls input[type="search"] { width: 100%; }
.controls select { min-width: 130px; cursor: pointer; }
.controls input:focus,
.controls select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 154, 90, 0.15);
}
.ctrl-suivi { display: none; }
.ctrl-suivi.is-on { display: flex; }
.reset {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.6rem 1rem;
  min-height: 40px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.reset:hover { color: var(--gold); border-color: var(--gold); background: var(--paper); }

/* ── COMPTEUR ── */
.tally { font-size: 0.8rem; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 0.7rem 0.2rem; }
.tally b { color: var(--ink); font-weight: 600; }
.tally .tally-seen { color: var(--seen); }

/* ── TABLEAU ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 900px; }
thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--ink); color: var(--paper);
  font-family: 'Montserrat', sans-serif;
  font-weight: 500; font-size: 0.64rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  text-align: left; padding: 0.85rem 0.9rem; white-space: nowrap; user-select: none;
}
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--gold); }
th.num { text-align: right; }
th.col-vu { text-align: center; }
.arrow { display: inline-block; width: 0.8em; color: var(--gold); font-size: 0.9em; }
th[data-dir="asc"] .arrow::after { content: "▲"; }
th[data-dir="desc"] .arrow::after { content: "▼"; }

tbody td { padding: 0.68rem 0.9rem; border-top: 1px solid rgba(184, 154, 90, 0.14); vertical-align: top; }
tbody td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr.film-row { cursor: pointer; }
tbody tr.film-row:nth-of-type(4n+1) { background: rgba(230, 236, 246, 0.5); }
tbody tr.film-row:hover { background: rgba(184, 154, 90, 0.12); }
tbody tr.film-row.is-seen { background: rgba(79, 138, 91, 0.09); }
tbody tr.film-row.is-seen:hover { background: rgba(79, 138, 91, 0.16); }

.cell-title { font-family: 'Cormorant Garamond', serif; font-size: 1.12rem; font-weight: 500; color: var(--ink); line-height: 1.2; }
.cell-title .chev { color: var(--gold); font-size: 0.7rem; margin-right: 0.35rem; display: inline-block; transition: transform 0.2s; }
.film-row.is-open .cell-title .chev { transform: rotate(90deg); }
.cell-orig { display: block; font-family: 'Montserrat', sans-serif; font-size: 0.72rem; font-style: italic; color: var(--muted); margin-top: 0.15rem; font-weight: 300; }
.cell-real { font-weight: 400; }
.tag-genre {
  display: inline-block; font-size: 0.66rem; letter-spacing: 0.03em;
  padding: 0.12rem 0.5rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); white-space: nowrap;
}
.prio-dot { color: var(--gold); letter-spacing: -1px; font-size: 0.8rem; }
.prio-dot .off { color: rgba(184,154,90,0.25); }

/* ── COLONNE / COMMANDES « VU » ── */
td.vu-cell { text-align: center; white-space: nowrap; }
.vu-controls { display: inline-flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.vu-check { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.vu-check input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.vu-box {
  width: 22px; height: 22px; border: 1.5px solid var(--muted); border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: var(--paper); transition: background 0.15s, border-color 0.15s;
}
.vu-box::after { content: "✓"; font-size: 0.8rem; opacity: 0; }
.vu-check input:checked + .vu-box { background: var(--seen); border-color: var(--seen); }
.vu-check input:checked + .vu-box::after { opacity: 1; }
.vu-check input:focus-visible + .vu-box { box-shadow: 0 0 0 3px rgba(184,154,90,0.3); }
.vu-check input:disabled { cursor: default; }
.vu-check input:disabled + .vu-box { opacity: 0.4; }
.vu-extra { display: none; flex-direction: column; align-items: center; gap: 0.25rem; }
.vu-controls.is-seen .vu-extra { display: flex; }
.vu-date {
  font-family: 'Montserrat', sans-serif; font-size: 0.68rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 3px; padding: 0.15rem 0.25rem;
  width: 8.5rem; max-width: 100%;
}
.vu-heart {
  background: none; border: none; cursor: pointer; font-size: 0.95rem; line-height: 1;
  padding: 0.1rem 0.35rem; border-radius: 999px; color: var(--muted);
  letter-spacing: 0.02em; transition: color 0.15s, background 0.15s;
}
.vu-heart .lbl { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; margin-left: 0.2rem; }
.vu-heart:hover { background: rgba(192,71,59,0.1); }
.vu-heart.is-fav { color: var(--heart); }

/* ── LIGNE DE DÉTAIL (dépliée) ── */
tr.detail-row > td { padding: 0; border-top: none; background: rgba(230, 236, 246, 0.55); }
.detail-inner { padding: 0.4rem 1.1rem 1.1rem; display: grid; gap: 0.75rem 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.detail-full { grid-column: 1 / -1; }
.detail-resume { font-size: 0.9rem; line-height: 1.6; color: var(--ink); font-style: italic; }
.detail-field .dl { display: block; font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.2rem; }
.detail-field .dv { font-size: 0.82rem; line-height: 1.5; color: var(--ink); }
.detail-note { grid-column: 1 / -1; font-size: 0.68rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 0.6rem; }
.detail-note a { color: var(--brand); }

.empty { text-align: center; color: var(--muted); font-style: italic; padding: 3rem 1rem; margin: 0; }

/* ── PAGINATION ── */
.pager { display: flex; align-items: center; justify-content: center; gap: 1.1rem; flex-wrap: wrap; margin: 1.4rem 0 0.6rem; }
.pager button {
  font-family: 'Montserrat', sans-serif; font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 3px;
  padding: 0.5rem 1rem; cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.pager button:hover:not(:disabled) { color: var(--gold); border-color: var(--gold); }
.pager button:disabled { opacity: 0.4; cursor: default; }
#pageinfo { font-size: 0.78rem; color: var(--muted); min-width: 8rem; text-align: center; }
.perpage { font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 0.5rem; }
.perpage select {
  font-family: 'Montserrat', sans-serif; font-size: 0.8rem; padding: 0.35rem 0.5rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 3px; color: var(--ink); cursor: pointer;
}

/* ── NOTE ── */
.note { font-size: 0.72rem; line-height: 1.6; color: var(--muted); margin: 2rem auto 0; max-width: 760px; text-align: center; }
.note code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: var(--paper-dark); padding: 0.1rem 0.35rem; border-radius: 3px; }
.note a { color: var(--brand); }

/* ── PIED ── */
.pied {
  text-align: center; padding: 2.5rem 1rem; margin-top: 3rem; font-size: 0.75rem;
  letter-spacing: 0.05em; color: var(--muted); border-top: 1px solid var(--line);
}
.pied a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.pied a:hover { color: var(--gold); }
.pied .sep { margin: 0 0.5rem; color: var(--gold); }

/* petit toast de sauvegarde */
#save-toast {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 9999;
  background: var(--ink); color: var(--paper); font-size: 0.78rem;
  padding: 0.6rem 0.95rem; border-radius: 8px; box-shadow: 0 10px 30px rgba(26,24,20,.22);
  opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s; pointer-events: none;
}
#save-toast.show { opacity: 1; transform: none; }
#save-toast.err { background: #7a2e26; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .scene, .entete { padding-left: 1rem; padding-right: 1rem; }
  .controls { padding: 1rem; }
  .ctrl { flex: 1 1 100%; }
  .ctrl-search { flex-basis: 100%; }
  .controls select { width: 100%; }
}
