/* =====================================================================
   Upgrade layer (Nov 2026), loaded after theme.css.
   1. Hero hook to the agreement check
   2. Agreement quick check (interactive)
   3. Signature band: lawyer + CPA
   4. Mobile swipe rows for guides and articles
   ===================================================================== */

/* ---------- 1. Hero hook ---------- */
.hero-checkup-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    color: var(--t-gold);
    font-weight: 600;
    font-size: 1.02rem;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
    text-decoration-color: rgba(193, 168, 123, 0.45);
    transition: text-decoration-color .3s ease, color .3s ease;
}
.hero-checkup-link:hover,
.hero-checkup-link:focus-visible { color: #e3d2ad; text-decoration-color: currentColor; }
.hero-checkup-link span { transition: transform .35s cubic-bezier(.16, 1, .3, 1); }
.hero-checkup-link:hover span { transform: translateX(-4px); }

/* ---------- 2. Agreement quick check ---------- */
.checkup {
    background: var(--t-stone);
    padding: clamp(72px, 9vw, 120px) 0;
    border-top: 1px solid var(--t-line);
    border-bottom: 1px solid var(--t-line);
}
.checkup-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(40px, 6vw, 96px);
    align-items: start;
}
.checkup-intro { position: sticky; top: 110px; }
.checkup-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--t-ink);
    font-size: clamp(2rem, 3.6vw, 3rem);
    line-height: 1.12;
    letter-spacing: -0.01em;
    margin: 0 0 18px;
    text-wrap: balance;
}
.checkup-lead {
    color: var(--t-text-2);
    font-size: 1.12rem;
    line-height: 1.75;
    max-width: 42ch;
    margin: 0 0 36px;
}
.checkup-score {
    border-top: 1px solid var(--t-line);
    padding-top: 26px;
    margin-bottom: 28px;
}
.checkup-score-line { display: flex; align-items: baseline; gap: 14px; margin: 0 0 10px; }
.checkup-score-num {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(4rem, 7vw, 5.5rem);
    line-height: .9;
    color: var(--t-ink);
    font-variant-numeric: lining-nums tabular-nums;
    min-width: 1ch;
    transition: color .4s ease;
}
.checkup-score-of { color: var(--t-text-3); font-weight: 600; font-size: 1rem; }
.checkup-verdict {
    color: var(--t-text);
    font-size: 1.08rem;
    line-height: 1.65;
    margin: 0;
    min-height: 3.3em;
    max-width: 44ch;
}
.checkup[data-tier="low"] .checkup-score-num { color: #8a3b2f; }
.checkup[data-tier="mid"] .checkup-score-num { color: var(--t-gold-ink); }
.checkup[data-tier="high"] .checkup-score-num { color: #2f5d47; }
.checkup-cta { display: inline-flex; }
.checkup-note {
    margin: 16px 0 0;
    font-size: .88rem;
    line-height: 1.6;
    color: var(--t-text-3);
    max-width: 46ch;
}

.checkup-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: chk;
    background: var(--t-card);
    border: 1px solid var(--t-line);
    border-radius: var(--t-r-md);
    box-shadow: var(--t-e2);
    overflow: hidden;
}
.checkup-list li + li { border-top: 1px solid var(--t-line); }
.checkup-list label {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    align-items: center;
    padding: 22px clamp(20px, 3vw, 32px);
    cursor: pointer;
    font-size: 1.08rem;
    line-height: 1.55;
    color: var(--t-text);
    transition: background-color .25s ease;
}
.checkup-list label:hover { background: #fcfaf6; }
.checkup-list input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.checkup-box {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1.5px solid rgba(7, 27, 51, .28);
    background: #fff;
    display: grid;
    place-items: center;
    transition: background-color .25s ease, border-color .25s ease, transform .3s cubic-bezier(.16, 1, .3, 1);
}
.checkup-box::after {
    content: "";
    width: 12px;
    height: 7px;
    border-left: 2.4px solid #fff;
    border-bottom: 2.4px solid #fff;
    transform: translateY(-2px) rotate(-45deg) scale(.4);
    opacity: 0;
    transition: transform .35s cubic-bezier(.16, 1, .3, 1), opacity .2s ease;
}
.checkup-list input:checked + .checkup-box {
    background: var(--t-ink);
    border-color: var(--t-ink);
    transform: scale(1.04);
}
.checkup-list input:checked + .checkup-box::after { opacity: 1; transform: translateY(-2px) rotate(-45deg) scale(1); }
.checkup-list input:checked ~ span:last-child { color: var(--t-text-2); }
.checkup-list input:focus-visible + .checkup-box { box-shadow: var(--focus-ring); }

@media (max-width: 900px) {
    .checkup-grid { grid-template-columns: 1fr; gap: 32px; }
    .checkup-intro { position: static; display: contents; }
    .checkup-title, .checkup-lead { order: 0; }
    .checkup-list { order: 1; }
    .checkup-score, .checkup-cta, .checkup-note { order: 2; }
    .checkup-intro > * { grid-column: 1; }
    .checkup-lead { margin-bottom: 0; }
    .checkup-score { margin-bottom: 0; }
    .checkup-cta { justify-content: center; width: 100%; }
    .checkup-list label { padding: 18px 18px; font-size: 1.02rem; gap: 14px; }
}

/* ---------- 3. Signature band ---------- */
.signature {
    background: var(--t-ink);
    color: var(--t-on-ink);
    padding: clamp(84px, 11vw, 150px) 0;
    position: relative;
    overflow: hidden;
}
.signature::before {
    content: "";
    position: absolute;
    inset-inline-start: -8%;
    top: -30%;
    width: 60%;
    height: 160%;
    background: radial-gradient(closest-side, rgba(193, 168, 123, .10), transparent 70%);
    pointer-events: none;
}
.signature-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
    gap: clamp(40px, 7vw, 110px);
    align-items: center;
}
.signature-portrait {
    margin: 0;
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: var(--t-r-md);
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .35), 0 6px 16px rgba(0, 0, 0, .25);
}
.signature-portrait::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(193, 168, 123, .35);
    border-radius: inherit;
    pointer-events: none;
}
.signature-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; display: block; }
@media (max-width: 860px) {
    .signature-inner { grid-template-columns: 1fr; }
    .signature-portrait { width: min(240px, 60%); order: -1; }
}
.signature-title {
    text-wrap: balance;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.6rem, 6vw, 5rem);
    line-height: 1.04;
    letter-spacing: -0.02em;
    margin: 0 0 30px;
    color: #fff;
}
.signature-title em { font-style: normal; color: var(--t-gold); }
.signature-text {
    font-size: clamp(1.1rem, 1.6vw, 1.32rem);
    line-height: 1.8;
    color: var(--t-on-ink-2);
    max-width: 52ch;
    margin: 0 0 40px;
}
.signature-by { display: flex; align-items: center; gap: 16px; color: var(--t-on-ink-2); font-size: 1rem; }
.signature-by strong { color: #fff; font-weight: 700; }
.signature-rule { width: 56px; height: 1px; background: var(--t-gold); flex: none; }

/* ---------- 4. Mobile swipe rows ---------- */
@media (max-width: 768px) {
    .knowledge-grid {
        display: flex;
        grid-template-columns: none;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 14px;
        margin-inline: -20px;
        padding: 4px 20px 18px;
        scrollbar-width: thin;
        scrollbar-color: var(--t-gold) transparent;
        -webkit-overflow-scrolling: touch;
    }
    .knowledge-grid > .knowledge-card {
        flex: 0 0 82%;
        scroll-snap-align: start;
    }
    .knowledge-grid::-webkit-scrollbar { height: 3px; }
    .knowledge-grid::-webkit-scrollbar-thumb { background: var(--t-gold); border-radius: 3px; }
}

@media (prefers-reduced-motion: reduce) {
    .checkup-box, .checkup-box::after, .hero-checkup-link span, .checkup-score-num { transition: none; }
}

/* ---------- Language adjustments ---------- */
html[lang="ar"] .signature-title { line-height: 1.45; letter-spacing: 0; }
html[lang="ar"] .checkup-title { line-height: 1.5; }
html[dir="ltr"] .hero-checkup-link:hover span,
html[lang="en"] .hero-checkup-link:hover span { transform: translateX(4px); }
