@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700;9..144,800&display=swap');

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root,
html[data-theme='kuestenwind'] {
    --header-offset: 80px;
    --anchor-offset: var(--header-offset);
    --font-body: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-heading: 'Fraunces', Georgia, serif;

    --color-bg: #f2f8fb;
    --color-text: #1e313f;
    --color-text-muted: #496272;
    --color-header-bg: #163447;
    --color-header-fg: #f4fbff;
    --color-accent: #2e8cb8;
    --color-accent-strong: #206f95;
    --color-surface: #ffffff;
    --color-surface-soft: #e1ecf2;
    --color-border: #c4d7e2;
    --color-hero-start: #2e8cb8;
    --color-hero-end: #206f95;
    --color-button-bg: #ffffff;
    --color-button-text: #206f95;
    --color-chip-bg: #2e8cb8;
    --color-chip-text: #f4fbff;
    --color-hero-text-shadow: rgba(6, 24, 36, 0.45);
    --color-shadow-1: rgba(8, 36, 53, 0.14);
    --color-shadow-2: rgba(8, 36, 53, 0.22);
}

html[data-theme='herdfeuer'] {
    --color-bg: #1e1e2e;
    --color-text: #cdd6f4;
    --color-text-muted: #a6adc8;
    --color-header-bg: #11111b;
    --color-header-fg: #f5e0dc;
    --color-accent: #f38ba8;
    --color-accent-strong: #eba0ac;
    --color-surface: #26263a;
    --color-surface-soft: #313244;
    --color-border: #45475a;
    --color-hero-start: #45475a;
    --color-hero-end: #1e1e2e;
    --color-button-bg: #f5e0dc;
    --color-button-text: #88304d;
    --color-chip-bg: #f38ba8;
    --color-chip-text: #3a1121;
    --color-hero-text-shadow: rgba(0, 0, 0, 0.5);
    --color-shadow-1: rgba(0, 0, 0, 0.28);
    --color-shadow-2: rgba(0, 0, 0, 0.42);
}

html[data-theme='marktmorgen'] {
    --color-bg: #f9f2e8;
    --color-text: #342117;
    --color-text-muted: #6d4a37;
    --color-header-bg: #6f2f1f;
    --color-header-fg: #fff4e8;
    --color-accent: #c45a1e;
    --color-accent-strong: #943d13;
    --color-surface: #fffaf3;
    --color-surface-soft: #f1dfc8;
    --color-border: #d8b892;
    --color-hero-start: #d27a28;
    --color-hero-end: #8f3d1f;
    --color-button-bg: #fff0df;
    --color-button-text: #6f2f1f;
    --color-chip-bg: #c45a1e;
    --color-chip-text: #fff4e8;
    --color-hero-text-shadow: rgba(41, 16, 8, 0.34);
    --color-shadow-1: rgba(53, 24, 12, 0.15);
    --color-shadow-2: rgba(53, 24, 12, 0.24);
}

html[data-theme='nachtkueche'] {
    --color-bg: #272822;
    --color-text: #f8f8f2;
    --color-text-muted: #a1a18d;
    --color-header-bg: #1f201c;
    --color-header-fg: #f8f8f2;
    --color-accent: #66d9ef;
    --color-accent-strong: #a6e22e;
    --color-surface: #3b3a32;
    --color-surface-soft: #49483e;
    --color-border: #75715e;
    --color-hero-start: #3b3a32;
    --color-hero-end: #272822;
    --color-button-bg: #f8f8f2;
    --color-button-text: #49483e;
    --color-chip-bg: #66d9ef;
    --color-chip-text: #112229;
    --color-hero-text-shadow: rgba(0, 0, 0, 0.52);
    --color-shadow-1: rgba(0, 0, 0, 0.3);
    --color-shadow-2: rgba(0, 0, 0, 0.46);
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
}

/* Header and Navigation */
header {
    background-color: var(--color-header-bg);
    color: var(--color-header-fg);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px var(--color-shadow-1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    height: 50px;
    overflow: hidden;
}

.logo-img {
    height: 40px;
    width: auto;
    max-width: 60px;
    max-height: 40px;
    object-fit: contain;
    display: block;
}

.logo h1 {
    font-size: 1.8rem;
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: 0.03em;
    margin: 0;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--color-header-fg);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--color-accent);
}

.nav-separator {
    color: color-mix(in srgb, var(--color-header-fg) 55%, transparent);
    font-size: 0.85rem;
    user-select: none;
}

.theme-nav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.theme-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
    background: transparent;
    color: var(--color-header-fg);
    font: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.theme-trigger:hover,
.theme-trigger:focus-visible {
    color: var(--color-accent);
    outline: none;
}

.theme-trigger-icon {
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 999px;
    border: 1.5px solid currentColor;
    position: relative;
    display: inline-block;
    opacity: 0.95;
}

.theme-trigger-icon::after {
    content: "";
    position: absolute;
    inset: 0.16rem;
    border-radius: inherit;
    background: currentColor;
    opacity: 0.8;
}

.theme-current {
    font-size: 0.88rem;
    font-weight: 600;
}

.theme-trigger-caret {
    font-size: 0.72rem;
    opacity: 0.8;
}

.theme-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 0.65rem);
    min-width: 210px;
    display: none;
    background-color: color-mix(in srgb, var(--color-header-bg) 94%, var(--color-surface));
    border: 1px solid color-mix(in srgb, var(--color-header-fg) 10%, transparent);
    border-radius: 10px;
    box-shadow: 0 12px 24px var(--color-shadow-2);
    padding: 0.3rem;
    z-index: 20;
}

.theme-menu.is-open {
    display: block;
}

.theme-option {
    width: 100%;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--color-header-fg);
    padding: 0.45rem 0.6rem;
    text-align: left;
    font-size: 0.88rem;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.theme-option:hover {
    background-color: color-mix(in srgb, var(--color-header-fg) 8%, transparent);
}

.theme-option.is-active {
    background-color: color-mix(in srgb, var(--color-accent) 18%, transparent);
    color: var(--color-accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent) 30%, transparent) inset;
}

.theme-nav-item-footer .theme-menu {
    top: auto;
    bottom: calc(100% + 0.65rem);
}

/* Main content */
main {
    margin-top: 0;
}

/* Hero section */
.hero {
    background-image:
        linear-gradient(135deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)),
        linear-gradient(135deg, var(--color-hero-start), var(--color-hero-end)),
        url('logo.png');
    background-size: cover, cover, contain;
    background-position: center, center, center;
    background-repeat: no-repeat;
    color: var(--color-header-fg);
    padding: calc(4rem + var(--header-offset)) 2rem 2.5rem;
    text-align: center;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#home,
#recipes,
#contact {
    scroll-margin-top: var(--anchor-offset);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 4px var(--color-hero-text-shadow);
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-content h2 {
    font-size: 3.35rem;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    font-weight: 800;
    text-transform: none;
    letter-spacing: 0.01em;
    line-height: 1.02;
    text-wrap: balance;
}

.hero-content p {
    font-size: 1.2rem;
    margin: 0 auto 2rem;
    max-width: 600px;
    text-wrap: pretty;
}

.cta-button {
    display: inline-block;
    background-color: var(--color-button-bg);
    color: var(--color-button-text);
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--color-shadow-2);
}

/* homework section - DEPRECATED, keeping for reference */
.homework-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.homework-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--color-text);
}

.homework-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.homework-card {
    background: var(--color-surface);
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--color-shadow-1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.homework-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--color-shadow-2);
}

.homework-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.homework-card h3 {
    padding: 1rem;
    color: var(--color-text);
    font-size: 1.3rem;
}

.homework-card p {
    padding: 0 1rem;
    color: var(--color-text-muted);
}

.cook-time {
    display: inline-block;
    background-color: var(--color-chip-bg);
    color: var(--color-chip-text);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background-color: var(--color-header-bg);
    color: var(--color-header-fg);
    padding: 2rem;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-top {
    width: 100%;
}

.footer-content h3 {
    margin-bottom: 1rem;
    color: var(--color-accent);
}

.theme-nav-item-footer {
    position: relative;
    display: none;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

/* Main recipe list section */
.recipes-section {
    padding: 2rem 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.recipes-section h2 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text);
}

.recipe-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.4rem;
}

.filter-selection-count {
    color: var(--color-text);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.filter-selection-count.is-visible {
    opacity: 1;
}

.tag-filter {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

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

.tag-filter.is-active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-header-fg);
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 320px));
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.recipes-grid > .recipe-card-link,
.recipes-grid > .recipe-card {
    width: 100%;
    display: flex;
}

.recipe-card-link {
    text-decoration: none !important;
    color: inherit !important;
    display: flex;
    min-width: 0;
}

.recipe-card-link.is-hidden {
    display: none;
}

.recipe-card.is-hidden {
    display: none;
}

.recipe-card-link:visited,
.recipe-card-link:link,
.recipe-card-link:hover,
.recipe-card-link:active {
    text-decoration: none !important;
    color: inherit !important;
}

.recipe-card-link h3,
.recipe-card-link p,
.recipe-card-link span {
    color: inherit !important;
    text-decoration: none !important;
}

.recipe-card-link h3 {
    color: var(--color-text) !important;
}

.recipe-card-link p {
    color: var(--color-text-muted) !important;
}

.recipe-card-link .cook-time {
    background-color: var(--color-chip-bg) !important;
    color: var(--color-chip-text) !important;
    align-self: flex-start;
}

.recipe-card {
    --image-pan-x: 0px;
    --image-pan-y: 0px;
    --image-zoom: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    min-width: 0;
    background: var(--color-surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--color-shadow-1);
    border: 1px solid var(--color-border);
    transform: none;
    transform-origin: center;
    transition: box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    cursor: pointer;
}

.recipe-card-link:hover .recipe-card,
.recipe-card:not(.coming-soon):hover {
    box-shadow: 0 18px 42px var(--color-shadow-2);
}

.recipe-image {
    height: 220px;
    overflow: hidden;
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate3d(var(--image-pan-x), var(--image-pan-y), 0) scale(var(--image-zoom));
    transform-origin: center;
    will-change: transform;
    transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.recipe-card-link:hover .recipe-image img,
.recipe-card:not(.coming-soon):hover .recipe-image img {
    --image-zoom: 1.12;
    transition-duration: 0.35s;
    transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.recipe-card.is-parallax-active .recipe-image img {
    transition-duration: 0.18s;
}

.recipe-card .recipe-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.5rem;
    min-width: 0;
}

.recipe-card .recipe-content h3 {
    color: var(--color-text);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: 0.01em;
    text-transform: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.recipe-card .recipe-content p {
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.recipe-tags {
    margin-top: auto;
    padding-top: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--color-accent) 35%, var(--color-border));
    background: color-mix(in srgb, var(--color-accent) 16%, var(--color-surface));
    color: var(--color-text);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.35rem 0.6rem;
}

.recipe-link {
    display: inline-flex;
    align-items: center;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    margin-top: 1rem;
    transition: color 0.2s ease;
}

.recipe-link:hover {
    color: var(--color-accent-strong);
}

.coming-soon {
    opacity: 1;
    cursor: default;
}

.coming-soon .recipe-content {
    text-align: center;
}

.coming-soon .recipe-content h3 {
    color: var(--color-text);
}

.coming-soon .recipe-content p {
    color: var(--color-text-muted);
}

.coming-soon .cook-time {
    background-color: var(--color-chip-bg);
    color: var(--color-chip-text);
    border: 1px solid var(--color-border);
    align-self: center;
    width: fit-content;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px var(--color-shadow-1);
}

.recipe-card.coming-soon:hover {
    transform: none;
    box-shadow: 0 4px 20px var(--color-shadow-1);
}

/* Recipe Page Styles */
.recipe-page {
    max-width: 800px;
    margin: 0 auto;
    padding: calc(2rem + var(--header-offset)) 2rem 2rem;
}

.recipe-header {
    margin-bottom: 3rem;
}

.breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.breadcrumb a {
    color: var(--color-accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.recipe-page h1 {
    font-size: 2.5rem;
    color: var(--color-text);
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    font-weight: 850;
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--color-surface-soft);
    border-radius: 8px;
}

.recipe-meta span {
    font-size: 0.9rem;
    color: var(--color-text);
    font-weight: 500;
}

.recipe-meta .cook-time {
    background-color: var(--color-chip-bg);
    color: var(--color-chip-text);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 0;
}

.recipe-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1.15rem;
}

.recipe-hero-image {
    --recipe-hero-shift-y: 0px;
    --recipe-hero-zoom: 1.12;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--color-shadow-1);
}

.recipe-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate3d(0, var(--recipe-hero-shift-y), 0) scale(var(--recipe-hero-zoom));
    transform-origin: center;
    will-change: transform;
    transition: transform 0.2s linear;
}

.recipe-page .recipe-content {
    margin: 3rem 0;
}

.recipe-page .recipe-content h2 {
    color: var(--color-accent);
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
    border-bottom: 2px solid var(--color-accent);
    padding-bottom: 0.5rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.recipe-page .recipe-content h3 {
    color: var(--color-text);
    font-size: 1.2rem;
    margin: 1.5rem 0 0.5rem 0;
    font-family: var(--font-heading);
}

.recipe-page .recipe-content p,
.recipe-page .recipe-content li {
    margin-bottom: 0.8rem;
    line-height: 1.7;
}

.recipe-page .recipe-content ul,
.recipe-page .recipe-content ol,
.recipe-tips ul {
    margin-left: 1.5rem;
}

.recipe-page .recipe-content ol li {
    margin-bottom: 1.5rem;
}

.recipe-page .recipe-content strong {
    color: var(--color-accent);
}

.recipe-tips {
    background-color: var(--color-surface-soft);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--color-accent);
}

.recipe-navigation {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--color-accent);
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.back-button:hover {
    background-color: var(--color-accent);
    color: var(--color-header-fg);
}

/* Logo link styling */
.logo h1 a {
    color: var(--color-header-fg);
    text-decoration: none;
}

.logo h1 a:hover {
    color: var(--color-surface-soft);
}

header,
footer,
.hero,
.recipe-card,
.theme-trigger,
.theme-menu,
.theme-option,
.recipe-meta,
.recipe-tips,
.back-button {
    transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

/* Responsive design */
@media (max-width: 768px) {
    html {
        scroll-padding-top: var(--anchor-offset);
    }

    html[data-theme='kuestenwind'],
    html[data-theme='herdfeuer'],
    html[data-theme='nachtkueche'],
    html[data-theme='marktmorgen'] {
        --header-offset: 180px;
    }

    :root {
        --header-offset: 180px;
        --anchor-offset: var(--header-offset);
    }

    .logo h1 {
        font-size: 2rem;
    }

    .nav-links {
        gap: 0.55rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .theme-nav-item {
        display: none;
    }

    .theme-nav-item-footer {
        display: flex;
    }

    .nav-links > li:nth-child(6) {
        display: none;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero {
        padding: calc(2rem + var(--header-offset)) 1.25rem 2rem;
        min-height: 40vh;
        background-size: cover, cover, cover;
    }

    .recipes-grid {
        gap: 1.25rem;
    }

    .recipes-section {
        padding: 2rem 1rem;
    }

    .recipes-section h2 {
        font-size: 1.9rem;
        letter-spacing: 0.02em;
        text-align: center;
    }

    .recipes-grid > .recipe-card-link,
    .recipes-grid > .recipe-card {
        flex-basis: 100%;
        max-width: 100%;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-actions {
        width: 100%;
        justify-content: center;
    }

    .theme-nav-item {
        width: 100%;
        justify-content: center;
    }

    .theme-menu {
        left: 50%;
        transform: translateX(-50%);
        min-width: 200px;
    }

    .recipe-page {
        padding: calc(1rem + var(--header-offset)) 1rem 1rem;
    }

    .recipe-page h1 {
        font-size: 2rem;
    }

    .recipe-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .recipe-hero-image {
        height: 250px;
    }
}

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