/* Montessence Collection v2.3 - Système de Grille 3 Colonnes avec Responsive Amélioré */
.montessence-collection-block {
    font-family: 'Garamond Comorant Medium';
    line-height: 1.6;
    width: 100%;
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    grid-auto-rows: minmax(400px, auto);
}

/* ==== SYSTÈME DE GRILLE 3 COLONNES AVEC ROW-SPAN ==== */

/* Colonnes avec span de 1, 2 ou 3 */
.montessence-column {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.column-span-1 {
    grid-column: span 1;
}

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

.column-span-3 {
    grid-column: span 3;
}

/* ==== ROW-SPAN : Colonnes sur plusieurs rangées ==== */

/* Colonne qui s'étend sur 2 rangées */
.row-span-2 {
    grid-row: span 2;
}

/* Combinaisons column-span + row-span */
.column-span-1.row-span-2 {
    grid-column: span 1;
    grid-row: span 2;
    min-height: 800px; /* 400px * 2 */
}

.column-span-2.row-span-2 {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 800px;
}

.column-span-3.row-span-2 {
    grid-column: span 3;
    grid-row: span 2;
    min-height: 800px;
}

/* ==== CARRÉS ==== */
.square {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    overflow: hidden;
    height: 100%;
}

/* Styles des carrés */
.square-style-light {
    background-color: #f8f6f3;
    color: #7d7164;
}

.square-style-brown {
    background-color: #7d7164;
    color: #fff;
}

.square-style-beige {
    background-color: #d4c4b0;
    color: #2e2e2e;
}

.square-style-white {
    background-color: #fff;
    color: #333;
}

.square-style-dark {
    background-color: #2e2e2e;
    color: #fff;
}

/* Image dans un carré */
.square-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 1;
}

/* Lien sur image carrée */
.square > a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: block;
}

.square:hover > a .square-image {
    opacity: 0.5;
    transition: opacity 0.3s ease-in-out;
}

.square:has(.square-image) {
    padding: 0;
}

.square:has(.square-image) .square-content {
    position: relative;
    z-index: 2;
    color: white;
    padding: 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 300px;
}

/* ==== CONTENU DES CARRÉS ==== */
.square-content {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Contenu Hero */
.hero-title {
    font-size: 4.5rem;
    font-weight: 300;
    margin: 0 0 15px 0;
    letter-spacing: -2px;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.4rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0 0 20px 0;
    font-weight: 400;
}

.hero-tagline {
    font-style: italic;
    font-size: 1.25rem;
    margin: 0;
    opacity: 0.8;
    text-align: center;
}

/* ==== NOUVEAU TYPE HERO_IMAGE ==== */
/* Logo/Image utilisé comme titre */
.hero-logo {
    width: 100%;
    height: auto;
    margin: 0 auto 25px auto;
    display: block;
    object-fit: contain;
}

/* Titre principal du hero_image (équivalent au subtitle du hero classique) */
.hero-image-title {
    font-size: 3.5rem;
    letter-spacing: 3px;
    margin: 0 0 20px 0;
    font-weight: 400;
    line-height: 1.3;
    text-align: center;
    color : #F2F0EB;
    font-family: 'Garamond Regular';
}

/* Le tagline est le même que pour hero classique, déjà défini ci-dessus */

/* Contenu Texte */
.text-title {
    font-family: 'Garamond Comorant';
    font-weight: bold;
    font-size: 2.2rem;
    font-weight: 400;
    margin: 0 0 20px 0;
    line-height: 1.3;
    text-align: left;
}

.text-content {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 25px;
    opacity: 0.9;
    flex-grow: 1;
    text-align: left;
}

.text-button {
    font-family: 'Garamond';
    background: none;
    border: none;
    font-size: 1.2rem;
    text-decoration: underline;
    cursor: pointer;
    color: inherit;
    padding: 0;
    margin-top: 40px;
    font-family: inherit;
    transition: opacity 0.3s ease;
    align-self: flex-end;
}

.text-button:hover {
    opacity: 0.7;
}

/* Contenu Citation */
.quote-text {
    font-family: 'Garamond';
    font-size: 1.8rem;
    line-height: 1.4;
    margin: 0 0 20px 0;
    font-weight: 300;
    quotes: """ """ "'" "'";
    text-align: center;
}

.quote-author {
    font-size: 1rem;
    font-style: normal;
    opacity: 0.8;
    margin-top: auto;
    display: block;
}

/* ==== IMAGE VERTICALE ==== */
.image-vertical-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Lien sur image verticale */
.image-vertical-container > a {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
}

.image-vertical-container > a:hover .vertical-image {
    transform: scale(1.05);
    transition: transform 0.5s ease;
}

.vertical-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
}

/* Overlay sur images */
.image-overlay {
    position: absolute;
    z-index: 3;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

.overlay-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.overlay-bottom-left {
    bottom: 40px;
    left: 40px;
}

.overlay-bottom-right {
    bottom: 40px;
    right: 40px;
    text-align: right;
}

.overlay-top-left {
    top: 40px;
    left: 40px;
}

.overlay-top-right {
    top: 40px;
    right: 40px;
    text-align: right;
}

.overlay-title {
    font-size: 2rem;
    font-weight: 300;
    margin: 0 0 10px 0;
    letter-spacing: -1px;
    line-height: 1.2;
}

.overlay-subtitle {
    font-size: 1rem;
    margin: 0;
    opacity: 0.9;
}

/* ==== RESPONSIVE AMÉLIORÉ ==== */

/* Tablettes (Portrait) - 1024px et moins */
@media (max-width: 1024px) {
    .montessence-collection-block {
        grid-template-columns: 1fr;
        gap: 0;
        grid-auto-rows: auto;
    }
    
    /* CRITIQUE: Forcer toutes les colonnes à prendre 1 seule colonne */
    .column-span-1,
    .column-span-2,
    .column-span-3 {
        grid-column: span 1 !important;
    }
    
    /* CRITIQUE: Désactiver complètement le row-span sur mobile */
    .row-span-2 {
        grid-row: span 1 !important;
    }
    
    /* Le row-span reste actif sur tablette */
    .row-span-2 {
        grid-row: span 2;
    }
    
    .montessence-column {
        min-height: 350px;
    }
    
    .square {
        padding: 35px 30px;
        min-height: 350px;
    }
    
    .hero-title {
        font-size: 3.5rem;
        letter-spacing: -1.5px;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
        letter-spacing: 2.5px;
    }
    
    .hero-tagline {
        font-size: 1.15rem;
    }
    
    .hero-logo {
        max-width: 900px;
        margin-bottom: 20px;
    }
    
    .hero-image-title {
        font-size: 2.2rem;
        letter-spacing: 2.5px;
    }
    
    .text-title {
        font-size: 2rem;
    }
    
    .text-content {
        font-size: 1.2rem;
    }
    
    .quote-text {
        font-size: 1.65rem;
    }
    
    .overlay-title {
        font-size: 1.8rem;
    }
    
    .overlay-bottom-left,
    .overlay-bottom-right,
    .overlay-top-left,
    .overlay-top-right {
        bottom: 30px;
        left: 30px;
        right: 30px;
        top: 30px;
    }
}

/* Mobile Landscape - 900px et moins */
@media (max-width: 900px) {
    
    .montessence-column {
        min-height: auto;
    }
    
    .square {
        padding: 40px 30px;
        min-height: auto;
    }
    
    /* Ajuster les hauteurs des images verticales */
    .image-vertical-container {
        min-height: 400px;
        max-height: 500px;
    }
    
    .vertical-image {
        object-fit: cover;
        object-position: center;
    }
    
    .hero-title {
        font-size: 3rem;
        letter-spacing: -1.2px;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        letter-spacing: 2.2px;
    }
}

/* Mobile Standard - 768px et moins */
@media (max-width: 768px) {
    .montessence-collection-block {
        grid-template-columns: 1fr;
        gap: 0;
        grid-auto-rows: auto;
    }
    
    /* CRITIQUE: S'assurer que tout est en une colonne */
    .column-span-1,
    .column-span-2,
    .column-span-3 {
        grid-column: span 1 !important;
    }
    
    .row-span-2 {
        grid-row: span 1 !important;
    }
    
    .montessence-column {
        min-height: auto;
    }
    
    .square {
        padding: 35px 25px;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 2.5rem;
        letter-spacing: -1px;
        margin-bottom: 12px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        letter-spacing: 2px;
        margin-bottom: 15px;
    }
    
    .hero-tagline {
        font-size: 1.1rem;
    }
    
    .hero-logo {
        max-width: 300px;
        margin-bottom: 18px;
    }
    
    .hero-image-title {
        font-size: 1.6rem;
        letter-spacing: 2px;
    }
    
    .text-title {
        font-size: 1.85rem;
        margin-bottom: 15px;
    }
    
    .text-content {
        font-size: 1.2rem;
        line-height: 1.7;
        margin-bottom: 20px;
    }
    
    .text-button {
        font-size: 1.1rem;
        margin-top: 25px;
    }
    
    .quote-text {
        font-size: 1.5rem;
        line-height: 1.5;
    }
    
    .quote-author {
        font-size: 0.95rem;
        margin-top: 15px;
    }
    
    /* Images verticales sur mobile */
    .image-vertical-container {
        min-height: 350px;
        max-height: 450px;
    }
    
    .vertical-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    .overlay-title {
        font-size: 1.6rem;
        letter-spacing: -0.5px;
    }
    
    .overlay-subtitle {
        font-size: 0.95rem;
    }
    
    .overlay-bottom-left,
    .overlay-bottom-right,
    .overlay-top-left,
    .overlay-top-right {
        bottom: 25px;
        left: 25px;
        right: 25px;
        top: 25px;
    }
    
    /* Uniformiser l'alignement des overlays sur mobile */
    .overlay-bottom-right,
    .overlay-top-right {
        text-align: left;
    }
}

/* Petit Mobile - 480px et moins */
@media (max-width: 480px) {
    .square {
        padding: 30px 20px;
    }
    
    .hero-title {
        font-size: 2.2rem;
        letter-spacing: -0.8px;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
        letter-spacing: 1.8px;
    }
    
    .hero-tagline {
        font-size: 1rem;
    }
    
    .hero-logo {
        max-width: 260px;
        margin-bottom: 15px;
    }
    
    .hero-image-title {
        font-size: 1.3rem;
        letter-spacing: 1.8px;
    }
    
    .text-title {
        font-size: 1.7rem;
    }
    
    .text-content {
        font-size: 1.2rem;
        line-height: 1.65;
    }
    
    .text-button {
        font-size: 1rem;
        margin-top: 20px;
    }
    
    .quote-text {
        font-size: 1.35rem;
        line-height: 1.5;
    }
    
    .quote-author {
        font-size: 0.9rem;
    }
    
    .image-vertical-container {
        min-height: 320px;
        max-height: 420px;
    }
    
    .overlay-title {
        font-size: 1.45rem;
    }
    
    .overlay-subtitle {
        font-size: 0.85rem;
    }
    
    .overlay-bottom-left,
    .overlay-bottom-right,
    .overlay-top-left,
    .overlay-top-right {
        bottom: 20px;
        left: 20px;
        right: 20px;
        top: 20px;
    }
}

/* Très Petit Mobile - 375px et moins */
@media (max-width: 375px) {
    .square {
        padding: 25px 18px;
    }
    
    .hero-title {
        font-size: 2rem;
        letter-spacing: -0.5px;
    }
    
    .hero-subtitle {
        font-size: 0.8rem;
        letter-spacing: 1.5px;
    }
    
    .hero-tagline {
        font-size: 0.95rem;
    }
    
    .hero-logo {
        max-width: 240px;
        margin-bottom: 12px;
    }
    
    .hero-image-title {
        font-size: 1.15rem;
        letter-spacing: 1.5px;
    }
    
    .text-title {
        font-size: 1.55rem;
    }
    
    .text-content {
        font-size: 1.2rem;
        line-height: 1.6;
    }
    
    .text-button {
        font-size: 0.95rem;
    }
    
    .quote-text {
        font-size: 1.2rem;
        line-height: 1.45;
    }
    
    .quote-author {
        font-size: 0.85rem;
    }
    
    .image-vertical-container {
        min-height: 300px;
        max-height: 380px;
    }
    
    .overlay-title {
        font-size: 1.3rem;
    }
    
    .overlay-subtitle {
        font-size: 0.8rem;
    }
    
    .overlay-bottom-left,
    .overlay-bottom-right,
    .overlay-top-left,
    .overlay-top-right {
        bottom: 18px;
        left: 18px;
        right: 18px;
        top: 18px;
    }
}

/* ==== TRANSITIONS ==== */
.text-button {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-logo {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==== ACCESSIBILITÉ ==== */
.text-button:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ==== CORRECTIONS SUPPLÉMENTAIRES POUR MOBILE ==== */

/* Éviter le débordement horizontal */
@media (max-width: 900px) {
    .montessence-collection-block {
        overflow-x: hidden;
        max-width: 100vw !important;
    }
    
    .montessence-column {
        max-width: 100%;
    }
    
    .square,
    .image-vertical-container {
        max-width: 100%;
    }
    
    /* S'assurer que les images ne débordent pas */
    .square-image,
    .vertical-image,
    .hero-logo {
        max-width: 100%;
        height: auto;
    }
    
    .square-image {
        height: 100%;
        width: 100%;
    }
}

/* Améliorer l'espacement du contenu sur mobile */
@media (max-width: 768px) {
    .square-content {
        align-items: center;
        width: 100%;
    }
    
    /* Éviter que le texte ne soit trop étendu */
    .text-content,
    .hero-tagline,
    .quote-text {
        max-width: 100%;
    }
}
