/* The page is a betting slip: printed in red ink on pink paper (Archivo,
   condensed for the print), and filled in with a blue ballpoint (Mynerve)
   wherever the visitor writes: the picks, the ranks, the first name. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Mynerve";
  src: url("/fonts/mynerve-latin.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Mynerve";
  src: url("/fonts/mynerve-latin-ext.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --rose: #f6d6df;      /* the paper */
  --rose-dark: #ebbfcb; /* behind a photo that is still loading */
  --rouge: #c1121f;     /* printed ink: titles, rules, numbers */
  --bordeaux: #5c0b17;  /* printed ink for running text */
  --bic: #1d3aa6;       /* the visitor's ballpoint */
  --blanc: #fff;        /* the ticket */
  --hand: "Mynerve", "Bradley Hand", cursive;
  --bar: 64px;          /* height of the ticket bar on a phone */
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--rose);
  color: var(--bordeaux);
  font: 400 17px/1.45 "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
}
body.sheet-open { overflow: hidden; }

img { display: block; max-width: 100%; }

a { color: var(--rouge); }

:focus-visible { outline: 3px solid var(--bic); outline-offset: 2px; }

[hidden] { display: none !important; }

/* Masthead */

.masthead { padding: 14px 16px 18px; border-bottom: 6px double var(--rouge); }

.edition {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 16px;
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rouge);
  color: var(--rouge);
  font-size: 14px;
  font-weight: 600;
}

h1 {
  margin: 10px 0 12px;
  color: var(--rouge);
  font-size: clamp(64px, 20.5vw, 210px);
  font-stretch: 62%;
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.005em;
}

.lede { max-width: 33em; margin: 0; font-size: 18px; }

/* Notices */

.notice { margin: 16px; padding: 12px 14px; border: 2px solid var(--rouge); background: var(--blanc); color: var(--rouge); font-weight: 600; }

.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(var(--bar) + 12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 24px);
  margin: 0;
  padding: 12px 16px;
  background: var(--bordeaux);
  color: var(--blanc);
  font-weight: 600;
  pointer-events: none;
}

/* Layout */

.layout { padding: 0 16px calc(var(--bar) + 40px); }

.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-top: 26px; }

.section-title {
  margin: 0;
  color: var(--rouge);
  font-size: 40px;
  font-stretch: 62%;
  font-weight: 800;
  line-height: 1;
}
.section-sub { margin: 6px 0 18px; font-size: 15px; }

.views { display: flex; border: 2px solid var(--rouge); }
.views button {
  min-width: 84px;
  min-height: 44px;
  padding: 6px 14px;
  border: 0;
  background: var(--blanc);
  color: var(--rouge);
  font: inherit;
  font-size: 18px;
  font-stretch: 75%;
  font-weight: 800;
  cursor: pointer;
}
.views button[aria-pressed="true"] { background: var(--rouge); color: var(--blanc); }

main:focus { outline: none; }

/* The candidates */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card { display: flex; flex-direction: column; }

.card-photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--rouge);
  background: var(--rose-dark);
  cursor: pointer;
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; }

.dossard {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 6px;
  background: var(--rouge);
  color: var(--blanc);
  font-size: 27px;
  font-stretch: 62%;
  font-weight: 800;
  line-height: 1;
}
.card-photo .dossard { position: absolute; top: 0; left: 0; }

.card-region {
  margin: 8px 0 1px;
  color: var(--rouge);
  font-size: 20px;
  font-stretch: 70%;
  font-weight: 800;
  line-height: 1.05;
}
.card-name { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.25; }
.card-meta { margin: 1px 0 6px; font-size: 14px; line-height: 1.3; }

/* A checkbox of the form: the box takes the rank, written by hand. */
.case {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-top: auto;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--rouge);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.box {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--rouge);
  background: var(--blanc);
  color: var(--bic);
  font: 30px/1 var(--hand);
}
.box svg { position: absolute; inset: -7px; width: calc(100% + 14px); height: calc(100% + 14px); overflow: visible; }
.box path { fill: none; stroke: var(--bic); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 130; stroke-dashoffset: 0; }
.case[aria-pressed="true"] .box path { animation: draw 0.35s ease-out; }
@keyframes draw { from { stroke-dashoffset: 130; } }
.case[aria-pressed="true"] .case-label { color: var(--bic); font: 21px/1.1 var(--hand); }

/* The ticket */

.slip {
  --hole: 7px;
  position: relative;
  padding: 18px 22px 20px;
  background: var(--blanc);
  color: var(--bordeaux);
  /* Perforated edges, like a ticket torn from its book. */
  -webkit-mask:
    radial-gradient(circle at 0 50%, transparent var(--hole), #000 calc(var(--hole) + 0.5px)) left / 51% 24px repeat-y,
    radial-gradient(circle at 100% 50%, transparent var(--hole), #000 calc(var(--hole) + 0.5px)) right / 51% 24px repeat-y;
  mask:
    radial-gradient(circle at 0 50%, transparent var(--hole), #000 calc(var(--hole) + 0.5px)) left / 51% 24px repeat-y,
    radial-gradient(circle at 100% 50%, transparent var(--hole), #000 calc(var(--hole) + 0.5px)) right / 51% 24px repeat-y;
}

.slip h2 {
  margin: 0;
  color: var(--rouge);
  font-size: 34px;
  font-stretch: 62%;
  font-weight: 800;
  line-height: 1;
}

.slip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.close {
  flex: none;
  width: 44px;
  height: 44px;
  border: 2px solid var(--rouge);
  background: var(--blanc);
  color: var(--rouge);
  font: 700 26px/1 "Archivo", sans-serif;
  cursor: pointer;
}

.owner { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 6px; color: var(--rouge); font-size: 15px; font-weight: 700; }
.owner span { flex: none; }
.owner input {
  flex: 1;
  min-width: 0;
  padding: 2px 2px 0;
  border: 0;
  border-bottom: 1px dashed var(--rouge);
  border-radius: 0;
  background: transparent;
  color: var(--bic);
  font: 26px/1.2 var(--hand);
}
.owner input::placeholder { color: #8a93c7; }

.slots { margin: 6px 0 0; padding: 0; list-style: none; }

/* A place: its number, its rank, then the pick on a second line, so a long
   region name wraps instead of being cut. */
.slot {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  grid-template-areas: "pos rank tools" "pos pick pick";
  column-gap: 10px;
  row-gap: 4px;
  align-items: center;
  min-height: 70px;
  padding: 8px 0;
  border-top: 1px solid var(--rouge);
}
.slot:last-child { border-bottom: 1px solid var(--rouge); }
.slot-ticket, .slot-zone { grid-template-columns: 22px 26px minmax(0, 1fr) auto; grid-template-areas: "handle pos rank tools" "handle pos pick pick"; column-gap: 8px; }

.handle { grid-area: handle; }
.pos { grid-area: pos; color: var(--rouge); font-size: 40px; font-stretch: 62%; font-weight: 800; line-height: 1; text-align: center; }
.rank { grid-area: rank; color: var(--rouge); font-size: 13px; font-weight: 700; }
.slot-tools { grid-area: tools; display: flex; gap: 4px; }
.slot .pick { grid-area: pick; }
.pick.empty { display: block; color: #9a6a74; font-size: 14px; }

.pick { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 10px; align-items: center; }
.pick img { grid-row: span 2; width: 44px; height: 44px; object-fit: cover; border: 1px solid var(--rouge); }
.pick-region { color: var(--bic); font: 22px/1.1 var(--hand); }
.pick-name { font-size: 13px; }

.slot-tools button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--rouge);
  background: var(--blanc);
  color: var(--rouge);
  font: 700 18px/1 "Archivo", sans-serif;
  cursor: pointer;
}
.slot-tools button:disabled { border-color: #e7b3bb; color: #e7b3bb; cursor: default; }

.combo { margin: 12px 0 0; color: var(--rouge); font-size: 15px; font-weight: 700; }
.combo span { color: var(--bic); font: 22px/1 var(--hand); }

.hint { margin: 8px 0 0; font-size: 15px; }

.share { display: grid; gap: 10px; margin-top: 16px; }
.share-more { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 0; font-weight: 700; }
.share-status { margin: 0; font-size: 15px; }
.share-status input { width: 100%; margin-top: 6px; padding: 8px; border: 1px solid var(--rouge); font: inherit; font-size: 14px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 18px;
  border: 2px solid var(--rouge);
  background: var(--rouge);
  color: var(--blanc);
  font: inherit;
  font-size: 20px;
  font-stretch: 75%;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.button.secondary { background: var(--blanc); color: var(--rouge); }
.button:disabled { opacity: 0.5; cursor: progress; }

.link { padding: 0; border: 0; background: none; color: var(--rouge); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* Drag and drop: the handle of a row, the row being dragged, where it would land. */

.handle {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-width: 26px;
  min-height: 44px;
  cursor: grab;
  touch-action: none;
}
.handle::before {
  content: "";
  width: 12px;
  height: 20px;
  background: radial-gradient(circle, var(--rouge) 1.7px, transparent 2.1px) 0 0 / 6px 6.67px;
}
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.is-dragging { opacity: 0.35; }
.ghost {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 0;
  margin: 0;
  list-style: none;
  background: var(--blanc);
  box-shadow: 0 12px 28px rgba(92, 11, 23, 0.35);
  pointer-events: none;
}
.slot.is-over { background: #e8ecfa; box-shadow: inset 0 3px 0 var(--bic); }
.rest.is-over { outline: 3px dashed var(--bic); outline-offset: -3px; }

/* The list: the ticket's places stay at the top of the screen while the
   other candidates scroll under them. */

.zone {
  position: sticky;
  z-index: 5;
  top: 0;
  margin: 0 -16px;
  padding: 8px 16px 10px;
  border-bottom: 6px double var(--rouge);
  background: var(--rose);
}
.zone-title { margin: 0 0 2px; color: var(--rouge); font-size: 20px; font-stretch: 62%; font-weight: 800; line-height: 1.1; }
/* One line per place: the number says the rank, the sheet spells it out. */
.zone .slot { grid-template-areas: "handle pos pick tools"; min-height: 42px; padding: 0; }
.zone .handle { min-height: 40px; }
.zone .pos { font-size: 26px; }
.zone .rank { display: none; }
.zone .pick { display: block; }
.zone .pick-region { font-size: 19px; }
.zone .pick.empty { font-size: 13px; }
.zone .slot-tools button { width: 32px; height: 32px; }

.rest { margin: 12px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rouge); }
.row { display: flex; align-items: center; gap: 6px; min-height: 64px; border-bottom: 1px solid var(--rouge); }
.row-open {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.row-number { flex: none; width: 28px; color: var(--rouge); font-size: 26px; font-stretch: 62%; font-weight: 800; text-align: center; }
.row-open img { flex: none; width: 48px; height: 48px; object-fit: cover; border: 1px solid var(--rouge); }
.row-text { display: grid; min-width: 0; }
.row-region { color: var(--rouge); font-size: 18px; font-stretch: 70%; font-weight: 800; line-height: 1.1; }
.row-name { font-size: 14px; line-height: 1.3; }
.add {
  flex: none;
  width: 44px;
  height: 44px;
  border: 2px solid var(--rouge);
  background: var(--blanc);
  color: var(--rouge);
  font: 800 28px/1 "Archivo", sans-serif;
  cursor: pointer;
}

/* On a phone the ticket is a bar at the bottom that opens as a sheet. */

.ticket { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; }

.ticket-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--bar);
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  border: 0;
  background: var(--rouge);
  color: var(--blanc);
  font: inherit;
  cursor: pointer;
}
.toggle-title { font-size: 24px; font-stretch: 62%; font-weight: 800; }
.mini { display: flex; flex: 1; gap: 5px; }
.mini span { display: grid; place-items: center; width: 30px; height: 30px; background: var(--blanc); color: var(--bic); font: 19px/1 var(--hand); }
.count { font-size: 17px; font-weight: 700; }

.ticket-body { display: none; }
.ticket.is-open .ticket-body {
  position: fixed;
  right: 8px;
  bottom: calc(var(--bar) + env(safe-area-inset-bottom) + 6px);
  left: 8px;
  display: block;
  max-height: calc(100dvh - var(--bar) - 30px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.backdrop { position: fixed; z-index: 15; inset: 0; background: rgba(92, 11, 23, 0.55); }

/* A friend's ticket, opened from a link */

.shared { margin: 20px 16px 0; }
.shared .slip { max-width: 520px; }
.shared .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 16px; }

/* The fiche of one candidate */

.fiche {
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--rose);
  color: var(--bordeaux);
}
.fiche::backdrop { background: rgba(92, 11, 23, 0.6); }
.fiche[open] { display: flex; flex-direction: column; }
#fiche-content { display: flex; flex: 1; flex-direction: column; min-height: 0; }

.fiche-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

.fiche-top { position: sticky; z-index: 1; top: 0; display: flex; justify-content: flex-end; padding: 8px; pointer-events: none; }
.fiche-top .close { pointer-events: auto; }

.photos {
  display: flex;
  gap: 8px;
  margin-top: -60px;
  padding: 0 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
/* A landscape photo shows whole; a tall one is cut at 62 % of the screen,
   around the face. */
.photos figure { flex: none; width: min(86vw, 640px); margin: 0; scroll-snap-align: start; }
.photos img { width: 100%; height: auto; max-height: 62vh; object-fit: cover; border: 2px solid var(--rouge); background: var(--rose-dark); }
.photos figcaption { margin-top: 4px; font-size: 12px; }

.fiche-body { max-width: 40em; padding: 12px 16px 24px; }
.fiche-region { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; color: var(--rouge); font-size: 24px; font-stretch: 70%; font-weight: 800; }
.fiche h2:focus { outline: none; }
.fiche h2 { margin: 2px 0 12px; font-size: 44px; font-stretch: 62%; font-weight: 800; line-height: 1; }
.insta { margin: -4px 0 14px; font-weight: 700; }
.fiche h3 { margin: 20px 0 6px; color: var(--rouge); font-size: 22px; font-stretch: 70%; font-weight: 800; }
.fiche-facts, .fiche-bio { margin: 0; padding-left: 20px; }
.fiche-facts li, .fiche-bio li { margin: 4px 0; }
.fiche-facts { padding: 0; list-style: none; border-top: 1px solid var(--rouge); }
.fiche-facts li { margin: 0; padding: 6px 0; border-bottom: 1px solid var(--rouge); }
.fiche-bio li::marker { color: var(--rouge); }
.sources { margin-top: 18px; font-size: 14px; }
.sources summary { color: var(--rouge); font-weight: 700; cursor: pointer; }
.sources ul { padding-left: 20px; }

.fiche-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 2px solid var(--rouge); background: var(--rose); }
.fiche-foot .button { width: 100%; }
.fiche-foot .button[aria-pressed="true"] { background: var(--blanc); color: var(--rouge); }
.fiche-status { margin: 8px 0 0; color: var(--rouge); font-weight: 700; }
.fiche-status:empty { display: none; }

/* Footer */

.footer { margin: 0 16px; padding: 18px 0 calc(var(--bar) + 30px); border-top: 6px double var(--rouge); font-size: 14px; }
.footer p { max-width: 46em; margin: 0 0 8px; }

/* Visually hidden, read by screen readers */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 18px; }
  .masthead, .layout { padding-left: 28px; padding-right: 28px; }
  .shared, .footer { margin-left: 28px; margin-right: 28px; }
  .zone { margin: 0 -28px; padding: 8px 28px 10px; }
  .fiche { width: min(760px, calc(100vw - 48px)); height: auto; max-height: calc(100dvh - 48px); margin: auto; border: 2px solid var(--rouge); }
}

/* On a wide screen the ticket stays in view next to the candidates. */
@media (min-width: 1000px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; padding-bottom: 40px; }
  .ticket { position: sticky; top: 16px; right: auto; bottom: auto; left: auto; margin-top: 26px; }
  .ticket-toggle, .backdrop, #ticket-close, .zone { display: none !important; }
  .ticket-body { display: block; max-height: calc(100vh - 32px); overflow-y: auto; }
  .footer { padding-bottom: 30px; }
  .toast { bottom: 24px; }
}

@media (min-width: 1300px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .case[aria-pressed="true"] .box path { animation: none; }
}

/* The static page of one candidate (/miss-normandie-2026-pauline-gourlez/),
   and the list of all the fiches on the home page. */

.masthead-small { padding-bottom: 10px; }
.brand { margin: 8px 0 0; font-size: 40px; font-stretch: 62%; font-weight: 800; line-height: 1; }
.brand a { color: var(--rouge); text-decoration: none; }

.page-main { max-width: 760px; padding: 0 16px calc(var(--bar) + 20px); }
.crumbs { margin: 14px 0 10px; font-size: 14px; }
.page-title { margin: 2px 0 6px; color: var(--bordeaux); font-size: 52px; font-stretch: 62%; font-weight: 800; line-height: 1; }
.page .lede { margin-bottom: 16px; }
.page-photos { margin: 0 -16px 12px; }
.page h2 { margin: 22px 0 6px; color: var(--rouge); font-size: 26px; font-stretch: 70%; font-weight: 800; }
.page-cta { margin: 22px 0; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin: 26px 0 0; padding-top: 12px; border-top: 1px solid var(--rouge); font-weight: 700; }
.page .footer { padding-bottom: 30px; }

.all-fiches { margin: 10px 16px 26px; }
.all-fiches ul { columns: 2 260px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 15px; }
.all-fiches li { margin: 0 0 6px; break-inside: avoid; }

@media (min-width: 640px) {
  .page-main { padding: 0 28px 40px; }
  .page-photos { margin: 0 0 12px; padding: 0; }
  .all-fiches { margin-left: 28px; margin-right: 28px; }
}
