/* ==========================================================================
   «مسیر طلایی موفقیت» theme
   Loaded after Themes/Default/css/theme.css: the inner pages (about, news, portal, pre-register,
   ...) come from the Default theme, so this file recolors the Default tokens with the Masir app
   palette (cream, navy, gold and teal, from the school's logo) and styles the Masir layout and
   home page. Every block is a soft "clay" panel: an outer shadow in its own hue, a dark inner
   shadow at the bottom and a light one at the top - the same look as the Masir app.
   ========================================================================== */

:root {
    /* Masir palette (same values as the app's KitColors.LightClay) */
    --ms-bg: #fff7e8;
    --ms-panel: #fffcf5;
    --ms-well: #fbefd6;
    --ms-line: #f1e2c4;
    --ms-text: #1c2340;
    --ms-muted: #59607a;
    --ms-heading: #12245e;
    --ms-gold: #f39019;
    --ms-gold-hover: #e07f0a;
    --ms-on-gold: #14204f;
    --ms-teal: #138c8c;
    --ms-on-teal: #ffffff;
    --ms-navy: #1e2f70;
    --ms-navy-deep: #14204f;
    --ms-on-navy: #ffffff;
    --ms-notice: #dcf3f1;
    --ms-notice-ink: #0b4f4c;
    --ms-mark: #ffd9a6;
    --ms-shadow: rgba(184, 106, 12, 0.18);
    --ms-inner-dark: rgba(184, 106, 12, 0.09);
    --ms-inner-light: rgba(255, 255, 255, 0.95);
    --ms-glow-1: rgba(255, 201, 138, 0.55);
    --ms-glow-2: rgba(158, 223, 216, 0.45);

    --ms-t0-bg: #d7f2ec; --ms-t0-ink: #0b6b55;
    --ms-t1-bg: #ffe7c7; --ms-t1-ink: #8a4a00;
    --ms-t2-bg: #e3e8fa; --ms-t2-ink: #1e2f70;
    --ms-t3-bg: #fff0c4; --ms-t3-ink: #7a5a00;
    --ms-t4-bg: #ffe0de; --ms-t4-ink: #a12a3a;
    --ms-t5-bg: #d9f1f1; --ms-t5-ink: #0e6a6a;

    --ms-radius: 22px;
    --ms-radius-sm: 14px;
    --ms-radius-lg: 28px;

    /* Default theme tokens, recolored for the inner pages */
    --theme-primary: #1e2f70;
    --theme-primary-hover: #14204f;
    --theme-primary-light: #e3e8fa;
    --theme-primary-glow: rgba(30, 47, 112, 0.22);
    --theme-secondary: #138c8c;
    --theme-secondary-hover: #0e6a6a;
    --theme-secondary-light: #dcf3f1;
    --theme-accent: #f39019;
    --theme-accent-hover: #e07f0a;
    --theme-accent-light: #ffe7c7;
    --theme-success: #1e7f57;
    --theme-success-light: #d7f2ec;
    --theme-danger: #c8323f;
    --theme-info: #138c8c;
    --theme-bg: #fff7e8;
    --theme-surface: #fffcf5;
    --theme-surface-subtle: #fbefd6;
    --theme-surface-elevated: #fffcf5;
    --theme-card-bg: #fffcf5;
    --theme-card-border: #f1e2c4;
    --theme-text: #1c2340;
    --theme-text-heading: #12245e;
    --theme-text-secondary: #3a4262;
    --theme-text-muted: #59607a;
    --theme-border: #f1e2c4;
    --theme-border-subtle: #fbefd6;
    --theme-input-bg: #ffffff;
    --theme-input-border: #e8d6b2;
    --theme-input-focus-border: #f39019;
    --theme-topbar-bg: #14204f;
    --theme-topbar-text: #d6daea;
    --theme-navbar-bg: rgba(255, 252, 245, 0.96);
    --theme-navbar-border: #f1e2c4;
    --theme-footer-bg: #121c48;
    --theme-footer-text: #b9bed6;
    --theme-dropdown-bg: #fffcf5;
    --theme-dropdown-hover: #fbefd6;
    --theme-shadow-xs: 0 1px 3px rgba(184, 106, 12, 0.08);
    --theme-shadow-sm: 0 2px 8px rgba(184, 106, 12, 0.08);
    --theme-shadow-md: 0 10px 25px -5px rgba(184, 106, 12, 0.12);
    --theme-shadow-lg: 0 20px 30px -10px rgba(184, 106, 12, 0.18);
    --theme-shadow-card: 0 10px 22px rgba(184, 106, 12, 0.14);
    --theme-shadow-card-hover: 0 16px 32px rgba(184, 106, 12, 0.22);
    --theme-radius-sm: 14px;
    --theme-radius: 22px;
    --theme-radius-lg: 28px;
    --theme-on-primary: #ffffff;
    --theme-hero-bg: #1e2f70;

    /* Bootstrap (MDB) utilities: primary navy, secondary = muted text, success, teal info, danger */
    --mdb-primary: #1e2f70;
    --mdb-primary-rgb: 30, 47, 112;
    --mdb-secondary: #59607a;
    --mdb-secondary-rgb: 89, 96, 122;
    --mdb-success: #1e7f57;
    --mdb-success-rgb: 30, 127, 87;
    --mdb-info: #138c8c;
    --mdb-info-rgb: 19, 140, 140;
    --mdb-danger: #c8323f;
    --mdb-danger-rgb: 200, 50, 63;
}

/* Dark mode (same values as the app's KitColors.DarkClay) */
[data-theme="dark"] {
    --ms-bg: #0e1430;
    --ms-panel: #182150;
    --ms-well: #121a40;
    --ms-line: #26326a;
    --ms-text: #f3f1ea;
    --ms-muted: #b9bed6;
    --ms-heading: #ffc56b;
    --ms-gold: #f7a23b;
    --ms-gold-hover: #ffb45a;
    --ms-on-gold: #14204f;
    --ms-teal: #4fd1c5;
    --ms-on-teal: #062a30;
    --ms-navy: #2a3c8a;
    --ms-navy-deep: #0a0f26;
    --ms-on-navy: #ffffff;
    --ms-notice: #103531;
    --ms-notice-ink: #99f6e4;
    --ms-mark: #6b4a1a;
    --ms-shadow: rgba(0, 0, 0, 0.4);
    --ms-inner-dark: rgba(0, 0, 0, 0.25);
    --ms-inner-light: rgba(255, 255, 255, 0.08);
    --ms-glow-1: rgba(58, 44, 106, 0.6);
    --ms-glow-2: rgba(23, 63, 74, 0.55);

    --ms-t0-bg: #113a31; --ms-t0-ink: #6ee7c3;
    --ms-t1-bg: #3e2810; --ms-t1-ink: #fdba74;
    --ms-t2-bg: #1f2a5c; --ms-t2-ink: #b9c6ff;
    --ms-t3-bg: #3a3010; --ms-t3-ink: #fcd34d;
    --ms-t4-bg: #3f1a22; --ms-t4-ink: #fda4af;
    --ms-t5-bg: #113838; --ms-t5-ink: #5eead4;

    --theme-primary: #f7a23b;
    --theme-primary-hover: #ffb45a;
    --theme-primary-light: rgba(247, 162, 59, 0.16);
    --theme-primary-glow: rgba(247, 162, 59, 0.35);
    --theme-secondary: #4fd1c5;
    --theme-secondary-hover: #7ee3d9;
    --theme-secondary-light: rgba(79, 209, 197, 0.15);
    --theme-accent: #f7a23b;
    --theme-accent-hover: #ffb45a;
    --theme-accent-light: rgba(247, 162, 59, 0.15);
    --theme-success: #4ade80;
    --theme-success-light: rgba(74, 222, 128, 0.15);
    --theme-danger: #f87171;
    --theme-info: #4fd1c5;
    --theme-bg: #0e1430;
    --theme-surface: #182150;
    --theme-surface-subtle: #121a40;
    --theme-surface-elevated: #1f2a5c;
    --theme-card-bg: #182150;
    --theme-card-border: #26326a;
    --theme-text: #f3f1ea;
    --theme-text-heading: #ffc56b;
    --theme-text-secondary: #b9bed6;
    --theme-text-muted: #8c93b5;
    --theme-border: #26326a;
    --theme-border-subtle: #1f2a5c;
    --theme-input-bg: #121a40;
    --theme-input-border: #2e3b78;
    --theme-input-focus-border: #f7a23b;
    --theme-topbar-bg: #0a0f26;
    --theme-topbar-text: #b9bed6;
    --theme-navbar-bg: rgba(24, 33, 80, 0.96);
    --theme-navbar-border: #26326a;
    --theme-footer-bg: #0a0f26;
    --theme-footer-text: #8c93b5;
    --theme-dropdown-bg: #182150;
    --theme-dropdown-hover: #1f2a5c;
    --theme-shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.4);
    --theme-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
    --theme-shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.55);
    --theme-shadow-lg: 0 20px 35px -10px rgba(0, 0, 0, 0.65);
    --theme-shadow-card: 0 10px 22px rgba(0, 0, 0, 0.4);
    --theme-shadow-card-hover: 0 16px 32px rgba(0, 0, 0, 0.55);
    /* gold fills carry navy text, as in the app */
    --theme-on-primary: #14204f;
    --theme-hero-bg: #2a3c8a;

    --mdb-primary: #f7a23b;
    --mdb-primary-rgb: 247, 162, 59;
    --mdb-secondary: #b9bed6;
    --mdb-secondary-rgb: 185, 190, 214;
    --mdb-success: #4ade80;
    --mdb-success-rgb: 74, 222, 128;
    --mdb-info: #4fd1c5;
    --mdb-info-rgb: 79, 209, 197;
    --mdb-danger: #f87171;
    --mdb-danger-rgb: 248, 113, 113;
}

/* --------------------------------------------------------------------------
   Page ground
   -------------------------------------------------------------------------- */
body {
    background-color: var(--ms-bg);
    background-image:
        radial-gradient(640px 420px at 0% 0%, var(--ms-glow-1), transparent 70%),
        radial-gradient(560px 420px at 100% 40%, var(--ms-glow-2), transparent 70%);
    background-attachment: fixed;
    color: var(--ms-text);
}

.ms-container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 20px;
}

.ms-clay {
    background: var(--ms-panel);
    border-radius: var(--ms-radius);
    box-shadow: 0 10px 22px var(--ms-shadow), inset 0 -4px 8px var(--ms-inner-dark), inset 0 3px 6px var(--ms-inner-light);
}

.ms-t0 { background: var(--ms-t0-bg); color: var(--ms-t0-ink); }
.ms-t1 { background: var(--ms-t1-bg); color: var(--ms-t1-ink); }
.ms-t2 { background: var(--ms-t2-bg); color: var(--ms-t2-ink); }
.ms-t3 { background: var(--ms-t3-bg); color: var(--ms-t3-ink); }
.ms-t4 { background: var(--ms-t4-bg); color: var(--ms-t4-ink); }
.ms-t5 { background: var(--ms-t5-bg); color: var(--ms-t5-ink); }

/* Buttons */
.ms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 800;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 11px 20px;
    border-radius: var(--ms-radius-sm);
    border: 0;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.ms-btn i { font-size: 1.15em; }
.ms-btn:hover { transform: translateY(-2px); }
.ms-btn:active { transform: translateY(0) scale(0.98); }
.ms-btn:focus-visible { outline: 3px solid var(--ms-teal); outline-offset: 2px; }
.ms-btn-gold {
    background: var(--ms-gold);
    color: var(--ms-on-gold) !important;
    box-shadow: 0 8px 16px var(--ms-shadow), inset 0 -3px 6px rgba(0, 0, 0, 0.12), inset 0 2px 4px rgba(255, 255, 255, 0.35);
}
.ms-btn-gold:hover { background: var(--ms-gold-hover); }
.ms-btn-teal {
    background: var(--ms-teal);
    color: var(--ms-on-teal) !important;
    box-shadow: 0 8px 16px var(--ms-shadow), inset 0 -3px 6px rgba(0, 0, 0, 0.18), inset 0 2px 4px rgba(255, 255, 255, 0.25);
}
.ms-btn-ghost {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45);
}
.ms-btn-ghost:hover { background: rgba(255, 255, 255, 0.2); }

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
.ms-topbar {
    background: var(--ms-navy-deep);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.78rem;
}
.ms-topbar .ms-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-block: 7px;
}
.ms-topbar-info,
.ms-topbar-links {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}
.ms-topbar-info span,
.ms-topbar-info a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    white-space: nowrap;
}
.ms-topbar-info .la { color: var(--ms-gold); font-size: 1rem; }
.ms-topbar-info .ms-address { overflow: hidden; text-overflow: ellipsis; }
.ms-topbar-links a {
    color: inherit;
    white-space: nowrap;
}
.ms-topbar-links a:hover { color: #fff; }
.ms-topbar-sep { width: 1px; height: 12px; background: rgba(255, 255, 255, 0.28); }
.ms-mode-btn {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 0;
    display: inline-grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
}
.ms-mode-btn:hover { background: rgba(255, 255, 255, 0.2); }

/* --------------------------------------------------------------------------
   Header: logo on the right, menu beside it, main action on the left
   -------------------------------------------------------------------------- */
.ms-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: var(--ms-panel);
    box-shadow: 0 6px 18px var(--ms-shadow);
}
.ms-header-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-block: 12px;
}
.ms-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: none;
    text-decoration: none;
    min-width: 0;
}
.ms-brand img {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    object-fit: cover;
    background: var(--ms-well);
    box-shadow: 0 6px 14px var(--ms-shadow);
}
.ms-brand-name {
    display: block;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ms-heading);
    line-height: 1.5;
}
.ms-brand-sub {
    display: block;
    font-size: 0.74rem;
    color: var(--ms-muted);
}

.ms-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.ms-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ms-text);
    text-decoration: none;
    white-space: nowrap;
    border-radius: 12px;
}
.ms-nav-link:hover { color: var(--ms-heading); background: var(--ms-well); }
.ms-nav-link.active { color: var(--ms-heading); font-weight: 800; }
.ms-nav-link.active::after {
    content: "";
    position: absolute;
    bottom: 3px;
    right: 12px;
    left: 12px;
    height: 3px;
    border-radius: 3px;
    background: var(--ms-gold);
}
.ms-nav-link .la-angle-down { font-size: 0.75rem; opacity: 0.7; }

.ms-dd { position: relative; }
.ms-dd-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--ms-panel);
    border-radius: 18px;
    box-shadow: 0 16px 32px var(--ms-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 30;
}
.ms-dd:hover .ms-dd-menu,
.ms-dd:focus-within .ms-dd-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.ms-dd-menu a {
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 0.86rem;
    color: var(--ms-text);
    text-decoration: none;
}
.ms-dd-menu a:hover { background: var(--ms-well); color: var(--ms-heading); }

.ms-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}
.ms-burger {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: var(--ms-well);
    color: var(--ms-heading);
    font-size: 1.5rem;
    place-items: center;
    cursor: pointer;
}
.ms-drawer {
    border-top: 1px solid var(--ms-line);
    padding-block: 10px 16px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}
.ms-drawer-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ms-drawer-list a,
.ms-drawer-list span {
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--ms-text);
    text-decoration: none;
    font-weight: 600;
}
.ms-drawer-list a:hover { background: var(--ms-well); }
.ms-drawer-list .ms-sub { padding-right: 28px; font-weight: 500; font-size: 0.92rem; color: var(--ms-muted); }
.ms-drawer-list .ms-group { color: var(--ms-heading); font-weight: 800; }

/* --------------------------------------------------------------------------
   Home: latest-news strip
   -------------------------------------------------------------------------- */
.ms-ticker { padding-top: 18px; }
.ms-ticker-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 18px;
    background: var(--ms-notice);
    color: var(--ms-notice-ink);
    box-shadow: 0 6px 14px var(--ms-shadow), inset 0 -3px 6px var(--ms-inner-dark), inset 0 2px 4px var(--ms-inner-light);
}
.ms-ticker-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    padding: 5px 12px;
    border-radius: 12px;
    background: var(--ms-panel);
    font-size: 0.8rem;
    font-weight: 800;
}
.ms-ticker-box a {
    flex: 1;
    min-width: 0;
    color: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ms-ticker-box small { flex: none; opacity: 0.75; }

/* --------------------------------------------------------------------------
   Home: hero
   -------------------------------------------------------------------------- */
.ms-hero { padding-top: 22px; }
.ms-hero-box {
    position: relative;
    overflow: hidden;
    border-radius: var(--ms-radius-lg);
    background-color: var(--ms-navy);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='none' stroke='white' stroke-opacity='.08' stroke-width='1.2'%3E%3Crect x='18' y='18' width='28' height='28'/%3E%3Crect x='18' y='18' width='28' height='28' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E");
    color: var(--ms-on-navy);
    box-shadow: 0 16px 34px var(--ms-shadow), inset 0 -6px 12px rgba(0, 0, 0, 0.2), inset 0 3px 6px rgba(255, 255, 255, 0.12);
}
.ms-hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    align-items: center;
    padding: clamp(24px, 4vw, 52px) clamp(20px, 4vw, 52px) clamp(64px, 7vw, 92px);
}
.ms-hero-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
}
.ms-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffc56b;
    font-size: 0.8rem;
    font-weight: 700;
}
.ms-hero-text h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.45rem, 3.2vw, 2.25rem);
    font-weight: 800;
    line-height: 1.55;
    text-wrap: balance;
}
.ms-hero-text p {
    margin: 0;
    max-width: 52ch;
    font-size: 0.97rem;
    line-height: 2;
    color: rgba(255, 255, 255, 0.85);
}
.ms-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.ms-hero-media { position: relative; min-width: 0; }
.ms-slider {
    position: relative;
    aspect-ratio: 4 / 3;
    max-width: 100%;
    border-radius: 24px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3), inset 0 0 0 6px rgba(255, 255, 255, 0.1);
}
.ms-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    transition: opacity 0.7s ease;
}
.ms-slide.is-on { opacity: 1; }
.ms-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-slide figcaption {
    position: absolute;
    bottom: 14px;
    right: 14px;
    max-width: calc(100% - 28px);
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ms-dots {
    position: absolute;
    bottom: 22px;
    right: 0;
    left: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
}
.ms-dots button {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: width 0.25s ease, background-color 0.25s ease;
}
.ms-dots button.is-on { width: 24px; background: var(--ms-gold); }
.ms-hero-logo {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    max-width: 100%;
}
.ms-hero-logo img {
    width: min(220px, 70%);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 40px;
    background: var(--ms-panel);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3), inset 0 0 0 6px rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------------
   Home: quick links (sit over the bottom of the hero)
   -------------------------------------------------------------------------- */
.ms-quick { padding-top: 26px; }
.ms-hero + .ms-quick { padding-top: 0; margin-top: -44px; position: relative; z-index: 2; }
.ms-quick-grid {
    display: grid;
    /* one row on wide screens; the page sets --ms-quick-count to the number of links */
    grid-template-columns: repeat(var(--ms-quick-count, 6), 1fr);
    gap: 14px;
    padding-inline: clamp(0px, 2vw, 24px);
}
.ms-quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 10px 16px;
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--ms-text);
    transition: transform 0.2s ease;
}
.ms-quick-item:hover { transform: translateY(-4px); color: var(--ms-heading); }
.ms-quick-icon {
    width: 54px;
    height: 54px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    font-size: 1.7rem;
    box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.06), inset 0 2px 4px rgba(255, 255, 255, 0.5);
}

/* --------------------------------------------------------------------------
   Home: sections
   -------------------------------------------------------------------------- */
.ms-section { padding-top: 48px; }
.ms-section:last-child { padding-bottom: 48px; }
.ms-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.ms-sec-head h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--ms-heading);
}
.ms-sec-head h3::before {
    content: "";
    width: 5px;
    height: 24px;
    border-radius: 3px;
    background: var(--ms-gold);
}
.ms-more {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--ms-teal);
    text-decoration: none;
    white-space: nowrap;
}
.ms-more:hover { color: var(--ms-heading); }

.ms-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--ms-muted);
}

/* placeholder for news without a picture */
.ms-ph {
    background-color: var(--ms-well);
    background-image: linear-gradient(135deg, var(--ms-glow-1), transparent 70%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cg fill='none' stroke='%23b86a0c' stroke-opacity='.12'%3E%3Crect x='11' y='11' width='18' height='18'/%3E%3Crect x='11' y='11' width='18' height='18' transform='rotate(45 20 20)'/%3E%3C/g%3E%3C/svg%3E");
    display: grid;
    place-items: center;
    color: var(--ms-gold);
    font-size: 2rem;
}

/* News: newest on the right, most read on the left */
.ms-news-layout {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 28px;
    align-items: start;
}
.ms-news-layout > * { min-width: 0; }
.ms-news-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 16px;
    align-items: start;
}
.ms-feat { overflow: hidden; display: flex; flex-direction: column; }
.ms-feat-img { display: block; height: 220px; overflow: hidden; }
.ms-feat-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.ms-feat:hover .ms-feat-img img { transform: scale(1.04); }
.ms-feat-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.ms-feat-body a.ms-title { font-size: 1.02rem; font-weight: 800; line-height: 1.75; color: var(--ms-heading); text-decoration: none; }
.ms-feat-body a.ms-title:hover { color: var(--ms-teal); }
.ms-feat-body p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.95;
    color: var(--ms-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ms-news-list { display: flex; flex-direction: column; gap: 12px; }
.ms-news-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 18px;
    text-decoration: none;
    color: var(--ms-text);
    transition: transform 0.2s ease;
}
.ms-news-item:hover { transform: translateY(-2px); }
.ms-news-thumb {
    width: 92px;
    height: 76px;
    flex: none;
    border-radius: 13px;
    overflow: hidden;
    font-size: 1.4rem;
}
.ms-news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-news-item div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ms-news-item strong {
    font-size: 0.9rem;
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ms-top-list { padding: 6px 18px; }
.ms-top-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-block: 14px;
    border-bottom: 1px dashed var(--ms-line);
    text-decoration: none;
    color: var(--ms-text);
}
.ms-top-item:last-child { border-bottom: 0; }
.ms-top-item:hover strong { color: var(--ms-heading); }
.ms-rank {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.ms-top-item div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ms-top-item strong {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ms-pager { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 22px; }
.ms-pager a {
    min-width: 40px;
    height: 40px;
    padding-inline: 10px;
    display: inline-grid;
    place-items: center;
    border-radius: 13px;
    background: var(--ms-panel);
    color: var(--ms-text);
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 14px var(--ms-shadow);
}
.ms-pager a.is-on { background: var(--ms-gold); color: var(--ms-on-gold); }

.ms-empty {
    padding: 36px 20px;
    text-align: center;
    color: var(--ms-muted);
}
.ms-empty .la { display: block; font-size: 2.4rem; color: var(--ms-gold); margin-bottom: 8px; }

/* App */
.ms-app {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 36px;
    align-items: center;
    padding: clamp(22px, 4vw, 44px);
    background: var(--ms-notice);
    color: var(--ms-notice-ink);
}
.ms-app h3 { margin: 0 0 12px; font-size: clamp(1.25rem, 2.6vw, 1.7rem); font-weight: 800; color: var(--ms-notice-ink); line-height: 1.6; }
.ms-app p { margin: 0 0 18px; line-height: 2; max-width: 54ch; }
.ms-app-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.ms-app-tags span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 700;
}
.ms-phone {
    width: min(270px, 100%);
    margin-inline: auto;
    padding: 9px;
    border-radius: 36px;
    background: #111;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}
.ms-phone-screen {
    border-radius: 28px;
    padding: 14px 12px;
    background: var(--ms-bg);
    color: var(--ms-text);
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.72rem;
}
.ms-phone-card { padding: 12px; display: flex; align-items: center; gap: 10px; border-radius: 18px; }
.ms-phone-logo {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 13px;
    object-fit: cover;
    background: var(--ms-well);
}
.ms-phone-avatar {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 50%;
    padding: 3px;
    background: conic-gradient(var(--ms-teal), var(--ms-gold), var(--ms-teal));
}
.ms-phone-avatar span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--ms-well); }
.ms-phone-card b { display: block; font-size: 0.85rem; color: var(--ms-heading); }
.ms-phone-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ms-phone-tiles span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 9px 2px 7px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.66rem;
}
.ms-phone-tiles .la { font-size: 1.25rem; }
.ms-phone-today {
    padding: 11px 12px;
    border-radius: 16px;
    background: var(--ms-navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.ms-phone-today div {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
}
.ms-phone-today em {
    font-style: normal;
    font-weight: 800;
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--ms-gold);
    color: var(--ms-on-gold);
}

/* Teachers */
.ms-teachers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.ms-teacher {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}
.ms-teacher-mark {
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: 17px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    font-weight: 800;
}
.ms-teacher div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ms-teacher strong { font-size: 0.95rem; color: var(--ms-heading); }
.ms-teacher span { font-size: 0.8rem; color: var(--ms-muted); }

/* Gallery */
.ms-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.ms-photo {
    position: relative;
    aspect-ratio: 4 / 3;
    max-width: 100%;
    padding: 0;
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    cursor: zoom-in;
    background: var(--ms-well);
    box-shadow: 0 8px 18px var(--ms-shadow);
}
.ms-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.ms-photo:hover img { transform: scale(1.05); }
.ms-photo span {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    padding: 24px 12px 10px;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: right;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Contact */
.ms-contact {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 32px;
    padding: clamp(20px, 4vw, 40px);
}
.ms-contact h3 { margin: 0 0 10px; font-size: 1.25rem; font-weight: 800; color: var(--ms-heading); }
.ms-contact p { margin: 0 0 18px; line-height: 2; color: var(--ms-muted); }
.ms-contact-rows { display: flex; flex-direction: column; gap: 10px; }
.ms-contact-rows span { display: flex; align-items: flex-start; gap: 8px; line-height: 1.8; }
.ms-contact-rows .la { color: var(--ms-gold); font-size: 1.25rem; margin-top: 2px; }
.ms-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ms-form .ms-wide { grid-column: 1 / -1; }
.ms-form label { display: block; margin-bottom: 6px; font-size: 0.85rem; font-weight: 700; color: var(--ms-text); }
.ms-form label b { color: var(--theme-danger); }
.ms-form input,
.ms-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid transparent;
    border-radius: 14px;
    background: var(--ms-well);
    color: var(--ms-text);
    font: inherit;
    box-shadow: inset 0 2px 5px var(--ms-inner-dark);
    transition: border-color 0.2s ease;
}
.ms-form input:focus,
.ms-form textarea:focus { outline: none; border-color: var(--ms-gold); }
.ms-form-foot { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.ms-footer {
    margin-top: 56px;
    background: var(--ms-navy-deep);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.88rem;
}
.ms-footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
    gap: 32px;
    padding-block: 42px 30px;
}
.ms-footer-grid > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ms-footer h4 { margin: 0 0 4px; font-size: 1rem; font-weight: 800; color: #fff; }
.ms-footer a { color: inherit; text-decoration: none; }
.ms-footer a:hover { color: var(--ms-gold); }
.ms-footer p { margin: 0; line-height: 2; }
.ms-footer .ms-brand-name { color: #fff; }
.ms-footer .ms-brand-sub { color: rgba(255, 255, 255, 0.6); }
.ms-footer-row { display: flex; align-items: flex-start; gap: 8px; line-height: 1.8; }
.ms-footer-row .la { color: var(--ms-gold); font-size: 1.15rem; margin-top: 3px; }
.ms-socials { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-socials a {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.2rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.ms-socials a:hover { background: var(--ms-gold); color: var(--ms-on-gold); }
.ms-seals {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 26px;
}
.ms-seals img {
    width: 92px;
    height: 92px;
    object-fit: contain;
    padding: 6px;
    border-radius: 14px;
    background: #fff;
}
.ms-footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.ms-footer-bottom .ms-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-block: 16px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

/* --------------------------------------------------------------------------
   Default-theme pieces used by the inner pages, in Masir colors
   -------------------------------------------------------------------------- */
/* buttons and color utilities follow the tokens above through Default's theme.css */
.page-item.active .page-link { background-color: var(--ms-gold); border-color: var(--ms-gold); color: var(--ms-on-gold); }
.page-link { color: var(--ms-heading); }
.form-control:focus,
.form-select:focus { border-color: var(--ms-gold); box-shadow: 0 0 0 0.2rem rgba(243, 144, 25, 0.2); }

.school-hero-public,
.stats-counter-banner {
    background: var(--ms-navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='none' stroke='white' stroke-opacity='.08' stroke-width='1.2'%3E%3Crect x='18' y='18' width='28' height='28'/%3E%3Crect x='18' y='18' width='28' height='28' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E");
}
.page-hero-banner { background: var(--ms-well); }
.portal-login-box { background: var(--ms-notice); }
.btn-submit-modern {
    background: var(--ms-gold);
    color: var(--ms-on-gold) !important;
    box-shadow: 0 8px 18px var(--ms-shadow);
}
.btn-submit-modern:hover { box-shadow: 0 12px 24px var(--ms-shadow); }
.card,
.news-card,
.teacher-card,
.service-hub-card,
.facility-card,
.form-card-public {
    border-radius: var(--ms-radius) !important;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .ms-nav-link { padding-inline: 9px; font-size: 0.86rem; }
}
@media (max-width: 991.98px) {
    .ms-nav { display: none; }
    .ms-burger { display: inline-grid; }
    .ms-header-row { justify-content: space-between; }
    .ms-hero-grid { grid-template-columns: 1fr; }
    .ms-hero-media { max-width: 520px; }
    .ms-news-layout { grid-template-columns: 1fr; }
    .ms-app { grid-template-columns: 1fr; }
    .ms-contact { grid-template-columns: 1fr; }
    .ms-gallery { grid-template-columns: repeat(2, 1fr); }
    .ms-footer-grid { grid-template-columns: 1fr 1fr; }
    .ms-quick-grid { grid-template-columns: repeat(3, 1fr); padding-inline: 0; }
}
@media (max-width: 767.98px) {
    .ms-topbar-info .ms-address,
    .ms-topbar-links .ms-staff,
    .ms-topbar-links .ms-topbar-sep.ms-staff-sep { display: none; }
    .ms-hero-media,
    .ms-dots { display: none; }
    .ms-news-grid { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
    .ms-container { padding-inline: 16px; }
    .ms-header-row { gap: 10px; }
    .ms-brand { flex: 1; }
    .ms-brand > div { min-width: 0; }
    .ms-brand img { width: 44px; height: 44px; border-radius: 14px; }
    .ms-brand-sub { display: none; }
    .ms-brand-name { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    /* no room beside the logo; the same link is in the menu and the quick links */
    .ms-actions .ms-btn { display: none; }
    .ms-quick-grid { grid-template-columns: repeat(2, 1fr); padding-inline: 0; }
    .ms-ticker-box small { display: none; }
    .ms-form { grid-template-columns: 1fr; }
    .ms-footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .ms-slide,
    .ms-btn,
    .ms-quick-item,
    .ms-news-item,
    .ms-feat-img img,
    .ms-photo img { transition: none; }
}
