/**
 * Gutenberg Block Compatibility Styles
 * Ensures Gutenberg blocks work correctly with the theme
 */

/* =====================
   GUTENBERG CORE FIXES
====================== */

/* Remove default block spacing */
.wp-block-group {
    margin-block-start: 0;
    margin-block-end: 0;
}

/* Constrained layout */
.wp-block-group.alignfull {
    width: 100%;
}

/* Screen reader text */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* =====================
   HEADER COMPATIBILITY
====================== */

/* Map Gutenberg navigation to custom header styles */
.wp-block-group.header .wp-block-navigation {
    display: flex;
    gap: 8px;
}

.wp-block-group.header .wp-block-navigation-item a {
    text-decoration: none;
    color: var(--text-medium);
    font-size: 13px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 100px;
    transition: all 0.2s;
}

.wp-block-group.header .wp-block-navigation-item a:hover {
    background: var(--bg-soft);
    color: var(--text-dark);
}

.wp-block-site-title a {
    font-family: 'Syne', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.5px;
    text-decoration: none;
}

/* =====================
   BUTTON COMPATIBILITY
====================== */

.wp-block-button__link {
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* =====================
   COLUMNS & LAYOUT
====================== */

.wp-block-columns.benefits-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.wp-block-column.benefit-card {
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: 24px;
    padding: 32px 24px;
    transition: all 0.2s;
}

.wp-block-column.benefit-card:hover {
    border-color: var(--lime);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(139, 195, 74, 0.15);
}

.benefit-icon {
    margin-bottom: 16px !important;
}

/* About section columns */
.about-section .wp-block-columns {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 48px;
    align-items: center;
}

.about-image .wp-block-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

/* =====================
   POST TEMPLATE (Single)
====================== */

.wp-block-post-featured-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.wp-block-post-title {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.wp-block-post-date,
.wp-block-post-terms {
    margin: 0 !important;
}

/* Post content styling */
.wp-block-post-content {
    font-size: 16px;
    line-height: 1.8;
}

.wp-block-post-content p {
    margin-bottom: 1.5em;
}

.wp-block-post-content h2 {
    font-family: var(--wp--preset--font-family--heading);
    font-size: 32px;
    margin-top: 2em;
    margin-bottom: 0.5em;
}

.wp-block-post-content h3 {
    font-family: var(--wp--preset--font-family--heading);
    font-size: 24px;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

/* Related articles query */
.wp-block-query .wp-block-post-template {
    display: grid;
    gap: 16px;
}

.wp-block-query .wp-block-group.has-bg-soft-background-color {
    transition: all 0.2s;
}

.wp-block-query .wp-block-group.has-bg-soft-background-color:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* =====================
   HERO CAROUSEL - REMOVED
   All carousel styles now in main.css
====================== */

/* =====================
   GRADIENT BACKGROUNDS
====================== */

.has-lime-mint-gradient-background {
    background: linear-gradient(135deg, var(--lime) 0%, var(--mint) 100%);
}

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

@media (max-width: 1200px) {
    .wp-block-columns.benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .about-section .wp-block-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .wp-block-columns.benefits-grid {
        grid-template-columns: 1fr;
    }

    .carousel-slide.active {
        grid-template-columns: 1fr;
    }

    .wp-block-group.header .wp-block-navigation {
        display: none;
    }
}
