/* ======================================================================
   style.css — סגנונות מותאמים אישית מעבר ל-Tailwind
   shiur.co.il (האתר הפומבי)
   ====================================================================== */

/* ── 1. Base — סגנונות גלובליים ────────────────────────────── */
html { scroll-behavior: smooth; }

body {
    font-family: 'Heebo', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f8fafc;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* תיקון עברית: ספרות וסימנים בתוך טקסט עברי */
html[lang="he"] {
    font-feature-settings: "kern", "liga", "calt";
}

/* תיקון יישור צ'ק-בוקסים ו-radio ב-RTL */
input[type="checkbox"],
input[type="radio"] {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* ── 2. Glass Effect — זכוכית הניווט הקבועה ────────────────── */
.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* כשהדף נגלל — נוסיף יותר shadow */
.glass-effect.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ── 3. Hero Background — תמונת רקע parallax ────────────────── */
.hero-bg {
    background-image:
        linear-gradient(to right, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.75)),
        url('https://images.unsplash.com/photo-1503387762-592deb58ef4e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

@media (min-width: 768px) {
    .hero-bg {
        background-attachment: fixed;
    }
}

/* כיבוי parallax ב-prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .hero-bg {
        background-attachment: scroll !important;
    }
    html { scroll-behavior: auto; }
}

/* ── 4. VIP Gradient — בלוק ה-VIP ───────────────────────────── */
.vip-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}

/* ── 5. Card Hover — אנימציית הצף לכרטיסים ──────────────────── */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* כיבוי הריחוף ב-reduced motion */
@media (prefers-reduced-motion: reduce) {
    .card-hover {
        transition: none;
    }
    .card-hover:hover {
        transform: none;
    }
}

/* ── 6. Line Clamp — הגבלת מס' שורות בתוכן ──────────────────── */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── 7. xs Breakpoint — נקודת שבירה קטנה (Tailwind מתחיל מ-sm=640) ── */
@media (min-width: 480px) {
    .xs\:inline    { display: inline; }
    .xs\:hidden    { display: none; }
    .xs\:block     { display: block; }
}

/* ── 8. Print Styles — הדפסה נקייה (חוסך דיו) ───────────────── */
@media print {
    nav, footer, .glass-effect, .hero-bg::before,
    #pwa-modal, [data-no-print] {
        display: none !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
    a {
        text-decoration: underline;
        color: black !important;
    }
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        color: #555;
    }
    .card-hover, .shadow-xl, .shadow-lg, .shadow-md, .shadow-sm {
        box-shadow: none !important;
    }
}

/* ── 9. Focus Visible — נגישות מקלדת ─────────────────────────── */
:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── 10. Selection — צבע סימון טקסט ──────────────────────────── */
::selection {
    background: #2563eb;
    color: white;
}
::-moz-selection {
    background: #2563eb;
    color: white;
}

/* ── 11. Loading Skeleton (לטעינה אסינכרונית עתידית) ─────────── */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}
@keyframes skeleton-loading {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── 12. Scroll Margin — תיקון anchor links עם nav fixed ─────── */
[id]:not(body) {
    scroll-margin-top: 5rem; /* 80px = h-16 (nav) + buffer */
}

/* ── 12b. Mobile menu open — מסתיר את כפתור הגלילה למעלה ─────── */
body.menu-open #scroll-to-top {
    display: none !important;
}

/* ── 13b. Logo tilt animation (זהה לפורטל הסטודנט ב-portal-app) ── */
@keyframes tilt-hat {
    0%   { transform: rotate(0deg); }
    50%  { transform: rotate(45deg); }
    100% { transform: rotate(0deg); }
}
.animate-tilt-hat {
    animation: tilt-hat 0.35s ease-in-out;
    transform-origin: center center;
    display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
    .animate-tilt-hat { animation: none; }
}

/* ── 13. SR Only utility (Tailwind has it, אבל מחזק כאן) ─────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}
