/* ==========================================================================
   Shondalai Template - Base & Layout
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-family: var(--sh-font-family);
    font-size: var(--sh-font-size-base);
    line-height: var(--sh-line-height-normal);
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html.sh-smooth-scroll,
.sh-smooth-scroll {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--sh-text);
    background-color: var(--sh-bg);
}

/* ── Skip Link ── */
.sh-skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    z-index: var(--sh-z-tooltip);
    padding: var(--sh-space-2) var(--sh-space-4);
    background: var(--sh-color-accent);
    color: #fff;
    font-size: var(--sh-font-size-sm);
    font-weight: var(--sh-font-weight-medium);
    border-radius: var(--sh-radius);
    text-decoration: none;
}

.sh-skip-link:focus {
    left: var(--sh-space-4);
    top: var(--sh-space-4);
}

/* ── Page Wrapper ── */
.sh-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Container ── */
.sh-container {
    width: 100%;
    max-width: var(--sh-container-max-width);
    margin-inline: auto;
    padding-inline: var(--sh-container-padding);
}

.sh-container--narrow { max-width: var(--sh-container-narrow); }
.sh-container--wide   { max-width: var(--sh-container-wide); }
.sh-container--full   { max-width: 100%; }

/* ── Row ── */
.sh-row {
    width: 100%;
}

.sh-row--full-width {
    padding-inline: 0;
}

.sh-row--full-width > .sh-container {
    max-width: 100%;
    padding-inline: 0;
}

/* ── Row Grid ── */
.sh-row__grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
}

.sh-row__grid--gap-xs  { gap: var(--sh-space-1); }
.sh-row__grid--gap-sm  { gap: var(--sh-space-2); }
.sh-row__grid--gap-md  { gap: var(--sh-space-4); }
.sh-row__grid--gap-lg  { gap: var(--sh-space-6); }
.sh-row__grid--gap-xl  { gap: var(--sh-space-8); }
.sh-row__grid--gap-2xl { gap: var(--sh-space-12); }

/* ── Column Spans ── */
.sh-col-1  { grid-column: span 1; }
.sh-col-2  { grid-column: span 2; }
.sh-col-3  { grid-column: span 3; }
.sh-col-4  { grid-column: span 4; }
.sh-col-5  { grid-column: span 5; }
.sh-col-6  { grid-column: span 6; }
.sh-col-7  { grid-column: span 7; }
.sh-col-8  { grid-column: span 8; }
.sh-col-9  { grid-column: span 9; }
.sh-col-10 { grid-column: span 10; }
.sh-col-11 { grid-column: span 11; }
.sh-col-12 { grid-column: span 12; }

/* ── Fixed-column Grids ── */
.sh-grid--2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sh-space-6); }
.sh-grid--3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sh-space-6); }
.sh-grid--4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sh-space-6); }

/* ── Content Grid ── */
.sh-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sh-space-8);
}

.sh-content-grid--sidebar {
    grid-template-columns: 1fr;
}

/* ── Main ── */
.sh-main {
    flex: 1;
    padding-block: var(--sh-space-8);
}

/* ── Header ── */
.sh-header {
    background: var(--sh-bg);
    border-bottom: 1px solid var(--sh-border);
    position: relative;
    z-index: var(--sh-z-sticky);
}

.sh-header--sticky {
    position: sticky;
    top: 0;
}

.sh-header__inner {
    display: flex;
    align-items: center;
    gap: var(--sh-space-6);
    height: var(--sh-header-height);
}

.sh-header__logo {
    flex-shrink: 0;
}

.sh-header__nav {
    flex: 1;
    display: none;
}

.sh-header__actions {
    display: flex;
    align-items: center;
    gap: var(--sh-space-2);
    margin-left: auto;
}

.sh-header .sh-row__grid {
    align-items: center;
}

.sh-position--search,
.sh-position--header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.sh-position--search > .sh-header-actions,
.sh-position--header-actions > .sh-header-actions {
    width: 100%;
    justify-content: flex-end;
}

.sh-header__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: none;
    color: var(--sh-text);
    cursor: pointer;
    border-radius: var(--sh-radius);
    transition: background var(--sh-transition-fast);
}

.sh-header__toggle:hover {
    background: var(--sh-bg-muted);
}

/* ── Logo ── */
.sh-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--sh-text);
}

.sh-logo__image {
    height: 32px;
    width: auto;
}

.sh-logo__text {
    font-size: var(--sh-font-size-lg);
    font-weight: var(--sh-font-weight-bold);
    letter-spacing: -0.025em;
}

/* ── Footer ── */
.sh-footer {
    position: relative;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 28rem),
        linear-gradient(180deg, var(--sh-bg-subtle) 0%, var(--sh-bg) 100%);
    border-top: 1px solid var(--sh-border);
    margin-top: auto;
    overflow: hidden;
}

.sh-footer::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--sh-color-primary), transparent);
    opacity: 0.35;
}

.sh-footer > .sh-container {
    position: relative;
}

.sh-footer__widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: clamp(var(--sh-space-4), 3vw, var(--sh-space-8));
    padding-block: clamp(var(--sh-space-8), 5vw, var(--sh-space-12));
    align-items: stretch;
}

.sh-footer__widgets:has(> :only-child) {
    grid-template-columns: minmax(0, 1fr);
}

.sh-footer__widgets:has(> :only-child) .sh-footer__col {
    width: 100%;
    max-width: min(100%, 58rem);
}

.sh-footer__col {
    min-width: 0;
}

.sh-footer__col > * {
    height: 100%;
}

.sh-footer-module {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: var(--sh-space-4);
    height: 100%;
    padding: clamp(var(--sh-space-5), 2vw, var(--sh-space-7));
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--sh-radius-lg);
    box-shadow: 0 28px 60px -46px rgba(15, 23, 42, 0.30);
    backdrop-filter: blur(10px);
}

.sh-footer-module::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--sh-color-primary) 0%, rgba(37, 99, 235, 0) 72%);
    opacity: 0.65;
}

.sh-footer-module--untitled {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.88) 100%);
}

.sh-footer-module--untitled::before {
    opacity: 0.95;
}

.sh-footer-module__title {
    margin: 0;
    font-size: var(--sh-font-size-xs);
    font-weight: var(--sh-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sh-text-muted);
}

.sh-footer-module__content {
    display: grid;
    gap: var(--sh-space-4);
    color: var(--sh-text-secondary);
    font-size: var(--sh-font-size-sm);
    line-height: 1.75;
}

.sh-footer-module--mod_custom .sh-footer-module__content {
    gap: var(--sh-space-5);
}

.sh-footer-module--mod_custom .sh-footer-module__content > .mod-custom.custom {
    display: grid;
    gap: var(--sh-space-5);
    min-width: 0;
}

.sh-footer-module--mod_custom .sh-footer-module__content > .mod-custom.custom > :first-child {
    margin-top: 0;
}

.sh-footer-module--mod_custom .sh-footer-module__content > .mod-custom.custom > :last-child {
    margin-bottom: 0;
}

.sh-footer-feature__lead {
    margin: 0;
}

.sh-footer-feature__group {
    display: grid;
    gap: var(--sh-space-2);
}

.sh-footer-feature__eyebrow {
    margin: 0;
    font-size: var(--sh-font-size-xs);
    font-weight: var(--sh-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sh-text-muted);
}

.sh-footer-feature__links {
    display: grid;
    gap: var(--sh-space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.sh-footer-feature__links li {
    margin: 0;
}

.sh-footer-feature__meta {
    margin: 0;
    max-width: none;
}

.sh-footer-module__content > :first-child {
    margin-top: 0;
}

.sh-footer-module__content > :last-child {
    margin-bottom: 0;
}

.sh-footer-module__content p,
.sh-footer-module__content ul,
.sh-footer-module__content ol,
.sh-footer__bottom ul,
.sh-footer__bottom ol {
    margin: 0;
    padding: 0;
}

.sh-footer-module__content p {
    max-width: 30ch;
}

.sh-footer-module--mod_custom.sh-footer-module--untitled .sh-footer-module__content > .mod-custom.custom > p:first-child {
    max-width: 34ch;
    font-size: clamp(1rem, 0.45vw + 0.95rem, 1.2rem);
    line-height: 1.65;
    color: var(--sh-text);
    font-weight: var(--sh-font-weight-semibold);
    letter-spacing: -0.01em;
}

.sh-footer-module--mod_custom.sh-footer-module--untitled .sh-footer-module__content > .mod-custom.custom > :not(:first-child) {
    align-self: start;
}

.sh-footer-module__content ul,
.sh-footer-module__content ol,
.sh-footer__bottom ul,
.sh-footer__bottom ol {
    list-style: none;
}

.sh-footer-module__content li,
.sh-footer__bottom li {
    margin: 0;
}

.sh-footer-module__content li + li,
.sh-footer__bottom li + li {
    margin-top: var(--sh-space-2);
}

.sh-footer-module__content a,
.sh-footer__col a,
.sh-footer__bottom a {
    display: inline-flex;
    align-items: center;
    gap: var(--sh-space-2);
    color: var(--sh-text);
    font-size: var(--sh-font-size-sm);
    font-weight: var(--sh-font-weight-medium);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color var(--sh-transition-fast), border-color var(--sh-transition-fast);
}

.sh-footer-module--mod_custom .sh-footer-module__content a::after,
.sh-footer-module--mod_menu .sh-menu__link::after {
    content: '\2192';
    font-size: 0.8em;
    opacity: 0;
    transform: translateX(-0.2rem);
    transition: opacity var(--sh-transition-fast), transform var(--sh-transition-fast);
}

.sh-footer-module__content a:hover,
.sh-footer__col a:hover,
.sh-footer__bottom a:hover {
    color: var(--sh-color-primary);
    border-bottom-color: currentColor;
}

.sh-footer-module--mod_custom .sh-footer-module__content a:hover::after,
.sh-footer-module--mod_menu .sh-menu__link:hover::after,
.sh-footer-module--mod_menu .sh-menu__link.is-active::after {
    opacity: 0.7;
    transform: translateX(0);
}

.sh-footer-module__content .sh-menu {
    display: grid;
    gap: var(--sh-space-2);
}

.sh-footer-module__content .sh-menu__item + .sh-menu__item {
    margin-top: 0;
}

.sh-footer-module__content .sh-menu__link {
    padding: 0;
    background: none;
    border-radius: 0;
}

.sh-footer-module__content .sh-menu__link:hover,
.sh-footer-module__content .sh-menu__link.is-active {
    color: var(--sh-color-primary);
    background: none;
}

.sh-footer-module--mod_menu .sh-menu__link {
    justify-content: space-between;
    width: 100%;
}

.sh-footer-module__content .sh-menu__sub {
    margin-top: var(--sh-space-2);
    padding-left: var(--sh-space-4);
    border-left: 1px solid var(--sh-border);
}

.sh-footer__bottom {
    padding-block: var(--sh-space-5);
    border-top: 1px solid var(--sh-border);
}

.sh-footer__bottom .sh-menu {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sh-space-4);
}

.sh-footer__bottom .sh-menu__item + .sh-menu__item {
    margin-top: 0;
}

.sh-footer__bottom .sh-menu__link {
    padding: 0;
    font-size: var(--sh-font-size-xs);
    color: var(--sh-text-muted);
    background: none;
    border-radius: 0;
}

.sh-footer__bottom .sh-menu__link:hover,
.sh-footer__bottom .sh-menu__link.is-active {
    color: var(--sh-text);
    background: none;
}

@media (min-width: 768px) {
    .sh-footer-module--mod_custom.sh-footer-module--untitled .sh-footer-module__content > .mod-custom.custom {
        grid-template-columns: minmax(0, 1.35fr) minmax(15rem, 1fr);
        column-gap: clamp(var(--sh-space-6), 4vw, var(--sh-space-10));
        align-items: start;
    }

    .sh-footer-module--mod_custom.sh-footer-module--untitled .sh-footer-module__content > .mod-custom.custom > :first-child {
        grid-column: 1;
        grid-row: 1 / span 3;
    }

    .sh-footer-module--mod_custom.sh-footer-module--untitled .sh-footer-module__content > .mod-custom.custom > :not(:first-child) {
        grid-column: 2;
    }
}

.sh-footer__copyright {
    padding-block: var(--sh-space-4);
    border-top: 1px solid var(--sh-border);
    text-align: center;
}

.sh-footer__copyright p {
    margin: 0;
    font-size: var(--sh-font-size-xs);
    color: var(--sh-text-muted);
}

/* ── Offcanvas ── */
.sh-offcanvas {
    position: fixed;
    inset: 0;
    z-index: var(--sh-z-offcanvas);
    pointer-events: none;
    visibility: hidden;
}

.sh-offcanvas[aria-hidden="false"] {
    pointer-events: auto;
    visibility: visible;
}

.sh-offcanvas__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity var(--sh-transition-normal);
}

.sh-offcanvas[aria-hidden="false"] .sh-offcanvas__backdrop {
    opacity: 1;
}

.sh-offcanvas__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: var(--sh-bg);
    transform: translateX(100%);
    transition: transform var(--sh-transition-slow);
    display: flex;
    flex-direction: column;
    box-shadow: var(--sh-shadow-xl);
}

.sh-offcanvas[aria-hidden="false"] .sh-offcanvas__panel {
    transform: translateX(0);
}

.sh-offcanvas__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sh-space-4) var(--sh-space-6);
    border-bottom: 1px solid var(--sh-border);
}

.sh-offcanvas__title {
    font-size: var(--sh-font-size-sm);
    font-weight: var(--sh-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sh-text-secondary);
}

.sh-offcanvas__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: none;
    color: var(--sh-text-secondary);
    cursor: pointer;
    border-radius: var(--sh-radius);
    transition: color var(--sh-transition-fast), background var(--sh-transition-fast);
}

.sh-offcanvas__close:hover {
    color: var(--sh-text);
    background: var(--sh-bg-muted);
}

.sh-offcanvas__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--sh-space-4) var(--sh-space-6);
}

/* ── Back to Top ── */
.sh-back-to-top {
    position: fixed;
    bottom: var(--sh-space-6);
    right: var(--sh-space-6);
    z-index: var(--sh-z-dropdown);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--sh-bg-raised);
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius-full);
    color: var(--sh-text-secondary);
    cursor: pointer;
    box-shadow: var(--sh-shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--sh-transition-normal), visibility var(--sh-transition-normal), color var(--sh-transition-fast);
}

.sh-back-to-top.sh-visible {
    opacity: 1;
    visibility: visible;
}

.sh-back-to-top:hover {
    color: var(--sh-text);
}

/* ── Responsive ── */
@media (max-width: 639px) {
    .sh-hidden-mobile { display: none !important; }
    .sh-row--stack-mobile .sh-row__grid { grid-template-columns: 1fr; }
    .sh-row--stack-mobile .sh-col-1,
    .sh-row--stack-mobile .sh-col-2,
    .sh-row--stack-mobile .sh-col-3,
    .sh-row--stack-mobile .sh-col-4,
    .sh-row--stack-mobile .sh-col-5,
    .sh-row--stack-mobile .sh-col-6,
    .sh-row--stack-mobile .sh-col-7,
    .sh-row--stack-mobile .sh-col-8,
    .sh-row--stack-mobile .sh-col-9,
    .sh-row--stack-mobile .sh-col-10,
    .sh-row--stack-mobile .sh-col-11,
    .sh-row--stack-mobile .sh-col-12 { grid-column: span 1; }
    .sh-grid--2,
    .sh-grid--3,
    .sh-grid--4 { grid-template-columns: 1fr; }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .sh-hidden-tablet { display: none !important; }
    .sh-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .sh-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .sh-hidden-desktop { display: none !important; }

    .sh-header__nav {
        display: block;
    }

    .sh-header__toggle {
        display: none;
    }

    .sh-content-grid--sidebar {
        grid-template-columns: var(--sh-sidebar-width) 1fr;
    }

}

@media (min-width: 1024px) {
    :root {
        --sh-container-padding: 2rem;
    }
}
