/* ===========================
   UNIT PAGE — MOBILE
=========================== */
@media (max-width: 768px) {

    /* ── HEADER ── */
    .unit-header {
        height: auto;
        min-height: 64px;
        flex-wrap: wrap;
        position: sticky; /* לא fixed — חוסך מקום */
        top: 0;
    }

    /* ריבוע לוגו — קטן יותר */
    .unit-header-logo-box {
        width: 64px;
        height: 64px;
        flex-shrink: 0;
    }
    .unit-header-logo-box img,
    .unit-header-logo-box .custom-logo {
        width: 44px;
    }

    /* gradient — תופס את שארית השורה */
    .unit-header-gradient {
        flex: 1;
        padding: 10px 14px;
        gap: 8px;
        flex-wrap: wrap;
        min-height: 64px;
    }

    /* טקסט כותרת */
    .unit-header-text {
        top: 0;
        gap: 6px;
        flex-wrap: wrap;
        align-items: center;
    }

    .unit-header-number {
        font-size: 22px;
    }

    .unit-header-title {
        font-size: 22px;
        line-height: 1.2;
    }

    .unit-header-decor {
        height: 22px;
    }

    /* קישורים — מוסתרים, מוחלפים ע"י חצי ניווט */
    .unit-header-links { display: none; }

    /* חצי ניווט — ממוקמים בתוך ה-gradient */
    .unit-header-nav {
        position: static;
        margin-bottom: 0;
        gap: 4px;
    }

    .unit-nav-btn {
        width: 28px;
        height: 28px;
        background: rgba(255,255,255,0.2);
    }

    /* תמונת חצי עיגול — מוסתרת */
    .unit-header-thumb-wrap { display: none; }

    /* ── BODY ── */
    .unit-body {
        flex-direction: column;
        padding-top: 0; /* sticky header לא צריך padding */
    }

    /* ── SIDEBAR → TAB BAR תחתון ── */
    .unit-sidebar {
        position: fixed;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: space-around;
        padding: 0 4px;
        gap: 0;
        z-index: 200;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
    }

    .unit-sidebar-item {
        flex: 1;
        padding: 6px 2px 4px;
        gap: 2px;
        max-width: 80px;
    }

    /* עיגול אייקון — קטן יותר */
    .unit-sidebar-icon-wrap {
        width: 32px;
        height: 32px;
    }

    .unit-sidebar-item.is-active .unit-sidebar-icon-wrap {
        transform: scale(1.2) rotate(10deg);
    }

    .unit-sidebar-icon {
        width: 18px;
        height: 18px;
    }

    .unit-sidebar-label {
        font-size: 9px;
        margin-top: 2px;
    }

    /* ── CONTENT ── */
    .unit-content {
        margin-right: 0;
        margin-bottom: 60px; /* מקום ל-tab bar */
        height: calc(100svh - 64px);
        scroll-snap-type: y mandatory;
        overflow-y: scroll;
    }

    .unit-bg-texture {
        inset: 0;
        position: absolute;
    }

    /* ── SECTIONS ── */
    .unit-section {
        min-height: calc(100svh - 64px);
        max-width: 100%;
        padding: 0;
    }

    .unit-section-title {
        font-size: 26px;
        padding: 12px 20px 10px;
        margin: 0 0 20px 0; /* הסרת margin-right */
    }

    .unit-section-content {
        padding: 0 16px 16px;
        overflow-y: auto;
    }

    /* ── OVERVIEW 1 ── */
    .overview-grid {
        grid-template-columns: 1fr;
    }

    .overview-image-wrap {
        width: 100%;
        max-width: 100%;
    }

    .overview-image {
        max-height: 240px;
        object-fit: cover;
    }

    .overview-cards {
        grid-template-columns: 1fr;
    }

    /* סרגל עוגנים */
    .overview-anchors-bar {
        gap: 8px;
        margin-top: 20px;
        padding-bottom: 20px;
    }

    .overview-anchor-item {
        width: 72px;
        height: 72px;
    }

    /* ── OVERVIEW 2 ── */
    .overview2-card.box-1 ul,
    .overview2-card.box-2 ul,
    .overview2-card.box-3 ul {
        columns: 1; /* במקום 2 עמודות */
        margin-right: 0;
        max-width: 100%;
    }

    /* ── OVERVIEW 3 — מדרשים ── */
    .overview3-cards {
        grid-template-columns: 1fr 1fr; /* 4→2 */
        max-height: none;
        gap: 12px;
    }

    /* ── OVERVIEW 4 — סיפורים ── */
    .sipurim-cards {
        grid-template-columns: 1fr 1fr; /* 4→2 */
    }

    .sipur-img-wrap {
        aspect-ratio: 3 / 2;
    }

    /* ── OVERVIEW 5 — עוד במערך ── */
    .ov5-grid {
        columns: 1; /* 2→1 */
    }

    .ov5-games-list,
    .ov5-list {
        grid-template-columns: 1fr; /* 2→1 */
    }

    .ov5-section-header h3 {
        font-size: 22px;
    }

    .ov5-game-pic {
        width: 50px;
        height: 50px;
    }

    .ov5-video-thumb {
        height: 90px;
    }

    /* ── OVERVIEW 6 — הדפסה ── */
    /* sipurim-cards כבר מכוסה למעלה */
}

/* מסכים קטנים מאוד */
@media (max-width: 380px) {

    .unit-sidebar-label { display: none; }
    .unit-sidebar { height: 52px; }

    .overview3-cards,
    .sipurim-cards {
        grid-template-columns: 1fr;
    }

    .unit-header-title { font-size: 18px; }
    .unit-header-number { font-size: 18px; }
}