/* ==========================================================================
   Charte graphique — inspirée du flyer « La Manuf' (encore) transformée »
   Jaune soleil · aubergine · papier blanc déchiré · titres condensés
   ========================================================================== */

:root {
  --manuf-jaune: #ffd60a;
  --manuf-jaune-fonce: #f2c200;
  --manuf-aubergine: #2d1b4e;
  --manuf-aubergine-clair: #45306f;
  --manuf-aubergine-fonce: #1e1236;
  --manuf-papier: #fffdf5;
  --manuf-encre: #24163f;

  /* Couleurs par type d'offre (calendrier, étiquettes) */
  --tl-evenement: #e0457b;
  --tl-atelier: #f07f1d;
  --tl-formation: #6a45a8;
  --tl-espace: #1f8a70;
  --tl-machine: #2f6db0;
  --tl-mine: #ffd60a;

  --font-titre: "Bebas Neue", "Oswald", Impact, sans-serif;
  --font-accroche: "Josefin Sans", "Mulish", sans-serif;
  --font-texte: "Mulish", system-ui, sans-serif;
  --font-logo: "Kalam", "Comic Sans MS", cursive;

  /* Surcharges Bootstrap */
  --bs-body-font-family: var(--font-texte);
  --bs-body-color: var(--manuf-encre);
  --bs-primary: var(--manuf-aubergine);
  --bs-primary-rgb: 45, 27, 78;
  --bs-link-color: var(--manuf-aubergine-clair);
  --bs-link-color-rgb: 69, 48, 111;
  --bs-link-hover-color: var(--manuf-aubergine-fonce);
  --bs-link-hover-color-rgb: 30, 18, 54;
  --bs-border-radius: .65rem;
  --bs-border-radius-lg: 1rem;
  --bs-focus-ring-color: rgba(255, 214, 10, .55);
}

/* --- Fond jaune tramé (effet impression) --------------------------------- */
body {
  background-color: var(--manuf-jaune);
  background-image:
    radial-gradient(rgba(45, 27, 78, .07) 1px, transparent 1.3px),
    radial-gradient(rgba(255, 255, 255, .25) 1px, transparent 1.3px);
  background-size: 7px 7px, 11px 11px;
  background-position: 0 0, 3px 5px;
  color: var(--manuf-encre);
}

/* --- Typographie ----------------------------------------------------------- */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .titre-affiche {
  font-family: var(--font-titre);
  font-weight: 400;
  letter-spacing: .03em;
  color: var(--manuf-aubergine);
  line-height: 1.05;
}
h1, .h1 { font-size: 2.8rem; }
h2, .h2 { font-size: 2.2rem; }
h3, .h3 { font-size: 2.2rem; }
h4, .h4 { font-size: 1.8rem; }
h5, .h5 { font-size: 1.55rem; }
h6, .h6 { font-size: 1.3rem; }

.accroche {
  font-family: var(--font-accroche);
  font-weight: 600;
  letter-spacing: .12em;
}

/* Titre de section souligné d'un trait jaune (comme « AU PROGRAMME ») */
.titre-souligne { display: inline-block; position: relative; padding-bottom: .55rem; margin-bottom: 1rem; }
.titre-souligne::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 3.2rem; height: .32rem; border-radius: 1rem; background: var(--manuf-jaune);
}
.text-center .titre-souligne::after, .titre-souligne.centre::after { left: 50%; transform: translateX(-50%); }

/* --- Logo ----------------------------------------------------------------- */
.logo {
  display: inline-flex; align-items: baseline; gap: .15em;
  background: #fff; color: #111;
  font-family: var(--font-logo); font-weight: 700; line-height: 1;
  padding: .35em .85em .45em;
  border-radius: 46% 54% 42% 58% / 62% 48% 52% 38%;
  box-shadow: 3px 4px 0 var(--manuf-aubergine-fonce);
  transform: rotate(-2deg);
  font-size: 1.45rem;
  text-decoration: none;
  white-space: nowrap;
}
.logo .logo-la { font-size: .62em; font-style: italic; }
.logo:hover { color: #111; transform: rotate(0deg); transition: transform .2s; }
.logo-geant { font-size: clamp(2.2rem, 7vw, 4rem); box-shadow: 5px 6px 0 var(--manuf-aubergine); }

/* --- Barre de navigation ------------------------------------------------- */
.navbar-manuf { background: var(--manuf-aubergine); padding-top: .7rem; padding-bottom: .7rem; box-shadow: 0 .2rem .8rem rgba(30, 18, 54, .25); }
/* Barre fixée en haut : les ancres et les en-têtes collants du calendrier se placent dessous */
html { scroll-padding-top: var(--hauteur-barre, 72px); }
.fc .fc-scrollgrid-section-header.fc-scrollgrid-section-sticky > * { top: var(--hauteur-barre, 72px); }
/* Menu replié sur mobile : il défile s'il dépasse l'écran */
@media (max-width: 991.98px) { .navbar-manuf .navbar-collapse { max-height: calc(100vh - 72px); overflow-y: auto; } }
.navbar-manuf .nav-link {
  font-family: var(--font-titre); font-size: 1.25rem; letter-spacing: .06em;
  color: rgba(255, 255, 255, .85);
}
.navbar-manuf .nav-link:hover, .navbar-manuf .nav-link:focus, .navbar-manuf .nav-link.active { color: var(--manuf-jaune); }
.navbar-manuf .dropdown-menu { border: 0; box-shadow: 0 .6rem 1.5rem rgba(0, 0, 0, .2); }
.navbar-manuf .dropdown-item:active { background: var(--manuf-aubergine); }
.solde-pill {
  display: inline-block; background: var(--manuf-jaune); color: var(--manuf-aubergine);
  font-family: var(--font-texte); font-weight: 800; font-size: .85rem; letter-spacing: 0;
  padding: .25rem .7rem; border-radius: 999px;
}

/* --- Feuille de papier qui porte le contenu ------------------------------- */
.feuille {
  background: var(--manuf-papier);
  border-radius: 1.1rem;
  padding: clamp(1rem, 3vw, 2.25rem);
  box-shadow: 0 .35rem 0 rgba(45, 27, 78, .12), 0 1rem 2.5rem rgba(45, 27, 78, .12);
}
.feuille .card { border-color: rgba(45, 27, 78, .12); }

/* --- Rayons « \ / » autour d'une accroche ------------------------------- */
.rayons { display: inline-flex; align-items: center; gap: 1rem; }
.rayons { gap: 1.4rem; }
.rayons > svg { flex: none; width: 46px; height: 54px; }

/* --- Cartes aubergine (« AU PROGRAMME ») -------------------------------- */
.carte-sombre {
  background: var(--manuf-aubergine); color: #fff;
  border-radius: 1.1rem; padding: 1.6rem 1.6rem 1.4rem; height: 100%;
}
.carte-sombre h2, .carte-sombre h3, .carte-sombre .h5 { color: #fff; }
.carte-sombre a { color: #fff; }
.carte-sombre a:hover { color: var(--manuf-jaune); }
.carte-sombre .text-muted, .carte-sombre .small-muted { color: rgba(255, 255, 255, .7) !important; }
.liste-programme { list-style: none; padding: 0; margin: 0; }
.liste-programme li { display: flex; align-items: center; gap: .9rem; padding: .55rem 0; border-bottom: 1px dashed rgba(255, 255, 255, .18); }
.liste-programme li:last-child { border-bottom: 0; }
.icone-grande .icone { width: 3.2rem; height: 3.2rem; color: var(--manuf-jaune); }
.liste-programme .icone { flex: none; width: 2.1rem; height: 2.1rem; color: var(--manuf-jaune); }

/* --- Boutons -------------------------------------------------------------- */
.btn { font-weight: 700; border-radius: 999px; padding-left: 1.1rem; padding-right: 1.1rem; }
.btn-sm { padding-left: .8rem; padding-right: .8rem; }
.btn-lg { font-family: var(--font-titre); font-weight: 400; font-size: 1.5rem; letter-spacing: .05em; padding: .55rem 1.6rem .4rem; }
.btn-primary {
  --bs-btn-bg: var(--manuf-aubergine); --bs-btn-border-color: var(--manuf-aubergine);
  --bs-btn-hover-bg: var(--manuf-aubergine-clair); --bs-btn-hover-border-color: var(--manuf-aubergine-clair);
  --bs-btn-active-bg: var(--manuf-aubergine-fonce); --bs-btn-active-border-color: var(--manuf-aubergine-fonce);
  --bs-btn-disabled-bg: var(--manuf-aubergine); --bs-btn-disabled-border-color: var(--manuf-aubergine);
  --bs-btn-focus-shadow-rgb: 255, 214, 10;
}
.btn-outline-primary {
  --bs-btn-color: var(--manuf-aubergine); --bs-btn-border-color: var(--manuf-aubergine);
  --bs-btn-hover-bg: var(--manuf-aubergine); --bs-btn-hover-border-color: var(--manuf-aubergine);
  --bs-btn-active-bg: var(--manuf-aubergine-fonce); --bs-btn-active-border-color: var(--manuf-aubergine-fonce);
  --bs-btn-focus-shadow-rgb: 255, 214, 10;
  border-width: 2px;
}
.btn-jaune {
  --bs-btn-color: var(--manuf-aubergine); --bs-btn-bg: var(--manuf-jaune); --bs-btn-border-color: var(--manuf-jaune);
  --bs-btn-hover-color: var(--manuf-aubergine); --bs-btn-hover-bg: #ffe14d; --bs-btn-hover-border-color: #ffe14d;
  --bs-btn-active-color: var(--manuf-aubergine); --bs-btn-active-bg: var(--manuf-jaune-fonce);
  --bs-btn-focus-shadow-rgb: 255, 214, 10;
}
.btn-ghost-blanc {
  --bs-btn-color: #fff; --bs-btn-border-color: rgba(255, 255, 255, .7);
  --bs-btn-hover-color: var(--manuf-aubergine); --bs-btn-hover-bg: #fff; --bs-btn-hover-border-color: #fff;
  border-width: 2px;
}

/* --- Formulaires, onglets, pagination ----------------------------------- */
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--manuf-aubergine-clair);
  box-shadow: 0 0 0 .25rem rgba(255, 214, 10, .55);
}
.form-check-input:checked { background-color: var(--manuf-aubergine); border-color: var(--manuf-aubergine); }
.form-label { font-weight: 700; }
.nav-pills { gap: .35rem; }
.nav-pills .nav-link {
  font-family: var(--font-titre); font-size: 1.2rem; letter-spacing: .05em;
  color: var(--manuf-aubergine); border-radius: 999px; padding: .35rem 1rem .25rem;
}
.nav-pills .nav-link:hover { background: rgba(45, 27, 78, .08); }
.nav-pills .nav-link.active { background: var(--manuf-aubergine); color: var(--manuf-jaune); }
.pagination { --bs-pagination-color: var(--manuf-aubergine); }
.breadcrumb { font-family: var(--font-accroche); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.table { --bs-table-bg: transparent; }
.table thead th {
  font-family: var(--font-titre); font-weight: 400; font-size: 1.1rem; letter-spacing: .05em;
  color: var(--manuf-aubergine); border-bottom: 3px solid var(--manuf-jaune);
}
.table td, .table th { vertical-align: middle; }
.alert { border: 0; border-left: .35rem solid currentColor; }
.alert-info { --bs-alert-bg: #efe9fb; --bs-alert-color: var(--manuf-aubergine); }
.progress-bar { background: var(--manuf-aubergine); }

/* --- Filtres en direct ------------------------------------------------- */
#resultats { transition: opacity .15s; }
#resultats.filtre-en-cours { opacity: .5; pointer-events: none; }

/* --- Pastilles de type d'offre ------------------------------------------- */
.type-pill {
  display: inline-block; padding: .2rem .65rem .1rem; border-radius: 999px;
  font-family: var(--font-titre); font-size: .95rem; letter-spacing: .06em; line-height: 1.2;
  color: #fff;
}

/* --- Cartes de la page Offre ----------------------------------------------- */
.card-offre { border: 0; border-radius: 1rem; overflow: hidden; box-shadow: 0 .3rem 0 rgba(45, 27, 78, .1); transition: transform .15s, box-shadow .15s; }
.card-offre:hover { transform: translateY(-3px); box-shadow: 0 .6rem 1.4rem rgba(45, 27, 78, .18); }
.card-offre .card-img-top { height: 160px; object-fit: cover; filter: grayscale(.2) contrast(1.05); }
.card-offre .photo-carte { position: relative; }
.card-offre .photo-carte .credit {
  position: absolute; right: 0; bottom: 0; max-width: 100%;
  background: rgba(30, 18, 54, .65); color: #fff; font-size: .62rem; line-height: 1.2;
  padding: .15rem .45rem; border-top-left-radius: .4rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo-offre figcaption { font-size: .72rem; color: #6b6280; margin-top: .3rem; }
.photo-offre figcaption a { color: inherit; }
.card-offre .placeholder-img {
  height: 160px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background-image: radial-gradient(rgba(255, 255, 255, .22) 1.4px, transparent 1.6px);
  background-size: 9px 9px;
}
.card-offre .placeholder-img .icone { width: 64px; height: 64px; color: #fff; opacity: .95; }
.card-offre .card-title a { color: var(--manuf-aubergine); }

/* --- Pied de page ------------------------------------------------------- */
.pied {
  background: var(--manuf-aubergine); color: rgba(255, 255, 255, .85);
  padding: 2rem 0 1.5rem; margin-top: 3rem;
}
.pied a { color: #fff; }
.pied a:hover { color: var(--manuf-jaune); }
.pied h2 { color: #fff; font-size: 1.5rem; }

/* --- Calendrier --------------------------------------------------------- */
.filtre-type { cursor: pointer; user-select: none; }
.filtre-type .pastille { display: inline-block; width: .85rem; height: .85rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.fc { font-size: .9rem; --fc-today-bg-color: rgba(255, 214, 10, .18); --fc-border-color: rgba(45, 27, 78, .12); }
.fc .fc-toolbar-title { font-family: var(--font-titre); font-size: 2rem; letter-spacing: .03em; color: var(--manuf-aubergine); }
.fc .fc-button-primary {
  background: var(--manuf-aubergine); border-color: var(--manuf-aubergine);
  border-radius: 999px !important; font-weight: 700; text-transform: none; margin: 0 .12rem !important;
}
.fc .fc-button-primary:hover { background: var(--manuf-aubergine-clair); border-color: var(--manuf-aubergine-clair); }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active {
  background: var(--manuf-jaune); border-color: var(--manuf-jaune); color: var(--manuf-aubergine);
}
.fc .fc-button-primary:focus { box-shadow: 0 0 0 .2rem rgba(255, 214, 10, .6) !important; }
.fc .fc-col-header-cell-cushion { font-family: var(--font-titre); font-size: 1.1rem; letter-spacing: .04em; color: var(--manuf-aubergine); }
.fc .fc-event { border-radius: .4rem; font-weight: 600; }
.fc a { text-decoration: none; color: inherit; }
.fc .fc-button-primary:disabled { background: var(--manuf-aubergine); border-color: var(--manuf-aubergine); opacity: .45; }
.fc .fc-plage { opacity: .55; border-style: dashed !important; border-width: 2px !important; }
.fc .fc-complet { opacity: .5; text-decoration: line-through; }
.fc .fc-bg-event { opacity: .25; }
.fc .fc-timegrid-now-indicator-line { border-color: #e0457b; }

/* --- Disponibilités d'une plage ----------------------------------------- */
.dispo-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .35rem; }
.dispo-grille .creneau { border-radius: .5rem; padding: .3rem .4rem; font-size: .8rem; font-weight: 700; text-align: center; }
.dispo-grille .libre { background: #d7f0e6; color: #0f5a45; }
.dispo-grille .partiel { background: #fff1b3; color: #6b5300; }
.dispo-grille .plein { background: #e9e5f0; color: #7d7590; text-decoration: line-through; }

/* --- Indicateurs (tableau de bord) -------------------------------------- */
.kpi { background: var(--manuf-aubergine); color: #fff; border-radius: 1rem; padding: 1rem 1.2rem; height: 100%; }
.kpi .kpi-label { font-family: var(--font-accroche); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.kpi .kpi-valeur { font-family: var(--font-titre); font-size: 2.8rem; line-height: 1; color: var(--manuf-jaune); }

@media (max-width: 575.98px) {
  h1, .h1 { font-size: 2.3rem; }
  .rayons > svg { display: none; }
}
