/* ============================================================
   mathsindex.uk — Learn2 theme custom overrides
   Drop into: user/themes/learn2/css/custom.css
   Logo SVG goes at: user/themes/learn2/images/lockup-dark.svg
   ============================================================ */

:root {
  --mi-navy:  #1e2d3d;
  --mi-cyan:  #00d1b2;
}

/* ── Sidebar panel ───────────────────────────────────────── */
#sidebar {
  background-color: var(--mi-navy) !important;
}

/* ── Header block (sits inside sidebar, do NOT change its  ──
       display model or it breaks the sidebar layout)       */
#header {
  background-color: var(--mi-navy) !important;
  /* keep Learn2's default text-align:center and padding */
}

/* ── Hide the GRAV SVG paths, keep the <a> as a block ───── */
#logo-svg {
  display: none !important;
}

/* ── Replace logo with our SVG lockup as background image ── */
#logo {
  display: block !important;
  width: 260px !important;
  height: 56px !important;
  margin: 0 auto 0.5rem !important;
  background-image: url('../images/lockup-dark.svg') !important;
  background-repeat: no-repeat !important;
  background-size: contain !important;
  background-position: center center !important;
}

/* ── Search box ──────────────────────────────────────────── */
.searchbox {
  background: rgba(255,255,255,0.08) !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  border-radius: 20px !important;
}

.searchbox label {
  color: rgba(255,255,255,0.4) !important;
}

.searchbox span {
  color: rgba(255,255,255,0.35) !important;
}

#search-by {
  color: rgba(255,255,255,0.8) !important;
  background: transparent !important;
}

#search-by::placeholder,
#search-by::-webkit-input-placeholder {
  color: rgba(255,255,255,0.35) !important;
}

/* ── Sidebar nav ─────────────────────────────────────────── */
#sidebar ul.topics > li > a,
#sidebar ul.topics > li > label {
  color: rgba(255,255,255,0.7) !important;
}

#sidebar ul.topics > li > a:hover,
#sidebar ul.topics > li > label:hover {
  color: #ffffff !important;
}

/* Active item: white background → cyan left bar instead */
#sidebar ul.topics li.active > a {
  background: rgba(0,209,178,0.12) !important;
  color: var(--mi-cyan) !important;
  border-left: 3px solid var(--mi-cyan) !important;
  margin-left: -1rem !important;
  padding-left: calc(1rem - 3px) !important;
}

/* Parent section highlight */
#sidebar ul.topics > li.parent,
#sidebar ul.topics > li.active {
  background: rgba(255,255,255,0.04) !important;
}

/* Sub-item links */
#sidebar ul.topics li li a {
  color: rgba(255,255,255,0.55) !important;
}

#sidebar ul.topics li li a:hover,
#sidebar ul.topics li li.active > a {
  color: var(--mi-cyan) !important;
}

/* Section heading (h5) in versioned mode */
#sidebar h5 a {
  color: rgba(255,255,255,0.7) !important;
}

#sidebar h5.active a,
#sidebar h5.parent a {
  color: #ffffff !important;
  background: rgba(255,255,255,0.06) !important;
}

/* Visited check icon */
#sidebar li.visited > a .read-icon {
  color: var(--mi-cyan) !important;
}

/* ── Sidebar divider + footer ────────────────────────────── */
#sidebar hr {
  border-bottom-color: rgba(255,255,255,0.1) !important;
}

#sidebar #footer,
#sidebar #footer p,
#sidebar #footer a {
  color: rgba(255,255,255,0.25) !important;
}

/* ── Clear history link ──────────────────────────────────── */
#sidebar a[data-clear-history-toggle],
#sidebar .padding[href="#"] {
  color: rgba(255,255,255,0.3) !important;
}

#sidebar a[data-clear-history-toggle]:hover {
  color: var(--mi-cyan) !important;
}

/* ── Body content links ──────────────────────────────────── */
#body a,
#body-inner a {
  color: var(--mi-cyan) !important;
}

#body a:hover,
#body-inner a:hover {
  color: #009e86 !important;
}

/* ── Prev/Next nav arrows ────────────────────────────────── */
#body .nav:hover {
  background: var(--mi-navy) !important;
  color: #ffffff !important;
}

/* ── Scrollbar (webkit) ──────────────────────────────────── */
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}

/* ============================================================
 Homepage cards
   ============================================================ */

/* ── Homepage layout ─────────────────────────────────────── */
.mi-homepage {
    padding: 2rem 2.5rem 4rem;
}

.mi-intro {
    margin-bottom: 2.5rem;
    border-bottom: 2px solid #f0f2f4;
    padding-bottom: 1.5rem;
}

.mi-intro h1 {
    font-size: 3rem;
    color: #1e2d3d;
    margin-bottom: 0.4rem;
    letter-spacing: -1px;
}

.mi-intro p {
    color: #666;
    font-size: 1.5rem;
    margin: 0;
}

/* ── Section headings ────────────────────────────────────── */
.mi-card-section {
    margin-bottom: 3rem;
}

.mi-section-heading {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin-bottom: 1rem;
    margin-top: 0;
}

/* ── Card grid ───────────────────────────────────────────── */
.mi-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

/* ── Individual card ─────────────────────────────────────── */
.mi-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e4e8ec;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
    text-decoration: none !important;
    color: inherit !important;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.mi-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.09);
    transform: translateY(-2px);
    color: inherit !important;
    text-decoration: none !important;
}

/* Cyan accent bar at top of each card */
.mi-card-accent {
    height: 4px;
    background-color: #00d1b2;
    flex-shrink: 0;
}

.mi-card-body {
    padding: 1rem 1.1rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Platform · Topic line */
.mi-card-meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.35rem;
}

.mi-card-dot {
    margin: 0 0.25em;
}

.mi-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e2d3d;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.mi-card-desc {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.5;
    margin: 0 0 0.75rem;
    flex: 1;
}

.mi-card-cta {
    font-size: 0.85rem;
    font-weight: 600;
    color: #00d1b2 !important;
    display: block;
}

/* ── Responsive: stack to 2 col on narrower viewports ────── */
@media (max-width: 900px) {
    .mi-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 600px) {
    .mi-homepage {
        padding: 1.5rem 1rem 3rem;
    }
    .mi-card-grid {
        grid-template-columns: 1fr;
    }
}
