/* =====================================================
   LEZZET DURAĞI — STİL DOSYASI
===================================================== */

:root {
    --bg: #faf9f5;
    --card: #ffffff;
    --surface: #ffffff;
    --text: #2c2a29;
    --muted: #6f6963;
    --accent: #8c7a6b;
    --accent-strong: #75655a;
    --accent-light: #f0ebe5;
    --border: #e8e5dc;
    --shadow: 0 8px 30px rgba(0, 0, 0, .06);
    --radius: 16px;
    --focus: 0 0 0 3px rgba(140, 122, 107, .35);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1c1a19;
        --card: #262321;
        --surface: #2c2927;
        --text: #f1ede8;
        --muted: #b3aba3;
        --accent: #c4ae9b;
        --accent-strong: #d6c2b0;
        --accent-light: #3a3430;
        --border: #3a3633;
        --shadow: 0 8px 30px rgba(0, 0, 0, .35);
        color-scheme: dark;
    }
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    /* Ana ekrandan açıldığında çentik / alt çubuk payı */
    padding:
        env(safe-area-inset-top)
        env(safe-area-inset-right)
        env(safe-area-inset-bottom)
        env(safe-area-inset-left);
}

button,
input {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

.container {
    width: min(1100px, 92%);
    margin: auto;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    z-index: 100;
    text-decoration: none;
}

.skip-link:focus {
    top: 16px;
}


/* ÜST MENÜ */

.top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding-top: 20px;
}

.lang-btn,
.install-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 9px 15px;
    border-radius: 8px;
    transition: border-color .2s, background-color .2s, transform .2s;
}

.lang-btn:hover {
    border-color: var(--accent);
}

.install-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 500;
}

.install-btn:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

@media (prefers-color-scheme: dark) {
    .install-btn {
        color: #1c1a19;
    }
}


/* BAŞLIK */

.site-header {
    text-align: center;
    padding: 40px 0 35px;
    border-bottom: 1px solid var(--border);
}

.site-header h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 600;
    letter-spacing: -1.5px;
    line-height: 1.15;
}

.site-header p {
    margin-top: 10px;
    color: var(--muted);
}


/* ARAMA */

.search-area {
    padding: 30px 0 20px;
}

.search-box {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;          /* 16px: iOS'ta otomatik yakınlaştırmayı önler */
    background: var(--surface);
    transition: border-color .2s;
}

.search-box:focus {
    border-color: var(--accent);
}

.search-box::placeholder {
    color: var(--muted);
}


/* KATEGORİLER */

.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 8px 13px;
    border-radius: 999px;
    font-size: .9rem;
    transition: background-color .2s, border-color .2s, color .2s;
}

.filter-count {
    font-size: .72rem;
    color: var(--muted);
    background: var(--accent-light);
    border-radius: 999px;
    padding: 0 7px;
    line-height: 1.6;
}

.filter-btn:hover {
    border-color: var(--accent);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.filter-btn.active .filter-count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

@media (prefers-color-scheme: dark) {
    .filter-btn.active,
    .filter-btn.active .filter-count {
        color: #1c1a19;
    }
}

.result-count {
    color: var(--muted);
    font-size: .85rem;
    margin-bottom: 16px;
}


/* TARİF KARTLARI */

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    align-items: start;
    padding-bottom: 50px;
}

.recipe-grid:focus {
    outline: none;
}

.recipe-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.recipe-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.recipe-card.active {
    border-color: var(--accent);
    transform: none;
}

.recipe-toggle {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 22px 22px 18px;
    border-radius: var(--radius);
}

.recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 15px;
}

.recipe-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
}

.recipe-time {
    color: var(--accent);
    font-size: .85rem;
    white-space: nowrap;
}

.recipe-meta {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent-strong);
    padding: 3px 9px;
    border-radius: 6px;
    font-size: .75rem;
}

.recipe-desc {
    margin-top: 12px;
    color: var(--muted);
    font-size: .9rem;
}

.recipe-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.code {
    color: var(--muted);
    font-size: .75rem;
    opacity: .8;
}

.chevron {
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(45deg);
    transition: transform .2s;
    margin-right: 4px;
}

.recipe-card.active .chevron {
    transform: rotate(-135deg);
}

.recipe-details {
    margin: 0 22px 22px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
}

.recipe-details h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 14px 0 7px;
}

.recipe-details ul,
.recipe-details ol {
    padding-left: 20px;
}

.recipe-details li {
    margin-bottom: 6px;
}

.recipe-details li::marker {
    color: var(--accent);
}

.no-result {
    text-align: center;
    padding: 50px 0;
    color: var(--muted);
}


/* ALT BİLGİ */

.site-footer {
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 30px 0;
    color: var(--muted);
    font-size: .85rem;
}


/* BİLDİRİM KUTUSU */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(20px + env(safe-area-inset-bottom));
    transform: translate(-50%, 20px);
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    max-width: calc(100% - 32px);
    background: #2c2a29;
    color: #faf9f5;
    padding: 12px 12px 12px 18px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    font-size: .9rem;
    z-index: 50;
    transition: opacity .25s, transform .25s;
}

.toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast-action {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 6px 12px;
    font-weight: 600;
    white-space: nowrap;
}

.toast-close {
    background: none;
    border: 0;
    color: inherit;
    font-size: 1.3rem;
    line-height: 1;
    padding: 4px 6px;
    opacity: .7;
}

.toast-close:hover {
    opacity: 1;
}

@media (prefers-color-scheme: dark) {
    .toast {
        background: #f1ede8;
        color: #1c1a19;
    }
}


/* ÇEVRİMDIŞI GÖSTERGESİ */

body.is-offline .site-header::after {
    content: "● offline";
    display: inline-block;
    margin-top: 12px;
    font-size: .75rem;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 10px;
}

html[lang="tr"] body.is-offline .site-header::after {
    content: "● çevrimdışı";
}


/* TELEFON */

@media (max-width: 700px) {

    .site-header {
        padding-top: 28px;
    }

    .recipe-grid {
        grid-template-columns: 1fr;
    }

    .recipe-header {
        flex-direction: column;
        gap: 2px;
    }

    .recipe-card:hover {
        transform: none;
        box-shadow: none;
    }
}

@media (max-width: 420px) {

    .top-bar {
        justify-content: stretch;
    }

    .top-bar button {
        flex: 1;
    }
}


/* HAREKET AZALTMA TERCİHİ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}
