/**
 * Gallery — Monarch design & manufacturing (source: Monarch Design and Manufacturing Process.docx).
 */

.tf-gallery {
  --gallery-border: 1px solid rgb(255 255 255 / 0.4);
  --gallery-panel-bg: rgb(0 0 0 / 0.2);
  --specs-gutter: 16px;

  padding-top: 0;
  padding-bottom: 64px;
}

.tf-gallery__scale-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.tf-gallery__shell {
  box-sizing: border-box;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--specs-gutter);
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* Allow grid to shrink so 2 columns don’t collapse to 1 (flex default min-width: auto) */
  min-width: 0;
}

.tf-gallery__body {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding: 48px 64px 64px;
  background: var(--gallery-panel-bg);
}

.tf-gallery__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tf-gallery__title {
  margin: 0;
  font-family: var(--font-family-headline);
  font-weight: var(--font-weight-headline);
  font-size: clamp(36px, 8vw, 80px);
  line-height: 1.1;
  color: var(--color-text-default);
  text-transform: uppercase;
}

.tf-gallery__lede {
  margin: 0;
  font-family: var(--font-family-body);
  font-weight: var(--font-weight-body);
  font-size: var(--type-body-s);
  line-height: 1.45;
  color: var(--color-text-muted);
  max-width: 52ch;
}

.tf-gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 20px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  align-items: start;
}

.tf-gallery__item {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.tf-gallery__thumb {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgb(255 255 255 / 0.06);
  cursor: zoom-in;
  color: inherit;
  font: inherit;
  /* Uniform tile size: intrinsic JPEG dimensions must not drive layout */
  aspect-ratio: 4 / 3;
  min-height: 0;
}

.tf-gallery__thumb:focus,
.tf-gallery__thumb:focus-visible {
  outline: none;
}

.tf-gallery__thumb:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 3px;
}

.tf-gallery__thumb img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.tf-gallery__caption {
  margin: 0;
  font-family: var(--font-family-body);
  font-size: var(--type-body-xs);
  line-height: 1.45;
  color: var(--color-text-default);
  font-weight: 400;
}

@media (max-width: 1024px) {
  .tf-gallery__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .tf-gallery__grid {
    /* Explicit two equal tracks — avoids some WebKit flex+grid shrink bugs */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px 16px;
  }

  .tf-gallery__body {
    padding: 32px 24px 48px;
    gap: 32px;
  }
}

@media (max-width: 380px) {
  .tf-gallery__grid {
    gap: 16px 10px;
  }
}

