/* ─────────────────────────────────────────
   TOKENS
───────────────────────────────────────── */
:root {
  --blue:      #1a4ed8;
  --blue-dark: #1239a8;
  --blue-dim:  #e8eefb;
  --ink:       #0f172a;
  --muted:     #64748b;
  --border:    #e2e8f0;
  --bg:        #f8faff;
  --paper:     #ffffff;

  --font-display: 'Lora', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --radius:    10px;
  --radius-lg: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
em { font-style: italic; }

/* ─────────────────────────────────────────
   NAVBAR
───────────────────────────────────────── */
.site-header {
  background: rgba(255,255,255,0.95) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.logo { display: flex; align-items: center; gap: 0.6rem; }

.logo-mark {
  width: 32px; height: 32px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.logo-text em { color: var(--blue); }

.nav-custom {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: var(--muted) !important;
  padding: 0.35rem 0.6rem !important;
  border-radius: var(--radius) !important;
  transition: color 0.2s, background 0.2s !important;
}
.nav-custom:hover {
  color: var(--ink) !important;
  background: var(--bg) !important;
}

.nav-search {
  display: flex;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  max-width: 280px;
  width: 100%;
}
.nav-search:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,78,216,0.1);
  background: var(--paper);
}
.nav-search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.45rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink);
}
.nav-search-input::placeholder { color: #a0aec0; }
.nav-search-btn {
  background: transparent;
  border: none;
  padding: 0 0.9rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s;
  font-size: 0.9rem;
}
.nav-search-btn:hover { color: var(--blue); }

/* ─────────────────────────────────────────
   NAVBAR AUTH
───────────────────────────────────────── */
.nav-username {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tutor-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--blue-dim);
  color: var(--blue-dark);
  border: 1px solid rgba(26,78,216,0.2);
  padding: 0.1rem 0.45rem;
  border-radius: 50px;
  margin-left: 0.25rem;
}

.nav-login-btn {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
  text-decoration: none;
}
.nav-login-btn:hover { color: var(--ink); background: var(--bg); }

.nav-register-btn {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius);
  transition: background 0.2s;
  text-decoration: none;
}
.nav-register-btn:hover { background: var(--blue-dark); color: #fff; }

.nav-logout-btn {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.nav-logout-btn:hover { color: var(--ink); background: var(--bg); }

a.nav-username {
  text-decoration: none;
  transition: color 0.2s;
}
a.nav-username:hover { color: var(--blue); }

/* ─────────────────────────────────────────
   HERO
───────────────────────────────────────── */
.hero {
  padding: 5rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1.1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.07;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1.1rem;
  max-width: 640px;
}
.hero-title em { color: var(--blue); }

.hero-sub {
  font-size: 1rem;
  color: var(--muted);
  max-width: 460px;
  margin: 0 auto 2.25rem;
  line-height: 1.75;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-content { animation: fadeUp 0.55s ease both; }

/* ─────────────────────────────────────────
   SEARCH BAR
───────────────────────────────────────── */
.search-form {
  display: flex;
  width: 100%;
  max-width: 520px;
  border-radius: 50px;
  overflow: hidden;
  border: 1.5px solid var(--blue);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(26,78,216,0.08);
  transition: box-shadow 0.2s;
}
.search-form:focus-within { box-shadow: 0 0 0 5px rgba(26,78,216,0.16); }

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.9rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
}
.search-input::placeholder { color: #a0aec0; }

.search-btn {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 0 1.6rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.search-btn:hover { background: var(--blue-dark); }
.search-form--page { margin-top: 1.25rem; max-width: 560px; }

/* ─────────────────────────────────────────
   BROWSE — homepage
───────────────────────────────────────── */
.browse-wrapper { padding-top: 2.5rem; padding-bottom: 4rem; }

.group-block { margin-bottom: 3rem; }
.group-block:last-child { margin-bottom: 0; }

.group-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.9rem;
  padding-bottom: 0.55rem;
  border-bottom: 1.5px solid var(--blue-dim);
}

/* ─────────────────────────────────────────
   CATEGORY CARDS (homepage)
───────────────────────────────────────── */
.cat-card {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  display: flex !important;
  flex-direction: column;
  gap: 0.35rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  text-decoration: none !important;
  color: var(--ink) !important;
}
.cat-card:hover {
  border-color: var(--blue);
  box-shadow: 0 6px 24px rgba(26,78,216,0.1);
  transform: translateY(-2px);
  color: var(--ink) !important;
}

.cat-icon {
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.65rem;
  color: var(--blue);
}

.cat-card h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.cat-card p {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

/* ─────────────────────────────────────────
   SUBSECTION CARDS (section page)
───────────────────────────────────────── */
.subsection-card {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.1rem 1.25rem;
  min-height: 92px;
  border: 1.5px solid var(--blue-dim);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s;
  text-decoration: none !important;
  color: var(--ink) !important;
}
.subsection-card:hover {
  border-color: var(--blue);
  background: var(--blue-dim);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26,78,216,0.1);
  color: var(--ink) !important;
}
.subsection-card-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.subsection-card-count {
  font-size: 0.72rem;
  color: var(--blue);
  font-weight: 500;
}

/* ─────────────────────────────────────────
   PAGE HEADER
───────────────────────────────────────── */
.page-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0 1.75rem;
}

.breadcrumb-item a { color: var(--blue); }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: var(--muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--border); }

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 0;
}
.page-title em { color: var(--blue); }

.page-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ─────────────────────────────────────────
   CONTENT WRAPPER
───────────────────────────────────────── */
.content-wrapper { padding-top: 2.5rem; padding-bottom: 5rem; }

.results-count {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* ─────────────────────────────────────────
   COURSE CARDS — column layout (legacy)
───────────────────────────────────────── */
.resource-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
}
.resource-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 20px rgba(26,78,216,0.1);
  transform: translateY(-2px);
  color: inherit;
}

.resource-thumb {
  width: calc(100% + 2.8rem);
  margin: -1.4rem -1.4rem 0.75rem;
  height: 160px;
  background-color: var(--bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  flex-shrink: 0;
}
.resource-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.resource-thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--blue);
  background: var(--blue-dim);
}

/* ─────────────────────────────────────────
   COURSE CARDS — row layout
───────────────────────────────────────── */
.resource-card-row {
  display: flex;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
}
.resource-card-row:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 20px rgba(26,78,216,0.1);
  transform: translateY(-2px);
  color: inherit;
}

.resource-thumb-row {
  width: 200px;
  min-width: 200px;
  min-height: 112px;
  background: var(--blue-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--blue);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.resource-thumb-row img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
}

.resource-card-body {
  flex: 1;
  min-width: 0;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* ─────────────────────────────────────────
   SHARED CARD ELEMENTS
───────────────────────────────────────── */
.resource-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.resource-type {
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.22rem 0.65rem;
  border-radius: 50px;
  width: fit-content;
}
.resource-type.yt   { background: #fff0f0; color: #c0392b; }
.resource-type.web  { background: var(--blue-dim); color: var(--blue-dark); }
.resource-type.both { background: #f0e6ff; color: #5b21b6; }

.resource-content-type {
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.65rem;
  border-radius: 50px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.resource-body h3 {
  font-family: var(--font-display);
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin: 0;
}
.resource-author {
  font-size: 0.78rem;
  color: var(--blue);
  margin-top: 0.15rem;
}
.resource-body p {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}
.resource-desc {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
}
.resource-tag {
  font-size: 0.68rem;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--muted);
}

/* ─────────────────────────────────────────
   EMPTY STATES
───────────────────────────────────────── */
.empty-state {
  padding: 4rem 0;
  text-align: center;
  color: var(--muted);
  line-height: 2.2;
}
.empty-state a { color: var(--blue); }
.empty-sub { font-size: 0.83rem; color: var(--muted); padding: 0.75rem 0; margin: 0; }

/* ─────────────────────────────────────────
   FILTER BAR
───────────────────────────────────────── */
.filter-bar {
  margin-bottom: 1.5rem;
  padding: 0.9rem 1.1rem;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
}

.filter-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.filter-bar-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s;
}
.filter-clear:hover { color: var(--blue-dark); text-decoration: underline; }

.filter-clear-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--blue);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 50%;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}

.filter-chip-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-chip-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 0.1rem;
}

.filter-select {
  appearance: none;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E") no-repeat right 0.6rem center;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 0.3rem 1.8rem 0.3rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.filter-select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,78,216,0.1);
}
.filter-select:hover { border-color: var(--blue); }

.filter-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  margin: 0 0.25rem;
  align-self: flex-end;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
  align-self: flex-end;
}
.filter-toggle input { display: none; }
.filter-toggle:hover { border-color: var(--blue); color: var(--blue); }
.filter-toggle--on {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-dim);
  font-weight: 600;
}

/* ─────────────────────────────────────────
   CTA
───────────────────────────────────────── */
.cta-section {
  background: var(--blue);
  padding: 4.5rem 1.5rem;
  text-align: center;
}
.cta-inner { max-width: 500px; margin: 0 auto; }
.cta-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.65rem;
}
.cta-inner p { color: rgba(255,255,255,0.72); margin-bottom: 1.75rem; font-size: 0.95rem; }
.cta-btn {
  display: inline-block;
  background: #fff;
  color: var(--blue);
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.8rem 1.9rem;
  border-radius: 50px;
  transition: opacity 0.2s, transform 0.15s;
}
.cta-btn:hover { opacity: 0.9; transform: translateY(-2px); color: var(--blue); }

/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */
.site-footer {
  margin-top: auto;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.footer-legal p {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

.footer-sep {
  font-size: 0.78rem;
  color: var(--border);
}

.footer-legal a {
  font-size: 0.78rem;
  color: var(--muted);
  transition: color 0.2s;
}
.footer-legal a:hover { color: var(--blue); }

.footer-cookie-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  transition: color 0.2s;
}
.footer-cookie-btn:hover { color: var(--blue); }

@media (max-width: 767px) {
  .nav-search { max-width: 100%; margin-top: 0.75rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
}

/* ─────────────────────────────────────────
   AUTH PAGES
───────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
}

.auth-header { margin-bottom: 2rem; }

.auth-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.auth-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.auth-field { margin-bottom: 1.25rem; }

.auth-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.auth-optional { font-weight: 400; color: var(--muted); }

.auth-field .form-control {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--paper);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.auth-field .form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,78,216,0.1);
  outline: none;
}

.auth-error, .auth-field-error {
  font-size: 0.8rem;
  color: #dc2626;
  margin-top: 0.35rem;
}

.auth-submit {
  width: 100%;
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 0.75rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.2s;
}
.auth-submit:hover { background: var(--blue-dark); }

.auth-switch {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 1.5rem;
  margin-bottom: 0;
}
.auth-switch a { color: var(--blue); font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; }

.alert-None, .alert-info { --bs-alert-color: #1a4ed8; --bs-alert-bg: #e8eefb; --bs-alert-border-color: rgba(26,78,216,.2); }
.alert-success { --bs-alert-color: #15803d; }

/* ─────────────────────────────────────────
   COURSE DETAIL PAGE
───────────────────────────────────────── */
.course-hero { margin-bottom: 3rem; }

.course-thumb-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
  border: 1.5px solid var(--border);
}

.course-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.course-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 900;
  color: var(--blue);
  background: var(--blue-dim);
}

.course-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.course-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 0.65rem;
}

.course-byline {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.course-byline strong { color: var(--blue); font-weight: 600; }

.course-short {
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.course-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.btn-primary-cta {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.7rem 1.5rem;
  border-radius: 50px;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}
.btn-primary-cta:hover { background: var(--blue-dark); color: #fff; transform: translateY(-1px); }

.btn-youtube-cta {
  display: inline-block;
  background: #ff0000;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.7rem 1.5rem;
  border-radius: 50px;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}
.btn-youtube-cta:hover { background: #cc0000; color: #fff; transform: translateY(-1px); }

.btn-website-cta {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.7rem 1.5rem;
  border-radius: 50px;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}
.btn-website-cta:hover { background: var(--blue-dark); color: #fff; transform: translateY(-1px); }

.btn-secondary-cta {
  display: inline-block;
  background: var(--paper);
  color: var(--ink);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.7rem 1.2rem;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.btn-secondary-cta:hover { border-color: var(--blue); background: var(--blue-dim); color: var(--ink); }

.course-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.course-section-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.course-prose {
  font-size: 0.975rem;
  color: var(--ink);
  line-height: 1.75;
  max-width: 720px;
}
.course-prose p { margin-bottom: 1rem; }

.detail-card {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.detail-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-value-big {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.detail-unit { font-size: 0.85rem; color: var(--muted); margin-left: 0.15rem; }
.detail-value { display: flex; align-items: center; gap: 0.5rem; }
.detail-sub { font-size: 0.8rem; color: var(--muted); }
.detail-value-big .yes { color: var(--blue); }
.detail-value-big .no  { color: var(--muted); }

.rating { display: inline-flex; gap: 3px; }
.rating .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
}
.rating .dot.filled { background: var(--blue); }

.mirror-list { list-style: none; padding: 0; margin: 0; }
.mirror-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.mirror-list li:last-child { border-bottom: none; }
.mirror-list a { color: var(--blue); font-size: 0.9rem; word-break: break-all; }
.mirror-list a:hover { text-decoration: underline; }

.detail-value-label { font-size: 0.85rem; font-weight: 600; line-height: 1.35; margin-top: 0.15rem; }
.difficulty-absolute_beginner { color: #16a34a; }
.difficulty-beginner          { color: #2563eb; }
.difficulty-intermediate      { color: #d97706; }
.difficulty-advanced          { color: #dc2626; }
.difficulty-expert            { color: #7c3aed; }

.format-badge {
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.65rem;
  border-radius: 50px;
  background: #f0f4ff;
  color: var(--blue-dark);
  border: 1px solid var(--blue-dim);
}

/* ─────────────────────────────────────────
   COURSE RATINGS
───────────────────────────────────────── */
.ratings-row { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.rating-block { display: flex; flex-direction: column; gap: 0.35rem; }

.rating-block-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.rating-stars-row { display: flex; align-items: center; gap: 0.2rem; }
.rating-star { font-size: 1.15rem; color: #f59e0b; }
.rating-num {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin-left: 0.4rem;
}
.rating-count { font-size: 0.75rem; color: var(--muted); }
.rating-empty { font-size: 0.85rem; color: var(--muted); font-style: italic; }

.user-rating-wrap { padding-top: 1.5rem; border-top: 1px solid var(--border); }
.user-rating-label { font-size: 0.82rem; font-weight: 600; color: var(--ink); margin-bottom: 0.6rem; letter-spacing: 0.02em; }
.user-rating-form { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.star-picker { display: flex; gap: 0.2rem; cursor: pointer; }
.star-btn { font-size: 1.75rem; color: #d1d5db; transition: color 0.1s, transform 0.1s; cursor: pointer; line-height: 1; }
.star-btn:hover { transform: scale(1.15); }
.star-btn.bi-star-fill { color: #f59e0b; }

.btn-rate {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-rate:hover { background: var(--blue-dark); }

.btn-rate-remove {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--muted);
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-rate-remove:hover { border-color: #dc2626; color: #dc2626; }

.rating-login-prompt {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.rating-login-prompt a { color: var(--blue); }

/* ─────────────────────────────────────────
   BOOKMARK BUTTONS
───────────────────────────────────────── */
.bookmark-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.bookmark-actions form { margin: 0; }

.btn-bookmark {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--paper);
  color: var(--muted);
  border: 1.5px solid var(--border);
  padding: 0.55rem 1.1rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.btn-bookmark i { font-size: 1rem; }
.btn-bookmark:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-dim); }

.btn-bookmark--active {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-dim);
  font-weight: 600;
}
.btn-bookmark--active:hover { border-color: #dc2626; color: #dc2626; background: #fff5f5; }

.btn-bookmark--done {
  border-color: #16a34a;
  color: #16a34a;
  background: #f0fdf4;
  font-weight: 600;
}
.btn-bookmark--done:hover { border-color: #dc2626; color: #dc2626; background: #fff5f5; }

/* ─────────────────────────────────────────
   PROFILE PAGE
───────────────────────────────────────── */
.profile-section { margin-bottom: 4rem; }
.profile-section:last-child { margin-bottom: 0; }

.profile-section-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid var(--border);
}

.profile-section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.profile-section-count { font-size: 0.8rem; color: var(--muted); }

.profile-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 3rem 0;
  color: var(--muted);
  text-align: center;
}
.profile-empty i { font-size: 2.5rem; opacity: 0.35; }
.profile-empty p { font-size: 0.95rem; margin: 0; }
.profile-empty a { font-size: 0.875rem; color: var(--blue); font-weight: 500; }

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 480px) {
  .resource-thumb-row { width: 110px; min-width: 110px; font-size: 1.5rem; }
}

/* ─────────────────────────────────────────
   GOOGLE OAUTH BUTTON
───────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn-google:hover {
  border-color: #4285F4;
  box-shadow: 0 0 0 3px rgba(66,133,244,0.1);
  background: #fafafa;
  color: var(--ink);
}

.btn-google-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   COOKIE BANNER
───────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 3rem);
  max-width: 580px;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.09);
  z-index: 9999;
  animation: fadeUp 0.3s ease both;
}

.cookie-banner-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.cookie-text { flex: 1; min-width: 0; }

.cookie-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.cookie-text p {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.cookie-text a {
  color: var(--blue);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cookie-btn {
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.cookie-btn:hover { opacity: 0.8; }

.cookie-btn--accept {
  background: var(--blue);
  color: #fff;
}

.cookie-btn--decline {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}

@media (max-width: 540px) {
  .cookie-banner {
    bottom: 0; left: 0; right: 0;
    width: 100%; transform: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .cookie-banner-inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .cookie-actions { width: 100%; justify-content: flex-end; }
}

/* ─────────────────────────────────────────
   PRIVACY PAGE
───────────────────────────────────────── */
.privacy-body { max-width: 720px; }

.privacy-toc {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.4rem;
  margin-bottom: 2.5rem;
}

.privacy-toc-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.privacy-toc ol {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 1rem;
}

.privacy-toc li { margin: 0; }

.privacy-toc a {
  font-size: 0.82rem;
  color: var(--blue);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.privacy-toc a::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--blue-dim);
  border: 1.5px solid var(--blue);
  flex-shrink: 0;
}

.privacy-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.privacy-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.privacy-section-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.privacy-section-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--blue-dim);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.privacy-section h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.privacy-section p, .privacy-section li {
  font-size: 0.875rem;
  color: var(--ink);
  line-height: 1.75;
}
.privacy-section ul { padding-left: 1.2rem; margin-top: 0.5rem; }
.privacy-section li { margin-bottom: 0.4rem; }
.privacy-section a { color: var(--blue); }

.rights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.right-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
}

.right-icon {
  color: var(--blue);
  flex-shrink: 0;
  margin-top: 0.15rem;
  font-size: 0.9rem;
}

.right-text { font-size: 0.8rem; color: var(--ink); line-height: 1.45; }

.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--blue-dim);
  border: 1.5px solid rgba(26,78,216,0.2);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-top: 0.75rem;
}

.contact-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.contact-label { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.2rem; }
.contact-value { font-size: 0.9rem; font-weight: 600; color: var(--blue); }

@media (max-width: 540px) {
  .privacy-toc ol { grid-template-columns: 1fr; }
  .rights-grid { grid-template-columns: 1fr; }
}