/*
  Radford Mathematics shared notes-page layout
  Upload path: /assets/css/site-sidebar.css

  Purpose:
  This file is the single source of truth for the scale, width, right sidebar,
  overview cards, title banner and notes-page layout used by all PHP notes pages.

  Rule:
  Individual lesson PHP files must NOT redefine page width, sidebar width,
  navbar scale, overview-card scale, or grid columns.
*/

:root {
  --rm-navy: #102f55;
  --rm-blue: #2563eb;
  --rm-blue-dark: #174c9c;
  --rm-green: #10a77a;
  --rm-gold: #d88a00;
  --rm-purple: #7c3aed;
  --rm-teal: #0f766e;
  --rm-ink: #111827;
  --rm-muted: #334155;
  --rm-soft-border: #cfe1ff;
  --rm-soft-bg: #f6faff;
  --rm-page-bg: #eaf5fb;
  --rm-card-bg: #ffffff;
  --rm-shadow: 0 12px 30px rgba(16, 47, 85, 0.10);
  --rm-radius-lg: 22px;
  --rm-radius-md: 16px;

  /* SITE-WIDE NOTES PAGE DIMENSIONS — DO NOT CHANGE INSIDE INDIVIDUAL PAGES */
  --rm-shell-max: 1440px;
  --rm-main-card-pad: 28px;
  --rm-sidebar-width: 300px;
  --rm-layout-gap: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #dcecff 0%, #edf9ff 50%, #f7fbff 100%);
  color: var(--rm-ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}

/* -------------------------------------------------------------------------
   SHARED NAVBAR SCALE
   ------------------------------------------------------------------------- */

.rm-site-navbar,
.site-navbar,
.navbar-rm {
  width: 100%;
  background: var(--rm-navy);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.16);
}

.rm-navbar-inner,
.site-navbar-inner,
.navbar-rm-inner {
  max-width: var(--rm-shell-max);
  margin: 0 auto;
  padding: 9px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.rm-navbar-brand,
.site-brand,
.navbar-brand-rm {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
  min-width: 0;
}

.rm-navbar-logo,
.site-logo,
.navbar-logo-rm {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.rm-navbar-title,
.site-brand-title,
.navbar-title-rm {
  display: block;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.rm-navbar-subtitle,
.site-brand-subtitle,
.navbar-subtitle-rm {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.rm-navbar-links,
.site-nav-links,
.navbar-links-rm {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rm-navbar-links a,
.site-nav-links a,
.navbar-links-rm a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 13px;
  min-height: 38px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-weight: 750;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.rm-navbar-links a:hover,
.site-nav-links a:hover,
.navbar-links-rm a:hover,
.rm-navbar-links a.is-active,
.site-nav-links a.is-active,
.navbar-links-rm a.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
}

.rm-navbar-links a.rm-contact,
.site-nav-links a.rm-contact,
.navbar-links-rm a.rm-contact {
  background: var(--rm-green);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding-inline: 17px;
}

/* -------------------------------------------------------------------------
   NOTES PAGE LAYOUT — single source of truth
   ------------------------------------------------------------------------- */

.rm-notes-shell {
  max-width: var(--rm-shell-max);
  margin: 0 auto;
  padding: 32px 28px 56px;
}

.rm-notes-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rm-sidebar-width);
  gap: var(--rm-layout-gap);
  align-items: start;
}

.rm-notes-main {
  min-width: 0;
  width: 100%;
  background: var(--rm-card-bg);
  border-radius: var(--rm-radius-lg);
  padding: var(--rm-main-card-pad);
  box-shadow: var(--rm-shadow);
}

/* Legacy aliases used by some existing pages. Keep these until every page has
   been migrated to rm-notes-shell > rm-notes-layout. */
main.worksheet-main.lesson-layout,
main.lesson-layout,
.main-with-sidebar {
  max-width: var(--rm-shell-max) !important;
  margin: 0 auto !important;
  padding: 32px 28px 56px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) var(--rm-sidebar-width) !important;
  gap: var(--rm-layout-gap) !important;
  align-items: start !important;
}

main.worksheet-main.lesson-layout > article,
main.lesson-layout > article,
.main-with-sidebar > article,
.lesson-content,
.notes-content,
.page-content {
  min-width: 0;
}

/* -------------------------------------------------------------------------
   HERO / TITLE BANNER
   ------------------------------------------------------------------------- */

.rm-hero,
.rm-note-hero,
.lesson-hero,
.topic-hero {
  width: 100%;
  border-radius: 17px;
  padding: 22px 24px;
  margin: 0 0 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #143761 0%, #1d5bc0 55%, #2f6df1 100%);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
}

.rm-hero-kicker,
.lesson-kicker,
.topic-kicker {
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rm-hero h1,
.rm-note-hero h1,
.lesson-hero h1,
.topic-hero h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(30px, 3.1vw, 46px);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: -0.045em;
}

.rm-hero-subtitle,
.lesson-subtitle,
.topic-subtitle {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 550;
}

.rm-hero-badge,
.syllabus-badge,
.topic-badge {
  flex: 0 0 auto;
  align-self: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

/* -------------------------------------------------------------------------
   TOP OVERVIEW CARDS
   ------------------------------------------------------------------------- */

.rm-overview-grid,
.lesson-overview,
.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 16px;
}

.rm-overview-card,
.info-card,
.overview-card {
  background: #ffffff;
  border: 1px solid var(--rm-soft-border);
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 94px;
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.045);
}

.rm-overview-card.blue,
.info-card.blue,
.overview-card.blue {
  border-left: 5px solid var(--rm-blue);
}
.rm-overview-card.green,
.info-card.green,
.overview-card.green {
  border-left: 5px solid var(--rm-green);
}
.rm-overview-card.gold,
.info-card.gold,
.overview-card.gold {
  border-left: 5px solid var(--rm-gold);
}
.rm-overview-card.purple,
.info-card.purple,
.overview-card.purple {
  border-left: 5px solid var(--rm-purple);
}
.rm-overview-card.teal,
.info-card.teal,
.overview-card.teal {
  border-left: 5px solid var(--rm-teal);
}

.rm-overview-card h2,
.rm-overview-card h3,
.info-card h2,
.info-card h3,
.overview-card h2,
.overview-card h3 {
  margin: 0 0 5px;
  color: var(--rm-ink);
  font-size: 16px;
  line-height: 1.15;
  font-weight: 850;
}

.rm-overview-card p,
.info-card p,
.overview-card p {
  margin: 0;
  color: var(--rm-ink);
  font-size: 15px;
  line-height: 1.35;
}

.rm-syllabus-chip,
.syllabus-chip,
.code-chip {
  display: inline-flex;
  align-items: center;
  vertical-align: baseline;
  min-height: 20px;
  padding: 1px 8px 2px;
  border-radius: 999px;
  border: 1px solid #b7d1ff;
  background: #edf5ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.rm-ib-focus,
.ib-focus {
  margin: 0 0 16px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid var(--rm-soft-border);
  border-left: 5px solid var(--rm-green);
  background: var(--rm-soft-bg);
  color: var(--rm-muted);
  font-size: 15px;
}

/* -------------------------------------------------------------------------
   ON THIS PAGE
   ------------------------------------------------------------------------- */

.rm-on-this-page,
.on-this-page,
.toc-card {
  margin: 0 0 34px;
  padding: 16px 18px;
  border: 1px solid var(--rm-soft-border);
  border-radius: 16px;
  background: #f8fbff;
  box-shadow: 0 7px 18px rgba(15, 23, 42, 0.05);
}

.rm-on-this-page h2,
.rm-on-this-page h3,
.on-this-page h2,
.on-this-page h3,
.toc-card h2,
.toc-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.15;
  font-weight: 900;
}

.rm-on-this-page ol,
.on-this-page ol,
.toc-card ol {
  margin: 0;
  padding-left: 22px;
  columns: 2;
  column-gap: 44px;
}

.rm-on-this-page li,
.on-this-page li,
.toc-card li {
  break-inside: avoid;
  margin: 3px 0;
  padding-left: 3px;
}

.rm-on-this-page a,
.on-this-page a,
.toc-card a {
  color: #1745b5;
  font-weight: 850;
  text-decoration: none;
}

.rm-on-this-page a:hover,
.on-this-page a:hover,
.toc-card a:hover {
  text-decoration: underline;
}

/* -------------------------------------------------------------------------
   SECTION HEADINGS / COMMON CONTENT BOXES
   ------------------------------------------------------------------------- */

.rm-section-title,
.lesson-section-title,
.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 34px 0 18px;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid var(--rm-soft-border);
  border-left: 7px solid var(--rm-blue);
  background: linear-gradient(90deg, #eaf4ff 0%, #ffffff 78%);
  box-shadow: 0 9px 22px rgba(15, 23, 42, 0.05);
}

.rm-section-number,
.section-number {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--rm-blue);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

.rm-section-title h2,
.lesson-section-title h2,
.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.02;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.rm-example,
.worked-example,
.example-card {
  margin: 18px 0;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--rm-soft-border);
  border-left: 6px solid var(--rm-blue);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

/* -------------------------------------------------------------------------
   RIGHT SIDEBAR — one identical sidebar across notes pages
   ------------------------------------------------------------------------- */

.rm-notes-sidebar,
.notes-sidebar,
.lesson-sidebar,
aside.rm-sidebar {
  width: var(--rm-sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 88px;
}

.rm-sidebar-card,
.rm-resource-card,
.rm-ad-card,
.rm-keep-card,
.sidebar-card,
.resource-card,
.ad-card,
.keep-card {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e1ecfb;
  border-radius: 17px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(16, 47, 85, 0.10);
  color: var(--rm-ink);
}

.rm-resource-card,
.resource-card {
  border-left: 5px solid var(--rm-green);
}

.rm-ad-card,
.ad-card {
  border-left: 5px solid #94a3b8;
}

.rm-keep-card,
.keep-card {
  border-left: 5px solid var(--rm-blue);
}

.rm-sidebar-label,
.sidebar-label {
  margin: 0 0 8px;
  color: #2563eb;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.rm-sidebar-card h2,
.rm-sidebar-card h3,
.rm-resource-card h2,
.rm-resource-card h3,
.rm-ad-card h2,
.rm-ad-card h3,
.rm-keep-card h2,
.rm-keep-card h3,
.sidebar-card h2,
.sidebar-card h3 {
  margin: 0 0 10px;
  color: var(--rm-ink);
  font-size: 22px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.rm-sidebar-card p,
.rm-resource-card p,
.rm-ad-card p,
.rm-keep-card p,
.sidebar-card p {
  margin: 0 0 12px;
  color: var(--rm-muted);
  font-size: 15px;
  line-height: 1.42;
}

.rm-sidebar-card ul,
.rm-resource-card ul,
.rm-keep-card ul,
.sidebar-card ul {
  margin: 12px 0 0;
  padding-left: 19px;
  color: var(--rm-muted);
}

.rm-sidebar-card li,
.rm-resource-card li,
.rm-keep-card li,
.sidebar-card li {
  margin: 5px 0;
}

.rm-sidebar-card a,
.rm-keep-card a,
.sidebar-card a {
  color: #1745b5;
  font-weight: 850;
  text-decoration: none;
}

.rm-sidebar-card a:hover,
.rm-keep-card a:hover,
.sidebar-card a:hover {
  text-decoration: underline;
}

.rm-coming-soon,
.resource-coming-soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  margin-top: 4px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.rm-ad-placeholder,
.ad-placeholder {
  min-height: 170px;
  border: 1.5px dashed #9bb2cf;
  border-radius: 14px;
  background: #f8fbff;
  color: var(--rm-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
}

.rm-ad-placeholder strong,
.ad-placeholder strong {
  display: block;
  margin-bottom: 3px;
  color: var(--rm-ink);
}

/* -------------------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .rm-notes-layout,
  main.worksheet-main.lesson-layout,
  main.lesson-layout,
  .main-with-sidebar {
    grid-template-columns: 1fr !important;
  }

  .rm-notes-sidebar,
  .notes-sidebar,
  .lesson-sidebar,
  aside.rm-sidebar {
    width: 100%;
    position: static;
  }
}

@media (max-width: 760px) {
  :root {
    --rm-main-card-pad: 18px;
  }

  .rm-navbar-inner,
  .site-navbar-inner,
  .navbar-rm-inner {
    padding: 9px 16px;
    flex-wrap: wrap;
  }

  .rm-navbar-links,
  .site-nav-links,
  .navbar-links-rm {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .rm-notes-shell,
  main.worksheet-main.lesson-layout,
  main.lesson-layout,
  .main-with-sidebar {
    padding: 18px 14px 42px !important;
  }

  .rm-hero,
  .rm-note-hero,
  .lesson-hero,
  .topic-hero {
    display: block;
    padding: 20px;
  }

  .rm-hero-badge,
  .syllabus-badge,
  .topic-badge {
    display: inline-flex;
    margin-top: 14px;
  }

  .rm-overview-grid,
  .lesson-overview,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .rm-on-this-page ol,
  .on-this-page ol,
  .toc-card ol {
    columns: 1;
  }
}


/* Shared action styles used inside the authoritative sidebar cards. */
.rm-sidebar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
  padding: 10px 13px;
  border-radius: 999px;
  background: var(--rm-blue-dark);
  color: #fff !important;
  text-decoration: none;
  font-weight: 800;
  text-align: center;
}
.rm-sidebar-action:hover { background: var(--rm-navy); color: #fff !important; }
.rm-sidebar-store { background: var(--rm-gold); }
.rm-youtube-invite { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rm-soft-border); }
.rm-youtube-invite strong, .rm-youtube-invite span { display:block; }
.rm-youtube-invite span { margin-top:4px; color:var(--rm-muted); font-size:13px; }
