/* Adaptive Layout System Diji’KòM
   WIDE >= 64rem | MEDIUM 47.5625rem–63.9375rem | COMPACT <= 47.5rem */

:root {
    --layout-gutter: clamp(1.25rem, 2.5vw, 2.5rem);
    --layout-gutter-compact: clamp(.875rem, 4vw, 1.25rem);
    --content-measure: 65ch;
    --touch-target: 2.75rem;
}

.shell {
    width: min(calc(100% - (2 * var(--layout-gutter))), var(--container));
}

.site-header__inner {
    width: min(calc(100% - (2 * var(--layout-gutter))), var(--container-wide));
}

/* Keep the primary navigation in the rail when tablet width permits it. */
@media (min-width: 820px) and (max-width: 1180px) {
    .site-header__inner {
        gap: clamp(.75rem, 1.2vw, 1rem);
    }

    .site-header__brand {
        flex-shrink: 0;
    }

    .site-header__brand .brand-logo {
        width: clamp(7rem, 12vw, 9rem);
    }

    .site-header.is-compact .site-header__brand .brand-logo {
        width: 5.4rem;
    }

    .desktop-nav {
        display: flex;
        flex-shrink: 0;
        gap: clamp(.65rem, 1.1vw, .85rem);
    }

    .desktop-nav a {
        display: inline-flex;
        align-items: center;
        min-height: var(--touch-target);
        font-size: .75rem;
        white-space: nowrap;
    }

    .site-header__actions {
        flex-shrink: 0;
        gap: .5rem;
    }

    .site-header .header-quote,
    .site-header .client-access {
        display: inline-flex;
        padding-inline: .6rem;
        gap: .5rem;
        white-space: nowrap;
    }

    .menu-toggle {
        display: none;
    }
}

.page-hero__lead,
.page-section__heading p,
.contact-copy p {
    max-width: var(--content-measure);
}

.entry-section,
.expertises,
.process,
.about,
.page-section,
.pricing-selector,
.pricing-complementary {
    container-type: inline-size;
    container-name: djk-section;
}

@container djk-section (max-width: 54rem) {
    .section-heading--split {
        display: block;
    }

    .section-heading--split > p {
        margin-top: 1rem;
    }

    .page-section__heading,
    .pricing-selector__heading,
    .contact-layout {
        grid-template-columns: 1fr;
    }

    .pricing-selector__heading > p {
        max-width: var(--content-measure);
    }
}

/* WIDE — preserve the validated editorial compositions. */
@media (min-width: 64rem) {
    .page-hero__inner,
    .page-section__heading,
    .contact-layout,
    .about__layout {
        align-items: center;
    }

    .page-section__heading {
        column-gap: clamp(3rem, 7vw, 7rem);
    }
}

/* MEDIUM — keep useful side-by-side relationships without miniaturising WIDE. */
@media (min-width: 47.5625rem) and (max-width: 63.9375rem) {
    :root {
        --section-space: clamp(4.5rem, 8vw, 6.5rem);
    }

    .entry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .entry-card {
        min-height: 26rem;
    }

    .entry-card__content {
        padding: clamp(1.5rem, 3vw, 2.25rem);
    }

    .expertises__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 1rem;
    }

    .expertise-trigger {
        min-height: 5rem;
    }

    .work-track {
        --work-card-width: clamp(23rem, 58vw, 34rem);
    }

    .about__visual {
        min-height: 30rem;
    }

    .pricing-capsules {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-layout {
        gap: clamp(2rem, 6vw, 4rem);
    }
}

/* COMPACT — vertical reading, horizontal tactile collections and full-width actions. */
@media (max-width: 47.5rem) {
    :root {
        --layout-gutter: var(--layout-gutter-compact);
        --section-space: clamp(3.75rem, 14vw, 5.5rem);
    }

    .section-heading,
    .page-section__heading,
    .pricing-selector__heading {
        margin-bottom: clamp(1.75rem, 8vw, 2.75rem);
    }

    .hero-slide__text {
        max-width: 34rem;
    }

    .hero__pagination button,
    .expertise-panel__link,
    .site-footer nav a {
        min-height: var(--touch-target);
    }

    .expertise-panel__link,
    .site-footer nav a {
        align-items: center;
    }

    .entry-grid,
    .about__layout,
    .page-hero__inner,
    .page-section__heading,
    .contact-layout,
    .pricing-selector__heading {
        grid-template-columns: 1fr;
    }

    .entry-card {
        min-height: clamp(25rem, 125vw, 31rem);
    }

    .expertises__list {
        grid-template-columns: 1fr;
    }

    .expertise-trigger {
        min-height: max(4.8rem, var(--touch-target));
    }

    .work-track {
        --work-card-width: min(84vw, 26rem);
        scroll-padding-inline: var(--layout-gutter);
    }

    .process-step {
        padding-right: 0;
    }

    .about__visual {
        min-height: clamp(23rem, 112vw, 28rem);
    }

    .final-cta__content,
    .page-cta__inner {
        display: grid;
        grid-template-columns: 1fr;
        align-items: start;
    }

    .family-nav,
    .pricing-capsules {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(15rem, 82vw);
        grid-template-columns: none;
        gap: .7rem;
        padding: .35rem var(--layout-gutter) 1rem;
        margin-inline: calc(-1 * var(--layout-gutter));
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-padding-inline: var(--layout-gutter);
        scroll-snap-type: x mandatory;
        scrollbar-width: thin;
    }

    .family-nav li,
    .pricing-capsule {
        scroll-snap-align: start;
    }

    .family-nav a {
        min-height: var(--touch-target);
        align-items: center;
    }

    .pricing-dialog {
        width: calc(100% - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    .pricing-family__header,
    .pricing-item {
        align-items: start;
    }

    .contact-form {
        grid-template-columns: 1fr;
    }

    .site-footer__main,
    .site-footer__legal {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-footer nav {
        row-gap: .85rem;
    }

    .entry-main {
        width: min(calc(100% - (2 * var(--layout-gutter))), 35rem);
    }

    .entry-choice,
    .sas-choice,
    .sas-continue,
    .contact-form .button[type="submit"] {
        min-height: var(--touch-target);
    }
}

/* Capability adaptations: tactile devices must not depend on persistent hover. */
@media (hover: none), (pointer: coarse) {
    .button:hover,
    .round-button:hover,
    .back-to-top:hover,
    .entry-card:hover,
    .entry-choice:hover,
    .pricing-capsule:hover,
    .expertise-trigger:hover {
        transform: none;
    }

    .button,
    .round-button,
    .icon-button,
    .back-to-top,
    .desktop-nav a,
    .mobile-menu a,
    .family-nav a,
    .pricing-capsule,
    .custom-select__trigger,
    .custom-select__option {
        min-height: var(--touch-target);
    }

    .expertise-trigger:hover strong,
    .expertise-trigger:hover .expertise-trigger__icon {
        transform: none;
    }
}

/* Short landscape contexts keep navigation and Hero controls reachable. */
@media (max-width: 63.9375rem) and (max-height: 36rem) and (orientation: landscape) {
    .mobile-menu {
        align-content: start;
        overflow-y: auto;
    }

    .hero,
    .hero-slide__content {
        min-height: 40rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .family-nav,
    .pricing-capsules,
    .work-track {
        scroll-behavior: auto;
    }
}
