@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Newsreader:opsz,wght@6..72,500;6..72,650;6..72,800&display=swap");

:root {
    --ink: #151713;
    --muted: #64685f;
    --soft: #f5faf7;
    --surface: #ffffff;
    --surface-2: #f8fbff;
    --line: #dfe8e2;
    --leaf: #2f7d58;
    --leaf-deep: #20583d;
    --tomato: #d84a33;
    --saffron: #e9b949;
    --shadow: 0 18px 48px rgba(21, 23, 19, 0.1);
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: linear-gradient(180deg, var(--surface) 0%, var(--soft) 54%, var(--surface-2) 100%);
    color: var(--ink);
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

main {
    padding-bottom: calc(2.25rem + env(safe-area-inset-bottom));
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

h1,
h2,
h3,
.recipe-title,
.card-title {
    font-family: "Newsreader", Georgia, serif;
    font-weight: 650;
}

.app-nav,
.top-nav,
.navbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom: 1px solid var(--line) !important;
    box-shadow: 0 10px 28px rgba(21, 23, 19, 0.06) !important;
    backdrop-filter: blur(18px);
    transition: transform 180ms ease;
}

.nav-shell {
    min-height: 72px;
    display: grid;
    grid-template-columns: auto minmax(280px, 520px) auto;
    align-items: center;
    gap: 1rem;
}

.recipe-detail-page .nav-shell {
    grid-template-columns: auto auto;
    justify-content: space-between;
}

.brand-link,
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--ink) !important;
    text-decoration: none;
    font-size: 1.02rem;
    font-weight: 800;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(47, 125, 88, 0.22);
    border-radius: 8px;
    background: var(--soft);
    color: var(--leaf);
}

.navbar-brand i,
.brand-link i {
    color: var(--leaf) !important;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 520px;
    justify-self: end;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 0.25rem;
    padding: 0.2rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
}

.language-switcher button {
    appearance: none;
    -webkit-appearance: none;
    min-width: 38px;
    min-height: 34px;
    padding: 0;
    border: 0 !important;
    border-radius: 6px !important;
    background: transparent !important;
    color: var(--muted) !important;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    transition: background 160ms ease, color 160ms ease;
}

.language-switcher button.active {
    background: var(--leaf) !important;
    color: white !important;
}

.language-switcher button:hover {
    background: rgba(47, 125, 88, 0.12) !important;
    color: var(--leaf-deep) !important;
}

.language-switcher button.active:hover {
    background: var(--leaf-deep) !important;
    color: white !important;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    color: var(--leaf);
    transform: translateY(-50%);
    pointer-events: none;
}

.search-input,
.filter-select,
.form-control {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    color: var(--ink) !important;
    font-family: "Inter", "Segoe UI", Arial, sans-serif !important;
    font-size: 0.98rem;
}

.search-input {
    padding: 0.78rem 1rem 0.78rem 2.75rem;
}

.filter-select {
    appearance: none;
    padding: 0.84rem 2.4rem 0.84rem 1rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--leaf) 50%), linear-gradient(135deg, var(--leaf) 50%, transparent 50%);
    background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.search-input:focus,
.filter-select:focus,
.form-control:focus {
    outline: none;
    border-color: rgba(47, 125, 88, 0.62) !important;
    box-shadow: 0 0 0 4px rgba(47, 125, 88, 0.13) !important;
}

.hero-section {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: end;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.78) 43%, rgba(255, 255, 255, 0.1) 100%),
        url("../images/hero-pickles.jpg") center/cover;
    border-bottom: 1px solid var(--line);
}

.hero-media {
    display: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
    padding: 5.5rem 0 4.2rem;
}

.eyebrow {
    margin: 0 0 0.72rem;
    color: var(--tomato);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hero-section h1 {
    max-width: 720px;
    margin: 0;
    color: var(--ink);
    font-size: 5.4rem;
    line-height: 0.94;
    text-wrap: balance;
}

.hero-copy {
    max-width: 560px;
    margin: 1.15rem 0 0;
    color: var(--muted);
    font-size: 1.06rem;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.78rem;
    margin-top: 1.55rem;
}

.hero-title {
    max-width: 720px;
    margin: 0;
    color: var(--ink);
    font-size: 5.4rem;
    line-height: 0.94;
    text-wrap: balance;
}

.hero-subtitle {
    max-width: 560px;
    margin: 1.15rem 0 0;
    color: var(--muted);
    font-size: 1.06rem;
    line-height: 1.75;
}

.btn-main,
.btn-quiet,
.filter-reset,
.back-link,
.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 46px;
    border-radius: 8px !important;
    font-weight: 800;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.btn-main {
    padding: 0.78rem 1.05rem;
    background: var(--leaf);
    border: 1px solid var(--leaf);
    color: white;
}

.btn-quiet {
    padding: 0.78rem 1.05rem;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--line);
    color: var(--ink);
}

.nav-shell > .btn-quiet {
    justify-self: end;
}

.btn-main:hover,
.btn-quiet:hover,
.filter-reset:hover,
.back-link:hover {
    transform: translateY(-2px);
}

.btn-main:hover {
    background: var(--leaf-deep);
    color: white;
    box-shadow: 0 12px 26px rgba(47, 125, 88, 0.2);
}

.filters-section {
    padding: 2rem 0 2.2rem;
    background: var(--surface) !important;
    border-bottom: 1px solid var(--line) !important;
}

.filters-head,
.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.filters-head h2,
.section-heading h2 {
    margin: 0;
    color: var(--ink);
    font-size: 3rem;
    line-height: 1;
}

.filters-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.filter-group {
    display: grid;
    gap: 0.5rem;
}

.filter-label {
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 800;
}

.filter-reset {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    padding: 0.75rem 1rem;
}

.filter-reset:hover {
    background: var(--soft);
    color: var(--leaf-deep);
}

.recipes-section {
    padding: 4rem 0 1rem;
}

.compact-hero {
    min-height: 390px;
    align-items: end;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.82) 48%, rgba(255, 255, 255, 0.18) 100%),
        url("../images/hero-pickles.jpg") center/cover;
}

.compact-hero .container {
    position: relative;
    z-index: 1;
    padding-top: 5rem;
    padding-bottom: 3.4rem;
}

.loading-note {
    margin: 0;
    color: var(--muted);
}

.recipe-card {
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    background: var(--surface) !important;
    box-shadow: 0 14px 34px rgba(21, 23, 19, 0.07) !important;
    transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.recipe-card-link {
    display: grid;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.recipe-card-image {
    width: 100%;
    height: 276px;
    display: block;
    object-fit: cover;
    background: var(--soft);
    transition: transform 240ms ease;
}

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

.recipe-card-body {
    display: grid;
    gap: 0.8rem;
    padding: 1.15rem;
}

.recipe-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recipe-card-meta span {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
    color: var(--leaf-deep);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
    padding: 0.46rem 0.58rem;
}

.recipe-card-body h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.5rem;
    line-height: 1.04;
}

.recipe-card-body p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.62;
}

.empty-state {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 2rem;
    box-shadow: 0 14px 34px rgba(21, 23, 19, 0.07);
}

.recipe-card:hover {
    transform: translateY(-5px) !important;
    border-color: rgba(47, 125, 88, 0.34) !important;
    box-shadow: var(--shadow) !important;
}

.recipe-image-container {
    position: relative;
    height: 276px;
    overflow: hidden;
    background: var(--soft);
}

.recipe-card-img,
.recipe-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-card-img {
    transition: transform 240ms ease;
}

.recipe-card:hover .recipe-card-img {
    transform: scale(1.04);
}

.recipe-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.85rem;
    background: linear-gradient(180deg, rgba(21, 23, 19, 0.36), rgba(21, 23, 19, 0.02) 48%, rgba(21, 23, 19, 0.38));
}

.recipe-category,
.meta-pill,
.category-badge,
.badge.bg-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.26) !important;
    border-radius: 8px !important;
    background: var(--tomato) !important;
    color: white !important;
    font-family: "Inter", "Segoe UI", Arial, sans-serif !important;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
    padding: 0.46rem 0.58rem;
}

.country-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 58%;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.4rem 0.52rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-body {
    display: grid;
    gap: 0.8rem;
    padding: 1.15rem !important;
}

.recipe-card-heading {
    display: grid;
    gap: 0.45rem;
}

.card-title {
    margin: 0 !important;
    color: var(--ink) !important;
    font-size: 1.5rem;
    line-height: 1.04;
}

.card-text {
    margin: 0;
    color: var(--muted) !important;
    font-size: 0.95rem;
    line-height: 1.62;
}

.recipe-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.35rem;
    color: var(--leaf-deep);
    font-size: 0.86rem;
    font-weight: 800;
}

.recipe-link-copy {
    color: var(--ink);
}

.no-results {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 3rem 1rem;
    box-shadow: 0 14px 34px rgba(21, 23, 19, 0.07);
}

.no-results-icon {
    color: var(--tomato) !important;
    font-size: 2.2rem;
    margin-bottom: 0.7rem;
}

.footer {
    margin-top: 4rem;
    padding: 2.1rem 0;
    background: var(--ink) !important;
    color: white !important;
}

.footer-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer p {
    margin: 0;
}

.footer-sub {
    color: rgba(255, 255, 255, 0.68);
    margin-top: 0.3rem !important;
}

.footer-share-link {
    flex: 0 0 auto;
    color: white !important;
}

.recipe-detail-page {
    background: linear-gradient(180deg, var(--surface) 0%, var(--soft) 100%);
}

.recipe-hero {
    position: relative;
    min-height: 540px;
    display: flex;
    align-items: end;
    overflow: hidden;
    background: var(--ink) !important;
    border-bottom: 1px solid var(--line) !important;
}

.recipe-hero .recipe-image {
    position: absolute;
    inset: 0;
    height: 100% !important;
    opacity: 0.86;
    filter: saturate(1.03);
}

.recipe-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(21, 23, 19, 0.86), rgba(21, 23, 19, 0.48) 54%, rgba(21, 23, 19, 0.08));
}

.recipe-hero-body {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 4.8rem 0 3.8rem;
    color: white;
}

.recipe-title {
    max-width: 820px;
    margin: 0 0 1rem;
    color: white !important;
    font-size: 5.2rem !important;
    line-height: 0.94 !important;
    text-wrap: balance;
}

.recipe-description {
    max-width: 680px;
    color: rgba(255, 255, 255, 0.84) !important;
    font-size: 1.06rem;
    line-height: 1.72;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 1rem 0 1.15rem;
}

.meta-pill {
    background: rgba(255, 255, 255, 0.14) !important;
    color: white !important;
}

.back-link {
    width: fit-content;
    min-height: 42px;
    margin-bottom: 1.2rem;
    padding: 0.6rem 0.78rem;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: white !important;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
}

.recipe-content-section {
    padding: 3rem 0 calc(2rem + env(safe-area-inset-bottom));
}

.recipe-layout {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.content-panel,
.recipe-container,
.recipe-section {
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 14px 34px rgba(21, 23, 19, 0.07) !important;
}

.content-panel {
    padding: 1.3rem;
}

.ingredients-panel {
    position: sticky;
    top: 96px;
}

.section-title,
.recipe-section h2 {
    margin: 0 0 1rem;
    color: var(--ink) !important;
    font-size: 1.8rem;
    line-height: 1;
}

.ingredient-list {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ingredient-list li {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    color: var(--muted);
    line-height: 1.58;
}

.ingredient-list li::before {
    content: "";
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-top: 0.52rem;
    border-radius: 8px;
    background: var(--leaf);
}

.preparation-list {
    display: grid;
    gap: 0.8rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: steps;
}

.preparation-list li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    color: var(--muted);
    line-height: 1.68;
    counter-increment: steps;
}

.preparation-list li::before {
    content: counter(steps);
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--soft);
    color: var(--leaf-deep);
    font-weight: 800;
}

.preparation-text {
    margin: 0;
    color: var(--muted) !important;
    line-height: 1.75;
    white-space: pre-wrap;
}

.recipe-container {
    max-width: 980px !important;
    padding: 2.5rem !important;
}

.recipe-section {
    padding: 1.4rem !important;
}

.recipe-img {
    border-radius: 8px !important;
    box-shadow: var(--shadow) !important;
}

button,
a,
select,
input[type="button"],
input[type="submit"] {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid rgba(47, 125, 88, 0.34);
    outline-offset: 3px;
}

@media (max-width: 991px) {
    .hero-section {
        min-height: 520px;
        background:
            linear-gradient(90deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.8) 62%, rgba(255, 255, 255, 0.26) 100%),
            url("../images/hero-pickles.jpg") center/cover;
    }

    .hero-section h1 {
        font-size: 4.3rem;
    }

    .hero-title {
        font-size: 4.3rem;
    }

    .filters-head h2,
    .section-heading h2 {
        font-size: 2.55rem;
    }

    .recipe-title {
        font-size: 4.1rem !important;
    }

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

    .ingredients-panel {
        position: static;
    }
}

@media (max-width: 768px) {
    .app-nav.nav-hidden {
        transform: translateY(-100%);
    }

    .nav-shell {
        min-height: 92px;
        grid-template-columns: 1fr auto;
        gap: 0.75rem;
        padding: 0.75rem 0;
    }

    .search-container {
        grid-column: 1 / -1;
        justify-self: stretch;
        max-width: none;
    }

    .recipe-detail-page .nav-shell {
        grid-template-columns: 1fr auto;
    }

    .hero-section {
        min-height: 480px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.72)),
            url("../images/hero-pickles.jpg") center/cover;
    }

    .hero-content {
        padding: 3.8rem 0 2.5rem;
    }

    .hero-section h1,
    .hero-title,
    .recipe-title {
        font-size: 3.05rem !important;
    }

    .hero-copy {
        font-size: 1rem;
    }

    .filters-head,
    .section-heading {
        align-items: start;
        flex-direction: column;
    }

    .filters-head h2,
    .section-heading h2 {
        font-size: 2.15rem;
    }

    .filters-container {
        grid-template-columns: 1fr;
    }

    .recipe-image-container {
        height: 238px;
    }

    .recipe-card-image {
        height: 238px;
    }

    .recipe-hero {
        min-height: 500px;
    }

    .recipe-container {
        padding: 1.25rem !important;
    }

    main {
        padding-bottom: calc(3.25rem + env(safe-area-inset-bottom));
    }

    .recipe-content-section {
        padding-bottom: calc(3rem + env(safe-area-inset-bottom));
    }

    .footer-layout {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-share-link {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
