:root {
    --primary-bg: #f4f7f6;
    --sidebar-bg: #ffffff;
    --accent-color: #3e5c38;
    --accent-deep: #253b20;
    --text-color: #1a1a1a;
    --muted-color: #6b7280;
    --border-color: #d1d5db;
    --link-color: #2563eb;
    --hover-bg: #f0fdf4;
    --wiki-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --highlight-bg: #fdf6e3;
    --highlight-border: #b58900;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    display: flex;
    min-height: 100vh;
    background-color: var(--primary-bg);
    color: var(--text-color);
    word-break: break-word;
}

a {
    color: var(--link-color);
}

nav {
    width: 320px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.03);
}

.logo-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-bg);
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-color);
    text-decoration: none;
    letter-spacing: -1px;
}

.lang-select {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 0.75rem;
    background: #f8fafc;
    color: #475569;
}

.menu-cat {
    margin-bottom: 5px;
}

.menu-btn {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 12px 15px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    color: #374151;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.menu-btn:hover {
    background: var(--hover-bg);
    color: var(--accent-color);
}

.menu-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: 15px;
}

.menu-content ul {
    list-style: none;
    padding: 5px 0 10px;
    margin: 0;
}

.menu-content li a {
    display: block;
    padding: 7px 12px;
    text-decoration: none;
    color: var(--muted-color);
    font-size: 0.88rem;
    border-radius: 6px;
}

.menu-content li a:hover {
    color: var(--link-color);
    background: #f9fafb;
}

.menu-btn.active + .menu-content {
    max-height: 1600px;
}

.menu-btn.active .arrow {
    transform: rotate(90deg);
}

.arrow {
    transition: transform 0.3s ease;
    font-size: 0.7rem;
    opacity: 0.4;
}

.current-link {
    font-weight: 700;
    color: var(--accent-color) !important;
    background: #edf6ee;
}

main {
    flex-grow: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.article-container {
    background: #ffffff;
    padding: 50px;
    border-radius: 12px;
    box-shadow: var(--wiki-shadow);
    max-width: 960px;
    width: 100%;
}

.breadcrumbs {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 10px;
}

.breadcrumbs a {
    color: #6b7280;
    text-decoration: none;
}

.breadcrumbs span {
    margin-right: 4px;
}

h1 {
    font-size: 2.6rem;
    margin: 0 0 20px;
    font-family: Georgia, serif;
}

h2 {
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-top: 40px;
    color: var(--accent-color);
}

h3 {
    margin-top: 0;
}

p,
li {
    line-height: 1.8;
    font-size: 1.05rem;
}

.wiki-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
}

.wiki-table th,
.wiki-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.wiki-table th {
    background: #f8fafc;
    color: var(--accent-deep);
    font-size: 0.95rem;
}

.pro-tip {
    background: #edf6ee;
    border-left: 4px solid var(--accent-color);
    padding: 18px 20px;
    margin: 24px 0;
}

.wiki-list,
.wiki-steps {
    padding-left: 22px;
}

.share-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.btn-s {
    padding: 8px 14px;
    border-radius: 4px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.82rem;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-s:hover {
    opacity: 0.88;
}

.facebook {
    background: #1877f2;
}

.twitter {
    background: #333333;
}

.whatsapp {
    background: #25d366;
}

.copy {
    background: #475569;
}

.infobox {
    float: right;
    width: 300px;
    border: 1px solid var(--border-color);
    margin: 0 0 20px 25px;
    padding: 15px;
    background: #fcfcfc;
    font-size: 0.85rem;
    border-radius: 8px;
}

.infobox-hero {
    background: linear-gradient(135deg, #edf6ee 0%, #f8fafc 100%);
    border: 1px solid #dbe7dc;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
}

.infobox-hero h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.infobox-hero p {
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0;
}

.hero-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-deep);
    margin-bottom: 8px;
}

.infobox th,
.infobox td {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.infobox th {
    text-align: left;
}

.infobox td {
    text-align: right;
    font-weight: 600;
}

.highlight-box {
    background: var(--highlight-bg);
    border-left: 4px solid var(--highlight-border);
    padding: 20px;
    margin: 25px 0;
    font-style: italic;
}

.wiki-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 28px;
}

.wiki-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fafcfb 100%);
}

.wiki-card h3 {
    margin-bottom: 10px;
    font-size: 1.15rem;
}

.wiki-card h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.wiki-card h3 a:hover,
.card-link:hover,
.inline-link:hover {
    text-decoration: underline;
}

.card-eyebrow {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-color);
}

.card-link,
.inline-link {
    font-weight: 700;
}

footer {
    margin-top: 50px;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
    width: 100%;
    padding-bottom: 40px;
    max-width: 960px;
}

.privacy-tag {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px auto 0;
    background: #e2e8f0;
    padding: 14px 18px;
    border-radius: 12px;
    color: #475569;
    text-align: center;
    width: 100%;
    max-width: 960px;
}

.privacy-tag-text {
    margin: 0;
}

.privacy-links {
    margin: 10px 0 0;
}

.footer-inline-link {
    color: var(--accent-deep);
    font-weight: 700;
    text-decoration: none;
}

.footer-inline-link:hover {
    text-decoration: underline;
}

.footer-sitemap {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(71, 85, 105, 0.18);
}

.sitemap-panel {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 24px;
}

.footer-sitemap-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.footer-copy-btn {
    border: 1px solid #94a3b8;
    background: #ffffff;
    color: #334155;
    border-radius: 8px;
    padding: 8px 12px;
    font: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.footer-copy-btn:hover {
    background: #f8fafc;
    border-color: #64748b;
}

.footer-sitemap-list,
.footer-sitemap-list ol {
    margin: 0;
    padding-left: 22px;
}

.footer-sitemap-list li {
    margin: 6px 0;
}

.footer-sitemap-link {
    color: #334155;
    text-decoration: none;
}

.footer-sitemap-link:hover {
    text-decoration: underline;
}

.footer-sitemap-section {
    font-weight: 700;
}

.footer-sitemap-group-label {
    list-style: none;
    color: #64748b;
    font-style: italic;
    margin-top: 10px;
}

/* ── Burger button (hidden on desktop) ─────────────────────── */
#burger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-direction: column;
    gap: 5px;
    margin-left: auto;
}

#burger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--accent-color);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ── Mobile nav overlay ─────────────────────────────────────── */
#mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    background: #ffffff;
    z-index: 200;
    flex-direction: column;
    overflow-y: auto;
}

#mobile-nav.active {
    display: flex;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 1;
}

#close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted-color);
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

#close-btn:hover {
    color: var(--text-color);
}

.mobile-nav-body {
    padding: 12px 0 40px;
}

.mobile-nav-cat {
    border-bottom: 1px solid var(--border-color);
}

.mobile-cat-btn {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #374151;
}

.mobile-cat-btn .arrow {
    font-size: 0.7rem;
    opacity: 0.4;
    transition: transform 0.3s ease;
}

.mobile-cat-btn.active .arrow {
    transform: rotate(90deg);
}

.mobile-cat-links {
    list-style: none;
    padding: 0 0 8px 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.mobile-cat-links.open {
    max-height: 1200px;
}

.mobile-cat-links li a {
    display: block;
    padding: 10px 20px 10px 32px;
    text-decoration: none;
    color: var(--muted-color);
    font-size: 0.92rem;
    border-left: 3px solid transparent;
    margin-left: 17px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.mobile-cat-links li a:hover {
    color: var(--accent-color);
    border-left-color: var(--accent-color);
    background: var(--hover-bg);
}

/* ── Responsive: show burger, hide sidebar nav categories ───── */
@media (max-width: 1000px) {
    body {
        flex-direction: column;
    }

    nav {
        width: 100%;
        height: auto;
        position: relative;
        padding: 16px 20px;
    }

    nav .menu-cat {
        display: none;
    }

    nav .search-wrap {
        display: none;
    }

    #burger-btn {
        display: flex;
    }

    .logo-area {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    main {
        padding: 24px;
    }

    .article-container {
        padding: 32px 24px;
    }

    .infobox {
        float: none;
        width: 100%;
        margin: 0 0 24px;
    }

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

@media (max-width: 406px) {
    main {
        padding: 14px;
    }

    .article-container {
        padding: 22px 16px;
    }

    h1 {
        font-size: 2rem;
    }

    .share-bar {
        flex-direction: column;
    }

    .btn-s {
        width: 100%;
        text-align: center;
    }

    .footer-sitemap-head {
        flex-direction: column;
        align-items: stretch;
    }

    .footer-copy-btn {
        width: 100%;
    }
}

/* ── Search ───────────────────────────────────────────────────── */
.search-wrap {
    margin-bottom: 18px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--primary-bg);
    color: var(--text-color);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(62, 92, 56, 0.12);
    background: #fff;
}

.search-input::placeholder {
    color: var(--muted-color);
}

.search-icon-svg {
    position: absolute;
    left: 10px;
    width: 15px;
    height: 15px;
    color: var(--muted-color);
    pointer-events: none;
    flex-shrink: 0;
}

/* Portal dropdown – fixed, positioned by JS */
.search-dropdown-portal {
    display: none;
    position: fixed;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    z-index: 9999;
    max-height: 380px;
    overflow-y: auto;
}

.search-dropdown-portal.open {
    display: block;
}

/* Inline dropdown – mobile */
.search-dropdown-inline {
    display: none;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 6px;
    max-height: 280px;
    overflow-y: auto;
}

.search-dropdown-inline.open {
    display: block;
}

.mobile-search-wrap {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

/* Search result items */
.search-result-item {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;
}

.search-result-item:last-of-type {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--hover-bg);
}

.sri-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
}

.sri-title mark {
    background: #fef08a;
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
    font-style: normal;
}

.sri-section {
    font-size: 0.76rem;
    color: var(--muted-color);
    margin-top: 2px;
}

.search-no-results {
    padding: 14px;
    color: var(--muted-color);
    font-size: 0.88rem;
    text-align: center;
}

.search-see-all {
    display: block;
    padding: 10px 14px;
    font-size: 0.84rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    border-top: 1px solid var(--border-color);
    background: var(--hover-bg);
    text-align: center;
    border-radius: 0 0 8px 8px;
    transition: background 0.15s ease;
}

.search-see-all:hover {
    background: #dff0d8;
}

/* Full search page */
.search-page-wrap {
    margin: 20px 0 28px;
    max-width: 560px;
}

.search-page-wrap .search-input {
    font-size: 1.05rem;
    padding: 12px 16px 12px 42px;
    border-radius: 10px;
}

.search-page-wrap .search-icon-svg {
    width: 18px;
    height: 18px;
    left: 13px;
}

.search-page-results {
    margin-top: 8px;
}

.search-page-results .search-result-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 14px 16px;
    box-shadow: var(--wiki-shadow);
    background: var(--sidebar-bg);
}

.search-page-results .search-result-item:hover {
    border-color: var(--accent-color);
    background: var(--hover-bg);
}

.search-page-results .sri-title {
    font-size: 1rem;
}

.search-page-results .sri-desc {
    font-size: 0.84rem;
    color: var(--muted-color);
    margin-top: 5px;
    line-height: 1.5;
}

.search-page-results .sri-desc mark {
    background: #fef08a;
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
    font-style: normal;
}

.search-results-count {
    font-size: 0.85rem;
    color: var(--muted-color);
    margin: 0 0 16px;
}

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