/* ─────────────────────────────────────────────────────────────────────────
   LOOPS.CSS — Pages boucles (blog, formations, réalisations)
   Chargé conditionnellement via assets.php (is_page(['blog','formations','realisations']))
   ───────────────────────────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════
   LOOP — Hero, Recherche, Filtres, Pagination
   ═══════════════════════════════════════════════════════════════════════════ */

/* -- Loop Hero -- */
.loop-hero {
    padding-block: 80px 64px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.loop-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url(../../images/hero-background.png) no-repeat center center;
    background-size: 110%;
    opacity: .3;
    pointer-events: none;
}

.loop-hero--formations .section-label { color: var(--emerald-600); }
.loop-hero .container  { position: relative; z-index: 1; }
.loop-hero .section-label { margin-bottom: 10px; }
.loop-hero h1          { margin-bottom: 14px; font-weight: 700; }
.loop-hero > .container > p {
    font-size: 18px;
    color: var(--slate-600);
    max-width: 580px;
    margin-inline: auto;
    margin-bottom: 36px;
    line-height: 1.8;
}

/* -- Loop Hero — stats (formations) -- */
.loop-hero__stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
}
.loop-hero__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.loop-hero__stat strong {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--fushia-600);
    line-height: 1;
    letter-spacing: -0.5px;
}
.loop-hero--formations .loop-hero__stat strong { color: var(--emerald-600); }
.loop-hero__stat span    { font-size: 13px; color: var(--slate-500); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }

/* -- Loop Search -- */
.loop-search {
    display: flex;
    max-width: 500px;
    margin-inline: auto;
    background: var(--color-white);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.loop-search input {
    flex: 1;
    padding: 13px 16px;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 15px;
    background: transparent;
    color: var(--slate-900);
}
.loop-search input::placeholder { color: var(--slate-400); }
.loop-search button {
    flex-shrink: 0;
    padding: 0 18px;
    background: var(--fushia-600);
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    transition: background var(--transition);
}
.loop-search button:hover { background: var(--fushia-700); }

/* -- Result count -- */
.loop-result-count {
    font-size: 15px;
    color: var(--slate-500);
    margin-bottom: 28px;
}
.loop-result-count strong { color: var(--slate-900); }
.loop-result-count em     { color: var(--fushia-600); font-style: normal; font-weight: 600; }
.loop-result-count a      { color: var(--fushia-600); text-decoration: underline; text-underline-offset: 3px; }

/* -- Filter Bar -- */
.filter-bar {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding-block: 14px;
    position: sticky;
    top: 72px;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(26,30,60,.04);
    backdrop-filter: blur(8px);
}
.admin-bar .filter-bar { top: calc(72px + 32px); }
@media screen and (max-width: 782px) {
    .admin-bar .filter-bar { top: calc(72px + 46px); }
}
.filter-bar__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.filter-bar__label {
    font-size: 13px;
    font-weight: 700;
    color: var(--slate-500);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 4px;
}

/* -- Filter Pills -- */
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 99px;
    border: 1.5px solid var(--color-border);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--slate-700);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.filter-pill:hover {
    border-color: var(--fushia-600);
    color: var(--fushia-600);
    background: var(--fushia-50, #fdf4ff);
}
.filter-pill.is-active {
    background: var(--fushia-600);
    border-color: var(--fushia-600);
    color: #fff;
}
.filter-pill__count {
    font-size: 11px;
    opacity: .65;
}
.filter-pills-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* -- Loop Empty -- */
.loop-empty {
    text-align: center;
    padding-block: 80px;
    color: var(--color-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.loop-empty i { font-size: 56px; opacity: .3; line-height: 1; }
.loop-empty p { font-size: 18px; }

/* -- Pagination boucle -- */
.loop-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 52px;
    flex-wrap: wrap;
}
.loop-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding-inline: 8px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-border);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--slate-700);
    background: var(--color-white);
    transition: all var(--transition);
    text-decoration: none;
}
.loop-pagination .page-numbers:hover,
.loop-pagination .page-numbers.current {
    background: var(--fushia-600);
    border-color: var(--fushia-600);
    color: #fff;
}
.loop-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    min-width: 24px;
    cursor: default;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOOP INTRO & CTA BANNERS
   ═══════════════════════════════════════════════════════════════════════════ */

/* -- Loop Intro Banner -- */
.loop-intro {
    background: linear-gradient(135deg, var(--fushia-50, #fdf4ff) 0%, var(--blue-50, #eff6ff) 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    margin-bottom: 40px;
    font-size: 15px;
    color: var(--slate-700);
    line-height: 1.75;
}
.loop-intro strong { color: var(--slate-900); }
.loop-intro a { color: var(--fushia-600); font-weight: 600; text-decoration: none; }
.loop-intro a:hover { text-decoration: underline; }

/* -- Loop CTA -- */
.loop-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient(135deg, var(--color-dark, #0f172a) 0%, #2d1b69 100%);
    border-radius: var(--radius-lg);
    padding: 36px 44px;
    margin-top: 64px;
    flex-wrap: wrap;
}
.loop-cta__text h3 {
    color: #fff;
    font-size: clamp(1.2rem, 2.5vw, 1.45rem);
    margin-bottom: 6px;
    line-height: 1.3;
}
.loop-cta__text p {
    color: rgba(255,255,255,.65);
    font-size: 15px;
    margin: 0;
    line-height: 1.6;
}

/* -- Responsive Loops -- */
@media (max-width: 768px) {
    .loop-hero { padding-block: 56px 48px; }
    .loop-hero__stats { gap: 24px; padding-top: 28px; }
    .filter-bar { top: 72px; }
    .loop-search { max-width: 100%; }
    .loop-cta { flex-direction: column; align-items: flex-start; padding: 28px 24px; }
    .loop-intro { padding: 20px 20px; }
}
@media screen and (max-width: 668px) {
    .loop-hero { padding-block: 36px 28px; }
    .loop-hero > .container > p { font-size: 16px; margin-bottom: 24px; }
    .loop-hero__stats { gap: 16px; padding-top: 20px; margin-top: 24px; }
    .loop-hero__stat strong { font-size: 1.5rem; }
    .loop-cta { padding: 20px 16px; gap: 12px; }
    .loop-empty { padding: 32px 0; }
}
