/* =========================================================
 * Internal Header — Modern / Dense / Responsive (FULL)
 * + Breadcrumb scrollbar clean (CLIPPED in pill) + Orange Pépites
 * ========================================================= */

:root{
  --font-sans: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Accent Pépites */
  --accent: #ff6233;

  /* Fallback tokens si page ne définit rien */
  --ih-text: #ffffff;
  --ih-muted: rgba(255,255,255,.78);
  --ih-surface: rgba(255,255,255,.10);
  --ih-border: rgba(255,255,255,.18);
}

/* Light override (si ton theme met data-theme="light") */
:root[data-theme="light"]{
  --ih-text: #111827;
  --ih-muted: rgba(17,24,39,.72);
  --ih-surface: rgba(255,255,255,.82);
  --ih-border: rgba(15,23,42,.14);
}

.internal-header-wrapper{
  font-family: var(--font-sans);
}

.internal-header-wrapper .container{
  margin-inline: auto;
  max-width: 1200px;
  padding-inline: 1rem;
}

/* Header background */
.internal-header-wrapper .internal-header{
  color: var(--ih-text);
  background:
  radial-gradient(1100px 380px at 50% -140px,
                  color-mix(in oklab, var(--accent) 16%, transparent), transparent),
                  linear-gradient(180deg, #0a0b0f, #23262c);
                  box-shadow: 0 14px 40px rgba(0,0,0,.22);
                  border-bottom: 1px solid rgba(255,255,255,.08);
}

:root[data-theme="light"] .internal-header-wrapper .internal-header{
  background:
  radial-gradient(1100px 380px at 50% -140px,
                  color-mix(in oklab, var(--accent) 12%, transparent), transparent),
                  linear-gradient(180deg, #f6f7f9, #eceff3);
                  box-shadow: 0 12px 34px rgba(15,23,42,.10);
                  border-bottom: 1px solid rgba(15,23,42,.08);
}

.internal-header-wrapper .ih-shell{
  padding-block: .9rem .85rem;
}

/* Top row */
.internal-header-wrapper .ih-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  min-height: 42px;
}

.internal-header-wrapper .ih-brand{
  display:flex;
  align-items:center;
  gap:.55rem;
  min-width: 0;
}

.internal-header-wrapper .ih-brand-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 10px 26px color-mix(in oklab, var(--accent) 32%, transparent);
  flex: 0 0 auto;
}

.internal-header-wrapper .ih-brand-text{
  font-weight: 900;
  letter-spacing: -0.02em;
  opacity: .95;
}

/* Actions */
.internal-header-wrapper .ih-actions{
  display:flex;
  align-items:center;
  gap:.6rem;
  flex: 0 0 auto;
}

.internal-header-wrapper .ih-theme{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  border: 1px solid var(--ih-border);
  background: color-mix(in oklab, var(--ih-surface) 70%, transparent);
  color: currentColor;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform .15s ease, background-color .2s ease, border-color .2s ease;
}

.internal-header-wrapper .ih-theme:hover{
  transform: translateY(-1px);
  background: color-mix(in oklab, var(--ih-surface) 92%, transparent);
  border-color: color-mix(in oklab, var(--accent) 25%, var(--ih-border));
}

/* Title block */
.internal-header-wrapper .ih-titlewrap{
  text-align:center;
  padding-top: .35rem;
  padding-bottom: .55rem;
}

.internal-header-wrapper .ih-title{
  margin: 0;
  font-weight: 950;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-size: clamp(1.45rem, 3.4vw, 2.35rem);
}

.internal-header-wrapper .ih-sub{
  margin: .45rem auto 0;
  max-width: 78ch;
  color: var(--ih-muted);
  font-weight: 600;
  line-height: 1.35;
  font-size: clamp(.92rem, 1.55vw, 1.05rem);
}

/* Breadcrumb (BOTTOM) — visible, premium, responsive */
.internal-header-wrapper .ih-breadcrumb{
  margin-top: .45rem;
  padding-top: .6rem;
  border-top: 1px solid rgba(255,255,255,.10);
}

:root[data-theme="light"] .internal-header-wrapper .ih-breadcrumb{
  border-top-color: rgba(15,23,42,.10);
}

/* =========================================================
 * Breadcrumb pill — IMPORTANT: CLIP au radius (sans casser le scroll)
 * On utilise clip-path (marche avec overflow-x:auto)
 * ========================================================= */
.internal-header-wrapper .ih-crumbs{
  list-style: none;
  margin: 0;
  padding: .42rem .65rem .62rem; /* bottom: réserve scrollbar */
  display:flex;
  align-items:center;
  gap: .45rem;

  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;

  background: color-mix(in oklab, var(--ih-surface) 92%, transparent);
  border: 1px solid var(--ih-border);
  border-radius: 999px;
  backdrop-filter: blur(10px);

  /* CLIP propre des extrémités arrondies (scrollbar incluse) */
  clip-path: inset(0 round 999px);
  -webkit-clip-path: inset(0 round 999px);

  /* évite les sauts de layout quand scrollbar apparaît */
  scrollbar-gutter: stable both-edges;

  /* meilleure impression d’alignement visuel */
  line-height: 1;
}

/* =========================================================
 * Scrollbar breadcrumb — CLEAN + ORANGE (rien ne dépasse)
 * ========================================================= */

/* WebKit (Chrome, Edge, Safari) */
.internal-header-wrapper .ih-crumbs::-webkit-scrollbar{
  height: 8px;
}

.internal-header-wrapper .ih-crumbs::-webkit-scrollbar-track{
  background: transparent;
  margin: 0 16px; /* ne touche jamais les coins */
}

.internal-header-wrapper .ih-crumbs::-webkit-scrollbar-thumb{
  background: var(--accent);
  border-radius: 999px;

  /* inset visuel => pas d'impression de “débordement” */
  border: 2px solid transparent;
  background-clip: padding-box;

  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}

.internal-header-wrapper .ih-crumbs::-webkit-scrollbar-thumb:hover{
  background: color-mix(in oklab, var(--accent) 86%, #ffffff);
}

/* Firefox */
.internal-header-wrapper .ih-crumbs{
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.internal-header-wrapper .ih-crumb{
  flex: 0 0 auto;
  min-width: 0;
}

.internal-header-wrapper .ih-sep{
  flex: 0 0 auto;
  opacity: .7;
  font-weight: 900;
}

.internal-header-wrapper .ih-crumb-link,
.internal-header-wrapper .ih-crumb-current{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding: .22rem .5rem;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  text-decoration: none;
}

.internal-header-wrapper .ih-crumb-link{
  color: currentColor;
  opacity: .92;
}

.internal-header-wrapper .ih-crumb-link:hover{
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.internal-header-wrapper .ih-crumb-current{
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
}

/* =========================
 * Mobile tuning (important)
 * ========================= */
@media (max-width: 680px){
  .internal-header-wrapper .ih-shell{
    padding-block: .8rem .75rem;
  }

  .internal-header-wrapper .ih-titlewrap{
    padding-bottom: .45rem;
  }

  .internal-header-wrapper .ih-sub{
    max-width: 44ch;
  }

  /* Breadcrumb pill: smaller + safer */
  .internal-header-wrapper .ih-crumbs{
    padding: .34rem .5rem .56rem;
    gap: .35rem;
  }

  .internal-header-wrapper .ih-crumb-link,
  .internal-header-wrapper .ih-crumb-current{
    font-size: .86rem;
    padding: .18rem .42rem;
  }

  /* scrollbar un peu plus fine sur mobile */
  .internal-header-wrapper .ih-crumbs::-webkit-scrollbar{ height: 7px; }
  .internal-header-wrapper .ih-crumbs::-webkit-scrollbar-track{ margin: 0 14px; }
}

/* Ultra small */
@media (max-width: 380px){
  .internal-header-wrapper .ih-title{
    font-size: 1.35rem;
  }

  .internal-header-wrapper .ih-theme{
    width: 36px;
    height: 36px;
  }

  .internal-header-wrapper .ih-crumbs::-webkit-scrollbar-track{
    margin: 0 12px;
  }
}
