/* Kiosque : la presse de la maison. Écrit pour les vieux Safari aussi (iPad de Maman). */
:root {
  --fond: #16110f;
  --fond-2: #211816;
  --carte: #261c19;
  --encre: #f4ecdc;
  --encre-2: #cfc2a8;
  --or: #d4b875;
  --or-vif: #e8cf8f;
  --or-sombre: #9c7f42;
  --trait: rgba(212, 184, 117, .28);
  --ombre: 0 18px 40px rgba(0, 0, 0, .45), 0 3px 8px rgba(0, 0, 0, .35);
  --nouveau: #c8443b;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --fond: #f5efe3;
    --fond-2: #ece3d1;
    --carte: #fffaf0;
    --encre: #1e1916;
    --encre-2: #5e5246;
    --or: #8a6a2c;
    --or-vif: #a37f36;
    --or-sombre: #6f5422;
    --trait: rgba(138, 106, 44, .3);
    --ombre: 0 16px 34px rgba(60, 40, 15, .22), 0 2px 6px rgba(60, 40, 15, .18);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--fond);
  background-image: radial-gradient(circle at 10% -10%, rgba(212, 184, 117, .16), transparent 45%),
                    radial-gradient(circle at 100% 0%, rgba(120, 30, 45, .22), transparent 40%);
  background-attachment: fixed;
  color: var(--encre);
  font: 18px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- en-tête ---------- */
.entete {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-wrap: wrap; flex-wrap: wrap;
  -webkit-box-align: end; -webkit-align-items: flex-end; align-items: flex-end;
  -webkit-box-pack: justify; -webkit-justify-content: space-between; justify-content: space-between;
  padding: 34px 40px 22px;
  padding-top: calc(34px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--trait);
}
.marque { margin: 0 24px 12px 0; }
.surtitre {
  display: block;
  font-size: 13px; font-weight: 600; letter-spacing: .32em; text-transform: uppercase;
  color: var(--or);
}
h1 {
  margin: 4px 0 0;
  font: italic 400 64px/1 var(--serif);
  letter-spacing: -.01em;
  color: var(--encre);
}
.jour { margin: 8px 0 0; font: 400 19px/1.3 var(--serif); color: var(--encre-2); }
.jour::first-letter { text-transform: uppercase; }

.outils {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  margin-bottom: 12px;
}
.recherche {
  position: relative;
  display: block;
  margin-right: 12px;
}
.recherche svg {
  position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; margin-top: -10px;
  fill: none; stroke: var(--encre-2); stroke-width: 2; stroke-linecap: round;
}
.recherche input {
  width: 300px; height: 52px;
  padding: 0 18px 0 46px;
  border: 1px solid var(--trait); border-radius: 26px;
  background: var(--fond-2); color: var(--encre);
  font: 17px var(--sans);
  -webkit-appearance: none; appearance: none;
  outline: none;
}
.recherche input:focus { border-color: var(--or); box-shadow: 0 0 0 3px rgba(212, 184, 117, .2); }
.recherche input::-webkit-input-placeholder { color: var(--encre-2); opacity: .8; }
.recherche input::placeholder { color: var(--encre-2); opacity: .8; }

.bouton-or {
  display: -webkit-inline-box; display: -webkit-inline-flex; display: inline-flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  height: 52px; padding: 0 24px 0 18px;
  border: 0; border-radius: 26px;
  background: linear-gradient(180deg, var(--or-vif), var(--or));
  color: #1b130a; font-weight: 700; font-size: 17px; letter-spacing: .02em;
  box-shadow: 0 6px 18px rgba(212, 184, 117, .25);
}
.bouton-or svg { width: 22px; height: 22px; margin-right: 8px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.bouton-or:active { -webkit-transform: translateY(1px); transform: translateY(1px); }

main { padding: 10px 40px 80px; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

/* ---------- le mot pour la famille ---------- */
.mot {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  margin: 24px 0 0; padding: 18px 20px 18px 22px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(212, 184, 117, .14), rgba(212, 184, 117, .04));
  border: 1px solid var(--trait); border-left: 4px solid var(--or);
}
.mot p { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; margin: 0; font: 17px/1.5 var(--serif); color: var(--encre); }
.mot-salut { display: block; font-style: italic; color: var(--or); margin-bottom: 2px; }
.mot strong { color: var(--or-vif); font-weight: 600; }
.mot button {
  margin-left: 18px; height: 44px; padding: 0 20px; border-radius: 22px; -webkit-flex-shrink: 0; flex-shrink: 0;
  border: 1px solid var(--or); background: transparent; color: var(--or-vif); font: 600 16px var(--sans);
}
@media (max-width: 600px) {
  .mot { -webkit-box-orient: vertical; -webkit-flex-direction: column; flex-direction: column; -webkit-box-align: start; -webkit-align-items: flex-start; align-items: flex-start; }
  .mot button { margin: 14px 0 0; }
}

/* ---------- rayons : Tout · Journaux · Magazines ---------- */
.rayons {
  display: -webkit-box; display: -webkit-flex; display: flex;
  margin: 24px 0 0; padding: 5px; border-radius: 30px;
  background: var(--fond-2); border: 1px solid var(--trait);
  width: -webkit-max-content; width: max-content; max-width: 100%;
}
.rayons button {
  height: 48px; padding: 0 26px; margin: 0; border: 0; border-radius: 24px;
  background: transparent; color: var(--encre-2);
  font: 600 17px var(--sans); letter-spacing: .02em;
  -webkit-transition: background .2s, color .2s; transition: background .2s, color .2s;
}
.rayons button.actif {
  background: linear-gradient(180deg, var(--or-vif), var(--or)); color: #1b130a;
  box-shadow: 0 4px 12px rgba(212, 184, 117, .25);
}

.themes {
  display: -webkit-box; display: -webkit-flex; display: flex;
  margin: 14px -4px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.themes::-webkit-scrollbar { display: none; }
.themes button {
  -webkit-flex-shrink: 0; flex-shrink: 0;
  height: 42px; margin: 0 4px; padding: 0 18px; border-radius: 21px;
  border: 1px solid var(--trait); background: transparent; color: var(--encre);
  font: 500 16px var(--sans); white-space: nowrap;
}
.themes button small { margin-left: 6px; color: var(--encre-2); font-size: 13px; }
.themes button.actif { border-color: var(--or); background: rgba(212, 184, 117, .16); color: var(--or-vif); }

/* ---------- sections ---------- */
.tete-section {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: baseline; -webkit-align-items: baseline; align-items: baseline;
  -webkit-box-pack: justify; -webkit-justify-content: space-between; justify-content: space-between;
  margin: 34px 0 6px;
}
h2 {
  margin: 0;
  font: 400 30px/1.15 var(--serif);
  color: var(--encre);
}
.tete-section h2::after {
  content: ""; display: block; width: 54px; height: 2px; margin-top: 10px;
  background: linear-gradient(90deg, var(--or), transparent);
}
.discret { color: var(--encre-2); font-size: 16px; }

/* ---------- l'étagère ---------- */
.etagere { position: relative; }
.rayon {
  display: -webkit-box; display: -webkit-flex; display: flex;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding: 26px 4px 46px;
  scrollbar-width: none;
}
.rayon::-webkit-scrollbar { display: none; }
.etagere::after {                         /* la planche */
  content: ""; position: absolute; left: 0; right: 0; bottom: 30px; height: 12px;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(212, 184, 117, .55), rgba(156, 127, 66, .35) 40%, rgba(0, 0, 0, .25));
  box-shadow: 0 10px 22px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.rayon .numero {
  -webkit-box-flex: 0; -webkit-flex: 0 0 auto; flex: 0 0 auto;
  width: 200px; margin-right: 30px;
  scroll-snap-align: start;
  position: relative; z-index: 1;
}
.rayon .numero:last-child { margin-right: 4px; }
.rayon .legende { position: absolute; left: 0; right: 0; top: 100%; margin-top: 22px; }

.fleche {
  position: absolute; top: 50%; z-index: 3; margin-top: -48px;
  width: 52px; height: 52px; border-radius: 26px;
  border: 1px solid var(--trait); background: var(--carte); color: var(--or);
  font: 34px/46px var(--serif); text-align: center; padding: 0;
  box-shadow: var(--ombre);
  opacity: 0; -webkit-transition: opacity .2s; transition: opacity .2s;
}
.fleche.gauche { left: -18px; }
.fleche.droite { right: -18px; }
@media (hover: hover) { .etagere:hover .fleche { opacity: 1; } }

/* ---------- une couverture ---------- */
.numero { display: block; }
.papier {
  position: relative;
  width: 100%;
  padding-top: 141.4%;                    /* format A4, sans aspect-ratio pour les vieux Safari */
  border-radius: 4px;
  overflow: hidden;
  background: #efe7d6;
  box-shadow: var(--ombre);
  -webkit-transition: -webkit-transform .25s ease, box-shadow .25s ease;
  transition: transform .25s ease, box-shadow .25s ease;
}
.papier img, .papier .couv-texte {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
}
.papier img { -o-object-fit: cover; object-fit: cover; -o-object-position: top; object-position: top; }
.papier::after {                          /* reflet discret du papier */
  content: ""; position: absolute; left: 0; top: 0; right: 0; bottom: 0;
  background: linear-gradient(105deg, rgba(255, 255, 255, .18), transparent 30%, transparent 75%, rgba(0, 0, 0, .12));
  pointer-events: none;
}
.numero:hover .papier, .numero:focus .papier { -webkit-transform: translateY(-6px); transform: translateY(-6px); }
.numero:active .papier { -webkit-transform: scale(.98); transform: scale(.98); }

.couv-texte {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: vertical; -webkit-flex-direction: column; flex-direction: column;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  padding: 16px; text-align: center;
  background: linear-gradient(160deg, #f7f1e4, #e6dcc6);
  color: #2a211b;
  font: 600 22px/1.15 var(--serif);
}
.couv-texte small { display: block; margin-top: 10px; font: 13px var(--sans); color: #6b5d4c; letter-spacing: .08em; text-transform: uppercase; }

.badge {
  position: absolute; top: 12px; left: -1px; z-index: 2;
  padding: 5px 12px 5px 10px;
  border-radius: 0 14px 14px 0;
  background: var(--nouveau); color: #fff;
  font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .3);
}
.progres {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: 6px;
  background: rgba(0, 0, 0, .35);
}
.progres span { display: block; height: 100%; background: var(--or-vif); }

.legende { margin-top: 14px; }
.legende strong {
  display: block;
  font: 600 19px/1.25 var(--serif); color: var(--encre);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.legende span { display: block; margin-top: 3px; font-size: 15px; color: var(--encre-2); }
.legende em { font-style: normal; color: var(--or); }

/* ---------- tous les titres ---------- */
.titres {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-wrap: wrap; flex-wrap: wrap;
  margin: 18px -9px 0;
}
.titre {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  width: calc(33.333% - 18px); margin: 9px;
  padding: 14px 18px 14px 14px;
  border: 1px solid var(--trait); border-radius: 18px;
  background: var(--carte);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  -webkit-transition: border-color .2s, -webkit-transform .2s; transition: border-color .2s, transform .2s;
}
.titre:hover { border-color: var(--or); -webkit-transform: translateY(-2px); transform: translateY(-2px); }
.titre:active { -webkit-transform: scale(.99); transform: scale(.99); }
.titre .papier { width: 74px; padding-top: 104px; -webkit-flex-shrink: 0; flex-shrink: 0; border-radius: 3px; box-shadow: 0 6px 14px rgba(0, 0, 0, .35); }
.titre .couv-texte { font-size: 11px; padding: 6px; }
.titre .couv-texte small { display: none; }
.titre .texte { margin-left: 18px; min-width: 0; -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; }
.titre strong { display: block; font: 600 22px/1.2 var(--serif); }
.titre span { display: block; margin-top: 4px; font-size: 15px; color: var(--encre-2); }
.titre .chevron { margin-left: 10px; font: 30px var(--serif); color: var(--or); }

/* ---------- grilles (un titre, une recherche) ---------- */
.retour {
  display: inline-block; margin-top: 26px; padding: 12px 20px 12px 14px;
  border: 1px solid var(--trait); border-radius: 26px;
  color: var(--or); font-size: 17px; font-weight: 600;
}
.retour span { font: 24px/0 var(--serif); margin-right: 4px; position: relative; top: 2px; }
.tete-titre { margin: 26px 0 8px; }
.tete-titre h2 { font-size: 42px; font-style: italic; }
.tete-titre p { margin: 6px 0 0; }
.grille {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-wrap: wrap; flex-wrap: wrap;
  margin: 18px -14px 0;
}
.grille .numero { width: calc(20% - 28px); margin: 14px 14px 26px; }

/* ---------- vide, erreurs, dépôt, envoi ---------- */
.vide { text-align: center; padding: 70px 20px; }
.vide h2 { font-size: 34px; margin-top: 30px; }
.vide p { color: var(--encre-2); font-size: 19px; }
.vide-pile { position: relative; width: 120px; height: 150px; margin: 0 auto; }
.vide-pile span { position: absolute; left: 10px; top: 0; width: 100px; height: 140px; border-radius: 4px; background: #efe7d6; box-shadow: var(--ombre); }
.vide-pile span:nth-child(1) { -webkit-transform: rotate(-9deg); transform: rotate(-9deg); opacity: .6; }
.vide-pile span:nth-child(2) { -webkit-transform: rotate(6deg); transform: rotate(6deg); opacity: .8; }
.erreur { margin: 30px 0; padding: 18px 22px; border-radius: 14px; background: rgba(200, 68, 59, .15); border: 1px solid rgba(200, 68, 59, .5); }

.depot {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 20;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  background: rgba(10, 7, 6, .82);
  border: 3px dashed var(--or); margin: 14px; border-radius: 26px;
  color: var(--or-vif); text-align: center; font: italic 34px var(--serif);
}
.depot svg { width: 64px; height: 64px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.envoi {
  position: fixed; left: 50%; bottom: 26px; bottom: calc(26px + env(safe-area-inset-bottom)); z-index: 21;
  width: 420px; max-width: calc(100% - 32px); margin-left: -210px;
  padding: 18px 22px; border-radius: 18px;
  background: var(--carte); border: 1px solid var(--trait); box-shadow: var(--ombre);
}
.envoi p { margin: 0 0 12px; font-size: 16px; }
.envoi-barre { height: 6px; border-radius: 3px; background: var(--fond-2); overflow: hidden; }
.envoi-barre span { display: block; height: 100%; width: 0; background: var(--or); -webkit-transition: width .2s; transition: width .2s; }

.pied { margin-top: 60px; text-align: center; font: italic 15px var(--serif); color: var(--encre-2); opacity: .8; }

/* ---------- écrans ---------- */
@media (max-width: 1100px) {
  .titre { width: calc(50% - 18px); }
  .grille .numero { width: calc(25% - 28px); }
}
@media (max-width: 820px) {
  .entete { padding: 24px 22px 16px; padding-top: calc(24px + env(safe-area-inset-top)); }
  main { padding-left: 22px; padding-right: 22px; }
  h1 { font-size: 52px; }
  .outils { width: 100%; }
  .recherche { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; }
  .recherche input { width: 100%; }
  .grille .numero { width: calc(33.333% - 28px); }
  .fleche { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .entete { padding: 18px 16px 14px; padding-top: calc(18px + env(safe-area-inset-top)); }
  main { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 44px; }
  .surtitre { font-size: 11px; }
  .bouton-or span { display: none; }
  .bouton-or { padding: 0; width: 52px; -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center; }
  .bouton-or svg { margin: 0; }
  h2 { font-size: 26px; }
  .rayon .numero { width: 150px; margin-right: 20px; }
  .titre { width: calc(100% - 18px); }
  .grille { margin: 12px -8px 0; }
  .grille .numero { width: calc(50% - 16px); margin: 8px 8px 22px; }
  .tete-titre h2 { font-size: 34px; }
  #compte { display: none; }
  .rayons { width: 100%; }
  .rayons button { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; padding: 0 8px; font-size: 16px; }
  .recherche input { font-size: 16px; }              /* 16 px : l'iPhone ne zoome pas en tapant */
}

/* ---------- page de connexion ---------- */
.page-connexion main.connexion {
  max-width: 420px; margin: 0 auto; padding: 12vh 24px 40px; text-align: center;
}
.connexion-icone { width: 88px; height: 88px; border-radius: 20px; box-shadow: var(--ombre); margin-bottom: 22px; }
.connexion h1 { font-size: 60px; margin-bottom: 30px; }
.connexion-carte {
  padding: 26px 24px 20px; border-radius: 22px; text-align: left;
  background: var(--carte); border: 1px solid var(--trait); box-shadow: var(--ombre);
}
.connexion-carte label { display: block; margin-bottom: 10px; font: 600 15px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--or); }
.connexion-carte input[type=password] {
  display: block; width: 100%; height: 58px; padding: 0 18px;
  border: 1px solid var(--trait); border-radius: 14px; background: var(--fond-2); color: var(--encre);
  font: 22px var(--sans); letter-spacing: .1em; outline: none; -webkit-appearance: none; appearance: none;
}
.connexion-carte input[type=password]:focus { border-color: var(--or); box-shadow: 0 0 0 3px rgba(212, 184, 117, .2); }
.connexion-carte .bouton-or { width: 100%; height: 58px; margin-top: 16px; padding: 0; font-size: 19px;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center; }
.connexion-carte .bouton-or span { display: inline !important; }
.connexion-message { min-height: 24px; margin: 12px 0 0; color: #e0675d; font-size: 16px; text-align: center; }
.connexion .discret { margin-top: 20px; font: italic 16px var(--serif); }
.secoue { -webkit-animation: secoue .45s; animation: secoue .45s; }
@-webkit-keyframes secoue { 20%, 60% { -webkit-transform: translateX(-10px); } 40%, 80% { -webkit-transform: translateX(10px); } }
@keyframes secoue { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
