/* ── Reset & root ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --brand: #007688;
  --bg: #f4f6f8;
  --surface: #fff;
  --text: #1a1a2e;
  --text-muted: #5a6375;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0, 0, 0, .10);
  --shadow-hover: 0 6px 20px rgba(0, 0, 0, .16);
}

body {
  font-family: "CV Source Sans", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ── */
header {
  background: #fff;
  color: var(--text);
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  border-bottom: 3px solid var(--brand);
}

.header-logo {
  height: 42px;
  width: auto;
  display: block;
}

.header-sub {
  font-size: .85rem;
  color: var(--text-muted);
}

/* ── Nav ── */
header+nav {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 0 32px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  position: sticky;
  top: 64px;
  z-index: 99;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
  border-radius: 4px 4px 0 0;
}

.nav-link img {
  flex-shrink: 0;
  border-radius: 4px;
}

.nav-link:hover {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: rgba(0, 118, 136, .05);
}

/* ── Main ── */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ── Category section ── */
.category {
  margin-bottom: 48px;
  scroll-margin-top: 100px;
}

.cat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.cat-icon {
  flex-shrink: 0;
  display: block;
}

.cat-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  flex: 1;
}

.cat-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.cat-count {
  font-size: .78rem;
  color: var(--text-muted);
  background: #f0f2f5;
  padding: 2px 10px;
  border-radius: 20px;
}

.cat-num {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cat-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .15s, transform .15s;
}

.cat-toggle:hover {
  background: #f0f2f5;
}

.category.collapsed .cat-toggle {
  transform: rotate(-90deg);
}

.category.collapsed .cards-grid {
  display: none;
}

/* ── Back to top ── */
.back-to-top {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: #E2001A;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s, transform .15s;
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
}

/* ── Cards (ul/li) ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  list-style: none;
  padding: 0;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .15s, transform .15s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.card-levels {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.level-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none;
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity .15s, transform .1s;
}

.level-btn:hover {
  opacity: .82;
  transform: scale(1.05);
}

/* ── Teacher banner ── */
.teacher-banner {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
  position: sticky;
  top: 112px;
  z-index: 98;
}

.teacher-banner-text {
  font-size: .88rem;
  color: #856404;
  line-height: 1.5;
  flex: 1;
  min-width: 250px;
}

.teacher-banner-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: var(--brand);
  color: #fff;
  border-radius: 20px;
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity .15s, transform .1s;
}

.teacher-banner-btn:hover {
  opacity: .85;
  transform: scale(1.03);
}

/* ── Footer ── */
footer {
  background: var(--surface);
  border-top: 1px solid #e0e0e0;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .82rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  background: none;
  border: none;
  padding: 0;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ── SPARKvue hint ── */
.sparkvue-hint {
  padding: 12px 20px;
  margin: 0;
  font-size: .88rem;
  color: var(--text-muted);
  background: rgba(0, 118, 136, .05);
  border-top: 1px solid #e0e0e0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.sparkvue-hint a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.sparkvue-hint a:hover {
  text-decoration: underline;
}

/* ── Contact hint ── */
.contact-hint {
  text-align: center;
  padding: 16px 32px;
  font-size: .85rem;
  color: var(--text-muted);
  background: var(--surface);
  border-top: 1px solid #e0e0e0;
}

.contact-hint a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.contact-hint a:hover {
  text-decoration: underline;
}

/* ── Mobile ── */
@media (max-width: 600px) {
  header {
    padding: 0 16px;
  }

  nav {
    padding: 0 8px;
  }

  main {
    padding: 16px 12px 48px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  footer {
    padding: 16px;
  }
}

/* ── Cookie Consent Popup ── */
.cc-modal-backdrop {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1050;
  display: none;
}
.cc-modal-backdrop.show { display: block; }

.cc-modal {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1055;
  overflow: auto;
  display: none;
}
.cc-modal.show { display: block; }

.cc-modal-dialog {
  position: relative;
  margin: 28px auto;
  max-width: 500px;
  width: auto;
}

.cc-modal-content {
  background-color: #fff;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.176);
  display: flex;
  flex-direction: column;
  position: relative;
}

.cc-modal-header {
  padding: 16px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
}

.cc-modal-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.cc-modal-body {
  padding: 16px;
  position: relative;
  flex: 1 1 auto;
}

.cc-inner { padding: 0; margin: 0; }
.cc-intro { padding: 0; margin: 0; }
.cc-footer { padding: 0; margin: 0; }

#cookieSettings .cc-form-group,
#cookieSettings h4 { margin: 0; padding: 0; }
#cookieSettings h3 { margin: 0; padding: 0; line-height: 25px; }
#cookieSettings label { cursor: pointer; margin-bottom: 0; }

.cc-inner .content_from_editor { padding: 0; margin: 0; }
.cc-inner .content_from_editor h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 20px 0;
}
.cc-inner .content_from_editor h3 {
  font-size: 1.2rem;
  font-weight: 700;
}
.cc-inner .content_from_editor h4 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #595959;
}
.cc-inner .content_from_editor p {
  margin: 0 0 16px 0;
  line-height: 1.6;
  font-size: 1rem;
}
.cc-inner a {
  color: #595959;
  text-decoration: underline;
}

.cc-form-check {
  display: block;
  margin-bottom: 16px;
  padding-left: 28.5px;
}
.cc-form-check-input {
  margin: 4.75px 0 0 -28.5px;
  width: 19px; height: 19px;
  vertical-align: top;
}
.cc-form-check-label {
  cursor: pointer;
  font-size: 15px;
  margin: 0;
}

.cc-row {
  display: flex;
  flex-wrap: wrap;
  margin: 8px -12px 0;
}
.cc-col-4 {
  flex: 0 0 auto;
  max-width: 100%;
  padding: 0 12px;
  width: 100%;
}
.cc-col-6 {
  flex: 0 0 auto;
  max-width: 100%;
  padding: 0 12px;
  width: 100%;
}
@media (min-width: 576px) {
  .cc-col-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
  .cc-col-6 { flex: 0 0 50%; max-width: 50%; }
}

.cc-btn {
  display: inline-block;
  padding: 6px 12px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  border-radius: 2px;
  border: 1px solid transparent;
}
.cc-btn-block { display: block; width: 100%; }
.cc-btn-primary {
  background-color: #007688;
  border-color: #007688;
  color: #fff;
}
.cc-btn-secondary {
  background-color: #bbb;
  border: 1px solid #eee;
  color: #fff;
}