/**
 * utilities.css — Remplacement Bootstrap sur mesure
 * Couvre : grid, flex, spacing, navbar, spinner, dropdown
 * Aucune dépendance externe.
 */

/* ── Reset minimal ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; height: auto; display: block; }

/* ── Containers ───────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1rem;
}
.container-fluid {
  width: 100%;
  padding-inline: 1rem;
}
.container-xxl {
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: 1rem;
}

/* ── Grid ─────────────────────────────────────────────────── */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-inline: -0.75rem;
}
.row > * {
  padding-inline: 0.75rem;
  width: 100%;
}

/* Gap utilities on row */
.g-0  { gap: 0;      }
.g-0 > * { padding-inline: 0; }
.g-3  { gap: 1rem;   }
.g-4  { gap: 1.5rem; }
.g-5  { gap: 3rem;   }
.gy-4 { row-gap: 1.5rem; }

/* With gap, remove negative margins and inline padding on row */
.g-3, .g-4, .g-5, .gy-4 { margin-inline: 0; }
.g-3 > *, .g-4 > *, .g-5 > *, .gy-4 > * { padding-inline: 0; }

/* Columns — mobile first (always full width by default) */
.col-12 { width: 100%; }

/* sm ≥ 576px */
@media (min-width: 576px) {
  .col-sm-6  { width: 50%; }
  .col-sm-12 { width: 100%; }
}

/* md ≥ 768px */
@media (min-width: 768px) {
  .col-md-4  { width: 33.3333%; }
  .col-md-6  { width: 50%; }
  .col-md-12 { width: 100%; }
}

/* lg ≥ 992px */
@media (min-width: 992px) {
  .col-lg-4  { width: 33.3333%; }
  .col-lg-5  { width: 41.6667%; }
  .col-lg-6  { width: 50%;      }
  .col-lg-7  { width: 58.3333%; }

  .flex-lg-row-reverse { flex-direction: row-reverse !important; }
  .text-lg-start       { text-align: left !important; }
  .ms-lg-auto          { margin-left: auto !important; }
}

/* ── Flex utilities ───────────────────────────────────────── */
.d-flex              { display: flex !important; }
.d-block             { display: block !important; }
.flex-column         { flex-direction: column !important; }
.align-items-center  { align-items: center !important; }
.justify-content-center { justify-content: center !important; }
.ms-auto             { margin-left: auto !important; }
.mx-auto             { margin-inline: auto !important; }

/* ── Spacing utilities ────────────────────────────────────── */
/* margin-bottom */
.m-0  { margin: 0 !important; }
.mb-2 { margin-bottom: 0.5rem  !important; }
.mb-3 { margin-bottom: 1rem    !important; }
.mb-4 { margin-bottom: 1.5rem  !important; }
.mb-5 { margin-bottom: 3rem    !important; }
/* margin-end (right in LTR) */
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem   !important; }
/* margin-y */
.my-5 { margin-block: 3rem !important; }
/* padding */
.p-3  { padding: 1rem   !important; }
.p-4  { padding: 1.5rem !important; }
.pt-2 { padding-top: 0.5rem  !important; }
.px-4 { padding-inline: 1.5rem !important; }
.py-0 { padding-block: 0     !important; }
.py-3 { padding-block: 1rem  !important; }
.py-4 { padding-block: 1.5rem !important; }
.py-5 { padding-block: 3rem  !important; }

/* ── Text utilities ───────────────────────────────────────── */
.text-center { text-align: center !important; }
.text-muted  { color: #6c757d !important; }
.text-white  { color: #fff !important; }

/* ── Background utilities ─────────────────────────────────── */
.bg-white       { background-color: #fff !important; }
.bg-dark        { background-color: #091a2d !important; }
.bg-transparent { background-color: transparent !important; }

/* ── Position utilities ───────────────────────────────────── */
.position-fixed   { position: fixed !important; }
.top-50           { top: 50% !important; }
.start-50         { left: 50% !important; }
.translate-middle { transform: translate(-50%, -50%) !important; }

/* ── Size utilities ───────────────────────────────────────── */
.w-100  { width: 100% !important; }
.w-35   { width: 35%  !important; }
.vh-100 { height: 100vh !important; }

/* ── Border radius ────────────────────────────────────────── */
.rounded   { border-radius: 0.375rem !important; }
.rounded-3 { border-radius: 1rem     !important; }

/* ── Visibility / show ────────────────────────────────────── */
.show { display: block !important; }

/* ── Accessibility ────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Image fluid ──────────────────────────────────────────── */
.img-fluid {
  max-width: 100%;
  height: auto;
}

/* ── Spinner ──────────────────────────────────────────────── */
.spinner-border {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}
@keyframes spinner-border {
  to { transform: rotate(360deg); }
}

/* ── Navbar component ─────────────────────────────────────── */
/* Base wrapper — always a horizontal flex bar */
.navbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  position: relative;
  width: 100%;
}

/* Brand */
.navbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-size: 1.25rem;
  white-space: nowrap;
}

/* Nav list */
.navbar-nav {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Nav items */
.nav-item { position: relative; }

/* Nav links */
.nav-link {
  display: block;
  padding: 0.5rem 0;
  text-decoration: none;
  color: inherit;
}

/* Collapse: hidden on mobile, always visible on desktop */
.navbar-collapse {
  flex-basis: auto;
  flex-grow: 1;
  display: none;
  align-items: center;
}
.navbar-collapse.show {
  display: flex;
  flex-direction: column;
  width: 100%;
  order: 3;
}

/* Hamburger toggler */
.navbar-toggler {
  background: none;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.navbar-toggler-icon {
  display: block;
  width: 1.5em;
  height: 1.5em;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833,37,41,0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
}

/* On large screens: inline flex row */
@media (min-width: 992px) {
  .navbar-expand-lg .navbar-collapse {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    flex-grow: 1;
    width: auto;
  }
  .navbar-expand-lg .navbar-nav {
    flex-direction: row;
    align-items: center;
    margin-left: auto;
  }
  .navbar-expand-lg .navbar-toggler {
    display: none;
  }
  .navbar-expand-lg .nav-link {
    padding: 0.5rem 0;
  }

  .col-lg-4  { width: 33.3333%; }
  .col-lg-5  { width: 41.6667%; }
  .col-lg-6  { width: 50%;      }
  .col-lg-7  { width: 58.3333%; }

  .flex-lg-row-reverse { flex-direction: row-reverse !important; }
  .text-lg-start       { text-align: left !important; }
  .ms-lg-auto          { margin-left: auto !important; }
}

/* ── Dropdown menu ────────────────────────────────────────── */
.dropdown { position: relative; }

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 10rem;
  padding: 0.5rem 0;
  margin: 0;
  list-style: none;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 1000;
  backdrop-filter: blur(16px);
}
.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.dropdown-item:hover {
  background: rgba(255,105,34,0.08);
  color: #ff6922;
}

/* ── Button outline-light (social footer) ─────────────────── */
.btn-outline-light {
  border: 1px solid rgba(255,255,255,0.5);
  color: rgba(255,255,255,0.85);
  background: transparent;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  text-decoration: none;
}
.btn-outline-light:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ── btn-link (footer quick links) ───────────────────────────*/
.btn-link {
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 0.2rem 0;
  font-size: 0.9rem;
  cursor: pointer;
  display: block;
  transition: color 0.2s;
}
.btn-link:hover { color: #ff6922; }

/* ── Map responsive ───────────────────────────────────────── */
.map-responsive {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.map-responsive iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── sticky-top (legacy, kept for compat) ─────────────────── */
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 1020;
}
