/* Multi-line truncation (for description) */
.truncate-multiline {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Show 2 lines of text */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    height: 3rem; /* Ensures long words wrap properly */
}

/* Single-line truncation (for title) */
.truncate-multiline-one-line {
    display: -webkit-box;
    -webkit-line-clamp: 1; /* Show 1 line of text */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word; /* Ensures long words wrap properly */
}

.alert {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    font-weight: bold;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ---- Dark/Light switcher (available site-wide) ---- */
.label .ball {
    transition: transform 0.2s linear;
    transform: translateX(0);
}

.checkbox:checked + .label .ball {
    transform: translateX(1.75rem); /* matches width and padding in switch */
}

/* ---- Navbar dropdown and submenu (desktop/mobile) ---- */
/* Basic positioning for parent to allow absolute submenu */
.parent-parent-menu-item {
    position: relative;
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 12rem;
    background: #fff;
    color: #0f172a;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 0.5rem 0;
    z-index: 40;
}

.submenu .sub-menu-item {
    display: block;
    padding: 0.5rem 1rem;
}

.submenu .sub-menu-item:hover {
    background: #7c3aed;
    color: #fff;
}

@media (min-width: 768px) {
    /* Desktop: only show on hover; ignore any stale .open classes */
    .has-submenu:hover > .submenu {
        display: block;
    }
}

@media (max-width: 767px) {
    /* Mobile: submenu becomes part of the flow; toggle via .open */
    .submenu {
        position: static;
        box-shadow: none;
        border-radius: 0;
    }

    .submenu.open {
        display: block;
    }
}

/* Keep dropdowns within the viewport width */
.submenu {
    max-width: calc(100vw - 2rem);
    overscroll-behavior: contain;
}

/* Centralize and align containers site-wide for consistent UI alignment */
:root {
    --site-max-width: 1200px;
}

html, body {
    overflow-x: hidden;
}

.container {
    margin-left: auto;
    margin-right: auto;
    max-width: var(--site-max-width) !important; /* enforce consistent center width on wide screens */
    padding-left: 1rem !important; /* match px-4 across breakpoints */
    padding-right: 1rem !important;
}

/* Hide Google reCAPTCHA v3 badge (functionality remains).
   Per Google policy, we show an alternative disclosure in the footer. */
.grecaptcha-badge {
    display: none !important; /* strongest, preferred */
    visibility: hidden !important; /* fallback */
    opacity: 0 !important; /* defense-in-depth */
    pointer-events: none !important;
}

/* Password inputs: keep custom eye inside the field and hide browser-native reveal buttons (Edge/IE) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
    width: 0;
    height: 0;
}

/* Ensure our toggle button appears above the input when absolutely positioned */
.password-toggle-btn {
    z-index: 2;
}


/* ---- Navbar layout fallback and alignment (scoped to #topnav) ---- */
#topnav {
    background: #ffffff;
}

#topnav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

/* Reset list defaults for primary nav */
#navigation > ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Mobile: keep nav hidden (hamburger can open it via JS if added later) */
@media (max-width: 767.98px) {
    #navigation {
        display: none;
    }
}

/* Desktop: show nav and force a centered single row */
@media (min-width: 768px) {
    #navigation {
        display: block;
        flex: 1 1 auto;
        margin-left: 1.5rem;
        margin-right: 1.5rem;
    }

    /* Ensure a single-line, centered, evenly spaced primary nav on desktop */
    #navigation > ul {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    #navigation > ul > li > a {
        display: inline-block;
        padding: 0.5rem 0.75rem;
    }
}


/* --- Tailwind compatibility layer (subset) for Bootstrap migration ---
   Note: Tailwind is removed. These classes mimic only what's used in templates.
   Remove this block after templates are fully refactored to Bootstrap utilities. */

/* Display & positioning */
.relative {
    position: relative
}

.absolute {
    position: absolute
}

.fixed {
    position: fixed
}

.sticky {
    position: sticky
}

.block {
    display: block
}

.inline-block {
    display: inline-block
}

.flex {
    display: flex
}

.inline-flex {
    display: inline-flex
}

.grid {
    display: grid
}

.items-center {
    align-items: center
}

.items-start {
    align-items: flex-start
}

.items-end {
    align-items: flex-end
}

.justify-center {
    justify-content: center
}

.justify-between {
    justify-content: space-between
}

.justify-start {
    justify-content: flex-start
}

.justify-end {
    justify-content: flex-end
}

.text-center {
    text-align: center
}

.overflow-hidden {
    overflow: hidden
}

.hidden {
    display: none !important
}

/* Z-index */
.z-1 {
    z-index: 1
}

.z-3 {
    z-index: 3
}

.z-10 {
    z-index: 10
}

.z-40 {
    z-index: 40
}

.z-50 {
    z-index: 50
}

/* Spacing scale (subset) */
.mt-2 {
    margin-top: 0.5rem
}

.mt-4 {
    margin-top: 1rem
}

.mt-10 {
    margin-top: 2.5rem
}

.mb-6 {
    margin-bottom: 1.5rem
}

.my-6 {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem
}

.p-5 {
    padding: 1.25rem
}

.p-8 {
    padding: 2rem
}

.px-3 {
    padding-left: .75rem;
    padding-right: .75rem
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem
}

.px-5 {
    padding-left: 1.25rem;
    padding-right: 1.25rem
}

.py-1 {
    padding-top: .25rem;
    padding-bottom: .25rem
}

.py-2 {
    padding-top: .5rem;
    padding-bottom: .5rem
}

.py-5 {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem
}

.py-16 {
    padding-top: 4rem;
    padding-bottom: 4rem
}

.py-32 {
    padding-top: 8rem;
    padding-bottom: 8rem
}

/* Responsive paddings */
@media (min-width: 1024px) {
    .lg\:py-24 {
        padding-top: 6rem;
        padding-bottom: 6rem
    }

    .lg\:py-44 {
        padding-top: 11rem;
        padding-bottom: 11rem
    }
}

/* Gap utilities (grid/flex) */
.gap-2 {
    gap: .5rem
}

.gap-4 {
    gap: 1rem
}

.gap-6 {
    gap: 1.5rem
}

/* Grid columns */
.grid-cols-1 {
    grid-template-columns:repeat(1, minmax(0, 1fr))
}

@media (min-width: 640px) {
    .sm\:grid-cols-2 {
        grid-template-columns:repeat(2, minmax(0, 1fr))
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns:repeat(2, minmax(0, 1fr))
    }

    .md\:grid-cols-12 {
        grid-template-columns:repeat(12, minmax(0, 1fr))
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns:repeat(3, minmax(0, 1fr))
    }

    .lg\:grid-cols-4 {
        grid-template-columns:repeat(4, minmax(0, 1fr))
    }

    .lg\:grid-cols-12 {
        grid-template-columns:repeat(12, minmax(0, 1fr))
    }
}

/* Sizing */
.w-24 {
    width: 6rem
}

.h-24 {
    height: 6rem
}

.w-28 {
    width: 7rem
}

.h-16 {
    height: 4rem
}

.size-8 {
    width: 2rem;
    height: 2rem
}

.size-7 {
    width: 1.75rem;
    height: 1.75rem
}

.w-full {
    width: 100%
}

.h-full {
    height: 100%
}

/* Borders & radius */
.border {
    border: 1px solid rgba(0, 0, 0, .125)
}

.border-transparent {
    border-color: transparent
}

.border-gray-200 {
    border-color: #e5e7eb
}

.border-gray-300 {
    border-color: #d1d5db
}

.rounded {
    border-radius: .25rem
}

.rounded-md {
    border-radius: .375rem
}

.rounded-xl {
    border-radius: .75rem
}

.rounded-2xl {
    border-radius: 1rem
}

.rounded-full {
    border-radius: 9999px
}

/* Shadows */
.shadow {
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05)
}

.shadow-sm {
    box-shadow: 0 1px 2px rgba(0, 0, 0, .075)
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06)
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04)
}

/* Colors (subset) */
.bg-white {
    background-color: #fff
}

.bg-black {
    background-color: #000
}

.bg-gray-50 {
    background-color: #f9fafb
}

.bg-violet-600 {
    background-color: #7c3aed
}

.bg-violet-100 {
    background-color: #ede9fe
}

.bg-blue-100 {
    background-color: #dbeafe
}

.bg-emerald-100 {
    background-color: #d1fae5
}

.text-white {
    color: #fff
}

.text-gray-900 {
    color: #111827
}

.text-gray-800 {
    color: #1f2937
}

.text-gray-500 {
    color: #6b7280
}

.text-violet-600 {
    color: #7c3aed
}

.text-blue-800 {
    color: #1e40af
}

.text-emerald-800 {
    color: #065f46
}

/* Hover variants (subset) */
.hover\:bg-violet-700:hover {
    background-color: #6d28d9
}

/* Opacity */
.opacity-80 {
    opacity: .8
}

/* Utilities */
.mx-auto {
    margin-left: auto;
    margin-right: auto
}

.max-w-3xl {
    max-width: 48rem
}

.rounded-lg {
    border-radius: .5rem
}

.space-y-6 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-y-reverse: 0;
    margin-top: calc(1.5rem * (1 - var(--tw-space-y-reverse)));
    margin-bottom: calc(1.5rem * var(--tw-space-y-reverse))
}

/* Position helpers used in templates */
.top-0 {
    top: 0
}

.bottom-3 {
    bottom: .75rem
}

.bottom-5 {
    bottom: 1.25rem
}

.start-0 {
    left: 0
}

.end-0 {
    right: 0
}

.end-3 {
    right: .75rem
}

.end-5 {
    right: 1.25rem
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0
}

/* Typography */
.text-xs {
    font-size: .75rem;
    line-height: 1rem
}

.text-sm {
    font-size: .875rem;
    line-height: 1.25rem
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem
}

.font-medium {
    font-weight: 500
}

.font-semibold {
    font-weight: 600
}

.font-bold {
    font-weight: 700
}

/* Misc */
.inline-flex {
    display: inline-flex
}

.antialiased {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale
}


/* Fallback formatting for Tailwind Typography classes used in content areas */
.prose {
    color: inherit;
    max-width: 100%;
    line-height: 1.7
}

.prose p {
    margin-bottom: 1rem
}

.prose h1 {
    font-size: 2rem;
    margin-top: 1.5rem;
    margin-bottom: .75rem;
    font-weight: 700
}

.prose h2 {
    font-size: 1.5rem;
    margin-top: 1.25rem;
    margin-bottom: .5rem;
    font-weight: 600
}

.prose h3 {
    font-size: 1.25rem;
    margin-top: 1rem;
    margin-bottom: .5rem;
    font-weight: 600
}

.prose ul {
    padding-left: 1.25rem;
    margin-bottom: 1rem
}

.prose ol {
    padding-left: 1.25rem;
    margin-bottom: 1rem
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: .375rem
}

.prose-lg {
    font-size: 1.0625rem
}

.prose-slate {
    color: #0f172a
}

.dark\:prose-invert {
    color: #e5e7eb
}


/* --- Compatibility extras for Bootstrap migration --- */
/* Semi-transparent black backgrounds used in legacy templates */
.bg-black\/50 {
    background-color: rgba(0, 0, 0, .5) !important;
}

.bg-black\/60 {
    background-color: rgba(0, 0, 0, .6) !important;
}

/* Backdrop blur utility used by overlays */
.backdrop-blur-sm {
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}


/* Typography smoothing for legacy 'antialiased' class */
.antialiased {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Accessibility helpers for focus and pagination (2025-09-17, updated 2025-09-17 23:00) */
.a11y-focus-ring:focus-visible,
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.page-link:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #0d6efd; /* Bootstrap primary blue: meets WCAG AA on white */
    outline-offset: 2px;
    border-radius: 0.375rem;
}

.pagination-link {
    min-width: 2.5rem; /* >= 40px */
    height: 2.5rem;
}


:root {
  --brand-purple: #8b5cf6; /* tweak to match your theme */
}

/* Glass / gradient header like screenshots */
.header-glass {
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.86));
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}

/* Brand treatment */
.brand-lockup { letter-spacing: .3px; }
.brand-mark { height: 28px; width: auto; display: inline-block; }
.navbar-brand { color: #1f1f1f; }
.navbar-brand:hover { color: #1f1f1f; text-decoration: none; }

/* Nav links: weight + underline on active/hover + purple accent */
.main-nav { gap: .5rem; }                    /* tighter spacing between items */
.main-nav .nav-link {
  font-weight: 600;                           /* bolder */
  letter-spacing: .1px;
}

.main-nav .nav-link:hover { color: #111; }
.main-nav .nav-link.active { color: var(--brand-purple); font-weight: 700; }
.main-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: .35rem;
  height: 2px;
  background: transparent;
  transition: all .22s ease;
}
.main-nav .nav-link:hover::after,
.main-nav .nav-link.active::after {
  background: var(--brand-purple);
}

/* Dropdown */
.dropdown-menu {
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.06);
  padding: .5rem;
}
.dropdown-item { border-radius: 8px; }
.dropdown-item:hover { background: rgba(139,92,246,.08); color: #111; }

/* Right tools: circular buttons like screenshot */
.btn.btn-icon,
.avatar-ring,
.lang-circle {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: none;
  overflow: hidden;                            /* ensures nothing spills outside the circle */
  line-height: 1;                              /* centers icon glyphs vertically */
}
.soft-light { background: rgba(0,0,0,.06); }
/* optional: unify purple buttons */
.soft-primary { background: var(--brand-purple); color:#fff; }
.soft-primary:hover { filter: brightness(.95); color:#fff; }

/* Avatar with purple ring */

.avatar-ring img { width: 100%; height: 100%; object-fit: cover; }

.lang-circle img {
  width: 100%; height: 100%;
  object-fit: cover;                           /* fills the circle, no rectangular edges */
  display: block;                              /* removes inline-gap artifacts */
  border-radius: 50%;                          /* guarantees circular crop */
  background: transparent;                     /* no white box behind pngs */
}

/* Layout tweaks */
@media (min-width: 992px) {
  /* left-align brand on desktop; allow default Bootstrap flow */
  .navbar .navbar-brand { position: static; left: auto; transform: none; }
  .navbar .tools-cluster { position: static; right: auto; }
}



/* NOTICE (2025-09-17): Tailwind-compat utility classes in this file are deprecated.
   Templates should use Bootstrap 5 utilities/components instead. Only add new styles
   as Bootstrap overrides/extensions. Remove unused compat utilities gradually. */


/* Accessibility helpers: focusable skip links and large tap targets */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.visually-hidden-focusable:focus, .visually-hidden-focusable:focus-within {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
}

/* Ensure interactive icon buttons meet 44x44 tap targets */
.nav-icon {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
}

/* ==============================
   11) Content density & readability
   Typographic scale, spacing tokens, readable content utilities
   ============================== */
:root {
  /* Typography scale (approx. Major Third) */
  --font-xxs: 0.75rem;   /* 12px */
  --font-xs:  0.8125rem; /* 13px */
  --font-sm:  0.875rem;  /* 14px */
  --font-md:  1rem;      /* 16px (base) */
  --font-lg:  1.25rem;   /* 20px */
  --font-xl:  1.5rem;    /* 24px */
  --font-2xl: 1.875rem;  /* 30px */
  --font-3xl: 2.25rem;   /* 36px */
  --font-4xl: 3rem;      /* 48px */

  /* Line-heights */
  --lh-tight: 1.25;
  --lh-normal: 1.6;
  --lh-relaxed: 1.8;

  /* Spacing scale (8px base) */
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem;  /* 8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem;    /* 16px */
  --space-5: 1.5rem;  /* 24px */
  --space-6: 2rem;    /* 32px */
  --space-7: 3rem;    /* 48px */
  --space-8: 4rem;    /* 64px */

  /* Readable measure */
  --measure: 72ch; /* target ~65–80ch */
}

/* Apply improved defaults */
body {
  font-size: var(--font-md);
  line-height: var(--lh-normal);
}

/* Headings rhythm */
h1, .h1 { line-height: var(--lh-tight); margin-top: var(--space-6); margin-bottom: var(--space-3); }
h2, .h2 { line-height: var(--lh-tight); margin-top: var(--space-5); margin-bottom: var(--space-3); }
h3, .h3 { line-height: var(--lh-tight); margin-top: var(--space-5); margin-bottom: var(--space-2); }
h4, .h4 { line-height: var(--lh-tight); margin-top: var(--space-4); margin-bottom: var(--space-2); }
h5, .h5 { line-height: var(--lh-tight); margin-top: var(--space-3); margin-bottom: var(--space-1); }
h6, .h6 { line-height: var(--lh-tight); margin-top: var(--space-3); margin-bottom: var(--space-1); }

/* Long-form content utility: limit paragraph width, comfortable leading */
.prose {
  --prose-spacing: var(--space-4);
  color: inherit;
}
.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose table {
  max-width: var(--measure);
  line-height: var(--lh-relaxed);
}
.prose p { margin: 0 0 var(--prose-spacing); }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 var(--prose-spacing); }
.prose li { margin: 0 0 var(--space-2); }
.prose blockquote { border-left: 4px solid rgba(0,0,0,.08); padding-left: var(--space-3); margin: 0 0 var(--prose-spacing); font-style: italic; }
.prose img, .prose video { max-width: 100%; height: auto; border-radius: .5rem; margin: var(--prose-spacing) 0; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { max-width: var(--measure); }
.prose h1 { font-size: var(--font-3xl); }
.prose h2 { font-size: var(--font-2xl); }
.prose h3 { font-size: var(--font-xl); }

/* Center long-form blocks within container on larger screens */
@media (min-width: 768px) {
  .prose > * { margin-left: auto; margin-right: auto; }
}

/* Optional wrapper to apply readable measure site-wide when needed */
.content-readable { max-width: var(--measure); }

/* ==============================
   12) Icons and imagery
   Sizing utilities and defaults for Feather icons; keep decorative icons hidden from AT.
   ============================== */
/* Feather inserts inline SVGs with class .feather */
.feather { width: 1em; height: 1em; vertical-align: -0.125em; }
.icon-14 .feather, .feather.icon-14 { width: 14px; height: 14px; }
.icon-16 .feather, .feather.icon-16 { width: 16px; height: 16px; }
.icon-20 .feather, .feather.icon-20 { width: 20px; height: 20px; }
.icon-24 .feather, .feather.icon-24 { width: 24px; height: 24px; }
.icon-32 .feather, .feather.icon-32 { width: 32px; height: 32px; }

/* Decorative icon helper */
[aria-hidden="true"].feather { focusable: false; }


/* ==============================
   13) Dark mode (production-ready): color tokens and components
   ============================== */
/* Logo swap helpers */
.brand-logo-light { display: none; }
html.dark .brand-logo-dark { display: none; }
html.dark .brand-logo-light { display: inline; }

/* Bootstrap CSS variables for light (fallback) and dark */
:root {
  --mx-surface-0: #ffffff;
  --mx-surface-1: #f8fafc; /* light slate-50 */
  --mx-text-0: #0f172a;    /* slate-900 */
  --mx-text-1: #334155;    /* slate-600 */
}
html.dark {
  color-scheme: dark;
  /* Body and text */
  --bs-body-bg: #0b1220;         /* near-slate-950 */
  --bs-body-color: #e2e8f0;      /* slate-200 */
  --bs-secondary-color: rgba(226,232,240,.75);
  --bs-tertiary-color: rgba(226,232,240,.55);
  --bs-heading-color: #f8fafc;   /* slate-50 */
  /* Surfaces */
  --bs-card-bg: #0f172a;         /* slate-900 */
  --bs-card-color: #e2e8f0;
  --bs-card-border-color: #1f2937; /* slate-800 */
  --bs-dropdown-bg: #0f172a;
  --bs-dropdown-link-color: #e2e8f0;
  --bs-dropdown-link-hover-color: #0b1220;
  --bs-dropdown-link-hover-bg: rgba(148,163,184,.2);
  --bs-modal-bg: #0f172a;
  --bs-modal-color: #e2e8f0;
  --bs-border-color: #334155;      /* slate-700 */
  /* Links */
  --bs-link-color: #93c5fd;       /* blue-300 */
  --bs-link-hover-color: #bfdbfe; /* blue-200 */
}

/* Navbar and header tweaks on dark */
html.dark .navbar { background-color: rgba(2,6,23,.9) !important; border-bottom: 1px solid rgba(148,163,184,.15); }
html.dark .navbar .nav-link { color: var(--bs-body-color); }
html.dark .navbar .nav-link.active { color: #a78bfa; }

/* Modal / Dropdown inherit dark tokens */
html.dark .modal .modal-content { background-color: var(--bs-modal-bg) !important; color: var(--bs-modal-color) !important; }
html.dark .dropdown-menu { background-color: var(--bs-dropdown-bg); color: var(--bs-dropdown-link-color); border-color: var(--bs-border-color); }
/* override Bootstrap utilities that force light colors */
html.dark .bg-white { background-color: var(--bs-card-bg) !important; }
html.dark .text-dark { color: var(--bs-body-color) !important; }

/* Card, list group, inputs */
html.dark .card { background-color: var(--bs-card-bg); color: var(--bs-card-color); border-color: var(--bs-card-border-color); }
html.dark .list-group-item { background-color: var(--bs-card-bg); color: var(--bs-card-color); border-color: var(--bs-card-border-color); }
html.dark .form-control, html.dark .form-select { background-color: #0b1324; color: #e2e8f0; border-color: #334155; }
html.dark .form-control::placeholder { color: #94a3b8; }
html.dark .btn-outline-secondary { color: #e2e8f0; border-color: #475569; }

/* Focus ring (visible in light/dark) */
.a11y-focus-ring:focus, .a11y-focus-ring:focus-visible,
.btn:focus, .form-control:focus, .form-select:focus, .nav-link:focus {
  outline: 2px solid #a78bfa !important; outline-offset: 2px; box-shadow: none !important;
}
/* Ensure anchors and dropdown/list items also get a visible focus ring in both themes */
a:focus, a:focus-visible,
.dropdown-item:focus, .dropdown-item:focus-visible,
.list-group-item:focus, .list-group-item:focus-visible,
.page-link:focus, .page-link:focus-visible {
  outline: 2px solid #a78bfa !important; outline-offset: 2px; box-shadow: none !important;
}

/* ==============================
   14) Micro-interactions: subtle transitions and reduced motion
   ============================== */
@media (prefers-reduced-motion: no-preference) {
  a, .btn, .card, .form-control, .form-select, .nav-link, .dropdown-menu, .alert, .badge {
    transition: color .15s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
  }
  .card:hover { transform: translateY(-1px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Skeleton loading */
.skeleton { position: relative; overflow: hidden; background: linear-gradient(90deg, rgba(148,163,184,.15) 25%, rgba(148,163,184,.25) 37%, rgba(148,163,184,.15) 63%); }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transform: translateX(-100%); animation: skeleton-shimmer 1.2s infinite; }
@keyframes skeleton-shimmer { 100% { transform: translateX(100%);} }
.skeleton-text { height: 0.75rem; border-radius: 0.25rem; }
.skeleton-rect { border-radius: 0.5rem; }
html.dark .skeleton { background: linear-gradient(90deg, rgba(51,65,85,.35) 25%, rgba(51,65,85,.55) 37%, rgba(51,65,85,.35) 63%); }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }

/* Preset skeleton blocks */
.skel-list-item { height: 2.25rem; border-radius: .5rem; }
.skel-card {
  border-radius: .75rem; padding: .75rem; border: 1px solid var(--bs-border-color);
}
.skel-card .skel-thumb { height: 140px; border-radius: .5rem; }
.skel-card .skel-line { height: .75rem; border-radius: .25rem; }

/* ==============================
   15) SEO hygiene: theme color for light/dark (visual only, meta added in head)
   ============================== */
:root { --theme-color-light: #ffffff; --theme-color-dark: #0b1220; }

/* ==============================
   16) Print styles: minimal, readable course detail
   ============================== */
@media print {
  /* Remove chrome */
  #mainNavbar, footer, .modal, .dropdown-menu, #back-to-top, .btn, .alert, .navbar, .breadcrumb, .pagination { display: none !important; }
  /* Simplify colors */
  body { background: #fff !important; color: #000 !important; }
  * { background: transparent !important; box-shadow: none !important; text-shadow: none !important; }
  a, a:visited { color: #000 !important; text-decoration: underline; }
  img { max-width: 100% !important; page-break-inside: avoid; }
  /* Layout */
  .container { max-width: 100% !important; padding: 0 1rem !important; }
  /* Course detail: ensure prose is readable */
  .prose { max-width: 100% !important; line-height: 1.6 !important; }
  .no-print { display: none !important; }
}


/* Hero overlay tokens for light/dark (2025-09-18) */
:root { 
  --hero-overlay-bg: rgba(0,0,0,.6);
  --hero-overlay-bg-strong: rgba(0,0,0,.75);
}
html.dark {
  --hero-overlay-bg: rgba(0,0,0,.45);
  --hero-overlay-bg-strong: rgba(0,0,0,.6);
}
.hero-overlay { position: absolute; inset: 0; background: var(--hero-overlay-bg); }
.hero-overlay-strong { position: absolute; inset: 0; background: var(--hero-overlay-bg-strong); }
.hero-overlay-gradient { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, var(--hero-overlay-bg) 100%); }
