/* === MYCELIUM ATLAS — STYLE.CSS === */
/* Bio/earth palette adapted from P06 (avintel.eu) template */

:root {
    /* Text colors */
    --text: #1c1917;
    --text-muted: #57534e;
    --text-light: #a8a29e;

    /* Surface colors */
    --surface: #ffffff;
    --surface-alt: #fafaf9;
    --surface-card: #ffffff;
    --header-bg: #14532d;
    --footer-bg: #1c1917;

    /* Brand — bio/earth */
    --green-deep: #166534;
    --green: #16a34a;
    --green-light: #dcfce7;
    --lime: #65a30d;
    --lime-light: #ecfccb;
    --brown: #b45309;
    --brown-light: #fef3c7;
    --amber: #ca8a04;
    --amber-light: #fef9c3;
    --gray: #78716c;

    /* Misc */
    --border: #e7e5e4;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 8px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --text: #e7e5e4;
        --text-muted: #a8a29e;
        --text-light: #78716c;
        --surface: #0c0a09;
        --surface-alt: #1c1917;
        --surface-card: #1c1917;
        --header-bg: #052e16;
        --footer-bg: #0c0a09;
        --border: #292524;
        --shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    body { background: var(--surface); color: var(--text); }
    .hero { background: linear-gradient(135deg, #052e16, #14532d); }
    input, select, textarea {
        background: #292524; color: var(--text); border-color: #44403c;
    }
    .hero-search input { background: #292524; color: var(--text); }
    .data-table th { background: var(--surface-alt); }
    .data-table tr:nth-child(even) { background: var(--surface-alt); }
    .section-alt { background: var(--surface-alt); }
    footer { background: var(--footer-bg); }
    .recipe-card { background: var(--surface-card); border-color: var(--border); }
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--surface);
    color: var(--text);
    line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* === VERSION BADGE === */
.version-badge {
    position: fixed;
    top: 6px;
    left: 8px;
    background: var(--amber);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    z-index: 1100;
    opacity: 0.85;
    pointer-events: none;
}

/* === HEADER === */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg);
    box-shadow: var(--shadow);
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    position: relative;
}
.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    margin-top: 1.5rem;
}
.logo-accent { color: var(--lime); }
nav { display: flex; gap: 1.25rem; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.nav-link {
    color: #d6d3d1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-link:hover { color: var(--lime); }

/* Hamburger toggle — hidden on desktop, shown on mobile */
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    margin-left: auto;
}
.nav-toggle:hover { border-color: var(--lime); color: var(--lime); }

/* === HERO === */
.hero {
    background: linear-gradient(135deg, #14532d, #166534);
    color: #fff;
    padding: 2.5rem 0 3rem;
    text-align: left;
}
.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.highlight { color: var(--lime); }
.hero-sub {
    font-size: 1.15rem;
    color: #d6d3d1;
    margin-bottom: 1.5rem;
    max-width: 700px;
}
.hero-search {
    display: flex;
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 0 2rem;
}
.hero-search input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #d6d3d1;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}
.hero-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.stat-num {
    font-size: 2rem;
    font-weight: 700;
    color: var(--lime);
}
.stat-label {
    font-size: 0.85rem;
    color: #d6d3d1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === BUTTONS === */
.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--lime); color: #14532d; }
.btn-secondary { background: #44403c; color: #fff; }

/* === SECTIONS === */
.section {
    padding: 3rem 0;
}
.section-alt {
    background: var(--surface-alt);
}
.section h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--green-deep);
}
.section-sub {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}
.section h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--green-deep);
    font-size: 1.2rem;
}
.section ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
.disclaimer {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* === SECTION ROW (side-by-side layout) === */
.section-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}
.section-row > .section {
    padding: 0;
}
.section-row > .section + .section {
    border-left: 1px solid var(--border);
    padding-left: 2rem;
}
@media (max-width: 900px) {
    .section-row {
        grid-template-columns: 1fr;
    }
    .section-row > .section + .section {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border);
        padding-top: 1.5rem;
        margin-top: 1.5rem;
    }
}

/* === MAP === */
.map-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.map-filters select,
.table-controls select,
.map-filters input,
.table-controls input {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
    background: #fff;
    color: var(--text);
}
#leafletMap {
    height: 500px;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* === TABLES === */
.table-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    align-items: center;
}
.table-controls input { flex: 1; min-width: 200px; }
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
table th {
    background: var(--surface-alt);
    text-align: left;
    padding: 0.75rem;
    font-weight: 600;
    color: var(--green-deep);
    border-bottom: 2px solid var(--border);
    cursor: pointer;
    user-select: none;
}
table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}
table tr:hover { background: var(--green-light); }
.pagination {
    margin-top: 1rem;
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}
.pagination button {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text);
}
.pagination button.active { background: var(--green-deep); color: #fff; border-color: var(--green-deep); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: var(--green-light); color: var(--green-deep); }
.badge-warning { background: var(--amber-light); color: var(--amber); }
.badge-info { background: var(--lime-light); color: var(--green-deep); }

/* === RECIPE GRID === */
.recipe-frame {
    background: repeating-linear-gradient(
        135deg,
        var(--surface-card) 0 12px,
        var(--surface-alt) 12px 24px
    );
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.4rem;
}
.recipe-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}
.recipe-card:hover { transform: translateY(-2px); }
.recipe-card h4 {
    color: var(--green-deep);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}
.recipe-card .recipe-meta {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}
.recipe-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* === SUBMIT FORM === */
.submit-form {
    max-width: 600px;
    background: var(--surface-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.form-row {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}
.form-row label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: var(--green-deep);
}
.form-row input,
.form-row select,
.form-row textarea {
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
}
.submit-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    display: none;
}
.submit-status.success {
    display: block;
    background: var(--green-light);
    color: var(--green-deep);
}
.submit-status.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

/* === FOOTER === */
footer {
    background: var(--footer-bg);
    color: #d6d3d1;
    padding: 2.5rem 0 1rem;
    margin-top: 2rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.footer-grid h4 {
    color: var(--lime);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.footer-grid a {
    display: block;
    color: #d6d3d1;
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}
.footer-grid a:hover { color: var(--lime); }
.footer-bottom {
    text-align: center;
    border-top: 1px solid #44403c;
    padding-top: 1rem;
}
.footer-bottom small {
    color: var(--text-light);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hero { padding: 1.5rem 0 2rem; }
    .hero-sub { font-size: 1rem; }
    .hero-search { flex-wrap: wrap; }
    .hero-search input { min-width: 0; }
    .hero-stats { gap: 1rem; }
    .stat-num { font-size: 1.5rem; }
    .stat-label { font-size: 0.75rem; }
    .map-filters select,
    .table-controls select { flex: 1; min-width: 120px; }
    #leafletMap { height: 350px; }

    /* Section spacing tighter on mobile */
    .section { padding: 1.5rem 0; }
    .section h2 { font-size: 1.4rem; }
    .section-sub { font-size: 0.9rem; margin-bottom: 1rem; }

    /* Recipe grid — single column on mobile */
    .recipe-grid { grid-template-columns: 1fr; }

    /* Tables — stack cells as blocks for mobile */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
    .footer-bottom { font-size: 0.8rem; padding: 0 0.5rem; }

    /* Hamburger menu — pushes the nav to the right side of the header */
    .nav-toggle { display: block; }
    nav#siteNav {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: auto;
        min-width: 200px;
        flex-direction: column;
        gap: 0;
        background: var(--header-bg, #14532d);
        box-shadow: var(--shadow);
        padding: 0.5rem 0;
        margin-left: 0;
        border-radius: 0 0 0 8px;
    }
    nav#siteNav.open { display: flex; }
    nav#siteNav .nav-link {
        padding: 0.85rem 1.25rem;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        font-size: 0.95rem;
    }
    nav#siteNav .nav-link:last-child { border-bottom: none; }
}

/* === EXTRA-SMALL PHONES === */
@media (max-width: 480px) {
    .container { padding: 0 0.75rem; }
    .logo { font-size: 1.1rem; margin-top: 1.5rem; }
    .recipe-frame { padding: 0.5rem; }
    .recipe-card { padding: 0.85rem; }
    .hero-stats { gap: 0.75rem; }
    .stat-num { font-size: 1.25rem; }
    .footer-grid { grid-template-columns: 1fr; }
}
