/* ==========================================================================
   SECTION INTERFACES (main/site_sections.py)
   Loaded only on feature-section pages (store., courses., jobs., ads.,
   projects.). base.html sets the per-section tokens on :root:
     --sx-accent, --sx-accent-rgb, --sx-accent-hover, --sx-deep,
     --sx-deep-dark, --sx-accent-text-dark, --sx-soft
   and this file maps them onto the shared header tokens (--sh-*) plus the
   section-only pieces: platform strip, section brand, footer.
   Page content can use var(--sx-accent) to follow the section color.
   ========================================================================== */

body[data-section] {
    --sh-accent: var(--sx-accent);
    --sh-accent-hover: var(--sx-accent-hover);
    --sh-accent-text: var(--sx-accent-hover);
    --sh-brand: var(--sx-accent);
}
[data-theme='dark'] body[data-section],
[data-bs-theme='dark'] body[data-section] {
    --sh-accent-text: var(--sx-accent-text-dark);
    --sh-brand: var(--sx-accent-text-dark);
}

/* ---- Platform strip (above the section header) ---- */
.sx-strip {
    background: var(--sx-deep);
    color: #fff;
    font-size: .74rem;
    font-weight: 700;
}
[data-theme='dark'] .sx-strip { background: var(--sx-deep-dark); }
.sx-strip-row {
    display: flex;
    align-items: center;
    gap: .15rem;
    min-height: 32px;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
}
.sx-strip-row::-webkit-scrollbar { display: none; }
.sx-strip-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    color: rgba(255, 255, 255, .78);
    text-decoration: none;
    transition: background-color .2s, color .2s;
}
.sx-strip-link i { font-size: .72rem; opacity: .85; }
.sx-strip-link:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.sx-strip-link.is-active { color: var(--sx-deep); background: #fff; }
[data-theme='dark'] .sx-strip-link.is-active { color: var(--sx-deep-dark); }
.sx-strip-home { margin-inline-end: .35rem; padding-inline-end: .9rem; border-radius: 0; border-inline-end: 1px solid rgba(255, 255, 255, .2); }
.sx-strip-home:hover { background: none; }

/* ---- Section brand (icon mark + name, or the uploaded section logo) ---- */
.sx-brand { gap: .6rem; }
.sx-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--sx-accent);
    color: #fff;
    font-size: 1.05rem;
    box-shadow: 0 6px 14px -8px rgba(var(--sx-accent-rgb), .9);
    flex-shrink: 0;
}
.sx-name { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.sx-name strong {
    color: var(--sh-ink);
    font-size: 1.02rem;
    font-weight: 800;
    white-space: nowrap;
}
.sx-name small { color: var(--sh-muted); font-size: .7rem; font-weight: 600; }

/* ---- Header pieces recolored by the section ---- */
.sh--section { border-bottom-color: rgba(var(--sx-accent-rgb), .25); }
.sh--section .sh-cta {
    background: var(--sx-accent) !important;
    box-shadow: 0 6px 16px -6px rgba(var(--sx-accent-rgb), .7), 0 0 0 1px rgba(255, 255, 255, .15) inset !important;
    color: #fff !important;
    text-decoration: none;
}
.sh--section .sh-cta:hover { background: var(--sx-accent-hover) !important; color: #fff !important; }
.sh--section .sh-login:hover { background: rgba(var(--sx-accent-rgb), .06); }
.sh--section .sh-nav-link.is-active { box-shadow: inset 0 -2px 0 var(--sx-accent); }

/* ---- Mobile drawer ---- */
.sx-mobile-title {
    padding: .7rem 1.25rem .3rem;
    color: var(--sh-muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .02em;
}
.mobile-nav-menu .sx-accent-icon { color: var(--sx-accent); }
[data-theme='dark'] .mobile-nav-menu .sx-accent-icon { color: var(--sx-accent-text-dark); }
.mobile-nav-menu .mobile-nav-link.active { background: rgba(var(--sx-accent-rgb), .1); }
.mobile-nav-menu .sx-mobile-cta { color: var(--sx-accent) !important; font-weight: 800; }
[data-theme='dark'] .mobile-nav-menu .sx-mobile-cta { color: var(--sx-accent-text-dark) !important; }

/* ---- Footer ---- */
footer.sx-ft { background: var(--sx-deep); padding-top: 2rem; }
[data-theme='dark'] footer.sx-ft,
[data-bs-theme='dark'] footer.sx-ft { background: var(--sx-deep-dark); }

.sx-ft-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: 1.5rem 2rem;
    padding-bottom: 1.5rem;
}
.sx-ft-logo {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
}
.sx-ft-logo img { height: 48px; width: auto; }
.sx-mark--ft { background: rgba(255, 255, 255, .14); box-shadow: none; }
.sx-ft-tagline { margin: .7rem 0 0; color: rgba(255, 255, 255, .82); font-size: .85rem; }
.sx-ft-desc { margin-top: .5rem; color: rgba(255, 255, 255, .65); font-size: .8rem; line-height: 1.7; }
.sx-ft-cta {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-top: 1rem;
    padding: .5rem 1rem;
    border-radius: 10px;
    background: #fff;
    color: var(--sx-deep);
    font-size: .82rem;
    font-weight: 800;
    text-decoration: none;
}
.sx-ft-cta:hover { background: var(--sx-soft); color: var(--sx-deep); }

.sx-ft-col { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.sx-ft-title { margin: 0 0 .3rem; color: #fff; font-size: .88rem; font-weight: 800; }
.sx-ft-col a { color: rgba(255, 255, 255, .72); font-size: .8rem; text-decoration: none; transition: color .2s; }
.sx-ft-col a:hover { color: #fff; }

footer.sx-ft .ft-social:hover { background: #fff; color: var(--sx-deep); }

@media (max-width: 991.98px) {
    .sx-ft-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sx-ft-brand { grid-column: 1 / -1; }
}
@media (max-width: 575.98px) {
    .sx-ft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sx-ft-brand { text-align: center; }
    .sx-name small { display: none; }
    .sx-mark { width: 36px; height: 36px; }
}
