:root {
  --navy: #0b2447;
  --navy-2: #153b68;
  --teal: #0f9f91;
  --teal-light: #dff8f4;
  --orange: #f59e0b;
  --ink: #142033;
  --muted: #65758b;
  --line: #dfe7ee;
  --surface: #ffffff;
  --bg: #f5f8fb;
  --radius: 18px;
  --shadow: 0 16px 45px rgba(11,36,71,.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.container { width: min(1160px, calc(100% - 36px)); margin-inline: auto; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; background: #fff; padding: 10px 16px; border-radius: 10px; }
.skip-link:focus { top: 12px; }

.site-header { background: rgba(255,255,255,.94); border-bottom: 1px solid rgba(223,231,238,.8); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(16px); }
.header-inner { height: 76px; display: flex; align-items: center; gap: 34px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 850; color: var(--navy); letter-spacing: -.025em; white-space: nowrap; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--navy); color: white; box-shadow: 0 7px 18px rgba(11,36,71,.18); }
.brand-mark svg { width: 25px; }
.brand em { color: var(--teal); font-style: normal; }
.main-nav { display: flex; gap: 7px; margin-left: auto; align-items: center; }
.main-nav a { color: #4b5e75; font-weight: 650; font-size: .93rem; padding: 9px 12px; border-radius: 10px; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--navy); background: #edf4f8; }
.nav-cta { background: var(--navy) !important; color: white !important; }
.menu-toggle { display: none; margin-left: auto; border: 0; width: 44px; height: 44px; border-radius: 12px; background: #edf4f8; color: var(--navy); cursor: pointer; }

.hero { position: relative; overflow: hidden; background: var(--navy); color: white; padding: 62px 0 58px; }
.hero::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: rgba(45,212,191,.13); right: -110px; top: -210px; }
.hero::after { content: ""; position: absolute; width: 280px; height: 280px; border: 60px solid rgba(255,255,255,.045); border-radius: 50%; left: -155px; bottom: -180px; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.08fr .92fr; gap: 54px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #9ff1e6; font-weight: 750; font-size: .86rem; text-transform: uppercase; letter-spacing: .07em; }
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--teal); }
.hero h1 { max-width: 720px; font-size: clamp(2.15rem, 5vw, 4.1rem); line-height: 1.08; letter-spacing: -.045em; margin: 13px 0 18px; }
.hero h1 span { color: #5eead4; }
.hero-copy { color: #cbd9e8; max-width: 650px; font-size: 1.06rem; margin: 0 0 26px; }
.arabic-note { font-family: Tahoma, Arial, sans-serif; color: #e8f4ff; }
.search-box { background: white; padding: 7px; border-radius: 16px; display: flex; max-width: 690px; box-shadow: 0 16px 40px rgba(0,0,0,.2); }
.search-box svg { width: 21px; color: #6c7d91; margin: 0 12px; flex: 0 0 auto; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); font-size: 1rem; }
.search-box button { border: 0; border-radius: 11px; padding: 12px 18px; background: var(--teal); color: #fff; font-weight: 750; cursor: pointer; }
.quick-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.quick-links a { padding: 7px 11px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); color: #dce8f4; font-size: .85rem; }
.quick-links a:hover { background: rgba(255,255,255,.09); }
.hero-panel { background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.13); border-radius: 24px; padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.18); }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-top strong { font-size: 1.05rem; }
.level-badge { padding: 6px 10px; background: rgba(45,212,191,.16); color: #94f7e8; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.progress-item { margin-top: 15px; }
.progress-label { display: flex; justify-content: space-between; color: #d8e4ef; font-size: .88rem; margin-bottom: 7px; }
.progress-track { height: 7px; background: rgba(255,255,255,.12); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #5eead4); }
.mini-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 23px; }
.mini-stat { text-align: center; background: rgba(255,255,255,.07); border-radius: 13px; padding: 12px 8px; }
.mini-stat b { display: block; font-size: 1.25rem; color: white; }
.mini-stat span { color: #aebfd0; font-size: .72rem; }

.section { padding: 70px 0; }
.section-white { background: white; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 29px; }
.section-head h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); line-height: 1.18; letter-spacing: -.035em; color: var(--navy); margin: 7px 0 0; }
.section-head p { color: var(--muted); margin: 0; max-width: 510px; }
.link-arrow { color: var(--teal); font-weight: 800; white-space: nowrap; }
.subject-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.subject-card { position: relative; min-height: 235px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: .25s ease; overflow: hidden; }
.subject-card:hover { transform: translateY(-5px); border-color: #b9d8d3; box-shadow: var(--shadow); }
.subject-card::after { content: ""; position: absolute; width: 80px; height: 80px; border-radius: 50%; right: -35px; bottom: -35px; background: var(--card-tint, #e7f8f5); }
.card-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--card-tint, #e7f8f5); color: var(--card-color, var(--teal)); margin-bottom: 21px; }
.card-icon svg { width: 25px; }
.subject-card h3 { color: var(--navy); margin: 0 0 7px; font-size: 1.1rem; }
.subject-card p { color: var(--muted); font-size: .9rem; margin: 0 0 15px; }
.card-meta { color: var(--card-color, var(--teal)); font-weight: 750; font-size: .82rem; }
.subject-card.hidden, .resource-row.hidden { display: none; }
.empty-search { display: none; grid-column: 1/-1; padding: 32px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed #bfcbd6; border-radius: var(--radius); }
.empty-search.show { display: block; }

.resources-layout { display: grid; grid-template-columns: 1fr 325px; gap: 28px; align-items: start; }
.filter-row { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.filter { border: 1px solid var(--line); background: white; color: #586b81; border-radius: 999px; padding: 8px 14px; font-weight: 700; cursor: pointer; }
.filter.active { background: var(--navy); border-color: var(--navy); color: white; }
.resource-list { background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.resource-row { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 18px 20px; border-bottom: 1px solid #e7edf2; }
.resource-row:last-child { border-bottom: 0; }
.file-badge { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 12px; background: #e8f7f4; color: var(--teal); font-weight: 850; font-size: .72rem; }
.resource-row h3 { font-size: .97rem; margin: 0 0 3px; color: var(--navy); }
.resource-row p { font-size: .82rem; color: var(--muted); margin: 0; }
.resource-action { color: var(--teal); font-weight: 800; font-size: .86rem; }
.study-card { border-radius: 22px; background: linear-gradient(145deg, var(--navy), #174d78); color: white; padding: 25px; position: sticky; top: 98px; }
.study-card h3 { font-size: 1.25rem; margin: 0 0 8px; }
.study-card > p { color: #c5d6e7; margin: 0 0 19px; font-size: .9rem; }
.plan-step { display: grid; grid-template-columns: 31px 1fr; gap: 11px; align-items: start; margin-top: 14px; }
.step-number { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: rgba(45,212,191,.18); color: #87f5e5; font-weight: 850; font-size: .82rem; }
.plan-step strong { display: block; font-size: .9rem; }
.plan-step span { color: #aebfd0; font-size: .78rem; }

.path-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.path-card { padding: 25px; border-radius: 18px; border: 1px solid var(--line); background: #fff; }
.path-card .number { font-size: .75rem; letter-spacing: .08em; color: var(--teal); font-weight: 850; }
.path-card h3 { color: var(--navy); margin: 8px 0; }
.path-card p { color: var(--muted); font-size: .9rem; margin: 0; }

.newsletter { margin: 10px auto 70px; background: #e4f8f5; border: 1px solid #bfe9e2; border-radius: 24px; padding: 30px 34px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.newsletter h2 { color: var(--navy); margin: 0 0 5px; font-size: 1.35rem; }
.newsletter p { color: #52706f; margin: 0; }
.newsletter a { flex: 0 0 auto; background: var(--teal); color: white; border-radius: 12px; padding: 12px 18px; font-weight: 800; }

.site-footer { background: #071a32; color: #c0ccda; padding: 47px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 36px; }
.footer-grid h3 { color: white; font-size: .92rem; margin: 0 0 14px; }
.footer-grid p { max-width: 370px; color: #97aabd; font-size: .88rem; }
.footer-links { display: grid; gap: 8px; }
.footer-links a { color: #aebdca; font-size: .86rem; }
.footer-links a:hover { color: #5eead4; }
.copyright { margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); font-size: .8rem; color: #8194a7; display: flex; justify-content: space-between; gap: 20px; }

@media (max-width: 980px) {
  .main-nav { display: none; position: absolute; top: 76px; left: 18px; right: 18px; padding: 12px; border-radius: 16px; background: white; box-shadow: var(--shadow); }
  .main-nav.open { display: grid; }
  .menu-toggle { display: grid; place-items: center; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-panel { display: none; }
  .subject-grid { grid-template-columns: repeat(2,1fr); }
  .resources-layout { grid-template-columns: 1fr; }
  .study-card { position: static; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-grid > div:last-child { grid-column: 2; }
}

@media (max-width: 640px) {
  .container { width: min(100% - 24px, 1160px); }
  .header-inner { height: 68px; }
  .main-nav { top: 68px; }
  .brand { font-size: .96rem; }
  .brand-mark { width: 38px; height: 38px; }
  .hero { padding: 45px 0 42px; }
  .hero h1 { font-size: 2.42rem; }
  .hero-copy { font-size: .98rem; }
  .search-box { padding: 6px; }
  .search-box button { width: 49px; color: transparent; position: relative; padding: 0; }
  .search-box button::after { content: "→"; color: white; position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.25rem; }
  .section { padding: 53px 0; }
  .section-head { align-items: start; flex-direction: column; margin-bottom: 22px; }
  .subject-grid, .path-grid { grid-template-columns: 1fr; }
  .subject-card { min-height: 0; }
  .resource-row { grid-template-columns: auto 1fr; }
  .resource-action { grid-column: 2; }
  .newsletter { margin-bottom: 50px; align-items: stretch; flex-direction: column; padding: 24px; }
  .newsletter a { text-align: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1/-1; }
  .footer-grid > div:last-child { grid-column: auto; }
  .copyright { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

.page-hero { background: linear-gradient(135deg, var(--navy), #174c76); color: white; padding: 52px 0 46px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; color: #b9cbe0; font-size: .85rem; margin-bottom: 16px; }
.breadcrumb a:hover { color: white; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1.1; letter-spacing: -.04em; margin: 0 0 13px; }
.page-hero p { color: #cedbea; max-width: 740px; margin: 0; font-size: 1.03rem; }
.page-tools { background: white; border-bottom: 1px solid var(--line); }
.page-tools-inner { display: flex; align-items: center; gap: 12px; min-height: 76px; }
.page-search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; flex: 1; max-width: 500px; }
.page-search svg { width: 19px; color: var(--muted); }
.page-search input { border: 0; outline: 0; width: 100%; min-width: 0; }
.semester-tabs { display: flex; gap: 8px; margin-left: auto; }
.semester-tabs a { padding: 9px 13px; border-radius: 10px; background: #eff4f8; color: #52677e; font-weight: 750; font-size: .86rem; }
.semester-tabs a:first-child { background: var(--navy); color: white; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 30px; align-items: start; }
.chapter-section + .chapter-section { margin-top: 44px; }
.chapter-section h2 { color: var(--navy); font-size: 1.45rem; margin: 0 0 16px; }
.chapter-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.chapter-card { display: flex; gap: 14px; align-items: flex-start; background: white; border: 1px solid var(--line); border-radius: 15px; padding: 17px; transition: .2s ease; }
.chapter-card:hover { border-color: #9bd4cc; box-shadow: 0 10px 24px rgba(11,36,71,.07); }
.chapter-number { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; background: var(--teal-light); color: var(--teal); border-radius: 10px; font-weight: 850; font-size: .8rem; }
.chapter-card h3 { font-size: .94rem; color: var(--navy); margin: 0 0 3px; }
.chapter-card p { color: var(--muted); font-size: .78rem; margin: 0; }
.sidebar-box { background: white; border: 1px solid var(--line); border-radius: 17px; padding: 20px; margin-bottom: 16px; }
.sidebar-box h2 { color: var(--navy); font-size: 1rem; margin: 0 0 13px; }
.side-links { display: grid; gap: 5px; }
.side-links a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf1f5; color: #51647b; font-size: .86rem; }
.side-links a:last-child { border-bottom: 0; }
.side-links a span { color: var(--teal); }
.tip-box { background: #fff8e8; border-color: #f4d896; }
.tip-box p { color: #7b6331; margin: 0; font-size: .85rem; }
.document-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.document-card { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.document-card .tag { display: inline-block; font-size: .72rem; padding: 5px 8px; background: var(--teal-light); color: var(--teal); border-radius: 99px; font-weight: 800; }
.document-card h3 { color: var(--navy); font-size: 1rem; margin: 13px 0 5px; }
.document-card p { color: var(--muted); font-size: .84rem; margin: 0 0 13px; }
.document-card a { color: var(--teal); font-weight: 800; font-size: .85rem; }
.prose-box { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.prose-box h2, .prose-box h3 { color: var(--navy); }
.prose-box h2:first-child { margin-top: 0; }
.prose-box p, .prose-box li { color: #4f6279; }
.prose-box table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.prose-box th, .prose-box td { padding: 12px; border: 1px solid var(--line); text-align: left; }
.prose-box th { background: #edf6f5; color: var(--navy); }

@media (max-width: 850px) {
  .content-layout { grid-template-columns: 1fr; }
  .page-tools-inner { align-items: stretch; flex-direction: column; padding: 13px 0; }
  .page-search { max-width: none; }
  .semester-tabs { margin-left: 0; }
  .document-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 590px) {
  .chapter-grid, .document-grid { grid-template-columns: 1fr; }
  .page-hero { padding: 38px 0 34px; }
  .prose-box { padding: 20px; overflow-x: auto; }
}

/* WordPress integration */
.tcm-teal { color: var(--teal); }
.main-nav .tcm-menu { display: flex; align-items: center; gap: 7px; list-style: none; padding: 0; margin: 0; }
.main-nav .current-menu-item > a { color: var(--navy); background: #edf4f8; }
.wp-block-image img, .entry-content img { max-width: 100%; height: auto; border-radius: 14px; }
.entry-content { font-size: 1.03rem; }
.entry-content > * { max-width: 820px; }
.entry-content > .alignwide { max-width: 1060px; }
.entry-content > .alignfull { max-width: none; }
.entry-content h2, .entry-content h3 { color: var(--navy); line-height: 1.25; }
.entry-content a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 12px; }
.entry-content th { background: #edf6f5; }
.resource-meta { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0 0; }
.resource-meta a, .resource-meta span { padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.11); color: #d9e7f4; font-size: .82rem; }
.download-box { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 30px; padding: 22px; border: 1px solid #bfe9e2; border-radius: 16px; background: #e9faf7; }
.download-box h2 { font-size: 1.05rem; margin: 0 0 4px; }
.download-box p { margin: 0; color: #52706f; font-size: .88rem; }
.download-button { flex: 0 0 auto; display: inline-flex; padding: 11px 16px; border-radius: 11px; background: var(--teal); color: white !important; font-weight: 800; text-decoration: none !important; }
.nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.page-numbers { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 9px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.page-numbers.current { background: var(--navy); border-color: var(--navy); color: white; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.resource-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; }
.resource-navigation a { display: block; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 14px; color: var(--navy); font-weight: 700; }

@media (max-width: 980px) {
  .main-nav .tcm-menu { display: grid; }
}
@media (max-width: 640px) {
  .download-box { align-items: stretch; flex-direction: column; }
  .download-button { justify-content: center; }
  .resource-navigation { grid-template-columns: 1fr; }
}
