/* ==========================================================================
   Maison d'Hôtes « La Demoiselle » – Aignay-le-Duc
   Feuille de style unique (remplace lademoiselle.css, de.css et contact.css)
   Reprend la charte d'origine : bordure ciel/escargot à gauche, bandeau
   blason / Demoiselle / écu encadré bleu-jaune-orange, encart pêche pointillé,
   cadre en pierre pour le diaporama, tableau des tarifs en police machine.
   ========================================================================== */

:root {
  --bleu: #3869ae;          /* trait bleu (blue.jpg) */
  --bleu-ciel: #4e7dbd;     /* bordure_suite.gif */
  --bleu-texte: #336699;    /* texte du formulaire d'origine */
  --bleu-nuit: #000066;
  --orange: #fc6230;        /* trait orange (orange.jpg) */
  --orange-pointille: #ff6633;
  --jaune: #f7cb06;         /* trait jaune (jaune.jpg) */
  --jaune-legende: #ffcc00;
  --peche: #ffcc99;
  --creme: #ffffcc;
  --rouge: #b00000;            /* contraste ≥ 4,5:1 sur blanc et sur pêche */
  --texte: #1a1a1a;
  --fond: #ffffff;
  --police: Geneva, Arial, Helvetica, sans-serif;
  --police-machine: "Courier New", Courier, monospace;
  --largeur-bordure: 175px;
}

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

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

body {
  margin: 0;
  font-family: var(--police);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--texte);
  background: var(--fond);
}

img { max-width: 100%; height: auto; border: 0; }

a { color: #0000ee; }
a:visited { color: #551a8b; }
a:hover { color: var(--orange); }

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

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.lien-evitement {
  position: absolute; left: .5rem; top: -100px; z-index: 100;
  padding: .5rem 1rem; background: var(--bleu); color: #fff; font-weight: bold;
}
.lien-evitement:focus { top: .5rem; color: #fff; }

/* ---------- Structure générale ----------
   Bureau : [bordure escargot] [bandeau + contenu]
   Mobile : bandeau / contenu / bordure (liens & logos) empilés          */
.page {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "bandeau"
    "principal"
    "bordure"
    "pied";
  min-height: 100vh;
  border-left: 15px solid var(--bleu-ciel);
}

.bandeau   { grid-area: bandeau; }
.bordure   { grid-area: bordure; }
.principal { grid-area: principal; }
.pied      { grid-area: pied; }

/* les colonnes de grille peuvent rétrécir (sinon un long mot ou le tableau élargit la page) */
.page > *, .contenu > *, .vitrine > * { min-width: 0; }

/* ---------- Pied de page ---------- */
.pied {
  padding: .75rem;
  border-top: 4px solid var(--bleu);
  font-size: .875rem;
  text-align: center;
  color: #444;
}
.pied p { margin: 0; }

/* ---------- Bandeau du haut ---------- */
.bandeau {
  position: relative;
  border-top: 4px solid var(--bleu);
  padding: 0 .75rem;
}

.bandeau__cadre {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  border-left: 4px solid var(--bleu);
  border-right: 4px solid var(--jaune);
  border-bottom: 4px solid var(--orange);
}
.bandeau__cadre img { display: block; height: auto; min-width: 0; }
.bandeau__cadre img:nth-child(1) { width: 121px; flex: 121 1 0; }
.bandeau__cadre img:nth-child(2) { width: 174px; flex: 174 1 0; }
.bandeau__cadre img:nth-child(3) { width: 68px;  flex: 68 1 0; }

.langues {
  list-style: none;
  margin: .5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1rem;
}
.langues a {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 44px;
  font-family: "Times New Roman", Times, serif; font-size: 1rem;
}
.langues img { width: 23px; height: 15px; }

/* ---------- Bordure gauche (liens, logos) ---------- */
.bordure {
  padding: 1.5rem 1rem 2rem;
  font-family: "Times New Roman", Times, serif;
  font-size: 1rem;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start;
  gap: 1.5rem 2rem;
  border-top: 4px solid var(--bleu);
}
.bordure h2 {
  margin: 0 0 .75rem; font-size: 1rem; font-weight: normal; text-align: center;
}
.bordure ul { list-style: none; margin: 0; padding: 0; }
.bordure li { margin: 0 0 .25rem; overflow-wrap: break-word; hyphens: auto; }
.bordure li a { display: inline-block; padding: .55rem 0; }

/* ---------- Contenu principal ---------- */
.principal { padding: 1rem .75rem 2rem; }

.contenu {
  display: grid;
  gap: 1.25rem;
  max-width: 451px;
  margin: 0 auto;
}

/* Encart de présentation (pêche, pointillés orange) */
.presentation {
  background: var(--peche);
  border: 3px dotted var(--orange-pointille);
  padding: 5px 8px;
  font-size: .875rem;
}
.presentation p { margin: 0 0 .75rem; }
.presentation ul { margin: 0 0 1rem; padding-left: 2.5rem; }
.presentation .ouverture { color: var(--rouge); margin: 0; }
.presentation .ouverture strong { display: block; }



/* Vitrine : table d'hôtes + diaporama + tarifs */
.vitrine { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.vitrine__titre { display: block; margin: 0 auto; }

/* --- Cadre en pierre et diaporama --- */
.diaporama { width: 100%; max-width: 451px; }

.cadre {
  position: relative;
  aspect-ratio: 451 / 349;
  background: url("images/bord_pierre.webp") center / 100% 100% no-repeat;
  touch-action: pan-y pinch-zoom;   /* le glissement horizontal est laissé au diaporama */
}
/* zone de la photo à l'intérieur du cadre : 317 × 222 px à (65, 67) */
.diaporama__photos {
  position: absolute;
  left: 14.41%; top: 19.2%; width: 70.29%; height: 63.61%;
  margin: 0; padding: 0; list-style: none;
  overflow: hidden;
}
.diapo {
  position: absolute; inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .7s ease-in-out, visibility 0s linear .7s;
}
.diapo.est-active {
  opacity: 1;
  visibility: visible;
  transition: opacity .7s ease-in-out, visibility 0s;
}
.diapo img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none;
}

/* flèches précédente / suivante, posées sur les pierres */
.diaporama__fleche {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 2.25rem; height: 2.25rem;
  display: grid; place-items: center;
  border: 2px solid #fff; border-radius: 50%;
  background: rgba(50, 35, 15, .8); color: #fff;
  font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.diaporama__fleche:hover { background: var(--orange); }
.diaporama__fleche--prec { left: 2.5%; }
.diaporama__fleche--suiv { right: 2.5%; }

.diaporama__compteur {
  position: absolute; bottom: 4.5%; left: 50%; transform: translateX(-50%);
  margin: 0; padding: 0 .5rem; border-radius: 3px;
  background: rgba(50, 35, 15, .85); color: #fff; font-size: .8125rem;
}

/* Barre sous le cadre : pictos – bouton */
.diaporama__barre {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .5rem;
  margin-top: 12px;
}
.pictos { display: flex; gap: 5px; align-self: end; }
.pictos img { display: block; width: 30px; height: 21px; }

/* Bouton « Lancer le diaporama » : reprise en CSS du bouton orange d'origine */
.bouton-diaporama {
  justify-self: center;
  min-width: 202px; min-height: 46px;
  padding: .35rem 1.25rem;
  font: bold 1.375rem/1.1 Georgia, "Times New Roman", serif;
  color: #fff;
  text-shadow: 1px 1px 0 #7a3000, 0 0 3px rgba(0, 0, 0, .5);
  background: linear-gradient(#e46a0a 0%, #d9620a 45%, #c05000 55%, #a84300 100%);  /* blanc ≥ 3,3:1 */
  border: 1px solid #9c4100;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 2px 3px 3px rgba(0, 0, 0, .35);
  cursor: pointer;
}
.bouton-diaporama:hover { color: #ffe066; }   /* jaune lisible sur l'orange (≥ 4:1) */
.bouton-diaporama:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 1px 1px 2px rgba(0,0,0,.35); }

/* --- Tarifs --- */
.tarifs { width: 100%; overflow-x: auto; }
.tarifs table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--police-machine);
  font-size: .8125rem;
}
.tarifs th, .tarifs td {
  border: 1px solid #808080;
  padding: 1px 4px;
  text-align: center;
  white-space: nowrap;
}
.tarifs thead th { font-weight: bold; white-space: normal; }
.tarifs tbody th { font-weight: normal; }

/* --- Coordonnées --- */
.coordonnees {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem; width: 100%;
}
.coordonnees address { font-style: normal; font-size: .875rem; }

/* --- Bande des labels : tous les logos regroupés, en plus petit --- */
.labels {
  max-width: 451px;
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 3px dotted var(--orange-pointille);
}
.labels ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 1rem 1.5rem;
}
.labels li, .labels a { display: block; }
.labels img { display: block; width: auto; height: 56px; }
.labels a:hover img, .labels a:focus-visible img { opacity: .8; }


/* ---------- Pages secondaires (contact, liens) ---------- */
.contenu--simple { max-width: 640px; display: block; }
.contenu--simple h2 {
  color: var(--bleu-texte); font-size: 1.05rem; margin: 1.5rem 0 .5rem;
  padding-bottom: .2rem; border-bottom: 2px dotted var(--orange-pointille);
}
.contenu--simple h1 {
  color: var(--bleu-texte); font-size: 1.25rem; margin: 0 0 1rem;
}

/* Formulaire : reprise de contact.css */
.formulaire { color: var(--bleu-texte); }
.formulaire fieldset {
  margin: 0; padding: 10px 14px 14px;
  border: 2px groove var(--orange-pointille);
}
.formulaire legend {
  font-weight: bold;
  padding: 3px 6px 5px;
  color: var(--bleu-nuit);   /* lisible sur le jaune (11,6:1) */
  border: 1px solid var(--orange-pointille);
  background: var(--jaune-legende);
}
.champ { display: grid; gap: .25rem; margin-top: 1rem; }
.champs-2 { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.formulaire label { font-weight: bold; }
.formulaire input,
.formulaire textarea {
  width: 100%;
  font: inherit; font-size: 1rem;
  color: var(--bleu-nuit);
  background: var(--creme);
  border: 1px solid var(--orange-pointille);
  padding: .35rem .5rem;
}
.formulaire input[type="number"] { max-width: 6rem; }
.formulaire input[aria-invalid="true"] { border: 2px solid var(--rouge); }
.obligatoire { color: var(--rouge); }
.aide { font-size: .875rem; color: #555; margin: .75rem 0 0; }
.erreur { color: var(--rouge); font-weight: bold; font-size: .85rem; }
.formulaire__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.boutons {
  padding: .4rem 1rem;
  font: inherit; font-weight: bold;
  color: #fff;
  background: var(--bleu-texte);
  border: 1px solid var(--orange-pointille);
  cursor: pointer;
}
.boutons:hover { background: var(--orange-pointille); }
.message-formulaire { margin: 1rem 0 0; font-weight: bold; }

.liste-liens { padding-left: 1.2rem; }
.liste-liens li { margin-bottom: 1rem; }
.badge-annuaire {
  width: 160px; padding: 4px; text-align: center;
  color: #92a4b6; background: #211e1f; border: 3px groove #615e5e;
  font: 13px Arial, sans-serif;
}
.badge-annuaire a { color: #92a4b6; }
.badge-annuaire a:first-of-type { font-size: 14px; font-weight: bold; text-decoration: none; }

/* ==========================================================================
   Écrans larges : on retrouve la composition d'origine
   ========================================================================== */
@media (min-width: 900px) {
  .page {
    max-width: 960px;
    margin: 0 auto;
    border-left: 0;
    grid-template-columns: var(--largeur-bordure) 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "bordure bandeau"
      "bordure principal"
      "bordure pied";
  }

  /* bordure ciel + escargot, prolongée par la bande bleue */
  .bordure {
    display: block;
    border-top: 0;
    padding: 106px 10px 2rem 52px;
    background:
      url("images/escarg_bdr.webp") 0 0 / 175px 395px no-repeat,
      url("images/bordure_suite.gif") 0 0 / 15px 1px repeat-y;
  }
  .bordure nav { margin-bottom: 3rem; }
  .bordure li { margin-bottom: .45rem; }
  .bordure li a { padding: .25rem 0; }
  .langues a { min-height: 0; }
  .bordure h2 { text-align: left; padding-left: 38px; }

  .bandeau { padding: 0; }
  .bandeau__cadre { margin: 0 0 0 125px; }
  .bandeau__cadre img:nth-child(n) { flex: none; }
  .langues {
    position: absolute; top: 36px; left: 515px;
    flex-direction: column; align-items: flex-start; margin: 0;
  }

  .principal { padding: 12px 0 2rem 5px; }

  .contenu {
    max-width: none; margin: 0;
    grid-template-columns: 216px 451px;
    column-gap: 25px;
    align-items: start;
  }
  .colonne-gauche { display: flex; flex-direction: column; gap: 10px; }
  .presentation { min-height: 475px; }
  .vitrine { padding-top: 0; }
  .labels { max-width: 692px; margin-left: 0; }

  .contenu--simple { display: block; max-width: 640px; padding-left: 5px; }
}

/* ---------- Préférences d'accessibilité ---------- */
@media (max-width: 380px) {
  .tarifs th, .tarifs td { padding: 1px 2px; }
  .tarifs th { white-space: normal; hyphens: auto; }
  .bouton-diaporama { min-width: 0; font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .diapo, .diapo.est-active { transition: none; }
}

@media print {
  .bordure, .diaporama__barre .bouton-diaporama, .diaporama__fleche, .lien-evitement { display: none; }
  .page { display: block; border: 0; }
}
