/* Gallery specific styles */
@layer components, layout;

@layer components {
  .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--thumb-min, 180px), 1fr));
    gap: var(--gap, 10px);
  }

  .gallery__thumb {
    display: block;
    overflow: hidden;
    border-radius: var(--roundness-level, 4px);
    background: #eee;
    text-decoration: none;
    position: relative;
    transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
  }

  .gallery__thumb:focus,
  .gallery__thumb:hover {
    transform: scale(1.03);
  }

  .gallery__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
  }

  .gallery__thumb:focus img,
  .gallery__thumb:hover img {
    transform: scale(1.03);
  }

  .gallery__load-more {
    display: block;
    margin: 20px auto;
    padding: 12px 18px;
    border-radius: var(--roundness-level, 4px);
    border: 0;
    background: var(--tertairy, #ffd700);
    color: var(--primary, #72207b);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s ease;
  }

  .gallery__load-more:hover {
    background: var(--tertairy-hover, #ffdb59);
  }

  .gallery__load-more:disabled {
    opacity: 0.5;
    cursor: default;
    background: var(--tertairy, #ffd700);
  }

  .gallery__caption {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 6px 8px;
    border-radius: var(--roundness-level, 4px);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 12px;
    display: none;
    /* enable if you want captions overlay */
  }
}

@layer layout {
  :root {
    --gap: 10px;
    --thumb-min: 180px;
  }

  .gallery-page {
    background: var(--primary, #72207b);
    background: linear-gradient(to right, var(--primary, #72207b), var(--primary-light, #a72db4), var(--primary, #72207b));
    min-height: 100vh;
    color: var(--secondary, #ffffff);
  }

  .gallery-page__header {
    padding: 1rem var(--mobile-padding, 1rem) 2rem;
    max-width: var(--max-width, 1400px);
    margin: 0 auto;
    background: transparent;
  }

  .gallery-page__navigation {
    margin-bottom: 1rem;
    margin-top: 1rem;
  }

  .gallery-page__back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--tertairy, #ffd700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    transition: color 0.2s ease;
  }

  .gallery-page__back-link:hover {
    color: var(--tertairy-hover, #ffdb59);
  }

  .gallery-page__back-link::before {
    content: "←";
    font-size: 16px;
  }

  .gallery-page__title {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--secondary, #ffffff);
  }

  .gallery-page__content {
    padding: 0 var(--mobile-padding, 1rem) 4rem;
    max-width: var(--max-width, 1400px);
    margin: 0 auto;
  }

  @media screen and (min-width: 750px) {
    :root {
      --thumb-min: 220px;
    }

    .gallery-page__header {
      padding: 0 var(--mobile-padding, 1rem) 3rem;
    }

    .gallery-page__navigation {
      margin-top: 2rem;
      margin-bottom: 2rem;
    }

    .gallery-page__title {
      font-size: 48px;
    }

    .gallery-page__content {
      padding: 0 var(--mobile-padding, 1rem) 6rem;
    }
  }

  @media screen and (min-width: 1200px) {
    :root {
      --thumb-min: 250px;
    }
  }
}
