/* =========================================================
   Gallery Block Widget — gallery-block.css
   Mirrors the carousel.ae asymmetric service-grid layout
   ========================================================= */

/* ── Google Font: Cormorant Garamond (elegant serif italic) ── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&family=Jost:wght@300;400;500&display=swap');

/* ── Reset / Base ──────────────────────────────────────── */
.gbw-wrapper *,
.gbw-wrapper *::before,
.gbw-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Section Title ─────────────────────────────────────── */
.gbw-section-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.04em;
    text-align: center;
    margin-bottom: 30px;
}

/* ── Grid Container ────────────────────────────────────── */
.gbw-grid {
    display: grid;
    --gbw-row-h: 320px;
    grid-auto-rows: var(--gbw-row-h);
    gap: 6px;
    width: 100%;
}

/* ── Individual Item ───────────────────────────────────── */
.gbw-item {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: stretch;
}

/* Row / col spans — set via inline style in PHP */
.gbw-item[style*="grid-row: span 2"] { grid-row: span 2; }
.gbw-item[style*="grid-column: span 2"] { grid-column: span 2; }

/* ── Whole-card clickable (anchor as item) ─────────────── */
a.gbw-item--clickable {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}
a.gbw-item--clickable .gbw-link { pointer-events: none; }

/* ── Image-only item ───────────────────────────────────── */
.gbw-item.gbw-type-image_only,
.gbw-item.gbw-type-overlay_text {
    background: #1a1a1a;
}

.gbw-image-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gbw-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Hover Effects ─────────────────────────────────────── */
.gbw-hover-zoom .gbw-item:hover .gbw-image-wrap img {
    transform: scale(1.06);
}

.gbw-hover-darken .gbw-item:hover .gbw-image-wrap img {
    filter: brightness(0.75);
}

.gbw-hover-lighten .gbw-item:hover .gbw-image-wrap img {
    filter: brightness(1.15);
}

/* ── Text-only (label card) ────────────────────────────── */
.gbw-item.gbw-type-text_only {
    display: flex;
}

.gbw-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    width: 100%;
    height: 100%;
}

.gbw-text-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

/* ── Heading ───────────────────────────────────────────── */
.gbw-heading {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    line-height: 1.1;
    color: #ffffff;
    letter-spacing: 0.02em;
}

/* Dark card headings inherit white, light cards get dark text */
.gbw-item:not(.gbw-item--dark) .gbw-heading {
    color: #2c2c2c;
}

/* ── Subheading ────────────────────────────────────────── */
.gbw-subheading {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: clamp(0.7rem, 1.1vw, 0.85rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #888888;
}

.gbw-item--dark .gbw-subheading {
    color: rgba(255,255,255,0.65);
}

/* ── Link ──────────────────────────────────────────────── */
.gbw-link {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-decoration: none;
    color: #999999;
    margin-top: 8px;
    display: inline-block;
    transition: color 0.3s ease, letter-spacing 0.3s ease;
    position: relative;
}

.gbw-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.35s ease;
}

.gbw-link:hover::after { width: 100%; }
.gbw-link:hover { letter-spacing: 0.2em; }

.gbw-item--dark .gbw-link { color: rgba(255,255,255,0.5); }
.gbw-item--dark .gbw-link:hover { color: rgba(255,255,255,0.9); }

/* ── Overlay Text (image + text overlaid) ──────────────── */
.gbw-overlay-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 2;
    padding: 30px;
    text-align: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.4) 100%);
}

.gbw-overlay-heading {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.gbw-overlay-sub {
    color: rgba(255,255,255,0.8) !important;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.gbw-overlay-link {
    color: rgba(255,255,255,0.75) !important;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ── Below Grid CTA ────────────────────────────────────── */
.gbw-below-section {
    margin-top: 50px;
    text-align: center;
}

.gbw-below-text {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.8;
    color: #555555;
    max-width: 640px;
    margin: 0 auto 28px;
    font-style: italic;
}

.gbw-below-btn {
    display: inline-block;
    padding: 14px 42px;
    border: 1px solid #1a1a1a;
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    color: #1a1a1a;
    background: transparent;
    transition: background-color 0.35s ease, color 0.35s ease;
    cursor: pointer;
}

.gbw-below-btn:hover {
    background-color: #1a1a1a;
    color: #ffffff;
}

/* ── Watermark / branding stamp (optional, like carousel.ae) ── */
.gbw-stamp {
    display: block;
    font-family: 'Jost', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: currentColor;
    opacity: 0.4;
    margin-top: 14px;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES
   ═══════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
    .gbw-grid {
        --gbw-row-h: 260px;
    }

    /* Reset row spans on tablet to avoid orphaned tall cells */
    .gbw-item[style*="grid-row: span 2"] {
        grid-row: span 1;
    }

    .gbw-heading {
        font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    }
}

/* Mobile */
@media (max-width: 767px) {
    .gbw-grid {
        --gbw-row-h: 240px;
        gap: 4px;
    }

    /* Flatten all spans on mobile */
    .gbw-item[style*="grid-row: span 2"],
    .gbw-item[style*="grid-column: span 2"] {
        grid-row: span 1 !important;
        grid-column: span 1 !important;
    }

    .gbw-heading {
        font-size: 2rem;
    }

    .gbw-content {
        padding: 24px;
    }

    .gbw-below-btn {
        padding: 12px 30px;
        font-size: 0.75rem;
    }
}

/* ── Elementor editor helper ───────────────────────────── */
.elementor-widget-gbw_gallery_block .gbw-item {
    min-height: var(--gbw-row-h, 320px);
}
