/* ── Page layout ── */
      .gallery-page {
        max-width: 1080px;
        margin: 0 auto;
        padding: 48px 20px 80px;
      }

      /* ── Page hero ── */
      .page-hero {
        margin-bottom: 36px;
        animation: rpmc-fadeUp 0.4s var(--ease) both;
      }
      .page-hero-tag {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        padding: 5px 14px;
        border-radius: 100px;
        background: var(--accent-dim);
        border: 1px solid rgba(59, 130, 246, 0.25);
        font-family: "Space Mono", monospace;
        font-size: 0.62rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--accent-2);
        margin-bottom: 14px;
      }
      .page-hero h1 {
        font-family: "Outfit", sans-serif;
        font-size: clamp(1.6rem, 4vw, 2.2rem);
        font-weight: 800;
        color: var(--text);
        line-height: 1.15;
        margin-bottom: 10px;
      }
      .page-hero h1 span {
        background: linear-gradient(135deg, #f59e0b, #f472b6);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
      }
      .page-hero p {
        font-size: 0.92rem;
        color: var(--text-2);
        line-height: 1.6;
        max-width: 520px;
      }

      /* ── Toolbar ── */
      .gallery-toolbar {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 20px;
        flex-wrap: wrap;
        animation: rpmc-fadeUp 0.4s 0.08s var(--ease) both;
      }
      .gallery-search-wrap {
        flex: 1;
        min-width: 200px;
        position: relative;
      }
      .gallery-search-wrap i {
        position: absolute;
        left: 13px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.78rem;
        color: var(--text-3);
        pointer-events: none;
      }
      .gallery-search {
        width: 100%;
        padding: 10px 14px 10px 36px;
        border-radius: var(--r-sm);
        border: 1.5px solid var(--border-2);
        background: var(--surface);
        color: var(--text);
        font-family: "Baloo Da 2", "Outfit", sans-serif;
        font-size: 0.86rem;
        transition: all 0.2s;
      }
      .gallery-search::placeholder {
        color: var(--text-3);
      }
      .gallery-search:focus {
        outline: none;
        border-color: var(--accent);
        background: var(--surface-2);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
      }

      /* Albums link button */
      .albums-btn {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        padding: 9px 16px;
        border-radius: var(--r-sm);
        border: 1.5px solid var(--border-2);
        background: var(--surface);
        color: var(--text-2);
        font-size: 0.8rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        font-family: "Baloo Da 2", "Outfit", sans-serif;
        white-space: nowrap;
        flex-shrink: 0;
      }
      .albums-btn:hover {
        color: var(--gold);
        border-color: rgba(245, 158, 11, 0.4);
        background: rgba(245, 158, 11, 0.08);
      }
      .albums-btn i {
        color: var(--gold);
      }

      /* ── Category pills ── */
      .cat-pills {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        margin-bottom: 20px;
        animation: rpmc-fadeUp 0.4s 0.12s var(--ease) both;
      }
      .cat-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 7px 14px;
        border-radius: 100px;
        border: 1.5px solid var(--border-2);
        background: var(--surface);
        font-size: 0.74rem;
        font-weight: 700;
        color: var(--text-2);
        cursor: pointer;
        transition: all 0.18s;
        font-family: "Baloo Da 2", "Outfit", sans-serif;
        white-space: nowrap;
        user-select: none;
      }
      .cat-pill:hover {
        border-color: var(--border-active);
        color: var(--text);
        background: var(--surface-2);
      }
      .cat-pill.active {
        color: #fff;
        border-color: transparent;
      }
      .cat-pill[data-cat="all"].active {
        background: linear-gradient(135deg, var(--accent), var(--accent-2));
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
      }
      .cat-pill[data-cat="orientation"].active {
        background: linear-gradient(135deg, #7c3aed, #a78bfa);
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
      }
      .cat-pill[data-cat="sports-day"].active {
        background: linear-gradient(135deg, #dc2626, #f87171);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
      }
      .cat-pill[data-cat="cultural-night"].active {
        background: linear-gradient(135deg, #d97706, #fbbf24);
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
      }
      .cat-pill[data-cat="academic"].active {
        background: linear-gradient(135deg, #0891b2, #22d3ee);
        box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
      }
      .cat-pill[data-cat="hangouts"].active {
        background: linear-gradient(135deg, #059669, #34d399);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
      }
      .cat-pill[data-cat="miscellaneous"].active {
        background: linear-gradient(135deg, #475569, #94a3b8);
        box-shadow: 0 4px 12px rgba(148, 163, 184, 0.3);
      }
      .cat-pill i {
        font-size: 0.65rem;
      }
      .cat-count {
        font-family: "Space Mono", monospace;
        font-size: 0.6rem;
        background: rgba(255, 255, 255, 0.15);
        padding: 1px 6px;
        border-radius: 10px;
      }

      /* ── Sort bar ── */
      .sort-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20px;
        flex-wrap: wrap;
        gap: 8px;
        animation: rpmc-fadeUp 0.4s 0.16s var(--ease) both;
      }
      .sort-result-count {
        font-family: "Space Mono", monospace;
        font-size: 0.68rem;
        color: var(--text-3);
      }
      .sort-result-count span {
        color: var(--accent-2);
        font-weight: 700;
      }

      /* ── Photo grid — CSS columns masonry ── */
      .photo-grid {
        columns: 4 220px;
        column-gap: 12px;
        animation: rpmc-fadeIn 0.4s var(--ease) both;
      }

      /* ── Photo tile ── */
      .photo-tile {
        break-inside: avoid;
        margin-bottom: 12px;
        border-radius: var(--r-sm);
        overflow: hidden;
        position: relative;
        cursor: pointer;
        background: var(--surface-2);
        border: 1px solid var(--border);
        transition:
          transform 0.22s var(--ease),
          box-shadow 0.22s var(--ease),
          border-color 0.22s;
        animation: rpmc-fadeUp 0.4s var(--ease) both;
        display: block;
      }
      .photo-tile:hover {
        transform: translateY(-4px) scale(1.01);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
        border-color: var(--border-2);
        z-index: 2;
      }
      .photo-tile img {
        width: 100%;
        display: block;
        object-fit: cover;
        transition: transform 0.35s var(--ease);
        min-height: 120px;
        background: var(--surface-3);
      }
      .photo-tile:hover img {
        transform: scale(1.04);
      }

      /* Overlay on hover */
      .photo-tile-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(
          to top,
          rgba(0, 0, 0, 0.75) 0%,
          rgba(0, 0, 0, 0.2) 50%,
          transparent 100%
        );
        opacity: 0;
        transition: opacity 0.25s ease;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding: 14px 12px 12px;
      }
      .photo-tile:hover .photo-tile-overlay {
        opacity: 1;
      }
      .photo-tile-title {
        font-size: 0.8rem;
        font-weight: 700;
        color: #fff;
        line-height: 1.3;
        margin-bottom: 4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
      }
      .photo-tile-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
      }
      .photo-tile-cat {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-family: "Space Mono", monospace;
        font-size: 0.55rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: rgba(255, 255, 255, 0.8);
        background: rgba(0, 0, 0, 0.4);
        padding: 2px 8px;
        border-radius: 100px;
        border: 1px solid rgba(255, 255, 255, 0.15);
      }
      .photo-tile-expand {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.25);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 0.72rem;
        flex-shrink: 0;
        transition: background 0.2s;
      }
      .photo-tile:hover .photo-tile-expand {
        background: rgba(255, 255, 255, 0.3);
      }

      /* Image loading skeleton */
      .photo-tile img.loading {
        opacity: 0;
        transition: opacity 0.3s;
      }
      .photo-tile img.loaded {
        opacity: 1;
      }

      /* ── Empty / error ── */
      .gallery-empty {
        text-align: center;
        padding: 60px 20px;
        animation: rpmc-fadeUp 0.4s var(--ease) both;
      }
      .gallery-empty-icon {
        font-size: 2.8rem;
        color: var(--text-3);
        margin-bottom: 16px;
        display: block;
      }
      .gallery-empty h3 {
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-2);
        margin-bottom: 8px;
      }
      .gallery-empty p {
        font-size: 0.84rem;
        color: var(--text-3);
        line-height: 1.6;
      }

      /* ── Load more ── */
      .load-more-wrap {
        text-align: center;
        margin-top: 24px;
      }
      .load-more-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 24px;
        border-radius: var(--r-sm);
        border: 1.5px solid var(--border-2);
        background: var(--surface);
        color: var(--text-2);
        font-size: 0.82rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s;
        font-family: "Baloo Da 2", "Outfit", sans-serif;
      }
      .load-more-btn:hover {
        border-color: var(--border-active);
        background: var(--accent-dim);
        color: var(--accent-2);
      }

      /* ══════════════════════════════════════════
         LIGHTBOX
      ══════════════════════════════════════════ */
      .lightbox {
        position: fixed;
        inset: 0;
        z-index: 400;
        background: rgba(0, 0, 0, 0.96);
        display: flex;
        align-items: center;
        justify-content: center;
        animation: rpmc-fadeIn 0.2s ease both;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
      }

      /* Nav buttons */
      .lb-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.15);
        color: #fff;
        font-size: 1rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.18s;
        z-index: 2;
        backdrop-filter: blur(4px);
      }
      .lb-nav:hover {
        background: rgba(255, 255, 255, 0.22);
        transform: translateY(-50%) scale(1.1);
      }
      .lb-nav:disabled {
        opacity: 0.2;
        cursor: default;
      }
      .lb-nav:disabled:hover {
        transform: translateY(-50%) scale(1);
        background: rgba(255, 255, 255, 0.1);
      }
      .lb-prev {
        left: clamp(12px, 3vw, 32px);
      }
      .lb-next {
        right: clamp(12px, 3vw, 32px);
      }

      /* Close */
      .lb-close {
        position: absolute;
        top: 16px;
        right: 16px;
        z-index: 2;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #fff;
        font-size: 1rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.18s;
      }
      .lb-close:hover {
        background: rgba(244, 63, 94, 0.5);
        border-color: rgba(244, 63, 94, 0.5);
      }

      /* Counter */
      .lb-counter {
        position: absolute;
        top: 18px;
        left: 50%;
        transform: translateX(-50%);
        font-family: "Space Mono", monospace;
        font-size: 0.7rem;
        color: rgba(255, 255, 255, 0.5);
        z-index: 2;
        white-space: nowrap;
        pointer-events: none;
      }

      /* Image container */
      .lb-img-wrap {
        display: flex;
        align-items: center;
        justify-content: center;
        max-width: calc(100vw - 140px);
        max-height: calc(100vh - 140px);
        animation: rpmc-fadeIn 0.25s ease both;
      }
      .lb-img-wrap img {
        max-width: 100%;
        max-height: calc(100vh - 140px);
        object-fit: contain;
        border-radius: 10px;
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
        display: block;
        animation: rpmc-fadeIn 0.25s ease both;
      }
      .lb-spinner {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 3px solid rgba(255, 255, 255, 0.1);
        border-top-color: rgba(255, 255, 255, 0.7);
        animation: rpmc-spin 0.7s linear infinite;
      }

      /* Caption */
      .lb-caption {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 20px 80px 24px;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
        text-align: center;
        pointer-events: none;
      }
      .lb-caption-title {
        font-family: "Outfit", sans-serif;
        font-size: 0.96rem;
        font-weight: 700;
        color: #fff;
        margin-bottom: 4px;
        line-height: 1.3;
      }
      .lb-caption-sub {
        font-family: "Space Mono", monospace;
        font-size: 0.62rem;
        color: rgba(255, 255, 255, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        flex-wrap: wrap;
      }
      .lb-caption-sub span {
        display: flex;
        align-items: center;
        gap: 4px;
      }

      /* Albums panel hint */
      .lb-album-link {
        position: absolute;
        bottom: 72px;
        right: 16px;
        z-index: 2;
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 7px 14px;
        border-radius: var(--r-sm);
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.15);
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.72rem;
        font-weight: 600;
        text-decoration: none;
        transition: all 0.18s;
        pointer-events: auto;
        font-family: "Space Mono", monospace;
      }
      .lb-album-link:hover {
        background: rgba(245, 158, 11, 0.25);
        color: var(--gold);
        border-color: rgba(245, 158, 11, 0.3);
      }

      /* Keyboard hint */
      .lb-keys {
        position: absolute;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        font-family: "Space Mono", monospace;
        font-size: 0.58rem;
        color: rgba(255, 255, 255, 0.25);
        pointer-events: none;
        white-space: nowrap;
        display: flex;
        gap: 10px;
      }
      .lb-key {
        display: inline-flex;
        align-items: center;
        gap: 4px;
      }
      .lb-key kbd {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 4px;
        padding: 1px 5px;
        font-family: inherit;
        font-size: inherit;
      }

      /* ── Google Drive URL helper banner ── */
      .drive-tip {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 14px 16px;
        border-radius: var(--r-sm);
        background: rgba(245, 158, 11, 0.08);
        border: 1px solid rgba(245, 158, 11, 0.2);
        margin-bottom: 24px;
        font-size: 0.8rem;
        color: var(--text-2);
        line-height: 1.55;
        animation: rpmc-fadeUp 0.4s 0.2s var(--ease) both;
      }
      .drive-tip i {
        color: var(--gold);
        font-size: 0.9rem;
        flex-shrink: 0;
        margin-top: 2px;
      }
      .drive-tip code {
        font-family: "Space Mono", monospace;
        font-size: 0.72rem;
        background: rgba(0, 0, 0, 0.3);
        padding: 1px 6px;
        border-radius: 4px;
        color: var(--accent-2);
      }

      /* Responsive */
      @media (max-width: 768px) {
        .photo-grid {
          columns: 2 160px;
        }
        .lb-img-wrap {
          max-width: calc(100vw - 80px);
        }
        .lb-caption {
          padding: 16px 60px 20px;
        }
        .lb-keys {
          display: none;
        }
        .lb-album-link {
          bottom: 60px;
        }
      }
      @media (max-width: 480px) {
        .gallery-page {
          padding: 32px 12px 60px;
        }
        .photo-grid {
          columns: 2 120px;
          gap: 8px;
        }
        .photo-tile {
          margin-bottom: 8px;
        }
        .lb-nav {
          width: 38px;
          height: 38px;
          font-size: 0.85rem;
        }
        .lb-prev {
          left: 8px;
        }
        .lb-next {
          right: 8px;
        }
      }

