/* CSS Reset & Variables */
:root {
  --primary: #b91c1c;
  --secondary: #fff1f2;
  --accent: #f59e0b;
  --text: #3b0764;
  --bg: #fafafa;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f8fafc;
  color: #1e293b;
  margin: 0;
  padding: 0;
}

/* Typography clamp for absolute readability and responsiveness */
h1 {
  font-size: clamp(22px, 5vw, 36px);
}

p, span, li, a {
  font-size: clamp(14px, 4vw, 16px);
}

/* Base styles */
header {
  border-bottom: 3px solid var(--primary, #2563eb);
}

.btn {
  border-radius: 6px;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* SR-ONLY Class for Accessible Radio Inputs */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive CSS Gallery Engine */
.gallery-container {
  width: 100%;
}

.gallery-main {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* Strict height constraint */
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 1;
  transition: opacity 0.3s ease-in-out;
  background-color: #fafafa;
}

.thumbnails {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.thumbnails label {
  aspect-ratio: 1 / 1;
  display: block;
  overflow: hidden;
  background-color: #fafafa;
}

/* Radio Checked States controlling active slides */
#img-1:checked ~ .gallery-main .slide-1 {
  opacity: 1;
  z-index: 10;
}

#img-2:checked ~ .gallery-main .slide-2 {
  opacity: 1;
  z-index: 10;
}

#img-3:checked ~ .gallery-main .slide-3 {
  opacity: 1;
  z-index: 10;
}

#img-4:checked ~ .gallery-main .slide-4 {
  opacity: 1;
  z-index: 10;
}

/* Radio Checked States controlling active thumbnail borders */
#img-1:checked ~ .thumbnails label[for="img-1"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.2);
}

#img-2:checked ~ .thumbnails label[for="img-2"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.2);
}

#img-3:checked ~ .thumbnails label[for="img-3"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.2);
}

#img-4:checked ~ .thumbnails label[for="img-4"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.2);
}