/* ==========================================================================
   1. Polices locales (Roboto & Roboto Condensed)
   ========================================================================== */
@font-face {
    font-family: 'Roboto';
    src: url('../assets/fonts/Roboto-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('../assets/fonts/Roboto-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto Condensed';
    src: url('../assets/fonts/RobotoCondensed-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto Condensed';
    src: url('../assets/fonts/RobotoCondensed-SemiBold.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   2. Variables & Reset
   ========================================================================== */
:root {
    --via-groupe: #262626;
    --via-bg: #f7f3e9;
    --via-light: #757575;
    --via-strada: #fab31e;
    --via-bene: #fa6650;
    --via-prentis: #00756F;
    --via-card-bg: #ffffff;
    --via-shadow: 0 10px 30px rgba(38, 38, 38, 0.16);
    --via-shadow-hover: 0 16px 38px rgba(38, 38, 38, 0.32);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background-color: var(--via-bg);
    color: var(--via-groupe);
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   13. Bandeau supérieur pleine largeur (retour groupe)
   ========================================================================== */
.top-bar {
    position: relative;
    z-index: 3;
    width: 100%;
    background-color: var(--accent-color, var(--var-prentis));
    color: #ffffff;
    font-size: 0.875rem;
}

.top-bar-inner {
    min-height: 38px;
    display: flex;
    align-items: center;
}

.top-bar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    padding: 0.35rem 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.top-bar-link:hover {
    opacity: 0.88;
}

.top-bar-arrow {
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.top-bar-link:hover .top-bar-arrow {
    transform: translateX(-3px);
}

.top-bar-link:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
    border-radius: 3px;
}

/* ==========================================================================
   3. Mise en page principale
   ========================================================================== */
.page-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 3rem 1.5rem 2rem;
    overflow-x: hidden;
    z-index: 1;
}

.site-header,
.activities-section,
.site-footer {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1080px;
    text-align: center;
}

/* ==========================================================================
   4. En-tête (Logo & Accroche)
   ========================================================================== */
.main-logo {
    max-width: 380px;
    width: 100%;
    height: auto;
    margin: 0 auto 1.75rem;
    display: block;
}

.tagline {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 400;
    color: var(--via-light);
    margin-bottom: 1.25rem;
}

.intro-text {
    max-width: 620px;
    margin: 0 auto;
    font-size: 0.95rem;
    color: var(--via-groupe);
    line-height: 1.6;
}

/* ==========================================================================
   5. Section Nos activités & Cartes
   ========================================================================== */
.activities-section {
    margin: 3rem auto;
}

.section-title {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1.85rem;
    font-weight: 400;
    color: var(--via-groupe);
    margin-bottom: 2.5rem;
}

.cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    max-width: 960px;
    margin: 0 auto;
}

.activity-card {
    flex: 0 1 calc(33.333% - 1.34rem);
    min-width: 260px;
    background-color: var(--via-card-bg);
    border-radius: 6px;
    padding: 2.25rem 1.75rem 2rem;
    box-shadow: var(--via-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.activity-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--via-shadow-hover);
}

.card-logo-wrapper {
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.card-logo-wrapper img {
    max-width: 300px;
    max-height: 180px;
    width: auto;
    height: auto;
}

.card-description {
    font-size: 1.05rem;
    color: var(--via-groupe);
    line-height: 1.45;
    margin-bottom: 1.75rem;
    max-width: 220px;
}

/* ==========================================================================
   6. Boutons d'action
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 0.65rem 1.75rem;
    border-radius: 5px;
    color: #ffffff;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1.05rem;
    font-weight: 400;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: filter 0.2s ease, transform 0.15s ease;
}

.btn:hover {
    filter: brightness(1.08);
    transform: scale(1.03);
}

.btn:active {
    transform: scale(0.98);
}

.btn-prentis {
    background-color: var(--via-prentis);
    position:relative;
    &.actif:after {
        content:'*';
        width:1rem;
        height:1rem;
        overflow:hidden;
        font-size:1rem;
        padding-top:.1rem;
        line-height:1rem;
        text-align:center;
        border-radius:.5rem;
        background-color:#c03;
        color:white;
        position:absolute;
        top:-.5rem;
        right:-.5rem;
    }
}

.btn-bene {
    background-color: var(--via-bene);
}

.btn-strada {
    background-color: var(--via-strada);
}

/* ==========================================================================
   7. Pied de page & Illustrations latérales
   ========================================================================== */
.site-footer {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--via-light);
}

.bg-illustration {
    position: fixed;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    max-width: 640px;
    width: 24vw;
    height: auto;
}

.deco-left {
    left: 0;
    transform: scaleX(-1);
}

.deco-right {
    right: 0;
}

.deco-mobile {
    display:none;
}
/* ==========================================================================
   8. Responsive (Tablette & Mobile)
   ========================================================================== */
@media (max-width: 960px) {
    .cards-grid {
        gap: 1.5rem;
        max-width: 640px;
    }

    .activity-card {
        flex: 0 1 calc(50% - 0.75rem);
    }
    
    .bg-illustration {
        opacity: 0.25;
        width: 32vw;
    }
}

@media (max-width: 600px) {
    .page-wrapper {
        padding: 2rem 1rem 1.5rem;
    }

    .main-logo {
        max-width: 280px;
    }

    .activities-section {
        margin: 2rem auto;
    }

    .bg-illustration {
        display: none;
    }
    
    .deco-mobile {
        display:block;
        max-width:640px;
        width:60vw;
        align:center;
        position: relative;
        left: 50%;
        transform: translateX(-65%);
        margin-bottom: 3rem;
    }
}


/* ==========================================================================
   9. Couleurs thématiques par branche (sous-pages)
   ========================================================================== */
.page-prentis {
    --accent-color: var(--via-prentis);
}

.page-bene {
    --accent-color: var(--via-bene);
}

.page-strada {
    --accent-color: var(--via-strada);
}

.btn-accent {
    background-color: var(--accent-color, var(--via-prentis));
}

/* ==========================================================================
   10. Mise en page sous-page & bandes alternées
   ========================================================================== */
.subpage-wrapper {
    justify-content: flex-start;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
}

.container {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.subpage-header {
    position: relative;
    z-index: 2;
    width: 100%;
    text-align: center;
    padding: 0 1.5rem 2.25rem;
}

.brand-link {
    display: inline-block;
    text-decoration: none;
}

.subpage-logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
}

.subpage-tagline {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    font-weight: 400;
    color: var(--via-light);
    max-width: 720px;
    margin: 0 auto;
}

.subpage-main {
    position: relative;
    z-index: 2;
    width: 100%;
}

.feature-band {
    width: 100%;
    padding: 3rem 0;
}

.band-cream {
    background-color: transparent;
}

.band-gray {
    background-color: #D3D3D399;
    h2 {
        color:var(--via-prentis);
    }
}

.band-green {
    background-color: #00756F99;
}

.feature-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(280px, 1.15fr);
    align-items: center;
    gap: 3.5rem;
}

/* Inversion visuelle sur la seconde bande en conservant l'ordre logique du DOM */
.feature-row.is-reversed .feature-media {
    order: 2;
}

.feature-row.is-reversed .feature-content {
    order: 1;
    text-align:right;
}

.feature-media {
    display: flex;
    justify-content: center;
    align-items: center;
}

.feature-media img {
    max-width: 400px;
    width: 100%;
    height: auto;
    display: block;
}

.feature-content {
    text-align: left;
    max-width: 440px;
    justify-self: center;
}

.feature-text {
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--via-groupe);
    margin-bottom: 1.5rem;
}

.subpage-footer {
    position: relative;
    z-index: 2;
    margin-top: 0;
    padding: 2rem 0 2.5rem;
    background-color: #e6e6e6;
    text-align: center;
}

/* ==========================================================================
   11. Responsive sous-page (Tablette & Mobile)
   ========================================================================== */
@media (max-width: 820px) {
    .feature-row {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Sur mobile/tablette, on garde l'ordre naturel : illustration puis texte */
    .feature-row.is-reversed .feature-media {
        order: 0;
    }
    .feature-row.is-reversed .feature-content {
        order: 0;
        text-align:center;
    }

    .feature-row.is-reversed .feature-content {
        order: 0;
    }

    .feature-content {
        text-align: center;
        max-width: 520px;
    }

    .feature-media img {
        max-width: 280px;
    }
}
/* ==========================================================================
   12. Formulaire de contact (sous-pages)
   ========================================================================== */
.contact-band {
    width: 100%;
    padding: 3rem 0 ;
    border-top: 1px solid rgba(38, 38, 38, 0.08);
}

.contact-container {
    max-width: 720px;
}

.contact-title {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--via-groupe);
    text-align: center;
    margin-bottom: 0.5rem;
}

.contact-subtitle {
    text-align: center;
    font-size: 1.25rem;
    color: var(--via-light);
    margin-bottom: 2rem;
}

.contact-form {
    background-color: var(--via-card-bg);
    border-radius: 6px;
    padding: 2rem;
    box-shadow: var(--via-shadow);
    text-align: left;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--via-groupe);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid #d4d0c8;
    border-radius: 5px;
    background-color: #ffffff;
    color: var(--via-groupe);
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control::placeholder {
    color: #9a9a9a;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color, var(--via-prentis));
    box-shadow: 0 0 0 3px rgba(0, 117, 111, 0.14);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    /*
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    */
    text-align:center;
    margin-top: 0.5rem;
    .form-status {
        display:block;
    }
}

.form-submit {
    border: none;
    cursor: not-allowed;
    opacity: 0.6;
}

.form-submit:hover {
    filter: none;
    transform: none;
}

.form-status {
    font-size: 0.75rem;
    color: var(--via-light);
}

@media (max-width: 600px) {
    .subpage-logo {
        max-width: 230px;
    }

    .feature-band {
        padding: 2.25rem 0;
    }

    .subpage-footer {
        background-color: transparent;
        padding-bottom: 1.5rem;
    }
    .contact-form {
        padding: 1.35rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .contact-band.band-gray {
        background-color: transparent;
        border-top: none;
        padding-top: 1.5rem;
    }
}

/* ==========================================================================
   14. Pastille retour en haut de page
   ========================================================================== */
.scroll-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 4;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background-color: var(--accent-color, var(--via-prentis));
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(38, 38, 38, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, filter 0.2s ease;
    border: solid var(--via-bene) 3px;
    outline: solid var(--via-strada) 3px;
    -webkit-box-shadow: 0 0 2px 2px rgba(0,0,0,0.25);
    box-shadow: 0 0 2px 2px rgba(0,0,0,0.25);    
}

.scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top.is-visible:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
}

.scroll-top:focus-visible {
    outline: 2px solid var(--var-groupe);
    outline-offset: 3px;
}

.scroll-top-icon {
    font-size: 1.25rem;
    line-height: 1;
    font-weight: 700;
}

@media (max-width: 600px) {
    .scroll-top {
        right: 1rem;
        bottom: 1rem;
        width: 42px;
        height: 42px;
    }
}