/* ==========================================================================
   «مسیر طلایی موفقیت» main site: the schools' portal on the main domain (Views/Home/Masir.cshtml).
   The brand's palette (cream, gold, navy, teal; the same tokens as Themes/Masir and the app's LightClay),
   every block a soft clay panel. RTL, local Vazir font, no framework.
   ========================================================================== */

@font-face {
    font-family: "Vazir";
    src: url("../fonts/vazir/Vazir-Regular.woff2") format("woff2"), url("../fonts/vazir/Vazir-Regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    /* Latin digits stay Latin (emails, addresses); Persian numbers are written in Persian digits already */
    unicode-range: U+0000-002F, U+003A-10FFFF;
}

@font-face {
    font-family: "Vazir";
    src: url("../fonts/vazir/Vazir-Medium.woff2") format("woff2"), url("../fonts/vazir/Vazir-Medium.woff") format("woff");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    /* Latin digits stay Latin (emails, addresses); Persian numbers are written in Persian digits already */
    unicode-range: U+0000-002F, U+003A-10FFFF;
}

@font-face {
    font-family: "Vazir";
    src: url("../fonts/vazir/Vazir-Bold.woff2") format("woff2"), url("../fonts/vazir/Vazir-Bold.woff") format("woff");
    font-weight: 600 700;
    font-style: normal;
    font-display: swap;
    /* Latin digits stay Latin (emails, addresses); Persian numbers are written in Persian digits already */
    unicode-range: U+0000-002F, U+003A-10FFFF;
}

@font-face {
    font-family: "Vazir";
    src: url("../fonts/vazir/Vazir-Black.woff2") format("woff2"), url("../fonts/vazir/Vazir-Black.woff") format("woff");
    font-weight: 800 900;
    font-style: normal;
    font-display: swap;
    /* Latin digits stay Latin (emails, addresses); Persian numbers are written in Persian digits already */
    unicode-range: U+0000-002F, U+003A-10FFFF;
}

:root {
    --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-gold-soft: #ffe7c7;
    --ms-teal: #138c8c;
    --ms-teal-soft: #dcf3f1;
    --ms-navy: #1e2f70;
    --ms-navy-deep: #14204f;
    --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-clay: 0 16px 34px -16px var(--ms-shadow), inset 0 -6px 14px var(--ms-inner-dark), inset 0 4px 10px var(--ms-inner-light);
    --ms-clay-hover: 0 24px 44px -18px rgba(184, 106, 12, 0.32), inset 0 -6px 14px var(--ms-inner-dark), inset 0 4px 10px var(--ms-inner-light);
    --ms-radius: 24px;
    --ms-radius-sm: 14px;
    --ms-max: 1180px;
}

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

html {
    scroll-behavior: smooth;
}

body.ms {
    margin: 0;
    font-family: "Vazir", Tahoma, sans-serif;
    color: var(--ms-text);
    background:
        radial-gradient(900px 520px at 100% -5%, rgba(255, 201, 138, 0.55), transparent 60%),
        radial-gradient(800px 520px at -10% 30%, rgba(158, 223, 216, 0.4), transparent 60%),
        var(--ms-bg);
    line-height: 1.85;
    font-size: 15.5px;
    -webkit-font-smoothing: antialiased;
}

:where(.ms) a {
    color: inherit;
    text-decoration: none;
}

:where(.ms) img {
    display: block;
    max-width: 100%;
}

:where(.ms) :is(h1, h2, h3, h4) {
    margin: 0;
    color: var(--ms-heading);
    line-height: 1.5;
}

.ms-wrap {
    width: 100%;
    max-width: var(--ms-max);
    margin: 0 auto;
    padding: 0 20px;
}

.ms-ic {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.ms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 14.5px;
    border: 0;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ms-btn:hover {
    transform: translateY(-2px);
}

.ms-btn-gold {
    background: var(--ms-gold);
    color: var(--ms-navy-deep);
    box-shadow: 0 12px 24px -12px rgba(224, 127, 10, 0.8), inset 0 -4px 8px rgba(160, 80, 0, 0.18), inset 0 3px 6px rgba(255, 255, 255, 0.45);
}

.ms-btn-gold:hover {
    background: var(--ms-gold-hover);
}

.ms-btn-navy {
    background: var(--ms-navy);
    color: #fff;
    box-shadow: 0 12px 24px -12px rgba(20, 32, 79, 0.75), inset 0 -4px 8px rgba(0, 0, 0, 0.2), inset 0 3px 6px rgba(255, 255, 255, 0.18);
}

.ms-btn-navy:hover {
    background: var(--ms-navy-deep);
}

.ms-btn-soft {
    background: var(--ms-panel);
    color: var(--ms-navy);
    box-shadow: var(--ms-clay);
}

.ms-btn-sm {
    padding: 8px 16px;
    font-size: 13.5px;
    border-radius: 13px;
}

/* ---------------------------------------------------------------- top bar and header */

.ms-header {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 12px 0;
    background: rgba(255, 247, 232, 0.86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ms-header-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 16px;
    border-radius: 22px;
    background: var(--ms-panel);
    box-shadow: var(--ms-clay);
}

.ms-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.ms-brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #fff;
    padding: 4px;
    box-shadow: 0 8px 18px -10px var(--ms-shadow), inset 0 -3px 6px var(--ms-inner-dark);
}

.ms-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ms-brand-name {
    font-weight: 900;
    font-size: 19px;
    color: var(--ms-heading);
    line-height: 1.25;
}

.ms-brand-name small {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ms-teal);
}

.ms-header-actions {
    margin-right: auto;
    display: flex;
    gap: 10px;
}

/* ---------------------------------------------------------------- schools */

.ms-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 18px;
    border-radius: 18px;
    background: var(--ms-panel);
    box-shadow: var(--ms-clay);
    flex: 0 1 380px;
}

.ms-search .ms-ic {
    color: var(--ms-gold);
    width: 22px;
    height: 22px;
}

.ms-search input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 15.5px;
    color: var(--ms-text);
    min-width: 0;
    padding: 8px 0;
}

.ms-search input::placeholder {
    color: #a39a86;
}

.ms-section {
    padding: 56px 0;
}

.ms-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.ms-section-head h1 {
    font-size: clamp(26px, 3.4vw, 38px);
    font-weight: 900;
}

.ms-section-head h1 span {
    color: var(--ms-gold);
}

.ms-section-head p {
    margin: 4px 0 0;
    color: var(--ms-muted);
}

.ms-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.ms-chip {
    border: 0;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 14px;
    background: var(--ms-panel);
    color: var(--ms-muted);
    box-shadow: var(--ms-clay);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.ms-chip:hover {
    transform: translateY(-1px);
    color: var(--ms-heading);
}

.ms-chip.on {
    background: var(--ms-navy);
    color: #fff;
    box-shadow: 0 10px 22px -12px rgba(20, 32, 79, 0.8), inset 0 -4px 8px rgba(0, 0, 0, 0.2), inset 0 3px 6px rgba(255, 255, 255, 0.15);
}

.ms-count {
    font-weight: 800;
    color: var(--ms-teal);
}

.ms-schools {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.ms-school {
    display: flex;
    flex-direction: column;
    border-radius: var(--ms-radius);
    background: var(--ms-panel);
    box-shadow: var(--ms-clay);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ms-school:hover {
    transform: translateY(-5px);
    box-shadow: var(--ms-clay-hover);
}

.ms-school[hidden] {
    display: none;
}

.ms-school-top {
    position: relative;
    height: 84px;
    background: var(--tb, #ffe7c7);
}

.ms-school-top::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120px 80px at 15% 0%, rgba(255, 255, 255, 0.65), transparent 70%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 10px, transparent 10px 22px);
}

.ms-school-logo {
    position: relative;
    z-index: 1;
    width: 78px;
    height: 78px;
    margin: -46px 20px 0 0;
    border-radius: 24px;
    background: #fff;
    padding: 6px;
    box-shadow: 0 12px 24px -12px var(--ms-shadow), inset 0 -4px 8px var(--ms-inner-dark);
    display: grid;
    place-items: center;
}

.ms-school-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 18px;
}

.ms-school-logo b {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 28px;
    font-weight: 900;
    color: var(--ti, #8a4a00);
    background: var(--tb, #ffe7c7);
}

.ms-school-body {
    padding: 14px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* long names and descriptions are cut at two lines, so the cards in a row keep one shape */
.ms-school h3 {
    font-size: 18px;
    font-weight: 900;
    line-height: 1.6;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ms-level {
    align-self: flex-start;
    font-size: 12.5px;
    font-weight: 800;
    padding: 2px 12px;
    border-radius: 999px;
    color: var(--ti, #0b6b55);
    background: var(--tb, #d7f2ec);
    margin-bottom: 10px;
}

.ms-school p {
    margin: 0;
    color: var(--ms-muted);
    font-size: 14px;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* the buttons always sit at the bottom of the card, whatever is written above them */
.ms-school-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 18px;
}

.ms-school-actions .ms-btn {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
}

.ms-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    border-radius: var(--ms-radius);
    background: var(--ms-panel);
    box-shadow: var(--ms-clay);
    color: var(--ms-muted);
}

.ms-empty b {
    display: block;
    font-size: 18px;
    color: var(--ms-heading);
    margin-bottom: 4px;
}

.ms-footer {
    margin-top: 40px;
    background: var(--ms-navy-deep);
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
}

.ms-footer-bottom {
    padding: 18px 0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
}

/* the designer's credit in the footer */
.ms-credit {
    color: #ffc98a;
    font-weight: 700;
}

.ms-credit:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------------- small screens */

@media (max-width: 1000px) {
    .ms-schools {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    body.ms {
        font-size: 15px;
    }

    .ms-wrap {
        padding: 0 16px;
    }

    .ms-brand-name {
        font-size: 16px;
    }

    .ms-section {
        padding-top: 28px;
    }

    .ms-search {
        flex-basis: 100%;
    }

    .ms-schools {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ms-btn,
    .ms-school,
    .ms-chip {
        transition: none;
    }
}
