/**
 * Roadmap homepage — grid pattern, typography, theme overrides.
 */

/* ── Root theme cascade (html → body → shell → sections) ─────────── */
body.sdc-roadmap-body {
    --sdc-rm-fg: #18181b;
    --sdc-rm-fg-muted: #52525b;
    --sdc-rm-fg-subtle: #71717a;
    --sdc-rm-border: #e4e4e7;
    --sdc-rm-surface: #ffffff;
    --sdc-rm-surface-muted: #fafafa;
    --sdc-rm-surface-raised: #ffffff;
    --sdc-rm-badge-bg: #ffffff;
    --sdc-rm-badge-fg: #18181b;
    --sdc-rm-badge-border: #18181b;
    --sdc-rm-newsletter-fg: #ffffff;
    --sdc-rm-newsletter-muted: #a1a1aa;
    --sdc-rm-newsletter-subtle: #71717a;
    color: var(--sdc-rm-fg);
    background-color: var(--sdc-rm-surface);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html[data-theme="dark"] body.sdc-roadmap-body,
html.dark body.sdc-roadmap-body {
    --sdc-rm-fg: #f4f4f5;
    --sdc-rm-fg-muted: #a1a1aa;
    --sdc-rm-fg-subtle: #71717a;
    --sdc-rm-border: #3f3f46;
    --sdc-rm-surface: var(--sdc-rm-dark-bg, #0b0b0f);
    --sdc-rm-surface-muted: #18181b;
    --sdc-rm-surface-raised: var(--sdc-rm-dark-card, #12121a);
    --sdc-rm-badge-bg: var(--sdc-rm-dark-card, #12121a);
    --sdc-rm-badge-fg: #f4f4f5;
    --sdc-rm-badge-border: #52525b;
    color: var(--sdc-rm-fg);
    background-color: var(--sdc-rm-surface);
}

html[data-theme="dark"] body.sdc-roadmap-body #page.sdc-roadmap-site,
html.dark body.sdc-roadmap-body #page.sdc-roadmap-site,
html[data-theme="dark"] body.sdc-roadmap-body #content.site-content,
html.dark body.sdc-roadmap-body #content.site-content {
    background-color: transparent !important;
    color: inherit;
}

body.sdc-roadmap-body .sdc-roadmap-main h1:not([class*="text-"]),
body.sdc-roadmap-body .sdc-roadmap-main h2:not([class*="text-"]),
body.sdc-roadmap-body .sdc-roadmap-main h3:not([class*="text-"]),
body.sdc-roadmap-body .sdc-roadmap-main h4:not([class*="text-"]),
body.sdc-roadmap-body .sdc-roadmap-footer h4 {
    color: var(--sdc-rm-fg);
}

body.sdc-roadmap-body .sdc-roadmap-main p:not([class*="text-"]) {
    color: var(--sdc-rm-fg-muted);
}

html[data-theme="dark"] body.sdc-roadmap-body .text-zinc-500,
html.dark body.sdc-roadmap-body .text-zinc-500 {
    color: var(--sdc-rm-fg-muted);
}

#coursesGrid .course-card > div:first-child > .absolute.bottom-3 {
    background-color: var(--sdc-rm-badge-bg);
    color: var(--sdc-rm-badge-fg);
    border-color: var(--sdc-rm-badge-border);
}

html[data-theme="dark"] body.sdc-roadmap-body #coursesGrid .course-card,
html.dark body.sdc-roadmap-body #coursesGrid .course-card {
    background-color: var(--sdc-rm-surface-raised) !important;
    border-color: var(--sdc-rm-border);
    color: var(--sdc-rm-fg);
}

body.sdc-roadmap-body h1,
body.sdc-roadmap-body h2,
body.sdc-roadmap-body h3,
body.sdc-roadmap-body h4,
body.sdc-roadmap-body .font-heading {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

body.sdc-roadmap-body.grid-pattern {
    background-size: 24px 24px;
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

html[data-theme="dark"] body.sdc-roadmap-body.grid-pattern,
html.dark body.sdc-roadmap-body.grid-pattern {
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

.sdc-roadmap-site .site-content,
.sdc-roadmap-main {
    margin: 0;
    padding: 0;
    max-width: none;
    width: 100%;
}

.sdc-roadmap-body .skip-link:focus {
    clip: auto;
    height: auto;
    width: auto;
    position: absolute;
    z-index: 100000;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Neutralize legacy theme styles on roadmap homepage */
body.sdc-roadmap-body #page,
body.sdc-roadmap-body .sdc-roadmap-site {
    background: transparent;
    margin: 0;
    padding: 0;
    max-width: none;
}

body.sdc-roadmap-body a.no-underline {
    text-decoration: none;
}

body.sdc-roadmap-body .sdc-roadmap-header a:hover,
body.sdc-roadmap-body .sdc-roadmap-footer a:hover {
    text-decoration: none;
}

body.sdc-roadmap-body.home .site-main,
body.sdc-roadmap-body .sdc-roadmap-main {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

/* Sticky Swiss header — fixed to viewport top, compact height */
body.sdc-layout-swiss {
    --sdc-header-h: 3.5rem;
}

body.sdc-layout-swiss .sdc-roadmap-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    z-index: 100 !important;
}

/* Offset page content by header height only (no legacy 56–64px body gap) */
body.sdc-layout-swiss #page.sdc-roadmap-site {
    padding-top: var(--sdc-header-h, 3.5rem) !important;
    margin-top: 0 !important;
}

body.sdc-layout-swiss.sdc-roadmap-body {
    padding-top: 0 !important;
}

body.sdc-layout-swiss.sdc-roadmap-body.admin-bar {
    padding-top: 0 !important;
}

body.sdc-layout-swiss.sdc-roadmap-body #content,
body.sdc-layout-swiss.sdc-roadmap-body .sdc-swiss-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Homepage — tighter section rhythm (overrides Tailwind py-12/py-20) */
body.sdc-layout-swiss.home .sdc-roadmap-main > section,
body.sdc-layout-swiss.front-page .sdc-roadmap-main > section {
    padding-top: 1.25rem !important;
    padding-bottom: 1.75rem !important;
    margin-top: 0 !important;
}

@media (min-width: 1024px) {
    body.sdc-layout-swiss.home .sdc-roadmap-main > section,
    body.sdc-layout-swiss.front-page .sdc-roadmap-main > section {
        padding-top: 1.75rem !important;
        padding-bottom: 2rem !important;
    }

    body.sdc-layout-swiss.home .sdc-roadmap-main > section:first-child,
    body.sdc-layout-swiss.front-page .sdc-roadmap-main > section:first-child {
        padding-top: 1rem !important;
    }
}

/* Admin bar: pin nav flush under WP toolbar */
body.admin-bar.sdc-layout-swiss .sdc-roadmap-header {
    top: 32px !important;
}

@media screen and (max-width: 782px) {
    body.admin-bar.sdc-layout-swiss .sdc-roadmap-header {
        top: 46px !important;
    }
}

/* Sign-out confirmation modal (roadmap header) */
body.sdc-roadmap-signout-open {
    overflow: hidden;
}

.sdc-roadmap-signout-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.sdc-roadmap-signout-modal.hidden {
    display: none !important;
}

.sdc-roadmap-signout-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.sdc-roadmap-signout-modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 28rem;
    padding: 1.5rem;
}

.sdc-roadmap-signout-modal__panel a[data-sdc-signout-confirm]:hover {
    color: #fff;
    text-decoration: none;
}

/* Homepage newsletter — always-dark band; inherit from section tokens */
body.sdc-roadmap-body #newsletter h2,
body.sdc-roadmap-body #newsletter h3 {
    color: var(--sdc-rm-newsletter-fg);
}

body.sdc-roadmap-body #newsletter p {
    color: var(--sdc-rm-newsletter-muted);
}

body.sdc-roadmap-body #newsletter p.text-zinc-500 {
    color: var(--sdc-rm-newsletter-subtle);
}

/* Homepage pricing — five cards in one row */
#pricing .sdc-pricing-shell {
    max-width: 1440px;
}

#pricing .sdc-home-pricing-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
}

#pricing .sdc-home-pricing-row > * {
    min-width: 0;
}

@media (max-width: 767px) {
    #pricing .sdc-home-pricing-row {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding-bottom: 0.5rem;
        scrollbar-width: thin;
    }

    #pricing .sdc-home-pricing-row > * {
        flex: 0 0 min(72vw, 220px);
        scroll-snap-align: start;
    }
}

/* coursesGrid — sharp thumbnails (override legacy .course-card hover transform + dim) */
#coursesGrid .course-card {
    transform: none;
    box-shadow: none;
}

#coursesGrid .course-card:hover {
    transform: none;
    box-shadow: none;
}

#coursesGrid .course-card > div:first-child img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

html[data-theme="dark"] #coursesGrid .course-card > div:first-child img,
[data-theme="dark"] #coursesGrid .course-card > div:first-child img {
    filter: none;
}

/* Industry credentials — official brand wordmark colors */
.sdc-credentials-brands .sdc-credential-brand--microsoft {
    background: linear-gradient(90deg, #f25022 0%, #7fba00 33%, #00a4ef 66%, #ffb900 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sdc-credentials-brands .sdc-credential-brand--netflix {
    color: #e50914;
}

.sdc-credentials-brands .sdc-credential-brand--stripe {
    color: #635bff;
}

.sdc-credentials-brands .sdc-credential-brand--uber {
    color: #000000;
}

html[data-theme="dark"] .sdc-credentials-brands .sdc-credential-brand--uber,
html.dark .sdc-credentials-brands .sdc-credential-brand--uber {
    color: #ffffff;
}
