/* --- 1. FONTS & VARIABLES --- */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@500;600;700;800&display=swap');

:root {
    --bg: #171816;
    --bg2: #1d1e1b;
    --surface: #252622;
    --text: #f4f0e8;
    --muted: #aaa79f;
    --line: #343530;
    --accent: #f08a32;
    --accent2: #ff9d48;
    --max: 1280px;
    --radius: 12px;
}

/* --- 2. GLOBAL RESET & BASE --- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Manrope', sans-serif; /* Используем Manrope как основной */
    line-height: 1.55;
}
a { color: inherit; text-decoration: none; transition: color 0.2s; }
img { max-width: 100%; display: block; }
.container { width: min(var(--max), calc(100% - 48px)); margin: auto; }

::selection { background: var(--accent); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* --- 3. HEADER & NAV --- */
.site-header {
    height: 76px;
    position: relative;
    z-index: 30;
    background: rgba(23, 24, 22, .96);
    border-bottom: 1px solid #30312d;
    backdrop-filter: blur(5px);
}
.header-inner { height: 76px; display: flex; align-items: center; }

.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand > img.brand-logo { width: 260px; height: auto; display: block; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 34px; }
.nav > a {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -.2px;
    color: #b9b6ae;
    padding: 29px 0;
    position: relative;
}
.nav > a:hover, .nav > a.active { color: var(--text); }
.nav > a.active:after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent);
}

.header-search {
    display: flex; width: 215px; height: 38px; background: #292a27;
    border-radius: 20px; margin-left: 20px; overflow: hidden; transition: all 0.3s;
}
.header-search:focus-within { box-shadow: 0 0 0 1px var(--accent); background: #2f302c; }
.header-search input {
    width: 100%; border: 0; outline: 0; background: transparent;
    color: var(--text); padding: 0 13px; font: 11px 'Manrope';
}
.header-search input::placeholder { color: #85837d; }
.header-search button {
    border: 0; background: transparent; color: var(--accent);
    width: 40px; display: grid; place-items: center; cursor: pointer;
}
.header-search button svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; }

.menu-toggle { display: none; margin-left: auto; background: none; border: 0; color: var(--text); font-size: 24px; cursor: pointer; }

/* --- 4. HERO SECTION (HOME) --- */
.home-hero {
    position: relative; min-height: 600px; border-bottom: 1px solid var(--line);
    overflow: hidden; display: flex; align-items: center;
}
.hero-media { position: absolute; inset: 0; z-index: 1; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; }
.hero-shade {
    position: absolute; inset: 0; z-index: 2;
    background: linear-gradient(90deg, rgba(23,24,22,0.95) 0%, rgba(23,24,22,0.8) 40%, rgba(23,24,22,0.2) 75%, rgba(23,24,22,0) 100%),
                linear-gradient(0deg, rgba(23,24,22,0.8) 0%, rgba(23,24,22,0) 40%);
}
.hero-inner {
    position: relative; z-index: 3; width: 100%;
    width: min(var(--max), calc(100% - 48px)); margin: 0 auto;
    padding: 60px 0; height: auto; min-height: 600px;
    display: flex; align-items: center;
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hero-copy { width: 55%; max-width: 650px; }
.hero-kicker { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; font-weight: 700; color: var(--accent); margin-bottom: 14px; display: block; }
.hero-copy h1 {
    font-family: 'Sora', 'Manrope', sans-serif; font-weight: 700;
    font-size: clamp(47px, 4.7vw, 72px); line-height: 1.02; letter-spacing: -2.8px; margin: 0 0 24px;
}
.hero-copy h1 span { color: var(--accent); }
.hero-copy p { font-size: 17px; line-height: 1.6; color: #cfcac2; max-width: 430px; margin: 0 0 32px; }

.button { display: inline-flex; align-items: center; gap: 10px; padding: 13px 24px; border-radius: 7px; font-size: 13px; font-weight: 700; transition: all 0.3s; }
.button-primary { background: var(--accent); color: #181916; box-shadow: 0 4px 15px rgba(240, 138, 50, 0.15); }
.button-primary:hover { background: var(--accent2); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(240, 138, 50, 0.35); }

.hero-feature {
    position: absolute; right: 0; bottom: 40px;
    background: rgba(23, 24, 22, 0.85); backdrop-filter: blur(8px);
    padding: 20px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1);
    max-width: 350px; text-shadow: none; z-index: 4; transition: transform 0.3s ease, background 0.3s ease;
}
.hero-feature:hover { transform: translateY(-5px); background: rgba(23, 24, 22, 0.95); border-color: var(--accent); }
.hero-feature span { font-size: 10px; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; display: block; }
.hero-feature strong { font-size: 18px; line-height: 1.3; color: #fff; margin-bottom: 10px; display: block; font-family: 'Manrope', sans-serif; }
.hero-feature small { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }

.hero-controls { position: absolute; right: 0; bottom: 28px; display: flex; gap: 7px; align-items: center; z-index: 5; }
.hero-controls i { width: 23px; height: 3px; background: var(--accent); margin-right: auto; }
.hero-controls button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.09); color: #eee; font-size: 20px; cursor: pointer; transition: background 0.2s; }
.hero-controls button:hover { background: var(--accent); color: #fff; }

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

/* --- 5. SECTIONS & GRIDS --- */
.section { padding: 64px 0; }
.category-section { background: #1b1c19; border-bottom: 1px solid #292a27; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 24px; }
.section-head h2 { font-family: 'Sora', sans-serif; font-weight: 600; font-size: clamp(29px, 3vw, 40px); line-height: 1.05; letter-spacing: -1.7px; margin: 7px 0 0; }
.eyebrow { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; font-weight: 700; color: var(--accent); display: block; margin-bottom: 8px; }
.arrow-link { font-size: 11px; color: var(--accent); white-space: nowrap; font-weight: 600; }
.arrow-link span { font-size: 16px; margin-left: 7px; }

/* Categories */
.category-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.category-card { position: relative; height: 150px; overflow: hidden; border: 1px solid #363732; border-radius: 11px; background: #242521; transition: border-color 0.3s; }
.category-card:hover { border-color: var(--accent); }
.category-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); }
.category-card:hover img { transform: scale(1.06); }
.category-overlay { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(9,10,9,0.95) 0%, rgba(9,10,9,0.5) 45%, rgba(9,10,9,0) 85%); }
.category-card-body { position: absolute; left: 16px; bottom: 14px; z-index: 2; }
.category-card-body strong { display: block; font: 700 16px/1.15 'Manrope', sans-serif; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.category-card-body span { font-size: 10px; color: #aaa79f; opacity: 0.9; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.category-arrow { position: absolute; right: 12px; bottom: 12px; z-index: 2; font-size: 17px; color: #e9e5dc; }
.category-grid-large { grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* Recipes Grid */
.recipes-preview { background: var(--bg); }
.recipe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.recipe-card { background: #20211e; border: 1px solid #33342f; border-radius: 10px; overflow: hidden; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.recipe-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 12px 30px rgba(0,0,0,0.3); }
.card-image { position: relative; aspect-ratio: 1.8; overflow: hidden; background: #242521; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s, filter 0.3s; }
.recipe-card:hover .card-image img { transform: scale(1.035); filter: brightness(1.08); }
.recipe-tag { position: absolute; top: 12px; left: 12px; padding: 4px 8px; border: 1px solid var(--accent); border-radius: 5px; color: var(--accent); font-size: 9px; background: rgba(17,18,16,.72); font-weight: 600; }
.card-arrow { position: absolute; right: 12px; bottom: 12px; width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; background: rgba(17,18,16,.72); color: #eee; transition: background 0.2s; }
.recipe-card:hover .card-arrow { background: var(--accent); color: #fff; }
.card-body { padding: 15px 16px 17px; }
.card-body h3 { font: 700 18px/1.2 'Manrope', sans-serif; margin: 0 0 13px; }
.card-meta { display: flex; gap: 18px; color: #8f8c85; font-size: 10px; }

/* --- 6. PAGE INTRO (ABOUT, CATEGORIES LIST) --- */
.page-intro { padding: 65px 0 50px; background: var(--bg2); border-bottom: 1px solid var(--line); }
.page-intro h1 { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: clamp(46px, 6vw, 76px); line-height: 1.04; letter-spacing: -3px; margin: 12px 0; }
.page-intro h1 em { display: block; font-style: normal; color: var(--text); margin-top: 4px; }
.page-intro p { color: var(--muted); font-size: 1.1rem; max-width: 800px; }

/* About Page Specifics */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin: 40px 0 20px; }
.about-card { background: var(--surface); border: 1px solid var(--line); padding: 24px; border-radius: var(--radius); transition: transform 0.2s, border-color 0.2s; }
.about-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.about-card h3 { font-family: 'Manrope', sans-serif; font-size: 18px; margin: 0 0 10px 0; color: var(--text); display: flex; align-items: center; gap: 10px; }
.about-card p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }
.about-contact-section { margin-top: 20px; padding-bottom: 80px; }
.contact-box { background: linear-gradient(145deg, var(--surface), var(--bg2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 20px; text-align: center; max-width: 700px; margin: 0 auto; }
.contact-box h2 { font-family: 'Sora', sans-serif; font-size: 24px; margin: 0 0 15px 0; color: var(--text); }
.contact-box p { color: var(--muted); margin-bottom: 25px; }
.btn-email { display: inline-flex; align-items: center; gap: 10px; background: var(--accent); color: #181916; padding: 12px 24px; border-radius: 7px; font-weight: 700; font-size: 14px; transition: background 0.2s; text-decoration: none; }
.btn-email:hover { background: var(--accent2); }
.btn-email svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.about-intro { padding-bottom: 30px !important; }
.about-content { padding-top: 10px !important; }

/* --- 7. RECIPE SINGLE PAGE --- */
.recipe-container { max-width: 1140px; }
.recipe-top { padding: 55px 0 40px; }
.recipe-top h1 { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: clamp(46px, 6vw, 76px); line-height: 1; letter-spacing: -3px; margin: 12px 0 20px; max-width: 100%; }
.lead { font-size: 19px; color: #d0ccc4; max-width: 850px; line-height: 1.6; }
.back { color: var(--muted); font-size: 12px; display: inline-block; margin-bottom: 15px; opacity: 0.7; transition: opacity 0.2s; }
.back:hover { opacity: 1; color: var(--accent); }
.recipe-cover { margin: 12px 0 55px; border-radius: 12px; overflow: hidden; border: 1px solid #30312d; }
.recipe-cover img { width: 100%; max-height: 700px; object-fit: cover; }
.recipe-layout { display: grid; grid-template-columns: 270px 1fr; gap: 60px; }
.ingredients { position: sticky; top: 95px; align-self: start; background: var(--surface); border: 1px solid #343530; border-radius: 10px; padding: 21px; }
.block-label { font-size: 10px; letter-spacing: 1.7px; text-transform: uppercase; color: var(--accent); padding-bottom: 11px; border-bottom: 1px solid var(--line); margin-bottom: 15px; font-weight: 700; }
.ingredients ul { list-style: none; padding: 0; margin: 0; }
.ingredients li { padding: 9px 0; border-bottom: 1px solid #343530; font-size: 14px; }
.step { display: grid; grid-template-columns: 42px 1fr; gap: 15px; padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.step-num { color: var(--accent); font-weight: 700; }
.step h2 { font: 700 23px/1.2 'Manrope', sans-serif; margin: 0 0 8px; }
.step p { color: #cbc7bf; font-size: 16px; margin: 0 0 9px; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 20px; }
.gallery-grid a { overflow: hidden; border-radius: 10px; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.gallery-grid a:hover img { transform: scale(1.03); }
.recipe-gallery, .serving, .recipe-video { margin-top: 60px; }
.serving { background: #6e765b; padding: 30px; border-radius: 10px; }
.serving p { font: 600 23px/1.4 'Manrope', sans-serif; margin: 0; color: #fff; }
.recipe-video video { width: 100%; border-radius: 10px; }

/* Search Page */
.search-form { display: flex; max-width: 760px; margin: 28px 0; }
.search-form input { flex: 1; background: var(--surface); border: 1px solid var(--line); color: var(--text); padding: 15px; border-radius: 7px 0 0 7px; outline: none; transition: border-color 0.2s; }
.search-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.search-form button { background: var(--accent); border: 0; padding: 0 22px; border-radius: 0 7px 7px 0; color: #181916; font-weight: 700; cursor: pointer; }
.empty-inline { padding: 60px 0; color: var(--muted); }

/* --- 8. FOOTER --- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: #85827c; font-size: 11px; position: relative; }
.site-footer::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 100px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0.5; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 9px; color: var(--text); letter-spacing: 1px; }
.footer-brand img { width: 150px; height: auto; }

/* --- 9. RESPONSIVE --- */
@media(max-width: 1100px) {
    .brand > img.brand-logo { width: 230px; }
    .nav { gap: 20px; }
    .nav > a { font-size: 13px; }
    .header-search { width: 180px; }
}

@media(max-width: 1000px) {
    .brand-tagline { display: none; }
    .hero-media img { width: 72%; } /* Fallback if JS fails or old layout */
    .hero-copy { width: 65%; }
    .category-grid { grid-template-columns: repeat(3, 1fr); }
    .recipe-layout { grid-template-columns: 1fr; }
    .ingredients { position: static; margin-bottom: 30px; }
    .category-grid-large { grid-template-columns: repeat(2, 1fr); }
}

@media(max-width: 760px) {
    .container { width: calc(100% - 30px); }
    .site-header, .header-inner { height: 68px; }
    
    /* Mobile Nav */
    .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; padding: 5px 15px 15px; background: #171816; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; gap: 0; }
    .nav.open { display: flex; }
    .nav > a { padding: 13px 5px; border-bottom: 1px solid var(--line); }
    .nav > a.active:after { display: none; }
    .header-search { width: 100%; margin: 8px 0 0; }
    .menu-toggle { display: block; }
    
    /* Mobile Hero */
    .home-hero { min-height: auto; flex-direction: column; justify-content: flex-end; }
    .hero-media img { position: relative; height: 300px; width: 100%; }
    .hero-shade { background: linear-gradient(0deg, #171816 10%, rgba(23,24,22,0.2) 100%); }
    .hero-inner { min-height: auto; padding: 30px 0 50px; width: calc(100% - 30px); }
    .hero-copy { width: 100%; }
    .hero-copy h1 { font-size: 40px; letter-spacing: -2px; }
    .hero-copy p { font-size: 15px; }
    .hero-feature { position: relative; right: auto; bottom: auto; margin-top: 25px; width: 100%; max-width: 100%; background: var(--surface); }
    .hero-controls { display: none; }
    
    /* Mobile Grids */
    .section { padding: 52px 0; }
    .section-head { align-items: flex-start; flex-direction: column; gap: 10px; }
    .category-grid, .category-grid-large { grid-template-columns: 1fr 1fr; }
    .category-card { height: 145px; }
    .recipe-grid { grid-template-columns: 1fr; }
    .card-image { aspect-ratio: 1.55; }
    
    /* Mobile Typography */
    .page-intro { padding: 52px 0 42px; }
    .recipe-top { padding-top: 42px; }
    .recipe-top h1 { font-size: 38px; }
    .lead { font-size: 16px; }
    .gallery-grid { grid-template-columns: 1fr; }
    
    .footer-inner { align-items: flex-start; flex-direction: column; gap: 10px; }
    .brand > img.brand-logo { width: 205px; }
}

@media(max-width: 500px) {
    .brand > img.brand-logo { width: 190px; }
    .category-grid, .category-grid-large { grid-template-columns: 1fr; }
    .category-card { height: 180px; }
    .hero-copy h1 { font-size: 36px; }
    .hero-copy p { max-width: 330px; }
}
/* --- FIX MOBILE HERO & CONTROLS --- */

@media(max-width: 760px) {
    /* Контейнер героя на мобильном */
    .hero-inner {
        flex-direction: column;
        align-items: flex-start; /* Выравниваем по левому краю */
        padding-top: 20px;
        padding-bottom: 40px;
    }

    /* Плашка с рецептом на мобильном: становится в поток под текст */
    .hero-feature {
        position: relative !important; /* Отменяем абсолют */
        right: auto !important;
        bottom: auto !important;
        margin-top: 25px;
        width: 100%;
        max-width: 100%;
        background: var(--surface); /* Сплошной фон, чтобы читалось */
        backdrop-filter: none;
    }

    /* Стрелки на мобильном: переносим под плашку или скрываем, если мешают */
    .hero-controls {
        position: relative;
        right: auto;
        bottom: auto;
        margin-top: 20px;
        width: 100%;
        justify-content: flex-end; /* Стрелки справа внизу */
    }
    
    /* Убираем линию индикатора на мобильном для чистоты */
    .hero-controls i { display: none; }
}

/* Стилизация активных стрелок */
.hero-controls button:hover {
    background: var(--accent);
    color: #fff;
}