/* Page d'accueil : grande image, raccourcis, publications à l'honneur, grille des événements. */

/* La barre supérieure passe sous la grande image : le logo et la photo occupent tout le haut de l'écran. */
body.page-home .cerm-topbar { position: absolute; top: 0; left: 0; right: 0; background: transparent; z-index: 5; }
body.page-home .cerm-main { padding-top: 0; }

.cerm-hero {
  position: relative; z-index: 1;
  min-height: 1008px;
  padding: 330px 0 140px;
  background: #4a6f93 center top / cover no-repeat fixed;
}
.cerm-hero__title {
  margin: 0 0 50px; padding-left: clamp(16px, 5vw, 80px); max-width: 780px;
  color: #fff; font: 500 40px/80px var(--cerm-font-title); text-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.cerm-hero__subtitle {
  margin: -40px 0 40px; padding-left: clamp(16px, 5vw, 80px);
  color: #f7f7f7; font: 700 24px/1.2 var(--cerm-font); text-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}

/* Raccourcis (bandeau bleu sous l'image) */
.cerm-shortcuts { background: var(--cerm-primary); color: var(--cerm-light); padding: 14px 10px 6px; text-align: center; }
.cerm-shortcuts__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 5%; list-style: none; margin: 0 auto; padding: 0; max-width: 1400px; }
.cerm-shortcuts__list li { width: 90px; }
.cerm-shortcuts__list a { display: block; color: var(--cerm-light); text-decoration: none; }
.cerm-shortcuts__list a:hover { color: #fff; }
.cerm-shortcuts__list i { display: block; font-size: 39px; line-height: 1; margin-bottom: 4px; }
.cerm-shortcuts__list span { display: block; font-size: 10px; font-weight: 600; line-height: 14px; }
.cerm-shortcuts__exchange { margin: 16px 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .5px; color: #fff; }
.cerm-shortcuts__exchange a { color: #fff; text-decoration: underline; }

/* Mission de l'association */
.cerm-mission { background: #fff; padding: 20px 10% 20px 15%; }
.cerm-mission h2 { margin: 0 0 12px; text-align: justify; font: 400 24px/1.2 Helvetica, Arial, sans-serif; color: #999; }

/* Deux colonnes : publications à l'honneur + événements */
.cerm-home-cols { display: grid; grid-template-columns: 1fr; background: #fff; }
.cerm-home-side { background: var(--cerm-primary); padding: 10px 10px 18px; text-align: center; }
.cerm-home-side__title { margin: 10px 0 14px; color: #fff; font: 500 18px/36px var(--cerm-font-title); text-align: left; padding-left: 5%; }
.cerm-home-side__item { display: block; margin: 0 auto 14px; max-width: 200px; background: #fff; padding: 0; line-height: 0; }
.cerm-home-side__item img { width: 100%; height: auto; display: block; }
.cerm-home-side__more { margin: 12px 0 0; }
.cerm-home-events { padding: 20px 8px 30px; background: #fff; margin: 0 3px 3px; }

.cerm-events-year {
  display: flex; align-items: center; justify-content: center; padding: 10px 20px; margin: 30px 0 20px;
  background: rgba(0, 0, 0, .03); font: 700 22px/1.2 var(--cerm-font); text-align: center; color: var(--cerm-primary);
}
.cerm-events-year:first-child { margin-top: 0; }
.cerm-events-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px 2%; margin: 0 0 1rem; width: 100%; }
.cerm-event-card { position: relative; display: flex; flex-direction: column; background: rgba(0, 0, 0, .03); min-width: 0; }
.cerm-event-card__image { display: block; text-align: center; line-height: 0; background: #eceff4; }
.cerm-event-card__image img { width: 100%; height: auto; display: block; aspect-ratio: 3 / 4; object-fit: cover; }
.cerm-event-card__noimg { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 4; font-size: 48px; color: #b9bfd6; }
.cerm-event-card__body { padding: 10px; }
.cerm-event-card__body > * { margin: 10px 0 0; }
.cerm-event-card__body > *:first-child { margin-top: 0; }
.cerm-event-card__title { font-size: 21px; font-weight: 700; line-height: 24px; color: var(--cerm-link); }
.cerm-event-card__title a { text-decoration: none; }
.cerm-event-card__title a:hover { text-decoration: underline; }
.cerm-event-card__date, .cerm-event-card__place { font-size: .95em; line-height: 24px; }
.cerm-event-card__tip {
  position: absolute; bottom: 100%; left: 50%; z-index: 20; width: 90%; max-width: 320px; margin-bottom: 12px; padding: 10px 14px;
  background: rgba(20, 33, 61, .93); color: #fff; font-size: .85em; line-height: 1.4; text-align: left; border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25); opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate(-50%, 6px); transition: opacity .2s ease, transform .2s ease;
}
.cerm-event-card__tip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: rgba(20, 33, 61, .93); }
.cerm-event-card:hover .cerm-event-card__tip, .cerm-event-card:focus-within .cerm-event-card__tip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

@media (min-width: 1200px) {
  .cerm-home-cols { grid-template-columns: 16.66% 1fr; align-items: stretch; }
  .cerm-home-side { padding: 10px 12px 18px; }
}
@media (max-width: 1199.98px) {
  .cerm-events-grid { grid-template-columns: repeat(3, 1fr); }
  .cerm-home-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 220px)); justify-content: center; gap: 14px; align-items: start; }
  .cerm-home-side__title, .cerm-home-side__more { grid-column: 1 / -1; }
  .cerm-home-side__title { text-align: center; padding-left: 0; }
  .cerm-home-side__item { margin: 0; }
}
@media (max-width: 991.98px) {
  .cerm-hero { min-height: 760px; padding-top: 250px; background-attachment: scroll; }
  .cerm-hero__title { font-size: 34px; line-height: 64px; }
  .cerm-mission { padding: 18px 6%; }
  .cerm-mission h2 { font-size: 20px; }
}
@media (max-width: 900px) { .cerm-events-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) {
  .cerm-hero { min-height: 560px; padding: 200px 0 80px; }
  .cerm-hero__title { font-size: 26px; line-height: 48px; margin-bottom: 36px; }
  .cerm-hero__subtitle { font-size: 20px; margin: -26px 0 20px; }
  .cerm-shortcuts__list { gap: 10px 4%; }
  .cerm-shortcuts__list li { width: 76px; }
  .cerm-shortcuts__list i { font-size: 30px; }
  .cerm-shortcuts__list span { font-size: 9px; }
  .cerm-events-grid { grid-template-columns: 1fr; }
  .cerm-event-card__image img { aspect-ratio: auto; max-height: 520px; object-fit: contain; }
  .cerm-home-side { display: none; }
  .cerm-mission h2 { font-size: 17px; text-align: left; }
}
