html {
    font-size: 16px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

/* Theme variables (dark mode removed) */
:root {
    --np-page-bg: #f3f4f5;
    --np-page-bg-alt: #eceeef;
    --np-text: #222;
    --np-accent: #2d6a4f;
    --np-accent-rgb: 45,106,79;
    --np-accent-soft: #e3f4ea;
    --np-border: #d6e4db;
    --np-surface: #ffffff;
    --np-radius-sm: .35rem;
    --np-radius: .65rem;
    --np-shadow-sm: 0 2px 4px rgba(0,0,0,.08);
    --np-font-sans: 'Inter', system-ui, Arial, sans-serif;
    --np-font-serif: 'Lora', Georgia, serif;
    --np-nav-h: 60px; /* adjust if your navbar is taller or shorter */
}

@media (max-width: 991.98px) {
    :root {
        --np-nav-h: 64px; /* smaller navbar height on mobile */
    }
}

/* Light mode only */
body {
    margin-bottom: 60px;
    background-color: var(--np-page-bg);
    background-image: linear-gradient(160deg, var(--np-page-bg) 0%, var(--np-page-bg-alt) 55%, var(--np-page-bg) 100%);
    background-attachment: fixed;
    color: var(--np-text);
    padding-top: var(--np-nav-h);
}

body, input, button, select, textarea {
    font-family: var(--np-font-sans);
}

.h-serif {
    font-family: var(--np-font-serif);
}

/* Navbar */
/* Fixed navbar */
.navbar-main.fixed-top {
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Navbar green gradient (fully opaque) */
.navbar-main {
    background: linear-gradient( 90deg, rgba(var(--np-accent-rgb), 1) 0%, rgba(var(--np-accent-rgb), 1) 35%, rgba(64, 156, 106, 1) 50%, rgba(var(--np-accent-rgb), 1) 65%, rgba(var(--np-accent-rgb), 1) 100% );
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .15);
}

    .navbar-main .nav-link {
        font-weight: 500;
        color: #f1f7f4;
        transition: color .2s;
    }

        .navbar-main .nav-link:hover {
            color: #ffffff;
        }

.navbar-brand {
    font-family: var(--np-font-serif);
    letter-spacing: .5px;
    color: #fff;
}

    .navbar-brand:hover {
        color: #fff;
    }

/* Hamburger visibility */
.navbar-main.navbar-dark .navbar-toggler {
    border-color: rgba(255,255,255,.4);
}

.navbar-main.navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Buttons */
.btn-outline-success {
    --bs-btn-color: var(--np-accent);
    --bs-btn-border-color: var(--np-accent);
}

    .btn-outline-success:hover {
        background: var(--np-accent);
        color: #fff;
    }

/* Search panel */
.search-panel {
    background: var(--np-accent-soft);
    border-top: 1px solid var(--np-border);
    border-bottom: 1px solid var(--np-border);
    padding: .75rem 0;
}

.search-inner {
    display: flex;
    gap: .75rem;
    align-items: center;
}

/* Hero */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 52vh;
    padding: 4rem 1.25rem;
    background: linear-gradient(135deg, rgba(var(--np-accent-rgb), .85), rgba(var(--np-accent-rgb), .55)), url('/images/hero.webp') center/cover;
    color: #fff;
}

.hero-content {
    max-width: 760px;
}

.hero h1 {
    font-family: var(--np-font-serif);
    font-size: clamp(2.3rem,5vw,3.5rem);
}

.hero p.lead {
    font-size: 1.25rem;
    font-weight: 400;
}

.mainpage-photo {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    width: 100%;
    height: auto;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

/* Gallery & cards */
.np-section-title {
    font-family: var(--np-font-serif);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.gallery-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
}

.np-card {
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius);
    box-shadow: var(--np-shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: .25s box-shadow,.25s transform;
}

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

    .np-card img {
        aspect-ratio: 4/3;
        object-fit: cover;
        width: 100%;
    }

    .np-card .np-card-body {
        padding: .75rem .9rem 1rem;
    }

.np-tag {
    display: inline-block;
    background: var(--np-accent-soft);
    color: var(--np-accent);
    font-size: .65rem;
    letter-spacing: .5px;
    font-weight: 600;
    padding: .35rem .55rem;
    border-radius: var(--np-radius-sm);
    text-transform: uppercase;
}

/* Footer */
.site-footer {
    background: transparent;
    backdrop-filter: blur(4px);
    border-top: 1px solid var(--np-border);
}

/* Utilities */
.text-accent {
    color: var(--np-accent) !important;
}

.bg-accent-soft {
    background: var(--np-accent-soft);
}

/* Responsive */
@media (max-width:575px) {
    .hero {
        padding: 3rem 1rem;
    }

    .search-inner {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Ensure content clears the fixed bar */
.maincontent {
    margin-top: 16px;
}

/* Namelist page */
.letter-top-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .75rem;
}

.letter-top-link {
    font-weight: 800;
    font-size: 1.5rem;
    line-height: 1;
    padding: .25rem .5rem;
    text-decoration: none;
    color: #212529;
    border-radius: .5rem;
    background: #f1f3f5;
    display: inline-block;
}

    .letter-top-link:hover {
        background: #e9ecef;
        text-decoration: none;
    }

.letter-section {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
    padding: 1rem;
    background: #fff;
}

.letter-badge-large {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    background: #e9ecef;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 2.5rem;
    line-height: 1;
    color: #212529;
}

.letter-list-group .list-group-item {
    padding-top: .75rem;
    padding-bottom: .75rem;
}

.name-item em {
    color: #6c757d;
}

.name-item .sci {
    font-style: italic;
}

/* ===== Mushroom detail view ===== */

.mush-caption {
    margin: 1.25rem 0 .75rem 0;
    padding-bottom: .25rem;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.mush-captiontext {
    font-size: clamp(1.35rem, 1.1rem + 1vw, 2rem);
    line-height: 1.2;
    font-weight: 700;
}

.mush-commonname {
    color: #6c757d;
    margin-left: .5rem;
    font-weight: 500;
}

/* ===== Image gallery ===== */

.mush-images {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin: 1rem 0 1.5rem 0;
}

.mush-image {
    position: relative;
    overflow: hidden;
    border-radius: .5rem;
    background: #f8f9fa;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
    transition: transform .15s ease, box-shadow .15s ease;
}

    .mush-image a {
        display: block;
        text-decoration: none;
        outline: none;
    }

    .mush-image img {
        width: 100%;
        height: 150px;
        object-fit: cover;
        display: block;
        transition: transform .3s ease, opacity .3s ease;
    }

    .mush-image:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
    }

        .mush-image:hover img {
            transform: scale(1.03);
        }

@media (min-width: 992px) {
    .mush-images {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 14px;
    }

    .mush-image img {
        height: 180px;
    }
}

/* ===== Info grid ===== */

.mush-info {
    width: 100%;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 10px 16px;
    align-items: start;
    margin-bottom: 1.5rem;
    /* aligned to left edge */
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

/* Labels */
.mush-labelus {
    font-weight: 600;
    color: #495057;
    background: #f5f9f5;
    border: 1px solid #e9ecef;
    border-radius: .5rem;
    padding: .5rem .75rem;
    line-height: 1.2;
    text-align: left;
}

/* Values */
.mush-textus,
.mush-longtextus {
    color: #212529;
    border: 1px solid #e9ecef;
    border-radius: .5rem;
    padding: .6rem .75rem;
    background: #ffffff;
    width: 100%;
    box-sizing: border-box;
    /* text formatting fixes */
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.6;
}

/* Long text spans full content column */
.mush-longtextus {
    grid-column: 2 / -1;
}

    .mush-longtextus p {
        margin-bottom: .75rem;
    }

    .mush-longtextus br {
        line-height: 1.2;
    }

/* ===== Mobile layout ===== */

@media (max-width: 576px) {
    .mush-info {
        grid-template-columns: 1fr;
    }

    .mush-labelus {
        background: transparent;
        border: none;
        padding: 0;
        margin-top: .75rem;
    }

    .mush-textus,
    .mush-longtextus {
        margin-top: .25rem;
        grid-column: 1 / -1;
    }
}

/* ===== Links and accessibility ===== */

.mush-textus a,
.mush-longtextus a {
    text-decoration: underline;
}

.mush-image a:focus-visible {
    outline: 3px solid #86b7fe;
    outline-offset: 2px;
    border-radius: .5rem;
}

/* ===== Print adjustments ===== */

@media print {
    .mush-image {
        box-shadow: none;
    }

        .mush-image img {
            height: auto;
        }
}

/* ===== Svampbok page ===== */

.svamp-container {
    max-width: 800px;
    background-color: #f8fdf8;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    font-family: Arial, sans-serif;
}

.svamp-title {
    color: #2e5634;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
}

.svamp-image {
    max-width: 160px;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.svamp-section {
    margin-top: 2rem;
}

    .svamp-section h3 {
        color: #3b6b3f;
        border-bottom: 2px solid #cde0c9;
        padding-bottom: 0.3rem;
        margin-bottom: 1rem;
    }

    .svamp-section ul {
        list-style-type: none;
        padding-left: 0;
    }

    .svamp-section li {
        margin-bottom: 0.5rem;
    }

    .svamp-section a {
        color: #2f6f34;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.2s ease, text-shadow 0.2s ease;
    }

        .svamp-section a:hover {
            color: #1c4b21;
            text-shadow: 0 0 3px rgba(46, 86, 52, 0.4);
        }

/* Mushroom summary Card wrapper */
.mushsum-card {
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
}

/* Caption */
.mushsum-caption {
    margin-bottom: 0.5rem;
}

.mushsum-captiontext {
    font-weight: 700;
    line-height: 1.2;
    display: inline-block;
    max-width: 100%;
    word-break: break-word;
}

.mushsum-commonname {
    font-weight: 400;
    font-style: italic;
    opacity: 0.85;
    margin-left: 0.25rem;
}

/* Image grid: now max two per row */
.mushsum-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    justify-content: center;
}

    /* Adjust spacing when only one image */
    .mushsum-images:has(.mushsum-image:only-child) {
        grid-template-columns: 1fr;
        justify-items: center;
    }

/* Image tile */
.mushsum-image {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    background: #f8f9fa;
    aspect-ratio: 1 / 1;
}

    /* Image itself */
    .mushsum-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform .2s ease-in-out, filter .2s ease-in-out;
    }

    /* Hover effect */
    .mushsum-image:hover img {
        transform: scale(1.04);
        filter: brightness(0.97);
    }

/* Card body layout */
.mushsum-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
}

/* Small screens: stack vertically */
@media (max-width: 575.98px) {
    .mushsum-images {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.mushsum-caption .mushsum-link {
    color: inherit;
    text-decoration: none;
}

    .mushsum-caption .mushsum-link:hover,
    .mushsum-caption .mushsum-link:focus {
        text-decoration: underline;
    }

