/* ======================================
   המטבח האיטלקי — Custom Styles
   ====================================== */

/* --- CSS Custom Properties --- */
:root {
    --it-primary: #C8102E;
    --it-primary-light: #E8A0A8;
    --it-primary-dark: #8B0A1F;
    --it-cream: #FAFAFA;
    --it-charcoal: #1A1A1A;
    --it-navy: #0A1628;
    --it-warm-gray: #F5F0EB;
    --it-text-secondary: #6B7280;
    --it-border: #E5E1DC;
}

/* --- Base --- */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Glassmorphism --- */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-search {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.glass-search:focus-within {
    border-color: var(--it-primary);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* --- Header --- */
.header-glass {
    background: rgba(250, 250, 250, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--it-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* --- Home Hero --- */
.home-hero {
    min-height: 50vh;
    background: url('../images/Italian_Cuisine_Hero_Background.jpg') center / cover no-repeat;
}

.home-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(10, 22, 40, 0.75) 0%, rgba(10, 22, 40, 0.6) 100%);
}

/* --- Card Lift Effect --- */
.card-lift {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08),
                0 8px 16px rgba(0, 0, 0, 0.04);
}

/* --- Recipe Card --- */
.recipe-card {
    border: 1px solid var(--it-border);
    border-radius: 12px;
    overflow: hidden;
    background: white;
    cursor: pointer;
}

.recipe-card-image-wrapper {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--it-warm-gray) 0%, #e8e4df 100%);
    position: relative;
    overflow: hidden;
}

.recipe-card-image {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    width: 100%;
    transition: transform 0.6s ease-out, opacity 0.4s ease;
    opacity: 0;
}

.recipe-card-image.loaded { opacity: 1; }

.img-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--it-primary);
    opacity: 0.3;
    font-size: 2.5rem;
}

.recipe-card:hover .recipe-card-image { transform: scale(1.05); }

/* --- Difficulty Badges --- */
.badge-easy { background-color: #dcfce7; color: #16a34a; }
.badge-medium { background-color: #fef3c7; color: #d97706; }
.badge-hard { background-color: #fee2e2; color: #dc2626; }

/* --- Category Pills --- */
.category-pill {
    white-space: nowrap;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--it-border);
    background: white;
    color: var(--it-charcoal);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.category-pill:hover {
    border-color: var(--it-primary);
    color: var(--it-primary);
}

.category-pill.active {
    background: var(--it-primary);
    color: white;
    border-color: var(--it-primary);
}

/* --- Recipe Detail Hero --- */
.recipe-hero {
    position: relative;
    min-height: 50vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.recipe-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 22, 40, 0.85) 0%, rgba(10, 22, 40, 0.3) 50%, transparent 100%);
}

@media (min-width: 1024px) {
    .recipe-hero { min-height: 40vh; }
}

/* --- Step Number Circle --- */
.step-number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: var(--it-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

/* --- Meta Item --- */
.meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0 1rem;
}

.meta-item:not(:last-child) {
    border-left: 1px solid var(--it-border);
}

/* --- Ingredient Row --- */
.ingredient-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(229, 225, 220, 0.5);
    line-height: 1.75;
}

.ingredient-row:last-child { border-bottom: none; }

/* --- Loading Spinner --- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--it-border);
    border-top-color: var(--it-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- View Transition --- */
.view-fade-in { animation: fadeIn 0.3s ease forwards; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Scrollbar Hide --- */
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* --- Tag Pill --- */
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: var(--it-warm-gray);
    color: var(--it-text-secondary);
    font-size: 0.8125rem;
}

/* --- Text Clamp --- */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- WhatsApp Share Button --- */
.whatsapp-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    background: #25D366;
    color: white;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.whatsapp-share-btn:hover { background: #1DA851; }
.whatsapp-share-btn i { font-size: 1.25rem; }

/* --- Gold Border (RTL: right border, LTR: left border) --- */
html[dir="rtl"] .primary-border-right {
    border-right: 3px solid var(--it-primary);
    border-left: none;
}

html[dir="ltr"] .primary-border-right {
    border-left: 3px solid var(--it-primary);
    border-right: none;
}

/* --- Language-Specific Fonts --- */
html[lang="he"] body {
    font-family: 'Heebo', sans-serif;
}

html[lang="en"] body {
    font-family: 'Inter', sans-serif;
}

html[lang="en"] .font-playfair {
    font-family: 'Playfair Display', serif;
}

/* --- Language Switcher --- */
.language-switcher {
    display: flex;
    gap: 0;
    border: 2px solid var(--it-primary);
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.lang-btn {
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--it-primary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.lang-btn:hover {
    background: rgba(200, 16, 46, 0.1);
}

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

.lang-btn:not(:last-child) {
    border-right: 1px solid rgba(200, 16, 46, 0.3);
}

/* --- RTL/LTR Meta Item Borders --- */
html[dir="rtl"] .meta-item:not(:last-child) {
    border-left: 1px solid var(--it-border);
    border-right: none;
}

html[dir="ltr"] .meta-item:not(:last-child) {
    border-right: 1px solid var(--it-border);
    border-left: none;
}

/* --- Responsive adjustments for language switcher --- */
@media (max-width: 640px) {
    .lang-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}
