/*
Theme Name: Family Recipes
Description: A custom WordPress theme for family recipe sharing, mobile-friendly with Hebrew RTL support.
Version: 1.1.0
Author: Family Recipes Team
Text Domain: family-recipes
License: GPL-2.0+
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Arial, 'Helvetica Neue', sans-serif;
    line-height: 1.7;
    color: #2d3748;
    background: #f7f8fc;
    direction: rtl;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; color: #1e3a8a; }
h1 { font-size: 2.4rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.9rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }

p { margin-bottom: 1rem; }

a { color: #2563eb; text-decoration: none; transition: color 0.2s; }
a:hover { color: #1d4ed8; }

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

/* ===== HEADER ===== */
.site-header {
    background: #fff;
    box-shadow: 0 2px 16px rgba(30,58,138,0.10);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0;
}
.site-branding { display: flex; flex-direction: column; }
.site-title { font-size: 1.6rem; color: #1e3a8a; margin: 0; }
.site-title a { color: inherit; }
.site-description { color: #64748b; font-size: 0.82rem; margin: 0; }

/* ===== NAVIGATION ===== */
.main-navigation { position: relative; }
.nav-menu { list-style: none; display: flex; gap: 0.2rem; align-items: center; }
.nav-menu li a {
    color: #374151;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    display: block;
}
.nav-menu li a:hover { background: #eff6ff; color: #1e3a8a; }

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: 2px solid #1e3a8a;
    border-radius: 8px;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    gap: 5px;
}
.mobile-menu-toggle span {
    width: 22px; height: 2.5px;
    background: #1e3a8a;
    border-radius: 2px;
    display: block;
    transition: 0.3s;
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}
.hero-pattern {
    position: absolute;
    inset: 0;
    background-size: 320px 320px;
    background-repeat: repeat;
    opacity: 0.08;
    pointer-events: none;
}
.hero-overlay { position: relative; z-index: 1; }
.hero-content { text-align: center; color: #fff; }

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.3rem 1.1rem;
    border-radius: 50px;
    margin-bottom: 1.25rem;
    letter-spacing: 0.5px;
}

.hero-title {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 0.6rem;
    text-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 2.25rem;
}

/* Hero search */
.hero-search {
    display: inline-flex;
    max-width: 560px;
    width: 100%;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0,0,0,0.22);
    border: none;
}
.hero-search .search-field {
    flex: 1;
    padding: 0.9rem 1.4rem;
    font-size: 1rem;
    border: none;
    outline: none;
    background: #fff;
    font-family: inherit;
    direction: rtl;
}
.hero-search .search-submit {
    background: #f59e0b;
    color: #fff;
    border: none;
    padding: 0.9rem 1.8rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    white-space: nowrap;
}
.hero-search .search-submit:hover { background: #d97706; }

/* Hero stats */
.hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 0.75rem 2rem;
    border-radius: 50px;
}
.hero-stat { text-align: center; }
.stat-number { display: block; font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1; }
.stat-label  { display: block; font-size: 0.78rem; color: rgba(255,255,255,0.75); margin-top: 2px; }
.hero-stat-divider { width: 1px; height: 36px; background: rgba(255,255,255,0.3); }

/* ===== MAIN CONTENT ===== */
.main-content { padding: 3rem 0; min-height: calc(100vh - 200px); }

/* ===== SECTION TITLES ===== */
.section-title {
    text-align: center;
    color: #1e3a8a;
    margin-bottom: 2rem;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 56px;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 2px;
    margin: 0.6rem auto 0;
}

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.view-all-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2563eb;
    border: 2px solid #dbeafe;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    transition: all 0.2s;
    white-space: nowrap;
}
.view-all-link:hover { background: #dbeafe; text-decoration: none; }

/* ===== CATEGORIES GRID ===== */
.recipe-categories { margin-bottom: 3.5rem; }

.categories-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.1rem;
}

.category-card {
    background: #fff;
    padding: 1.5rem 0.75rem 1.25rem;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    text-align: center;
    transition: transform 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
}
.category-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 10px 28px rgba(30,58,138,0.15);
    text-decoration: none;
}

.category-img-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.6);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    flex-shrink: 0;
}
.category-img-wrap img { width: 80px; height: 80px; object-fit: cover; }

.category-card h3 { font-size: 0.88rem; color: #1e3a8a; margin: 0; line-height: 1.3; }
.recipe-count { color: #64748b; font-size: 0.76rem; font-weight: 600; }

/* ===== RECIPES GRID ===== */
.latest-recipes { margin-bottom: 3rem; }

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.75rem;
}

.recipe-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(0,0,0,0.07);
    transition: transform 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
}
.recipe-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.recipe-image {
    position: relative;
    overflow: hidden;
    height: 200px;
    flex-shrink: 0;
}
.recipe-image a { display: block; height: 100%; }
.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}
.recipe-card:hover .recipe-image img { transform: scale(1.06); }

.recipe-cat-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(30,58,138,0.85);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.recipe-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.recipe-title { font-size: 1.05rem; margin: 0; }
.recipe-title a { color: #1e3a8a; }
.recipe-title a:hover { color: #2563eb; text-decoration: underline; }

.recipe-meta-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.meta-chip {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.18rem 0.6rem;
    border-radius: 20px;
}
.time-chip { background: #dbeafe; color: #1d4ed8; }

.recipe-author { color: #64748b; font-size: 0.82rem; }

.recipe-read-more {
    display: inline-block;
    margin-top: auto;
    padding-top: 0.6rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #2563eb;
    border-top: 1px solid #f1f5f9;
}
.recipe-read-more:hover { text-decoration: underline; }

/* No recipes placeholder */
.no-recipes-message {
    text-align: center;
    padding: 3rem;
    color: #64748b;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.no-recipes-message img { margin: 0 auto 1rem; }

/* ===== ARCHIVE / CATEGORY PAGE ===== */
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border-radius: 14px;
    color: #fff;
}
.page-title { color: #fff; font-size: 2rem; margin: 0; }

/* ===== SINGLE RECIPE ===== */
.recipe-single {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0,0,0,0.09);
    max-width: 860px;
    margin: 0 auto;
}

.recipe-header {
    padding: 2.5rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: #fff;
}
.recipe-header .recipe-title { color: #fff; margin-bottom: 1rem; }
.recipe-header .recipe-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.recipe-header .recipe-author,
.recipe-header .recipe-date {
    background: rgba(255,255,255,0.18);
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.recipe-featured-image img { width: 100%; max-height: 420px; object-fit: cover; }
.recipe-single .recipe-content { padding: 2rem; }

.recipe-video { margin: 1.5rem 0; }
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
}
.video-wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

.recipe-uploader-note, .recipe-notes {
    background: #f0f9ff;
    border-right: 4px solid #3b82f6;
    padding: 1.25rem 1.5rem;
    border-radius: 0 10px 10px 0;
    margin: 1.5rem 0;
}
.recipe-uploader-note h3, .recipe-notes h3 { color: #1d4ed8; margin-bottom: 0.5rem; }

.recipe-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.print-button {
    background: #1e3a8a;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.2s;
}
.print-button:hover { background: #1d4ed8; }

.share-button.whatsapp-share {
    background: #25d366;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.2s;
    display: inline-block;
}
.share-button.whatsapp-share:hover { background: #128c7e; }

/* ===== PAGINATION ===== */
.nav-links { display: flex; justify-content: center; gap: 0.4rem; margin: 2rem 0; flex-wrap: wrap; }
.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px; height: 38px;
    border-radius: 8px;
    background: #fff;
    color: #1e3a8a;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.09);
    transition: all 0.2s;
    padding: 0 0.6rem;
}
.page-numbers.current, .page-numbers:hover { background: #1e3a8a; color: #fff; text-decoration: none; }

/* ===== FOOTER ===== */
.site-footer {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: #e2e8f0;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}
.footer-section h3 { color: #60a5fa; margin-bottom: 1rem; font-size: 1.05rem; }
.footer-section p  { color: #cbd5e1; font-size: 0.88rem; }
.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 0.4rem; }
.footer-section ul li a { color: #cbd5e1; font-size: 0.88rem; transition: color 0.2s; }
.footer-section ul li a:hover { color: #60a5fa; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: 1.25rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.82rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .categories-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .header-content { flex-direction: row; }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #fff;
        position: absolute;
        top: 100%;
        right: 0; left: 0;
        box-shadow: 0 6px 16px rgba(0,0,0,0.1);
        padding: 0.5rem 0;
        z-index: 999;
    }
    .nav-menu.active { display: flex; }
    .nav-menu li { width: 100%; }
    .nav-menu li a { border-radius: 0; padding: 0.75rem 1.25rem; }
    .mobile-menu-toggle { display: flex; }

    .hero-title { font-size: 1.9rem; }
    .hero-section { padding: 3rem 0 2.5rem; }
    .hero-stats { flex-direction: column; gap: 0.75rem; }
    .hero-stat-divider { width: 40px; height: 1px; }

    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    .recipes-grid { grid-template-columns: 1fr; }

    .footer-content { grid-template-columns: 1fr; }
    .section-header-row { flex-direction: column; align-items: flex-start; }

    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.3rem; }
}

/* ===== PRINT ===== */
@media print {
    .no-print,
    .site-header,
    .site-footer,
    .recipe-actions,
    .hero-section,
    .recipe-categories,
    nav { display: none !important; }

    body { background: #fff; color: #000; font-size: 11pt; }

    .recipe-single { box-shadow: none; border-radius: 0; }
    .recipe-header { background: none !important; color: #000; border-bottom: 2pt solid #1e3a8a; }
    .recipe-header .recipe-title { color: #1e3a8a; }
    .recipe-header .recipe-author,
    .recipe-header .recipe-date { background: none; color: #333; }

    img, .recipe-featured-image, figure, .recipe-image, video { display: none !important; }
    a { color: inherit; text-decoration: none; }

    body::after {
        content: "mygo.co.il - משפחת כהן ולוי";
        display: block;
        margin-top: 20pt;
        padding-top: 8pt;
        border-top: 1pt solid #ccc;
        font-size: 9pt;
        color: #666;
        text-align: center;
    }
}
