/* ==========================================================================
   Jumbo Travel — base.css
   Reset moderno acotado, typographie de base, éléments HTML et styles par
   défaut du contenu WordPress (alignements, légendes, citations, tableaux,
   code, accessibilité).
   Handle : jt-base. Dépend de jt-tokens (chargé avant).
   ========================================================================== */

/* ==========================================================================
   1. Reset
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--jt-blanc);
  color: var(--jt-encre);
  font-family: var(--jt-font);
  font-size: var(--jt-fs-body);
  font-weight: var(--jt-fw-body);
  line-height: var(--jt-lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Filet de sécurité : jamais de scroll horizontal.
     `clip` et non `hidden` — `hidden` casserait le header sticky. */
  overflow-x: clip;
}

h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, pre { margin: 0; }

ul, ol { margin: 0; padding-left: 1.25em; }

img, picture, video, canvas, iframe, svg { max-width: 100%; }

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

iframe, video { border: 0; }

hr {
  border: 0;
  border-top: 1px solid var(--jt-bord);
  margin: 32px 0;
}

/* ==========================================================================
   2. Typographie
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--jt-font);
  font-weight: var(--jt-fw-black);
  letter-spacing: var(--jt-ls-h);
  line-height: var(--jt-lh-h2-sm);
  color: var(--jt-encre);
  text-wrap: balance;
}

h1 { font-size: var(--jt-fs-h1-page); line-height: var(--jt-lh-h1); }
h2 { font-size: var(--jt-fs-h2);      line-height: var(--jt-lh-h2); }
h3 { font-size: var(--jt-fs-h3);      line-height: var(--jt-lh-h3); }
h4 { font-size: var(--jt-fs-h3-sm);   line-height: var(--jt-lh-tight); }
h5 { font-size: var(--jt-fs-body);    line-height: var(--jt-lh-tight); }
h6 { font-size: var(--jt-fs-body-sm); line-height: var(--jt-lh-tight); }

p { line-height: var(--jt-lh-para); }

strong, b { font-weight: var(--jt-fw-black); }

small { font-size: var(--jt-fs-legal); font-weight: var(--jt-fw-med); }

/* Contenu éditorial : rythme entre blocs (jamais appliqué aux composants) */
.entry-content > * + * { margin-top: 22px; }
.entry-content > h2 { margin-top: 48px; }
.entry-content > h3 { margin-top: 36px; }
.entry-content p { color: var(--jt-gris); }

/* ==========================================================================
   3. Liens
   ========================================================================== */

a {
  color: var(--jt-encre);
  text-decoration: none;
  transition: color var(--jt-t-fast) ease;
}

a:hover { color: var(--jt-turquoise); }

.entry-content a:not([class]) {
  color: var(--jt-turquoise);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

.entry-content a:not([class]):hover { color: var(--jt-nuit-3); }

nav a { white-space: nowrap; }

/* ==========================================================================
   4. Formulaires et boutons
   ========================================================================== */

input, select, button, textarea, optgroup {
  font-family: var(--jt-font);
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: 0; padding: 0; }

textarea { resize: vertical; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
  width: 100%;
  background: var(--jt-blanc);
  border: 1.5px solid var(--jt-bord-2);
  border-radius: var(--jt-r-md);
  padding: 13px 18px;
  font-weight: var(--jt-fw-med);
  color: var(--jt-encre);
  transition: border-color var(--jt-t-fast) ease;
}

input::placeholder,
textarea::placeholder { color: var(--jt-gris-clair); opacity: 1; }

input:hover, select:hover, textarea:hover { border-color: var(--jt-bord-3); }
input:focus, select:focus, textarea:focus { border-color: var(--jt-turquoise); }

select { cursor: pointer; }

/* ==========================================================================
   5. Accessibilité — focus, texte lecteur d'écran, lien d'évitement
   ========================================================================== */

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

:focus:not(:focus-visible) { outline: none; }

/* Sur fond sombre le turquoise reste lisible, on ajoute juste un halo */
.jt-footer :focus-visible,
.jt-topbar :focus-visible {
  outline-color: var(--jt-turquoise);
  outline-offset: 2px;
}

.screen-reader-text {
  border: 0 !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  width: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  white-space: nowrap !important;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background: var(--jt-blanc) !important;
  border-radius: var(--jt-r-sm) !important;
  box-shadow: var(--jt-shadow-float) !important;
  clip: auto !important;
  clip-path: none !important;
  color: var(--jt-encre) !important;
  display: block !important;
  font-size: var(--jt-fs-sm) !important;
  font-weight: var(--jt-fw-bold) !important;
  height: auto !important;
  left: 6px !important;
  line-height: normal !important;
  padding: 14px 22px !important;
  text-decoration: none !important;
  top: 6px !important;
  width: auto !important;
  z-index: 100000 !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100000;
  background: var(--jt-encre);
  color: var(--jt-blanc);
  font-size: var(--jt-fs-sm);
  font-weight: var(--jt-fw-bold);
  padding: 14px 22px;
  border-radius: 0 0 var(--jt-r-md) 0;
}

.skip-link:focus,
.skip-link:focus-visible {
  left: 0;
  color: var(--jt-blanc);
  outline-offset: -3px;
}

/* ==========================================================================
   6. Contenu WordPress — alignements
   ========================================================================== */

.alignleft {
  float: left;
  margin: .35em 1.6em 1.2em 0;
  max-width: 50%;
}

.alignright {
  float: right;
  margin: .35em 0 1.2em 1.6em;
  max-width: 50%;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Déborde jusqu'aux bords du conteneur (gouttière comprise) */
.alignwide {
  width: auto;
  max-width: none;
  margin-left: calc(var(--jt-gutter) * -1);
  margin-right: calc(var(--jt-gutter) * -1);
}

/* Pleine largeur de la fenêtre. `overflow-x: clip` sur body absorbe
   la largeur de la barre de défilement : aucun scroll horizontal. */
.alignfull {
  width: auto;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.alignfull > img,
.alignwide > img { width: 100%; }

@media (max-width: 767.98px) {
  .alignleft,
  .alignright {
    float: none;
    max-width: 100%;
    margin: 0 0 1.2em;
  }
  .alignwide { margin-left: 0; margin-right: 0; }
}

/* ==========================================================================
   7. Contenu WordPress — légendes, galeries, embeds
   ========================================================================== */

.wp-caption {
  max-width: 100%;
  margin-bottom: 1.4em;
}

.wp-caption img {
  border-radius: var(--jt-r-md);
  margin-bottom: 10px;
}

.wp-caption-text,
.wp-element-caption,
figcaption {
  font-size: var(--jt-fs-xxs);
  font-weight: var(--jt-fw-med);
  line-height: var(--jt-lh-para-sm);
  color: var(--jt-gris-clair);
  text-align: left;
  margin-top: 10px;
}

.wp-block-image img { border-radius: var(--jt-r-md); }

.wp-block-embed,
.wp-block-embed__wrapper { max-width: 100%; }

/* Classes exigées par le Theme Check WordPress */
.sticky      { display: block; }
.bypostauthor { display: block; }

/* ==========================================================================
   8. Contenu WordPress — citations, listes, tableaux, code
   ========================================================================== */

blockquote {
  background: var(--jt-sable);
  border-left: 3px solid var(--jt-turquoise);
  border-radius: 0 var(--jt-r-md) var(--jt-r-md) 0;
  padding: 26px 30px;
  font-size: var(--jt-fs-body-sm);
  font-weight: var(--jt-fw-body);
  line-height: var(--jt-lh-para-lg);
  color: var(--jt-encre);
}

blockquote p + p { margin-top: 14px; }

blockquote cite {
  display: block;
  margin-top: 14px;
  font-size: var(--jt-fs-xxs);
  font-weight: var(--jt-fw-bold);
  font-style: normal;
  color: var(--jt-gris-clair);
}

.entry-content ul,
.entry-content ol { color: var(--jt-gris); }

.entry-content li + li { margin-top: 8px; }

/* Les tableaux larges défilent dans leur propre boîte, jamais la page */
.wp-block-table,
.wp-block-table.is-style-stripes,
.jt-table-wrap { overflow-x: auto; max-width: 100%; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--jt-fs-xs);
}

th, td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--jt-bord);
  vertical-align: top;
}

th {
  font-weight: var(--jt-fw-bold);
  font-size: var(--jt-fs-label);
  letter-spacing: var(--jt-ls-label);
  text-transform: uppercase;
  color: var(--jt-gris-clair);
}

td { font-weight: var(--jt-fw-body); color: var(--jt-gris); }

tbody tr:last-child th,
tbody tr:last-child td { border-bottom: 0; }

caption {
  caption-side: bottom;
  padding-top: 12px;
  font-size: var(--jt-fs-xxs);
  color: var(--jt-gris-clair);
}

code, kbd, samp, pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .92em;
}

code {
  background: var(--jt-sable);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--jt-encre);
}

pre {
  background: var(--jt-sable);
  border-radius: var(--jt-r-md);
  padding: 22px 24px;
  overflow-x: auto;
  line-height: 1.5;
}

pre code { background: none; padding: 0; }

/* ==========================================================================
   9. Mouvement réduit
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
