/* ===== CSS Variables ===== */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --secondary: #7C3AED;
    --accent: #10B981;
    --background: #FFFFFF;
    --surface: #F3F4F6;
    --text: #1F2937;
    --text-light: #6B7280;
    --border: #E5E7EB;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Heebo', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.7;
    direction: rtl;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.3;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 2rem;
    text-align: center;
}

h3 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* ===== Layout ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
}

.section {
    padding: 5rem 0;
}

/* ===== Header & Navigation ===== */
.header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    background: var(--background);
    box-shadow: var(--shadow);
    z-index: 1000;
    overflow-x: hidden;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.logo-icon {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-text,
.logo-tagline,
.logo-byline {
    overflow-wrap: break-word;
    word-break: break-word;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    line-height: 1.2;
}

/* כותרת הלוגו (למשל "לימוד בינה מלאכותית AI") — שחור, לא כחול primary */
.logo .logo-text {
    color: #000000;
}

.logo a:hover .logo-text {
    color: #000000;
}

/* English (LTR): same two-line logo — black title, blue byline (COMBE) */
html[lang="en"] .logo .logo-byline {
    color: #2b63e1;
    font-weight: 700;
    font-size: 0.72em;
}

html[lang="en"] .logo a:hover .logo-byline {
    color: #2b63e1;
}

html[lang="en"] .logo-stack {
    text-align: left;
    align-items: flex-start;
}

.logo-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    line-height: 1.2;
    min-width: 0;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Search box in nav */
.nav-search {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-search input[type="search"] {
    width: 160px;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    direction: rtl;
    transition: width 0.2s ease, border-color 0.2s ease;
}

.nav-search input[type="search"]:focus {
    outline: none;
    border-color: var(--primary);
    width: 200px;
}

.nav-search button[type="submit"] {
    padding: 0.4rem 0.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
}

.nav-search button[type="submit"]:hover {
    background: var(--primary-dark);
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}
.lang-switcher a {
    color: var(--text-light);
}
.lang-switcher a:hover {
    color: var(--primary);
}
.lang-switcher .lang-active {
    font-weight: 600;
    color: var(--primary);
}

@media (max-width: 768px) {
    .nav-search {
        order: 3;
        flex: 1 1 100%;
        min-width: 0;
    }
    .nav-search input[type="search"] {
        width: 100%;
        max-width: none;
        min-width: 0;
    }
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s;
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: linear-gradient(135deg, rgba(37, 99, 235, 0.8) 0%, rgba(124, 58, 237, 0.8) 100%), url('images/colorful%20digital%20media%20sy.png');
    background-size: cover;
    background-position: center 35%;
    background-repeat: no-repeat;
    color: white;
    padding: 6rem 1.5rem 4rem;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-tagline {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: white;
    color: var(--primary);
}

.btn-primary:hover {
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--primary-dark);
}

/* ===== Intro Section ===== */
.intro {
    background: var(--surface);
}

.intro-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.intro-text p {
    font-size: 1.1rem;
    color: var(--text-light);
}

.feature-list {
    list-style: none;
    margin-top: 1.5rem;
}

.feature-list li {
    padding: 0.75rem 0;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--border);
}

.feature-list li:last-child {
    border-bottom: none;
}

.placeholder-image {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius);
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8rem;
}

/* ===== Cards Grid ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.card h3 {
    margin-bottom: 0.75rem;
    color: var(--text);
}

.card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.card-link {
    font-weight: 600;
    color: var(--primary);
}

/* ===== Tools Section ===== */
.tools {
    background: var(--surface);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tool-item {
    background: var(--background);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    border-right: 4px solid var(--primary);
}

.tool-item h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.tool-item p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.95rem;
}

/* ===== About Section ===== */
.about {
    text-align: center;
}

.about p {
    max-width: 700px;
    margin: 0 auto 1rem;
    font-size: 1.1rem;
    color: var(--text-light);
}

/* ===== Footer ===== */
.footer {
    background: var(--text);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    margin: 0.25rem 0;
    opacity: 0.9;
}

.footer-contact {
    margin-top: 0.5rem !important;
}

.footer-contact a {
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.5);
}

.footer-contact a:hover {
    border-bottom-color: white;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header .nav {
        padding: 0.2rem 0.6rem;
        gap: 0.25rem;
        min-height: 0;
    }

    .logo {
        font-size: 0.9rem;
        max-width: calc(100vw - 80px);
        order: 1;
        flex: 1 1 auto;
    }

    .logo-text,
    .logo-tagline,
    .logo-byline {
        font-size: 0.8rem;
        line-height: 1.15;
    }

    html[lang="en"] .logo .logo-text {
        font-size: 0.8rem;
    }

    html[lang="en"] .logo .logo-byline {
        font-size: 0.62rem;
    }

    .logo-icon {
        width: 20px;
        height: 20px;
    }

    /* מובייל: המבורגר פותח תפריט רגיל בזרימה; אחרי בחירה – חוזר למצב המבורגר */
    .mobile-menu-btn {
        display: flex;
        flex-shrink: 0;
        order: 2;
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
        position: relative;
        z-index: 1001;
    }

    .mobile-menu-btn span {
        width: 18px;
        height: 2px;
    }

    .nav-links {
        order: 4;
        display: none;
        flex-direction: column;
        width: 100%;
        flex: 1 1 100%;
        position: static;
        background: var(--background);
        padding: 0.35rem 0;
        gap: 0;
        box-shadow: 0 4px 8px rgba(0,0,0,0.08);
        border-radius: var(--radius-sm);
        margin-top: 0.25rem;
        max-height: 70vh;
        overflow-y: auto;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        border-bottom: 1px solid var(--border);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links > li > a {
        display: block;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        white-space: normal;
    }

    .nav-search {
        flex: 1 1 100%;
        min-width: 0;
        max-width: none;
        padding: 0.15rem 0.2rem;
    }

    .nav-search input[type="search"] {
        width: 100%;
        min-width: 0;
        padding: 0.25rem 0.5rem;
        font-size: 0.85rem;
    }

    .nav-search button[type="submit"] {
        padding: 0.2rem 0.35rem;
        font-size: 0.9rem;
    }

    .hero {
        padding: 3rem 1rem 2rem;
        min-height: 100svh;
    }

    .hero h1 {
        font-size: clamp(1.15rem, 4.5vw, 1.5rem);
        line-height: 1.25;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-tagline {
        font-size: 0.9rem;
        padding: 0.4rem 1rem;
    }

    .intro-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .placeholder-image {
        height: 200px;
        font-size: 5rem;
    }

    .section {
        padding: 2.5rem 0;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        min-width: 0;
    }

    .card {
        min-width: 0;
        padding: 1.25rem;
    }

    .card p, .card h3 {
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .tool-item {
        min-width: 0;
    }

    .btn {
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
        text-align: center;
        box-sizing: border-box;
    }

    .article-nav .btn {
        display: block;
        width: 100%;
        max-width: 100%;
    }

    .hero .btn-primary {
        width: auto;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 2rem 0;
    }

    .logo-text,
    .logo-tagline,
    .logo-byline {
        font-size: 0.95rem;
    }

    html[lang="en"] .logo .logo-text {
        font-size: 0.95rem;
    }

    html[lang="en"] .logo .logo-byline {
        font-size: 0.72rem;
    }

    .hero {
        padding: 4.5rem 0.75rem 2.5rem;
    }

    .card-number {
        top: -6px;
        right: -6px;
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* ===== Dropdown Menu ===== */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--background);
    min-width: 220px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 0.5rem 0;
    z-index: 1001;
    list-style: none;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    border-bottom: none !important;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text);
    font-weight: 400;
    font-size: 0.95rem;
    transition: background 0.2s ease;
}

.dropdown-menu a:hover {
    background: var(--surface);
    color: var(--primary);
}

.dropdown-menu a::after {
    display: none;
}

/* ===== Card Numbers ===== */
.card {
    position: relative;
}

.card-number {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: var(--shadow);
}

/* ===== Mobile Dropdown ===== */
@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        padding: 0;
        padding-right: 0.5rem;
        padding-bottom: 0.25rem;
        background: var(--surface);
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    .dropdown-menu a {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
        border-bottom: 1px solid var(--border);
    }

    .dropdown-toggle {
        font-size: 0.9rem;
    }

    .card-number {
        top: -8px;
        right: -8px;
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}
