/* Ceazers 3D - projects.css | Project cards (data-driven), gallery, lightbox */

    /* ── Featured cards: additions to the base .project-card styles ── */
    button.project-image {
      width: 100%;
      border: 0;
      padding: 0;
      cursor: zoom-in;
      font: inherit;
      color: inherit;
    }
    button.project-image:focus-visible,
    .pg-tile:focus-visible,
    .project-view:focus-visible,
    .pg-tab:focus-visible,
    .lb-btn:focus-visible {
      outline: 2px solid var(--color-accent);
      outline-offset: 3px;
    }

    /* Solid tag so it stays legible over busy real-world photos */
    #projectsGrid .project-tag {
      background: rgba(8,12,20,0.78);
      border-color: rgba(255,255,255,0.12);
      color: #fff;
      backdrop-filter: blur(4px);
    }

    /* Whole-image fit for CAD renders on white backgrounds */
    .project-photo.is-contain {
      object-fit: contain;
      background: #fff;
      padding: 12px;
    }

    .project-count {
      position: absolute;
      right: 12px; bottom: 12px;
      z-index: 3;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 10px;
      border-radius: 100px;
      background: rgba(8,12,20,0.72);
      color: #fff;
      font-size: 0.72rem;
      font-weight: 600;
      backdrop-filter: blur(4px);
    }
    .project-count svg {
      width: 12px; height: 12px;
      fill: none; stroke: currentColor; stroke-width: 2;
      stroke-linecap: round; stroke-linejoin: round;
    }
    .project-count svg + svg, .project-count svg:not(:first-child) { margin-left: 4px; }

    .project-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 14px;
    }
    .project-chips li {
      font-size: 0.7rem;
      font-weight: 600;
      color: var(--color-accent-dark);
      background: var(--color-accent-glow);
      border-radius: 100px;
      padding: 3px 10px;
    }

    .project-view {
      border: 0;
      background: none;
      padding: 0;
      cursor: pointer;
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--color-text-primary);
      text-decoration: underline;
      text-decoration-color: var(--color-border);
      text-underline-offset: 4px;
    }
    .project-view:hover { text-decoration-color: var(--color-accent); }

    /* ── Gallery ─────────────────────────────────────────────────── */
    .project-gallery { margin-top: 64px; }

    .pg-head {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 24px;
    }
    .pg-heading {
      font-family: var(--font-heading);
      font-size: 1.35rem;
      font-weight: 700;
      color: var(--color-text-primary);
    }
    .pg-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
    .pg-tab {
      border: 1px solid var(--color-border);
      background: var(--color-bg-white);
      color: var(--color-text-secondary);
      font-size: 0.8rem;
      font-weight: 600;
      padding: 7px 14px;
      border-radius: 100px;
      cursor: pointer;
      transition: background var(--transition), color var(--transition), border-color var(--transition);
    }
    .pg-tab:hover { border-color: var(--color-accent); color: var(--color-accent-dark); }
    .pg-tab[aria-pressed="true"] {
      background: var(--color-accent);
      border-color: var(--color-accent);
      color: #fff;
    }

    .pg-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 18px;
    }
    .pg-tile {
      display: flex;
      flex-direction: column;
      text-align: left;
      border: 1px solid var(--color-border);
      border-radius: var(--radius-md);
      background: var(--color-bg-white);
      overflow: hidden;
      padding: 0;
      cursor: zoom-in;
      font: inherit;
      transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    }
    .pg-tile:hover {
      transform: translateY(-4px);
      box-shadow: var(--shadow-md);
      border-color: rgba(14,165,233,0.25);
    }
    .pg-thumb {
      position: relative;
      display: block;
      aspect-ratio: 4/3;
      background: #0D1B2A;
      overflow: hidden;
    }
    .pg-thumb img {
      width: 100%; height: 100%;
      object-fit: cover;
      transition: transform 0.5s cubic-bezier(0.23,1,0.32,1);
    }
    .pg-thumb.is-contain { background: #fff; }
    .pg-thumb.is-contain img { object-fit: contain; padding: 10px; }
    .pg-tile:hover .pg-thumb img { transform: scale(1.05); }
    .pg-caption { display: block; padding: 14px 16px 16px; }
    .pg-title {
      display: block;
      font-family: var(--font-heading);
      font-weight: 700;
      font-size: 0.95rem;
      color: var(--color-text-primary);
      margin-bottom: 4px;
    }
    .pg-desc {
      display: block;
      font-size: 0.8rem;
      line-height: 1.55;
      color: var(--color-text-secondary);
    }

    /* ── Lightbox ────────────────────────────────────────────────── */
    .lb {
      position: fixed;
      inset: 0;
      z-index: 10050;
      background: rgba(8,12,20,0.95);
      display: grid;
      grid-template-rows: auto 1fr auto;
      padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
      color: #fff;
    }
    .lb[hidden] { display: none; }
    .lb-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      max-width: 1200px;
      width: 100%;
      margin: 0 auto;
    }
    .lb-heading { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
    .lb-title {
      font-family: var(--font-heading);
      font-weight: 700;
      font-size: 1.05rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .lb-counter { font-size: 0.8rem; color: rgba(255,255,255,0.6); flex-shrink: 0; }
    .lb-stage {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 0;
      padding: 12px 0;
    }
    .lb-stage img, .lb-stage video {
      max-width: min(100%, 1200px);
      max-height: 100%;
      object-fit: contain;
      border-radius: var(--radius-sm);
      background: #fff;
    }
    .lb-stage video { background: #000; }
    .lb-caption {
      text-align: center;
      font-size: 0.875rem;
      color: rgba(255,255,255,0.75);
      max-width: 720px;
      margin: 0 auto;
      min-height: 1.4em;
    }
    .lb-btn {
      width: 44px; height: 44px;
      border-radius: 50%;
      border: 1px solid rgba(255,255,255,0.18);
      background: rgba(255,255,255,0.08);
      color: #fff;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      flex-shrink: 0;
      transition: background var(--transition);
    }
    .lb-btn:hover { background: rgba(255,255,255,0.18); }
    .lb-btn svg {
      width: 20px; height: 20px;
      fill: none; stroke: currentColor; stroke-width: 2.2;
      stroke-linecap: round; stroke-linejoin: round;
    }
    .lb-prev, .lb-next {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
    }
    .lb-prev { left: 16px; }
    .lb-next { right: 16px; }
    .lb-btn[hidden] { display: none; }

    /* ── Use-case cards: real project photo across the top ─────────── */
    .usecase-img {
      margin: -28px -24px 20px;
      height: 150px;
      overflow: hidden;
      background: #0D1B2A;
    }
    .usecase-img img {
      width: 100%; height: 100%;
      object-fit: cover;
      transition: transform 0.5s ease;
    }
    .usecase-card:hover .usecase-img img { transform: scale(1.05); }
    /* The coloured top accent bar sits above the photo */
    .usecase-card::before { z-index: 1; }

    @media (max-width: 640px) {
      .project-gallery { margin-top: 48px; }
      .pg-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
      .pg-desc { display: none; }
      .pg-caption { padding: 10px 12px 12px; }
      .pg-title { font-size: 0.85rem; margin-bottom: 0; }
      .lb-prev, .lb-next { top: auto; bottom: max(16px, env(safe-area-inset-bottom)); transform: none; }
      .lb-caption { padding: 0 56px; }
    }

    @media (prefers-reduced-motion: reduce) {
      .pg-tile, .pg-thumb img { transition: none; }
      .pg-tile:hover { transform: none; }
    }
