/* ═══════════════════════════════════════════════════════════════
   VINDHYA MILLETS — EDITORIAL GALLERY REDESIGN (gallery.php)
   Matches Reference Mockup: media_1788576410268.jpg
   ═══════════════════════════════════════════════════════════════ */

:root {
    --brand-forest: #143d28;
    --brand-forest-dark: #0d281a;
    --brand-amber: #e59838;
    --brand-terracotta: #c25e1a;
    --brand-cream: #faf8f5;
    --text-charcoal: #1c2b22;
    --border-soft: #e5dfd5;
}

/* ── 1. ORGANIC GALLERY HERO ────────────────────────────── */
.gallery-hero-organic {
    position: relative;
    width: 100%;
    min-height: 380px;
    background: linear-gradient(90deg, 
                #113722 0%, 
                rgba(17, 55, 34, 0.94) 34%, 
                rgba(17, 55, 34, 0.72) 55%, 
                rgba(17, 55, 34, 0.25) 75%, 
                rgba(0, 0, 0, 0.05) 100%), 
                url('../images/gallery-hero-millet.jpg') center right / cover no-repeat;
    padding: 38px 0 28px;
    color: #ffffff;
    overflow: hidden;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.ghero-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 3;
}

.ghero-left {
    max-width: 680px;
}

.ghero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    color: #ffffff;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.ghero-title {
    font-size: clamp(2.4rem, 4.8vw, 3.8rem);
    font-weight: 900;
    line-height: 1.15;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin: 0 0 12px 0;
}

.ghero-amber {
    color: var(--brand-amber);
}

.ghero-desc {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.55;
    margin: 0;
    max-width: 600px;
    font-weight: 400;
}

/* Right side badges & cursive watermark */
.ghero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    position: relative;
}

.ghero-cursive-stamp {
    font-family: 'Caveat', cursive;
    font-size: 2.3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.05;
    text-align: right;
    transform: rotate(10deg);
    pointer-events: none;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.ghero-stacked-pillars {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 8px 14px;
}

.ghero-stacked-pillars .leaf-ico {
    font-size: 1.4rem;
}

.ghero-stacked-text {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.35;
}

/* ── 2. CONTROLS TOOLBAR (PILLS & SEARCH) ───────────────── */
.gallery-controls-bar {
    background: #ffffff;
    border-bottom: 1.5px solid var(--border-soft);
    padding: 16px 0;
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.gcontrols-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    min-width: 0;
    width: 100%;
}

.gfilter-pills-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 8px;
    max-width: 100%;
    width: 100%;
    min-width: 0;
}

.gfilter-pills-row::-webkit-scrollbar {
    display: none;
}

.gcat-pill {
    background: #ffffff;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #2b3b31;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.gcat-pill .pill-ico {
    font-size: 0.95rem;
    line-height: 1;
}

.gcat-pill:hover {
    transform: translateY(-2px);
    border-color: var(--brand-forest);
    color: var(--brand-forest);
}

.gcat-pill.active {
    background: var(--brand-forest) !important;
    border-color: var(--brand-forest) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(20, 61, 40, 0.25) !important;
}

.gcontrols-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gsearch-pill {
    position: relative;
    width: 260px;
    display: flex;
    align-items: center;
}

.gsearch-pill .search-icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: #718096;
    pointer-events: none;
}

.gsearch-pill input {
    width: 100%;
    height: 42px;
    padding: 0 36px 0 40px;
    border-radius: 999px;
    border: 1.5px solid var(--border-soft);
    background: #faf8f5;
    font-size: 0.9rem;
    color: var(--text-charcoal);
    outline: none;
    transition: all 0.2s;
}

.gsearch-pill input:focus {
    background: #ffffff;
    border-color: var(--brand-forest);
    box-shadow: 0 0 0 3px rgba(20, 61, 40, 0.1);
}

.gsearch-clear {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    display: none;
    font-size: 0.9rem;
}

.gsearch-pill.has-val .gsearch-clear {
    display: block;
}

.gsort-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gsort-label {
    font-size: 0.88rem;
    color: #718096;
    font-weight: 500;
}

.gsort-select-pill {
    position: relative;
}

.gsort-select-pill select {
    appearance: none;
    -webkit-appearance: none;
    background: #ffffff;
    border: 1.5px solid var(--border-soft);
    border-radius: 999px;
    padding: 8px 34px 8px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-charcoal);
    cursor: pointer;
    outline: none;
}

.gsort-select-pill .sort-chev {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #718096;
}

/* ── 3. GALLERY PHOTO GRID (4 COLUMNS) ───────────────────── */
.gallery-main-wrap {
    background: var(--brand-cream);
    padding: 36px 0 70px;
    min-height: 700px;
}

.ggrid-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 28px;
}

.gallery-grid-4col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.gcard-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 270px;
    background: #EBF0EB;
    border: 1px solid rgba(22, 101, 52, 0.08);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gcard-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(22, 101, 52, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: rgba(22, 101, 52, 0.25);
}

.gcard-img-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    background: #EBF0EB;
}

.gcard-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

.gcard-item:hover .gcard-img {
    transform: scale(1.06);
}

.gcard-gradient-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
                transparent 0%, 
                transparent 55%, 
                rgba(0, 0, 0, 0.14) 75%, 
                rgba(0, 0, 0, 0.45) 100%);
    pointer-events: none;
    z-index: 2;
    transition: background 0.3s ease;
}

.gcard-item:hover .gcard-gradient-overlay {
    background: linear-gradient(180deg, 
                transparent 0%, 
                transparent 50%, 
                rgba(0, 0, 0, 0.18) 72%, 
                rgba(0, 0, 0, 0.52) 100%);
}

.gcard-top-icon {
    position: relative;
    z-index: 3;
    padding: 14px 16px;
    display: flex;
    justify-content: flex-end;
}

.gcard-badge-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #166534;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.gcard-item:hover .gcard-badge-icon {
    background: #166534;
    color: #ffffff;
    border-color: #166534;
    transform: scale(1.08);
}

.gcard-bottom-info {
    position: relative;
    z-index: 3;
    padding: 16px 18px;
    color: #ffffff;
}

.gcard-title {
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1.25;
    color: #ffffff;
    margin: 0 0 4px 0;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75), 0 2px 10px rgba(0, 0, 0, 0.5);
}

.gcard-tagline {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.94);
    line-height: 1.35;
    margin: 0;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* ── 4. LIGHTBOX MODAL ──────────────────────────────────── */
.gallery-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 18, 14, 0.92);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

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

.gmodal-box {
    position: relative;
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gmodal-img {
    max-width: 88vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.gmodal-caption {
    margin-top: 14px;
    color: #ffffff;
    text-align: center;
}

.gmodal-caption h4 {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 0 4px 0;
}

.gmodal-caption p {
    font-size: 0.88rem;
    color: #a0aec0;
    margin: 0;
}

.gmodal-close-btn {
    position: absolute;
    top: -46px;
    right: 0;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.gmodal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.gmodal-nav-btn:hover {
    background: #ffffff;
    color: #111111;
}

.gmodal-prev { left: -60px; }
.gmodal-next { right: -60px; }

/* ── 5. RESPONSIVE QUERIES ──────────────────────────────── */
@media (max-width: 1200px) {
    .gallery-grid-4col {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 860px) {
    .gallery-hero-organic {
        padding: 32px 0 24px;
        min-height: auto;
    }
    .ghero-inner {
        padding: 0 16px;
    }
    .ghero-title {
        font-size: 2.1rem;
    }
    .ghero-desc {
        font-size: 0.95rem;
    }
    .ghero-right {
        display: none !important;
    }
    .gcontrols-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 0 16px;
        gap: 12px;
    }
    .gcontrols-right {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
    }
    .gsearch-pill {
        flex: 1;
        width: auto;
        min-width: 0;
    }
    .gallery-grid-4col {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 20px 16px;
    }
}

@media (max-width: 580px) {
    .gallery-controls-bar {
        padding: 12px 0;
    }
    .gcontrols-right {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .gsearch-pill {
        width: 100%;
    }
    .gsort-wrap {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 8px;
    }
    .gsort-select-pill {
        flex: 1;
    }
    .gsort-select-pill select {
        width: 100%;
    }
    .gallery-grid-4col {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 16px 12px;
    }
    .gcard-item {
        height: 240px;
    }
    .gmodal-box {
        max-width: 95vw;
        max-height: 90vh;
    }
    .gmodal-img {
        max-width: 94vw;
        max-height: 65vh;
    }
    .gmodal-close-btn {
        top: -40px;
        right: 4px;
        font-size: 1.6rem;
    }
    .gmodal-nav-btn {
        width: 38px;
        height: 38px;
    }
    .gmodal-prev { left: 6px; }
    .gmodal-next { right: 6px; }
}
