/* ============================================================
   MAARIF CENTER FOR STRATEGIC STUDIES — Brand Layer
   Think-tank editorial components on top of the existing
   design system (style008.css + tailwind.generated.css).
   ============================================================ */

/* --- Bilingual toggling (global, not just blog) --- */
html[lang="ar"] .maarif-page .lang-en,
html[lang="ar"] .maarif-page .label-en { display: none !important; }

html[lang="en"] .maarif-page .lang-ar,
html[lang="en"] .maarif-page .label-ar { display: none !important; }

html[lang="en"] .maarif-page .lang-en { text-align: left; }
html[lang="en"] .maarif-page .lang-en ul { padding-right: 0; padding-left: 2rem; }

/* --- Brand color utilities (gold accent; navy lives in generated tailwind) --- */
.text-accent { color: var(--accent, #E99A22) !important; }
.bg-accent { background-color: var(--accent, #E99A22) !important; }
.border-accent { border-color: var(--accent, #E99A22) !important; }
.text-accent-soft { color: var(--accent-soft, #C98A16) !important; }
.bg-navy { background-color: #123B63 !important; }
.bg-navy-deep { background-color: #0B1F33 !important; }
.bg-navy-mid { background-color: #2F628F !important; }
.text-navy { color: #123B63 !important; }
.border-navy { border-color: #123B63 !important; }

/* --- Section header system --- */
.maarif-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent, #E99A22);
}
.maarif-eyebrow::before {
    content: "";
    width: 1.75rem;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
}
.maarif-eyebrow--center::after {
    content: "";
    width: 1.75rem;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
}
.maarif-section-title {
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-main, #16324F);
    letter-spacing: -0.01em;
}
.maarif-section-sub {
    color: var(--text-muted, #5b6b7a);
    font-size: 1.05rem;
    line-height: 1.9;
}

/* --- Institutional hero --- */
.maarif-hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 82% 18%, rgba(47, 98, 143, 0.55), transparent 42%),
        radial-gradient(circle at 12% 85%, rgba(233, 154, 34, 0.18), transparent 40%),
        linear-gradient(160deg, #0B1F33 0%, #123B63 55%, #1B4A78 100%);
    color: #ffffff;
    isolation: isolate;
}
.maarif-hero__grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 78%);
    mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 78%);
}
.maarif-hero__halo {
    position: absolute;
    inset: -30%;
    z-index: -1;
    background:
        conic-gradient(from 120deg at 70% 40%, rgba(233, 154, 34, 0.14), transparent 30%, rgba(47, 98, 143, 0.22) 55%, transparent 78%);
    filter: blur(40px);
    animation: maarif-halo-float 26s ease-in-out infinite alternate;
}
@keyframes maarif-halo-float {
    from { transform: translate3d(-2%, -1%, 0) rotate(0deg); }
    to   { transform: translate3d(2%, 1%, 0) rotate(4deg); }
}
.maarif-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 1.1rem;
    border: 1px solid rgba(233, 154, 34, 0.55);
    border-radius: 999px;
    background: rgba(233, 154, 34, 0.12);
    color: #F5B84A;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    backdrop-filter: blur(6px);
}
.maarif-hero__title {
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: -0.015em;
    color: #ffffff;
}
.maarif-hero__title .lang-en {
    font-family: var(--font-display, 'Fraunces', serif);
    font-weight: 600;
}
.maarif-hero__lead {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.15rem;
    line-height: 2;
    max-width: 44rem;
}
.maarif-hero__mark {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    opacity: 0.85;
    display: none;
}
@media (min-width: 1024px) {
    .maarif-hero__mark { display: block; }
}

/* --- Buttons --- */
.btn-maarif {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.95rem 2.1rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.btn-maarif:hover { transform: translateY(-2px); }
.btn-maarif:focus-visible { outline: 3px solid rgba(233, 154, 34, 0.5); outline-offset: 3px; }
.btn-maarif--gold { background: var(--accent, #E99A22); color: #0B1F33; }
.btn-maarif--gold:hover { box-shadow: 0 14px 30px rgba(233, 154, 34, 0.35); }
.btn-maarif--navy { background: #123B63; color: #ffffff; }
.btn-maarif--navy:hover { box-shadow: 0 14px 30px rgba(18, 59, 99, 0.35); }
.btn-maarif--ghost { border-color: rgba(255, 255, 255, 0.4); color: #ffffff; background: rgba(255, 255, 255, 0.06); }
.btn-maarif--ghost:hover { border-color: #E99A22; color: #F5B84A; background: rgba(233, 154, 34, 0.12); }
.btn-maarif--outline { border-color: #123B63; color: #123B63; background: transparent; }
.btn-maarif--outline:hover { background: #123B63; color: #ffffff; }

/* --- Abstract editorial cover (no-photo card visuals) --- */
.maarif-cover {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
    background:
        radial-gradient(circle at 78% 22%, rgba(233, 154, 34, 0.55), transparent 38%),
        linear-gradient(150deg, #0B1F33 0%, #123B63 52%, #2F628F 100%);
}
.maarif-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: 0.5;
}
.maarif-cover__icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(233, 154, 34, 0.55);
    color: #F5B84A;
    font-size: 1.6rem;
    backdrop-filter: blur(4px);
}
.maarif-cover__icon--sm { width: 3.5rem; height: 3.5rem; font-size: 1.15rem; border-radius: 0.9rem; flex-shrink: 0; }
.maarif-cover__rule {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, #E99A22 0%, rgba(233, 154, 34, 0.2) 100%);
    z-index: 1;
}
.maarif-cover__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.maarif-cover--light {
    background:
        radial-gradient(circle at 78% 22%, rgba(233, 154, 34, 0.4), transparent 40%),
        linear-gradient(150deg, #F1F5F9 0%, #E2EAF3 100%);
}
.maarif-cover--light::before {
    background-image:
        linear-gradient(rgba(18, 59, 99, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(18, 59, 99, 0.06) 1px, transparent 1px);
}
.maarif-cover--light .maarif-cover__icon { color: #123B63; border-color: rgba(18, 59, 99, 0.3); background: rgba(255, 255, 255, 0.7); }

/* --- Cards --- */
.maarif-card {
    background: var(--surface-strong, rgba(255, 255, 255, 0.94));
    border: 1px solid rgba(18, 59, 99, 0.08);
    border-radius: 1.25rem;
    overflow: hidden;
    transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s ease, border-color 0.4s ease;
}
.maarif-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
    border-color: rgba(18, 59, 99, 0.2);
}
.maarif-card__body { padding: 1.5rem; }

/* --- Numbered goal badge --- */
.maarif-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    background: rgba(233, 154, 34, 0.14);
    border: 1px solid rgba(233, 154, 34, 0.4);
    color: #B47B0F;
    font-weight: 800;
    font-size: 1.05rem;
    flex-shrink: 0;
}

/* --- Category tag --- */
.maarif-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.85rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: rgba(18, 59, 99, 0.08);
    color: #123B63;
    border: 1px solid rgba(18, 59, 99, 0.14);
}
.maarif-tag--gold { background: rgba(233, 154, 34, 0.12); color: #B47B0F; border-color: rgba(233, 154, 34, 0.35); }
.maarif-tag--soft { background: rgba(47, 98, 143, 0.12); color: #2F628F; border-color: rgba(47, 98, 143, 0.25); }
.maarif-tag--onhero { background: rgba(255, 255, 255, 0.1); color: #F5B84A; border-color: rgba(233, 154, 34, 0.5); }

/* --- Research / article / project card title links --- */
.maarif-link {
    font-weight: 700;
    color: #123B63;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: color 0.25s ease, gap 0.25s ease;
}
.maarif-link:hover { color: #E99A22; gap: 0.7rem; }

/* --- Status pill (projects) --- */
.maarif-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.8rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}
.maarif-status--active { background: rgba(233, 154, 34, 0.14); color: #B47B0F; border: 1px solid rgba(233, 154, 34, 0.4); }
.maarif-status--done { background: rgba(47, 98, 143, 0.12); color: #2F628F; border: 1px solid rgba(47, 98, 143, 0.3); }

/* --- Filter chips (research) --- */
.maarif-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.maarif-filter {
    appearance: none;
    padding: 0.55rem 1.25rem;
    border-radius: 999px;
    border: 1px solid rgba(18, 59, 99, 0.16);
    background: var(--surface-strong, rgba(255, 255, 255, 0.94));
    color: #16324F;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.maarif-filter:hover { border-color: #123B63; }
.maarif-filter.is-active { background: #123B63; color: #ffffff; border-color: #123B63; }

/* --- Breadcrumbs --- */
.maarif-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted, #5b6b7a);
}
.maarif-breadcrumb a { color: #123B63; text-decoration: none; font-weight: 600; }
.maarif-breadcrumb a:hover { color: #E99A22; }
.maarif-breadcrumb .sep { opacity: 0.45; }

/* --- Pagination --- */
.maarif-pagination { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.maarif-pagination a,
.maarif-pagination span {
    min-width: 2.6rem;
    height: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(18, 59, 99, 0.16);
    background: var(--surface-strong, #fff);
    color: #16324F;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.maarif-pagination a:hover { border-color: #123B63; }
.maarif-pagination .is-active { background: #123B63; color: #fff; border-color: #123B63; }

/* --- Inner page hero --- */
.maarif-page-hero {
    position: relative;
    padding: clamp(7rem, 12vh, 9rem) 0 clamp(3rem, 6vh, 4.5rem);
    background:
        radial-gradient(circle at 80% 20%, rgba(47, 98, 143, 0.5), transparent 45%),
        linear-gradient(155deg, #0B1F33 0%, #123B63 58%, #1B4A78 100%);
    color: #ffffff;
    overflow: hidden;
}
.maarif-page-hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 52px 52px;
    opacity: 0.5;
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 90%);
    mask-image: linear-gradient(180deg, #000, transparent 90%);
}

/* --- CTA band --- */
.maarif-cta-band {
    position: relative;
    overflow: hidden;
    border-radius: 2rem;
    padding: clamp(3rem, 7vw, 5rem);
    background:
        radial-gradient(circle at 85% 20%, rgba(233, 154, 34, 0.32), transparent 40%),
        linear-gradient(150deg, #0B1F33 0%, #123B63 60%, #2F628F 100%);
    color: #ffffff;
    text-align: center;
}
.maarif-cta-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    opacity: 0.5;
}
.maarif-cta-band--tight { border-radius: 1.5rem; padding: 2rem; }

/* --- Partner tile --- */
.maarif-partner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    min-height: 11rem;
    padding: 1.6rem;
    border-radius: 1.25rem;
    border: 1px dashed rgba(18, 59, 99, 0.18);
    background: var(--surface-strong, rgba(255,255,255,0.94));
    text-align: center;
    transition: border-color 0.3s ease, transform 0.3s var(--ease-out-expo), box-shadow 0.3s ease;
}
.maarif-partner:hover { border-color: #E99A22; transform: translateY(-3px); box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08); }
.maarif-partner__name { font-weight: 700; color: #16324F; font-size: 0.98rem; }
.maarif-partner__meta { font-size: 0.78rem; color: var(--text-muted, #5b6b7a); }
.maarif-partner__logo {
    width: 4.5rem;
    height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(18, 59, 99, 0.06);
    color: #123B63;
    font-size: 1.5rem;
}

/* --- Team card --- */
.maarif-team {
    text-align: center;
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    background: var(--surface-strong, #fff);
    border: 1px solid rgba(18, 59, 99, 0.08);
    transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s ease;
}
.maarif-team:hover { transform: translateY(-4px); box-shadow: 0 22px 44px rgba(15, 23, 42, 0.1); }
.maarif-team__avatar {
    width: 5.5rem;
    height: 5.5rem;
    margin: 0 auto 1.1rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(150deg, #123B63, #2F628F);
    color: #F5B84A;
    font-size: 1.5rem;
}
.maarif-team__role { font-size: 0.8rem; font-weight: 600; color: var(--accent-soft, #B47B0F); letter-spacing: 0.04em; }

/* --- News list item --- */
.maarif-news {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
    padding: 1.4rem 0;
    border-bottom: 1px solid rgba(18, 59, 99, 0.08);
    text-decoration: none;
}
.maarif-news:last-child { border-bottom: 0; }
.maarif-news__date {
    flex-shrink: 0;
    min-width: 4.4rem;
    text-align: center;
    padding: 0.6rem 0.4rem;
    border-radius: 0.9rem;
    background: rgba(18, 59, 99, 0.07);
    border: 1px solid rgba(18, 59, 99, 0.12);
}
.maarif-news__date b { display: block; font-size: 1.35rem; color: #123B63; line-height: 1.1; }
.maarif-news__date span { font-size: 0.72rem; color: var(--text-muted); }

/* --- Event card date block --- */
.maarif-event-date {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 4.6rem;
    border-radius: 1rem;
    background: #123B63;
    color: #fff;
    padding: 0.55rem 0.2rem;
}
.maarif-event-date b { font-size: 1.5rem; line-height: 1; color: #F5B84A; }
.maarif-event-date span { font-size: 0.7rem; opacity: 0.85; }

/* --- Share row --- */
.maarif-share { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.maarif-share a {
    width: 2.6rem; height: 2.6rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(18, 59, 99, 0.16);
    color: #123B63;
    background: var(--surface-strong, #fff);
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.maarif-share a:hover { background: #123B63; color: #fff; border-color: #123B63; transform: translateY(-2px); }

/* --- Prose (article / publication body) --- */
.maarif-prose { color: var(--text-main, #16324F); line-height: 2; font-size: 1.06rem; }
.maarif-prose h2, .maarif-prose h3 { font-weight: 800; color: #123B63; margin: 2rem 0 0.9rem; line-height: 1.4; }
.maarif-prose h2 { font-size: 1.6rem; }
.maarif-prose h3 { font-size: 1.3rem; }
.maarif-prose p { margin-bottom: 1.2rem; }
.maarif-prose ul, .maarif-prose ol { margin: 0 0 1.4rem; padding-inline-start: 1.4rem; }
.maarif-prose li { margin-bottom: 0.45rem; }
.maarif-prose blockquote {
    border-inline-start: 4px solid #E99A22;
    padding: 0.9rem 1.4rem;
    margin: 1.6rem 0;
    background: rgba(233, 154, 34, 0.07);
    border-radius: 0.5rem;
    font-weight: 600;
    color: #16324F;
}
.maarif-prose a { color: #2F628F; font-weight: 600; }

/* --- Stats band --- */
.maarif-stat { text-align: center; padding: 1rem; }
.maarif-stat__value { font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 800; color: #123B63; line-height: 1.1; }
.maarif-stat__label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-top: 0.4rem; }

/* --- Forms --- */
.maarif-field { width: 100%; }
.maarif-field label { display: block; font-size: 0.85rem; font-weight: 700; color: #16324F; margin-bottom: 0.4rem; }
.maarif-field input,
.maarif-field select,
.maarif-field textarea {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(18, 59, 99, 0.16);
    background: var(--surface-strong, #fff);
    color: #16324F;
    font-family: inherit;
    font-size: 0.98rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.maarif-field input:focus,
.maarif-field select:focus,
.maarif-field textarea:focus {
    outline: none;
    border-color: #123B63;
    box-shadow: 0 0 0 4px rgba(18, 59, 99, 0.1);
}

/* --- Small utility helpers --- */
.divider-navy { height: 1px; background: linear-gradient(90deg, transparent, rgba(18, 59, 99, 0.25), transparent); }
.text-balance { text-wrap: balance; }

/* --- Institutional footer --- */
.maarif-footer {
    position: relative;
    z-index: 20;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-top-left-radius: 3rem;
    border-top-right-radius: 3rem;
    background:
        radial-gradient(circle at 85% 15%, rgba(47, 98, 143, 0.4), transparent 45%),
        linear-gradient(150deg, #0B1F33 0%, #123B63 100%);
    color: #ffffff;
}
.maarif-footer a { text-decoration: none; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .maarif-hero__halo { animation: none; }
    .maarif-card, .maarif-team, .maarif-partner { transition: none; }
    .maarif-card:hover, .maarif-team:hover, .maarif-partner:hover { transform: none; }
}

/* --- Nav tightening between tablet and wide desktop --- */
@media (min-width: 768px) and (max-width: 1279px) {
    header#navbar .pill,
    header#navbar .pill-list > li > a:not(.pill) { min-width: 0; padding: 0 0.8rem; font-size: 0.72rem; }
    header#navbar .pill-cta { display: none !important; }
    header#navbar .pill-nav-items { max-width: 70vw; }
    header#navbar .pill-list { gap: 1px; }
}