@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Arial&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --maroon: #bc2b2b;
  --maroon-dark: #bc2b2b;
  --maroon-pale: rgba(206,97,97,.4);
  --link-blue: #00c;
  --link-hover: #f0f;
  --content-max: 1000px;
}

body {
  font-family: Helvetica, Arial, Verdana, sans-serif;
  font-size: 16px;
  line-height: 1.6rem;
  color: #111;
  background: #fff;
}

a { color: var(--link-blue); text-decoration: none; font-weight: bold; }
a:hover { color: var(--link-hover); }
a:visited { color: var(--link-blue); }

/* old thin accent bar - superseded by the solid topbar below, kept harmless if still present in a page */
.top-accent-bar { display: none; }

/* ══════════ TOPBAR (Paul's real .header/.header-side-menu-icon/.header-title) ══════════ */
#site-header {
  background: var(--maroon);
  padding: 0;
  display: flex;
  align-items: center;
  height: 50px;
  font-size: 16px; font-weight: bold; color: #fff;
  position: sticky;
  top: 0;
  z-index: 300;
}
#hamburger-btn {
  background-color: #fff; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 50px; height: 50px; flex-shrink: 0;
}
#hamburger-btn span { display: block; width: 22px; height: 2.5px; background: #000; border-radius: 2px; }
#hamburger-btn:hover span { background: var(--maroon); }

#site-header a.site-title {
  font-family: Helvetica, Arial, Verdana, sans-serif;
  font-size: 20px; font-weight: bold;
  color: #fff; text-decoration: none; text-shadow: 2px 2px 3px #000;
  padding-left: 15px; flex: 1;
}
#site-header a.site-title:hover { color: #fff; }
#site-header .site-tagline { display: none; } /* tagline now lives on the home page body, not the bar */

/* right-side icon menu: real .top-menu-button / .jq-dropdown values */
#content-top-menu { display: flex; align-items: center; gap: 4px; margin-right: 8px; flex-shrink: 0; }
.top-menu-button {
  background: var(--maroon); color: #fff; border: 2px solid #fff;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12);
}
.top-menu-button:hover { background: #fff; color: var(--maroon); border-color: #ccc; }
.top-menu-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; }
.top-menu-button:hover svg { stroke: var(--maroon); }

.jq-dropdown {
  position: absolute; display: none; z-index: 400;
  background: #fff; border: 1px solid var(--maroon); border-radius: 4px;
  min-width: 200px; max-width: 320px; padding: 4px 0;
  box-shadow: 0 5px 10px rgba(0,0,0,.25);
}
.jq-dropdown.open { display: block; }
.jq-dropdown-menu { list-style: none; margin: 0; padding: 0; }
.jq-dropdown-menu li { margin: 0; }
.jq-dropdown-nav-title {
  background: var(--maroon); color: #fff; font-weight: bold; text-align: center;
  border-radius: 10px; margin: 3px 8px !important; padding: 3px 0; font-size: 0.82rem;
  text-shadow: 2px 2px 3px rgba(0,0,0,.8);
}
.jq-dropdown-menu li > a, .jq-dropdown-menu li > span {
  display: block; padding: 5px 14px; font-size: 0.85rem; text-decoration: none; white-space: nowrap;
}
.jq-dropdown-menu li > a { color: var(--link-blue); font-weight: bold; }
.jq-dropdown-menu li > a:hover { background: rgba(206,97,97,.25); }
.jq-dropdown-menu li > span.current-view { background: rgba(206,97,97,.4); border-radius: 12px; margin: 0 8px; font-weight: bold; color: #000; }
.jq-dropdown-notice { font-size: 0.78rem; color: #666; padding: 6px 14px; white-space: normal; max-width: 260px; }

/* ══════════ SITE MENU PANEL (opens from the hamburger) ══════════ */
#site-menu-overlay {
  display: none; position: fixed; inset: 48px 0 0 0;
  background: rgba(0,0,0,0.3); z-index: 250;
}
#site-menu-overlay.open { display: block; }

#site-menu-panel {
  display: none; position: fixed; top: 48px; left: 0;
  width: 300px; max-width: 88vw; height: calc(100vh - 48px);
  background: #fff; border-right: 1px solid #ddd; overflow-y: auto;
  z-index: 251; box-shadow: 3px 0 14px rgba(0,0,0,0.2);
}
#site-menu-panel.open { display: block; }

#site-menu-panel a.sm-link {
  display: block; padding: 7px 16px; font-size: 14px; color: var(--link-blue); font-weight: bold;
  text-decoration: none; border-bottom: 1px solid #f0f0f0;
}
#site-menu-panel a.sm-link:hover { padding-left: 26px; }
#site-menu-panel a.sm-home { font-size: 1rem; color: var(--maroon); text-shadow: 1px 1px 2px rgba(0,0,0,.4); }

/* pill-shaped category badge, matching Paul's real .mm-listview>li>span exactly */
.sm-pill-heading {
  display: inline-block;
  background-color: var(--maroon);
  border: 2px solid var(--maroon);
  color: #fff;
  font-size: 18px; font-weight: bold;
  text-shadow: 2px 2px 3px rgba(0,0,0,.9);
  padding: 4px 16px;
  border-radius: 25px;
  margin: 12px 0 8px 8px;
}

/* root screen: a course row with a chevron, entire row clickable to drill in */
.sm-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 16px; font-size: 14px; color: var(--link-blue); font-weight: bold;
  border-bottom: 1px solid #f0f0f0; cursor: pointer;
  transition: padding 0.3s ease;
}
.sm-row:hover { padding-left: 26px; }
.sm-row .sm-row-link { color: var(--link-blue); flex: 1; pointer-events: none; }
.sm-row .sm-chevron { color: #999; font-size: 18px; pointer-events: none; }
.sm-row a.sm-row-link { text-decoration: none; pointer-events: auto; }
.sm-view-notes { color: var(--maroon) !important; }

/* drilled-down course screen header: breadcrumb + close X, like the reference image */
.sm-drill-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; border-bottom: 1px solid #eee;
}
.sm-drill-crumb {
  font-weight: bold; font-size: 1.05rem; color: var(--maroon);
  text-shadow: 1px 1px 2px rgba(0,0,0,.4);
  text-decoration: underline;
}
.sm-drill-crumb a { color: var(--maroon); text-decoration: underline; text-shadow: 2px 2px 3px rgba(0,0,0,.4); }
.sm-drill-crumb a:hover { color: var(--link-hover); }
.sm-close-x {
  background: none; border: none; font-size: 22px; line-height: 1; color: #666;
  cursor: pointer; padding: 2px 8px;
}
.sm-close-x:hover { color: #000; }

/* book rows within the drilled-down course screen */
.sm-drill-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #f0f0f0;
}
.sm-drill-row-link { color: var(--link-blue); font-weight: 600; font-size: 14.5px; text-decoration: none; flex: 1; }
.sm-drill-row-link:hover { color: var(--link-hover); }
.sm-drill-chevron { color: #999; font-size: 18px; }

/* ══════════ BREADCRUMB PILL (Paul's real .top-menu-breadcrumb) ══════════ */
.crumb-row { display: flex; justify-content: center; padding: 8px 10px 4px; }
.crumb-pill {
  background-color: var(--maroon); color: #fff;
  border: 3px solid var(--maroon); border-radius: 15px;
  padding: 4px 6px 2px 6px;
  box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12);
  text-shadow: 2px 2px 3px rgba(0,0,0,.9);
  font-size: 0.95rem; font-weight: bold;
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.crumb-pill a { color: #fff; font-weight: normal; text-decoration: underline; }
.crumb-pill a:hover { color: #fff; font-weight: bold; }
.crumb-pill .sep { color: #ddb; opacity: 0.7; }
.crumb-pill .current { text-decoration: none; }

/* ══════════ TAB PILL ROW (Paul's real .top-nav-bar) ══════════ */
.tab-row {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 10px; padding: 15px 10px 10px;
  margin-bottom: 22px;
}
.tab-pill {
  border: 2px solid var(--maroon); border-radius: 25px;
  padding: 2px 8px; font-size: 0.95rem; font-weight: bold;
  background: #fff; color: var(--link-blue);
}
.tab-pill:hover {
  background-color: var(--maroon-pale); border: 2px solid var(--maroon-pale); color: #000;
}
.tab-pill.active {
  background-color: var(--maroon-pale); border: 2px solid var(--maroon-pale);
  color: #000; text-decoration: none; cursor: default;
}
.tab-pill.disabled {
  color: #aaa; border-color: #ccc; cursor: default; text-decoration: none;
}

/* ══════════ CONTENT ══════════ */
#content { max-width: var(--content-max); margin: 0 auto; padding: 0 24px 60px; width: 100%; }

h1, h1.page-title {
  text-transform: uppercase; font-weight: bold; font-size: 24px;
  border-bottom: 3px solid #000;
  text-shadow: 0 0 3px rgba(188,43,43,.8);
  box-shadow: -6px 0 #fff, 0 -6px #fff, 6px 0 #fff, 1px 1px 3px rgba(188,43,43,.8);
  margin-bottom: 8px;
}
h1 + p, h1.page-title + p { margin-top: 8px; }

h2 {
  text-transform: capitalize; font-weight: bold; font-size: 20px;
  border-bottom: 2px solid #000;
  text-shadow: 0 0 2px rgba(188,43,43,.8);
  box-shadow: -6px 0 #fff, 0 -6px #fff, 6px 0 #fff, 1px 1px 3px rgba(188,43,43,.8);
  margin-bottom: 8px;
}
h2 + p { margin-top: 8px; }

/* homepage section labels (CLASS NOTES, CHEAT SHEETS AND TABLES) use Paul's plain
   uppercase+underline style, not the glowing h2 treatment above */
h2.section-title, .content-subheader {
  text-transform: uppercase; text-decoration: underline;
  font-size: 16px; font-weight: bold;
  border-bottom: none; box-shadow: none; text-shadow: none;
  margin-bottom: 8px;
}

h3 {
  text-transform: capitalize; font-weight: bold; font-size: 18px;
  border-bottom: 1px solid #000;
  box-shadow: -6px 0 #fff, 0 -6px #fff, 6px 0 #fff, 1px 1px 3px rgba(188,43,43,.8);
  margin-bottom: 8px;
}
h3 + p { margin-top: 8px; }
h4 { font-weight: bold; margin-bottom: 0; }
h4 + p { margin-top: 0; }

p { margin-bottom: 1em; }

/* Practice/Assignment Problems pages get a larger base font, per request */
.problems-page, .problems-page p, .problems-page li, .problems-page .showhide-content {
  font-size: 1.2rem; line-height: 1.75;
}
.problems-page h1.page-title { font-size: 1.7rem; }
.problems-page h2 { font-size: 1.35rem; }
ul, ol { padding-left: 1.7em; margin-bottom: 1em; }
li { margin-bottom: 0.45em; }

/* major section separator (e.g. between Cheat Sheets and Class Notes) */
.content-separator { border: none; width: 75%; margin: 20px auto; border-bottom: 2px solid var(--maroon); }
/* separator between individual classes within a section */
.content-sub-separator { border: none; width: 50%; margin: 20px auto; border-bottom: 1px solid var(--maroon); }

.top-accent-bar + #site-header + .crumb-row { margin-top: 0; }

/* ══════════ HOMEPAGE CLASS NOTES LIST ══════════ */
.class-entry { margin-bottom: 1.4em; }
.class-entry .class-name { font-weight: 700; }
.class-entry .class-links { font-weight: 700; }
.class-entry .class-links a { margin: 0 2px; }
.class-entry .class-topics { margin-top: 0.5em; list-style: disc outside; padding-left: 1.4em; }
.class-entry .class-topics li { font-size: 1rem; display: list-item; }
.class-entry .class-topics li strong { color: #111; }
.class-desc { margin-top: 0.7em; }

/* ══════════ ARABIC / LESSON CONTENT BLOCKS ══════════ */
.arabic {
  font-family: 'Amiri', serif; font-size: 22px;
  direction: rtl; text-align: right; line-height: 2.2; color: #000;
  background: #e6f6fb; border: 1px solid #b9dcea;
  padding: 12px 16px; margin: 14px 0;
}
.arabic-sm { font-family: 'Amiri', serif; font-size: 1.05em; }

.translation {
  font-style: italic; color: #333; font-size: 0.95em;
  padding: 3px 14px 10px; border-left: 3px solid var(--maroon); margin: 0 0 16px;
}

.vocab-list { list-style: none; padding: 0; margin: 0 0 16px; }
.vocab-list li { display: flex; gap: 12px; padding: 4px 0; border-bottom: 1px dotted #ddd; font-size: 14.5px; }
.vocab-list .vocab-ar { font-family: 'Amiri', serif; font-size: 1.15em; direction: rtl; min-width: 90px; }
.vocab-list .vocab-en { color: #333; }

/* small uppercase labels above each TEXT / VOCABULARY / TRANSLATION / COMMENTARY block,
   Paul-style structured presentation kept around your own Scrivener section labels */
.section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--maroon); margin: 16px 0 5px;
}
.lesson-block { margin-bottom: 8px; }
.lesson-block + .lesson-block {
  border-top: 1px solid #e8d8d8; padding-top: 6px; margin-top: 22px;
}
body.course-aqeedah .lesson-block + .lesson-block {
  border-top: none;
}
.lesson-subtitle {
  font-size: 1.05rem; font-weight: 700; color: #111; margin: 1.6em 0 0.2em;
}
.lesson-subtitle .ar { font-family: 'Amiri', serif; font-weight: 400; color: #555; font-size: 0.9em; margin-left: 8px; }

/* Theorem / axiom / fundamental-principle box, matching Paul's .fact box */
.fact {
  background: #ccffff; border: 1px solid #000; border-radius: 10px;
  padding: 12px 18px; margin: 14px 0;
  box-shadow: 0 0 3px 2px rgba(0,0,204,.6);
  display: flex; align-items: center; gap: 14px;
}
.fact-content { flex: 1 1 auto; min-width: 0; }
.fact-content p:first-child { margin-top: 0; }
.fact-content p:last-child { margin-bottom: 0; }
.fact-num { flex: 0 0 auto; font-weight: bold; color: #000; white-space: nowrap; }
.fact-ref { color: var(--maroon); font-weight: bold; }
.term-def { color: var(--maroon); font-weight: 700; }

/* ══════════ SHOW / HIDE (Paul's real .SH-Link bracket-wrapped style) ══════════ */
.showhide-btn {
  background: none; border: none; padding: 0;
  font-size: smaller; font-weight: bold; color: var(--link-blue);
  cursor: pointer; font-family: inherit;
}
.showhide-btn:hover { color: var(--link-hover); }
.showhide-btn::before { content: "["; color: #000; font-weight: normal; }
.showhide-btn::after { content: "]"; color: #000; font-weight: normal; }
.showhide-content {
  display: none; border: 2px solid #000; border-radius: 10px;
  padding: 5px; margin-top: 8px; background: #fff;
  box-shadow: 0 0 3px 2px rgba(188,43,43,.6);
  font-size: 0.97rem; line-height: 1.7;
}
.showhide-content.open { display: block; }

/* ══════════ EXAMPLE BOX (Paul's real .example/.example-title/.soln-title values) ══════════ */
.example-box {
  border: 2px solid #000; border-radius: 10px;
  padding: 5px; margin: 0 0 20px 0;
  box-shadow: 0 0 3px 2px rgba(188,43,43,.6);
  background: #fff;
}
.example-box .example-label { font-weight: bold; font-style: italic; margin-right: 4px; }
.example-box .example-task { display: block; font-weight: normal; font-style: normal; color: #444; margin: 2px 0 6px; font-size: 0.95rem; }
.example-box .example-ar { font-family: 'Amiri', serif; font-size: 1.3em; direction: rtl; }
.example-solution-toggle {
  color: var(--link-blue); font-weight: bold; cursor: pointer;
  background: none; border: none; padding: 0; margin-top: 8px;
  display: inline-flex; align-items: center; gap: 5px; font-size: 0.9rem; font-family: inherit;
}
.example-solution-toggle:hover { color: var(--link-hover); }
.example-solution-toggle .chevron { display: inline-block; transition: transform 0.15s; }
.example-solution-toggle.open .chevron { transform: rotate(90deg); }
.example-solution-content {
  display: none; margin-top: 10px; padding: 10px 5px 0 5px;
  font-size: 0.97rem; line-height: 1.7;
}
.example-solution-content.open { display: block; }

/* ══════════ NOTE / WARN BOXES ══════════ */
.note-box {
  border: 1px solid #b8b8e0; background: #f2f2fb;
  border-radius: 4px; padding: 12px 16px; margin: 16px 0; font-size: 14.5px;
}
.note-box strong { display: block; margin-bottom: 4px; color: var(--maroon-dark); }
.warn-box {
  border: 1px solid #c8a000; background: #fffbe6;
  border-radius: 4px; padding: 12px 16px; margin: 16px 0; font-size: 14.5px;
}
.warn-box strong { display: block; margin-bottom: 4px; color: #7a5500; }

/* ══════════ TABLES ══════════ */
table.terms { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14px; }
table.terms th { background: var(--maroon); color: #fff; padding: 7px 12px; text-align: left; }
table.terms td { padding: 6px 12px; border-bottom: 1px solid #ddd; vertical-align: top; }
table.terms tr:nth-child(even) td { background: #faf6f6; }
table.terms .ar { font-family: 'Amiri', serif; font-size: 17px; direction: rtl; text-align: right; }

/* ══════════ DOWNLOAD / UPLOAD LINKS ══════════ */
.dl-links { margin: 8px 0 18px; font-size: 13px; }
.dl-links a { margin-right: 18px; }
.dl-links a::before { content: "\2193  "; text-decoration: none; }

.upload-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 14px; margin: 16px 0; }
.upload-card {
  border: 1px solid #ddd; border-radius: 4px; padding: 12px 14px;
  background: #faf9fb; display: flex; align-items: center; gap: 10px;
}
.upload-card .icon { font-size: 1.4rem; }
.upload-card a { font-weight: 600; }
.upload-card .meta { font-size: 12px; color: #666; display: block; text-decoration: none; }
.upload-card .pending-title { font-weight: 600; color: #555; }

/* ══════════ PREV / NEXT (bottom pill row) ══════════ */
.bottom-nav-row {
  display: flex; justify-content: center; gap: 16px;
  margin-top: 3em; padding-top: 16px; border-top: 3px solid var(--maroon);
}

/* ══════════ FOOTER ══════════ */
#site-footer {
  border-top: 1px solid #ddd; padding: 16px; font-size: 12px;
  color: #666; text-align: center; margin-top: 30px;
}
#site-footer a { color: #666; margin: 0 6px; }

@media (max-width: 600px) {
  h1.page-title { font-size: 1.5rem; }
  #content { padding: 0 14px 40px; }
  .crumb-pill, .tab-pill { font-size: 0.82rem; padding: 5px 12px; }
}
