/*====================================
  1) RESET & VARIABLES
====================================*/
:root {
  --header-height: 5rem;
  --max-width:    1100px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Raleway', sans-serif;
  background: #f9f9f9;
  color: #333;
  overflow-x: hidden;
  scroll-padding-top: var(--header-height);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.main-top-offset {
  padding-top: calc(var(--header-height) + 5rem);
}


/*====================================
  2) HEADER, NAV & SUBMENU
====================================*/
/* fixed header */
.header-ocm {
  position: fixed;
  inset: 0 0 auto;
  background: none;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

/* header inner */
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 2rem;
  background: #1e3d59;
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  position: relative;
}

/* logo & title */
.logo-link { display: flex; align-items: center; }
.logo-img  { height: 50px; width: auto; }
.header-right {
  flex: 1;
  text-align: center;
}
.header-right h1 {
  font-size: 1.5em;
  font-weight: 400;
  margin-top: .4em;
}
.header-right h1 span {
  display: block;
  font-size: .85em;
  font-weight: 300;
}

/* desktop nav */
.main-nav { flex-basis: 100%; }
.main-nav > ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  list-style: none;
  margin-top: 1rem;
  padding: 0;
}
.main-nav > ul > li { position: relative; }
.main-nav a {
  display: block;
  padding: .5rem 1rem;
  color: #fff;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.main-nav a:hover {
  background: rgba(255,255,255,.1);
}

/* desktop submenu */
.sous-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #1e3d59;
  border-radius: 5px;
  min-width: 200px;
  box-shadow: 0 4px 10px rgba(0,0,0,.1);
  z-index: 1001;
  margin: 0; padding: 0;
}

/* bullet colors */
.sous-menu li.exposition    { --bullet-color: #4b7cde; }
.sous-menu li.conference    { --bullet-color: #8a60a4; }
.sous-menu li.atelier       { --bullet-color: #d17e46; }
.sous-menu li.manifestation { --bullet-color: #3c9e6b; }
.sous-menu li.stage         { --bullet-color: #eac04d; }

.sous-menu li {
  list-style: none;
  position: relative;
  padding-left: 1.2em;
}
.sous-menu li::before {
  content: "•";
  position: absolute;
  left: 0; top: .2em;
  color: var(--bullet-color);
}
.sous-menu a {
  display: block;
  padding: .5rem 1rem;
  white-space: nowrap;
  color: #fff;
  text-decoration: none;
}
.sous-menu a:hover {
  background: rgba(255,255,255,.1);
}

@media (min-width: 769px) {
  .main-nav > ul > li:hover > .sous-menu,
  .main-nav > ul > li:focus-within > .sous-menu {
    display: block;
  }
  .logo-img {
    height: 70px !important;
    width: auto  !important;
  }
  .page-administration .bureau-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
  }
}

/* toggle details/summary “Activités” */
.submenu-item details summary::-webkit-details-marker,
.submenu-item details summary::marker {
  display: none;
}
.submenu-item details summary {
  display: block;
  padding: .6rem 1.2rem;
  color: #fff;
  font-weight: 600;
  background: none;
  text-align: center;
  border-radius: 4px;
  user-select: none;
}
.submenu-item details summary:hover {
  background: rgba(255,255,255,.15);
}
.submenu-item details summary::after {
  content: "▾";
  margin-left: .5em;
  transition: transform .3s;
  color: #f9d342;
}
.submenu-item details[open] summary::after {
  transform: rotate(180deg);
}
.submenu-item details {
  position: relative;
}
.submenu-item details .sous-menu {
  display: none !important;
  position: absolute;
  top: 100%; left: 0;
  background: #1e3d59;
  border-radius: 4px;
  min-width: 240px;
  box-shadow: 0 4px 10px rgba(0,0,0,.1);
  margin-top: .3rem;
  overflow: hidden;
  margin: 0; padding: 0;
  list-style: none;
  z-index: 1001;
}
.submenu-item details[open] .sous-menu {
  display: block !important;
}
.submenu-item .sous-menu li {
  position: relative;
  padding-left: 1.5em;
}
.submenu-item .sous-menu li::before {
  content: "\25A0";
  position: absolute;
  left: .8em; top: 50%;
  transform: translateY(-50%);
  color: var(--bullet-color);
  font-size: .8em;
}

/* burger & mobile toggle */
.menu-toggle { display: none; }
.menu-icon {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px; height: 22px;
  cursor: pointer;
}
.menu-icon span {
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    position: absolute;
    top: 1.2rem; right: 2rem;
    width: 1.5rem; height: 1.5rem;
    opacity: 0; z-index: 1002;
    cursor: pointer;
  }
  .menu-icon {
    display: flex;
    position: absolute;
    top: 1rem; right: 1rem;
    z-index: 1002;
  }
  .menu-toggle:checked + .menu-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .menu-toggle:checked + .menu-icon span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle:checked + .menu-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  nav.main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    max-height: calc(100vh - var(--header-height));
    background: #1e3d59;
    overflow-y: auto;
    padding: 1rem 0;
    flex-direction: column;
    align-items: center;
    z-index: 1001;
  }
  .menu-toggle:checked ~ nav.main-nav {
    display: flex;
  }

  nav.main-nav > ul {
    list-style: none;
    margin: .5rem 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .4rem;
  }
  nav.main-nav li { margin: 0; }
  nav.main-nav a  { padding: .4rem .8rem; }

  .sous-menu {
    display: none !important;
    position: static;
    box-shadow: none;
    margin: 0; padding: 0;
  }
  .main-nav li:focus-within > .sous-menu {
    display: flex !important;
    flex-direction: column;
  }
  .sous-menu li { margin: 0; }

  .header-inner {
    justify-content: center;
    padding: 1rem .5rem;
  }
  .logo-link { order: 1; margin: .5rem auto 0; }
  .header-right {
    order: 2;
    width: 100%;
    margin: .5rem auto;
    text-align: center;
  }
  .header-right h1 {
    font-size: 1.3em;
    line-height: 1.2;
    white-space: normal;
  }
  .header-right h1 span {
    margin-top: .2em;
  }

  .page-administration .admin-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-auto-rows: 1fr !important;
    gap: 1rem !important;
  }
  .page-administration .admin-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
  }

  .page-partenaires .logos {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 0;
  }
  .page-partenaires .logos a {
    flex: 0 1 calc(33.333% - 1rem);
    max-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .page-partenaires .logos img {
    width: 100%;
    height: auto;
  }

  .hide-on-mobile { display: none !important; }
}

@media (max-width: 600px) {
  #site-footer .footer-inner {
    font-size: .75rem;
    line-height: 1.3;
  }
}


/*====================================
  3) ÉVÉNEMENTS
====================================*/
.event-list,
.event-liste {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

@media (min-width: 769px) {
  .event-list,
  .event-liste {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 2rem;
  }
}

.event-bloc {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #fff;
  border: 1px solid #ccc;
  border-left: 6px solid transparent;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
}

.event-img {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* style global images */
.event-img img {
  width: 100%;
  max-width: 220px;
  border-radius: 8px;
  object-fit: cover;
  background: #f0f0f0;
}

/* crop 25% bas en portrait (index only) */
body.page-index .image-crop.portrait {
  overflow: hidden;
  margin-bottom: -25%;
}
body.page-index .image-crop.portrait img {
  clip-path: inset(0 0 25% 0);
  -webkit-clip-path: inset(0 0 25% 0);
}

.event-info {
  font-size: .95rem;
  color: #444;
  line-height: 1.4;
  margin-top: 1rem;
}

.event-bloc.exposition    { border-left-color: #4b7cde; }
.event-bloc.conference    { border-left-color: #8a60a4; }
.event-bloc.atelier       { border-left-color: #d17e46; }
.event-bloc.manifestation { border-left-color: #3c9e6b; }
.event-bloc.stage         { border-left-color: #eac04d; }


/*====================================
  4) PAGE-INDEX OVERRIDES
====================================*/
/* conserve liens inactifs, etc. */
.page-index .event-link,
.page-index .event-link * {
  text-decoration: none !important;
  color: inherit !important;
}
.page-index .event-list .event-bloc {
  align-items: stretch;
}

/* pousse le <h2> Agenda sous le header fixe */
body.page-index .contenu-encadre > h2 {
  position: relative;
  top: var(--header-height);
  background: #fff;
  padding-top: .5rem;
  margin-bottom: 1rem;
  z-index: 2;
}

/*====================================
  5) ADMINISTRATION
====================================*/
.page-administration .bureau-list {
  list-style: square outside;
  margin-top: 1rem;
  padding-left: 1rem !important;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.page-administration .bureau-list li {
  margin-bottom: .5rem;
  padding-left: 0 !important;
}
.page-administration .bureau-list > li > strong {
  display: block;
  margin-bottom: .3rem;
}
.page-administration .bureau-list li > ul {
  list-style: disc inside !important;
  margin: .1rem 0 .1rem .1rem !important;
  padding-left: 0 !important;
}
.page-administration .admin-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1rem;
  justify-items: center;
  margin-top: 1rem;
}
.page-administration .admin-card {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  width: 100%;
}


/*====================================
  6) CONTACT
====================================*/
.page-contact .contact-intro {
  text-align: center;
  margin-bottom: 1rem;
}
.page-contact .contact-intro a {
  color: #1e3d59;
  text-decoration: none;
}
.page-contact .contact-bloc {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}
.page-contact .contact-info {
  flex: 1 1 100%;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.page-contact .contact-info ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 769px) {
  .page-contact .contact-bloc {
    display: grid;
    grid-template-areas:
      "address hours"
      "phone   phone";
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .page-contact .contact-info:nth-child(1) { grid-area: address; }
  .page-contact .contact-info:nth-child(2) { grid-area: hours;   }
  .page-contact .contact-info:nth-child(3) { grid-area: phone;   }
}


/*====================================
  7) FOOTER & DASHBOARD STRIPES
====================================*/
/* Footer */
#site-footer {
  margin-top: 1.5rem;
  background: #f5f5f5;
  padding: 2rem 1rem;
}
#site-footer .footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  line-height: 1.4;
  font-size: .9rem;
}
#site-footer a {
  color: inherit;
  text-decoration: none;
}
#site-footer .spacer {
  height: 1em;
  font-size: 0;
  margin: 0;
}
#site-footer .bureau {
  margin: .5em 0;
}
/* Zebra stripes */
.admin-dashboard__list table tbody tr:nth-child(odd) {
  background-color: #bbd2e1;
}
.admin-dashboard__list table tbody tr:nth-child(even) {
  background-color: #fff;
}


/*====================================
  8) UTILITAIRES
====================================*/
/* Section header (title + action) */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* Download button */
.download-plaquette {
  font-size: .9rem;
  color: #0078d4;
  text-decoration: none;
  border: 1px solid #0078d4;
  padding: .3em .6em;
  border-radius: 3px;
  transition: background .2s, color .2s;
}
.download-plaquette:hover {
  background: #0078d4;
  color: #fff;
}

/* White box + form */
.contenu-encadre {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.contenu-encadre form .form-group {
  margin-bottom: 1.5rem;
}
.contenu-encadre form label {
  display: block;
  margin-bottom: .5rem;
  font-weight: 600;
}
.contenu-encadre form input,
.contenu-encadre form select,
.contenu-encadre form textarea {
  width: 100%;
  padding: .6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color .2s;
}
.contenu-encadre form input:focus,
.contenu-encadre form select:focus,
.contenu-encadre form textarea:focus {
  border-color: #007BFF;
  outline: none;
}
.contenu-encadre form .btn {
  display: inline-block;
  padding: .7rem 1.4rem;
  margin-top: .5rem;
  border: none;
  background: #007BFF;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: background .2s;
}
.contenu-encadre form .btn:hover {
  background: #0056b3;
}
.contenu-encadre form .btn-cancel {
  background: #6c757d;
  margin-left: 1rem;
}

/* Icon links */
.icon-link {
  font-size: 1.4rem;
  display: inline-block;
  width: 2.2rem;
  height: 2.2rem;
  line-height: 2.2rem;
  text-align: center;
  vertical-align: middle;
  text-decoration: none;
}
.icon-link:hover {
  background: rgba(0,0,0,.05);
  border-radius: 4px;
}

/* Hide certain elements on small screens */
@media only screen and (max-width: 770px) {
  .hide-on-mobile {
    display: none !important;
  }
}


/*====================================
  9) SOUS-MENU : CARRÉS GROS & COLORÉS
====================================*/
nav.main-nav .sous-menu {
  list-style: none !important;
  margin: 0;
  padding: 0;
}
nav.main-nav .sous-menu li {
  position: relative !important;
  padding-left: 3em !important;
  margin: .4em 0 !important;
  font-size: 1rem !important;
  line-height: 1.4 !important;
  display: block !important;
}
nav.main-nav .sous-menu li::before {
  content: "\25A0";
  position: absolute;
  left: 1em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3em !important;
  color: var(--bullet-color) !important;
}
nav.main-nav .sous-menu li.exposition    { --bullet-color: #4b7cde; }
nav.main-nav .sous-menu li.conference    { --bullet-color: #8a60a4; }
nav.main-nav .sous-menu li.atelier       { --bullet-color: #d17e46; }
nav.main-nav .sous-menu li.manifestation { --bullet-color: #3c9e6b; }
nav.main-nav .sous-menu li.stage         { --bullet-color: #eac04d; }
