/* ============================================================
   CGB – SMILE GALLERY CAROUSEL
   Native CSS scroll-snap carousel. Pulls all colour and typography
   tokens from the active theme (pfd-variables.css).
   Block class root: .srd-sgc
   ============================================================ */

.srd-sgc {
    --srd-sgc-bg:           var(--pfd-warm-white,  #FAF9F5);
    --srd-sgc-surface:      var(--pfd-white,       #FFFFFF);
    --srd-sgc-ink:          var(--pfd-near-black,  #091015);
    --srd-sgc-ink-muted:    var(--pfd-text-primary, #77808E);
    --srd-sgc-ink-soft:     rgba(28, 42, 53, 0.55);
    --srd-sgc-line:         rgba(28, 42, 53, 0.10);

    --srd-sgc-primary:      var(--pfd-dark-navy,   #1C2A35);
    --srd-sgc-gold:         var(--pfd-gold,        #DBAB6B);

    --srd-sgc-radius:       var(--radius-md, 8px);
    --srd-sgc-radius-lg:    var(--radius-lg, 16px);

    --srd-sgc-gap:          20px;
    --srd-sgc-edge-pad:     32px;

    background: var(--srd-sgc-bg);
    color: var(--srd-sgc-ink);
    font-family: var(--font-body, system-ui, -apple-system, sans-serif);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    margin: 0;
}

.srd-sgc *,
.srd-sgc *::before,
.srd-sgc *::after { box-sizing: border-box; }

.srd-sgc__inner {
    max-width: var(--max-width, 1200px);
    margin: 0 auto;
    padding: 80px var(--srd-sgc-edge-pad);
}

/* ── Header ──────────────────────────────────────────────── */
.srd-sgc__header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 48px;
}

.srd-sgc__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sub, var(--font-body));
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--srd-sgc-primary);
    margin-bottom: 18px;
}

.srd-sgc__eyebrow::before,
.srd-sgc__eyebrow::after {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--srd-sgc-primary);
    opacity: 0.5;
}

.srd-sgc__heading {
    font-family: var(--font-display, var(--font-body));
    font-weight: 600;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--srd-sgc-ink);
    margin: 0 0 16px;
}

.srd-sgc__intro {
    font-size: 17px;
    color: var(--srd-sgc-ink-muted);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* ── Carousel shell ──────────────────────────────────────── */
.srd-sgc__carousel {
    position: relative;
}

/* ── Viewport (the scroll container) ─────────────────────── */
.srd-sgc__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Negative-margin trick so slides extend visually to the section padding
       on small viewports while the buttons stay aligned to the container. */
    margin-inline: calc(var(--srd-sgc-edge-pad) * -1);
    padding-inline: var(--srd-sgc-edge-pad);
    padding-block: 4px;
}

.srd-sgc__viewport::-webkit-scrollbar { display: none; }

.srd-sgc__viewport:focus-visible {
    outline: 3px solid var(--srd-sgc-gold);
    outline-offset: 2px;
    border-radius: var(--srd-sgc-radius);
}

/* ── Track ───────────────────────────────────────────────── */
.srd-sgc__track {
    display: flex;
    gap: var(--srd-sgc-gap);
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ── Slides ──────────────────────────────────────────────── */
.srd-sgc__slide {
    flex: 0 0 86%;
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    /* Theme has a `main ul:not(.menu)... > li` rule that adds bullets/padding
       to li unless the ul matches a known utility class. Override here so
       slide markers don't leak through. */
    list-style: none;
    margin: 0;
    padding: 0;
}

.srd-sgc__slide::marker { content: ''; }

@media (min-width: 640px) {
    .srd-sgc__slide { flex-basis: calc(50% - (var(--srd-sgc-gap) / 2)); }
}

@media (min-width: 1024px) {
    .srd-sgc__slide { flex-basis: calc(33.333% - (var(--srd-sgc-gap) * 2 / 3)); }
}

.srd-sgc__figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.srd-sgc__media {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--srd-sgc-radius-lg);
    background: var(--srd-sgc-line);
    box-shadow:
        0 1px 2px rgba(28, 42, 53, 0.06),
        0 12px 28px rgba(28, 42, 53, 0.10);
}

.srd-sgc__media img,
.srd-sgc__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.srd-sgc__caption {
    margin-top: 14px;
    font-size: 14px;
    color: var(--srd-sgc-ink-muted);
    line-height: 1.5;
    text-align: center;
}

/* ── Prev / next buttons ─────────────────────────────────── */
.srd-sgc__nav {
    position: absolute;
    top: calc(50% - 28px); /* half button height; accounts for caption below media */
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--srd-sgc-surface);
    color: var(--srd-sgc-primary);
    border: 1px solid var(--srd-sgc-line);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 4px 16px rgba(28, 42, 53, 0.12);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.srd-sgc__nav:hover:not(:disabled),
.srd-sgc__nav:focus-visible:not(:disabled) {
    background: var(--srd-sgc-primary);
    color: var(--srd-sgc-surface);
    border-color: var(--srd-sgc-primary);
}

.srd-sgc__nav:focus-visible {
    outline: 3px solid var(--srd-sgc-gold);
    outline-offset: 2px;
}

.srd-sgc__nav:disabled {
    opacity: 0;
    pointer-events: none;
}

.srd-sgc__nav--prev {
    left: -8px;
    transform: translateX(-50%);
}

.srd-sgc__nav--next {
    right: -8px;
    transform: translateX(50%);
}

@media (max-width: 720px) {
    /* On mobile keep the buttons inside the viewport edge so they don't bleed
       into the section padding. */
    .srd-sgc__nav { width: 40px; height: 40px; }
    .srd-sgc__nav--prev { left: 8px; transform: none; }
    .srd-sgc__nav--next { right: 8px; transform: none; }
}

/* ── Dots ────────────────────────────────────────────────── */
.srd-sgc__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.srd-sgc__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--srd-sgc-line);
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.srd-sgc__dot:hover {
    border-color: var(--srd-sgc-primary);
}

.srd-sgc__dot:focus-visible {
    outline: 2px solid var(--srd-sgc-gold);
    outline-offset: 3px;
}

.srd-sgc__dot.is-active {
    background: var(--srd-sgc-primary);
    border-color: var(--srd-sgc-primary);
    transform: scale(1.15);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .srd-sgc__inner {
        padding: 56px 20px;
        --srd-sgc-edge-pad: 20px;
    }
    .srd-sgc__header { margin-bottom: 32px; }
    .srd-sgc__heading { font-size: clamp(26px, 6vw, 34px); }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .srd-sgc__viewport { scroll-behavior: auto; }
    .srd-sgc__nav,
    .srd-sgc__dot { transition: none; }
    .srd-sgc__dot.is-active { transform: none; }
}
