/* AskTeko Guides (the blog): English + Arabic (RTL) article pages, hubs and the year-group finder.
   Loaded after site.css and reuses its tokens. Logical properties throughout so the same rules work in RTL. */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('../assets/fonts/IBMPlexSansArabic-500-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('../assets/fonts/IBMPlexSansArabic-700-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* ---------- Arabic: own typeface, no negative tracking (it breaks letter joining), roomier lines ---------- */
html[dir="rtl"] { --font: 'IBM Plex Sans Arabic', 'Nunito', 'Segoe UI', Tahoma, system-ui, sans-serif; }
[dir="rtl"] body { font-weight: 500; line-height: 1.85; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 { letter-spacing: 0; font-weight: 700; line-height: 1.35; }
[dir="rtl"] .btn, [dir="rtl"] .faq-item summary { font-weight: 700; }
[dir="rtl"] .faq-item summary { padding: 20px 0 20px 48px; }
[dir="rtl"] .faq-item summary::after { right: auto; left: 0; }
[dir="rtl"] .faq-item p { padding-right: 0; padding-left: 48px; }
[dir="rtl"] .arrow-ic { transform: scaleX(-1); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- Reading progress ---------- */
.read-progress { position: fixed; inset-inline: 0; top: 0; height: 4px; z-index: 60; background: transparent; pointer-events: none; }
.read-progress i { display: block; height: 100%; width: 100%; background: var(--g-brand); transform-origin: left; transform: scaleX(var(--p, 0)); box-shadow: 0 0 12px rgba(255, 79, 216, .6); }
[dir="rtl"] .read-progress i { transform-origin: right; }

/* ---------- Page head for guides ---------- */
.guide-head { padding: clamp(36px, 6vw, 80px) 0 clamp(48px, 6vw, 84px); }
.guide-head h1 { font-size: clamp(2.2rem, 4.6vw, 3.9rem); max-width: 20ch; line-height: 1.04; }
[dir="rtl"] .guide-head h1 { line-height: 1.3; }
.guide-head .lede { max-width: 42em; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0 0 22px; padding: 0; list-style: none; font-size: .95rem; font-weight: 800; }
.crumbs li { display: inline-flex; align-items: center; gap: 10px; color: #CFC9FF; }
.crumbs li + li::before { content: '/'; opacity: .5; }
.night .crumbs a { color: #fff; text-decoration: none; }
.night .crumbs a:hover { text-decoration: underline; }
.head-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.cat-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; border-radius: 999px; background: var(--lime); color: var(--ink) !important; font-weight: 900; font-size: .9rem; text-decoration: none; }
.lang-link { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .35); color: #fff !important; font-weight: 800; font-size: .95rem; text-decoration: none; background: rgba(255, 255, 255, .08); }
.lang-link:hover { background: rgba(255, 255, 255, .18); }
.lang-link[lang="ar"] { font-family: 'IBM Plex Sans Arabic', var(--font); font-weight: 700; }
.lang-link[lang="en"] { font-family: 'Nunito', system-ui, sans-serif; }
.byline { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 26px; font-size: .98rem; font-weight: 700; color: #D9D4FF; }
.byline span { display: inline-flex; align-items: center; gap: 8px; }
.byline .ic { width: 22px; height: 22px; }
.byline b { color: #fff; }

/* ---------- Article layout ---------- */
.guide-body { padding: clamp(32px, 5vw, 64px) 0 clamp(56px, 8vw, 100px); }
.guide-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 20px); padding: 20px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .72); border: 2px solid var(--line); backdrop-filter: blur(6px); max-height: calc(100vh - var(--header-h) - 40px); overflow: auto; }
.toc h2 { font-size: .86rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 0 0 10px; }
[dir="rtl"] .toc h2 { text-transform: none; letter-spacing: 0; font-size: 1rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.toc a { display: grid; grid-template-columns: 26px 1fr; gap: 6px; padding: 8px 10px; border-radius: 12px; text-decoration: none; color: var(--ink-2); font-size: .95rem; font-weight: 800; line-height: 1.3; counter-increment: toc; }
.toc a::before { content: counter(toc); font-size: .8rem; color: var(--ink-3); padding-top: 2px; }
.toc a:hover { background: var(--purple-soft); color: var(--purple); }
.toc a.is-current { background: var(--purple); color: #fff; }
.toc a.is-current::before { color: var(--lime); }
.toc-mobile { display: none; }
@media (max-width: 980px) {
  .guide-grid { grid-template-columns: 1fr; }
  .toc { display: none; }
  .toc-mobile { display: block; margin-bottom: 20px; border-radius: var(--r-md); background: #fff; border: 2px solid var(--line); padding: 0 18px; }
  .toc-mobile summary { cursor: pointer; padding: 16px 0; font-weight: 900; }
  .toc-mobile ol { margin: 0 0 16px; padding-inline-start: 22px; display: grid; gap: 8px; }
  .toc-mobile a { color: var(--ink-2); font-weight: 800; text-decoration: none; }
}

.article { background: #fff; border: 2px solid var(--line); border-radius: var(--r-xl); padding: clamp(22px, 5vw, 64px); box-shadow: 0 30px 80px -50px rgba(40, 20, 120, .45); min-width: 0; }
.article > :first-child { margin-top: 0; }
.article { font-size: 1.12rem; line-height: 1.75; }
.article p, .article li { color: #2A2950; max-width: 70ch; }
.article h2 { font-size: clamp(1.65rem, 3vw, 2.25rem); margin: 1.9em 0 .55em; scroll-margin-top: calc(var(--header-h) + 20px); }
.article h3 { font-size: clamp(1.25rem, 2vw, 1.45rem); margin: 1.5em 0 .5em; scroll-margin-top: calc(var(--header-h) + 20px); }
.article ul, .article ol { padding-inline-start: 1.3em; }
.article li { margin-bottom: .45em; }
.article li::marker { color: var(--purple); font-weight: 900; }
.article strong { color: var(--ink); font-weight: 900; }
[dir="rtl"] .article strong { font-weight: 700; }
.article a { font-weight: 800; }
.article .lead-in { font-size: 1.25rem; color: var(--ink-2); }

/* Key facts */
.keyfacts { border-radius: var(--r-lg); background: linear-gradient(135deg, #F6FFD0, #E9FFF9); border: 2px solid #D7EE7E; padding: 22px 24px; margin: 0 0 32px; }
.keyfacts h2 { font-size: 1.2rem !important; margin: 0 0 12px !important; display: flex; align-items: center; gap: 10px; }
.keyfacts ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.keyfacts li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; margin: 0; max-width: none; }
.keyfacts li::before { content: ''; width: 22px; height: 22px; margin-top: 5px; border-radius: 7px; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23DDFF3A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }

/* Notes */
.note { border-radius: var(--r-md); padding: 18px 20px; margin: 26px 0; border: 2px solid var(--line); background: var(--paper); }
.note > :last-child { margin-bottom: 0; }
.note .note-title { display: block; font-weight: 900; margin-bottom: 4px; color: var(--ink); }
.note.tip { background: #EEF9FF; border-color: #BFE6FB; }
.note.warn { background: #FFF6CF; border-color: #F1DF8A; }
.note.cambridge { background: #F1EEFF; border-color: #CFC7FF; }
.note.cambridge .note-title::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--purple); margin-inline-end: 8px; vertical-align: 1px; box-shadow: 0 0 0 4px rgba(91, 75, 255, .18); }

/* Pull quote / big number */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 28px 0; }
.stat { border-radius: var(--r-md); padding: 18px; background: var(--purple-night); color: #fff; }
.stat b { display: block; font-size: clamp(1.8rem, 3.2vw, 2.4rem); line-height: 1.05; font-weight: 900; color: var(--lime); }
.stat span { color: #D9D4FF; font-size: .95rem; font-weight: 700; line-height: 1.4; display: block; margin-top: 6px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 26px 0; border-radius: var(--r-md); border: 2px solid var(--line); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline-offset: 2px; }
table.data { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.45; min-width: 560px; }
table.data caption { text-align: start; padding: 14px 16px; font-weight: 900; color: var(--ink); background: var(--paper); border-bottom: 2px solid var(--line); }
table.data th, table.data td { padding: 12px 14px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
table.data thead th { background: var(--ink); color: #fff; font-weight: 900; white-space: nowrap; }
table.data tbody tr:nth-child(even) td, table.data tbody tr:nth-child(even) th { background: #FAF9FF; }
table.data tbody th { font-weight: 900; color: var(--ink); background: #F4F2FF; }
table.data tbody tr:last-child > * { border-bottom: 0; }
table.data .hl { background: #F6FFD0 !important; }

/* Pathway diagram (HTML, so it translates and mirrors for RTL) */
.pathway { margin: 30px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; counter-reset: st; }
.pathway .st { --c: var(--purple); border-radius: var(--r-md); padding: 16px; background: #fff; border: 2px solid var(--line); border-top: 8px solid var(--c); display: grid; gap: 6px; align-content: start; position: relative; }
.pathway .st:nth-child(2) { --c: var(--sky); } .pathway .st:nth-child(3) { --c: var(--pink); } .pathway .st:nth-child(4) { --c: var(--sun); }
.pathway .st .age { font-size: .86rem; font-weight: 900; color: var(--ink-3); }
.pathway .st h3, .pathway .st h4 { margin: 0; font-size: 1.15rem; }
.pathway .st p { margin: 0; font-size: .95rem; line-height: 1.45; color: var(--ink-2); }
.pathway .st .q { margin-top: 6px; display: inline-flex; padding: 4px 10px; border-radius: 999px; background: var(--paper); font-size: .85rem; font-weight: 900; color: var(--ink); justify-self: start; }
@media (max-width: 760px) { .pathway { grid-template-columns: 1fr 1fr; } }
@media (max-width: 440px) { .pathway { grid-template-columns: 1fr; } }

/* Side-by-side comparison */
.versus { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 26px 0; }
.versus > div { border-radius: var(--r-md); padding: 18px 20px; border: 2px solid var(--line); background: #fff; }
.versus > div:first-child { border-color: #CFC7FF; background: #F6F4FF; }
.versus > div:last-child { border-color: #FFD2BF; background: #FFF7F2; }
.versus h3 { margin: 0 0 8px !important; font-size: 1.15rem; }
.versus ul { margin: 0; }
.versus li { font-size: 1rem; }
@media (max-width: 640px) { .versus { grid-template-columns: 1fr; } }

/* Grade scale strip */
.scale { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 24px; direction: ltr; }   /* grade order is always A* … G, left to right */
[dir="rtl"] .scale { justify-content: flex-end; }
.scale span { min-width: 46px; height: 46px; padding: 0 10px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; background: var(--paper); border: 2px solid var(--line); color: var(--ink); direction: ltr; }
.scale span.top { background: var(--lime); border-color: #B9D61E; }
.scale span.pass { background: #E3FBEA; border-color: #A9E5BC; }
.scale span.fail { background: #FFE9EA; border-color: #F6BABD; }

/* Sources and disclaimer */
.sources { margin-top: 48px; padding-top: 28px; border-top: 2px dashed var(--line); }
.sources h2 { font-size: 1.4rem !important; margin-top: 0 !important; }
.sources ol { font-size: .98rem; }
.sources li { color: var(--ink-2); }
.sources .checked { font-size: .95rem; color: var(--ink-3); font-weight: 700; }
.disclaimer { margin-top: 24px; font-size: .92rem; color: var(--ink-3); font-weight: 700; line-height: 1.6; }

/* FAQ inside an article */
.article .faq { margin-top: 18px; max-width: none; }
.article .faq-item p { max-width: none; }

/* Related guides */
.related { padding: 0 0 clamp(56px, 8vw, 100px); }
.related h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }

/* ---------- Guide cards (hub + related) ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 26px; }
@media (max-width: 1000px) { .post-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .post-grid { grid-template-columns: 1fr; } }
.post-card { position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; padding: 24px; border-radius: var(--r-lg); background: #fff; border: 2px solid var(--line); text-decoration: none; color: var(--ink); transition: transform .2s, box-shadow .2s, border-color .2s; isolation: isolate; overflow: hidden; }
.post-card:hover { transform: translateY(-4px); border-color: var(--purple); box-shadow: var(--glow-purple); color: var(--ink); }
.post-card .pc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.post-card .pc-cat { font-size: .82rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--purple); }
[dir="rtl"] .post-card .pc-cat { text-transform: none; letter-spacing: 0; font-size: .92rem; }
.post-card h3 { margin: 0; font-size: 1.3rem; line-height: 1.2; }
[dir="rtl"] .post-card h3 { line-height: 1.45; }
.post-card p { margin: 0; color: var(--ink-2); font-size: 1rem; line-height: 1.55; }
.post-card .pc-foot { display: flex; align-items: center; justify-content: space-between; font-size: .9rem; font-weight: 800; color: var(--ink-3); }
.post-card .pc-go { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--purple-soft); color: var(--purple); transition: background .2s; }
.post-card:hover .pc-go { background: var(--lime); color: var(--ink); }
.post-card .pc-go svg { width: 20px; height: 20px; }
.post-card.feature { grid-column: span 2; background: var(--g-night); color: #fff; border-color: transparent; }
.post-card.feature h3 { color: #fff; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.post-card.feature p { color: #D9D4FF; }
.post-card.feature .pc-cat { color: var(--lime); }
.post-card.feature .pc-foot { color: #CFC9FF; }
@media (max-width: 640px) { .post-card.feature { grid-column: auto; } }

.hub-intro { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 900px) { .hub-intro { grid-template-columns: 1fr; } }
.hub-promise { display: grid; gap: 12px; }
.hub-promise > div { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; padding: 16px 18px; border-radius: var(--r-md); background: #fff; border: 2px solid var(--line); }
.hub-promise h3 { margin: 0 0 2px; font-size: 1.1rem; }
.hub-promise p { margin: 0; font-size: 1rem; color: var(--ink-2); }
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.cat-filter button { border: 2px solid var(--line); background: #fff; border-radius: 999px; min-height: 42px; padding: 0 16px; font: 900 .98rem/1 var(--font); color: var(--ink-2); cursor: pointer; }
.cat-filter button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Year-group finder ---------- */
.finder { margin: 30px 0; border-radius: var(--r-lg); padding: clamp(20px, 4vw, 32px); background: var(--g-night); color: #fff; position: relative; overflow: hidden; }
.finder h2, .finder h3 { color: #fff; margin-top: 0 !important; }
.finder p { color: #D9D4FF !important; }
.finder form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 14px 0 6px; }
.finder label { display: grid; gap: 6px; font-weight: 900; font-size: .95rem; color: #fff; }
.finder select, .finder input { min-height: 50px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .12); color: #fff; font: 800 1.05rem/1 var(--font); padding: 0 14px; color-scheme: dark; }
.finder select option { color: var(--ink); background: #fff; }
.finder-out { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.finder-out > div { border-radius: var(--r-md); background: rgba(255, 255, 255, .1); border: 1.5px solid rgba(255, 255, 255, .2); padding: 14px 16px; }
.finder-out small { display: block; color: #CFC9FF; font-weight: 800; font-size: .85rem; }
.finder-out b { display: block; font-size: 1.5rem; color: var(--lime); line-height: 1.2; margin-top: 4px; }
.finder-out span { display: block; font-size: .9rem; color: #D9D4FF; margin-top: 4px; line-height: 1.4; }
.finder .fine { font-size: .9rem; margin: 14px 0 0; }
@media (max-width: 640px) { .finder-out { grid-template-columns: 1fr; } }

/* ---------- Static header/footer (Arabic pages build their own chrome) ---------- */
[dir="rtl"] .nav a, [dir="rtl"] .mobile-nav a { font-weight: 700; }
.site-footer .footer-grid nav a[lang="en"] { font-family: 'Nunito', system-ui, sans-serif; }

@media print {
  .site-header, .site-footer, .toc, .toc-mobile, .read-progress, .related, .cta, .teko-wake, .lang-link { display: none !important; }
  .article { border: 0; box-shadow: none; padding: 0; }
  body { background: #fff; }
}
