/* MTC "Serene Flow" - Main Stylesheet */

/* --- 1. Variables & Reset --- */
:root {
    /* Colors */
    --clr-primary: #0F4C5C;
    /* Deep Teal */
    --clr-secondary: #96C5B0;
    /* Sage Green */
    --clr-accent: #FF9F89;
    /* Soft Coral */
    --clr-bg: #FAFAF9;
    /* Warm Off-White */
    --clr-bg-alt: #EBF2F0;
    /* Light Sage tint for sections */
    --clr-text: #2C3E50;
    --clr-text-light: #6B7C93;
    --clr-white: #ffffff;

    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --spacer-sm: 1rem;
    --spacer-md: 2rem;
    --spacer-lg: 4rem;
    --spacer-xl: 6rem;

    /* Shape */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(15, 76, 92, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--clr-bg);
    color: var(--clr-text);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
    border-radius: var(--radius-sm);
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

/* --- 2. Typography --- */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--clr-primary);
    line-height: 1.2;
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: var(--spacer-md);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--clr-text-light);
}

.section-title {
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: var(--spacer-lg);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--clr-accent);
    border-radius: 2px;
}

.text-accent {
    color: var(--clr-accent);
}

/* --- 3. Utility Classes --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacer-sm);
}

.grid {
    display: grid;
    gap: var(--spacer-md);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-auto-rows: 300px;
    /* Increased height for content safety */
    grid-auto-flow: dense;
    gap: var(--spacer-md);
}

.card {
    background: var(--clr-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-body {
    padding: 1.5rem;
    /* Restored comfortable padding */
    flex: 0 0 auto;
    /* Content dictates size, never shrinks */
    z-index: 2;
    background: var(--clr-white);
}

.card-img {
    width: 100%;
    /* Default height for standard cards, but flexible */
    min-height: 130px;
    /* Reduced slightly to allow text space */
    flex: 1 1 auto;
    /* Fill remaining space */
    background-size: cover;
    background-position: center top;
    /* Focus on faces/tops */
}



/* Tall cards: Image simply stretches to fill huge vertical space */
.row-span-2 .card-img {
    height: auto;
}

.col-span-2 {
    grid-column: span 2;
}

/* Wide cards: Side-by-Side on Desktop */
@media (min-width: 768px) {
    .card.col-span-2 {
        flex-direction: row;
    }

    .card.col-span-2 .card-img {
        width: 50%;
        height: auto;
        min-height: 100%;
        /* Ensure full height coverage */
        flex: 0 0 50%;
    }

    .card.col-span-2 .card-body {
        width: 50%;
        flex: 0 0 50%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

.row-span-2 {
    grid-row: span 2;
}

@media (max-width: 768px) {

    .col-span-2,
    .row-span-2 {
        grid-column: auto;
        grid-row: auto;
    }
}

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

.section {
    padding: var(--spacer-xl) 0;
}

.bg-alt {
    background-color: var(--clr-bg-alt);
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--clr-accent);
    color: var(--clr-white);
    font-family: var(--font-heading);
    font-weight: 700;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: #ffb09c;
}

/* --- 4. Component: Header & Nav --- */
.header {
    height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0;
    object-fit: cover;
}

.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 76, 92, 0.8) 0%, rgba(15, 76, 92, 0.5) 100%);
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
    color: var(--clr-white);
    max-width: 800px;
}

.header-content h1 {
    color: var(--clr-white);
    margin-bottom: var(--spacer-md);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.navbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1.5rem 0;
    transition: 0.3s;
}

.navbar.scrolled {
    position: fixed;
    background: rgba(15, 76, 92, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-menu {
    display: flex;
    gap: 1.2rem;
}

.nav-link {
    color: var(--clr-white);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    white-space: nowrap;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.nav-link:hover {
    color: var(--clr-accent);
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--clr-primary);
        padding: 2rem;
        text-align: center;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .header h1 {
        font-size: 2.5rem;
    }
}

/* --- 5. Component: Cards --- */
.card {
    background: var(--clr-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.card-img {
    height: 220px;
    width: 100%;
    object-fit: cover;
}

.card-body {
    padding: var(--spacer-md);
}

/* --- 6. Specific Sections --- */

/* Intro (Pour Quoi) */
.list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.list-item {
    display: flex;
    align-items: center;
    background: var(--clr-white);
    padding: 1rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.list-icon {
    width: 30px;
    margin-right: 1rem;
}

/* Comment (Zig Zag) */
.feature-row {
    display: flex;
    flex-direction: column;
    gap: var(--spacer-md);
    margin-bottom: var(--spacer-xl);
}

@media (min-width: 768px) {
    .feature-row {
        flex-direction: row;
        align-items: center;
    }

    .feature-row:nth-child(even) {
        flex-direction: row-reverse;
    }

    .feature-row>* {
        flex: 1;
    }
}

/* Testimonials */
.scroller {
    display: flex;
    overflow-x: auto;
    gap: var(--spacer-md);
    padding-bottom: 2rem;
    scroll-snap-type: x mandatory;
}

.testimonial-card {
    min-width: 300px;
    background: var(--clr-white);
    padding: 2rem;
    border-radius: var(--radius-md);
    scroll-snap-align: center;
    box-shadow: var(--shadow-sm);
}

.testimonial-author {
    margin-top: 1rem;
    font-weight: 700;
    color: var(--clr-primary);
}

/* Contact */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacer-lg);
}

.contact-card h3 {
    color: var(--clr-accent);
}

.address-item {
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
}

/* Footer */
footer {
    background: var(--clr-primary);
    color: var(--clr-white);
    padding: var(--spacer-md) 0;
    text-align: center;
}

footer a {
    border-bottom: 1px dotted rgba(255, 255, 255, 0.5);
}

/* --- 7. Lightbox Specific --- */
.gallery-grid {
    columns: 3 300px;
    gap: 1rem;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    cursor: pointer;
}

.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-content {
    max-height: 90vh;
    max-width: 90vw;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* --- 8. Data Modals (Text Content) --- */
.text-modal {
    display: none;
    position: fixed;
    z-index: 1100;
    inset: 0;
    background: rgba(15, 76, 92, 0.95);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.text-modal.active {
    display: flex;
    opacity: 1;
}

.text-modal-content {
    background: white;
    padding: 3rem;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-md);
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.text-modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--clr-text-light);
    transition: color 0.2s;
}

.text-modal-close:hover {
    color: var(--clr-accent);
}

.article-card {
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s;
}

.article-card:hover {
    transform: translateY(-5px);
}

.article-card::after {
    content: '+ Lire la suite';
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 0.8rem;
    color: var(--clr-accent);
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.3s;
}

.article-card:hover::after {
    opacity: 1;
}

/* --- 9. Photo Filters --- */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--clr-primary);
    color: var(--clr-primary);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.3s;
    font-weight: 600;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--clr-primary);
    color: white;
}

.gallery-item {
    transition: opacity 0.3s, transform 0.3s;
}

.gallery-item.hide {
    display: none;
}