/* ===================================================
   מדור מאמרים – עיצוב משותף לעמוד המאמרים ולעמודי המאמר
   =================================================== */

:root {
    --a-navy: #0f172a;
    --a-ink: #111827;
    --a-text: #1f2937;
    --a-muted: #64748b;
    --a-blue: #365db4;
    --a-blue-dark: #1e3a8a;
    --a-light-blue: #93c5fd;
    --a-bg: #f8fafc;
    --a-line: #e5e7eb;
    --a-white: #ffffff;
    --a-gradient: linear-gradient(45deg, #365db4, #000000);
    --a-radius: 18px;
}

/* בעמודי טקסט ארוכים לא רוצים "הצמדה" של הגלילה לסקשנים */
body.articles-page {
    scroll-snap-type: none;
    background: var(--a-bg);
}

html {
    scroll-behavior: smooth;
}

/* ---------- כותרת עליונה (באנר) ---------- */
.a-hero {
    background: radial-gradient(circle at top, #1e293b 0, #0f172a 55%, #020617 100%);
    color: #f9fafb;
    padding: 56px 20px 64px;
    text-align: center;
}

.a-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 12px;
}

.a-hero p {
    color: #cbd5e1;
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 620px;
    margin: 0 auto;
}

/* ---------- עמוד מרכזי: חיפוש + קוביות מאמרים ---------- */
.a-hero {
    padding-bottom: 110px;
}

.a-list-wrap {
    max-width: 1200px;
    margin: -78px auto 0;
    padding: 0 20px 90px;
    position: relative;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* תיבת החיפוש */
.a-search {
    background: var(--a-white);
    border-radius: 22px;
    padding: 26px 28px 22px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14);
    max-width: 980px;
    margin: 0 auto 40px;
    text-align: center;
}

.a-search-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--a-navy);
    margin-bottom: 16px;
}

.a-search-box {
    display: flex;
    border: 2px solid var(--a-navy);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 4px 4px 0 var(--a-navy);
    background: var(--a-white);
    max-width: 760px;
    margin: 0 auto;
}

.a-search-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 13px 22px;
    font: inherit;
    font-size: 1rem;
    color: var(--a-ink);
    background: transparent;
}

.a-search-box input::placeholder {
    color: #94a3b8;
}

.a-search-box button {
    border: 0;
    background: var(--a-gradient);
    color: #fff;
    width: 60px;
    font-size: 1.05rem;
    cursor: pointer;
}

.a-search-box:focus-within {
    box-shadow: 4px 4px 0 var(--a-blue);
    border-color: var(--a-blue);
}

.a-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.a-chip {
    font: inherit;
    font-size: 0.9rem;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    color: var(--a-text);
    padding: 7px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.a-chip:hover {
    border-color: var(--a-blue);
    color: var(--a-blue);
}

.a-chip.is-active {
    background: var(--a-navy);
    border-color: var(--a-navy);
    color: #fff;
}

.a-status {
    text-align: center;
    color: var(--a-muted);
    font-size: 0.9rem;
    min-height: 1.2em;
    margin: -24px 0 14px;
}

/* רשת הקוביות */
.a-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.a-grid li[hidden] {
    display: none;
}

.a-card {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--a-white);
    border-radius: 26px;
    padding: 12px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
    border: 1px solid var(--a-line);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.a-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.16);
}

/* הגרפיקה של הקובייה */
.a-cover {
    --bg: linear-gradient(140deg, #1e293b, #0f172a);
    --fg: #ffffff;
    --medal-bg: #ffffff;
    --medal-fg: #0f172a;
    --deco: rgba(255, 255, 255, 0.08);
    --coin: #93c5fd;
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 18px;
    overflow: hidden;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

/* פסים מעוגלים ברקע – כמו עמודים בגרף */
.a-cover::before,
.a-cover::after {
    content: "";
    position: absolute;
    z-index: -1;
    bottom: -30px;
    width: 46px;
    border-radius: 999px;
    background: var(--deco);
}

.a-cover::before {
    inset-inline-start: 14%;
    height: 70%;
    box-shadow: 64px 40px 0 var(--deco), 128px 10px 0 var(--deco);
}

.a-cover::after {
    inset-inline-end: 10%;
    height: 85%;
    box-shadow: -64px 50px 0 var(--deco);
}

.a-cover-medal {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: var(--medal-bg);
    color: var(--medal-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.9rem;
    border: 3px solid var(--a-navy);
    box-shadow: 6px 6px 0 var(--a-navy);
    transition: transform 0.25s ease;
}

.a-card:hover .a-cover-medal {
    transform: rotate(-8deg) scale(1.05);
}

.a-cover-ghost {
    position: absolute;
    inset-inline-end: -14px;
    bottom: -18px;
    font-size: 7.5rem;
    color: var(--fg);
    opacity: 0.08;
    z-index: -1;
}

.a-cover-coin {
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--coin);
    color: var(--a-navy);
    border: 2px solid var(--a-navy);
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.a-cover-coin.c1 { top: 22%; inset-inline-end: 18%; transform: rotate(-12deg); }
.a-cover-coin.c2 { bottom: 18%; inset-inline-start: 16%; width: 28px; height: 28px; font-size: 0.8rem; transform: rotate(10deg); }
.a-cover-coin.c3 { bottom: 26%; inset-inline-end: 12%; width: 24px; height: 24px; font-size: 0.75rem; }

.a-cover-badge {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    z-index: 2;
    background: #fff;
    color: var(--a-navy);
    border: 2px solid var(--a-navy);
    border-radius: 10px;
    padding: 3px 12px;
    font-weight: 700;
    font-size: 0.85rem;
    transform: rotate(-3deg);
}

.a-cover.has-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.a-cover.has-img::before,
.a-cover.has-img::after {
    display: none;
}

/* צבעי הנושאים – כולם מתוך הפלטה של FINANTZA */
.a-cover.v-navy {
    --bg: radial-gradient(circle at 30% 20%, #1e293b, #0f172a 60%, #020617);
}

.a-cover.v-blue {
    --bg: linear-gradient(45deg, #365db4, #0f172a);
}

.a-cover.v-sky {
    --bg: linear-gradient(160deg, #dbeafe, #93c5fd);
    --fg: #0f172a;
    --medal-bg: #0f172a;
    --medal-fg: #93c5fd;
    --deco: rgba(255, 255, 255, 0.45);
    --coin: #ffffff;
}

.a-cover.v-light {
    --bg: linear-gradient(160deg, #f8fafc, #e0e7ff);
    --fg: #365db4;
    --medal-bg: #365db4;
    --medal-fg: #ffffff;
    --deco: rgba(54, 93, 180, 0.1);
    --coin: #93c5fd;
}

/* טקסט מתחת לקובייה */
.a-card-body {
    padding: 18px 10px 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.a-card time {
    font-size: 0.82rem;
    color: var(--a-muted);
    margin-bottom: 4px;
}

.a-card h2 {
    font-size: 1.18rem;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--a-ink);
}

.a-card h2 a {
    color: inherit;
    text-decoration: none;
}

/* כל הקובייה לחיצה */
.a-card h2 a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 26px;
}

.a-card h2 a:focus-visible {
    outline: none;
}

.a-card:has(a:focus-visible) {
    outline: 3px solid var(--a-blue);
    outline-offset: 3px;
}

.a-card p {
    color: var(--a-text);
    line-height: 1.7;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
}

.a-card .a-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--a-navy);
    border: 2px solid var(--a-navy);
    border-radius: 999px;
    padding: 7px 18px;
    box-shadow: 3px 3px 0 var(--a-navy);
    align-self: flex-start;
    margin-top: auto;
    transition: background 0.15s ease, color 0.15s ease;
}

.a-card:hover .a-more {
    background: var(--a-navy);
    color: #fff;
}

.a-empty {
    background: var(--a-white);
    border: 1px dashed #cbd5e1;
    border-radius: var(--a-radius);
    padding: 40px 24px;
    text-align: center;
    color: var(--a-muted);
    line-height: 1.8;
    max-width: 760px;
    margin: 0 auto;
}

.a-empty[hidden] {
    display: none;
}

.a-empty a {
    color: var(--a-blue);
    font-weight: 600;
}

@media (max-width: 1000px) {
    .a-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

/* ---------- עמוד מאמר ---------- */
.article {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    color: var(--a-text);
}

.a-breadcrumbs {
    font-size: 0.85rem;
    color: var(--a-muted);
    margin-bottom: 18px;
}

.a-breadcrumbs a {
    color: var(--a-blue);
    text-decoration: none;
}

.a-breadcrumbs a:hover {
    text-decoration: underline;
}

.article h1 {
    font-size: clamp(1.75rem, 4.5vw, 2.5rem);
    line-height: 1.3;
    color: var(--a-ink);
    font-weight: 700;
    margin-bottom: 12px;
}

.a-byline {
    color: var(--a-muted);
    font-size: 0.95rem;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--a-line);
}

.a-byline strong {
    color: var(--a-ink);
    font-weight: 600;
}

/* תוכן עניינים */
.a-toc {
    background: var(--a-white);
    border: 1px solid var(--a-line);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 32px;
}

.a-toc summary {
    font-weight: 700;
    color: var(--a-ink);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.a-toc summary::-webkit-details-marker {
    display: none;
}

.a-toc summary::after {
    content: "\f107";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    transition: transform 0.2s ease;
}

.a-toc[open] summary::after {
    transform: rotate(180deg);
}

.a-toc ol {
    margin: 12px 0 0;
    padding-inline-start: 22px;
    display: grid;
    gap: 6px;
}

.a-toc a {
    color: var(--a-blue);
    text-decoration: none;
    line-height: 1.6;
}

.a-toc a:hover {
    text-decoration: underline;
}

/* גוף המאמר */
.a-body {
    font-size: 1.08rem;
    line-height: 1.9;
}

.a-body h2 {
    font-size: 1.5rem;
    line-height: 1.35;
    color: var(--a-ink);
    margin: 40px 0 12px;
    /* שהכותרת לא תוסתר מתחת לתפריט העליון כשקופצים אליה */
    scroll-margin-top: 120px;
}

.a-body h3 {
    font-size: 1.2rem;
    color: var(--a-ink);
    margin: 26px 0 8px;
    scroll-margin-top: 120px;
}

.a-body p {
    margin-bottom: 16px;
}

.a-body ul,
.a-body ol {
    margin: 0 0 16px;
    padding-inline-start: 24px;
}

.a-body li {
    margin-bottom: 6px;
}

.a-body a {
    color: var(--a-blue);
}

.a-body strong {
    color: var(--a-ink);
}

.a-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 20px;
    font-size: 0.95rem;
    display: block;
    overflow-x: auto;
}

.a-body th,
.a-body td {
    border: 1px solid var(--a-line);
    padding: 8px 12px;
    text-align: right;
}

.a-body th {
    background: #eef2ff;
}

.a-body blockquote {
    border-inline-start: 4px solid var(--a-blue);
    background: #eff6ff;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 0 0 16px;
}

/* כפתור הנעה לפעולה */
.a-cta {
    background: var(--a-gradient);
    color: #fff;
    border-radius: var(--a-radius);
    padding: 28px 26px;
    margin: 36px 0;
    text-align: center;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.a-cta h2,
.a-cta .a-cta-title {
    color: #fff;
    font-size: 1.3rem;
    margin: 0 0 6px;
    font-weight: 700;
    line-height: 1.4;
}

.a-cta p {
    color: #dbeafe;
    margin: 0 0 18px;
    font-size: 1rem;
    line-height: 1.7;
}

.a-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: var(--a-ink) !important;
    text-decoration: none !important;
    font-weight: 700;
    padding: 13px 28px;
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, background 0.15s ease;
}

.a-cta-btn:hover {
    background: var(--a-light-blue);
    transform: translateY(-2px);
}

/* שאלות נפוצות */
.a-faq {
    margin-top: 44px;
}

.a-faq h2 {
    margin-top: 0;
}

/* כל יעד של קפיצה מתוכן העניינים – לא להסתתר מתחת לתפריט העליון */
.article [id] {
    scroll-margin-top: 120px;
}

.a-faq details {
    background: var(--a-white);
    border: 1px solid var(--a-line);
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
}

.a-faq summary {
    cursor: pointer;
    padding: 14px 18px;
    font-weight: 600;
    color: var(--a-ink);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    line-height: 1.5;
}

.a-faq summary::-webkit-details-marker {
    display: none;
}

.a-faq summary::after {
    content: "+";
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--a-blue);
    flex-shrink: 0;
}

.a-faq details[open] summary::after {
    content: "−";
}

.a-faq .a-faq-answer {
    padding: 0 18px 14px;
    line-height: 1.8;
}

.a-faq .a-faq-answer p:last-child {
    margin-bottom: 0;
}

/* תיבת כותב */
.a-author {
    display: flex;
    gap: 18px;
    align-items: center;
    background: var(--a-white);
    border: 1px solid var(--a-line);
    border-radius: var(--a-radius);
    padding: 22px;
    margin-top: 44px;
}

.a-author-mark {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--a-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.a-author-name {
    font-weight: 700;
    color: var(--a-ink);
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.a-author-role {
    color: var(--a-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* הערה משפטית */
.a-disclaimer {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--a-line);
    font-size: 0.85rem;
    color: var(--a-muted);
    text-align: center;
}

/* ---------- טלפון ---------- */
@media (max-width: 600px) {
    .a-hero {
        padding: 40px 16px 52px;
    }

    .a-hero {
        padding-bottom: 96px;
    }

    .a-list-wrap {
        padding: 0 14px 60px;
        margin-top: -70px;
    }

    .a-search {
        padding: 20px 16px 18px;
        margin-bottom: 30px;
    }

    .a-search-title {
        font-size: 1.2rem;
    }

    .a-search-box input {
        padding: 11px 16px;
        font-size: 0.95rem;
    }

    .a-chips {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
        margin-inline: -16px;
        padding-inline: 16px;
        scrollbar-width: none;
    }

    .a-chip {
        flex-shrink: 0;
    }

    .a-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .a-cover {
        aspect-ratio: 16 / 10;
    }

    .article {
        padding: 28px 16px 60px;
    }

    .a-body {
        font-size: 1.02rem;
        line-height: 1.85;
    }

    .a-body h2 {
        font-size: 1.3rem;
        margin-top: 32px;
    }

    .a-cta {
        padding: 24px 18px;
    }

    .a-cta-btn {
        width: 100%;
        justify-content: center;
    }

    .a-author {
        flex-direction: column;
        text-align: center;
    }
}
