/* =====================================================
   INFOPOMPIERS DOC HUB PRO 3.0
   Dark full-width, rails compacts, titres lisibles
   ===================================================== */

:root {
  --ipdh-red: #ff2d36;
  --ipdh-red2: #c1121f;
  --ipdh-blue: #2f80ff;
  --ipdh-bg: #070b14;
  --ipdh-bg2: #0d1320;
  --ipdh-border: rgba(148, 163, 184, .18);
  --ipdh-text: #f8fafc;
  --ipdh-muted: #a7b1c2;
}

/* Pleine largeur réelle dans Extra/Divi */
body:has(.ipdh) {
  background:
    radial-gradient(circle at 20% 0%, rgba(193, 18, 31, .20), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(47, 128, 255, .12), transparent 28%),
    linear-gradient(180deg, #070b14 0%, #0a101b 42%, #060910 100%) !important;
}

body:has(.ipdh) #page-container,
body:has(.ipdh) #main-content,
body:has(.ipdh) .container,
body:has(.ipdh) #content-area,
body:has(.ipdh) .post-wrap,
body:has(.ipdh) .post-content,
body:has(.ipdh) article,
body:has(.ipdh) .entry-content {
  background: transparent !important;
}

body:has(.ipdh) .container,
body:has(.ipdh) #content-area {
  width: 100% !important;
  max-width: 100% !important;
}

body:has(.ipdh) .et_pb_extra_column_main {
  width: 100% !important;
  max-width: 100% !important;
}

body:has(.ipdh) .et_pb_extra_column_sidebar {
  display: none !important;
}

body:has(.ipdh) h1.entry-title,
body:has(.ipdh) .post-title {
  display: none !important;
}

.ipdh,
.ipdh * {
  box-sizing: border-box;
}

.ipdh {
  width: min(100%, 1780px);
  margin: 0 auto 90px;
  padding: 0 26px 70px;
  color: var(--ipdh-text);
  font-family: inherit;
}

/* HERO compact */
.ipdh-hero {
  position: relative;
  min-height: 300px;
  border-radius: 0 0 34px 34px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(7, 11, 20, .98) 0%, rgba(7, 11, 20, .84) 44%, rgba(7, 11, 20, .34) 100%),
    radial-gradient(circle at 78% 45%, rgba(255, 45, 54, .42), transparent 32%),
    linear-gradient(135deg, #0d1320, #111827);
  border: 1px solid var(--ipdh-border);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .38);
}

.ipdh-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 74% 50%, rgba(255, 45, 54, .35), transparent 18%),
    radial-gradient(circle at 85% 15%, rgba(255, 95, 40, .18), transparent 20%),
    linear-gradient(135deg, transparent 0%, rgba(15, 23, 42, .55) 100%);
  opacity: .95;
}

.ipdh-hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: clamp(34px, 5vw, 58px);
}

.ipdh-hero h1 {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(36px, 5vw, 64px);
  line-height: .98;
  letter-spacing: -2px;
  font-weight: 950;
  text-transform: none;
}

.ipdh-hero p {
  max-width: 650px;
  margin: 0;
  color: #d7deea;
  font-size: 17px;
  line-height: 1.62;
}

.ipdh-search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 520px);
  height: 48px;
  margin-top: 24px;
  padding: 0 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.ipdh-search span {
  color: #8fa1ba;
  font-size: 22px;
}

.ipdh-search input {
  width: 100%;
  border: none !important;
  background: transparent !important;
  outline: none !important;
  color: #fff !important;
  font-size: 15px;
  font-weight: 700;
}

.ipdh-search input::placeholder {
  color: #77849a;
}

/* Familles sobres, sans icônes */
.ipdh-nav {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin: -34px 0 46px;
  padding: 0 18px;
}

.ipdh-family {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: end;
  min-height: 106px;
  padding: 18px;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 22px 52px rgba(0,0,0,.24);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.ipdh-family::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .25;
  background:
    radial-gradient(circle at 50% 0%, currentColor, transparent 42%),
    linear-gradient(180deg, transparent, rgba(0,0,0,.58));
}

.ipdh-family::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: currentColor;
}

.ipdh-family:hover {
  transform: translateY(-6px);
  border-color: currentColor;
  box-shadow: 0 30px 80px rgba(0,0,0,.36);
}

.ipdh-family > * {
  position: relative;
  z-index: 2;
}

.ipdh-family strong {
  color: #fff;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 950;
  margin-bottom: 7px;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.ipdh-family small {
  color: #d8e0ec;
  font-size: 12px;
  font-weight: 800;
}

.ipdh-family-red { color: #ff2d36; }
.ipdh-family-blue { color: #2f80ff; }
.ipdh-family-orange { color: #ff8a22; }
.ipdh-family-green { color: #2ee59d; }
.ipdh-family-purple { color: #bd5cff; }
.ipdh-family-cyan { color: #38bdf8; }
.ipdh-family-slate { color: #cbd5e1; }

/* Titres sections */
.ipdh-eyebrow {
  margin: 0 0 10px;
  color: var(--ipdh-red);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.ipdh-group {
  margin-top: 52px;
}

.ipdh-group-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.ipdh-group h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -1.2px;
  font-weight: 950;
}

.ipdh-rail {
  margin-top: 34px;
}

.ipdh-rail + .ipdh-rail {
  padding-top: 8px;
}

.ipdh-rail-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 16px;
  padding-right: 8px;
}

.ipdh-rail h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(21px, 1.8vw, 28px);
  line-height: 1.12;
  letter-spacing: -.7px;
  font-weight: 920;
}

.ipdh-rail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ipdh-count {
  flex: 0 0 auto;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  color: #d8e0ec;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  font-size: 12px;
  font-weight: 900;
}

.ipdh-scroll-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 25px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
  transition: all .18s ease;
}

.ipdh-scroll-btn:hover {
  background: var(--ipdh-red2);
  border-color: var(--ipdh-red2);
  transform: translateY(-2px);
}

/* Rails plus denses */
.ipdh-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(155px, 185px);
  gap: 14px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 4px 6px 20px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.20) transparent;
  scroll-behavior: smooth;
}

.ipdh-row::-webkit-scrollbar {
  height: 8px;
}

.ipdh-row::-webkit-scrollbar-track {
  background: transparent;
}

.ipdh-row::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.18);
  border-radius: 999px;
}

.ipdh-card {
  min-width: 0;
  scroll-snap-align: start;
}

.ipdh-card-link {
  display: block;
  text-decoration: none;
  color: #fff;
}

/* Poster compact */
.ipdh-poster {
  position: relative;
  height: 248px;
  border-radius: 13px;
  overflow: hidden;
  background:
    radial-gradient(circle at 40% 30%, rgba(255,45,54,.16), transparent 35%),
    #111827;
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 18px 46px rgba(0,0,0,.33);
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}

.ipdh-card-link:hover .ipdh-poster {
  transform: translateY(-7px) scale(1.025);
  border-color: rgba(255,45,54,.62);
  box-shadow: 0 30px 78px rgba(0,0,0,.55), 0 0 0 1px rgba(255,45,54,.12);
}

.ipdh-poster img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform .32s ease, filter .32s ease;
}

.ipdh-card-link:hover .ipdh-poster img {
  transform: scale(1.075);
  filter: saturate(1.06) contrast(1.06);
}

.ipdh-poster-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 28%, rgba(0,0,0,.30) 54%, rgba(0,0,0,.78) 100%);
  transition: background .22s ease;
}

.ipdh-card-link:hover .ipdh-poster-shade {
  background:
    linear-gradient(180deg, rgba(0,0,0,.06) 18%, rgba(0,0,0,.54) 58%, rgba(0,0,0,.94) 100%),
    radial-gradient(circle at center, rgba(255,45,54,.12), transparent 64%);
}

/* Meta en haut pour ne plus gêner le titre */
.ipdh-mini-meta {
  position: absolute;
  left: 10px;
  top: 10px;
  display: flex;
  gap: 6px;
  z-index: 4;
}

.ipdh-mini-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  background: rgba(0,0,0,.58);
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .04em;
}

.ipdh-mini-meta span:first-child {
  background: var(--ipdh-red2);
}

/* Titre lisible, discret au repos, renforcé au survol */
.ipdh-card-title {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 5;
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.34));
  transform: translateY(0);
  opacity: .96;
  transition: background .22s ease, transform .22s ease;
}

.ipdh-card-link:hover .ipdh-card-title {
  background: rgba(0,0,0,.48);
  transform: translateY(-2px);
}

.ipdh-card-title h4 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 13px;
  line-height: 1.16;
  font-weight: 900;
  letter-spacing: -.15px;
  text-shadow: 0 2px 10px rgba(0,0,0,.72);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-transform: none;
}

.ipdh-card-title p {
  margin: 0;
  color: #fca5a5;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 900;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .22s ease, transform .22s ease;
}

.ipdh-card-link:hover .ipdh-card-title p {
  opacity: 1;
  transform: translateY(0);
}

/* Fallback PDF plus sobre */
.ipdh-pdf-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top, rgba(255,45,54,.22), transparent 42%),
    linear-gradient(135deg, #151c2b, #070b14);
}

.ipdh-pdf-fallback span {
  display: grid;
  place-items: center;
  width: 74px;
  height: 98px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #ff2d36, #9f0d18);
  font-size: 18px;
  font-weight: 950;
  letter-spacing: .06em;
  box-shadow: 0 24px 60px rgba(193,18,31,.32);
}

.ipdh-empty {
  margin: 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px dashed rgba(255,255,255,.14);
  color: var(--ipdh-muted);
  font-weight: 800;
}

.ipdh-no-results {
  display: none;
  margin: 36px 0 0;
  padding: 22px;
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  font-weight: 900;
}

.ipdh-no-results.is-visible {
  display: block;
}

@media (max-width: 1180px) {
  .ipdh-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .ipdh {
    padding: 0 12px 50px;
  }

  .ipdh-hero {
    min-height: auto;
    border-radius: 22px;
  }

  .ipdh-hero-content {
    padding: 34px 24px;
  }

  .ipdh-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
    padding: 0;
  }

  .ipdh-family {
    min-height: 92px;
  }

  .ipdh-rail-head {
    align-items: start;
    flex-direction: column;
  }

  .ipdh-rail-actions {
    width: 100%;
    justify-content: space-between;
  }

  .ipdh-row {
    grid-auto-columns: minmax(145px, 165px);
  }

  .ipdh-poster {
    height: 220px;
  }
}
