/* Gallery page — Gallery section (US-GAL-02)
 *
 * Responsive photo-tile grid: three columns on desktop, two on tablet, one on
 * mobile. Each tile is a card with a fixed 4:3 brand-tinted visual, a category
 * tag, and a caption. Uses the project brand palette (#3b82f6 blue, #10b981
 * green, #f59e0b amber) and the Gallery page fonts (Inter headings / Roboto
 * body). Scoped under .gallery-grid so nothing leaks into the header nav.
 *
 * Motion is CSS-only (moderate: a gentle staggered fade/rise on load plus hover
 * lift) and fully disabled under prefers-reduced-motion.
 */

.gallery-grid {
    --gallery-blue: #3b82f6;
    --gallery-green: #10b981;
    --gallery-amber: #f59e0b;
    --gallery-ink: #1f2933;
    --gallery-muted: #556270;
    --gallery-surface: #ffffff;
    --gallery-border: #e4e8ee;

    background: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
    padding: clamp(3rem, 7vw, 5.5rem) 1.25rem;
}

.gallery-grid__inner {
    max-width: 1180px;
    margin: 0 auto;
}

/* ── Section header ─────────────────────────────────────────────── */
.gallery-grid__header {
    max-width: 680px;
    margin: 0 auto clamp(2rem, 5vw, 3.25rem);
    text-align: center;
}

.gallery-grid__eyebrow {
    margin: 0 0 0.75rem;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gallery-blue);
}

.gallery-grid__title {
    margin: 0 0 1rem;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(1.9rem, 4.5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--gallery-ink);
}

.gallery-grid__subtitle {
    margin: 0;
    font-family: 'Roboto', system-ui, sans-serif;
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--gallery-muted);
}

/* ── Grid ───────────────────────────────────────────────────────── */
.gallery-grid__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.25rem, 2.5vw, 1.75rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.gallery-grid__item {
    margin: 0;
}

.gallery-grid__figure {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--gallery-surface);
    border: 1px solid var(--gallery-border);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(31, 41, 51, 0.06);
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.gallery-grid__item:hover .gallery-grid__figure,
.gallery-grid__figure:focus-within {
    transform: translateY(-6px);
    box-shadow: 0 16px 34px rgba(31, 41, 51, 0.14);
}

/* Fixed-ratio visual area — brand-tinted "photo" placeholder */
.gallery-grid__media {
    position: relative;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.92);
    overflow: hidden;
}

/* Subtle diagonal texture over the tint so tiles don't read flat */
.gallery-grid__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.28), transparent 42%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 10px, transparent 10px 20px);
    pointer-events: none;
}

.gallery-grid__item--blue .gallery-grid__media {
    background: linear-gradient(135deg, #2563eb 0%, var(--gallery-blue) 60%, #60a5fa 100%);
}

.gallery-grid__item--green .gallery-grid__media {
    background: linear-gradient(135deg, #059669 0%, var(--gallery-green) 60%, #34d399 100%);
}

.gallery-grid__item--amber .gallery-grid__media {
    background: linear-gradient(135deg, #d97706 0%, var(--gallery-amber) 60%, #fbbf24 100%);
}

.gallery-grid__icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(2px);
    transition: transform 220ms ease;
}

.gallery-grid__item:hover .gallery-grid__icon {
    transform: scale(1.08);
}

/* ── Caption ────────────────────────────────────────────────────── */
.gallery-grid__caption {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem 1.35rem 1.4rem;
}

.gallery-grid__tag {
    align-self: flex-start;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gallery-ink);
    background: #eef2f7;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
}

.gallery-grid__item--blue .gallery-grid__tag {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.12);
}

.gallery-grid__item--green .gallery-grid__tag {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
}

.gallery-grid__item--amber .gallery-grid__tag {
    color: #b45309;
    background: rgba(245, 158, 11, 0.14);
}

.gallery-grid__text {
    font-family: 'Roboto', system-ui, sans-serif;
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--gallery-muted);
}

/* ── Motion: staggered reveal on load ───────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .gallery-grid__item {
        opacity: 0;
        transform: translateY(18px);
        animation: gallery-grid-reveal 560ms ease forwards;
        animation-delay: var(--gallery-delay, 0ms);
    }
}

@keyframes gallery-grid-reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .gallery-grid__list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .gallery-grid__list {
        grid-template-columns: 1fr;
    }
}
