/* ==========================================================================
   OMAD - One Meal A Day
   Main Stylesheet
   ========================================================================== */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #2e7d32;
    --color-primary-dark: #1b5e20;
    --color-primary-light: #a5d6a7;
    --color-accent: #ff8f00;
    --color-accent-hover: #e67e00;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-bg: #ffffff;
    --color-bg-alt: #f5f7f5;
    --color-border: #e0e0e0;
    --color-tab-bg: #16421a;
    --color-tab-active: #ffffff;
    --color-tab-text: #c8e6c9;
    --color-tab-text-active: var(--color-primary-dark);
    --font-body: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: Georgia, "Times New Roman", serif;
    --max-width: 1100px;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul,
ol {
    list-style: none;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--color-primary-dark);
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.4rem;
}

h2 {
    font-size: 1.8rem;
}

h3 {
    font-size: 1.3rem;
}

p {
    margin-bottom: 1em;
}

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

main {
    flex: 1;
}

/* ---------- Site Header ---------- */
.site-header {
    background-color: var(--color-primary-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* -- Brand bar -- */
.brand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0;
}

.brand-bar .logo a {
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.brand-bar .logo a span {
    color: var(--color-accent);
    font-weight: 400;
}

/* -- Tab Navigation -- */
.tab-nav {
    background-color: var(--color-tab-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-nav .container {
    position: relative;
}

.tab-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tab-list li {
    flex: 0 0 auto;
}

.tab-list a {
    display: block;
    padding: 0.7rem 1.25rem;
    color: var(--color-tab-text);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px 6px 0 0;
    position: relative;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
    white-space: nowrap;
}

.tab-list a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
}

.tab-list a.active {
    background-color: var(--color-tab-active);
    color: var(--color-tab-text-active);
    font-weight: 600;
}

/* subtle bottom indicator on active tab */
.tab-list a.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--color-accent);
    border-radius: 3px 3px 0 0;
}

/* ---------- Mobile Nav Toggle ---------- */
.nav-toggle {
    display: none;
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 5px;
    cursor: pointer;
    padding: 0.35rem 0.55rem;
    transition: border-color 0.2s ease;
}

.nav-toggle:hover {
    border-color: #ffffff;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #ffffff;
    margin: 4px 0;
    border-radius: 2px;
    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
}

/* Hamburger animation when open */
.nav-toggle.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Hero Section ---------- */
.hero {
    background: linear-gradient(135deg, var(--color-bg-alt) 0%, #e8f5e9 100%);
    padding: 0 0 4rem;
    text-align: center;
    border-bottom: 3px solid var(--color-primary-light);
}

.hero__banner {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-radius: 10px;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 0.3em;
}

.hero p {
    font-size: 1.15rem;
    color: var(--color-text-light);
    max-width: 650px;
    margin: 0 auto 1.5em;
}

.btn {
    display: inline-block;
    background-color: var(--color-accent);
    color: #ffffff;
    padding: 0.75rem 2rem;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        transform 0.1s ease;
}

.btn:hover {
    background-color: var(--color-accent-hover);
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* ---------- Content Sections (frontpage) ---------- */
.section {
    padding: 3rem 0;
}

.section--alt {
    background-color: var(--color-bg-alt);
}

.section__title {
    text-align: center;
    margin-bottom: 2rem;
}

.intro {
    padding: 3rem 0;
}

.highlights {
    padding: 3rem 0;
    background-color: var(--color-bg-alt);
}

.cta {
    padding: 3rem 0;
    text-align: center;
}

/* ---------- Card Grid ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card h3 {
    margin-bottom: 0.5em;
}

.card p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* ---------- Page Content (sub-pages) ---------- */
.page-content {
    padding: 3rem 0 4rem;
}

.page-content h1 {
    margin-bottom: 0.75em;
    border-bottom: 2px solid var(--color-primary-light);
    padding-bottom: 0.3em;
}

.page-content h2 {
    margin-top: 2em;
    margin-bottom: 0.5em;
}

.page-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.4em;
}

.page-content p + ul,
.page-content p + ol {
    margin-top: -0.5em;
}

.page-content ul,
.page-content ol {
    margin: 0 0 1em 1.5em;
}

.page-content ul {
    list-style: disc;
}

.page-content ol {
    list-style: decimal;
}

.page-content li {
    margin-bottom: 0.4em;
}

.page-content blockquote {
    border-left: 4px solid var(--color-primary-light);
    margin: 1.5em 0;
    padding: 1em 1.5em;
    background-color: var(--color-bg-alt);
    color: var(--color-text-light);
    font-style: italic;
    border-radius: 0 6px 6px 0;
}

.page-content .info-box {
    background-color: #e8f5e9;
    border: 1px solid var(--color-primary-light);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin: 1.5em 0;
}

.page-content .info-box h3 {
    margin-top: 0;
    color: var(--color-primary);
}

.page-content .warning-box {
    background-color: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin: 1.5em 0;
}

.page-content .warning-box h3 {
    margin-top: 0;
    color: #f57f17;
}

/* ---------- Recipe Cards ---------- */
.recipe-card {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s ease;
}

.recipe-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.recipe-card h3 {
    margin-top: 0;
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.4em;
    margin-bottom: 0.6em;
}

.recipe-card .recipe-meta {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 0.75em;
}

.recipe-card ul {
    margin: 0 0 1em 1.5em;
    list-style: disc;
}

.recipe-card ol {
    margin: 0 0 1em 1.5em;
    list-style: decimal;
}

.recipe-card li {
    margin-bottom: 0.3em;
}

/* ---------- FAQ ---------- */
.faq-item {
    border-bottom: 1px solid var(--color-border);
    padding: 1.25rem 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    margin-top: 0;
    color: var(--color-primary);
    cursor: default;
}

.faq-item p {
    color: var(--color-text-light);
    margin-bottom: 0;
}

/* ---------- Footer ---------- */
.site-footer {
    background-color: var(--color-primary-dark);
    color: #cccccc;
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.85rem;
    margin-top: auto;
}

.site-footer p {
    margin-bottom: 0;
}

.site-footer a {
    color: var(--color-primary-light);
}

.footer-nav {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

/* ---------- Responsive: Tablet ---------- */
@media (max-width: 900px) {
    .tab-list a {
        padding: 0.6rem 0.9rem;
        font-size: 0.85rem;
    }
}

/* ---------- Responsive: Mobile ---------- */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .hero {
        padding: 2.5rem 0;
    }

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

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

    /* Show mobile toggle */
    .nav-toggle {
        display: block;
    }

    /* Hide tab bar by default on mobile */
    .tab-nav {
        display: none;
    }

    .tab-nav.open {
        display: block;
    }

    .tab-list {
        flex-direction: column;
        padding: 0.5rem 0;
    }

    .tab-list li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .tab-list li:last-child {
        border-bottom: none;
    }

    .tab-list a {
        border-radius: 0;
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }

    .tab-list a.active {
        background-color: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }

    .tab-list a.active::after {
        display: none;
    }

    .section,
    .intro,
    .highlights,
    .cta {
        padding: 2rem 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .brand-bar .logo a {
        font-size: 1.4rem;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

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

    .btn {
        padding: 0.65rem 1.5rem;
        font-size: 0.9rem;
    }
}
