/*
Theme Name: EndVoice Theme
Theme URI: https://endvoice.co.il
Author: EndVoice
Author URI: https://endvoice.co.il
Description: תבנית בלוג עסקית מודרנית בעברית - עיצוב נקי, מהיר ומותאם SEO. בנויה להתרחב מ-3 מאמרים ועד מאות.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: endvoice
Tags: rtl, blog, business, hebrew, custom-menu, featured-images, translation-ready
*/

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --ev-primary: #2563eb;
    --ev-primary-dark: #1e40af;
    --ev-primary-light: #dbeafe;
    --ev-dark: #0f172a;
    --ev-gray-900: #111827;
    --ev-gray-700: #374151;
    --ev-gray-500: #6b7280;
    --ev-gray-300: #d1d5db;
    --ev-gray-100: #f3f4f6;
    --ev-gray-50: #f9fafb;
    --ev-white: #ffffff;
    --ev-radius: 12px;
    --ev-radius-lg: 16px;
    --ev-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --ev-shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --ev-shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --ev-transition: 0.2s ease;
    --ev-max-width: 1200px;
    --ev-content-width: 768px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Heebo', 'Assistant', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ev-gray-900);
    background: var(--ev-gray-50);
    line-height: 1.7;
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ev-primary); text-decoration: none; transition: color var(--ev-transition); }
a:hover { color: var(--ev-primary-dark); }

img { max-width: 100%; height: auto; display: block; }

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

/* ── Header ───────────────────────────────────────────────────────────────── */
.ev-header {
    background: var(--ev-white);
    border-bottom: 1px solid var(--ev-gray-100);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.92);
}

.ev-header-inner {
    max-width: var(--ev-max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 32px;
    height: 64px;
}

.ev-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ev-dark);
}

.ev-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    font-size: 16px;
}

.ev-logo-text { font-size: 20px; font-weight: 800; }

/* Navigation */
.ev-nav ul {
    list-style: none;
    display: flex;
    gap: 32px;
    align-items: center;
}

.ev-nav a {
    color: var(--ev-gray-700);
    font-size: 15px;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: color var(--ev-transition);
}

.ev-nav a:hover,
.ev-nav .current-menu-item > a,
.ev-nav .current_page_item > a {
    color: var(--ev-primary);
}

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

.ev-nav a:hover::after,
.ev-nav .current-menu-item > a::after { width: 100%; }

/* Mobile menu */
.ev-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--ev-gray-700);
    margin-right: auto;
}

.ev-menu-toggle svg { width: 24px; height: 24px; }

@media (max-width: 768px) {
    .ev-menu-toggle { display: block; }
    .ev-nav {
        display: none;
        position: absolute;
        top: 64px;
        right: 0;
        left: 0;
        background: var(--ev-white);
        border-bottom: 1px solid var(--ev-gray-100);
        box-shadow: var(--ev-shadow-md);
        padding: 16px 20px;
    }
    .ev-nav.is-open { display: block; }
    .ev-nav ul { flex-direction: column; gap: 0; }
    .ev-nav li { border-bottom: 1px solid var(--ev-gray-100); }
    .ev-nav a { display: block; padding: 12px 0; }
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.ev-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #2563eb 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.ev-hero h1 {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.3;
}

.ev-hero p {
    font-size: 18px;
    color: rgba(255,255,255,0.8);
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.ev-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ev-white);
    color: var(--ev-primary-dark);
    padding: 14px 32px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    transition: transform var(--ev-transition), box-shadow var(--ev-transition);
}

.ev-hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    color: var(--ev-primary-dark);
}

@media (max-width: 768px) {
    .ev-hero { padding: 48px 0; }
    .ev-hero h1 { font-size: 28px; }
    .ev-hero p { font-size: 16px; }
}

/* ── Section Titles ────────────────────────────────────────────────────────── */
.ev-section { padding: 60px 0; }

.ev-section-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--ev-gray-900);
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ev-section-title::before {
    content: '';
    width: 4px;
    height: 28px;
    background: var(--ev-primary);
    border-radius: 2px;
}

/* ── Posts Grid ───────────────────────────────────────────────────────────── */
.ev-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

@media (max-width: 900px) { .ev-posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .ev-posts-grid { grid-template-columns: 1fr; } }

/* ── Grid Card (Morning style) ───────────────────────────────────────────── */
.grid-card {
    display: flex;
    flex-direction: column;
}

.grid-card__thumbnail {
    display: block;
    aspect-ratio: 3/2;
    background-size: cover;
    background-position: center;
    background-color: var(--ev-gray-100);
    border-radius: var(--ev-radius);
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
}

.grid-card:hover .grid-card__thumbnail {
    transform: scale(1.02);
}

.grid-card__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ev-gray-100), var(--ev-gray-50));
    color: var(--ev-gray-300);
}

.grid-card__content {
    padding: 14px 2px 0;
}

.grid-card__title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.5;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grid-card__title a {
    color: var(--ev-gray-900);
    text-decoration: none;
    transition: color var(--ev-transition);
}

.grid-card:hover .grid-card__title a {
    color: var(--ev-primary);
}

/* Post meta line */
.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ev-gray-500);
}

.post-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.post-meta__item svg {
    flex-shrink: 0;
}

.post-meta__dot {
    flex-shrink: 0;
    color: var(--ev-gray-300);
}

/* ── Single Post ──────────────────────────────────────────────────────────── */
.ev-single-hero {
    width: 100%;
    max-width: var(--ev-content-width);
    margin: 0 auto;
    padding: 24px 20px 0;
}

.ev-single-hero img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--ev-radius-lg);
}

.ev-single { max-width: var(--ev-content-width); margin: 0 auto; padding: 40px 20px 60px; }

.ev-single-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--ev-primary);
    margin-bottom: 24px;
}

.ev-single-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--ev-gray-500);
    margin-bottom: 16px;
}

.ev-single h1 {
    font-size: 36px;
    font-weight: 800;
    color: var(--ev-primary);
    line-height: 1.3;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .ev-single h1 { font-size: 26px; }
}

/* Article content */
.ev-content { font-size: 17px; line-height: 1.85; color: var(--ev-gray-700); overflow-wrap: break-word; word-wrap: break-word; }
.ev-content h2 { font-size: 24px; font-weight: 700; color: var(--ev-primary-dark); margin: 40px 0 16px; }
.ev-content h3 { font-size: 20px; font-weight: 700; color: var(--ev-gray-900); margin: 32px 0 12px; }
.ev-content h4 { font-size: 18px; font-weight: 600; margin: 24px 0 10px; }
.ev-content p { margin-bottom: 16px; }
.ev-content ul, .ev-content ol { padding-right: 24px; margin-bottom: 16px; }
.ev-content li { margin-bottom: 6px; }
.ev-content ul { list-style-type: disc; }
.ev-content ol { list-style-type: decimal; }
.ev-content a { color: var(--ev-primary); text-decoration: underline; }
.ev-content img { border-radius: var(--ev-radius); margin: 24px 0; }
.ev-content blockquote {
    border-right: 4px solid var(--ev-primary);
    padding: 16px 20px;
    margin: 24px 0;
    background: var(--ev-gray-50);
    border-radius: 0 var(--ev-radius) var(--ev-radius) 0;
    color: var(--ev-gray-700);
    font-style: italic;
}
.ev-content strong { font-weight: 700; color: var(--ev-gray-900); }
.ev-content table { border-collapse: collapse; width: 100%; margin: 24px 0; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ev-content th, .ev-content td { border: 1px solid var(--ev-gray-300); padding: 10px 14px; text-align: right; white-space: nowrap; }
.ev-content th { background: var(--ev-primary-light); font-weight: 600; }

/* Related posts */
.ev-related { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--ev-gray-100); }

/* ── Archive / Blog Page ──────────────────────────────────────────────────── */
.ev-archive-header {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    color: white;
    padding: 48px 0;
    text-align: center;
}

.ev-archive-header h1 { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.ev-archive-header p { color: rgba(255,255,255,0.7); font-size: 16px; }

.ev-archive-subtitle { padding: 16px 0; border-bottom: 1px solid var(--ev-gray-100); }
.ev-archive-subtitle h2 { font-size: 18px; font-weight: 600; color: var(--ev-gray-700); }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.ev-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 40px 0;
}

.ev-pagination a, .ev-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--ev-transition);
}

.ev-pagination a {
    background: var(--ev-white);
    color: var(--ev-gray-700);
    border: 1px solid var(--ev-gray-200);
}

.ev-pagination a:hover { background: var(--ev-primary-light); color: var(--ev-primary); }

.ev-pagination .current {
    background: var(--ev-primary);
    color: white;
    border: none;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.ev-footer {
    background: var(--ev-dark);
    color: rgba(255,255,255,0.6);
    padding: 40px 0;
    text-align: center;
    font-size: 14px;
}

.ev-footer a { color: rgba(255,255,255,0.8); }
.ev-footer a:hover { color: white; }

.ev-footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

/* ── 404 ──────────────────────────────────────────────────────────────────── */
.ev-404 {
    text-align: center;
    padding: 100px 20px;
}

.ev-404 h1 { font-size: 80px; font-weight: 900; color: var(--ev-primary); margin-bottom: 16px; }
.ev-404 p { font-size: 18px; color: var(--ev-gray-500); margin-bottom: 32px; }

/* ── CTA Box ──────────────────────────────────────────────────────────────── */
.ev-cta-box {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-radius: var(--ev-radius-lg);
    padding: 40px;
    text-align: center;
    color: white;
    margin: 48px 0;
}

.ev-cta-box h3 { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.ev-cta-box p { font-size: 16px; opacity: 0.9; margin-bottom: 24px; }

.ev-cta-box a {
    display: inline-block;
    background: white;
    color: var(--ev-primary-dark);
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 700;
    transition: transform var(--ev-transition);
}

.ev-cta-box a:hover { transform: translateY(-2px); color: var(--ev-primary-dark); }

/* ── Search Hero ──────────────────────────────────────────────────────────── */
.search-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #1e40af 100%);
    padding: 48px 0 40px;
}

.search-hero__container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.search-hero__title {
    font-size: 36px;
    font-weight: 800;
    color: var(--ev-white);
    margin-bottom: 28px;
}

.search-form { position: relative; }

.search-form__field { position: relative; }

.search-form__icons {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.search-form__icon {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--ev-transition);
}

.search-form__icon:hover { color: var(--ev-primary); }

.search-form__icon--spinner { animation: ev-spin 1s linear infinite; }
@keyframes ev-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.search-form__icon--clear { color: var(--ev-gray-400); }
.search-form__icon--clear:hover { color: var(--ev-gray-700); }

.search-form__field input[type="text"] {
    width: 100%;
    padding: 14px 44px 14px 40px;
    font-size: 18px;
    font-family: inherit;
    border: none;
    background: transparent;
    color: var(--ev-white);
    direction: rtl;
    outline: none;
}

.search-form__field input[type="text"]::placeholder { color: rgba(255,255,255,0.5); }

.search-form__underline {
    height: 2px;
    background: rgba(255,255,255,0.2);
    border-radius: 1px;
    position: relative;
    overflow: hidden;
}

.search-form__underline span {
    position: absolute;
    bottom: 0;
    right: 50%;
    width: 0;
    height: 100%;
    background: var(--ev-primary);
    transition: width 0.3s ease, right 0.3s ease;
}

.search-form__field input[type="text"]:focus ~ .search-form__underline span {
    width: 100%;
    right: 0;
}

/* Results dropdown */
.search-form__results {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--ev-white);
    border: 1px solid var(--ev-gray-200);
    border-top: none;
    border-radius: 0 0 var(--ev-radius) var(--ev-radius);
    box-shadow: var(--ev-shadow-md);
    z-index: 50;
    max-height: 320px;
    overflow-y: auto;
}

.search-form__results a {
    display: block;
    padding: 12px 16px;
    color: var(--ev-gray-700);
    font-size: 15px;
    border-bottom: 1px solid var(--ev-gray-50);
    transition: background var(--ev-transition);
    text-align: right;
}

.search-form__results a:hover { background: var(--ev-gray-50); color: var(--ev-primary); }

.search-form__results .no-results {
    padding: 16px;
    color: var(--ev-gray-500);
    font-size: 14px;
    text-align: center;
}

/* Recommended searches */
.search-form__recommended {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--ev-white);
    border: 1px solid var(--ev-gray-200);
    border-top: none;
    border-radius: 0 0 var(--ev-radius) var(--ev-radius);
    box-shadow: var(--ev-shadow-md);
    z-index: 50;
    padding: 16px;
    text-align: right;
}

.search-form__field input[type="text"]:focus ~ .search-form__recommended,
.search-form__recommended.is-visible { display: block; }

.recommended__title {
    font-size: 12px;
    font-weight: 700;
    color: var(--ev-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 10px;
}

.recommended__links { display: flex; flex-direction: column; gap: 4px; }

.recommended__link {
    display: block;
    padding: 8px 12px;
    color: var(--ev-gray-700);
    font-size: 14px;
    border-radius: 8px;
    transition: background var(--ev-transition);
}

.recommended__link:hover { background: var(--ev-gray-50); color: var(--ev-primary); }

@media (max-width: 768px) {
    .search-hero { padding: 32px 0 28px; }
    .search-hero__title { font-size: 28px; margin-bottom: 20px; }
    .search-form__field input[type="text"] { font-size: 16px; }
}

/* ── Search (simple header) ──────────────────────────────────────────────── */
.ev-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ev-search-form input[type="search"] {
    border: 1px solid var(--ev-gray-300);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    font-family: inherit;
    direction: rtl;
    width: 200px;
    transition: border-color var(--ev-transition), width var(--ev-transition);
    outline: none;
}

.ev-search-form input[type="search"]:focus {
    border-color: var(--ev-primary);
    width: 260px;
}

.ev-search-form button {
    background: var(--ev-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: background var(--ev-transition);
}

.ev-search-form button:hover { background: var(--ev-primary-dark); }

/* Header search (compact) */
.ev-header-search input[type="search"] { width: 160px; }
.ev-header-search input[type="search"]:focus { width: 220px; }

@media (max-width: 768px) {
    .ev-header-search { display: none; }
    .ev-mobile-search { display: block; padding: 12px 20px; border-bottom: 1px solid var(--ev-gray-100); }
    .ev-mobile-search input[type="search"] { width: 100%; }
}

@media (min-width: 769px) {
    .ev-mobile-search { display: none; }
}

/* ── Mobile Responsiveness ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Container */
    .ev-container { padding: 0 16px; }

    /* Sections */
    .ev-section { padding: 36px 0; }

    /* Section titles */
    .ev-section-title { font-size: 22px; margin-bottom: 20px; }
    .ev-section-title::before { height: 22px; }

    /* Post cards */
    .grid-card__title { font-size: 16px; }
    .grid-card__content { padding: 10px 2px 0; }

    /* CTA box */
    .ev-cta-box { padding: 28px 20px; margin: 32px 0; }
    .ev-cta-box h3 { font-size: 20px; }
    .ev-cta-box p { font-size: 14px; }

    /* Single post */
    .ev-single { padding: 24px 16px 40px; }
    .ev-single-hero { padding: 16px 16px 0; }
    .ev-single-meta { gap: 10px; font-size: 13px; }

    /* Archive subtitle */
    .ev-archive-subtitle h2 { font-size: 16px; }

    /* Pagination */
    .ev-pagination { padding: 28px 0; gap: 6px; }
    .ev-pagination a, .ev-pagination span { width: 36px; height: 36px; font-size: 13px; }

    /* Footer */
    .ev-footer { padding: 28px 0; }
    .ev-footer-links { gap: 16px; flex-wrap: wrap; }

    /* 404 */
    .ev-404 { padding: 60px 16px; }
    .ev-404 h1 { font-size: 56px; }
    .ev-404 p { font-size: 16px; }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .ev-container { padding: 0 12px; }
    .ev-header-inner { padding: 0 12px; height: 56px; }
    .ev-logo-text { font-size: 18px; }
    .ev-logo-icon { width: 32px; height: 32px; font-size: 14px; }

    .search-hero { padding: 24px 0 20px; }
    .search-hero__title { font-size: 24px; margin-bottom: 16px; }
    .search-form__field input[type="text"] { font-size: 15px; padding: 12px 40px 12px 36px; }

    .ev-posts-grid { gap: 20px; }
    .grid-card__thumbnail { border-radius: 10px; }

    .ev-cta-box { border-radius: 12px; padding: 24px 16px; }
    .ev-cta-box a { padding: 10px 24px; font-size: 14px; }
}

/* ── Utilities ────────────────────────────────────────────────────────────── */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
}
