/* ============================================================================
   Chrome shared by every public page: navbar, mobile drawer, footer, floats
   and the course card. Extracted from _Layout.cshtml so it is cached once
   instead of shipping inline on every request. Loads after site.css to keep
   the original cascade order.
   ========================================================================== */

* {
    font-family: var(--sv-font);
    box-sizing: border-box;
}

/* The `*` rule above loses to Bootstrap's `body` selector on specificity,
   so body itself was falling back to system-ui. Match it explicitly. */
body {
    font-family: var(--sv-font);
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.sv-navbar {
    background: rgba(255,255,255,0.97) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    padding: 0;
    transition: box-shadow 0.3s ease;
}

.sv-navbar.scrolled {
    box-shadow: 0 4px 24px rgba(0,0,0,0.14);
}

/* Two-column navbar: logo | (nav links / action buttons) */
.nav-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.4rem 0;
}

.nav-col-content {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 0.18rem;
}

.nav-row-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-top: 0.18rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* The logo is a near-square stacked lockup, so sizing it by width made it 131px
   tall and forced a 144px navbar — taller than the offset below, which hid the
   top of every page behind the fixed header. The nav links + buttons column
   beside it is 80px, so a logo up to that height costs no extra navbar height.
   Size by height and keep it under that ceiling. */
.sv-logo img {
    width: auto;
    height: 76px;
}

.navbar-nav-spaced .nav-link {
    font-weight: 500;
    padding: 0.28rem 1.1rem !important;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    color: var(--sv-ink) !important;
}

.navbar-nav-spaced .nav-link:hover,
.navbar-nav-spaced .nav-link.active {
    background: rgba(37,99,235,0.1);
    color: var(--sv-primary) !important;
    transform: translateY(-1px);
}

/* ── Hamburger (mobile) ─────────────────────────────────────────────────── */
.sv-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--sv-radius-sm);
    transition: background 0.2s;
}

.sv-hamburger:hover {
    background: rgba(37,99,235,0.1);
}

.sv-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--sv-ink);
    border-radius: 2px;
    transition: all 0.3s ease;
    margin: 3px 0;
}

.sv-hamburger.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.sv-hamburger.open span:nth-child(2) {
    opacity: 0;
}

.sv-hamburger.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ── Mobile drawer — always fixed offscreen (hidden on all sizes) ───────── */
.sv-mobile-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 85vw);
    height: 100vh;
    background: var(--sv-surface);
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    z-index: 1045;
    overflow-y: auto;
    transition: right 0.32s var(--sv-ease);
    padding: var(--sv-space-4);
}

.sv-mobile-drawer.open {
    right: 0;
}

.sv-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1044;
}

.sv-mobile-overlay.open {
    display: block;
}

.sv-mobile-drawer .nav-link {
    padding: 0.75rem 1rem !important;
    border-radius: var(--sv-radius-sm);
    font-weight: 500;
    color: var(--sv-ink);
    display: flex;
    align-items: center;
    gap: var(--sv-space-2);
}

.sv-mobile-drawer .nav-link:hover {
    background: var(--sv-surface-tint);
    color: var(--sv-primary);
}

.sv-mobile-drawer .drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: var(--sv-space-4);
    border-bottom: 1px solid var(--sv-line);
}

.sv-mobile-drawer .drawer-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--sv-ink-soft);
    padding: var(--sv-space-1);
    border-radius: 6px;
}

.sv-mobile-drawer .drawer-close:hover {
    background: #f3f4f6;
    color: var(--sv-ink);
}

.sv-mobile-drawer .drawer-cta {
    margin-top: var(--sv-space-4);
    padding-top: var(--sv-space-4);
    border-top: 1px solid var(--sv-line);
}

/* ── Mobile-only overrides ──────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sv-hamburger {
        display: flex;
    }

    /* The logo is a near-square lockup, so `width: 130px` made it 131px tall and
       the fixed navbar 142px — while main only offsets 64px, hiding the top of
       every page behind the header. Constrain by height on small screens so the
       navbar actually fits the offset below. */
    .sv-logo img {
        width: auto;
        height: 52px;
    }
}

/* Main content offset — must clear the fixed navbar. Keep these in step with
   the logo heights above: navbar = max(logo, 80px nav column) + 12.8px padding. */
main[role="main"] {
    margin-top: 93px !important;
}

@media (max-width: 991.98px) {
    main[role="main"] {
        margin-top: 64px !important;
    }
}

/* ── Utility ────────────────────────────────────────────────────────────── */
.bg-gradient-primary {
    background: var(--sv-gradient-brand);
}

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
}

.btn {
    border-radius: var(--sv-radius-sm);
    font-weight: 600;
    padding: 0.55rem 1.2rem;
    transition: all var(--sv-transition);
}

.btn:hover {
    transform: translateY(-2px);
}

.card {
    border-radius: var(--sv-radius);
    overflow: hidden;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
    background: linear-gradient(135deg, var(--sv-ink) 0%, #111827 100%);
}

.footer a:hover {
    color: #93c5fd !important;
}

/* ── WhatsApp float button ──────────────────────────────────────────────── */
.whatsapp-float {
    position: fixed;
    bottom: 113px;
    right: 20px;
    width: 54px;
    height: 54px;
    background: var(--sv-whatsapp);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37,211,102,0.45);
    z-index: 1040;
    transition: transform var(--sv-transition), box-shadow var(--sv-transition);
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 24px rgba(37,211,102,0.5);
}

.whatsapp-float i {
    font-size: 1.6rem;
    color: #fff;
}

.whatsapp-label {
    position: absolute;
    right: 60px;
    background: var(--sv-ink);
    color: #fff;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.78rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.whatsapp-float:hover .whatsapp-label {
    opacity: 1;
}

/* ── Course cards ───────────────────────────────────────────────────────── */
.sv-course-card {
    border: none;
    border-radius: var(--sv-radius-lg);
    overflow: hidden;
    box-shadow: var(--sv-shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--sv-surface);
    height: 100%;
}

.sv-course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(37,99,235,0.15);
}

.sv-course-card .card-img-top {
    height: 190px;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.sv-course-card:hover .card-img-top {
    transform: scale(1.04);
}

.sv-course-card .img-wrapper {
    overflow: hidden;
    position: relative;
}

.sv-course-card .badge-level {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
}

.sv-course-card .card-body {
    padding: 1.25rem;
}

.sv-course-card .course-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--sv-ink);
    line-height: 1.4;
    margin-bottom: var(--sv-space-2);
}

.sv-course-card .course-meta {
    font-size: 0.82rem;
    color: var(--sv-ink-soft);
}

.sv-course-card .price-block {
    margin-top: auto;
}

.sv-course-card .price-original {
    text-decoration: line-through;
    color: var(--sv-ink-muted);
    font-size: 0.85rem;
}

.sv-course-card .price-current {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--sv-primary);
}

.sv-course-card .btn-enroll {
    width: 100%;
    background: var(--sv-gradient-brand);
    color: #fff;
    border: none;
    border-radius: var(--sv-radius-sm);
    padding: 0.6rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s;
    margin-top: var(--sv-space-3);
}

.sv-course-card .btn-enroll:hover {
    background: linear-gradient(135deg, var(--sv-primary-dark), var(--sv-primary-darker));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.35);
    color: #fff;
}

.sv-course-card .rating-stars {
    color: var(--sv-warning);
    font-size: 0.8rem;
}

/* Lazy-load fade */
img.lazy {
    opacity: 0;
    transition: opacity 0.4s ease;
}

img.lazy.loaded {
    opacity: 1;
}

/* ============================================================================
   VISUAL LAYER
   ----------------------------------------------------------------------------
   Site-wide polish applied on top of the token layer: elevation, typographic
   rhythm, section spacing, focus and motion. Everything here is driven by
   tokens from sv-theme.css — no page markup needs to change. This block loads
   last so it can win against Bootstrap and legacy !important rules.
   ========================================================================== */

/* ── Elevation ──────────────────────────────────────────────────────────────
   Bootstrap's shadows are a single flat blur. Swapping in the layered tokens
   (tight contact shadow + wide ambient shadow) is what reads as "premium".   */
.shadow-sm {
    box-shadow: var(--sv-shadow-sm) !important;
}

.shadow {
    box-shadow: var(--sv-shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--sv-shadow-lg) !important;
}

/* Cards sit on a hairline instead of a hard border. */
.card {
    border-color: rgba(15, 23, 42, .07);
}

.card.shadow-sm:hover,
.card.shadow:hover {
    box-shadow: var(--sv-shadow-lg) !important;
}

.card.shadow-sm,
.card.shadow {
    transition: transform var(--sv-transition), box-shadow var(--sv-transition);
}

/* ── Typographic rhythm ─────────────────────────────────────────────────────
   Tighter tracking on headings, roomier body copy. Headings only get the
   optical correction at display sizes, where loose default tracking shows.  */
h1, h2, h3,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    letter-spacing: var(--sv-tracking-tight);
    line-height: 1.18;
}

h4, h5, h6 {
    letter-spacing: -.01em;
    line-height: 1.3;
}

main[role="main"] p:not(.mb-0):not(.lead) {
    line-height: var(--sv-leading-body);
}

.lead {
    line-height: 1.6;
}

/* Opt-in reading measure. Long lines are the main thing that makes a marketing
   page feel like a document; apply to prose columns, never to layout wrappers. */
.sv-measure {
    max-width: 68ch;
}

/* ── Section rhythm ─────────────────────────────────────────────────────────
   Bootstrap's py-5 is a flat 3rem at every viewport. Scaling it with the
   viewport gives large screens the breathing room they need without
   squeezing phones.                                                          */
main[role="main"] > section.py-5,
main[role="main"] > div > section.py-5 {
    padding-top: clamp(3rem, 5.5vw, 5rem) !important;
    padding-bottom: clamp(3rem, 5.5vw, 5rem) !important;
}

/* ── Focus ──────────────────────────────────────────────────────────────────
   The old ring used a non-brand blue on a white halo. Brand ring, no halo.  */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 .22rem var(--sv-primary-a20);
    border-color: var(--sv-primary);
}

.form-control,
.form-select {
    border-radius: var(--sv-radius-sm);
    border-color: var(--sv-line);
    transition: border-color var(--sv-transition), box-shadow var(--sv-transition);
}

/* ── Buttons ────────────────────────────────────────────────────────────────
   Solid buttons pick up a coloured shadow on hover and a real press state,
   so clicks feel physical rather than instantaneous.                        */
.btn-primary {
    background: var(--sv-gradient-brand);
    border: none;
}

    .btn-primary:hover,
    .btn-primary:focus {
        background: linear-gradient(135deg, var(--sv-primary-dark), var(--sv-primary-darker));
        box-shadow: 0 6px 18px rgba(37, 99, 235, .32);
    }

.btn-success:hover {
    box-shadow: 0 6px 18px rgba(16, 185, 129, .32);
}

.btn-warning:hover {
    box-shadow: 0 6px 18px rgba(245, 158, 11, .34);
}

.btn-danger:hover {
    box-shadow: 0 6px 18px rgba(239, 68, 68, .32);
}

.btn:active {
    transform: translateY(0) scale(.985) !important;
}

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
    font-weight: 600;
    letter-spacing: .01em;
    padding: .4em .7em;
    border-radius: var(--sv-radius-pill);
}

/* ── Images ─────────────────────────────────────────────────────────────── */
main[role="main"] img {
    max-width: 100%;
}

/* ── Links ──────────────────────────────────────────────────────────────── */
main[role="main"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link) {
    transition: color var(--sv-transition);
}

/* ── Motion ─────────────────────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
}

/* ── Accessibility: honour reduced-motion for everything added above ─────── */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .card.shadow-sm,
    .card.shadow,
    .form-control,
    .form-select {
        transition: none !important;
    }

    .card.shadow-sm:hover,
    .card.shadow:hover,
    .btn:active {
        transform: none !important;
    }

    /* Never leave scroll-revealed content stuck at opacity 0. */
    .cd-fade-up {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
