/* CSS Custom Variables and Base Styles */
:root {
  --primary: #d97706;
  --secondary: #fffbeb;
  --accent: #6d28d9;
  --text: #78350f;
  --bg: #ffffff;
}

body {
  background: #f8fafc;
  color: #1e293b;
  overflow-x: hidden;
}

section {
  padding: 64px 16px;
}

.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn {
  border-radius: 6px;
  font-weight: 600;
}

header {
  border-bottom: 3px solid var(--primary, #2563eb);
}

/* Typography Fluid Sizing */
p, span, li, label, div {
  font-size: clamp(14px, 4vw, 16px);
}

h1 {
  font-size: clamp(22px, 5vw, 36px);
}

/* Screen Reader Utility (Strictly Required for CSS Selector Logic) */
.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;
}

/* CSS-Only Gallery Styles */
.gallery-main {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* Height equals width */
  overflow: hidden;
  background-color: #f1f5f9;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 1;
  transition: opacity 0.3s ease-in-out;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Gallery Radio Connection Logic */
#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;
}

/* Thumbnails Grid Styles */
.thumbnails {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.thumbnails label {
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s ease-in-out;
  aspect-ratio: 1/1;
}

.thumbnails label img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Active Thumbnail Selection Indicators */
#img-1:checked ~ .thumbnails label[for="img-1"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}
#img-2:checked ~ .thumbnails label[for="img-2"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}
#img-3:checked ~ .thumbnails label[for="img-3"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}
#img-4:checked ~ .thumbnails label[for="img-4"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}