/* Ajouts propres à WordPress (la maquette reste dans ooray.css). */

/* Coupures de lignes : un mot long passe à la ligne au lieu d'être coupé en plein milieu ;
   il n'est cassé que s'il est plus large que la ligne entière. Jamais de césure automatique. */
body {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  -webkit-hyphens: none;
  line-break: strict;
}
h1, h2, h3, h4, .lead { text-wrap: balance; }
p, li, dd, blockquote { text-wrap: pretty; }

/* Blocs d'article (éditeur WordPress) : les styles de bloc reprennent les classes de la maquette. */
.prose p.is-style-callout { background: var(--mint-100); border-left: 4px solid var(--green); padding: 1.1rem 1.5rem; border-radius: 0 var(--radius) var(--radius) 0; font-family: var(--font-serif); font-size: 1.5rem; line-height: 1.3; color: var(--ink); }
.prose p.is-style-strong-p { font-weight: 700; color: var(--ink); font-size: 1.2rem; }
.prose ul.is-style-dot li::before { background: var(--green); width: .55rem; height: .55rem; top: .75em; left: .3rem; }
.prose ul.is-style-arrow li::before { background: none; content: "→"; width: auto; height: auto; color: var(--green-700); font-weight: 700; top: 0; left: 0; }
.prose figure { margin: 0; }

/* Formulaire de contact. */
.form-note.is-error { background: #fbe4e4; color: #7a1414; }
.ooray-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Cartes d'actualité : image entière au lieu de recadrée. */
.card-news .cover.is-contain { background: var(--mint-100); }
.card-news .cover.is-contain img { object-fit: contain; }

/* Formulaire : validation en direct, menu déroulant, bouton grisé. */
.field-error { margin: .4rem 0 0; font-size: .9rem; font-weight: 600; color: #9b1c1c; }
.field-error[hidden] { display: none; }
.form-control.is-invalid { border-color: #c0392b; box-shadow: 0 0 0 3px rgba(192,57,43,.15); }
.form-control.is-valid { border-color: var(--green); }
select.form-select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F172A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; background-size: 1.1rem;
}
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; filter: grayscale(.4); }
[data-field][hidden] { display: none; }

/* Ancres : le haut de la section ciblée se place juste sous le header collant (hauteur mesurée par assets/js/layout.js).
   Une seule source de décalage : on neutralise le scroll-margin de la maquette. */
html { scroll-padding-top: var(--header-h, 4.25rem); }
[data-anchor] { scroll-margin-top: 0; }

/* Articles : titres, images, galeries et vidéos au fil du texte. */
.prose h2 { font-size: clamp(1.6rem, 2.6vw, 2rem); line-height: 1.15; margin-top: 2.5rem; }
.prose h2 + * { margin-top: .9rem; }
.prose .wp-block-image, .prose .wp-block-embed, .prose .wp-block-gallery { margin: 2rem 0; }
.prose .wp-block-image img, .prose .wp-block-gallery img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.prose figcaption, .prose .wp-element-caption { margin-top: .6rem; font-size: .92rem; line-height: 1.4; color: var(--muted); text-align: left; }
.prose .wp-block-gallery { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.prose .wp-block-gallery .wp-block-image { margin: 0; }
.prose .wp-block-gallery .wp-block-image img { aspect-ratio: 4 / 3; object-fit: cover; }
.prose .wp-block-embed__wrapper { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--ink); }
.prose .wp-embed-aspect-9-16 .wp-block-embed__wrapper { aspect-ratio: 9 / 16; max-width: 22rem; margin-inline: auto; }
.prose .wp-block-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Image cliquable : loupe discrète. */
a.ooray-zoom { position: relative; display: block; cursor: zoom-in; border-radius: var(--radius); }
a.ooray-zoom::after {
  content: ""; position: absolute; right: .75rem; bottom: .75rem; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: rgba(15, 23, 42, .72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5M11 8.5v5M8.5 11h5'/%3E%3C/svg%3E") center / 60% no-repeat;
  opacity: 0; transition: opacity .2s;
}
a.ooray-zoom:hover::after, a.ooray-zoom:focus-visible::after { opacity: 1; }
@media (hover: none) { a.ooray-zoom::after { opacity: 1; } }

/* Fenêtre d'agrandissement des images : compteur en haut, image, légende, bande d'aperçus en bas. */
.ooray-lightbox { border: 0; padding: 0; width: 100%; height: 100%; max-width: 100vw; max-height: 100vh; background: transparent; color: #fff; }
.ooray-lightbox::backdrop { background: rgba(15, 23, 42, .94); }
.ooray-lightbox[open] { display: grid; grid-template-rows: 1fr auto; }
.ooray-lightbox figure { margin: 0; display: grid; justify-items: center; align-content: center; gap: .75rem; pointer-events: none; padding: 4rem 4.5rem 1rem; min-height: 0; }
.ooray-lightbox figure img { pointer-events: auto; max-width: min(92vw, 1500px); max-height: calc(100vh - 14.5rem); width: auto; height: auto; object-fit: contain; border-radius: 12px; background: #fff; }
.ooray-lightbox figcaption { pointer-events: auto; max-width: 60rem; text-align: center; font-size: .98rem; color: #E5ECF3; }
.ooray-lightbox .lb-count { position: fixed; top: 1.35rem; left: 50%; transform: translateX(-50%); margin: 0; padding: .3rem .9rem; border-radius: 999px; background: rgba(255, 255, 255, .14); font-weight: 600; font-size: .95rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.ooray-lightbox .lb-count[hidden] { display: none; }
.ooray-lightbox > button { position: fixed; border: 0; border-radius: 50%; width: 3rem; height: 3rem; background: rgba(255, 255, 255, .16); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; display: grid; place-items: center; z-index: 2; }
.ooray-lightbox > button:hover, .ooray-lightbox > button:focus-visible { background: rgba(255, 255, 255, .32); }
.ooray-lightbox > button[hidden] { display: none; }
.ooray-lightbox .lb-close { top: 1rem; right: 1rem; }
.ooray-lightbox .lb-prev { left: 1rem; top: calc(50% - 4rem); }
.ooray-lightbox .lb-next { right: 1rem; top: calc(50% - 4rem); }
.ooray-lightbox .lb-strip { overflow-x: auto; overflow-y: hidden; padding: .5rem 0 1.1rem; scrollbar-width: none; }
.ooray-lightbox .lb-strip::-webkit-scrollbar { display: none; }
.ooray-lightbox .lb-strip[hidden] { display: none; }
.ooray-lightbox .lb-track { display: flex; gap: .6rem; width: max-content; padding-inline: calc(50vw - 3.5rem); }
.ooray-lightbox .lb-thumb { flex: none; width: 7rem; height: 4.75rem; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #0F172A; cursor: pointer; opacity: .5; transition: opacity .2s, border-color .2s, transform .2s; }
.ooray-lightbox .lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ooray-lightbox .lb-thumb:hover { opacity: .85; }
.ooray-lightbox .lb-thumb.is-current { opacity: 1; border-color: #fff; transform: scale(1.06); }
@media (max-width: 575.98px) {
  .ooray-lightbox figure { padding: 4rem .5rem .5rem; }
  .ooray-lightbox figure img { max-height: calc(100vh - 13rem); }
  .ooray-lightbox > .lb-prev, .ooray-lightbox > .lb-next { width: 2.5rem; height: 2.5rem; font-size: 1.6rem; top: calc(50% - 3.5rem); }
  .ooray-lightbox .lb-thumb { width: 5.25rem; height: 3.6rem; }
  .ooray-lightbox .lb-track { padding-inline: calc(50vw - 2.6rem); }
}
html:has(.ooray-lightbox[open]) { overflow: hidden; }

/* Article : les textes gardent une largeur de lecture, les médias (images, galeries, vidéos) prennent toute la colonne. */
.prose-wide { max-width: none; }
.prose-wide > p, .prose-wide > ul, .prose-wide > ol, .prose-wide > h2, .prose-wide > blockquote { max-width: 40rem; }

/* Badge « +n » des cartes : au-dessus du lien étendu de la carte. */
.tag-more[hidden] { display: none; }
.tag-more { position: relative; z-index: 2; border: 0; cursor: pointer; font: inherit; }
.tag-more:hover, .tag-more:focus-visible { filter: brightness(.92); }
.tags-extra { display: contents; }
.tags-extra[hidden] { display: none; }

/* Vidéo avec notre image : YouTube ne se charge qu'au clic. */
.ooray-video-poster { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; background: var(--ink); display: block; }
.ooray-video-poster img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; }
.ooray-video-poster .play-btn { position: absolute; left: 50%; top: 50%; width: 4.5rem; height: 4.5rem; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(15,23,42,.78); display: grid; place-items: center; transition: transform .2s, background .2s; }
.ooray-video-poster .play-btn svg { width: 1.8rem; height: 1.8rem; fill: #fff; margin-left: .2rem; }
.ooray-video-poster:hover .play-btn, .ooray-video-poster:focus-visible .play-btn { background: var(--green-700); transform: translate(-50%, -50%) scale(1.08); }


/* Galeries : une photo par ligne, pleine largeur de colonne (la règle de largeur du noyau WordPress est plus spécifique, d'où l'identifiant factice). */
.prose .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { width: 100%; max-width: 100%; margin: 0; flex: none; }
.tags-extra:focus { outline: none; }

.prose .wp-embed-aspect-9-16 .ooray-video-poster img { object-fit: contain; }
