/* ============================================================
   GALLERY PAGES — DEDICATED STYLESHEET
   Used by:  gallery.html (main folder index)
             gallery-event.html (inner per-event page)
   All NEW selectors use `gp-` prefix.
   Reuses .gallery-mosaic / .gcell-* styles from style.css for
   the homepage-style mosaic at the top of the main page.
============================================================ */

.gp-page { padding-top: 0; }


/* ============================================================
   PAGE HERO / BANNER (matches About / Departments / Blogs / Contact)
============================================================ */
.gp-hero {
    position: relative;
    padding: 200px 0 90px;
    background:
        linear-gradient(135deg,
            rgba(20, 68, 42, 0.92) 0%,
            rgba(13, 115, 119, 0.88) 60%,
            rgba(20, 68, 42, 0.94) 100%),
        radial-gradient(ellipse at top left, rgba(200, 147, 58, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse at bottom right, rgba(232, 185, 106, 0.18) 0%, transparent 55%),
        var(--green-deep);
    overflow: hidden;
    isolation: isolate;
}

.gp-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(45deg,
            transparent 0,
            transparent 38px,
            rgba(200, 147, 58, 0.06) 38px,
            rgba(200, 147, 58, 0.06) 40px);
    pointer-events: none;
    z-index: -1;
}

.gp-hero::after {
    content: "";
    position: absolute;
    right: -120px;
    top: -120px;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 147, 58, 0.18) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.gp-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 4%;
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
}

.gp-hero-arabic {
    font-family: 'Scheherazade New', 'Amiri', serif;
    direction: rtl;
    font-size: 1.7rem;
    color: var(--gold-light);
    margin-bottom: 14px;
    display: inline-block;
    animation: fadeUp 0.7s ease both;
}

.gp-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 18px;
}

.gp-hero-eyebrow span {
    display: inline-block;
    width: 38px;
    height: 1px;
    background: var(--gold-light);
}

.gp-hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.1rem, 5vw, 3.6rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 18px;
    color: var(--white);
}

.gp-hero-title em {
    font-style: italic;
    color: var(--gold-light);
}

.gp-hero-sub {
    max-width: 720px;
    margin: 0 auto 26px;
    font-size: 1.05rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.85);
}

.gp-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(232, 185, 106, 0.35);
    border-radius: 50px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    flex-wrap: wrap;
    justify-content: center;
}

.gp-breadcrumb a,
.gp-breadcrumb span {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.gp-breadcrumb a:hover { color: var(--gold-light); }
.gp-breadcrumb .crumb-sep { color: var(--gold-light); font-size: 0.7rem; }
.gp-breadcrumb .crumb-current { color: var(--gold-light); }

.gp-hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    line-height: 0;
    z-index: 3;
}

.gp-hero-wave svg {
    display: block;
    width: 100%;
    height: 60px;
}


/* ============================================================
   SECTION SHELL
============================================================ */
.gp-section {
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.gp-section.alt-bg { background: var(--parchment); }

.gp-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 4%;
    position: relative;
    z-index: 2;
}

.gp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 14px;
}

.gp-eyebrow span {
    display: inline-block;
    width: 34px;
    height: 1px;
    background: var(--gold);
}

.gp-section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 3.2vw, 2.4rem);
    font-weight: 700;
    color: var(--green-deep);
    line-height: 1.2;
    margin-bottom: 12px;
}

.gp-section-title em {
    font-style: italic;
    color: var(--primary-teal);
}

.gp-rule {
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 2px;
    margin-bottom: 22px;
}

.gp-section-sub {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-mid);
    max-width: 700px;
}

.gp-section-head {
    text-align: center;
    margin-bottom: 50px;
}

.gp-section-head .gp-rule { margin: 0 auto 22px; }
.gp-section-head .gp-section-sub { margin: 0 auto; }


/* ============================================================
   HIGHLIGHT MOSAIC (uses .gallery-mosaic from style.css)
   Just adds page-scoped tweaks
============================================================ */
.gp-page .gallery-mosaic {
    margin-top: 10px;
}

.gp-page .gcell { cursor: zoom-in; }

.gp-highlight-note {
    text-align: center;
    margin-top: 22px;
    font-size: 0.88rem;
    color: var(--text-soft);
    font-style: italic;
}


/* ============================================================
   FOLDER GRID — the centerpiece of the gallery system
============================================================ */
.gp-folders-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* The folder card itself — a real folder illusion */
.gp-folder {
    position: relative;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    color: inherit;
    transition: transform 0.4s ease;
    perspective: 800px;
}

.gp-folder:hover { transform: translateY(-10px); }

/* Folder "tab" — sticks up from the body */
.gp-folder-tab {
    width: 55%;
    height: 24px;
    background: linear-gradient(135deg, var(--gold), #b07f2c);
    border-radius: 10px 10px 0 0;
    position: relative;
    margin-left: 8px;
    box-shadow: inset 0 -3px 8px rgba(0, 0, 0, 0.1);
}

.gp-folder-tab::after {
    content: "";
    position: absolute;
    right: -16px;
    top: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 24px 16px;
    border-color: transparent transparent var(--gold) transparent;
}

.gp-folder:hover .gp-folder-tab,
.gp-folder:hover .gp-folder-tab::after {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

.gp-folder:hover .gp-folder-tab::after {
    border-color: transparent transparent var(--gold-light) transparent;
}

/* Folder body */
.gp-folder-body {
    position: relative;
    background: var(--white);
    border-radius: 0 14px 14px 14px;
    box-shadow:
        0 18px 40px -20px rgba(20, 68, 42, 0.35),
        0 0 0 1px var(--border);
    overflow: hidden;
    transition: box-shadow 0.4s ease;
}

.gp-folder:hover .gp-folder-body {
    box-shadow:
        0 26px 50px -20px rgba(20, 68, 42, 0.5),
        0 0 0 1px rgba(200, 147, 58, 0.5);
}

/* Folder "manila" texture — subtle diagonal lines */
.gp-folder-body::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(45deg,
            transparent 0,
            transparent 18px,
            rgba(200, 147, 58, 0.025) 18px,
            rgba(200, 147, 58, 0.025) 19px);
    pointer-events: none;
    z-index: 1;
}

/* Preview thumbnail */
.gp-folder-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--cream);
}

.gp-folder-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.gp-folder:hover .gp-folder-preview img {
    transform: scale(1.06);
}

.gp-folder-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(20, 68, 42, 0.55) 100%);
    pointer-events: none;
}

/* Photo-count badge */
.gp-folder-count {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(20, 68, 42, 0.85);
    color: var(--gold-light);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: 1px solid rgba(232, 185, 106, 0.35);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gp-folder-count i {
    font-size: 0.65rem;
}

/* "Stacked photos" effect — small thumbs peeking from corner */
.gp-folder-stack {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    gap: -10px;
    z-index: 2;
}

.gp-folder-stack-item {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 2px solid var(--white);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    margin-left: -10px;
    transition: transform 0.35s ease;
}

.gp-folder-stack-item:first-child { margin-left: 0; }

.gp-folder:hover .gp-folder-stack-item:nth-child(1) { transform: translateY(-4px) rotate(-3deg); }
.gp-folder:hover .gp-folder-stack-item:nth-child(2) { transform: translateY(-3px); }
.gp-folder:hover .gp-folder-stack-item:nth-child(3) { transform: translateY(-4px) rotate(3deg); }

/* Folder content area below preview */
.gp-folder-content {
    position: relative;
    z-index: 2;
    padding: 20px 22px 22px;
}

.gp-folder-cat {
    display: inline-block;
    font-size: 0.66rem;
    color: var(--gold);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 6px;
}

.gp-folder-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.18rem;
    color: var(--green-deep);
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 6px;
}

.gp-folder-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--text-mid);
    margin-bottom: 12px;
}

.gp-folder-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.gp-folder-meta i {
    color: var(--gold);
    font-size: 0.72rem;
}

.gp-folder-desc {
    font-size: 0.88rem;
    color: var(--text-mid);
    line-height: 1.65;
    margin: 0 0 16px;
}

.gp-folder-open {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-teal);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: gap 0.3s ease, color 0.3s ease;
}

.gp-folder:hover .gp-folder-open {
    gap: 12px;
    color: var(--gold);
}


/* ============================================================
   INNER EVENT PAGE — GRID
============================================================ */
.gp-event-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.gp-event-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    background: var(--cream);
    box-shadow: 0 8px 22px -16px rgba(20, 68, 42, 0.25);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.gp-event-tile.tile-wide { aspect-ratio: 2 / 1; grid-column: span 2; }
.gp-event-tile.tile-tall { aspect-ratio: 1 / 2; grid-row: span 2; }

.gp-event-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.gp-event-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 34px -16px rgba(20, 68, 42, 0.45);
}

.gp-event-tile:hover img { transform: scale(1.08); }

.gp-event-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(20, 68, 42, 0.5) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.gp-event-tile:hover::after { opacity: 1; }

.gp-event-tile-zoom {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--green-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.4s ease;
    pointer-events: none;
}

.gp-event-tile:hover .gp-event-tile-zoom {
    opacity: 1;
    transform: scale(1);
}

.gp-event-tile-caption {
    position: absolute;
    bottom: 12px;
    left: 14px;
    right: 60px;
    color: var(--white);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.4s ease;
    pointer-events: none;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.gp-event-tile:hover .gp-event-tile-caption {
    opacity: 1;
    transform: translateY(0);
}


/* ============================================================
   EVENT PAGE HEADER (stats strip below hero)
============================================================ */
.gp-event-meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin: -40px auto 30px;
    max-width: 900px;
    position: relative;
    z-index: 5;
}

.gp-event-meta-pill {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 10px 22px;
    font-size: 0.85rem;
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    box-shadow: 0 10px 30px -18px rgba(20, 68, 42, 0.4);
    font-weight: 600;
}

.gp-event-meta-pill i {
    color: var(--primary-teal);
    font-size: 0.85rem;
}

.gp-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-teal);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.05em;
    transition: gap 0.3s ease, color 0.3s ease;
    margin-bottom: 20px;
}

.gp-back-link:hover {
    color: var(--gold);
    gap: 12px;
}


/* Empty state when an event slug is unknown */
.gp-empty-event {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-mid);
}

.gp-empty-event i {
    font-size: 4rem;
    color: var(--gold);
    opacity: 0.55;
    margin-bottom: 18px;
}

.gp-empty-event h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--green-deep);
    margin-bottom: 8px;
}

.gp-empty-event p {
    font-size: 0.95rem;
    margin-bottom: 20px;
}


/* ============================================================
   LIGHTBOX
============================================================ */
.gp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(8, 18, 12, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: gpFadeIn 0.3s ease;
}

.gp-lightbox.active {
    display: flex;
}

@keyframes gpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gp-lightbox-stage {
    position: relative;
    max-width: 92vw;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gp-lightbox-img {
    max-width: 92vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    animation: gpZoomIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gpZoomIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.gp-lightbox-caption {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    padding: 0 20px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.gp-lightbox-counter {
    display: inline-block;
    margin-left: 12px;
    padding: 3px 12px;
    background: rgba(200, 147, 58, 0.25);
    border-radius: 20px;
    color: var(--gold-light);
    font-size: 0.8rem;
    font-weight: 700;
}

/* Lightbox controls */
.gp-lightbox-close,
.gp-lightbox-prev,
.gp-lightbox-next {
    position: fixed;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
}

.gp-lightbox-close:hover,
.gp-lightbox-prev:hover,
.gp-lightbox-next:hover {
    background: var(--gold);
    color: var(--green-deep);
    border-color: var(--gold);
    transform: scale(1.08);
}

.gp-lightbox-close {
    top: 22px;
    right: 22px;
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
}

.gp-lightbox-prev,
.gp-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    font-size: 1.2rem;
}

.gp-lightbox-prev:hover,
.gp-lightbox-next:hover {
    transform: translateY(-50%) scale(1.08);
}

.gp-lightbox-prev { left: 22px; }
.gp-lightbox-next { right: 22px; }

body.gp-lightbox-open {
    overflow: hidden;
}


/* ============================================================
   ANIMATION HELPERS
============================================================ */
.gp-anim {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.gp-anim.gp-visible {
    opacity: 1;
    transform: translateY(0);
}

.gp-anim-d1 { transition-delay: 0.1s; }
.gp-anim-d2 { transition-delay: 0.2s; }
.gp-anim-d3 { transition-delay: 0.3s; }
.gp-anim-d4 { transition-delay: 0.4s; }
.gp-anim-d5 { transition-delay: 0.5s; }


/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1100px) {
    .gp-folders-grid { grid-template-columns: repeat(2, 1fr); }
    .gp-event-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .gp-hero { padding: 110px 0 70px; }
    .gp-hero-arabic { font-size: 1.4rem; }
    .gp-section { padding: 60px 0; }

    .gp-folders-grid {
        grid-template-columns: 1fr;
        max-width: 460px;
        margin: 0 auto;
    }

    .gp-event-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gp-event-tile.tile-wide,
    .gp-event-tile.tile-tall {
        grid-column: auto;
        grid-row: auto;
        aspect-ratio: 1 / 1;
    }

    .gp-event-meta-strip {
        margin: -30px auto 26px;
        gap: 10px;
    }

    .gp-event-meta-pill {
        padding: 8px 16px;
        font-size: 0.78rem;
    }

    /* Lightbox on mobile */
    .gp-lightbox-prev,
    .gp-lightbox-next {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .gp-lightbox-prev { left: 12px; }
    .gp-lightbox-next { right: 12px; }

    .gp-lightbox-close {
        top: 14px;
        right: 14px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .gp-hero { padding: 100px 0 60px; }
    .gp-section { padding: 50px 0; }
    .gp-inner { padding: 0 5%; }

    .gp-event-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

    .gp-folder-content { padding: 18px 18px 20px; }
    .gp-folder-title { font-size: 1.05rem; }

    .gp-lightbox-caption {
        bottom: -42px;
        font-size: 0.82rem;
    }
}