/* ================================
   🌅 Mobile-first CSS (Cheezz)
   - Palette & variables
   - Accessibilité & focus
   - Animations respectueuses
   - Galerie responsive & ratios
   ================================ */
:root{
  --bg: #ff7a00;         /* orange fond */
  --accent: #ff5722;     /* orange soutenu */
  --accent-2: #ff9800;   /* orange clair bouton secondaire */
  --hi: #ffeb3b;         /* jaune vif */
  --hi-2:#fff700;        /* jaune hover */
  --ink:#000;
  --ink-inv:#fff;
  --shadow: rgba(0,0,0,.3);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --space: 20px;
  --space-lg: 30px;
  --maxw: 640px;
}

/* Respecte les encoches iOS */
html, body { height: 100%; }
body {
  background-color: #FFB347; /* orange pastel plus doux */
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Arial Black", sans-serif;
  color: var(--ink-inv);
  text-align: center;
  margin: 0;
  padding: 0;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: clamp(16px, 4vw, 18px); /* base fluide */
}


/* Titres */
h2 {
  text-align: left;
  font-size: clamp(1.4rem, 5vw, 2rem);
  margin: 0 0 12px;
  text-shadow: 2px 2px #000;
}

/* Sous-titre dans le header (fond orange) */
.container h3 {
  color: rgba(255,255,255,.95);
  text-shadow: 1px 1px 0 #000;
  font-weight: 600;
  margin: .4em 0 1.2em;
  font-size: clamp(1.1rem, 4.5vw, 1.6rem);
}

/* Titre du modal (fond blanc) */
#modal .sheet h3,
#modal .sheet #modal-title {
  color: #111;
  text-shadow: none;
  font-weight: 700;
  font-size: clamp(1.1rem, 4.5vw, 1.5rem);
}

/* Option : variante “accent doux” pour le header si tu veux moins de blanc */
.container h3.use-accent {
  color: #ffe08a;
  text-shadow: 1px 1px 0 rgba(0,0,0,.5);
}

/* Formulaires */
form {
  background-color: var(--accent);
  padding: clamp(16px, 4vw, 30px);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 20px var(--hi-2);
  display: inline-block;
  margin-top: 16px;
  width: 100%;
  max-width: var(--maxw);
  text-align: left;
}

input[type="file"],
input[type="text"],
select {
  width: 100%;
  font-size: clamp(1rem, 3.8vw, 1.125rem);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #e9e9e9;
  outline: none;
  box-sizing: border-box;
}

input[type="file"]{
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

select { background: #fff; }

/* Boutons */
button, a.button {
  margin-top: 16px;
  padding: 12px 20px;
  background-color: var(--hi);
  color: var(--ink);
  border: none;
  border-radius: 999px;
  font-size: clamp(1rem, 4vw, 1.3rem);
  font-weight: 800;
  box-shadow: 0 2px 10px #333;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform .2s ease, background-color .25s ease, box-shadow .25s ease;
  will-change: transform;
}

button:hover,
a.button:hover { background-color: var(--hi-2); transform: scale(1.04); }

#open-modal{
  margin-top: 12px;
  background: #FFEB99;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

form > button[type="submit"]{
  margin-top: 12px;
  /*background: #111;
  color: #fff;*/
}

/* Focus visible pour accessibilité */
button:focus-visible,
a.button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--hi);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255,235,59,.35);
}

/* Texte */
/*p,
li {
  font-size: clamp(1rem, 3.2vw, 1.15rem);
}*/

p {
  margin: 12px 0;
  text-shadow: 1px 1px #000;
}

/* Images */
img {
  margin-top: 16px;
  max-width: 100%;
  height: auto;
  border: 4px solid var(--hi-2);
  border-radius: 15px;
  box-shadow: 0 0 15px #000;
}

.styled-image {
  border: none;
  outline: none;
  box-shadow: none;
  max-width: 100%;
  height: auto;
}

/* === Galerie responsive === */
.galerie{
  display: grid;
  grid-template-columns: 1fr 1fr;  /* mobile: 2 colonnes */
  gap: 10px;
  margin-top: 12px;
}

.galerie img{
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* ===== Loader overlay ===== */
#loader{
  position: fixed;
  inset: 0;
  background: rgba(255,140,0,.85);
  display: none; /* caché par défaut */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 24px;
}

.spinner{
  border: 8px solid #f3f3f3;
  border-top: 8px solid #ff6600;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  animation: spin 1s linear infinite;
}

#loader p{
  margin-top: 12px;
  color: white;
  font-size: clamp(1rem, 3.5vw, 1.125rem);
  font-weight: 700;
}

@keyframes spin{ to { transform: rotate(360deg); } }

/* Respect des préférences utilisateur (réduction animations) */
@media (prefers-reduced-motion: reduce){
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* === Titre principal flashy === */
.flashy-title4{
  display: block;
  width: 100%;
  font-size: clamp(2.2rem, 8vw, 4rem);
  font-weight: 900;
  text-align: center;
  letter-spacing: 2px;
  color: var(--accent);
  margin: 20px 0 10px;
  text-shadow: 2px 2px #000;
}

/* === Container titre+logo === */
.container{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* === Modal bottom sheet === */
#modal[aria-hidden="true"]{ display: none; }
#modal[aria-hidden="false"]{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: flex-end;
  z-index: 9999;
  padding-bottom: env(safe-area-inset-bottom);
}

.sheet{
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  padding: 16px;
  box-shadow: 0 -6px 20px rgba(0,0,0,.2);
  animation: rise .2s ease-out;
}

@keyframes rise{
  from { transform: translateY(30px); opacity: .9; }
  to   { transform: none; opacity: 1; }
}

.sheet h2{
  margin: 4px 0 6px;
  font-size: clamp(1.1rem, 4.2vw, 1.25rem);
  color: #111;
}

.hint{
  margin: 0 0 10px;
  color: #666;
  font-size: clamp(.9rem, 3.5vw, 1rem);
}

.row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

#cancel{
  background: #eee;
  color: var(--ink);
}

#save{
  background: var(--hi);
  color: var(--ink);
}

/* Accessibilité */
.sr-only{
  position: absolute;
  left: -9999px;
}

/* === Boutons du formulaire (layout) === */
.form-buttons{
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;  /* centre par défaut */
}

.form-buttons .left-button{
  align-self: flex-start;  /* 1er bouton à gauche */
}

.form-buttons .center-button{
  align-self: center;      /* 2e bouton centré */
}


/* ======================
   📐 Breakpoints
   ====================== */
@media (min-width: 481px){
  .galerie{ grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px){
  body { padding: 32px; }
  .galerie{ grid-template-columns: repeat(3, 1fr); }
  .row{ grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px){
  .galerie{ grid-template-columns: repeat(4, 1fr); }
}

/* Gouttières autour de la modale */
#modal[aria-hidden="false"]{
  padding: 0 16px env(safe-area-inset-bottom); /* un peu plus que 14px */
}

/* Base */
.sheet{
  width: 100%;
  max-width: 520px; /* resserré sur desktop/tablette (au lieu de 560/720) */
  margin: 0 auto;
  box-sizing: border-box;       /* IMPORTANT: padding inclus */
}

/* Mobile : plus étroit */
@media (max-width: 480px){
  .sheet{
    width: min(88vw, 400px);    /* cap visuel + marge latérale nette */
    max-width: none;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
  }
}

/* === Bandeau plein-bord (full-bleed) === */
.top-banner{
  text-align: left;
  background: linear-gradient(90deg, #FFD700, #FFB347, #FF7A00, #FF6F61, #FF4081);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);

  /* occupe toute la largeur du viewport, même si le body a du padding */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);

  /* annule le padding-top du body pour coller en haut */
  margin-top: calc(-1 * clamp(16px, 4vw, 40px));
  
}


/* Option: tenir compte des encoches (iPhone) pour éviter un léger débord */
@supports (padding: max(0px)) {
  .top-banner{
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* Le padding global de la page (ce que tu avais sur body) */
.page{
  padding: clamp(16px,4vw,40px);
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* Option : si tu veux que le bandeau dépasse à 100% de l’écran même quand .page a des paddings */
html { overflow-x: hidden; }

.top-banner {
  display: flex;
  flex-direction: column;  /* empile logo puis texte */
  align-items: flex-start; /* aligné à gauche */
  justify-content: flex-start;
  gap: 6px;                /* petit espace logo ↔ texte */
  padding: 12px 20px;      /* espace interne */
  box-sizing: border-box;

  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);

  /*background: linear-gradient(90deg,#FFD700,#FFB347,#FF7A00,#FF6F61,#FF4081);*/
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  color: #fff;
}

.top-banner .flashy-title4 {
  margin: 0;
  padding: 0;
  font-size: 0; /* masque le texte du h1, on affiche que l'image */
}

.top-banner h1 img {
  display: block;
  max-height: 120px; /* tu peux ajuster la taille du logo */
  width: auto;
}

.top-banner h3 {
  margin: 0;
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0,0,0,.35);
}

nav a.button {
  margin: 0 8px; /* marge gauche/droite */
}



/* === Bloc conditions === */
.conditions {
  text-align: left;
  /*font-size: clamp(0.65rem, 2.2vw, 0.9rem);
  font-size: 1;*/
  color: #eee;
  line-height: 1.25;
}


