/* Art équestre : galeries réservées aux membres des Écuries de Rouvre, dans la charte du site (fond sombre).
   Liste des galeries et photos chiffrées, déchiffrées dans le navigateur après le mot de passe. */

/* Ambiance claire des galeries clients (≠ galeries d'art sur fond noir), couleurs du logo :
   bleu du cercle, ardoise et terre cuite des continents, sur un papier ivoire. */
html.eq-light {
  --bg: #f5f2ec;        /* papier ivoire */
  --panel: #fcfbf8;
  --panel-2: #ece7de;
  --fg: #1d2a33;        /* ardoise des continents */
  --muted: #66717a;
  --line: #dcd5ca;
  --blue: #1e6fa6;      /* bleu du cercle du logo */
  --copper: #c4643a;    /* terre cuite des continents */
  --ochre: #c4643a;
  --scrim: 245 242 236;
  color-scheme: light;
}
html.eq-light main::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, #1e6fa6, #4fa3d6 38%, #e39a4f 70%, #c4643a); }
html.eq-light .eq-gate input { background: #fff; }
html.eq-light .eq-gate .eq-err { color: #b3261e; }
html.eq-light .lede { color: #3b4a54; }
html.eq-light #screen3d { border-color: var(--line); }
html.eq-light .room-msg { background: rgb(255 255 255 / 0.9); }
html.eq-light .g-pop::backdrop { background: rgb(29 42 51 / 0.35); }
html.eq-light .g-pop { box-shadow: 0 24px 60px rgb(29 42 51 / 0.18); }


/* Accès protégé */
.eq-gate { display: grid; justify-items: center; gap: 14px; width: min(100%, 420px); margin: clamp(8px, 2vw, 20px) auto 0; text-align: center; }
.eq-gate form { display: flex; width: 100%; gap: 8px; }
.eq-gate input { flex: 1; min-width: 0; font: inherit; font-size: 1rem; padding: 13px 14px; border: 1px solid var(--line); border-radius: 0; background: var(--panel); color: var(--fg); }
.eq-gate input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.eq-gate .btn { padding: 13px 20px; cursor: pointer; }
.eq-gate .eq-err { color: #ff8a80; margin: 0; font-size: 0.9375rem; }
.eq-gate .label { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.eq-gate .label svg { width: 14px; height: 14px; flex: none; }
.eq-club { margin: 0; }
.eq-club .btn { padding: 12px 18px; }
.eq-auto [data-locked] { visibility: hidden; }
.eq-remove { max-width: 62ch; margin: clamp(36px, 5vw, 64px) auto 0; color: var(--muted); font-size: 0.9375rem; line-height: 1.6; text-align: center; border-top: 1px solid var(--line); padding-top: 20px; }
.eq-remove a { color: var(--fg); }
[hidden] { display: none !important; }

/* Liste des galeries */
.eq-cards { margin-top: clamp(8px, 2vw, 24px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 380px)); justify-content: center; }
.eq-card .dep-cover { aspect-ratio: 4 / 5; }
.eq-logo { display: block; line-height: 0; transition: opacity .2s ease; }
.eq-logo:hover { opacity: .85; }
.eq-logo img { width: clamp(160px, 22vw, 220px); height: auto; }
.eq-card .dep-cover img { opacity: 0; transition: opacity .4s ease, transform .7s cubic-bezier(.2,.6,.2,1); }
.eq-card .dep-cover img.is-in { opacity: 1; }

/* Galerie */
.g-bar { position: sticky; top: 0; z-index: 3; background: rgb(var(--scrim, 11 11 12) / 0.92); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.g-bar .wrap { display: flex; gap: 6px clamp(14px, 3vw, 36px); flex-wrap: wrap; justify-content: center; align-items: center; min-height: 54px; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
/* onglets des parties : la partie affichée à l'écran est soulignée */
.g-bar a { text-decoration: none; color: var(--muted); padding: 8px 2px; border-bottom: 2px solid transparent; transition: color .2s ease, border-color .2s ease; }
.g-bar a:hover { color: var(--fg); }
.g-bar a[aria-current="true"] { color: var(--fg); border-bottom-color: var(--blue); }
.g-bar .g-count { display: none; }
.g-section { padding: clamp(36px, 5vw, 64px) 0 0; scroll-margin-top: 64px; }
/* titre de partie entre deux traits, comme les rubriques de l'Art équestre */
.g-section h2 { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); text-align: center; margin: 0 0 clamp(20px, 2.8vw, 36px); }
.g-section h2::before, .g-section h2::after { content: ""; flex: 1 1 24px; min-width: 24px; height: 1px; background: var(--fg); opacity: 0.35; }
.g-grid { columns: 3 300px; column-gap: clamp(10px, 1.4vw, 18px); }
.g-grid button { display: block; width: 100%; margin: 0 0 clamp(10px, 1.4vw, 18px); padding: 0; border: 0; background: var(--panel); cursor: zoom-in; break-inside: avoid; }
.g-grid img { display: block; width: 100%; height: auto; opacity: 0; transition: opacity .4s ease; }
.g-grid img.is-in { opacity: 1; }
.g-grid button:hover img.is-in { opacity: .86; }
.g-note { text-align: center; color: var(--muted); font-size: 0.9375rem; line-height: 1.6; max-width: 70ch; margin: clamp(36px, 5vw, 64px) auto 0; }
.g-note a { color: var(--fg); }

/* Visionneuse (comme les autres galeries du site) */
.g-lb { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(var(--scrim, 11 11 12) / 0.98); color: var(--fg); }
.g-lb::backdrop { background: rgb(var(--scrim, 11 11 12) / 0.9); }
.g-lb[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.g-lb-top, .g-lb-bot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; }
.g-lb-bot { flex-direction: column; justify-content: center; gap: 12px; padding-bottom: 18px; }
.g-lb-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.g-lb-actions .btn { padding: 13px 18px; cursor: pointer; }
/* Fenêtre « Photo offerte » (crédit Instagram) */
.g-pop { width: min(calc(100vw - 32px), 440px); margin: auto; padding: 36px 28px 28px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); text-align: center; }
.g-pop::backdrop { background: rgb(0 0 0 / 0.65); }
.g-pop[open] { display: grid; justify-items: center; gap: 14px; }
.g-pop h2 { margin: 0; font-size: 1.375rem; }
.g-pop p { margin: 0; color: var(--muted); line-height: 1.6; }
.g-pop .g-pop-ask { color: var(--fg); }
.g-pop .g-pop-ask a { color: var(--blue); font-weight: 500; }
.g-pop .btn { margin-top: 6px; padding: 13px 20px; }
.g-pop button.g-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; background: none; color: var(--muted); border: 1px solid var(--line); font-size: 1.5rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.g-pop button.g-x:hover { color: var(--fg); border-color: var(--fg); }
.g-back { margin: 0 0 -8px; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.g-back a { color: var(--muted); text-decoration: none; }
.g-back a:hover { color: var(--fg); }
#tirage { scroll-margin-top: 16px; margin-top: clamp(40px, 6vw, 80px); }
.g-lb-count { font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.12em; color: var(--muted); }
.g-lb-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; padding: 0 72px; }
.g-lb-stage img { display: block; max-width: 100%; max-height: calc(100dvh - 190px); width: auto; height: auto; object-fit: contain; }
.g-lb button.g-x, .g-lb button.g-nav { background: rgb(var(--scrim, 11 11 12) / 0.7); color: var(--fg); border: 1px solid var(--line); width: 48px; height: 48px; font-size: 1.75rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.g-lb button.g-x:hover, .g-lb button.g-nav:hover { border-color: var(--fg); }
.g-lb button.g-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.g-lb .g-prev { left: 12px; } .g-lb .g-next { right: 12px; }
.g-lb .g-wait { position: absolute; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.g-lb .btn svg { width: 14px; height: 14px; }
@media (max-width: 640px) { .g-lb-stage { padding: 0 8px; } .g-lb-actions .btn { flex: 1 1 100%; } .g-lb-stage img { max-height: calc(100dvh - 300px); } .g-lb button.g-nav { display: none; } .g-grid { columns: 2 140px; } }
/* Nom du concours sur une seule ligne dans la liste */
.eq-card .dep-title { font-size: clamp(1.05rem, 0.9rem + 0.45vw, 1.3rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Rubriques de la page Art équestre */
.eq-sec { margin-top: clamp(40px, 6vw, 72px); }
.eq-sec + .eq-sec { margin-top: clamp(56px, 8vw, 96px); }
.eq-sec-h { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); text-align: center; margin: 0 0 clamp(24px, 3vw, 40px); }
.eq-sec-h::before, .eq-sec-h::after { content: ""; flex: 1 1 24px; min-width: 24px; height: 1px; background: var(--fg); opacity: 0.35; }
.eq-sec .eq-cards { margin-top: 0; }
.eq-empty { text-align: center; color: var(--muted); margin: 0; }
/* Événements : couverture façon Pic-Time, cartes privées, lien HD */
.ev-hero { margin: 0 0 clamp(24px, 4vw, 48px); background: var(--panel-2); aspect-ratio: 16 / 9; overflow: hidden; }
.ev-hero img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.ev-hero img.is-in { opacity: 1; }
.ev-cover { display: grid; place-items: center; background: linear-gradient(145deg, #e9edf0 0%, #f3ece4 55%, #f0e2d6 100%); }
.ev-lock { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ev-lock svg { width: 14px; height: 14px; }
.ev-hd { margin: 0; }
@media (max-width: 640px) {
  /* onglets sur une seule ligne, qu'on fait défiler du doigt */
  .g-bar .wrap { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .g-bar .wrap::-webkit-scrollbar { display: none; }
  .g-bar a { white-space: nowrap; flex: none; }
}
/* Galerie mise en avant (la plus récente) en tête de rubrique */
.eq-feature { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; gap: clamp(20px, 3.4vw, 48px); text-decoration: none; color: inherit; margin: 0 0 clamp(36px, 5vw, 64px); }
.eq-feature:not(.is-wide) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); max-width: 980px; margin-inline: auto; }
.eq-feature-cover { display: block; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); aspect-ratio: 3 / 2; }
.eq-feature:not(.is-wide) .eq-feature-cover { aspect-ratio: 4 / 5; }
.eq-feature-cover img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .5s ease, transform .9s cubic-bezier(.2,.6,.2,1); }
.eq-feature-cover img.is-in { opacity: 1; }
.eq-feature:hover .eq-feature-cover img { transform: scale(1.02); }
.eq-feature-body { display: grid; gap: 14px; justify-items: start; }
.eq-feature-title { margin: 0; font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.6rem); line-height: 1.05; }
.eq-feature .btn { margin-top: 6px; }
.eq-feature:hover .btn { background: var(--blue); border-color: var(--blue); }
@media (max-width: 760px) { .eq-feature, .eq-feature:not(.is-wide) { grid-template-columns: 1fr; } }
