/*
 * Layout primitives — containers, section rhythm, grid helpers.
 * Used by components in Phase 1+.
 */

.redesign .container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad-inline);
}

/* Section — vertical rhythm from Figma (112px on desktop, tighter on mobile) */
.redesign .section {
    padding-block: var(--sp-28);
}

.redesign .section--compact {
    padding-block: var(--sp-20);
}

/* Asymmetric padding modifiers — for two adjacent sections that should
 * read as "tightly coupled" (e.g. map image flowing into the Resources
 * header below). Pair them: flush-bottom on the upper section,
 * tight-top on the lower. */
.redesign .section--flush-bottom { padding-bottom: 0; }
.redesign .section--tight-top    { padding-top: var(--sp-12); }   /* 48 px */
.redesign .section--tight-bottom { padding-bottom: var(--sp-12); }/* 48 px */

.redesign .section--dark {
    background: var(--brand-sea-green-darker);
    color: var(--text-heading-white);
}

.redesign .section--peach {
    background: var(--brand-offwhite-peach);
}

@media (max-width: 768px) {
    .redesign .section {
        padding-block: var(--sp-16);
    }
    .redesign .section--compact {
        padding-block: var(--sp-12);
    }
    .redesign .section--tight-top    { padding-top: var(--sp-8); }    /* 32 px mobile */
    .redesign .section--tight-bottom { padding-bottom: var(--sp-8); } /* 32 px mobile */
}

/* Stack — vertical flow with configurable gap */
.redesign .stack {
    display: flex;
    flex-direction: column;
    gap: var(--sp-6);
}

.redesign .stack--sm  { gap: var(--sp-3); }
.redesign .stack--md  { gap: var(--sp-6); }
.redesign .stack--lg  { gap: var(--sp-12); }
.redesign .stack--xl  { gap: var(--sp-16); }

/* Cluster — horizontal flow, wraps on overflow */
.redesign .cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-4);
}

/* Grid — 12-col, falls to single-column on mobile */
.redesign .grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--sp-8);
}

@media (max-width: 768px) {
    .redesign .grid-12 {
        grid-template-columns: 1fr;
        gap: var(--sp-6);
    }
}

/* Carousel wrapper + dot pagination (Figma Slider Dots 11711:4109).
 * The same markup is used for featured-podcast episodes and featured
 * articles. The inner scroller (.featured-row or .card-grid) is what
 * actually overflows horizontally; this wrapper just provides a layout
 * context for the dot row below and a hook (data-carousel) for JS. */
.redesign .carousel {
    position: relative;
    width: 100%;
}

.redesign .carousel-dots {
    display: none;                         /* hidden on desktop, grids don't scroll */
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 0;
}

@media (max-width: 768px) {
    .redesign .carousel-dots { display: flex; }
}

.redesign .carousel-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--brand-offwhite-seagreen, rgba(0, 0, 0, 0.16));
    cursor: pointer;
    transition: background var(--hover-dur) var(--hover-ease), transform 140ms ease;
}

.redesign .carousel-dot[aria-selected="true"] {
    background: var(--brand-sea-green-darkest, var(--brand-brown));
    transform: scale(1.15);
}

/* Subtle noise overlay — Figma uses a 1024x1024 tiled pattern at 4% opacity
 * on many panels. Placeholder here uses a CSS gradient stipple; Phase 1
 * will swap for the exported asset. */
.redesign .bg-noise {
    position: relative;
}

.redesign .bg-noise::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--opacity-black-60) 0.5px, transparent 0.5px);
    background-size: 3px 3px;
    opacity: 0.04;
    pointer-events: none;
}
