/* ==========================================================================
   Sir Al-Basirah — "Sacred Manuscript Modern"
   Emerald primary, gold accents, Nouri paper surfaces, RTL Arabic.
   ========================================================================== */

:root {
    /* primary — emerald */
    --brand-50: #f6fff5;
    --brand-100: #e0f5e8;
    --brand-200: #8ff8ba;
    --brand-300: #73db9f;
    --brand-500: #098652;
    --brand-600: #006a40;
    --brand-700: #005230;
    --brand-800: #0e4b30;
    --brand-900: #002110;

    /* secondary — gold */
    --gold-100: #fff4d1;
    --gold-200: #ffdf94;
    --gold-300: #fecf4f;
    --gold-500: #d9a800;
    --gold-600: #765b00;

    /* tertiary — lime */
    --lime-200: #d1ef6c;
    --lime-500: #667e00;

    /* neutrals */
    --ink: #1c1b1b;
    --ink-soft: #3e4941;
    --muted: #6e7a70;
    --line: #bdcabe;
    --paper: #fdf8f8;
    --surface: #ffffff;
    --surface-alt: #f7f2f2;

    /* shape + rhythm */
    --r-sm: 0.25rem;
    --r: 0.5rem;
    --r-md: 0.75rem;
    --r-lg: 1rem;
    --r-full: 9999px;
    --container: 1280px;
    --gutter: 24px;
    --section: 96px;

    --font-body: 'Lexend', 'IBM Plex Sans Arabic', system-ui, sans-serif;
    --font-display: 'El Messiri', 'IBM Plex Sans Arabic', serif;
    --font-utility: 'IBM Plex Sans Arabic', system-ui, sans-serif;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    /* stop iOS enlarging text when the phone is rotated to landscape */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    /* a decorative overhang must never create a sideways scrollbar;
       `clip` rather than `hidden` so position:sticky still works */
    overflow-x: clip;
}

/* long words and URLs break instead of forcing the page wider */
h1, h2, h3, h4, h5, h6, p, li, a, td, th {
    overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 0.6em;
    color: var(--ink);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; line-height: 1.95; }

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-500); }

img { max-width: 100%; height: auto; }

::selection { background: var(--brand-600); color: #fff; }

.sab-container {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.sab-section { padding-block: var(--section); }
.sab-section--alt { background: var(--surface-alt); }

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.skip-link:focus {
    position: fixed; inset-block-start: 1rem; inset-inline-end: 1rem;
    z-index: 100; background: var(--brand-600); color: #fff;
    padding: 0.6rem 1rem; border-radius: var(--r); width: auto; height: auto;
    clip: auto;
}

/* ------------------------------------------------------------ artwork ---- */

.sab-pattern { position: relative; }
.sab-pattern::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-color: var(--pattern-color, currentColor);
    opacity: var(--pattern-opacity, 0.07);
    -webkit-mask: var(--mask-pattern) repeat 0 0 / 120px 120px;
    mask: var(--mask-pattern) repeat 0 0 / 120px 120px;
}
.sab-pattern > * { position: relative; }

/* tintable decorative shapes — an <img> can't inherit currentColor, a mask can */
.sab-art {
    background-color: var(--art-color, currentColor);
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-size: contain; mask-size: contain;
}

/* framed portraits — scalloped cartouche */
.sab-framed { position: relative; aspect-ratio: 600 / 720; }
.sab-framed::before {
    content: '';
    position: absolute; inset: -8%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(254, 207, 79, 0.3), transparent 68%);
    opacity: 0.45;
}
.sab-framed__photo {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    -webkit-mask: var(--mask-frame) center / contain no-repeat;
    mask: var(--mask-frame) center / contain no-repeat;
}
.sab-framed__keyline {
    position: absolute; inset: 0; pointer-events: none;
    background: var(--img-frame-outline) center / contain no-repeat;
}

/* ------------------------------------------------------------- header ---- */

.sab-topbar {
    background: var(--brand-800);
    color: rgba(255, 255, 255, 0.85);
    font-family: var(--font-utility);
    font-size: 13px;
}
.sab-topbar .sab-container {
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px; padding-block: 10px;
}
.sab-topbar a { color: inherit; }
.sab-topbar a:hover { color: var(--gold-300); }
.sab-topbar__links { display: flex; gap: 24px; align-items: center; }

.sab-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(253, 248, 248, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gold-300);
}
.sab-header .sab-container {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.sab-brand { display: flex; align-items: center; gap: 12px; padding-block: 12px; }
/* Brand medallion. The supplied artwork carries its own light ground, so
   it is clipped to a circle and given a thin gold ring to read as a badge
   on both the paper header and darker surfaces. */
.sab-brand__mark {
    width: 52px; height: 52px; flex: none;
    border-radius: var(--r-full);
    object-fit: cover;
    background: #fbfaf5;
    box-shadow: 0 0 0 1px rgba(217, 168, 0, 0.35);
}

/* WordPress's own custom-logo output gets the same treatment */
.custom-logo {
    width: 52px; height: 52px; flex: none;
    border-radius: var(--r-full); object-fit: cover;
    background: #fbfaf5;
    box-shadow: 0 0 0 1px rgba(217, 168, 0, 0.35);
}
.sab-brand__name {
    font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
    color: var(--ink); display: block; line-height: 1.3;
}
.sab-brand__tag { font-size: 12px; color: var(--muted); display: block; }

.sab-nav { font-family: var(--font-utility); }
.sab-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.sab-nav li { position: relative; }
.sab-nav a {
    display: block; padding: 22px 14px;
    font-size: 15px; font-weight: 500; color: var(--ink-soft);
}
.sab-nav a:hover,
.sab-nav .current-menu-item > a { color: var(--brand-600); }

/* dropdowns */
.sab-nav ul ul {
    position: absolute; inset-block-start: 100%; inset-inline-end: 0;
    min-width: 240px; display: block;
    background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--r-md);
    box-shadow: 0 18px 40px -20px rgba(0, 33, 16, 0.3);
    padding: 8px; opacity: 0; visibility: hidden;
    transform: translateY(8px); transition: all 0.2s var(--ease);
}
/* Panels open on click, not hover — the titles stay hidden until the
   visitor actually asks for them. `is-open` is toggled in theme.js. */
.sab-nav li.is-open > ul { opacity: 1; visibility: visible; transform: none; }
.sab-nav ul ul a { padding: 10px 14px; border-radius: var(--r); font-size: 14px; }
.sab-nav ul ul a:hover { background: var(--brand-50); }

/* third level (a study level's lessons) flies out to the side.
   In RTL that means opening leftwards from the parent panel. */
.sab-nav ul ul ul {
    inset-block-start: -8px;
    inset-inline-end: 100%;
    margin-inline-end: 6px;
    max-height: 70vh;
    overflow-y: auto;
}

/* parents that have a child panel get a chevron */
.sab-nav ul ul > li.menu-item-has-children > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.sab-nav ul ul > li.menu-item-has-children > a::after {
    content: '';
    width: 6px;
    height: 6px;
    flex: none;
    border-inline-start: 1.5px solid currentColor;
    border-block-end: 1.5px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.5;
}

/* top-level parents keep a downward caret */
.sab-nav > ul > li.menu-item-has-children > a::after {
    content: '';
    width: 6px;
    height: 6px;
    margin-inline-start: 6px;
    border-inline-end: 1.5px solid currentColor;
    border-block-end: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: 0.55;
    transition: transform 0.2s var(--ease);
}
.sab-nav > ul > li.menu-item-has-children.is-open > a::after {
    transform: rotate(225deg) translateY(-2px);
}

/* an open parent reads as active */
.sab-nav li.is-open > a { color: var(--brand-600); }

/* "view everything in this section" link at the foot of a panel */
.sab-nav .sab-viewall > a {
    margin-top: 4px;
    border-top: 1px solid var(--line);
    border-radius: 0;
    font-weight: 600;
    color: var(--brand-600);
}

.sab-menu-toggle {
    display: none; width: 44px; height: 44px;
    align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: var(--r-md);
    background: transparent; color: var(--ink); cursor: pointer;
}

/* ------------------------------------------------------------ buttons ---- */

.sab-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 26px; border-radius: var(--r-lg);
    font-family: var(--font-body); font-size: 14px; font-weight: 600;
    border: 1px solid transparent; cursor: pointer;
    transition: all 0.25s var(--ease);
}
.sab-btn--primary { background: var(--brand-600); color: #fff; }
.sab-btn--primary:hover {
    background: var(--brand-500); color: #fff;
    box-shadow: 0 0 0 4px rgba(254, 207, 79, 0.28);
}
.sab-btn--gold { background: var(--gold-300); color: var(--brand-900); }
.sab-btn--gold:hover { background: var(--gold-200); color: var(--brand-900); }
.sab-btn--ghost { border-color: var(--brand-600); color: var(--brand-600); background: transparent; }
.sab-btn--ghost:hover { background: var(--brand-50); }
.sab-btn--light { border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.sab-btn--light:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* --------------------------------------------------------------- hero ---- */

.sab-hero {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--brand-700), var(--brand-800));
    color: #fff;
    padding-block: 110px;
}
.sab-hero h1 { color: #fff; max-width: 20ch; }
.sab-hero p { color: rgba(255, 255, 255, 0.78); max-width: 60ch; font-size: 1.05rem; }
.sab-hero__eyebrow {
    display: inline-block; margin-bottom: 16px;
    padding: 6px 16px; border-radius: var(--r-full);
    border: 1px solid rgba(254, 207, 79, 0.45);
    background: rgba(254, 207, 79, 0.12);
    color: var(--gold-300);
    font-family: var(--font-utility); font-size: 14px;
}
.sab-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.sab-hero__lantern {
    position: absolute; inset-inline-end: 6%; inset-block-start: -10px;
    width: 110px; height: 260px; opacity: 0.3;
}
.sab-hero__skyline {
    position: absolute; inset-inline: 0; inset-block-end: 0;
    height: 110px; opacity: 0.09;
    -webkit-mask-position: bottom center; mask-position: bottom center;
}

/* page banner on inner pages */
.sab-banner {
    position: relative; overflow: hidden;
    background: var(--brand-800); color: #fff;
    padding-block: 72px;
}
.sab-banner h1 { color: #fff; margin-bottom: 0; }
.sab-banner__crumbs {
    font-family: var(--font-utility); font-size: 14px;
    color: rgba(255, 255, 255, 0.6); margin-bottom: 12px;
}
.sab-banner__crumbs a { color: inherit; }
.sab-banner__crumbs a:hover { color: var(--gold-300); }
.sab-banner__ornament {
    position: absolute; inset-inline-end: -30px; inset-block-start: -20px;
    width: 200px; height: 200px; opacity: 0.22;
}

/* -------------------------------------------------------------- cards ---- */

/* `min(px, 100%)` lets a track shrink below its ideal width on narrow
   screens. A bare minmax(300px, 1fr) cannot, so on a 320px phone the grid
   stays 300px wide inside a 288px container and pushes the page sideways. */
.sab-grid { display: grid; gap: 24px; }
.sab-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.sab-grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.sab-grid--4 { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }

.sab-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.sab-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -22px rgba(0, 106, 64, 0.4);
}
.sab-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--brand-800); }
.sab-card__media img { width: 100%; height: 100%; object-fit: cover; }
.sab-card__body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.sab-card__title { font-size: 1.1rem; margin-bottom: 10px; }
.sab-card__title a { color: var(--ink); }
.sab-card__title a:hover { color: var(--brand-600); }
.sab-card__excerpt { color: var(--muted); font-size: 0.92rem; margin-bottom: 16px; }
.sab-card__meta {
    margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
    font-family: var(--font-utility); font-size: 12px; color: var(--muted);
    display: flex; justify-content: space-between; gap: 10px;
}

.sab-badge {
    display: inline-block; padding: 4px 12px;
    border-radius: var(--r-full);
    font-family: var(--font-utility); font-size: 11px; font-weight: 600;
    background: var(--brand-50); color: var(--brand-700);
    width: fit-content;
}
.sab-badge--gold { background: rgba(254, 207, 79, 0.2); color: var(--gold-600); }
.sab-badge--lock { background: rgba(254, 207, 79, 0.2); color: var(--gold-600); }

/* level cards */
.sab-level {
    position: relative; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--r);
    padding: 28px; overflow: hidden; display: block;
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.sab-level:hover { transform: translateY(-5px); box-shadow: 0 20px 40px -22px rgba(0, 106, 64, 0.4); }
.sab-level::after {
    content: ''; position: absolute; inset-block-start: 0; inset-inline: 0; height: 3px;
    background: linear-gradient(to left, var(--brand-500), var(--gold-300));
}
.sab-level__num {
    font-family: var(--font-display); font-size: 2.6rem; font-weight: 700;
    color: rgba(9, 134, 82, 0.18); line-height: 1;
}

/* ---- photo variant -------------------------------------------------
   The image runs to the card edges, so the padding moves onto the text
   below it and the number sits over the photo. */
.sab-level--photo { padding: 0; display: flex; flex-direction: column; }
.sab-level--photo .sab-level__title,
.sab-level--photo .sab-level__sub,
.sab-level--photo .sab-level__desc,
.sab-level--photo .sab-badge { margin-inline: 24px; }
.sab-level--photo .sab-level__title { margin-top: 18px; }
.sab-level--photo .sab-badge { margin-bottom: 24px; }

.sab-level__media {
    position: relative;
    display: block;
    aspect-ratio: 8 / 5;
    overflow: hidden;
    background: var(--brand-800);
}
.sab-level__media img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s var(--ease);
}
.sab-level--photo:hover .sab-level__media img { transform: scale(1.04); }

/* a wash keeps the number legible whatever the photo is doing */
.sab-level__media::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(14, 75, 48, 0.75), rgba(14, 75, 48, 0.05) 55%);
}
.sab-level--photo .sab-level__num {
    position: absolute;
    inset-block-end: 10px;
    inset-inline-end: 20px;
    z-index: 1;
    color: rgba(255, 255, 255, 0.92);
    font-size: 2.4rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.sab-level__title { font-size: 1.1rem; margin: 10px 0 4px; color: var(--ink); }
.sab-level__sub { font-family: var(--font-utility); font-size: 13px; color: var(--gold-600); }
.sab-level__desc { color: var(--muted); font-size: 0.9rem; margin-top: 10px; }

/* ---------------------------------------------------------- section head - */

.sab-head { max-width: 60ch; margin-inline: auto; text-align: center; margin-bottom: 48px; }
.sab-head--start { margin-inline: 0; text-align: start; }
.sab-head__eyebrow {
    font-family: var(--font-utility); font-size: 14px; font-weight: 600;
    color: var(--gold-600); letter-spacing: 0.02em; display: block; margin-bottom: 10px;
}
.sab-head p { color: var(--muted); }

.sab-rule {
    display: block; height: 28px; width: 220px; margin: 18px auto 0;
}
.sab-head--start .sab-rule { margin-inline: 0; }

/* ---------------------------------------------------------------- stats -- */

.sab-stats {
    position: relative; overflow: hidden;
    background: var(--brand-800); color: #fff; padding-block: 80px;
}
.sab-stats h2 { color: #fff; }
.sab-stats p { color: rgba(255, 255, 255, 0.72); }
.sab-stat { text-align: center; }
.sab-stat__value {
    font-family: var(--font-display); font-size: 2.6rem; font-weight: 700;
    color: var(--gold-300);
}
.sab-stat__label { font-family: var(--font-utility); font-size: 14px; color: rgba(255, 255, 255, 0.72); }

/* ------------------------------------------------------------- content --- */

.sab-entry { max-width: 76ch; margin-inline: auto; }
.sab-entry__content { font-size: 1.05rem; line-height: 2.05; }
.sab-entry__content h2,
.sab-entry__content h3 { margin-top: 1.9em; color: var(--brand-700); }
.sab-entry__content img { border-radius: var(--r); margin-block: 1.6em; }
.sab-entry__content blockquote {
    margin: 1.8em 0; padding: 18px 22px;
    background: var(--surface-alt);
    border-inline-start: 3px solid var(--gold-300);
    border-radius: var(--r);
}
.sab-entry__content ul,
.sab-entry__content ol { padding-inline-start: 1.4em; }
.sab-entry__meta {
    font-family: var(--font-utility); font-size: 13px; color: var(--muted);
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    margin-bottom: 28px;
}
.sab-entry__thumb { border-radius: var(--r); margin-bottom: 28px; width: 100%; }

/* gated lesson notice */
.sab-gate {
    text-align: center; padding: 48px 32px;
    border: 1px solid rgba(254, 207, 79, 0.5);
    background: rgba(254, 207, 79, 0.07);
    border-radius: var(--r);
}
.sab-gate__icon {
    width: 56px; height: 56px; margin-inline: auto; margin-bottom: 18px;
    display: grid; place-items: center; border-radius: var(--r-full);
    background: rgba(254, 207, 79, 0.25); color: var(--gold-600);
}

/* post navigation */
.sab-postnav {
    display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line);
}
.sab-postnav a {
    display: block; padding: 16px; border: 1px solid var(--line);
    border-radius: var(--r); color: var(--ink);
}
.sab-postnav a:hover { border-color: var(--brand-500); background: var(--brand-50); }
.sab-postnav small { display: block; color: var(--muted); font-size: 12px; }

/* -------------------------------------------------------------- footer --- */

.sab-footer { margin-top: 0; background: var(--brand-900); color: rgba(255, 255, 255, 0.75); }
.sab-footer a { color: inherit; }
.sab-footer a:hover { color: var(--gold-300); }
.sab-footer h2 { color: #fff; font-size: 1.05rem; margin-bottom: 18px; }
.sab-footer__grid {
    display: grid; gap: 40px; padding-block: 64px;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}
.sab-footer ul { list-style: none; margin: 0; padding: 0; }
.sab-footer li { margin-bottom: 10px; font-size: 14px; }
.sab-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-block: 20px; font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
}
.sab-footer__skyline {
    height: 90px; opacity: 0.1;
    -webkit-mask-position: bottom center; mask-position: bottom center;
}

/* ------------------------------------------------------------- widgets --- */

.sab-widget { margin-bottom: 32px; }
.sab-widget__title { font-size: 1.05rem; margin-bottom: 14px; }
.sab-widget ul { list-style: none; margin: 0; padding: 0; }
.sab-widget li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }

/* --------------------------------------------------------- whatsapp ------ */

.sab-whatsapp {
    position: fixed; inset-block-end: 24px; inset-inline-start: 24px; z-index: 60;
}
.sab-whatsapp__btn {
    width: 56px; height: 56px; border: 0; cursor: pointer;
    border-radius: var(--r-full); background: #25d366; color: #fff;
    display: grid; place-items: center;
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.45);
    transition: transform 0.25s var(--ease);
}
.sab-whatsapp__btn:hover { transform: scale(1.06); }
.sab-whatsapp__panel {
    width: min(280px, calc(100vw - 40px)); margin-bottom: 12px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-md); overflow: hidden;
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.35);
}
.sab-whatsapp__panel[hidden] { display: none; }

/* ---- contact card ---------------------------------------------------
   Laid out like a messaging profile: cover strip, round photo breaking
   over its lower edge, name, number, then a row of actions. */

.sab-wacard__cover {
    height: 96px;
    background: var(--brand-800);
    overflow: hidden;
}
.sab-wacard__cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

.sab-wacard__avatar {
    width: 78px; height: 78px;
    margin: -39px auto 0;
    position: relative;
    border-radius: var(--r-full);
    overflow: hidden;
    background: #fbfaf5;
    border: 3px solid var(--surface);
    box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.45);
}
.sab-wacard__avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

.sab-wacard__id { text-align: center; padding: 12px 16px 4px; }
.sab-wacard__name {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.05rem; font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
}
.sab-wacard__number {
    margin: 4px 0 0;
    font-family: var(--font-utility);
    font-size: 13px;
    color: var(--muted);
}

.sab-wacard__actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 14px 14px 4px;
}
.sab-wacard__actions a {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 10px 4px;
    border-radius: var(--r);
    font-family: var(--font-utility); font-size: 12px; font-weight: 500;
    color: var(--ink-soft);
    transition: background 0.2s var(--ease);
}
.sab-wacard__actions a:hover { background: var(--brand-50); color: var(--brand-600); }

.sab-wacard__icon {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: var(--r-full);
    background: var(--surface-alt);
    color: var(--brand-600);
}
.sab-wacard__actions a:first-child .sab-wacard__icon {
    background: #25d366; color: #fff;
}

.sab-wacard__note {
    margin: 0;
    padding: 6px 16px 16px;
    text-align: center;
    font-size: 11px;
    color: var(--muted);
}

/* -------------------------------------------------------- pagination ----- */

.sab-pagination { margin-top: 48px; display: flex; justify-content: center; }
.sab-pagination .page-numbers {
    display: inline-block; padding: 8px 14px; margin: 0 3px;
    border: 1px solid var(--line); border-radius: var(--r);
    color: var(--ink-soft); font-family: var(--font-utility); font-size: 14px;
}
.sab-pagination .page-numbers.current,
.sab-pagination .page-numbers:hover { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

/* ------------------------------------------------------------- forms ----- */

input[type='text'], input[type='email'], input[type='search'],
input[type='password'], input[type='url'], textarea {
    width: 100%; padding: 12px 16px;
    background: var(--surface-alt);
    border: 1px solid var(--line); border-radius: var(--r);
    font-family: inherit; font-size: 14px; color: var(--ink);
}
input:focus, textarea:focus { outline: none; border-color: var(--brand-600); }
label { font-family: var(--font-utility); font-size: 14px; font-weight: 500; }

/* ---------------------------------------------------------- responsive --- */

@media (max-width: 1024px) {
    :root { --section: 72px; }
    .sab-menu-toggle { display: inline-flex; }
    .sab-nav {
        position: absolute; inset-inline: 0; inset-block-start: 100%;
        background: var(--paper); border-bottom: 1px solid var(--line);
        max-height: 0; overflow: hidden; transition: max-height 0.3s var(--ease);
    }
    .sab-nav.is-open { max-height: 80vh; overflow-y: auto; }
    .sab-nav ul { flex-direction: column; align-items: stretch; padding: 8px 24px; }
    .sab-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
    /* In the drawer the panels stack instead of floating, but they still
       stay collapsed until their section is clicked. */
    .sab-nav ul ul,
    .sab-nav ul ul ul {
        position: static; opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border: 0; padding-inline-start: 16px;
        inset-inline-end: auto; margin-inline-end: 0;
        max-height: none; overflow: visible;
        display: none;
    }
    .sab-nav li.is-open > ul { display: block; }
    /* the side-chevron reads wrong once the panels are stacked */
    .sab-nav ul ul > li.menu-item-has-children > a::after { transform: rotate(-45deg); }
    .sab-topbar { display: none; }
    .sab-hero { padding-block: 72px; }
    .sab-hero__lantern { display: none; }
}

/* tablets in portrait */
@media (max-width: 900px) {
    :root { --section: 64px; }
    .sab-banner { padding-block: 56px; }
    .sab-wacard__cover { height: 84px; }
}

@media (max-width: 640px) {
    :root { --gutter: 16px; --section: 56px; }
    .sab-footer__grid { padding-block: 44px; gap: 28px; }
    .sab-hero { padding-block: 56px; }
    .sab-hero__actions .sab-btn { flex: 1 1 auto; justify-content: center; }
    .sab-card__body { padding: 20px; }
    .sab-level--photo .sab-level__title,
    .sab-level--photo .sab-level__sub,
    .sab-level--photo .sab-level__desc,
    .sab-level--photo .sab-badge { margin-inline: 20px; }
    .sab-postnav a { text-align: start !important; }
}

/* small phones — iPhone SE and similar 320–400px screens */
@media (max-width: 420px) {
    :root { --gutter: 14px; --section: 44px; }
    body { font-size: 15px; }
    h3 { font-size: 1.1rem; }
    .sab-brand__mark,
    .custom-logo { width: 44px; height: 44px; }
    .sab-brand__name { font-size: 1rem; }
    .sab-brand__tag { font-size: 11px; }
    .sab-btn { padding: 11px 18px; }
    .sab-header__cta { display: none; }   /* the floating button covers this */
    .sab-entry__content { font-size: 1rem; line-height: 1.95; }
    .sab-wacard__actions { gap: 2px; padding-inline: 8px; }
    .sab-wacard__actions a { font-size: 11px; }
    .sab-rule { width: min(220px, 100%); }
}

/* ---- device ergonomics --------------------------------------------- */

/* Fixed UI clears the home indicator / notch on modern iPhones. */
.sab-whatsapp {
    inset-block-end: calc(24px + env(safe-area-inset-bottom, 0px));
    inset-inline-start: calc(24px + env(safe-area-inset-left, 0px));
}

/* Touch devices get larger hit areas and drop hover-only affordances. */
@media (pointer: coarse) {
    .sab-nav a { padding-block: 16px; }
    .sab-wacard__actions a { padding-block: 14px; }
    .sab-btn { min-height: 44px; }
    .sab-menu-toggle { width: 46px; height: 46px; }
    .sab-card:hover,
    .sab-level:hover { transform: none; box-shadow: none; }
    .sab-level--photo:hover .sab-level__media img { transform: none; }
}

/* Imported post content can contain wide tables or embeds; let those
   scroll inside their own box instead of stretching the page. */
.sab-entry__content table,
.sab-entry__content pre {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.sab-entry__content img,
.sab-entry__content iframe,
.sab-entry__content video {
    max-width: 100%;
    height: auto;
}
.sab-entry__content iframe { aspect-ratio: 16 / 9; width: 100%; }

/* Landscape phones are short — reclaim vertical space. */
@media (max-height: 480px) and (orientation: landscape) {
    :root { --section: 40px; }
    .sab-hero { padding-block: 40px; }
    .sab-nav.is-open { max-height: 70vh; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* reveal-on-scroll, safe without JS */
@media (prefers-reduced-motion: no-preference) {
    .sab-reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
    .sab-reveal.is-visible { opacity: 1; transform: none; }
}

/* ---- password gate ------------------------------------------------- */

.sab-passform {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

.sab-passform input[type="password"] {
  flex: 0 1 260px;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--border-soft, rgba(0, 0, 0, .14));
  border-radius: 12px;
  background: var(--surface, #fff);
  color: inherit;
  font: inherit;
  text-align: center;
}

.sab-passform input[type="password"]:focus {
  outline: none;
  border-color: var(--gold-400, #c9a227);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .18);
}
