﻿/* ═══ Arabica — responsive system (mobile → desktop) ═══ */

:root {
    --sg-gutter: clamp(0.75rem, 2.8vw, 2rem);
    --sg-touch-min: 44px;
    --sg-shell-max: 1120px;
    --sg-break-sm: 480px;
    --sg-break-md: 768px;
    --sg-break-lg: 992px;
    --sg-break-xl: 1200px;
    --sg-break-2xl: 1400px;
}

/* Safe area (notched phones) */
.sg-body {
    padding-inline: env(safe-area-inset-left, 0) env(safe-area-inset-right, 0);
}

.sg-masthead__shell {
    padding-inline: env(safe-area-inset-left, 0) env(safe-area-inset-right, 0);
}

.sg-container {
    width: min(var(--sg-shell-max), calc(100% - var(--sg-gutter) * 2));
    margin-inline: auto;
}

.sg-masthead__inner {
    width: min(var(--sg-shell-max), calc(100% - var(--sg-gutter) * 2));
}

/* Clip decorative overflow */
.sg-hero--editorial,
.sg-showcase,
.sg-story,
.sg-cta,
.sg-ribbon,
.sg-colophon {
    overflow-x: clip;
}

.sg-hero__pattern {
    max-width: 55vw;
}

/* ─── ≤ 479px — small phones ─── */
@media (max-width: 479.98px) {
    .sg-masthead__tag {
        display: none;
    }

    .sg-masthead__tool--menu span {
        display: none;
    }

    .sg-masthead__tool--menu {
        width: var(--sg-touch-min);
        padding: 0;
    }

    .sg-masthead__name {
        font-size: 0.95rem;
        max-width: 46vw;
    }

    .sg-masthead__emblem {
        width: 40px;
        height: 40px;
    }

    .sg-hero__title {
        font-size: clamp(1.75rem, 9vw, 2.35rem);
    }

    .sg-hero__lead,
    .sg-hero__note {
        font-size: 0.92rem;
    }

    .sg-hero__shortcuts {
        margin-inline: calc(var(--sg-gutter) * -0.25);
        padding-inline: calc(var(--sg-gutter) * 0.25);
    }

    .sg-bento__copy strong {
        font-size: 0.92rem;
    }

    .sg-bento__meta {
        inset-inline: 0.65rem;
        bottom: 0.65rem;
        padding: 0.55rem 0.65rem;
    }

    .sg-nav-bottom {
        inset-inline: max(0.35rem, env(safe-area-inset-left, 0.35rem))
            max(0.35rem, env(safe-area-inset-right, 0.35rem));
    }

    .sg-nav-bottom__link {
        min-height: var(--sg-touch-min);
        justify-content: center;
    }

    .sg-colophon__menu-cta {
        width: 100%;
        justify-content: center;
    }

    .sg-colophon__intro {
        align-items: flex-start;
    }
}

/* ─── ≤ 767px — phones ─── */
@media (max-width: 767.98px) {
    .sg-hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .sg-hero__actions .sg-btn {
        width: 100%;
        justify-content: center;
    }

    .sg-hero__metrics {
        grid-template-columns: 1fr;
    }

    .sg-hero__pattern,
    .sg-hero__visual-ring {
        display: none;
    }

    .sg-hero__visual {
        width: 100%;
    }

    .sg-hero__portrait {
        width: 100%;
    }

    .sg-bento__link {
        min-height: 180px;
    }

    .sg-cta__card {
        border-radius: 20px;
        margin-inline: calc(var(--sg-gutter) * -0.15);
    }

    .sg-cta__inner {
        padding: 1.5rem 1.1rem;
    }

    .sg-cta__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .sg-cta__actions .sg-btn {
        width: 100%;
    }

    .sg-showcase {
        padding: 2.25rem 0 2rem;
    }

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

    .sg-story {
        padding: 2.5rem 0;
    }

    .sg-story__copy .sg-btn {
        width: 100%;
        justify-content: center;
    }

    .sg-wall__board {
        gap: 0.65rem;
    }

    .sg-masthead__drawer-panel {
        width: min(100%, calc(100% - env(safe-area-inset-left, 0) - env(safe-area-inset-right, 0)));
        max-width: 360px;
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0));
    }

    .sg-menu-hero__inner {
        text-align: center;
    }

    .sg-menu-hero__copy {
        text-align: center;
    }

    .sg-section-head--start {
        text-align: center;
    }

    .sg-chamber__head {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .sg-featured__rail .sg-card {
        flex: 0 0 min(260px, 88vw);
    }
}

/* ─── 768–991px — tablets ─── */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .sg-hero__split {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 1.35rem;
    }

    .sg-hero__portrait {
        max-height: 420px;
        aspect-ratio: 3 / 4;
    }

    .sg-hero__metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .sg-hero__metrics li:last-child {
        grid-column: 1 / -1;
    }

    .sg-wall__board {
        grid-template-columns: repeat(3, 1fr);
    }

    .sg-bento__cell--hero .sg-bento__link {
        min-height: 240px;
    }

    .sg-bento__cell--wide {
        grid-column: 1 / -1;
    }

    .sg-colophon__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sg-colophon__panel--about {
        grid-column: 1 / -1;
    }

    .sg-menu-hero__inner {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }

    .sg-menu-hero__copy {
        text-align: center;
    }

    .sg-search {
        margin-inline: auto;
    }
}

/* ─── 992–1199px — small laptop / tight desktop ─── */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .sg-masthead__nav {
        flex-wrap: wrap;
        justify-content: center;
        max-width: 52vw;
    }

    .sg-masthead__link {
        padding: 0.45rem 0.65rem;
        font-size: 0.78rem;
    }

    .sg-masthead__chip {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sg-masthead__cta span {
        font-size: 0.82rem;
    }

    .sg-hero__split {
        gap: 1.75rem;
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    }

    .sg-hero__content {
        padding-inline-end: 0.5rem;
    }
}

/* ─── 1200px+ — full desktop chrome (nav fits comfortably) ─── */
@media (max-width: 1199.98px) {
    .sg-masthead__tools {
        display: flex;
    }

    .sg-masthead__nav,
    .sg-masthead__aside {
        display: none !important;
    }
}

@media (min-width: 1200px) {
    .sg-masthead__tools {
        display: none !important;
    }

    .sg-masthead__nav {
        display: flex;
        flex: 1 1 auto;
        justify-content: center;
        max-width: none;
        flex-wrap: wrap;
        min-width: 0;
        margin-inline: 0.35rem;
    }

    .sg-masthead__aside {
        display: flex;
        flex: 0 0 auto;
    }

    .sg-masthead__tools {
        margin-inline-start: 0;
    }

    .sg-masthead__drawer {
        display: none !important;
    }
}

/* ─── Large screens ─── */
@media (min-width: 1400px) {
    :root {
        --sg-shell-max: 1240px;
    }

    .sg-menu-shell {
        width: min(1240px, calc(100% - var(--sg-gutter) * 2));
    }
}

/* ─── Landscape phones ─── */
@media (max-height: 520px) and (orientation: landscape) {
    .sg-hero--editorial {
        min-height: auto;
        padding-block: 0.75rem 1.25rem;
    }

    .sg-hero__portrait {
        max-height: 65vh;
        aspect-ratio: 4 / 3;
    }

    .sg-hero__scroll-cue {
        display: none;
    }

}

/* ─── Touch / coarse pointer ─── */
@media (hover: none) and (pointer: coarse) {
    .sg-btn,
    .sg-masthead__link,
    .sg-masthead__tool,
    .sg-masthead__drawer-link,
    .sg-rail__plate,
    .sg-bento__link,
    .sg-nav-bottom__link {
        min-height: var(--sg-touch-min);
    }

    .sg-bento__link:hover {
        transform: none;
    }
}