/* ============================================================
   layout.css — Container, Grid Systems, Section Spacing
   Fatigue Answers
   ============================================================ */

/* ============================================================
   CONTAINER
   ============================================================ */

.container {
    width: 100%;
    max-width: 1100px;
    margin-inline: auto;
    padding-inline: 24px;
}

/* ============================================================
   SECTION SPACING
   ============================================================ */

.section {
    padding-block: var(--space-section-mobile);
}

@media (min-width: 768px) {
    .section {
        padding-block: var(--space-section);
    }
}

.section--pb-tight { padding-bottom: 40px; }
.section--pt-tight { padding-top: 40px; }

@media (min-width: 768px) {
    .section--pb-tight { padding-bottom: 48px; }
    .section--pt-tight { padding-top: 48px; }
}

/* ============================================================
   GRIDS
   ============================================================ */

/* Generic auto-fit grid */
.grid {
    display: grid;
    gap: 32px;
}

/* 2-col grid */
.grid--2 {
    grid-template-columns: 1fr;
}

@media (min-width: 600px) {
    .grid--2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 3-col grid */
.grid--3 {
    grid-template-columns: 1fr;
}

@media (min-width: 600px) {
    .grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 4-col grid */
.grid--4 {
    grid-template-columns: 1fr;
}

@media (min-width: 600px) {
    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1100px) {
    .grid--4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Two-col split: content + image */
.split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: center;
}

@media (min-width: 768px) {
    .split {
        grid-template-columns: 1fr 1fr;
    }

    .split--wide {
        grid-template-columns: 3fr 2fr;
    }
}

/* ============================================================
   FLEX UTILITIES
   ============================================================ */

.flex {
    display: flex;
}

.flex--center {
    align-items: center;
    justify-content: center;
}

.flex--between {
    align-items: center;
    justify-content: space-between;
}

.flex--wrap {
    flex-wrap: wrap;
}

/* ============================================================
   GAP VARIANTS
   ============================================================ */

.gap-tight {
    gap: 24px;
}

.gap-medium {
    gap: 32px;
}

.gap-roomy {
    gap: 40px;
}

.gap-loose {
    gap: 48px;
}

/* ============================================================
   TEXT ALIGNMENT
   ============================================================ */

.text-center {
    text-align: center;
}

.text-center p,
.text-center h1,
.text-center h2,
.text-center h3 {
    margin-inline: auto;
}

/* ============================================================
   SECTION HEADING BLOCK
   Used above grids/islands — label + H2 + optional sub text
   ============================================================ */

.section-header {
    margin-bottom: 56px;
    position: relative;
    padding-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Ensures even centering for all headers */
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--color-primary);
    opacity: 0.3;
}

.section-header .label {
    margin-bottom: 12px;
}

.section-header h2 {
    margin-bottom: 16px;
    max-width: none;
}

.section-header p {
    font-size: 18px;
    opacity: 0.8;
}

/* ============================================================
   IMAGE UTILITIES
   ============================================================ */

.img-rounded {
    border-radius: var(--radius-image);
}

.img-full {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   VISUALLY HIDDEN (accessibility)
   ============================================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   SKIP LINK
   ============================================================ */

.skip-link {
    position: absolute;
    top: -100%;
    left: 24px;
    z-index: 999;
    background: var(--color-primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: 0 0 var(--radius-card) var(--radius-card);
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}