/* ייבוא פונטים */
@import url(https://fonts.googleapis.com/earlyaccess/opensanshebrew.css);
@import url(https://fonts.googleapis.com/earlyaccess/opensanshebrewcondensed.css);
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;600&display=swap');

:root {
    --primary-color: rgb(27, 87, 137);
    --accent-color: #3498db;
    --bg-color: #f8f9fa;
    --text-color: #333333;
    --light-gray: #e9ecef;
    --white: #ffffff;
    --container-width: 1200px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Open Sans Hebrew', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    direction: rtl;
}

body.cke_editable {
    padding: 15px;
    background-color: #fff;
    font-size: 18px;
    font-family: 'Open Sans Hebrew', sans-serif;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
a:hover { color: var(--accent-color); }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Main Site Header --- */
body > header {
    background: var(--white);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 9999; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transform: translateZ(0); 
}

.header-inner { display: flex; justify-content: space-between; align-items: center; position: relative; width: 100%; }

.header-right { display: flex; align-items: center; gap: 20px; flex-wrap: nowrap; }
.header-left { display: flex; align-items: center; gap: 20px; }

.logo-wrapper { display: flex; flex-direction: column; text-decoration: none; flex-shrink: 0; }
.logo-wrapper img { height: 45px; width: auto; }
.logo-tagline { font-size: 0.75rem; color: #888; text-align: right; margin-top: 2px; padding-right: 5px; }

.header-slogan { 
    font-family: 'Open Sans Hebrew Condensed', sans-serif; 
    font-size: 1.35rem; 
    color: var(--primary-color); 
    border-right: 2px solid #eee; 
    padding-right: 15px; 
    font-weight: 400; 
    line-height: 1.2; 
    white-space: nowrap; 
}

nav ul { list-style: none; display: flex; gap: 15px; margin: 0; padding: 0; }
nav a { font-weight: 600; font-size: 0.95rem; color: #444; }
.search-form { display: flex; }
.search-form input { padding: 5px 10px; border: 1px solid #ddd; border-radius: 4px; width: 150px; font-family: 'Open Sans Hebrew', sans-serif;}

.mobile-menu-toggle { display: none; background: none; border: none; font-size: 1.8rem; color: var(--primary-color); cursor: pointer; padding: 5px; }

/* --- כפתורי אדמין - שקיפות, ריחוף ועיצוב מינימלי --- */
.admin-copy-btn, .admin-edit-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
    line-height: 1;
    background: transparent;
}

.admin-copy-btn { color: #b58900; }
.admin-copy-btn:hover { background: #fdfbf7; border-color: #e3ca8c; }
.admin-edit-link { color: #c2185b; }
.admin-edit-link:hover { background: #fce4ec; border-color: #f8bbd0; }

.article-card .admin-edit-link, 
.archive-item .admin-edit-link, 
.hero-slide .admin-edit-link {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid #f8bbd0 !important;
    border-radius: 20px !important;
    padding: 4px 10px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15) !important;
    z-index: 100 !important;
    width: auto !important;
}
.article-card .admin-edit-link:hover, 
.archive-item .admin-edit-link:hover, 
.hero-slide .admin-edit-link:hover {
    background: #fff !important;
    transform: scale(1.05);
}

.article-meta-bar { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    flex-wrap: wrap; 
    border-top: 1px solid #eee; 
    border-bottom: 1px solid #eee; 
    padding: 12px 0; 
    margin-bottom: 25px; 
    color: #777; 
    font-size: 0.9rem; 
}
.meta-info { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.admin-actions { margin-right: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* --- מנגנון הקישורים --- */
.card-link-overlay { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; background: transparent; cursor: pointer; }
.hero-slide, .article-card, .archive-item, .side-card { position: relative; }

/* --- טיפוגרפיה --- */
.article-header { position: static; z-index: 1; box-shadow: none; padding: 0; background: transparent; }
h1, .article-header h1 { font-family: "Open Sans Hebrew Condensed", sans-serif; font-weight: 400; color: rgb(27, 87, 137); font-size: 36.4px; line-height: 1.1; margin-top: 0; margin-bottom: 10px; }
h2, .article-body h2 { font-family: "Open Sans Hebrew Condensed", sans-serif; font-weight: 400 !important; font-size: 28px; color: var(--primary-color); margin-top: 25px; margin-bottom: 10px; line-height: 1.2; border-bottom: none; }
.article-body h3 { font-family: "Open Sans Hebrew Condensed", sans-serif; font-weight: 700; font-size: 1.4rem; color: var(--primary-color); margin-top: 20px; margin-bottom: 5px; line-height: 1.2; }
.article-body h4 { font-family: "Open Sans Hebrew Condensed", sans-serif; font-weight: 700; font-size: 1.2rem; margin-top: 15px; margin-bottom: 5px; color: #444; }

/* תיבת קרדיט לכותב בתחתית הכתבה */
.author-credit-box {
    margin-top: 40px;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-right: 4px solid var(--primary-color);
    border-radius: 4px;
    font-size: 1rem;
    color: #555;
    font-style: italic;
    line-height: 1.6;
}

.author-credit-box p:last-child {
    margin-bottom: 0;
}

/* עיצוב רספונסיבי מיוחד לסרטוני יוטיוב ו-וימאו בתוך התוכן */
.article-body iframe[src*="youtube.com"],
.article-body iframe[src*="youtube-nocookie.com"],
.article-body iframe[src*="vimeo.com"] {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9;
    border: none;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* Hero Slider */
.top-section-wrapper { margin-bottom: 30px; display: grid; grid-template-columns: 1fr 300px; gap: 30px; height: auto; }
.hero-slider-container { position: relative; min-width: 0; height: 550px; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border: 1px solid #eee; transition: all 0.3s ease; }
.hero-slide { display: flex; flex-direction: column; width: 100%; height: 100%; position: absolute; top: 0; left: 0; opacity: 0; transition: opacity 0.5s ease-in-out; z-index: 1; background: #fff; visibility: hidden; }
.hero-slide.active { opacity: 1; z-index: 2; visibility: visible; }
.hero-image { width: 100%; height: 350px; background-size: cover; background-position: center top; flex-shrink: 0; position: relative; }
.hero-image::after { content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 80px; background: linear-gradient(to bottom, rgba(255,255,255,0), #ffffff); pointer-events: none; }
.hero-content { padding: 1.2rem; display: flex; flex-direction: column; justify-content: flex-start; flex-grow: 1; overflow: hidden; position: relative; z-index: 1; }
.hero-slide h2 { font-size: 28px; margin: 0 0 0.5rem 0; font-weight: 400; }
.hero-slide p { font-family: 'Open Sans Hebrew', sans-serif; font-size: 1rem; color: #555; margin: 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-sidebar-ad { width: 100%; height: 550px; }
.hero-ad-spot { background: #f8f9fa; border: 1px dashed #ccc; display: flex; align-items: center; justify-content: center; height: 100%; border-radius: 8px; overflow: hidden; }

/* Grid Layout */
.main-layout { display: grid; grid-template-columns: 1fr 300px; gap: 30px; margin-bottom: 3rem; }
.articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* Article Card */
.article-card { background: var(--white); border-radius: 6px; overflow: hidden; border: 1px solid #eee; display: flex; flex-direction: column; transition: all 0.3s ease; }
.article-card:hover, .hero-slider-container:hover, .side-card:hover, .archive-item:hover { box-shadow: 0 10px 25px rgba(0,0,0,0.12); transform: translateY(-4px); border-color: #ddd; }
.card-img { height: 160px; background-size: cover; background-position: center; }
.card-content { padding: 1rem; flex-grow: 1; display: flex; flex-direction: column; }
.card-title { font-family: 'Open Sans Hebrew Condensed', serif; font-size: 1.4rem; margin: 0 0 0.5rem 0; font-weight: 400; line-height: 1.2; color: var(--primary-color); }
.card-excerpt { font-size: 0.95rem; color: #666; margin-bottom: 0; flex-grow: 1; }
.ad-card-container { background: #f9f9f9; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px; border: 1px solid #e1e4e8; border-radius: 6px; min-height: 250px; }

/* Single Article */
.single-article { background: var(--white); padding: 2rem; border-radius: 8px; box-shadow: 0 1px 5px rgba(0,0,0,0.02); }
.article-body { font-size: 1.15rem; line-height: 1.6; color: #222; }
.article-body p { margin-top: 0; margin-bottom: 12px; }
.article-body ul { margin-top: 0; margin-bottom: 15px; padding-right: 30px; }
.article-body li { margin-bottom: 5px; }
.article-body img { max-width: 100%; height: auto; margin: 15px 0; display: block; }
.article-body ol { counter-reset: custom-counter; list-style-type: none; padding-right: 0; margin-top: 15px; margin-bottom: 20px; }
.article-body ol li { counter-increment: custom-counter; position: relative; padding-right: 45px; margin-bottom: 15px; line-height: 1.6; }
.article-body ol li::before { content: counter(custom-counter); position: absolute; right: 0; top: 0; background-color: var(--primary-color); color: white; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1.1rem; font-family: 'Rubik', sans-serif; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }

/* CKEditor classes */
img.img-100 { width: 100% !important; height: auto !important; display: block; margin: 15px 0; }
img.img-left { float: left; margin: 0 15px 15px 0; max-width: 50%; }
img.img-right { float: right; margin: 0 0 15px 15px; max-width: 50%; }
.highlight-text { background-color: #fff3cd; padding: 0 5px; }

/* Sidebar Articles */
.side-articles-box { margin-top: 30px; }
.side-articles-title { font-family: "Open Sans Hebrew Condensed", serif; font-size: 1.5rem; color: var(--primary-color); border-bottom: 2px solid #eee; padding-bottom: 5px; margin-bottom: 15px; }
.side-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #eee; border-radius: 6px; overflow: hidden; margin-bottom: 15px; position: relative; }
.side-card-img { height: 140px; background-size: cover; background-position: center; }
.side-card-content { padding: 10px; }
.side-card-title { font-family: "Open Sans Hebrew Condensed", serif; font-size: 1.2rem; font-weight: 600; line-height: 1.2; color: var(--primary-color); margin: 0; }

/* Archive Page */
.archive-list { display: flex; flex-direction: column; gap: 25px; }
.archive-item { display: flex; background: #fff; border: 1px solid #ccc; border-radius: 6px; overflow: hidden; min-height: 180px; box-shadow: 0 2px 5px rgba(0,0,0,0.03); position: relative; transition: all 0.3s ease; }
.archive-img { width: 280px; background-size: cover; background-position: center; flex-shrink: 0; }
.archive-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.archive-title { font-family: "Open Sans Hebrew Condensed", serif; font-size: 1.6rem; color: var(--primary-color); margin: 0 0 10px 0; font-weight: 600; line-height: 1.2; }
.archive-meta { font-size: 0.9rem; color: #777; margin-bottom: 10px; font-weight: bold; }
.archive-excerpt { font-size: 1rem; color: #555; line-height: 1.5; }

.pagination { margin-top: 40px; display: flex; justify-content: center; gap: 5px; }
.pagination a, .pagination span { padding: 8px 12px; border: 1px solid #ddd; background: #fff; text-decoration: none; color: #333; border-radius: 4px; }
.pagination .current-page { background: var(--accent-color); color: #fff; border-color: var(--accent-color); font-weight: bold; }

/* Scroll to Top */
#scrollToTopBtn { display: none; position: fixed; bottom: 25px; left: 25px; z-index: 1000; border: none; outline: none; background-color: var(--accent-color); color: white; cursor: pointer; width: 45px; height: 45px; border-radius: 50%; padding: 0; box-shadow: 0 4px 15px rgba(0,0,0,0.2); font-size: 1.5rem; font-weight: bold; font-family: Arial, sans-serif; line-height: 1; transition: all 0.3s ease; align-items: center; justify-content: center; opacity: 0.8; }
#scrollToTopBtn:hover { background-color: var(--primary-color); transform: translateY(-5px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); opacity: 1; }
footer { position: relative; z-index: 100; }

/* --- Responsive Adjustments --- */
@media (min-width: 1350px) { #scrollToTopBtn { left: calc(50% - 600px - 70px); } }

@media (max-width: 1024px) {
    .header-slogan { display: none; }
}

@media (max-width: 992px) {
    .main-layout { grid-template-columns: 1fr; }
    .top-section-wrapper { grid-template-columns: 1fr; height: auto; }
    .hero-slider-container { height: auto; min-height: 500px; }
    .hero-sidebar-ad { width: 100%; height: 300px; }
    .side-articles-box { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .archive-item { flex-direction: column; height: auto; }
    .archive-img { width: 100%; height: 200px; }
    #scrollToTopBtn { bottom: 20px; left: 20px; width: 40px; height: 40px; font-size: 1.2rem; }
}

@media (max-width: 768px) { 
    .mobile-menu-toggle { display: block; }
    .header-left.nav-container { 
        display: none; 
        flex-direction: column; 
        position: absolute; 
        top: 100%; 
        left: 0; 
        width: 100%; 
        background: var(--white); 
        padding: 15px; 
        box-shadow: 0 6px 15px rgba(0,0,0,0.1); 
        border-top: 1px solid #eee;
        z-index: 9999;
    }
    .header-left.nav-container.active { display: flex; }
    
    nav ul { flex-direction: column; gap: 12px; text-align: right; width: 100%; }
    .search-form { width: 100%; margin-top: 15px; }
    .search-form input { width: 100%; padding: 10px; }
    
    .articles-grid { grid-template-columns: repeat(2, 1fr); } 
    .side-articles-box { grid-template-columns: 1fr; }
}

@media (max-width: 576px) { .articles-grid { grid-template-columns: 1fr; } }