/* ==========================================================================
   Le Chti — habillage de l'extension OpenAgenda
   D'après _passation/design/openagenda-lechti.css, avec :
   - les polices du thème (hébergées, aucun appel à Google) ;
   - les survols en bleu nuit (variable --survol, comme le reste du site) ;
   - une variante compacte pour la colonne « Ce soir à Lille » de l'accueil.
   Chargé par inc/agenda.php, après le style de l'extension.
   ========================================================================== */

:root {
  --oa-main-color: var(--accent);
  --oa-main-color-lighter: #2E3F86;
  --oa-main-color-darker: #141E4A;
}

/* ---------- Aperçu : bloc « Ce soir à Lille » (page d'accueil) ---------- */
body .oa-preview { font-family: var(--f-texte); color: #151515; }
body .oa-preview :is(.oa-event-list, .oa-event-grid) { display: block; margin: 0; padding: 0; }

/* Le cadre : un trait fin, les cartes sont collées sans double bordure */
body .oa-preview :is(.oa-event-list, .oa-event-grid) .oa-event { border: 1px solid #151515; border-radius: 0; background: #fff; box-shadow: none; margin: 0; }
body .oa-preview :is(.oa-event-list, .oa-event-grid) .oa-event + .oa-event { border-top: 0; }
body .oa-preview :is(.oa-event-list, .oa-event-grid) .oa-event:hover { background: #FBFAF7; }

/* Texte à gauche, image entière à droite */
body .oa-preview :is(.oa-event-list, .oa-event-grid) a.oa-event-wrapper { display: grid; grid-template-columns: 1fr 260px; gap: 0; align-items: center; height: auto; padding: 0; color: inherit; text-decoration: none; background: none; box-shadow: none; border: 0; }
body .oa-preview :is(.oa-event-list, .oa-event-grid) .oa-event-details { order: 1; display: grid; grid-template-columns: 140px 1fr; column-gap: 24px; align-content: center; padding: 28px; }
body .oa-preview :is(.oa-event-list, .oa-event-grid) .oa-event-thumbnail { order: 2; height: auto; padding: 20px 20px 20px 0; }
body .oa-preview :is(.oa-event-list, .oa-event-grid) .oa-event-thumbnail img { display: block; width: 100%; height: auto; max-height: 240px; object-fit: contain; object-position: center; border-radius: 0; }

body .oa-preview .oa-event-range { grid-column: 1; grid-row: 1 / span 2; margin: 0; font: 800 24px/1.05 var(--f-titre); text-transform: uppercase; }
body .oa-preview .oa-event-range strong { font-weight: inherit; }
body .oa-preview .oa-event-title { grid-column: 2; margin: 0; font: 600 24px/1.15 var(--f-serif); letter-spacing: -.01em; color: #151515; }
body .oa-preview .oa-event-description { display: none; }
body .oa-preview .oa-event-location-label { grid-column: 2; margin: 6px 0 0; color: #5A5750; font-size: 15px; }
body .oa-preview a.oa-event-wrapper:hover .oa-event-title { color: var(--survol); }

/* ---------- Page agenda (liste complète) ---------- */
body.single-oa-calendar { font-family: var(--f-texte); }
body.single-oa-calendar :is(.oa-event-list, .oa-event-grid) .oa-event { border: 1px solid #151515; border-radius: 0; background: #fff; box-shadow: none; }
body.single-oa-calendar .oa-event-list a.oa-event-wrapper { display: grid; grid-template-columns: 1fr 260px; gap: 0; align-items: center; height: auto; padding: 0; color: inherit; text-decoration: none; background: none; box-shadow: none; border: 0; }
body.single-oa-calendar .oa-event-list .oa-event-details { order: 1; padding: 28px; }
body.single-oa-calendar .oa-event-list .oa-event-thumbnail { order: 2; height: auto; padding: 20px 20px 20px 0; }
body.single-oa-calendar .oa-event-list .oa-event-thumbnail img { display: block; width: 100%; height: auto; max-height: 240px; object-fit: contain; object-position: center; border-radius: 0; }
body.single-oa-calendar .oa-event-range { margin: 0 0 6px; font: 800 24px/1.05 var(--f-titre); text-transform: uppercase; }
body.single-oa-calendar .oa-event-range strong { font-weight: inherit; }
body.single-oa-calendar .oa-event-title { margin: 0 0 8px; font: 600 26px/1.15 var(--f-serif); letter-spacing: -.01em; color: #151515; }
body.single-oa-calendar .oa-event-description { margin: 0 0 8px; color: #5A5750; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body.single-oa-calendar .oa-event-location-label { margin: 0; color: #5A5750; font-size: 15px; }
body.single-oa-calendar a.oa-event-wrapper:hover .oa-event-title { color: var(--survol); }
body .oa-month-header { font: 800 40px/1 var(--f-titre); text-transform: uppercase; }

/* ---------- Boutons, champs, étiquettes ---------- */
body .oa-button,
body .oa-pagination a { border-radius: 0; background: #151515; color: #F4F2EE; border: 2px solid #151515; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; font-size: 13px; }
body .oa-button:hover,
body .oa-pagination a:hover { background: var(--survol); border-color: var(--survol); color: #fff; }
body .oa-search-widget input[type=search],
body .oa-search-widget input[type=text] { border: 2px solid #151515; border-radius: 0; background: #fff; min-height: 48px; padding: 0 16px; font-size: 17px; }
body .oa-event-status-badge { border-radius: 0; background: #151515; color: #F4F2EE; font-weight: 600; }
body .oa-event-featured-badge { border-radius: 0; background: var(--accent); color: #fff; }

/* ---------- Téléphone : l'image passe au-dessus du texte ---------- */
@media (max-width: 700px) {
  body .oa-preview :is(.oa-event-list, .oa-event-grid) a.oa-event-wrapper,
  body.single-oa-calendar .oa-event-list a.oa-event-wrapper { grid-template-columns: 1fr; }
  body .oa-preview :is(.oa-event-list, .oa-event-grid) .oa-event-thumbnail,
  body.single-oa-calendar .oa-event-list .oa-event-thumbnail { order: -1; padding: 16px 16px 0; }
  body .oa-preview :is(.oa-event-list, .oa-event-grid) .oa-event-thumbnail img,
  body.single-oa-calendar .oa-event-list .oa-event-thumbnail img { max-height: 220px; }
  body .oa-preview :is(.oa-event-list, .oa-event-grid) .oa-event-details { grid-template-columns: 1fr; padding: 16px; }
  body .oa-preview .oa-event-range,
  body .oa-preview .oa-event-title,
  body .oa-preview .oa-event-location-label { grid-column: 1; grid-row: auto; }
  body .oa-preview .oa-event-range { margin-bottom: 6px; }
}

/* ---------- Accueil : colonne « Ce soir à Lille » ----------
   La colonne est étroite (moitié de page) : sans image, date à gauche, titre et lieu à droite.
   Quand la colonne s'élargit (tablette), on retrouve la carte avec image à droite. */
.lechti-ce-soir .oa-preview { container-type: inline-size; }
.lechti-ce-soir .oa-preview { margin-bottom: 0; }
.lechti-ce-soir .lechti-ag__pied { margin-top: 24px; }
@container (max-width: 640px) {
  body .lechti-ce-soir .oa-preview :is(.oa-event-list, .oa-event-grid) a.oa-event-wrapper { grid-template-columns: 1fr; }
  body .lechti-ce-soir .oa-preview :is(.oa-event-list, .oa-event-grid) .oa-event-thumbnail { display: none; }
  body .lechti-ce-soir .oa-preview :is(.oa-event-list, .oa-event-grid) .oa-event-details { grid-template-columns: 112px 1fr; column-gap: 20px; padding: 20px; }
  body .lechti-ce-soir .oa-preview .oa-event-range { font-size: 22px; }
  body .lechti-ce-soir .oa-preview .oa-event-title { font-size: 21px; }
}
@container (max-width: 380px) {
  body .lechti-ce-soir .oa-preview :is(.oa-event-list, .oa-event-grid) .oa-event-details { grid-template-columns: 1fr; padding: 16px; }
  body .lechti-ce-soir .oa-preview .oa-event-range,
  body .lechti-ce-soir .oa-preview .oa-event-title,
  body .lechti-ce-soir .oa-preview .oa-event-location-label { grid-column: 1; grid-row: auto; }
  body .lechti-ce-soir .oa-preview .oa-event-range { margin-bottom: 6px; }
}
.lechti-ce-soir__vide { margin: 0 0 24px; }

/* Titres très longs : jamais de débordement sur l'image ou hors de la carte. Trois lignes au plus, puis « … ». */
body :is(.oa-preview, .single-oa-calendar) :is(.oa-event-wrapper, .oa-event-details, .oa-event-title, .oa-event-location-label) { min-width: 0; }
body :is(.oa-preview, .single-oa-calendar) .oa-event-title { overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
body :is(.oa-preview, .single-oa-calendar) .oa-event-location-label { overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
