/* ==========================================================================
   Accueil public - Lycée Technique Ibn Sina
   --------------------------------------------------------------------------
   Hero, cartes de decouverte et affinages de sections.
   Complementaire a style.css / versions.css / responsive.css / custom.css
   ========================================================================== */

/* ---------- Hero ---------- */
.home-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 255px;
    overflow: hidden;
    background: #0b1120;
    isolation: isolate;
}

.home-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    transform: scale(1.02);
    transition: transform .8s ease;
}

/* Le <picture> enveloppe l'image du hero et occupe toute la surface */
.home-hero > picture {
    position: absolute;
    inset: 0;
    z-index: -2;
    display: block;
}

.home-hero > picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.02);
    transition: transform .8s ease;
}

.home-hero:hover .home-hero__img,
.home-hero:hover > picture img { transform: scale(1.06); }

/* Photo du directeur */
.director-picture { display: inline-block; line-height: 0; }

.home-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(11, 17, 32, .30) 0%, rgba(11, 17, 32, .55) 45%, rgba(11, 17, 32, .92) 100%),
        linear-gradient(100deg, rgba(30, 58, 138, .85) 0%, rgba(59, 130, 246, .25) 55%, rgba(11, 17, 32, .10) 100%);
}

.home-hero__content {
    position: relative;
    padding: 1.5rem 0 1.6rem;
    width: 100%;
}

/* Disposition : titre a gauche, bouton a droite, sous-titre en dessous.
   Le bandeau est masque sur petit ecran (il passe sous le ticker d'annonces
   fixe, et le titre porte deja l'information). */
.home-hero__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "main btn"
        "sub  sub";
    align-items: center;
    gap: 10px 18px;
}

.home-hero__eyebrow { display: none; }
.home-hero__main    { grid-area: main; min-width: 0; }
.home-hero__sub     { grid-area: sub; }
.home-hero__btn     { grid-area: btn; width: auto; }

/* Libelle du bouton : icone seule sur petit ecran, texte a partir de 576px */
.home-hero__btn-full,
.home-hero__btn-short { display: none; }

.home-hero__eyebrow {
    display: none;
    align-items: center;
    gap: 7px;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .22);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.home-hero__eyebrow svg { width: 14px; height: 14px; }

.home-hero__title {
    color: #fff;
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.025em;
    margin: 0;
    max-width: 20ch;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}

.home-hero__sub {
    color: rgba(255, 255, 255, .88);
    font-size: .92rem;
    line-height: 1.5;
    max-width: 62ch;
    margin: 0;
}

.home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.home-hero__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    min-width: 46px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .18s ease, transform .12s ease, box-shadow .18s ease;
    -webkit-tap-highlight-color: transparent;
}

.home-hero__btn:hover {
    background: rgba(255, 255, 255, .26);
    color: #fff;
    transform: translateY(-2px);
}

.home-hero__btn:active { transform: scale(.97); }
.home-hero__btn svg { width: 17px; height: 17px; }

.home-hero__btn--solid {
    background: #fff;
    color: #1e3a8a;
    border-color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}

.home-hero__btn--solid:hover { background: #eef4ff; color: #1e3a8a; }

/* ---------- Cartes de decouverte ---------- */
.home-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e8ecf3;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .05);
    transition: transform .2s ease, box-shadow .22s ease, border-color .2s ease;
}

.home-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .13);
    border-color: #dbe3f0;
}

.home-card__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #eef2f7;
}

.home-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}

.home-card:hover .home-card__media img { transform: scale(1.06); }

.home-card__badge {
    position: absolute;
    left: 12px;
    top: 12px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .94);
    color: #1e3a8a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .18);
}

.home-card__badge svg { width: 20px; height: 20px; }

.home-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }

.home-card__title {
    font-size: 1.02rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: #0f172a;
}

.home-card__text { font-size: .87rem; color: #64748b; line-height: 1.55; margin: 0 0 14px; }

.home-card__link {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.home-card__link:hover { text-decoration: underline; }
.home-card__link svg { width: 14px; height: 14px; transition: transform .18s ease; }
.home-card__link:hover svg { transform: translateX(3px); }

/* ---------- Titres de section ---------- */
.home-section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.4rem;
    text-align: center;
}

.home-section-title::before,
.home-section-title::after {
    content: '';
    height: 2px;
    width: 46px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, #2563eb);
}

.home-section-title::after { background: linear-gradient(90deg, #2563eb, transparent); }

/* ---------- Encarts de l'etablissement ---------- */
.home-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border: 1px solid #e8ecf3;
    border-radius: 14px;
    padding: 16px 18px;
    height: 100%;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .05);
    transition: transform .18s ease, box-shadow .2s ease;
}

.home-feature:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(15, 23, 42, .1); }

.home-feature__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.home-feature__icon svg { width: 21px; height: 21px; }
.home-feature__title { font-size: .95rem; font-weight: 700; margin: 0 0 4px; color: #0f172a; }
.home-feature__text { font-size: .84rem; color: #64748b; margin: 0; line-height: 1.5; }

/* ==========================================================================
   Progressive enhancement
   ========================================================================== */
@media (min-width: 576px) {
    .home-hero__btn-short { display: inline; }
}

@media (min-width: 768px) {
    .home-hero { min-height: 345px; }
    .home-hero__content { padding: 2.2rem 0 2.4rem; }
    .home-hero__title { font-size: 2.4rem; }
    .home-hero__sub { font-size: 1rem; }
    .home-hero__btn-full { display: inline; }
    .home-hero__btn-short { display: none; }
    .home-section-title { font-size: 1.75rem; }

    /* Le bandeau revient sur sa propre ligne */
    .home-hero__inner {
        grid-template-areas:
            "eyebrow eyebrow"
            "main    btn"
            "sub     sub";
    }
    .home-hero__eyebrow {
        display: inline-flex;
        grid-area: eyebrow;
        justify-self: start;
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-hero__img, .home-card, .home-card__media img, .home-hero__btn, .home-card__link svg { transition: none !important; }
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .55);
    outline-offset: 2px;
}
