/**
 * CG Editorial Block Styles
 * Classes alignées avec le template PHP
 */

/* ==========================================================================
   Base Structure
   ========================================================================== */

.cg-editorial {
    position: relative;
    width: 100%;
}

/* Padding */
.cg-editorial--padding-none {
    padding-top: 0;
    padding-bottom: 0;
}

.cg-editorial--padding-small {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.cg-editorial--padding-medium {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.cg-editorial--padding-large {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.cg-editorial--padding-xlarge {
    padding-top: 8rem;
    padding-bottom: 8rem;
}

/* Background Colors */
.cg-editorial--bg-white {
    background-color: var(--cg-white);
}

.cg-editorial--bg-off-white {
    background-color: var(--cg-off-white);
}

.cg-editorial--bg-gray-light {
    background-color: #f0f0f0;
}

.cg-editorial--bg-black {
    background-color: var(--cg-black);
}

.cg-editorial--bg-gold {
    background-color: var(--cg-gold);
}

/* Text Colors */
.cg-editorial--text-dark {
    color: var(--cg-text);
}

.cg-editorial--text-dark .cg-editorial__titre {
    color: var(--cg-black);
}

.cg-editorial--text-light {
    color: rgba(255, 255, 255, 0.9);
}

.cg-editorial--text-light .cg-editorial__titre {
    color: var(--cg-white);
}

.cg-editorial--text-light .cg-editorial__surtitre {
    color: var(--cg-gold);
}

/* Container */
.cg-editorial .container {
    max-width: var(--cg-container-width, 1400px);
    margin: 0 auto;
    padding: 0 var(--cg-gutter, 20px);
}

.cg-editorial .container.container-narrow {
    max-width: 900px;
}

.cg-editorial .container.container-wide {
    max-width: 1600px;
}

.cg-editorial__full-width {
    width: 100%;
    padding: 0;
}

/* ==========================================================================
   Typography
   ========================================================================== */

.cg-editorial__surtitre {
    font-family: var(--cg-font-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--cg-gold);
    margin-bottom: 0.75rem;
    display: block;
}

.cg-editorial__titre {
    font-family: var(--cg-font-primary);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1.25rem;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.cg-editorial__contenu {
    font-size: 1rem;
    line-height: 1.8;
}

.cg-editorial__contenu p {
    margin-bottom: 1.25rem;
}

.cg-editorial__contenu p:last-child {
    margin-bottom: 0;
}

/* CTA */
.cg-editorial__cta {
    margin-top: 2rem;
}

.cg-editorial__cta--center {
    text-align: center;
}

/* ==========================================================================
   GRID LAYOUT - Image Left / Image Right (IMPORTANT!)
   ========================================================================== */

.cg-editorial__grid {
    display: grid;
    grid-template-columns: var(--col-1, 1fr) var(--col-2, 1fr);
    gap: 3rem;
    align-items: center;
}

/* Vertical alignment options */
.cg-editorial--valign-top .cg-editorial__grid {
    align-items: flex-start;
}

.cg-editorial--valign-center .cg-editorial__grid {
    align-items: center;
}

.cg-editorial--valign-bottom .cg-editorial__grid {
    align-items: flex-end;
}

/* Media (Image) */
.cg-editorial__media {
    position: relative;
    width: 100%;
}

.cg-editorial__media img {
    width: 100%;
    height: auto;
    display: block;
}

/* Image Styles */
.cg-editorial__media--rounded img {
    border-radius: var(--cg-radius-lg, 8px);
}

/* Placeholder d'image */
.cg-editorial__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 350px;
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 50%, #f0f0f0 100%);
    border-radius: 12px;
    border: 2px dashed #d0d0d0;
    color: #999999;
}

.cg-editorial__placeholder i {
    font-size: 3rem;
    opacity: 0.5;
}

.cg-editorial__placeholder span {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cg-editorial__media--shadow img {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.cg-editorial__media--framed {
    padding: 1rem;
    background: var(--cg-white);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.cg-editorial__media--framed img {
    border-radius: 0;
}

.cg-editorial__media--circle img {
    border-radius: 50%;
    aspect-ratio: 1;
    object-fit: cover;
}

/* Text Content */
.cg-editorial__text-content {
    width: 100%;
}

/* ==========================================================================
   STACKED LAYOUTS - Vertical
   ========================================================================== */

.cg-editorial__stacked {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.cg-editorial--layout-text_only .cg-editorial__stacked {
    max-width: 800px;
}

.cg-editorial--layout-image_top .cg-editorial__media,
.cg-editorial--layout-image_bottom .cg-editorial__media {
    max-width: 800px;
    margin: 0 auto;
}

/* ==========================================================================
   COLUMNS LAYOUTS
   ========================================================================== */

.cg-editorial__columns-layout {
    width: 100%;
}

.cg-editorial__header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.cg-editorial__contenu--header {
    margin-top: 1rem;
}

.cg-editorial__columns {
    display: grid;
    gap: 2rem;
}

.cg-editorial__columns--2 {
    grid-template-columns: repeat(2, 1fr);
}

.cg-editorial__columns--3 {
    grid-template-columns: repeat(3, 1fr);
}

.cg-editorial__column {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.cg-editorial__column-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cg-gold, #C9A227);
    border-radius: 50%;
    font-size: 1.75rem;
    color: var(--cg-black, #1a1a1a);
}

.cg-editorial__column-titre {
    font-family: var(--cg-font-primary, 'Playfair Display', serif);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--cg-black, #1a1a1a);
}

.cg-editorial__column-texte {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--cg-text, #4a4a4a);
}

/* Colonnes sur fond noir */
.cg-editorial--text-light .cg-editorial__column {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cg-editorial--text-light .cg-editorial__column-titre {
    color: #ffffff;
}

.cg-editorial--text-light .cg-editorial__column-texte {
    color: rgba(255, 255, 255, 0.85);
}

.cg-editorial--text-light .cg-editorial__column-texte p {
    color: rgba(255, 255, 255, 0.85);
}

/* ==========================================================================
   GALLERY GRID
   ========================================================================== */

.cg-editorial__gallery {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.cg-editorial__gallery--cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.cg-editorial__gallery--cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.cg-editorial__gallery--cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.cg-editorial__gallery-item {
    overflow: hidden;
    border-radius: var(--cg-radius, 4px);
}

.cg-editorial__gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cg-editorial__gallery-item:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   CHECKLIST
   ========================================================================== */

.cg-editorial__checklist {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
}

.cg-editorial__check-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.cg-editorial__check-item:last-child {
    border-bottom: none;
}

.cg-editorial__check-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cg-gold);
    border-radius: 50%;
    color: var(--cg-black);
    font-size: 0.75rem;
}

.cg-editorial__check-text {
    font-size: 1rem;
    line-height: 1.6;
    padding-top: 3px;
}

/* ==========================================================================
   IMAGE BACKGROUND
   ========================================================================== */

.cg-editorial--layout-image_background {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
}

.cg-editorial__bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.cg-editorial__bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.7);
}

.cg-editorial--layout-image_background .container {
    position: relative;
    z-index: 2;
}

.cg-editorial--layout-image_background .cg-editorial__stacked {
    max-width: 700px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.cg-editorial .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-family: var(--cg-font-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--cg-radius, 4px);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.cg-editorial .btn-primary {
    background-color: var(--cg-gold);
    color: var(--cg-black);
    border-color: var(--cg-gold);
}

.cg-editorial .btn-primary:hover {
    background-color: var(--cg-gold-light);
    border-color: var(--cg-gold-light);
}

.cg-editorial .btn-secondary {
    background-color: transparent;
    color: var(--cg-gold);
    border-color: var(--cg-gold);
}

.cg-editorial .btn-secondary:hover {
    background-color: var(--cg-gold);
    color: var(--cg-black);
}

.cg-editorial .btn-black {
    background-color: var(--cg-black);
    color: var(--cg-white);
    border-color: var(--cg-black);
}

.cg-editorial .btn-black:hover {
    background-color: var(--cg-gold);
    border-color: var(--cg-gold);
    color: var(--cg-black);
}

.cg-editorial .btn-white {
    background-color: var(--cg-white);
    color: var(--cg-black);
    border-color: var(--cg-white);
}

.cg-editorial .btn-white:hover {
    background-color: transparent;
    color: var(--cg-white);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 992px) {
    .cg-editorial__grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }
    
    /* Image en premier sur mobile pour image_left */
    .cg-editorial--layout-image_left .cg-editorial__grid {
        display: flex;
        flex-direction: column;
    }
    
    /* Texte en premier sur mobile pour image_right */
    .cg-editorial--layout-image_right .cg-editorial__grid {
        display: flex;
        flex-direction: column-reverse;
    }
    
    .cg-editorial__columns--3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cg-editorial__gallery--cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .cg-editorial--padding-large {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    
    .cg-editorial--padding-xlarge {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
    
    .cg-editorial__columns--2,
    .cg-editorial__columns--3 {
        grid-template-columns: 1fr;
    }
    
    .cg-editorial__gallery--cols-3,
    .cg-editorial__gallery--cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cg-editorial__column {
        padding: 1.5rem;
    }
    
    .cg-editorial__titre {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }
}

@media (max-width: 576px) {
    .cg-editorial__gallery--cols-2,
    .cg-editorial__gallery--cols-3,
    .cg-editorial__gallery--cols-4 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   ANIMATIONS - Fonctionnent automatiquement avec CSS
   ========================================================================== */

/* Par défaut visible */
.cg-editorial__media,
.cg-editorial__text-content,
.cg-editorial__stacked,
.cg-editorial__column,
.cg-editorial__columns-layout {
    opacity: 1;
    transform: translateY(0);
}

/* Animation au chargement */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cg-editorial--animated .cg-editorial__media {
    animation: fadeInUp 0.6s ease forwards;
}

.cg-editorial--animated .cg-editorial__text-content {
    animation: fadeInUp 0.6s ease 0.2s forwards;
}

.cg-editorial--animated .cg-editorial__stacked {
    animation: fadeInUp 0.6s ease forwards;
}

.cg-editorial--animated .cg-editorial__columns-layout {
    animation: fadeInUp 0.6s ease forwards;
}

/* Délais progressifs pour les colonnes */
.cg-editorial--animated .cg-editorial__column:nth-child(1) {
    animation: fadeInUp 0.6s ease 0.1s forwards;
}

.cg-editorial--animated .cg-editorial__column:nth-child(2) {
    animation: fadeInUp 0.6s ease 0.2s forwards;
}

.cg-editorial--animated .cg-editorial__column:nth-child(3) {
    animation: fadeInUp 0.6s ease 0.3s forwards;
}

/* ==========================================================================
   GUTENBERG EDITOR
   ========================================================================== */

.editor-styles-wrapper .cg-editorial {
    margin: 20px 0;
}

.editor-styles-wrapper .cg-editorial__grid {
    display: grid;
    grid-template-columns: var(--col-1, 1fr) var(--col-2, 1fr);
    gap: 2rem;
}

.editor-styles-wrapper .cg-editorial__media,
.editor-styles-wrapper .cg-editorial__text-content,
.editor-styles-wrapper .cg-editorial__stacked,
.editor-styles-wrapper .cg-editorial__column {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}
