.gallery-detail-hero {
    min-height: 70vh;
    background:
      linear-gradient(90deg, rgba(7, 8, 13, 0.92), rgba(7, 8, 13, 0.44) 52%, rgba(7, 8, 13, 0.78)),
      var(--cover);
    background-size: cover;
    background-position: center;
    color: white;
  }

  .detail-head {
    display: grid;
    grid-template-columns: minmax(0, 0.72fr) minmax(18rem, 0.42fr);
    gap: 2rem;
    align-items: end;
  }

  .detail-info {
    color: #a8b0c2;
  }

  .detail-info span {
    display: inline-flex;
    margin: 0 0.5rem 0.8rem 0;
    padding: 0.55rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 0.78rem;
    font-weight: 900;
  }

  .detail-info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.04rem;
    line-height: 1.7;
  }

  .section.light.gallery-body {
    padding-top: 2.5rem;
    background: var(--paper);
  }

  .gallery-toolbar {
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: center;
    border-bottom: 1px solid var(--line-dark);
    color: var(--ink-dark);
  }

  .gallery-view-hint {
    margin: .5rem 0 0;
    font-size: .875rem;
    line-height: 1.5;
    color: var(--muted-dark);
  }

  .gallery-toolbar h2 {
    max-width: none;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: clamp(1.5rem, 2vw, 1.85rem);
    letter-spacing: -0.04em;
    line-height: 1.2;
  }

  .gallery-photo-count { padding: .2rem .55rem; border: 1px solid var(--line-dark); border-radius: .5rem; color: var(--muted-dark); font: 500 .75rem/1.4 "Inter", sans-serif; letter-spacing: 0; }

  .back-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    justify-self: end;
    min-height: 44px;
    padding: .5rem 0;
    color: var(--ink-dark);
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
  }

  .back-link:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: .25em;
  }

  .back-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 2px; }

  .thumb-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
    position: relative;
    z-index: 2;
  }

  .thumb-grid a {
    grid-column: span 4;
    min-height: 340px;
    overflow: hidden;
    border-radius: var(--radius);
    background: #0b0d12;
    box-shadow: 0 20px 70px rgba(15, 23, 42, 0.12);
    position: relative;
  }

  .thumb-grid a:nth-child(5n + 1),
  .thumb-grid a:nth-child(5n + 4) {
    grid-column: span 8;
  }

  .thumb-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(0.9) contrast(1.06);
    transition: transform 500ms ease, filter 500ms ease;
  }

  .thumb-grid a::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 58%, rgba(7, 8, 13, 0.72));
    opacity: 0.72;
    transition: opacity 220ms ease;
  }

  .thumb-grid a:hover img {
    transform: scale(1.035);
    filter: saturate(1.06) contrast(1.08);
  }

  .thumb-grid a:hover::after {
    opacity: 1;
  }

  .thumb-grid span {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    z-index: 1;
    color: white;
    font-size: 0.82rem;
    font-weight: 900;
  }

  @media (max-width: 840px) {
    .detail-head {
      grid-template-columns: 1fr;
    }

    .gallery-toolbar {
      grid-template-columns: 1fr;
      align-items: start;
      gap: .5rem;
    }

    .gallery-toolbar .back-link { justify-self: start; }

    .thumb-grid a,
    .thumb-grid a:nth-child(5n + 1),
    .thumb-grid a:nth-child(5n + 4) {
      grid-column: span 6;
      min-height: 260px;
    }
  }

  @media (max-width: 560px) {
    .thumb-grid a,
    .thumb-grid a:nth-child(5n + 1),
    .thumb-grid a:nth-child(5n + 4) {
      grid-column: 1 / -1;
    }
  }
