/*
 * GAPphotos Gallery — Archive Index
 * Editorial aviation photo catalog; registration numbers as the signature element.
 */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Newsreader:ital,opsz,wght@0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,500&family=Space+Mono:wght@400;700&display=swap');

:root {
    --night: #060b12;
    --panel: #0d1420;
    --surface: #121b2a;
    --elevated: #1a2538;
    --signal: #5b9cf5;
    --signal-bright: #8bb8ff;
    --signal-dim: #3d7fd4;
    --text: #e6edf5;
    --muted: #7a8fa6;
    --line: rgba(91, 156, 245, 0.11);
    --line-strong: rgba(91, 156, 245, 0.24);
    --shadow: 0 24px 56px rgba(0, 0, 0, 0.42);
    --radius: 12px;
    --radius-lg: 16px;
    --mono: 'Space Mono', 'JetBrains Mono', ui-monospace, monospace;
    --display: 'Newsreader', 'Noto Serif SC', 'Songti SC', serif;
    --body: 'Manrope', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body.page-gallery {
    font-family: var(--body);
    background: var(--night);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    font-size: 0.9375rem;
    -webkit-font-smoothing: antialiased;
}

body.page-gallery::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 420px;
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.09) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

body.page-gallery::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(880px 400px at 8% 18%, rgba(96, 165, 250, 0.07), transparent 58%),
        radial-gradient(720px 340px at 92% 78%, rgba(59, 130, 246, 0.05), transparent 60%);
}

body.page-gallery > * { position: relative; z-index: 1; }

body.page-gallery ::selection {
    background: rgba(96, 165, 250, 0.35);
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    body.page-gallery *, body.page-gallery *::before, body.page-gallery *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.45);
    border-radius: 999px;
    border: 2px solid var(--night);
}
*::-webkit-scrollbar-track { background: rgba(8, 15, 26, 0.7); }

/* ── Navbar ── */
.navbar {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.97) 0%, rgba(8, 15, 26, 0.97) 100%) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
}

.navbar-brand {
    font-family: var(--display);
    font-weight: 700 !important;
    font-size: 1.35rem !important;
    letter-spacing: 0.03em;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.45rem 0.9rem !important;
    border-radius: 8px;
    margin: 0 0.1rem;
    transition: background 0.2s, color 0.2s;
}

.navbar-nav .nav-link:hover {
    background: rgba(96, 165, 250, 0.14) !important;
    color: var(--signal-bright) !important;
}

.navbar-nav .nav-link.active {
    background: rgba(96, 165, 250, 0.22) !important;
    color: #fff !important;
}

.navbar-toggler {
    border: 1px solid var(--line-strong) !important;
}

/* ── Flash alerts ── */
.alert {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow);
}

.alert-success { border-color: rgba(34, 197, 94, 0.35); }
.alert-danger { border-color: rgba(239, 68, 68, 0.35); }
.alert-warning { border-color: rgba(96, 165, 250, 0.35); }
.alert-info { border-color: rgba(96, 165, 250, 0.35); }

.btn-close {
    filter: invert(1) grayscale(1);
    opacity: 0.65;
}

/* ── Page shell ── */
.gl-main {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.75rem 1.35rem 3rem;
}

/* ── Masthead ── */
.gl-masthead {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem 3rem;
    align-items: end;
    padding-bottom: 1.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.gl-eyebrow {
    font-family: var(--mono);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--signal);
    margin-bottom: 0.55rem;
    display: block;
}

.gl-title {
    font-family: var(--display);
    font-size: clamp(2rem, 4vw, 2.65rem);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.08;
    color: var(--text);
}

.gl-lead {
    margin-top: 0.7rem;
    max-width: 34rem;
    font-size: 0.9375rem;
    color: var(--muted);
    line-height: 1.7;
}

.gl-masthead-stats {
    display: flex;
    gap: 1.75rem;
    margin: 0;
}

.gl-stat {
    text-align: right;
}

.gl-stat dt {
    font-family: var(--mono);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.gl-stat dd {
    font-family: var(--mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--signal-bright);
    letter-spacing: -0.02em;
    line-height: 1;
}

/* ── Search ── */
.gl-search-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.25rem;
    margin-bottom: 1.25rem;
}

.gl-search-label {
    font-family: var(--mono);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.65rem;
    display: block;
}

.gl-search-form {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.gl-search-input-wrap {
    flex: 1;
    min-width: min(100%, 280px);
    position: relative;
}

.gl-search-input-wrap i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.gl-search-input {
    width: 100%;
    font-family: var(--body);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gl-search-input::placeholder {
    color: var(--muted);
    font-weight: 400;
}

.gl-search-input:focus {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 3px rgba(91, 156, 245, 0.18);
}

.gl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--body);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
    white-space: nowrap;
}

.gl-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(91, 156, 245, 0.28);
}

.gl-btn--primary {
    background: rgba(91, 156, 245, 0.18);
    border-color: var(--line-strong);
    color: var(--signal-bright);
}

.gl-btn--primary:hover {
    background: rgba(91, 156, 245, 0.28);
    color: #fff;
}

.gl-btn--ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--muted);
}

.gl-btn--ghost:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

/* ── Filter toolbar ── */
.gl-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    padding: 0.95rem 1.15rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    position: sticky;
    top: 0.65rem;
    z-index: 20;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.gl-sort-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.gl-sort-label {
    font-family: var(--mono);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-right: 0.35rem;
}

.gl-sort-pill {
    font-family: var(--body);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    padding: 0.42rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.gl-sort-pill:hover {
    border-color: var(--line-strong);
    color: var(--signal-bright);
}

.gl-sort-pill.is-active {
    background: rgba(91, 156, 245, 0.14);
    border-color: var(--line-strong);
    color: var(--signal-bright);
}

.gl-category-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.gl-category-wrap label {
    font-family: var(--mono);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.gl-category-select {
    font-family: var(--body);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.45rem 2rem 0.45rem 0.75rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237a8fa6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    min-width: 140px;
    transition: border-color 0.2s;
}

.gl-category-select:focus {
    outline: none;
    border-color: var(--line-strong);
    box-shadow: 0 0 0 3px rgba(91, 156, 245, 0.18);
}

/* ── Active filter chips ── */
.gl-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
    align-items: center;
}

.gl-active-label {
    font-family: var(--mono);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-right: 0.25rem;
}

.gl-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--mono);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--signal-bright);
    background: rgba(91, 156, 245, 0.1);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    padding: 0.3rem 0.55rem;
    text-decoration: none;
    transition: background 0.2s;
}

.gl-filter-chip:hover {
    background: rgba(91, 156, 245, 0.18);
    color: #fff;
}

.gl-filter-chip i { font-size: 0.6rem; opacity: 0.75; }

/* ── Results meta ── */
.gl-results-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.15rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px dashed var(--line);
}

.gl-results-count {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.gl-results-count strong {
    color: var(--signal-bright);
    font-weight: 700;
}

.gl-page-indicator {
    font-family: var(--mono);
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}

/* ── Photo grid (boarding pass cards) ── */
.gl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
    gap: 1rem;
}

.gl-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s;
    position: relative;
    text-decoration: none;
    color: inherit;
    display: block;
}

.gl-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 2px;
    height: 100%;
    background: var(--signal);
    z-index: 2;
    opacity: 0.55;
}

.gl-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
}

.gl-card:hover::before { opacity: 1; }

.gl-card:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(91, 156, 245, 0.28);
}

.gl-card-img {
    position: relative;
    height: 168px;
    overflow: hidden;
}

.gl-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.gl-card:hover .gl-card-img img { transform: scale(1.06); }

.gl-card-badge {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    font-family: var(--mono);
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--signal-bright);
    background: rgba(8, 15, 26, 0.82);
    border: 1px solid var(--line);
    padding: 0.18rem 0.42rem;
    border-radius: 4px;
    z-index: 1;
}

.gl-card-cat {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text);
    background: rgba(8, 15, 26, 0.75);
    border: 1px solid var(--line);
    padding: 0.18rem 0.45rem;
    border-radius: 4px;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 1;
}

.gl-card-body {
    padding: 0.85rem 1rem 1rem;
    position: relative;
}

.gl-card-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 1rem;
    right: 1rem;
    border-top: 1px dashed var(--line);
}

.gl-card-reg {
    font-family: var(--mono);
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text);
    margin-bottom: 0.4rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gl-card-title {
    font-family: var(--display);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 0.45rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gl-card-details {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    margin-bottom: 0.5rem;
}

.gl-card-detail {
    font-size: 0.75rem;
    color: var(--muted);
}

.gl-card-footer {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    color: var(--muted);
    padding-top: 0.55rem;
    border-top: 1px solid var(--line);
}

/* ── Empty state ── */
.gl-empty {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
}

.gl-empty-icon {
    font-size: 2rem;
    color: var(--signal);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.gl-empty-title {
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.gl-empty-desc {
    font-size: 0.9375rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

/* ── Pagination ── */
.gl-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 2.25rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--line);
}

.gl-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.65rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--muted);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.gl-page-link:hover {
    border-color: var(--line-strong);
    color: var(--signal-bright);
}

.gl-page-link.is-active {
    background: rgba(91, 156, 245, 0.16);
    border-color: var(--line-strong);
    color: var(--signal-bright);
}

.gl-page-link.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.gl-page-ellipsis {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--muted);
    padding: 0 0.25rem;
}

/* ── Reveal animation ── */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.reveal-show {
    opacity: 1;
    transform: none;
}

/* ── Footer ── */
.airport-footer {
    margin-top: 2rem;
    background: linear-gradient(180deg, var(--surface) 0%, var(--night) 100%);
    color: var(--text);
    padding: 2.75rem 0 1.75rem;
    position: relative;
    border-top: 3px solid var(--signal);
}

.airport-footer::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 0; right: 0;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        var(--signal) 0,
        var(--signal) 36px,
        transparent 36px,
        transparent 52px
    );
    opacity: 0.5;
}

.footer-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.terminal-gates {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    color: var(--muted);
    text-decoration: none;
    padding: 1.25rem 1.75rem;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
    transition: transform 0.2s, border-color 0.2s, color 0.2s;
    min-width: 110px;
}

.gate:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    color: var(--signal-bright);
}

.gate i { font-size: 1.35rem; }
.gate span { font-size: 0.875rem; font-weight: 600; }

.footer-info {
    text-align: center;
}

.footer-info p {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0.25rem 0;
}

.footer-info a {
    color: var(--muted);
    text-decoration: none;
}

.footer-info a:hover { color: var(--signal-bright); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .gl-main { padding: 1.25rem 0.875rem 2.5rem; }

    .gl-masthead {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .gl-masthead-stats {
        justify-content: flex-start;
    }

    .gl-stat { text-align: left; }

    .gl-toolbar {
        position: static;
        flex-direction: column;
        align-items: stretch;
    }

    .gl-sort-group { justify-content: flex-start; }

    .gl-category-wrap {
        width: 100%;
    }

    .gl-category-select {
        flex: 1;
        width: 100%;
    }

    .gl-search-form { flex-direction: column; }

    .gl-btn { width: 100%; }

    .gl-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

    .gl-card-img { height: 148px; }

    .terminal-gates {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .gate { min-width: 0; width: 100%; padding: 1rem 0.75rem; }
}

@media (max-width: 480px) {
    .gl-title { font-size: 1.65rem; }

    .gl-grid { grid-template-columns: 1fr; }

    .gl-card-img { height: 180px; }

    .terminal-gates { grid-template-columns: 1fr; }
}
