/* ================================================================
   KBA.de — Réplique pédagogique fidèle  |  style.css
   Charte GSB 7.1 (Government Site Builder) — gouvernement fédéral allemand
   ================================================================ */

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: .9375rem;   /* 15px */
  line-height: 1.6;
  color: #333;
  background: #fff;
}
a  { color: #005EA8; text-decoration: none; }
a:hover { text-decoration: underline; color: #003f7a; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* ── CONTAINER ── */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ================================================================
   TOPBAR
   ================================================================ */
.topbar {
  background: #fff;
  border-bottom: 1px solid #dde3ea;
  font-size: .78rem;
}
.topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.topbar__home a { color: #333; font-weight: 600; font-size: .78rem; }
.topbar__home a:hover { text-decoration: underline; }
.topbar__nav { display: flex; align-items: center; gap: 20px; }
.topbar__nav a { color: #555; font-size: .78rem; }
.topbar__nav a:hover { color: #003366; text-decoration: underline; }
.topbar__lang {
  padding: 2px 8px;
  border: 1px solid #bbb;
  border-radius: 2px;
  color: #333 !important;
  font-weight: 600;
}
.topbar__lang:hover { background: #f0f0f0; text-decoration: none !important; }

/* ================================================================
   HEADER
   ================================================================ */
.header {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  max-width: 1200px;
  margin: 0 auto;
  gap: 16px;
}

/* Logo */
.header__logo { display: flex; align-items: center; gap: 12px; text-decoration: none !important; }
.logo-img { height: 60px; width: auto; }

/* Logo fallback (si image bloquée) */
.logo-fallback {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-fallback__badge {
  background: #003366;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
}
.logo-fallback__text { display: flex; flex-direction: column; line-height: 1.25; }
.logo-fallback__text strong { color: #003366; font-size: 1.1rem; font-weight: 700; }
.logo-fallback__text span  { color: #666; font-size: .72rem; }

/* Boutons header */
.header__actions { display: flex; align-items: center; gap: 8px; }

.btn-search {
  background: none;
  border: 1px solid #003366;
  color: #003366;
  padding: 7px 14px;
  border-radius: 2px;
  cursor: pointer;
  font-size: .82rem;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background .18s, color .18s;
  white-space: nowrap;
}
.btn-search:hover { background: #003366; color: #fff; }

.btn-menu {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px; height: 42px;
  background: none;
  border: 1px solid #003366;
  border-radius: 2px;
  cursor: pointer;
  padding: 0;
}
.burger-line {
  display: block;
  width: 22px; height: 2px;
  background: #003366;
  border-radius: 1px;
  transition: all .22s;
}
.btn-menu.open .burger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.btn-menu.open .burger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.btn-menu.open .burger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── SEARCHBAR ── */
.searchbar {
  display: none;
  background: #eef2fb;
  border-top: 1px solid #dde3ea;
  padding: 12px 0;
}
.searchbar.open { display: block; }
.searchbar__form {
  display: flex;
  align-items: center;
  max-width: 640px;
  background: #fff;
  border: 2px solid #003366;
  border-radius: 2px;
  overflow: hidden;
  gap: 0;
}
.searchbar__form svg { padding: 0 12px; flex-shrink: 0; color: #999; }
.searchbar__form input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 0;
  font-size: .95rem;
  font-family: inherit;
  color: #333;
}
.searchbar__form button {
  background: #003366;
  color: #fff;
  border: none;
  padding: 10px 22px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  transition: background .18s;
}
.searchbar__form button:hover { background: #00468f; }

/* ================================================================
   NAVIGATION PRINCIPALE
   ================================================================ */
.mainnav { background: #003366; }
.nav__list {
  display: flex;
  align-items: stretch;
  margin: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav__item { position: relative; }

.nav__link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 13px 16px;
  color: #fff;
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s;
  text-decoration: none !important;
}
.nav__link:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav__arrow { transition: transform .2s; flex-shrink: 0; }

/* i-Kfz item en jaune */
.nav__item--ikfz > .nav__link {
  background: #f7a800;
  color: #1a1a1a;
  font-weight: 700;
  gap: 6px;
}
.nav__item--ikfz > .nav__link:hover { background: #e09600; }
.nav__ikfz-icon { width: 18px; height: 18px; object-fit: contain; }

/* Dropdown au hover */
.nav__item:hover > .nav__link .nav__arrow { transform: rotate(180deg); }
.nav__item:hover > .nav__link { background: rgba(255,255,255,.12); }

/* ── SOUS-NAVIGATION ── */
.subnav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-top: 3px solid #003366;
  box-shadow: 0 4px 16px rgba(0,0,0,.14);
  z-index: 800;
  min-width: 220px;
  padding: 8px 0;
}
.subnav--sm { min-width: 240px; }

.nav__item:hover .subnav,
.nav__item.open .subnav { display: block; }

/* Subnav simple */
.subnav > li > a {
  display: block;
  padding: 9px 20px;
  font-size: .84rem;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.subnav > li:last-child > a { border-bottom: none; }
.subnav > li > a:hover { background: #eef2fb; color: #003366; text-decoration: none; }

/* Subnav avec groupes */
.subnav__group { padding: 10px 0; }
.subnav__group + .subnav__group { border-top: 1px solid #e8ecf2; }
.subnav__group > strong {
  display: block;
  padding: 4px 20px 8px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #003366;
}
.subnav__group ul li a {
  display: block;
  padding: 7px 20px 7px 28px;
  font-size: .83rem;
  color: #444;
  border-bottom: 1px solid #f4f4f4;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.subnav__group ul li:last-child a { border-bottom: none; }
.subnav__group ul li a:hover { background: #eef2fb; color: #003366; text-decoration: none; }

/* Subnav avec groupes — largeur élargie */
.subnav:has(.subnav__group) {
  min-width: 320px;
  padding: 0;
}

/* ================================================================
   HERO BANNER
   ================================================================ */
.hero { width: 100%; line-height: 0; }
.hero__img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* Fallback si image KBA bloquée */
.hero--fallback {
  height: 260px;
  background: linear-gradient(120deg, #001f6e 0%, #003366 45%, #0a5cb8 80%, #1a7dcf 100%);
  display: flex;
  align-items: center;
}

/* ================================================================
   NOTICE BAR (Enquête)
   ================================================================ */
.notice-bar {
  background: #f0f7e6;
  border-bottom: 1px solid #c5dfa6;
  font-size: .85rem;
}
.notice-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.notice-bar__inner p { color: #3a5a20; flex: 1; }
.notice-bar__inner a { color: #2a7700; font-weight: 600; text-decoration: underline; }
.notice-bar__close {
  background: none;
  border: 1px solid #3a5a20;
  color: #3a5a20;
  border-radius: 50%;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: .75rem;
  flex-shrink: 0;
  transition: background .15s;
}
.notice-bar__close:hover { background: #3a5a20; color: #fff; }

/* ================================================================
   SECTIONS
   ================================================================ */
.section { padding: 40px 0; }
.section--white { background: #fff; }
.section--grey  { background: #f4f4f4; }

.sec-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 1px solid #dde3ea;
}

.subsec-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #333;
  margin: 36px 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dde3ea;
}

/* ================================================================
   ONGLETS NEWS (tabs)
   ================================================================ */
.tabs-container { margin-top: 8px; }

.tab-btns {
  display: flex;
  border-bottom: 2px solid #003366;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 0;
}
.tab-btn {
  background: #f0f3f8;
  border: 1px solid #c8d2e0;
  border-bottom: none;
  padding: 10px 20px;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  color: #444;
  cursor: pointer;
  margin-right: 4px;
  margin-bottom: -2px;
  border-radius: 2px 2px 0 0;
  transition: background .15s, color .15s;
}
.tab-btn small { font-weight: 400; color: #888; font-size: .76rem; }
.tab-btn:hover { background: #dde6f5; color: #003366; }
.tab-btn--active {
  background: #003366;
  color: #fff;
  border-color: #003366;
}
.tab-btn--active small { color: rgba(255,255,255,.7); }

/* Panneaux */
.tab-panel {
  display: none;
  background: #fff;
  border: 1px solid #c8d2e0;
  border-top: none;
  padding: 24px;
}
.tab-panel--active { display: block; }

/* ── Slider d'actualités ── */
.news-slider { position: relative; overflow: hidden; }
.news-slider__track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.news-slider__track::-webkit-scrollbar { display: none; }

/* Carte actualité */
.news-card {
  flex: 0 0 calc(25% - 12px);
  min-width: 200px;
  border: 1px solid #e0e6ef;
  border-radius: 2px;
  overflow: hidden;
  scroll-snap-align: start;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: box-shadow .18s;
}
.news-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }

.news-card__img-wrap {
  display: block;
  height: 140px;
  overflow: hidden;
  background: #eef2fb;
  flex-shrink: 0;
}
.news-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.news-card__img-wrap:hover img { transform: scale(1.04); }
.news-card__img-wrap.img-error {
  background: #dde6f5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.news-card__img-wrap.img-error::after {
  content: "🖼";
  font-size: 2rem;
  opacity: .4;
}

/* Icône pour les offres d'emploi */
.news-card__img-wrap--jobs {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f3f8;
}
.news-card__jobs-icon { opacity: .6; }

.news-card__body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.news-card__tag {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #666;
}
.news-card__title {
  font-size: .87rem;
  font-weight: 600;
  color: #005EA8;
  line-height: 1.4;
  display: block;
}
.news-card__title:hover { color: #003f7a; text-decoration: underline; }

/* Contrôles du slider */
.news-slider__controls {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 12px;
}
.slider-btn {
  width: 34px; height: 34px;
  background: #fff;
  border: 1px solid #003366;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #003366;
  transition: background .15s, color .15s;
}
.slider-btn:hover { background: #003366; color: #fff; }

.all-link {
  display: inline-block;
  margin-top: 16px;
  font-size: .85rem;
  font-weight: 600;
  color: #005EA8;
  padding: 7px 0;
  border-bottom: 2px solid transparent;
  transition: border-color .15s;
}
.all-link:hover { border-bottom-color: #005EA8; text-decoration: none; }

/* ================================================================
   GRILLE SERVICES EN LIGNE
   ================================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.svc-card {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 2px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  color: #333;
  text-decoration: none;
  transition: box-shadow .18s, border-color .18s;
}
.svc-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  border-color: #005EA8;
  text-decoration: none;
  color: #333;
}
.svc-card__icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}
.svc-card__body { display: flex; flex-direction: column; gap: 6px; }
.svc-card__body strong {
  font-size: .9rem;
  color: #005EA8;
  line-height: 1.35;
  display: block;
}
.svc-card__body p { font-size: .8rem; color: #555; line-height: 1.5; }
.svc-card__more {
  font-size: .8rem;
  font-weight: 700;
  color: #005EA8;
  margin-top: 4px;
}
.svc-card__more::after { content: " ›"; }

/* ================================================================
   SPECIAL TOPICS
   ================================================================ */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 8px;
}

.topic-card {
  border: 1px solid #dde3ea;
  border-radius: 2px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: box-shadow .18s;
}
.topic-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); }

.topic-card__img-wrap {
  display: block;
  height: 160px;
  overflow: hidden;
  background: #dde6f5;
  flex-shrink: 0;
}
.topic-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.topic-card__img-wrap:hover img { transform: scale(1.04); }
.topic-card__img-wrap.img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #c8d7ec;
}
.topic-card__img-wrap.img-fallback::after { content: "🖼"; font-size: 2.2rem; opacity: .4; }

.topic-card__body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.topic-card__body h3 { font-size: .88rem; font-weight: 700; line-height: 1.3; }
.topic-card__body h3 a { color: #005EA8; }
.topic-card__body h3 a:hover { text-decoration: underline; }
.topic-card__body h3 small { font-weight: 400; font-size: .77rem; color: #888; display: block; }
.topic-card__body p { font-size: .78rem; color: #555; line-height: 1.5; flex: 1; }

/* ================================================================
   i-KFZ SECTION
   ================================================================ */
.ikfz-wrap {
  display: flex;
  gap: 40px;
  align-items: center;
}
.ikfz-wrap__img {
  flex: 0 0 360px;
  max-width: 360px;
  border-radius: 2px;
  overflow: hidden;
}
.ikfz-wrap__img img { width: 100%; height: 240px; object-fit: cover; }
.ikfz-wrap__img.ikfz-img-fallback {
  background: #c8d7ec;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #8aa5c8;
}
.ikfz-wrap__text { flex: 1; }
.ikfz-wrap__text p { color: #444; margin: 12px 0 24px; max-width: 560px; }

.kba-btn {
  display: inline-block;
  padding: 10px 22px;
  background: #003366;
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
  border-radius: 2px;
  transition: background .18s;
  text-decoration: none;
}
.kba-btn:hover { background: #00468f; color: #fff; text-decoration: none; }

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
  background: #1a2740;
  color: rgba(255,255,255,.75);
  padding: 40px 0 0;
}
.footer__top {
  display: grid;
  grid-template-columns: 240px 1fr 180px;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

/* About */
.footer__about { display: flex; flex-direction: column; gap: 16px; }
.footer__logo { height: 48px; width: auto; filter: brightness(0) invert(1); opacity: .85; }
.footer__about p { font-size: .83rem; color: rgba(255,255,255,.65); line-height: 1.55; }

/* Colonnes de liens */
.footer__nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.footer__col h4 {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #fff;
  margin-bottom: 12px;
}
.footer__col ul li { margin-bottom: 7px; }
.footer__col ul li a { font-size: .8rem; color: rgba(255,255,255,.6); }
.footer__col ul li a:hover { color: #fff; text-decoration: underline; }

/* Contact */
.footer__contact { font-size: .83rem; color: rgba(255,255,255,.7); }
.footer__contact strong { font-size: 1.8rem; color: #fff; display: block; margin-bottom: 6px; }
.footer__contact p { margin-bottom: 3px; line-height: 1.4; }

/* Bas de footer */
.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
  flex-wrap: wrap;
  font-size: .78rem;
  color: rgba(255,255,255,.45);
}
.footer__legal { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__legal a { color: rgba(255,255,255,.5); font-size: .78rem; }
.footer__legal a:hover { color: #fff; text-decoration: underline; }

/* ================================================================
   RESPONSIVE — TABLETTE (≤ 1024px)
   ================================================================ */
@media (max-width: 1024px) {
  .nav__link { padding: 13px 11px; font-size: .8rem; }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .topics-grid   { grid-template-columns: repeat(3, 1fr); }
  .footer__top   { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
  .footer__nav   { grid-template-columns: repeat(3, 1fr); grid-column: span 2; }
  .footer__contact { grid-column: span 2; border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; }
}

/* ================================================================
   RESPONSIVE — MOBILE (≤ 768px)
   ================================================================ */
@media (max-width: 768px) {
  /* Header */
  .btn-search span { display: none; }
  .btn-menu { display: flex; }

  /* Navigation mobile */
  .mainnav { display: none; }
  .mainnav.open { display: block; }
  .nav__list { flex-direction: column; padding: 0; max-width: 100%; }
  .nav__item { border-bottom: 1px solid rgba(255,255,255,.1); }
  .nav__link { padding: 14px 20px; font-size: .92rem; justify-content: space-between; }

  .subnav, .subnav:has(.subnav__group) {
    position: static;
    display: none;
    box-shadow: none;
    border-top: none;
    min-width: unset;
    background: rgba(0,0,0,.2);
    padding: 0;
  }
  .nav__item.open .subnav { display: block; }
  .subnav > li > a { color: rgba(255,255,255,.8); padding: 10px 32px; }
  .subnav__group > strong { color: rgba(255,255,255,.5); padding: 8px 20px 4px; }
  .subnav__group ul li a { color: rgba(255,255,255,.7); padding: 8px 20px 8px 36px; }

  /* Hero */
  .hero__img { height: 160px; }

  /* Sections */
  .section { padding: 28px 0; }
  .sec-title { font-size: 1.2rem; }

  /* Onglets */
  .tab-btns { flex-direction: column; border-bottom: none; }
  .tab-btn { border: 1px solid #c8d2e0; border-radius: 2px; margin: 0 0 4px; padding: 10px 16px; }
  .tab-btn--active { background: #003366; color: #fff; }

  /* Slider */
  .news-card { flex: 0 0 80%; }

  /* Grilles */
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .topics-grid   { grid-template-columns: repeat(2, 1fr); }

  /* i-Kfz */
  .ikfz-wrap { flex-direction: column; gap: 20px; }
  .ikfz-wrap__img { flex: none; max-width: 100%; }

  /* Footer */
  .footer__top { grid-template-columns: 1fr; gap: 28px; }
  .footer__nav { grid-template-columns: repeat(2, 1fr); grid-column: 1; }
  .footer__contact { grid-column: 1; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }

  /* Topbar */
  .topbar__home { display: none; }
}

/* ================================================================
   RESPONSIVE — PETIT MOBILE (≤ 480px)
   ================================================================ */
@media (max-width: 480px) {
  .services-grid { grid-template-columns: 1fr; }
  .topics-grid   { grid-template-columns: 1fr; }
  .footer__nav   { grid-template-columns: 1fr; }
  .news-card     { flex: 0 0 90%; }
}
