/* ══════════════════════════════════════════
   gallery.html — page-specific styles
══════════════════════════════════════════ */
/* ── Filter Tabs ── */
    .filter-tabs {
      display: flex;
      gap: 0.5rem;
      flex-wrap: wrap;
      margin-bottom: 2.5rem;
    }

    .tab-btn {
      padding: 8px 18px;
      border-radius: 30px;
      border: 1px solid var(--border-color);
      background: var(--bg-elevated);
      color: var(--text-secondary);
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      transition: var(--transition);
    }

    .tab-btn:hover {
      border-color: var(--purple-bright);
      color: var(--purple-light);
    }

    .tab-btn.active {
      background: linear-gradient(135deg, var(--purple-main), var(--purple-bright));
      border-color: transparent;
      color: white;
    }

    /* ── Masonry-style Grid ── */
    .gallery-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1.25rem;
    }

    .gallery-item {
      position: relative;
      border-radius: var(--radius-lg);
      overflow: hidden;
      border: 1px solid var(--border-color);
      cursor: pointer;
      transition: var(--transition);
      background: var(--bg-card);
      display: flex;
      flex-direction: column;
    }

    .gallery-item:hover {
      border-color: var(--border-glow);
      transform: translateY(-3px);
      box-shadow: 0 12px 40px rgba(94,53,177,0.3);
    }

    .gallery-item.hidden { display: none; }

    .gallery-img-wrap {
      position: relative;
      overflow: hidden;
      aspect-ratio: 4/3;
      flex-shrink: 0;
    }

    .gallery-img-wrap img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
      display: block;
      transition: transform 0.4s ease;
    }

    .gallery-item:hover .gallery-img-wrap img {
      transform: scale(1.04);
    }

    .gallery-zoom-icon {
      position: absolute;
      top: 10px;
      right: 10px;
      background: rgba(0,0,0,0.65);
      border: 1px solid rgba(255,255,255,0.15);
      border-radius: 7px;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.8rem;
      color: white;
      opacity: 0;
      transition: var(--transition);
    }

    .gallery-item:hover .gallery-zoom-icon { opacity: 1; }

    .gallery-card-footer {
      padding: 0.85rem 1rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      border-top: 1px solid var(--border-color);
    }

    .gallery-card-title {
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .gallery-category {
      font-size: 0.7rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: var(--purple-light);
      background: rgba(124,77,255,0.12);
      border: 1px solid rgba(124,77,255,0.25);
      border-radius: 4px;
      padding: 2px 7px;
      white-space: nowrap;
      flex-shrink: 0;
    }

    /* ── 3D Model Viewer section ── */
    #section-3d { display: none; }
    #section-3d.visible { display: block; }
    #section-gallery { display: block; }
    #section-gallery.hidden { display: none; }

    .model-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 1.5rem;
      margin-bottom: 2rem;
    }

    .model-card {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      overflow: hidden;
      transition: var(--transition);
    }

    .model-card:hover {
      border-color: var(--border-glow);
      box-shadow: 0 12px 40px rgba(94,53,177,0.25);
      transform: translateY(-3px);
    }

    model-viewer {
      width: 100%;
      height: 300px;
      background: linear-gradient(135deg, var(--bg-surface), var(--bg-elevated));
      --poster-color: transparent;
    }

    .model-card-body {
      padding: 1.1rem 1.25rem 1.25rem;
    }

    .model-card-title {
      font-weight: 700;
      font-size: 0.95rem;
      margin-bottom: 0.3rem;
    }

    .model-card-meta {
      font-size: 0.78rem;
      color: var(--text-muted);
      display: flex;
      gap: 0.85rem;
      flex-wrap: wrap;
      margin-top: 0.5rem;
    }

    .model-card-meta span {
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .model-controls-hint {
      font-size: 0.72rem;
      color: var(--text-muted);
      text-align: center;
      padding: 0.6rem;
      background: var(--bg-elevated);
      border-top: 1px solid var(--border-color);
      display: flex;
      justify-content: center;
      gap: 1.25rem;
    }

    .model-controls-hint span {
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .ar-btn {
      display: none; /* shown only on AR-capable devices */
    }

    /* model-viewer built-in controls — restyle */
    model-viewer::part(default-ar-button) {
      display: none;
    }

    /* ── Lightbox ── */
    .lightbox {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.92);
      z-index: 2000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 2rem;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
    }

    .lightbox.open {
      opacity: 1;
      pointer-events: all;
    }

    .lightbox-inner {
      max-width: 900px;
      width: 100%;
      max-height: calc(100vh - 4rem);
      display: grid;
      grid-template-columns: 1fr 300px;
      gap: 0;
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      overflow: hidden;
    }

    .lightbox-img {
      width: 100%;
      overflow: hidden;
      min-height: 200px;
    }

    .lightbox-img img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .lightbox-info {
      padding: 2rem;
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      max-height: calc(100vh - 4rem);
    }

    .lightbox-title { font-size: 1.25rem; margin-bottom: 0.5rem; }
    .lightbox-cat {
      color: var(--purple-light);
      font-size: 0.78rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 2px;
      margin-bottom: 1rem;
    }
    .lightbox-desc { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.7; }

    .lightbox-meta {
      margin-top: 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }

    .lightbox-meta-row {
      display: flex;
      justify-content: space-between;
      font-size: 0.82rem;
      padding: 0.4rem 0;
      border-bottom: 1px solid var(--border-color);
    }

    .lightbox-meta-row span:first-child { color: var(--text-muted); }
    .lightbox-meta-row span:last-child { font-weight: 600; }

    .lightbox-actions { margin-top: auto; padding-top: 1.5rem; padding-bottom: 0.5rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

    .lightbox-close {
      position: absolute;
      top: 1rem;
      right: 1rem;
      background: var(--purple-main);
      border: 2px solid var(--purple-bright);
      color: #fff;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      cursor: pointer;
      font-size: 1rem;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: var(--transition);
    }

    .lightbox-close:hover { border-color: var(--danger); color: var(--danger); }

    .lightbox-nav {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      background: var(--bg-elevated);
      border: 1px solid var(--border-color);
      color: var(--text-primary);
      width: 44px;
      height: 44px;
      border-radius: 50%;
      cursor: pointer;
      font-size: 1rem;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: var(--transition);
    }

    .lightbox-nav:hover { border-color: var(--purple-bright); color: var(--purple-bright); }
    .lightbox-nav.prev { left: 1rem; }
    .lightbox-nav.next { right: 1rem; }

    @media (max-width: 900px) {
      .gallery-grid { grid-template-columns: repeat(2, 1fr); }
      .lightbox {
        align-items: flex-start;
        padding: 1rem;
        overflow-y: auto;
      }
      .lightbox-inner {
        grid-template-columns: 1fr;
        max-height: none;
        overflow: visible;
        margin: auto;
      }
      .lightbox-img { aspect-ratio: 4/3; max-height: 45vh; }
      .lightbox-img img { max-height: 45vh; }
      .lightbox-info { max-height: none; overflow-y: visible; }
    }

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