/* Surcharges propres à IFPS, séparées de theme/guruma/css/style.css
   (celui-ci reste une copie fidèle du thème acheté). */

:root {
    --ifps-red: #e4002b;
    --ifps-red-dark: #a80020;
    --ifps-blue: #002d72;
    --ifps-blue-dark: #001c47;
}

/* La page d'accueil enchaîne beaucoup de sections avec le padding par
   défaut du thème (100px haut+bas) : deux sections adjacentes cumulent
   alors 200px de vide. On resserre à une valeur plus dense, cohérente sur
   tout le site (pas seulement l'accueil). */
.space-ptb {
    padding: 35px 0;
}

.space-pt {
    padding-top: 35px;
}

.space-pb {
    padding-bottom: 35px;
}

.space-sm-ptb {
    padding: 25px 0;
}

.space-sm-pt {
    padding-top: 25px;
}

.space-sm-pb {
    padding-bottom: 25px;
}

@media (max-width: 767px) {
    .space-ptb {
        padding: 25px 0;
    }

    .space-pt {
        padding-top: 25px;
    }

    .space-pb {
        padding-bottom: 25px;
    }
}

/* ==========================================================================
   Bandeau d'atouts (icône à gauche, texte à droite, hauteur réduite)
   ========================================================================== */
.ifps-strip {
    padding: 22px 0;
}

.ifps-strip-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 10px 15px;
}

.ifps-strip-item h4 {
    font-size: 1rem;
}

.ifps-strip-item p {
    font-size: 0.85rem;
    opacity: 0.9;
}

@media (max-width: 767px) {
    .ifps-strip-item {
        margin-bottom: 0.75rem;
    }
}

/* ==========================================================================
   Top bar (coordonnées + réseaux sociaux)
   ========================================================================== */
.ifps-topbar {
    background: var(--ifps-blue);
    color: #fff;
    font-size: 0.85rem;
    padding: 0.5rem 0;
}

.ifps-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ifps-topbar-infos {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.ifps-topbar-infos i {
    color: var(--ifps-red);
    margin-right: 0.35rem;
}

.ifps-topbar-infos a,
.ifps-topbar-infos span {
    color: #fff;
    text-decoration: none;
}

.ifps-topbar-social {
    display: flex;
    gap: 0.75rem;
}

.ifps-topbar-social a {
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: background 0.25s ease, transform 0.25s ease;
}

.ifps-topbar-social a:hover {
    background: var(--ifps-red);
    transform: translateY(-2px) scale(1.08);
}

@media (max-width: 767px) {
    .ifps-topbar-infos span:nth-child(1) {
        display: none;
    }
}

/* ==========================================================================
   Menu centré + barre de recherche (remplace le bouton "Demander un devis")
   ========================================================================== */
@media (min-width: 992px) {
    .ifps-nav-center {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
}

.ifps-search-form {
    display: flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    border-radius: 30px;
    overflow: hidden;
    background: #fff;
}

.ifps-search-form input {
    border: 0;
    padding: 0.5rem 1rem;
    outline: none;
    min-width: 180px;
    font-size: 0.9rem;
    background: transparent;
}

.ifps-search-form button {
    border: 0;
    background: var(--ifps-red);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    margin: 2px;
    transition: background 0.25s ease, transform 0.2s ease;
}

.ifps-search-form button:hover {
    background: var(--ifps-blue);
    transform: scale(1.08) rotate(-8deg);
}

/* ==========================================================================
   Ruban défilant des logos partenaires
   ========================================================================== */
.ifps-logo-ribbon {
    overflow: hidden;
    width: 100%;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.ifps-logo-ribbon-track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: ifps-marquee 28s linear infinite;
}

.ifps-logo-ribbon:hover .ifps-logo-ribbon-track {
    animation-play-state: paused;
}

.ifps-logo-ribbon-item {
    flex: 0 0 auto;
    padding: 0 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.ifps-logo-ribbon-item img {
    max-height: 50px;
    max-width: 140px;
    -webkit-filter: grayscale(1);
    filter: grayscale(1);
    opacity: 0.65;
    transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.ifps-logo-ribbon-item img:hover {
    -webkit-filter: grayscale(0);
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.08);
}

@keyframes ifps-marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ifps-logo-ribbon-track {
        animation: none;
    }
}

/* ==========================================================================
   Footer bleu
   ========================================================================== */
.ifps-footer-blue,
.ifps-footer-blue .space-ptb {
    background: var(--ifps-blue);
}

.ifps-footer-blue .footer-title {
    color: #fff;
}

.ifps-footer-blue p,
.ifps-footer-blue .contact-item,
.ifps-footer-blue .contact-item a,
.ifps-footer-blue .footer-link a {
    color: rgba(255, 255, 255, 0.75);
}

.ifps-footer-blue .contact-item i {
    color: var(--ifps-red);
}

.ifps-footer-blue .footer-link a:hover {
    color: #fff;
    padding-left: 4px;
}

.ifps-footer-blue .footer-bottom {
    background: var(--ifps-blue-dark);
    padding: 1rem 0;
}

.ifps-footer-blue .footer-bottom .copyright p {
    color: rgba(255, 255, 255, 0.7);
}

.ifps-footer-blue .social-icon-round a {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.ifps-footer-blue .social-icon-round a:hover {
    background: var(--ifps-red);
}

/* ==========================================================================
   Animations "survol" et "attraction" — thème sécurité / incendie
   ========================================================================== */

/* Fiches formation : légère élévation + zoom photo + liseré rouge qui glisse */
.course {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.course::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--ifps-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
    z-index: 2;
}

.course:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 30px rgba(0, 45, 114, 0.18);
}

.course:hover::before {
    transform: scaleX(1);
}

.course-img {
    overflow: hidden;
}

.course-img img {
    transition: transform 0.5s ease;
}

.course:hover .course-img img {
    transform: scale(1.08);
}

/* Catégories : zoom + voile rouge/bleu + icône propre au domaine au survol */
.categories {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

.categories img {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.categories-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
    background: linear-gradient(135deg, rgba(228, 0, 43, 0.8), rgba(0, 45, 114, 0.8));
    opacity: 0;
    transform: scale(0.8) rotate(-8deg);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.categories:hover img {
    transform: scale(1.12);
}

.categories:hover .categories-overlay {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Effet "scanner de sécurité" : un faisceau lumineux balaie la photo au survol
   (::after est utilisé ici — ::before est déjà pris par le thème pour le
   dégradé qui assure la lisibilité du titre en bas de chaque vignette). */
.categories::after,
.course .course-img::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, 0.55) 50%, transparent 60%);
    background-size: 250% 100%;
    background-position: 120% 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.categories:hover::after,
.course:hover .course-img::after {
    opacity: 1;
    animation: ifps-scan 1.1s ease;
}

@keyframes ifps-scan {
    from {
        background-position: 120% 0;
    }
    to {
        background-position: -20% 0;
    }
}

/* Icône "flamme" du domaine incendie : vacille légèrement au survol */
.ifps-cat-fire:hover .categories-overlay i {
    animation: ifps-flicker 0.9s ease-in-out infinite;
}

@keyframes ifps-flicker {
    0%, 100% {
        transform: scale(1) rotate(-2deg);
        opacity: 1;
    }
    25% {
        transform: scale(1.08) rotate(2deg);
        opacity: 0.9;
    }
    50% {
        transform: scale(0.96) rotate(-1deg);
        opacity: 1;
    }
    75% {
        transform: scale(1.05) rotate(3deg);
        opacity: 0.92;
    }
}

/* Boutons : effet "alerte" pulsée au survol */
.btn-primary {
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 6px rgba(228, 0, 43, 0.18);
}

/* Icônes de fonctionnalités : bascule + agrandissement au survol */
.feature-info-04,
.wayne-corp-service-box {
    transition: transform 0.3s ease;
}

.feature-info-04:hover,
.wayne-corp-service-box:hover {
    transform: translateY(-6px);
}

.feature-info-04 i,
.flaticon,
[class^="flaticon-"] {
    display: inline-block;
    transition: transform 0.35s ease, color 0.35s ease;
}

.feature-info-04:hover i {
    transform: scale(1.15) rotate(-6deg);
    color: #fff !important;
}

/* Variante compacte utilisée sur la section "Pourquoi choisir IFPS" de l'accueil */
.ifps-feature-sm {
    padding: 20px 15px;
}

.ifps-feature-sm h4 {
    font-size: 0.95rem;
}

.ifps-feature-sm p {
    font-size: 0.82rem;
    margin-bottom: 0;
}

/* Badge "attraction" façon gyrophare, pour mettre en avant un élément (Qualiopi, urgence, etc.) */
.ifps-pulse {
    position: relative;
}

.ifps-pulse::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--ifps-red);
    animation: ifps-siren 1.6s ease-out infinite;
}

@keyframes ifps-siren {
    0% {
        transform: scale(0.85);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Lecture vidéo : bouton play qui "respire" pour attirer le clic */
.popup-icon {
    transition: transform 0.3s ease;
}

.popup-icon:hover {
    transform: scale(1.12);
}

.ifps-play-btn {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--ifps-red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    animation: ifps-breathe 2.2s ease-in-out infinite;
}

@keyframes ifps-breathe {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(228, 0, 43, 0.45);
    }
    50% {
        box-shadow: 0 0 0 16px rgba(228, 0, 43, 0);
    }
}

/* Photos "positionnement" : léger zoom au survol des sections éditoriales */
.ifps-photo-frame {
    overflow: hidden;
    border-radius: 6px;
}

.ifps-photo-frame img {
    transition: transform 0.5s ease;
}

.ifps-photo-frame:hover img {
    transform: scale(1.05);
}

/* Hero vidéo YouTube en fond de section (page d'accueil) */
.hero-video-section {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero-video-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.hero-video-bg iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw; /* ratio 16:9 */
    min-height: 100%;
    min-width: 177.78vh; /* ratio 16:9 */
    transform: translate(-50%, -50%);
    border: 0;
}

.hero-video-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.55);
}

.hero-video-section .container {
    position: relative;
    z-index: 2;
}

@media (max-width: 767px) {
    .hero-video-section {
        min-height: 480px;
    }
}

/* ==========================================================================
   Compléments d'animation — survol du menu, CTA et cartes info
   ========================================================================== */

/* Menu : liseré rouge qui se déploie depuis le centre au survol/actif */
.header .navbar-nav .nav-link {
    position: relative;
}

.header .navbar-nav .nav-link::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 0;
    height: 2px;
    background: var(--ifps-red);
    transition: width 0.3s ease, left 0.3s ease;
}

.header .navbar-nav .nav-link:hover::after,
.header .navbar-nav .nav-link.active::after {
    width: 70%;
    left: 15%;
}

/* Bouton de recherche : petite secousse façon "alerte" au survol */
.ifps-search-form button:hover i {
    animation: ifps-shake 0.5s ease;
}

@keyframes ifps-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

/* Widget prix / CTA d'inscription : liseré pulsé façon signalétique de sécurité */
.widget-price {
    position: relative;
}

.widget-price .btn {
    position: relative;
    overflow: hidden;
}

.widget-price .btn:hover {
    animation: ifps-breathe 1.4s ease-in-out infinite;
}

/* Icônes de catégorie (mega-menu, listes) : petit sursaut au survol du lien */
.dropdown-item {
    transition: padding-left 0.25s ease, color 0.25s ease;
}

.dropdown-item:hover {
    padding-left: 1.6rem;
    color: var(--ifps-red);
}

/* Compteurs chiffrés : légère mise en avant au survol de leur bloc */
.counter {
    transition: transform 0.3s ease;
}

.counter:hover {
    transform: translateY(-4px);
}

.counter:hover .counter-number h3 {
    color: var(--ifps-red);
}

/* ==========================================================================
   Révélation des sections au scroll (voir public/js/ifps-reveal.js)
   ========================================================================== */
.ifps-animate {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.ifps-animate.in-view {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .ifps-animate {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ==========================================================================
   Bandeau d'en-tête de page (_page_banner.html.twig) : la classe
   "header-position" du thème compense déjà le header transparent en
   position absolute (qui flotte par-dessus et chevauchait le H1) ; on ajoute
   ici un peu de marge basse pour ne pas coller la section suivante.
   ========================================================================== */
.ifps-banner-spacing {
    padding-bottom: 90px;
}

@media (max-width: 767px) {
    .ifps-banner-spacing {
        padding-bottom: 60px;
    }
}

/* ==========================================================================
   Cartes actualités : forme uniforme, photo nette en fond, texte sur un
   panneau "verre dépoli" (flou local) pour rester lisible
   ========================================================================== */
.ifps-article-card {
    position: relative;
    display: block;
    height: 300px;
    border-radius: 10px;
    overflow: hidden;
    background-color: var(--ifps-blue);
    background-size: cover;
    background-position: center;
    text-decoration: none;
    isolation: isolate;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.ifps-article-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 30px rgba(0, 45, 114, 0.22);
}

/* Léger zoom de la photo au survol — l'image reste nette en tout temps,
   seul le panneau de texte ci-dessous est flouté pour rester lisible. */
.ifps-article-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    background-size: cover;
    background-position: center;
    transform: scale(1);
    transition: transform 0.6s ease;
    z-index: 0;
}

.ifps-article-card:hover::before {
    transform: scale(1.08);
}

.ifps-article-date {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    background: var(--ifps-red);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* Panneau "verre dépoli" : flou + assombrissement uniquement derrière le
   texte, pour que la photo reste visible sur le reste de la carte. */
.ifps-article-card-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 1.5rem 1.5rem 1.25rem;
    background: linear-gradient(180deg, rgba(0, 20, 51, 0) 0%, rgba(0, 20, 51, 0.55) 35%, rgba(0, 20, 51, 0.75) 100%);
    -webkit-backdrop-filter: blur(6px) saturate(1.2);
    backdrop-filter: blur(6px) saturate(1.2);
    transform: translateY(6px);
    transition: transform 0.35s ease, background 0.35s ease;
}

.ifps-article-card:hover .ifps-article-card-body {
    transform: translateY(0);
    background: linear-gradient(180deg, rgba(0, 20, 51, 0.1) 0%, rgba(0, 20, 51, 0.7) 35%, rgba(0, 20, 51, 0.88) 100%);
}

/* Navigateurs sans backdrop-filter (rares) : fond plus opaque en repli,
   pour garder le texte lisible même sans effet de flou. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .ifps-article-card-body {
        background: linear-gradient(180deg, rgba(0, 20, 51, 0.15) 0%, rgba(0, 20, 51, 0.88) 45%, rgba(0, 20, 51, 0.95) 100%);
    }
}

.ifps-article-badge {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ff9fae;
}

.ifps-article-title {
    color: #fff;
    margin: 0;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ifps-article-card:hover .ifps-article-title {
    color: #ffd7d7;
}
