/* Design System Variables */
:root {
    --primary: #92400e;
    --secondary: #fef3c7;
    --accent: #6d28d9;
    --text: #451a03;
    --bg: #fffef0;
}

/* Base Styles */
body {
    background-color: #fafafa;
    color: #18181b;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* Card Styling */
.card {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 4px;
}

/* Headings with letter-spacing */
h1, h2 {
    font-weight: 600;
    letter-spacing: -0.03em;
}

/* Clamp Typography */
.text-clamp-body {
    font-size: clamp(14px, 4vw, 16px);
}

.text-clamp-h1 {
    font-size: clamp(20px, 4.5vw, 28px);
}

.text-clamp-h2 {
    font-size: clamp(18px, 4vw, 24px);
}

/* Screen Reader Only utility for CSS-only Gallery */
.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;
}

/* Gallery Mechanics */
.gallery-container {
    width: 100%;
}

.gallery-main {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Strict aspect ratio constraint */
    overflow: hidden;
    border: 1px solid #e4e4e7;
    border-radius: 4px;
    background: #f4f4f5;
}

.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;
}

/* Slide visibility based on checked radio inputs */
#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 */
.thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.thumbnails label {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: block;
    transition: border-color 0.2s ease;
}

.thumbnails label img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Highlight active thumbnail */
#img-1:checked ~ .thumbnails label[for="img-1"] {
    border-color: var(--primary);
}
#img-2:checked ~ .thumbnails label[for="img-2"] {
    border-color: var(--primary);
}
#img-3:checked ~ .thumbnails label[for="img-3"] {
    border-color: var(--primary);
}
#img-4:checked ~ .thumbnails label[for="img-4"] {
    border-color: var(--primary);
}

/* CTA Button Styling */
.btn-cta {
    background-color: var(--accent);
    border: 1px solid #18181b;
    border-radius: 4px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cta:hover {
    background-color: #5b21b6; /* Slightly darker shade of accent for hover feedback */
}