/* ==========================================================================
   SHOHRAH — Free tools pages

   Shared chrome for the two "أدوات مجانية" pages:
     • /calendar.html     — Saudi e-commerce season calendar
     • /spend-leaks.html  — ad-spend leak diagnostic

   Loaded only by those pages. Everything is scoped under `.tl-page` and
   reuses the global palette — no colour is redefined here, so
   `shohrah-theme.css` stays the single source of truth for the brand.
   ========================================================================== */

.tl-page {
    --tl-ink: var(--black--color);
    --tl-accent: var(--accent--color);
    --tl-accent-strong: var(--accent--strong);
    --tl-muted: var(--text--color);
    --tl-line: var(--border--color);
    --tl-bg: var(--bg--color);
    --tl-radius: 14px;
}

/* ==========================================================================
   1. SHARED PRIMITIVES
   ========================================================================== */

/* Small eyebrow above a section heading — mirrors `.heading-title-con span`
   but works left-aligned inside a normal text column. */
.tl-eyebrow {
    display: inline-block;
    font-family: 'Thmanyah Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--tl-accent-strong);
    background: var(--accent--family--color);
    border-radius: 999px;
    padding: 6px 16px;
    margin-bottom: 18px;
}

.tl-page h2 {
    font-family: 'Thmanyah Serif Display', serif;
    font-weight: 900;
    color: var(--tl-ink);
    font-size: clamp(26px, 3.4vw, 42px);
    line-height: 1.25;
    margin: 0 0 20px;
}

.tl-page h3 {
    font-family: 'Thmanyah Serif Display', serif;
    font-weight: 700;
    color: var(--tl-ink);
    font-size: clamp(20px, 2.2vw, 27px);
    line-height: 1.35;
    margin: 0 0 14px;
}

.tl-lede {
    font-size: clamp(16px, 1.5vw, 19px);
    line-height: 1.95;
    color: var(--tl-muted);
    margin-bottom: 18px;
}

.tl-lede:last-child {
    margin-bottom: 0;
}

.tl-prose {
    max-width: 820px;
}

/* Soft note block — the Hijri-dates caveat, the "why we don't ask" aside. */
.tl-note {
    border: 1px solid var(--tl-line);
    border-inline-start: 3px solid var(--tl-accent);
    background: #fff;
    border-radius: var(--tl-radius);
    padding: 22px 26px;
    margin-top: 28px;
}

.tl-note h3 {
    font-size: 19px;
    margin-bottom: 10px;
}

.tl-note p {
    font-size: 15.5px;
    line-height: 1.9;
    color: var(--tl-muted);
    margin: 0;
}

/* Channel / platform chips */
.tl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tl-chips li {
    font-size: 13px;
    font-weight: 600;
    color: var(--tl-ink);
    background: var(--tl-bg);
    border: 1px solid var(--tl-line);
    border-radius: 999px;
    padding: 6px 14px;
}

/* Intensity badge — three levels, warm-scaled so "قصوى" reads loudest. */
.tl-badge {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 999px;
    padding: 5px 13px;
    white-space: nowrap;
}

.tl-badge--mid {
    color: var(--tl-ink);
    background: #e7eff1;
}

.tl-badge--high {
    color: #8a3b06;
    background: #fde3cf;
}

.tl-badge--max {
    color: #fff;
    background: var(--tl-accent-strong);
}

/* Hijri "approximate date" marker */
.tl-approx {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--tl-muted);
    border: 1px dashed var(--tl-line);
    border-radius: 999px;
    padding: 5px 12px;
    white-space: nowrap;
}

/* ==========================================================================
   2. CALENDAR — OVERVIEW TABLE
   ========================================================================== */

.tl-table-wrap {
    border: 1px solid var(--tl-line);
    border-radius: var(--tl-radius);
    background: #fff;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tl-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    margin: 0;
}

.tl-table th,
.tl-table td {
    text-align: right;
    padding: 16px 20px;
    vertical-align: middle;
    border-bottom: 1px solid var(--tl-line);
}

.tl-table thead th {
    font-family: 'Thmanyah Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .03em;
    color: #fff;
    background: var(--tl-ink);
    border-bottom: 0;
    white-space: nowrap;
}

.tl-table tbody tr:last-child th,
.tl-table tbody tr:last-child td {
    border-bottom: 0;
}

.tl-table tbody tr:hover {
    background: var(--tl-bg);
}

.tl-table th[scope="row"] {
    font-weight: 700;
}

.tl-table th[scope="row"] a {
    color: var(--tl-ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color .2s, border-color .2s;
}

.tl-table th[scope="row"] a:hover,
.tl-table th[scope="row"] a:focus-visible {
    color: var(--tl-accent-strong);
    border-bottom-color: currentColor;
}

.tl-table td {
    font-size: 15px;
    color: var(--tl-muted);
}

/* "1 نوفمبر" + "قبل 26 يومًا" stacked in one cell */
.tl-start strong {
    display: block;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--tl-ink);
}

.tl-start span {
    display: block;
    font-size: 12.5px;
    color: var(--tl-accent-strong);
    margin-top: 2px;
}

.tl-scroll-hint {
    display: none;
    font-size: 13px;
    color: var(--tl-muted);
    margin-top: 10px;
}

/* ==========================================================================
   3. CALENDAR — SEASON CARDS
   ========================================================================== */

.tl-seasons {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: tl-season;
}

.tl-season {
    counter-increment: tl-season;
    position: relative;
    background: #fff;
    border: 1px solid var(--tl-line);
    border-radius: var(--tl-radius);
    padding: 30px clamp(22px, 3vw, 38px);
    margin-bottom: 20px;
    /* Anchored from the overview table — keep the sticky header clear. */
    scroll-margin-top: 100px;
}

.tl-season:last-child {
    margin-bottom: 0;
}

.tl-season::before {
    content: counter(tl-season, decimal-leading-zero);
    position: absolute;
    top: 26px;
    inset-inline-end: clamp(22px, 3vw, 38px);
    font-family: 'Thmanyah Serif Display', serif;
    font-weight: 900;
    font-size: 40px;
    line-height: 1;
    color: var(--tl-line);
}

.tl-season-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    /* Leave room for the big counter in the corner. */
    padding-inline-end: 56px;
}

.tl-season-date {
    font-size: 14px;
    font-weight: 700;
    color: var(--tl-ink);
}

.tl-season h3 {
    margin-bottom: 12px;
}

/* "كن مشتغلًا بحلول 1 نوفمبر — قبل الموسم بـ26 يومًا" */
.tl-golive {
    font-size: 16px;
    line-height: 1.7;
    color: var(--tl-ink);
    background: var(--tl-bg);
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 16px;
}

.tl-golive strong {
    color: var(--tl-accent-strong);
    font-weight: 800;
}

.tl-season p {
    font-size: 15.5px;
    line-height: 1.95;
    color: var(--tl-muted);
    margin-bottom: 14px;
}

.tl-mistake {
    border-inline-start: 3px solid var(--tl-accent);
    padding-inline-start: 16px;
}

.tl-mistake strong {
    color: var(--tl-ink);
    font-weight: 800;
}

.tl-season .tl-chips {
    margin-top: 18px;
}

/* ==========================================================================
   4. SPEND-LEAKS — BUDGET SLIDER
   ========================================================================== */

.tl-budget {
    background: #fff;
    border: 1px solid var(--tl-line);
    border-radius: var(--tl-radius);
    padding: 28px clamp(22px, 3vw, 36px);
    margin-bottom: 32px;
}

.tl-budget label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--tl-ink);
    margin-bottom: 6px;
}

.tl-budget-value {
    font-family: 'Thmanyah Serif Display', serif;
    font-weight: 900;
    font-size: clamp(28px, 3.4vw, 40px);
    line-height: 1.2;
    color: var(--tl-ink);
    margin-bottom: 14px;
}

.tl-budget-value span {
    font-family: 'Thmanyah Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--tl-muted);
}

.tl-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: var(--tl-line);
    outline: none;
    margin: 0 0 8px;
}

.tl-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--tl-accent);
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(21, 77, 90, .28);
    cursor: pointer;
}

.tl-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--tl-accent);
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(21, 77, 90, .28);
    cursor: pointer;
}

.tl-range:focus-visible {
    box-shadow: 0 0 0 3px rgba(243, 114, 49, .35);
}

.tl-range-scale {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--tl-muted);
    direction: ltr;
}

.tl-budget-hint {
    font-size: 14px;
    line-height: 1.85;
    color: var(--tl-muted);
    margin: 14px 0 0;
}

/* ==========================================================================
   5. SPEND-LEAKS — QUESTIONS
   ========================================================================== */

.tl-questions {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: tl-q;
}

.tl-q {
    counter-increment: tl-q;
    background: #fff;
    border: 1px solid var(--tl-line);
    border-radius: var(--tl-radius);
    padding: 26px clamp(20px, 3vw, 32px);
    margin-bottom: 16px;
    transition: border-color .2s, box-shadow .2s;
}

.tl-q:last-child {
    margin-bottom: 0;
}

.tl-q.is-answered {
    border-color: #c8d7da;
    box-shadow: 0 2px 14px rgba(21, 77, 90, .06);
}

.tl-q-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.tl-q-num {
    font-family: 'Thmanyah Serif Display', serif;
    font-weight: 900;
    font-size: 17px;
    color: var(--tl-line);
    line-height: 1;
}

.tl-q-num::before {
    content: counter(tl-q, decimal-leading-zero);
}

.tl-q-cat {
    font-size: 12px;
    font-weight: 700;
    color: var(--tl-accent-strong);
    background: var(--accent--family--color);
    border-radius: 999px;
    padding: 4px 12px;
}

/* Each question is a real <fieldset>/<legend> so the three answers are
   announced as one labelled group. Both carry heavy UA + Bootstrap defaults
   (legend is 1.5rem and full-width in reboot) — unwind them so the heading
   inside the legend keeps the page's own type scale. */
.tl-q fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.tl-q legend {
    display: block;
    width: auto;
    max-width: 100%;
    float: none;
    padding: 0;
    margin: 0;
    border: 0;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    white-space: normal;
}

.tl-q h3 {
    font-size: clamp(17px, 1.9vw, 21px);
    margin-bottom: 10px;
}

.tl-q p {
    font-size: 15px;
    line-height: 1.9;
    color: var(--tl-muted);
    margin: 0 0 18px;
}

/* Three-way answer control. Real radios stay in the DOM for keyboard and
   screen-reader support; the visible chip is the <label>. */
.tl-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tl-answer {
    position: relative;
}

.tl-answer input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.tl-answer span {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--tl-ink);
    background: #fff;
    border: 1.5px solid var(--tl-line);
    border-radius: 999px;
    padding: 10px 26px;
    transition: background .2s, border-color .2s, color .2s;
    pointer-events: none;
}

.tl-answer input:hover + span {
    border-color: #b9cbd0;
}

.tl-answer input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(243, 114, 49, .35);
}

.tl-answer input:checked + span {
    color: #fff;
    background: var(--tl-ink);
    border-color: var(--tl-ink);
}

.tl-answer--no input:checked + span {
    background: var(--tl-accent-strong);
    border-color: var(--tl-accent-strong);
}

.tl-answer--unsure input:checked + span {
    color: var(--tl-ink);
    background: #e7eff1;
    border-color: #c8d7da;
}

/* ==========================================================================
   6. SPEND-LEAKS — SUBMIT BAR + RESULT
   ========================================================================== */

.tl-submit {
    text-align: center;
    margin-top: 32px;
}

.tl-progress {
    font-size: 16px;
    color: var(--tl-muted);
    margin-bottom: 16px;
}

.tl-progress strong {
    color: var(--tl-ink);
    font-weight: 800;
}

.tl-btn {
    display: inline-block;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: var(--tl-accent-strong);
    border: 0;
    border-radius: 999px;
    padding: 15px 44px;
    cursor: pointer;
    transition: transform .2s, background .2s, opacity .2s;
}

.tl-btn:hover:not(:disabled),
.tl-btn:focus-visible:not(:disabled) {
    background: var(--tl-ink);
    transform: translateY(-2px);
    color: #fff;
}

.tl-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.tl-btn--ghost {
    color: var(--tl-ink);
    background: transparent;
    border: 1.5px solid var(--tl-line);
}

.tl-btn--ghost:hover,
.tl-btn--ghost:focus-visible {
    color: #fff;
    background: var(--tl-ink);
    border-color: var(--tl-ink);
}

.tl-result {
    margin-top: 40px;
    scroll-margin-top: 90px;
}

.tl-result[hidden] {
    display: none;
}

.tl-result-head {
    text-align: center;
    background: var(--tl-ink);
    border-radius: var(--tl-radius) var(--tl-radius) 0 0;
    padding: 40px clamp(22px, 4vw, 48px);
    color: #fff;
}

.tl-result-head p {
    font-size: 15px;
    color: rgba(255, 255, 255, .78);
    margin: 0;
}

.tl-result-amount {
    font-family: 'Thmanyah Serif Display', serif;
    font-weight: 900;
    font-size: clamp(38px, 6vw, 66px);
    line-height: 1.1;
    margin: 8px 0;
}

.tl-result-amount span {
    font-family: 'Thmanyah Sans', sans-serif;
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 600;
    color: rgba(255, 255, 255, .78);
}

.tl-result-tier {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    border-radius: 999px;
    padding: 7px 20px;
    margin-top: 10px;
    color: #fff;
    background: rgba(255, 255, 255, .16);
}

.tl-result-body {
    background: #fff;
    border: 1px solid var(--tl-line);
    border-top: 0;
    border-radius: 0 0 var(--tl-radius) var(--tl-radius);
    padding: clamp(26px, 4vw, 44px);
}

.tl-result-body > h3 {
    margin-bottom: 8px;
}

.tl-result-intro {
    font-size: 15.5px;
    line-height: 1.9;
    color: var(--tl-muted);
    margin-bottom: 26px;
}

.tl-leaks {
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
}

.tl-leak {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    border-top: 1px solid var(--tl-line);
    padding: 20px 0;
}

.tl-leak:last-child {
    padding-bottom: 0;
}

.tl-leak-cost {
    flex: 0 0 auto;
    min-width: 104px;
    font-family: 'Thmanyah Serif Display', serif;
    font-weight: 900;
    font-size: 19px;
    line-height: 1.3;
    color: var(--tl-accent-strong);
}

.tl-leak-cost span {
    display: block;
    font-family: 'Thmanyah Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--tl-muted);
}

.tl-leak-text h4 {
    font-family: 'Thmanyah Serif Display', serif;
    font-weight: 700;
    font-size: 17.5px;
    line-height: 1.5;
    color: var(--tl-ink);
    margin: 0 0 6px;
}

.tl-leak-text p {
    font-size: 15px;
    line-height: 1.85;
    color: var(--tl-muted);
    margin: 0;
}

.tl-leak-text .tl-leak-flag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--tl-muted);
    background: var(--tl-bg);
    border: 1px solid var(--tl-line);
    border-radius: 999px;
    padding: 3px 11px;
    margin-inline-start: 8px;
    vertical-align: middle;
}

.tl-clean {
    text-align: center;
    font-size: 16px;
    line-height: 1.9;
    color: var(--tl-muted);
    margin-bottom: 30px;
}

.tl-result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.tl-result-note {
    font-size: 13.5px;
    line-height: 1.85;
    color: var(--tl-muted);
    text-align: center;
    margin: 22px 0 0;
}

/* ==========================================================================
   7. SUPPORTING BLOCKS (steps, out-of-scope list, CTA)
   ========================================================================== */

.tl-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tl-step {
    background: #fff;
    border: 1px solid var(--tl-line);
    border-radius: var(--tl-radius);
    padding: 28px 26px;
}

.tl-step-num {
    display: block;
    font-family: 'Thmanyah Serif Display', serif;
    font-weight: 900;
    font-size: 26px;
    line-height: 1;
    color: var(--tl-accent);
    margin-bottom: 12px;
}

.tl-step h3 {
    font-size: 19px;
    margin-bottom: 8px;
}

.tl-step p {
    font-size: 14.5px;
    line-height: 1.85;
    color: var(--tl-muted);
    margin: 0;
}

/* "ليست في يدك" list — items the platform owns, not the merchant. */
.tl-outside {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
}

.tl-outside li {
    position: relative;
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--tl-muted);
    padding-inline-start: 30px;
    margin-bottom: 12px;
}

.tl-outside li::before {
    content: "\f00d";
    /* Font Awesome 6 free — solid ×, matching the theme's icon usage. */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 13px;
    color: var(--tl-accent);
    position: absolute;
    inset-inline-start: 0;
    top: 5px;
}

.tl-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 30px;
}

.tl-fact strong {
    display: block;
    font-family: 'Thmanyah Serif Display', serif;
    font-weight: 900;
    font-size: 42px;
    line-height: 1;
    color: var(--tl-ink);
}

.tl-fact span {
    display: block;
    font-size: 14px;
    color: var(--tl-muted);
    margin-top: 6px;
}

/* Closing CTA band, shared by both pages. */
.tl-cta {
    background: var(--tl-ink);
    border-radius: var(--tl-radius);
    padding: clamp(34px, 5vw, 62px);
    text-align: center;
}

.tl-cta h2 {
    color: #fff;
    margin-bottom: 14px;
}

.tl-cta p {
    font-size: clamp(15px, 1.5vw, 17px);
    line-height: 1.9;
    color: rgba(255, 255, 255, .8);
    max-width: 640px;
    margin: 0 auto 28px;
}

.tl-cta-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.tl-cta .tl-btn--ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, .38);
}

.tl-cta .tl-btn--ghost:hover,
.tl-cta .tl-btn--ghost:focus-visible {
    color: var(--tl-ink);
    background: #fff;
    border-color: #fff;
}

/* Cross-link between the two tools. */
.tl-crosslink {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: var(--tl-bg);
    border: 1px solid var(--tl-line);
    border-radius: var(--tl-radius);
    padding: 26px clamp(22px, 3vw, 34px);
    margin-top: 30px;
}

.tl-crosslink h3 {
    font-size: 20px;
    margin-bottom: 6px;
}

.tl-crosslink p {
    font-size: 14.5px;
    line-height: 1.8;
    color: var(--tl-muted);
    margin: 0;
    max-width: 560px;
}

/* ==========================================================================
   8. RESPONSIVE
   ========================================================================== */

@media (max-width: 991px) {
    .tl-steps {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .tl-steps {
        grid-template-columns: 1fr;
    }

    .tl-scroll-hint {
        display: block;
    }

    .tl-season::before {
        font-size: 30px;
        top: 22px;
    }

    .tl-season-meta {
        padding-inline-end: 42px;
    }

    .tl-answers {
        gap: 8px;
    }

    .tl-answer span {
        padding: 10px 20px;
    }

    .tl-leak {
        flex-direction: column;
        gap: 6px;
    }

    .tl-leak-cost {
        min-width: 0;
    }

    .tl-facts {
        gap: 22px;
    }

    .tl-crosslink {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {

    .tl-btn:hover:not(:disabled),
    .tl-btn:focus-visible:not(:disabled) {
        transform: none;
    }
}

/* ==========================================================================
   9. PRINT — the calendar is meant to be handed to a team
   ========================================================================== */

@media print {

    .tl-page header,
    .tl-page .sub-banner-con,
    .tl-page .shohrah-footer,
    .tl-page .sadu-band,
    .tl-cta,
    .tl-crosslink,
    .lux-call-pill,
    #lux-progress,
    .shohrah-assistant,
    .loader-mask {
        display: none !important;
    }

    .tl-season,
    .tl-table-wrap {
        break-inside: avoid;
        box-shadow: none;
    }

    .tl-page {
        padding: 0;
    }
}
