:root {
    --primary: #1d9a58;
    --primary-dark: #157a45;
    --primary-light: #e6f5ed;
    --secondary: #39ac6f;
    --secondary-light: #eef8f2;
    --accent: #2ad57a;
    --accent-light: #eafff2;
    --bg-page: #eef1f0;
    --bg-section: #e4eae8;
    --surface: #fafafa;
    --surface-elevated: #ffffff;
    --text-main: #2d3933;
    --text-muted: #759f88;
    --border: #d0ddd5;
    --shadow: rgba(45, 57, 51, 0.08);
    --radius: 0.75rem;
    --radius-sm: 0.375rem;
    --radius-lg: 1rem;
    --container-max: 1200px;
    --font-sans: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-page);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(29, 154, 88, 0.04) 0%, transparent 25%), radial-gradient(circle at 90% 80%, rgba(42, 213, 122, 0.04) 0%, transparent 25%);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

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

a {
    color: var(--primary);
    text-decoration: none;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    line-height: 1.25;
    color: var(--text-main);
    font-weight: 700;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

ul,
ol {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Bootstrap-like grid */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.col-1,
.col-2,
.col-3,
.col-4,
.col-5,
.col-6,
.col-7,
.col-8,
.col-9,
.col-10,
.col-11,
.col-12,
.col-md-1,
.col-md-2,
.col-md-3,
.col-md-4,
.col-md-5,
.col-md-6,
.col-md-7,
.col-md-8,
.col-md-9,
.col-md-10,
.col-md-11,
.col-md-12,
.col-lg-1,
.col-lg-2,
.col-lg-3,
.col-lg-4,
.col-lg-5,
.col-lg-6,
.col-lg-7,
.col-lg-8,
.col-lg-9,
.col-lg-10,
.col-lg-11,
.col-lg-12 {
    position: relative;
    width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.col-1 {
    flex: 0 0 8.333333%;
    max-width: 8.333333%;
}
.col-2 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
}
.col-3 {
    flex: 0 0 25%;
    max-width: 25%;
}
.col-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}
.col-5 {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
}
.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
}
.col-7 {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
}
.col-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
}
.col-9 {
    flex: 0 0 75%;
    max-width: 75%;
}
.col-10 {
    flex: 0 0 83.333333%;
    max-width: 83.333333%;
}
.col-11 {
    flex: 0 0 91.666667%;
    max-width: 91.666667%;
}
.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

@media (min-width: 768px) {
    .col-md-1 {
        flex: 0 0 8.333333%;
        max-width: 8.333333%;
    }
    .col-md-2 {
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
    }
    .col-md-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    .col-md-5 {
        flex: 0 0 41.666667%;
        max-width: 41.666667%;
    }
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    .col-md-7 {
        flex: 0 0 58.333333%;
        max-width: 58.333333%;
    }
    .col-md-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
    .col-md-9 {
        flex: 0 0 75%;
        max-width: 75%;
    }
    .col-md-10 {
        flex: 0 0 83.333333%;
        max-width: 83.333333%;
    }
    .col-md-11 {
        flex: 0 0 91.666667%;
        max-width: 91.666667%;
    }
    .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (min-width: 1024px) {
    .col-lg-1 {
        flex: 0 0 8.333333%;
        max-width: 8.333333%;
    }
    .col-lg-2 {
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
    }
    .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    .col-lg-5 {
        flex: 0 0 41.666667%;
        max-width: 41.666667%;
    }
    .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    .col-lg-7 {
        flex: 0 0 58.333333%;
        max-width: 58.333333%;
    }
    .col-lg-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
    .col-lg-9 {
        flex: 0 0 75%;
        max-width: 75%;
    }
    .col-lg-10 {
        flex: 0 0 83.333333%;
        max-width: 83.333333%;
    }
    .col-lg-11 {
        flex: 0 0 91.666667%;
        max-width: 91.666667%;
    }
    .col-lg-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Utility spacing */
.m-0 {
    margin: 0 !important;
}
.m-1 {
    margin: 0.25rem !important;
}
.m-2 {
    margin: 0.5rem !important;
}
.m-3 {
    margin: 1rem !important;
}
.m-4 {
    margin: 1.5rem !important;
}
.m-5 {
    margin: 3rem !important;
}

.mt-0 {
    margin-top: 0 !important;
}
.mt-1 {
    margin-top: 0.25rem !important;
}
.mt-2 {
    margin-top: 0.5rem !important;
}
.mt-3 {
    margin-top: 1rem !important;
}
.mt-4 {
    margin-top: 1.5rem !important;
}
.mt-5 {
    margin-top: 3rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}
.mb-1 {
    margin-bottom: 0.25rem !important;
}
.mb-2 {
    margin-bottom: 0.5rem !important;
}
.mb-3 {
    margin-bottom: 1rem !important;
}
.mb-4 {
    margin-bottom: 1.5rem !important;
}
.mb-5 {
    margin-bottom: 3rem !important;
}

.p-0 {
    padding: 0 !important;
}
.p-1 {
    padding: 0.25rem !important;
}
.p-2 {
    padding: 0.5rem !important;
}
.p-3 {
    padding: 1rem !important;
}
.p-4 {
    padding: 1.5rem !important;
}
.p-5 {
    padding: 3rem !important;
}

.pt-1 {
    padding-top: 0.25rem !important;
}
.pt-2 {
    padding-top: 0.5rem !important;
}
.pt-3 {
    padding-top: 1rem !important;
}
.pt-4 {
    padding-top: 1.5rem !important;
}
.pt-5 {
    padding-top: 3rem !important;
}

.pb-1 {
    padding-bottom: 0.25rem !important;
}
.pb-2 {
    padding-bottom: 0.5rem !important;
}
.pb-3 {
    padding-bottom: 1rem !important;
}
.pb-4 {
    padding-bottom: 1.5rem !important;
}
.pb-5 {
    padding-bottom: 3rem !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background-color: var(--primary);
    color: #fff;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.btn:hover {
    background-color: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--secondary);
}

.btn-secondary:hover {
    background-color: var(--primary);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25em 0.6em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 999px;
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.badge-primary {
    background-color: var(--primary);
    color: #fff;
}

.badge-secondary {
    background-color: var(--secondary-light);
    color: var(--secondary);
}

/* Alerts */
.alert {
    position: relative;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background-color: var(--accent-light);
    color: var(--text-main);
}

.alert-primary {
    background-color: var(--primary-light);
    border-color: var(--primary);
}

.alert-secondary {
    background-color: var(--secondary-light);
    border-color: var(--secondary);
}

/* Forms */
.form-label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-main);
    background-color: var(--surface);
    background-clip: padding-box;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--accent);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(45, 213, 122, 0.25);
}

/* Header / Navbar */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: linear-gradient(180deg, #ffffff 0%, #f7faf9 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px var(--shadow);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.navbar-brand:hover {
    color: var(--text-main);
    text-decoration: none;
}

.brand-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.site-name {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.site-name-main {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text-main);
}

.site-name-sub {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    margin-top: 0.125rem;
}

.navbar-toggler {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    cursor: pointer;
}

.navbar-toggler-icon {
    display: inline-block;
    width: 24px;
    height: 2px;
    background-color: currentColor;
    position: relative;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: currentColor;
}

.navbar-toggler-icon::before {
    top: -7px;
}

.navbar-toggler-icon::after {
    top: 7px;
}

.navbar-collapse {
    display: flex;
    align-items: center;
    flex-grow: 1;
    justify-content: flex-end;
}

.nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--primary);
    background-color: var(--primary-light);
    text-decoration: none;
}

.nav-item.active .nav-link {
    color: var(--primary);
    background-color: var(--primary-light);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
}

.nav-dropdown-toggle::after {
    content: "▼";
    font-size: 0.625rem;
    color: var(--text-muted);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1040;
    display: none;
    min-width: 220px;
    padding: 0.5rem;
    margin-top: 0;
    list-style: none;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(45, 57, 51, 0.12);
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

@media (min-width: 1024px) {
    .nav-dropdown:hover .nav-dropdown-menu {
        display: block;
    }
}

.nav-dropdown-menu .nav-link {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}

/* Mobile nav */
@media (max-width: 1023px) {
    .navbar-toggler {
        display: inline-flex;
    }

    .navbar-collapse {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        background-color: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 0.75rem;
        margin-top: 0.5rem;
    }

    .navbar-collapse.open {
        display: flex;
    }

    .nav {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .nav-dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        padding-left: 0.75rem;
        margin-top: 0.25rem;
        width: 100%;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
    }
}

/* Page layout */
.page-wrapper {
    flex: 1 0 auto;
    width: 100%;
}

.content-row {
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
}

.sidebar,
.main-content {
    min-width: 0;
}

/* Homepage intro */
.homepage-intro {
    padding-top: 1.75rem;
    padding-bottom: 0.5rem;
}

.homepage-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.homepage-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.12) 0%, transparent 40%), radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 35%);
    pointer-events: none;
}

.homepage-hero > * {
    position: relative;
    z-index: 1;
}

.homepage-hero h1 {
    color: #fff;
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.homepage-hero p {
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 0;
    max-width: 720px;
}

.homepage-hero a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.homepage-hero a:hover {
    color: rgba(255, 255, 255, 0.85);
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 0;
}

/* Cards grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

@media (max-width: 767px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 6px var(--shadow);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(45, 57, 51, 0.12);
    text-decoration: none;
    color: inherit;
}

.card__media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background-color: var(--bg-section);
}

.card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card__media img {
    transform: scale(1.04);
}

.card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 1.25rem;
}

.card__category {
    align-self: flex-start;
    margin-bottom: 0.5rem;
}

.card__title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: var(--text-main);
}

.card__title a {
    color: inherit;
    text-decoration: none;
}

.card__title a:hover {
    color: var(--primary);
    text-decoration: none;
}

.card__excerpt {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.55;
    margin-bottom: 1rem;
    flex: 1 1 auto;
}

.card__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.card__meta time {
    color: var(--text-muted);
}

/* Homepage overlay card */
.card--overlay {
    min-height: 280px;
    justify-content: flex-end;
}

.card--overlay .card__media {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
    z-index: 0;
}

.card--overlay .card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(45, 57, 51, 0.15) 0%, rgba(45, 57, 51, 0.78) 100%);
    z-index: 1;
}

.card--overlay .card__body {
    position: relative;
    z-index: 2;
    background: transparent;
    color: #fff;
    padding: 1.5rem;
}

.card--overlay .card__title {
    color: #fff;
    font-size: 1.25rem;
}

.card--overlay .card__title a {
    color: #fff;
}

.card--overlay .card__title a:hover {
    color: var(--accent);
}

.card--overlay .card__excerpt {
    color: rgba(255, 255, 255, 0.85);
}

.card--overlay .card__meta {
    color: rgba(255, 255, 255, 0.8);
}

.card--overlay .badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(4px);
}

/* Card clickable overlay */
.card__link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 10;
}

/* Article page */
.article-header {
    margin-bottom: 1.25rem;
}

.article-header h1 {
    font-size: 1.875rem;
    margin-bottom: 0.75rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.article-image {
    margin: 0 0 1.5rem;
    border-radius: var(--radius);
    overflow: hidden;
    background-color: var(--bg-section);
}

.article-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Article content */
.article-content {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text-main);
}

.article-content h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

.article-content h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.article-content p {
    margin-bottom: 1.25rem;
}

.article-content b,
.article-content strong {
    font-weight: 700;
    color: var(--primary-dark);
}

.article-content em {
    font-style: italic;
}

.article-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.article-content a:hover {
    color: var(--primary-dark);
}

.article-content blockquote {
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--surface) 0%, var(--primary-light) 100%);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-main);
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

.article-content blockquote::before {
    content: "«";
    font-size: 2rem;
    line-height: 1;
    color: var(--primary);
    display: block;
    margin-bottom: 0.25rem;
}

/* Custom content blocks */
.article-content div.infobox,
.article-content div.stat-block,
.article-content div.highlight-box,
.article-content div.step-list,
.article-content div.checklist,
.article-content div.warning-box,
.article-content div.tip-box {
    margin: 1.5rem 0;
    padding: 1.25rem;
    border-radius: var(--radius);
    background-color: var(--surface);
    border: 1px solid var(--border);
}

.article-content div.infobox {
    background: linear-gradient(135deg, var(--surface) 0%, var(--secondary-light) 100%);
    border-left: 4px solid var(--secondary);
}

.article-content div.infobox p,
.article-content div.infobox ul,
.article-content div.infobox li {
    margin-bottom: 0.75rem;
}

.article-content div.infobox li:last-child,
.article-content div.infobox p:last-child {
    margin-bottom: 0;
}

.article-content div.infobox strong {
    color: var(--primary-dark);
}

.article-content div.infobox em {
    color: var(--text-muted);
}

.article-content div.stat-block {
    background: linear-gradient(135deg, var(--surface) 0%, var(--primary-light) 100%);
    border-left: 4px solid var(--primary);
}

.article-content div.stat-block p,
.article-content div.stat-block ul,
.article-content div.stat-block li {
    margin-bottom: 0.75rem;
}

.article-content div.stat-block li:last-child,
.article-content div.stat-block p:last-child {
    margin-bottom: 0;
}

.article-content div.stat-block strong {
    color: var(--primary-dark);
    font-size: 1.125em;
}

.article-content div.highlight-box {
    background: linear-gradient(135deg, var(--accent-light) 0%, #ffffff 100%);
    border-left: 4px solid var(--accent);
}

.article-content div.highlight-box p {
    margin-bottom: 0.75rem;
}

.article-content div.highlight-box p:last-child {
    margin-bottom: 0;
}

.article-content div.highlight-box strong {
    color: var(--primary-dark);
}

.article-content table.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background-color: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 6px var(--shadow);
}

.article-content table.comparison-table thead {
    background-color: var(--primary);
    color: #fff;
}

.article-content table.comparison-table th,
.article-content table.comparison-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.article-content table.comparison-table th {
    font-weight: 700;
}

.article-content table.comparison-table tbody tr:nth-child(even) {
    background-color: var(--bg-page);
}

.article-content table.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.article-content ul.pros-cons {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    display: grid;
    gap: 0.75rem;
}

.article-content ul.pros-cons li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0;
}

.article-content ul.pros-cons li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

.article-content ul.pros-cons strong {
    color: var(--primary-dark);
}

.article-content div.step-list {
    counter-reset: step;
}

.article-content div.step-list ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-content div.step-list li {
    position: relative;
    padding-left: 2.75rem;
    margin-bottom: 1rem;
    min-height: 2rem;
}

.article-content div.step-list li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
    font-size: 0.875rem;
}

.article-content div.step-list li:last-child {
    margin-bottom: 0;
}

.article-content div.step-list strong {
    color: var(--primary-dark);
}

.article-content div.step-list a {
    color: var(--primary);
}

.article-content div.checklist ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-content div.checklist li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.625rem;
}

.article-content div.checklist li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

.article-content div.warning-box {
    background: linear-gradient(135deg, #fff8f0 0%, #ffffff 100%);
    border-left: 4px solid #e8a33d;
}

.article-content div.warning-box p {
    margin-bottom: 0.75rem;
}

.article-content div.warning-box p:last-child {
    margin-bottom: 0;
}

.article-content div.warning-box strong {
    color: #9a5c1d;
}

.article-content div.tip-box {
    background: linear-gradient(135deg, var(--primary-light) 0%, #ffffff 100%);
    border-left: 4px solid var(--accent);
}

.article-content div.tip-box p {
    margin-bottom: 0.75rem;
}

.article-content div.tip-box p:last-child {
    margin-bottom: 0;
}

.article-content div.tip-box strong {
    color: var(--primary-dark);
}

.article-content div.tip-box a {
    color: var(--primary);
}

/* Tags */
.tags-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.tags-label {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags-list a {
    display: inline-flex;
    padding: 0.375rem 0.875rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-main);
    font-size: 0.9375rem;
    text-decoration: none;
}

.tags-list a:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Related articles */
.related-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.related-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.related-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.related-list li {
    margin: 0;
}

.related-list a {
    display: block;
    padding: 0.875rem 1rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-main);
    font-weight: 600;
    text-decoration: none;
}

.related-list a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 0 0 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumbs ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumbs li:not(:last-child)::after {
    content: "/";
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
}

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

.breadcrumbs-item--current {
    color: var(--text-muted);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.widget {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: 0 2px 6px var(--shadow);
}

.sidebar-widget-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

.widget-description {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Tags widget */
.widget-tags--flow .tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.widget-tags--flow .tags-list a {
    font-size: 0.9375rem;
}

/* Recent widget */
.widget-recent--cards .recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.widget-recent--cards .recent-item {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
}

.widget-recent--cards .recent-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: var(--bg-section);
}

.widget-recent--cards .recent-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.widget-recent--cards .recent-title {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main);
    text-decoration: none;
}

.widget-recent--cards .recent-title:hover {
    color: var(--primary);
}

/* Categories widget */
.widget-categories--plain .categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.widget-categories--plain .categories-list li {
    border-bottom: 1px solid var(--border);
}

.widget-categories--plain .categories-list li:last-child {
    border-bottom: none;
}

.widget-categories--plain .categories-list a {
    display: block;
    padding: 0.625rem 0;
    color: var(--text-main);
    font-weight: 500;
    text-decoration: none;
}

.widget-categories--plain .categories-list a:hover {
    color: var(--primary);
    padding-left: 0.25rem;
}

/* Injected widget */
.widget-injected-pages--compact .widget-injected-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.widget-injected-pages--compact .widget-injected-list li {
    border-bottom: 1px solid var(--border);
}

.widget-injected-pages--compact .widget-injected-list li:last-child {
    border-bottom: none;
}

.widget-injected-pages--compact .widget-injected-list a {
    display: block;
    padding: 0.625rem 0;
    color: var(--text-main);
    font-weight: 500;
    text-decoration: none;
}

.widget-injected-pages--compact .widget-injected-list a:hover {
    color: var(--primary);
}

/* Footer */
.site-footer {
    background: linear-gradient(180deg, #24332c 0%, #1a2621 100%);
    color: rgba(255, 255, 255, 0.85);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.site-footer h3,
.site-footer h4 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 1023px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-about p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.65;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-brand-logo {
    width: 40px;
    height: 40px;
}

.footer-brand-name {
    color: #fff;
    font-weight: 800;
    font-size: 1.125rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    display: inline-block;
    padding: 0.25rem 0;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 767px) {
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* Misc */
.text-muted {
    color: var(--text-muted) !important;
}

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

.category-header {
    margin-bottom: 1.5rem;
}

.category-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.category-description {
    color: var(--text-muted);
}

/* Ensure footer stays at bottom */
.page-wrapper {
    flex: 1 0 auto;
}

.site-footer {
    flex-shrink: 0;
}

/* Print */
@media print {
    .site-header,
    .sidebar,
    .site-footer {
        display: none;
    }
}
