/* Bimarist user manual — the product's identity: light, flat, Plex Arabic. */
@font-face { font-family: Plex; font-weight: 400; font-display: swap; src: url(fonts/plex-arabic-400.woff2) format('woff2'); }
@font-face { font-family: Plex; font-weight: 600; font-display: swap; src: url(fonts/plex-arabic-600.woff2) format('woff2'); }
@font-face { font-family: Plex; font-weight: 700; font-display: swap; src: url(fonts/plex-arabic-700.woff2) format('woff2'); }

:root {
  --bg: #f2f7f6; --surface: #fff; --soft: #e3efed; --line: #d3e3e0;
  --ink: #14404a; --teal: #3a7276; --teal-d: #1e4e54; --amber: #e09634; --green: #2e8c5c; --muted: #607c80; --red: #c44038;
  --shadow: 0 10px 28px rgba(20, 64, 74, .08), 0 1px 3px rgba(20, 64, 74, .06);
  --side: 290px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.85 Plex, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: 68px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); font-weight: 700; }
.brand img { height: 38px; }
.brand span { padding-inline-start: 14px; border-inline-start: 1px solid var(--line); font-size: 17px; }
.search-btn { margin-inline-start: auto; min-width: 260px; text-align: start; font: 600 15px Plex, sans-serif; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px; cursor: pointer; }
.site { font-weight: 700; text-decoration: none; direction: ltr; }
.menu { display: none; background: none; border: 0; font-size: 24px; color: var(--ink); cursor: pointer; }

/* Layout */
.shell { display: flex; align-items: flex-start; max-width: 1400px; margin: 0 auto; }
.side { position: sticky; top: 68px; width: var(--side); flex: none; height: calc(100vh - 68px); overflow-y: auto; padding: 22px 18px 40px; border-inline-end: 1px solid var(--line); }
.side details { margin-bottom: 6px; }
.side summary { cursor: pointer; font-weight: 700; font-size: 15px; padding: 8px 10px; border-radius: 10px; list-style: none; }
.side summary::-webkit-details-marker { display: none; }
.side summary::before { content: '‹'; display: inline-block; width: 16px; transition: transform .15s; }
.side details[open] summary::before { transform: rotate(-90deg); }
.side ul { list-style: none; margin: 2px 0 8px; padding: 0 16px 0 0; }
.side li a { display: block; padding: 5px 12px; border-radius: 8px; font-size: 15px; color: var(--ink); text-decoration: none; }
.side li a:hover { background: var(--soft); }
.side li a[aria-current] { background: var(--teal); color: #fff; font-weight: 600; }
.main { flex: 1; min-width: 0; padding: 36px 56px 60px; max-width: 980px; }

/* Article */
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
h1 { font-size: 40px; line-height: 1.3; margin: 6px 0 10px; }
h1::after { content: ''; display: block; width: 72px; height: 6px; border-radius: 3px; background: var(--amber); margin-top: 14px; }
h2 { font-size: 27px; line-height: 1.4; margin: 46px 0 12px; padding-top: 6px; }
h3 { font-size: 20px; margin: 30px 0 8px; }
.anchor { opacity: 0; text-decoration: none; color: var(--muted); font-size: .7em; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
.lead { font-size: 20px; color: var(--muted); font-weight: 600; margin: 4px 0 18px; }
.facts { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; margin: 18px 0; }
.facts b { display: inline-block; min-width: 128px; font-size: 14px; color: var(--muted); }
.chip { display: inline-block; background: var(--soft); color: var(--teal-d); border-radius: 999px; padding: 1px 12px; margin: 2px 0 2px 6px; font-size: 14px; font-weight: 600; }
.where { font-weight: 600; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 20px; margin-bottom: 8px; }
.toc summary { cursor: pointer; font-weight: 700; }
.toc ol { margin: 8px 0 0; padding-inline-start: 22px; columns: 2; column-gap: 32px; }
.toc li { font-size: 15px; break-inside: avoid; }
.body p, .body li { max-width: 72ch; }
.body ol, .body ul { padding-inline-start: 26px; }
.body li { margin: 4px 0; }
.body li::marker { color: var(--teal); font-weight: 700; }
.body strong { color: var(--teal-d); }
.body code { font-family: inherit; background: var(--soft); padding: 1px 8px; border-radius: 6px; font-weight: 600; }
.body kbd { font-family: inherit; font-weight: 700; font-size: .9em; background: var(--surface); border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 8px; padding: 0 9px; white-space: nowrap; }
.note { margin: 20px 0; background: #fdf4e7; border-inline-start: 5px solid var(--amber); border-radius: 12px; padding: 12px 20px; }
.note p { margin: 4px 0; }
.table-wrap { overflow-x: auto; margin: 16px 0; }
table { border-collapse: collapse; width: 100%; background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); font-size: 15px; }
th, td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
th { background: var(--soft); font-weight: 700; }
.perm td.yes { color: var(--green); font-weight: 700; text-align: center; }
.perm td.no { color: var(--line); text-align: center; }
.perm th:not(:first-child) { text-align: center; }
.chips { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 14px; font-weight: 600; font-size: 15px; }

/* Screenshots & videos */
figure { margin: 22px 0; }
.shot a { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); cursor: zoom-in; }
.shot img { display: block; width: 100%; }
figcaption { font-size: 14px; color: var(--muted); font-weight: 600; margin-top: 8px; }
.tag { display: inline-block; background: var(--amber); color: #fff; border-radius: 6px; padding: 0 8px; font-size: 12px; font-weight: 700; margin-inline-end: 4px; }
.video video, .video button { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--ink); }
.video button { position: relative; padding: 0; cursor: pointer; overflow: hidden; }
.video button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video .play { position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; background: var(--teal); box-shadow: var(--shadow); }
.video .play::after { content: ''; position: absolute; top: 27px; left: 34px; border-style: solid; border-width: 15px 0 15px 24px; border-color: transparent transparent transparent #fff; }
.video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; }

/* Pager & footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.pager a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; text-decoration: none; font-weight: 700; color: var(--ink); }
.pager a:hover { border-color: var(--teal); }
.pager small { display: block; color: var(--muted); font-weight: 600; font-size: 13px; }
.pager .next { text-align: left; }
.foot { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* Home */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 34px 36px; box-shadow: var(--shadow); }
.hero h1 { margin-top: 0; }
.hero-search { width: 100%; text-align: start; font: 600 17px Plex, sans-serif; color: var(--muted); background: var(--bg); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 20px; cursor: pointer; }
.home-h { margin-top: 40px; }
.roles, .sections, .videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.role-card, .section-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 22px; }
.role-card { border-top: 5px solid var(--teal); }
.role-card h3, .section-card h3 { margin: 0 0 4px; }
.role-card p { margin: 0 0 8px; color: var(--muted); font-size: 15px; }
.role-card ol, .section-card ul { margin: 0; padding-inline-start: 20px; font-size: 15px; }
.video-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; text-decoration: none; color: var(--ink); }
.video-card b { display: block; margin-top: 6px; }

/* Search */
.search { position: fixed; inset: 0; z-index: 50; background: rgba(20, 64, 74, .35); display: flex; flex-direction: column; align-items: center; padding: 80px 16px 16px; }
.search[hidden] { display: none; }
.search-box { display: flex; gap: 10px; width: min(720px, 100%); background: var(--surface); border-radius: 16px; padding: 10px; box-shadow: var(--shadow); }
.search-box input { flex: 1; font: 600 18px Plex, sans-serif; border: 0; outline: 0; padding: 8px 12px; color: var(--ink); }
.search-box button { font: 600 14px Plex, sans-serif; border: 0; background: var(--soft); color: var(--ink); border-radius: 10px; padding: 0 16px; cursor: pointer; }
.results { width: min(720px, 100%); max-height: 70vh; overflow-y: auto; list-style: none; margin: 10px 0 0; padding: 0; }
.results a { display: block; background: var(--surface); border-radius: 12px; padding: 12px 18px; margin-bottom: 8px; text-decoration: none; color: var(--ink); }
.results a:focus, .results a:hover { outline: 2px solid var(--teal); }
.results b { display: block; }
.results small { color: var(--muted); }
.results mark { background: #fbe3c0; color: inherit; border-radius: 3px; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(20, 64, 74, .85); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 100%; border-radius: 10px; }

@media (max-width: 960px) {
  .menu { display: block; }
  .side { position: fixed; top: 68px; right: 0; z-index: 40; background: var(--surface); transform: translateX(105%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .main { padding: 24px 16px 48px; }
  .search-btn { min-width: 0; }
  .site, .brand span { display: none; }
  h1 { font-size: 30px; }
  .toc ol { columns: 1; }
}
@media print { .top, .side, .pager, .search { display: none !important; } .main { padding: 0; } }
