:root {
  --sapin: #173a2e;
  --sapin-fonce: #0f2a21;
  --kraft: #d8b98b;
  --kraft-clair: #e6cfa9;
  --encre: #2b2118;
  --airelle: #b3263a;
  --fil: #c9a45c;
  --neige: #f3efe6;

  --titre: "Gloock", Georgia, serif;
  --main: "Kalam", "Comic Sans MS", cursive;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 50% -200px, #24523f 0%, transparent 70%),
    var(--sapin);
  color: var(--neige);
  font-family: var(--main);
  font-size: 1.125rem;
  line-height: 1.5;
}

a { color: inherit; }

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

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

/* ---------- En-tête ---------- */

.entete {
  padding: 56px 0 40px;
  text-align: center;
}

.entete h1 {
  margin: 0;
  font-family: var(--titre);
  font-weight: 400;
  font-size: clamp(2.6rem, 9vw, 5.2rem);
  line-height: 1;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.entete p {
  max-width: 34em;
  margin: 18px auto 0;
  color: #cfdcd3;
}

.bandeau {
  max-width: 40em;
  margin: 0 auto 32px;
  padding: 12px 16px;
  border: 1px dashed var(--fil);
  border-radius: 6px;
  color: var(--kraft-clair);
  text-align: center;
}

.lien-bandeau {
  display: block;
  margin: 6px auto 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--neige);
  font: inherit;
  font-size: 1rem;
  text-decoration: underline;
  cursor: pointer;
}

.accueil {
  max-width: 34em;
  margin: 0 auto 48px;
  padding: 24px 20px;
  border-radius: 8px;
  background: var(--kraft-clair);
  color: var(--encre);
  text-align: center;
}

.accueil h2 {
  margin: 0;
  font-family: var(--titre);
  font-weight: 400;
  font-size: 1.8rem;
}

.accueil p { margin: 8px 0 0; }

.boutons-accueil {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

/* ---------- Étiquettes ---------- */

.etiquettes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 56px 32px;
}

.etiquette {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 34px; /* place pour la ficelle */
}

/* la ficelle */
.etiquette::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 52px;
  background: var(--fil);
  transform: translateX(-50%);
}

.carte {
  position: relative;
  flex: 1;
  min-height: 210px;
  padding: 36px 22px 22px;
  background: var(--kraft);
  color: var(--encre);
  clip-path: polygon(18% 0, 82% 0, 100% 9%, 100% 100%, 0 100%, 0 9%);
  transform: rotate(var(--penche, 0deg));
  transform-origin: 50% 0;
}

.etiquette:nth-child(3n + 1) { --penche: -1.4deg; }
.etiquette:nth-child(3n + 2) { --penche: 1deg; }
.etiquette:nth-child(3n) { --penche: -0.4deg; }

/* l'œillet */
.carte::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: var(--sapin);
  box-shadow: 0 0 0 4px var(--kraft-clair);
}

/* La photo garde sa propre forme (paysage, portrait ou carrée) : rien n'est rogné. */
.carte img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 320px;
  margin: 0 auto 14px;
  border-radius: 2px;
}

.carte h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.prix {
  margin: 6px 0 0;
  font-size: 1.25rem;
}

.note {
  margin: 8px 0 0;
  color: #5a4632;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 2px solid var(--encre);
  border-radius: 999px;
  background: transparent;
  color: var(--encre);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.bouton:hover { background: rgba(43, 33, 24, 0.08); }

.bouton-offrir {
  border-color: var(--airelle);
  background: var(--airelle);
  color: var(--neige);
}

.bouton-offrir:hover { background: #941d2f; }

.lien-discret {
  padding: 0;
  border: 0;
  background: none;
  color: #5a4632;
  font: inherit;
  font-size: 1rem;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Réservé : le tampon ---------- */

.etiquette.prise .carte > :not(.tampon):not(.actions) { opacity: 0.55; }

.tampon {
  position: absolute;
  top: 58px;
  left: 50%;
  padding: 6px 14px;
  border: 3px solid var(--airelle);
  border-radius: 6px;
  color: var(--airelle);
  font-family: var(--titre);
  font-size: 1.7rem;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%) rotate(-12deg);
  pointer-events: none;
  mix-blend-mode: multiply;
}

.tampon small {
  display: block;
  max-width: 13em;
  margin: 0 auto;
  white-space: normal;
  overflow-wrap: anywhere;
  font-family: var(--main);
  font-size: 1rem;
}

.tampon.arrive { animation: tamponne 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }

@keyframes tamponne {
  from { transform: translateX(-50%) rotate(-12deg) scale(1.8); opacity: 0; }
  to { transform: translateX(-50%) rotate(-12deg) scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .tampon.arrive { animation: none; }
}

/* ---------- États ---------- */

.message {
  max-width: 32em;
  margin: 24px auto;
  text-align: center;
  color: var(--kraft-clair);
}

[hidden] { display: none !important; }

/* ---------- Fenêtre de réservation ---------- */

dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 28px 22px 22px;
  border: 0;
  border-radius: 8px;
  background: var(--kraft-clair);
  color: var(--encre);
  font-family: var(--main);
}

dialog::backdrop { background: rgba(15, 42, 33, 0.75); }

dialog h2 {
  margin: 0 0 6px;
  font-family: var(--titre);
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.15;
}

label {
  display: block;
  margin-top: 16px;
  font-weight: 700;
}

.aide {
  display: block;
  font-weight: 400;
  font-size: 0.95rem;
  color: #5a4632;
}

input,
textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 2px solid #8a6f4d;
  border-radius: 6px;
  background: #fbf6ec;
  color: var(--encre);
  font: inherit;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
}

.erreur {
  margin: 12px 0 0;
  color: var(--airelle);
  font-weight: 700;
}

.boutons-fenetre {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* ---------- Page d'édition ---------- */

.edition {
  max-width: 720px;
  margin: 0 auto;
}

.panneau {
  margin-bottom: 32px;
  padding: 24px 20px;
  border-radius: 8px;
  background: var(--kraft-clair);
  color: var(--encre);
}

.panneau h2 {
  margin: 0 0 4px;
  font-family: var(--titre);
  font-weight: 400;
  font-size: 1.8rem;
}

.liste-admin {
  list-style: none;
  margin: 0;
  padding: 0;
}

.liste-admin li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 14px 0;
  border-top: 1px dashed #8a6f4d;
}

.liste-admin .nom {
  flex: 1 1 200px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.liste-admin .nom span {
  display: block;
  font-weight: 400;
  font-size: 0.95rem;
  color: #5a4632;
}

.retour {
  color: var(--kraft-clair);
}
