:root {
    --portal-bg: #fafbf8;
    --portal-surface: #ffffff;
    --portal-surface-soft: #f1f8ef;
    --portal-green: #2f6b2f;
    --portal-green-dark: #215222;
    --portal-text: #111827;
    --portal-muted: #667085;
    --portal-border: #e2e8e2;
    --portal-shadow: 0 8px 30px rgba(17, 24, 39, 0.05);
}

html {
    background: var(--portal-bg);
}

body.landing-page,
body.admin-panel {
    color: var(--portal-text);
    background: var(--portal-bg);
}

body.landing-page main {
    overflow: clip;
}

.portal-header {
    position: sticky !important;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--portal-border);
    box-shadow: 0 1px 10px rgba(17, 24, 39, 0.03);
}

.portal-header .navbar {
    min-height: 0;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none;
}

.portal-header .portal-header-inner {
    max-width: 1280px;
}

.portal-header .portal-brand strong {
    color: #153d20;
}

.portal-header .portal-search {
    border-color: #dce5dc;
    border-radius: 10px;
    background: #f8faf7;
}

.portal-header .portal-nav-list .nav-link {
    border-radius: 8px;
    color: #4b5563 !important;
}

.portal-header .portal-nav-list .nav-link:hover,
.portal-header .portal-nav-list .nav-link:focus-visible,
.portal-header .portal-nav-list .nav-link.active {
    color: var(--portal-green) !important;
    background: var(--portal-surface-soft);
}

/* Home */
.home-page .home-container {
    max-width: 1240px;
}

.home-page .home-hero {
    position: relative;
    display: flex;
    min-height: 510px;
    align-items: center;
    padding: 4rem 0;
    overflow: hidden;
    background-image:
        linear-gradient(90deg, rgba(13, 32, 20, 0.9) 0%, rgba(17, 44, 27, 0.72) 48%, rgba(17, 44, 27, 0.18) 100%),
        url("../images/hero-rabbit.jpg");
    background-position: center;
    background-size: cover;
}

.home-page .home-hero::after {
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    content: "";
}

.home-hero-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.home-page .home-eyebrow {
    min-height: 28px;
    margin-bottom: 1rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #cce4cc;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
}

.home-page .home-hero-title {
    max-width: 14ch;
    margin: 0;
    color: #fff;
    font-family: "Inter", sans-serif;
    font-size: clamp(2.8rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.04;
}

.home-page .home-hero-lead {
    max-width: 620px;
    margin: 1.25rem 0 1.6rem;
    color: #e7eee8;
    font-size: 1.1rem;
    line-height: 1.7;
}

.home-hero-search {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    width: min(620px, 100%);
    min-height: 58px;
    padding: 0.35rem 0.4rem 0.35rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
    color: var(--portal-green);
}

.home-hero-search input {
    min-width: 0;
    height: 48px;
    padding: 0 0.75rem;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--portal-text);
    font-size: 0.96rem;
}

.home-hero-search button {
    min-height: 46px;
    padding: 0.65rem 1.2rem;
    border: 0;
    border-radius: 10px;
    background: var(--portal-green);
    color: #fff;
    font-weight: 800;
}

.home-hero-search button:hover,
.home-hero-search button:focus-visible {
    background: var(--portal-green-dark);
}

.home-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1.25rem;
    margin-top: 1.25rem;
    color: #e3ece4;
    font-size: 0.82rem;
    font-weight: 650;
}

.home-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.portal-topic-strip {
    border-bottom: 1px solid var(--portal-border);
    background: #fff;
}

.portal-topic-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-topic-link {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 20px;
    gap: 0.75rem;
    align-items: center;
    min-width: 0;
    min-height: 112px;
    padding: 1rem 1.15rem;
    border-right: 1px solid var(--portal-border);
    color: var(--portal-text);
    text-decoration: none;
}

.portal-topic-link:first-child {
    border-left: 1px solid var(--portal-border);
}

.portal-topic-link:hover,
.portal-topic-link:focus-visible {
    color: var(--portal-text);
    background: var(--portal-surface-soft);
}

.portal-topic-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--portal-surface-soft);
    color: var(--portal-green);
    font-size: 1.1rem;
}

.portal-topic-link strong,
.portal-topic-link small {
    display: block;
}

.portal-topic-link strong {
    font-size: 0.93rem;
}

.portal-topic-link small {
    margin-top: 0.2rem;
    color: var(--portal-muted);
    font-size: 0.76rem;
    line-height: 1.4;
}

.portal-topic-link > i {
    color: var(--portal-green);
}

.home-page .section-gap-sm {
    margin-top: clamp(3.25rem, 6vw, 5rem);
    margin-bottom: clamp(3.25rem, 6vw, 5rem);
}

.home-page .section-lead,
.portal-archive-page .section-lead {
    margin-bottom: 0.5rem;
    color: var(--portal-green);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.home-page .decor-title {
    margin: 0;
    color: var(--portal-text);
    font-family: "Inter", sans-serif;
    font-size: clamp(2rem, 3.4vw, 3rem);
    font-weight: 800;
    line-height: 1.12;
}

.home-page .section-heading-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.home-page .section-link {
    min-height: 44px;
    color: var(--portal-green);
}

/* Shared article cards */
.blog-grid {
    gap: 1.25rem;
}

.blog-card {
    display: flex;
    min-width: 0;
    min-height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--portal-shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.blog-card:hover,
.blog-card:focus-within {
    border-color: #bfd4bd;
    box-shadow: 0 16px 38px rgba(30, 71, 36, 0.09);
    transform: translateY(-2px);
}

.blog-card-media {
    width: 100%;
    min-height: 0;
    aspect-ratio: 16 / 10;
    padding: 0;
    overflow: hidden;
    border-bottom: 1px solid var(--portal-border);
    background: #eef4ec;
}

.blog-card-image {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    object-fit: cover;
}

.blog-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.25rem;
}

.blog-card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--portal-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.blog-card-category {
    padding: 0.28rem 0.5rem;
    border-radius: 6px;
    background: var(--portal-surface-soft);
    color: var(--portal-green);
    text-decoration: none;
}

.blog-card-topline > span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.blog-card-title {
    margin: 0 0 0.65rem;
    color: var(--portal-text);
    font-family: "Inter", sans-serif;
    font-size: clamp(1.15rem, 1.7vw, 1.42rem);
    font-weight: 800;
    line-height: 1.25;
}

.blog-card-excerpt {
    display: -webkit-box;
    margin-bottom: 1rem !important;
    overflow: hidden;
    color: var(--portal-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid #edf0ed;
}

.blog-card-footer time {
    color: var(--portal-muted);
    font-size: 0.76rem;
}

.blog-card-footer a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--portal-green);
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

.home-page .blog-home-grid.blog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-page .popular-featured-card,
.home-page .home-trust-panel {
    overflow: hidden;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--portal-shadow);
}

.home-page .popular-featured-card {
    grid-template-columns: minmax(240px, 0.95fr) minmax(0, 1.05fr);
}

.home-page .popular-featured-media {
    padding: 0;
    background: #eef4ec;
}

.home-page .popular-featured-media img {
    min-height: 330px;
    border-radius: 0;
}

.home-page .popular-featured-body h3 {
    font-family: "Inter", sans-serif;
    font-weight: 800;
}

.home-page .popular-list-item {
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
}

.home-page .category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.home-page .category-card {
    display: grid;
    min-height: 220px;
    padding: 1.3rem;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--portal-shadow);
}

.home-page .category-card:hover,
.home-page .category-card:focus-visible {
    border-color: #bfd4bd;
    box-shadow: 0 16px 38px rgba(30, 71, 36, 0.08);
}

.home-page .category-icon,
.home-page .home-trust-icon {
    border-radius: 10px;
    background: var(--portal-surface-soft);
    color: var(--portal-green);
}

.home-page .category-title {
    color: var(--portal-text);
    font-size: 1.2rem;
    font-weight: 800;
}

.home-page .category-description {
    color: var(--portal-muted);
    font-size: 0.9rem;
}

.home-page .home-trust-panel {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
    padding: 1.75rem;
    background: var(--portal-surface-soft);
}

.home-page .home-trust-card {
    border-color: #dce8da;
    border-radius: 12px;
    background: #fff;
}

/* Blog and categories */
.portal-archive-page {
    background: var(--portal-bg);
}

.portal-archive-hero {
    padding: 2.25rem 0 1.35rem;
    border-bottom: 1px solid var(--portal-border);
    background: #fff;
}

.portal-archive-hero .blog-breadcrumbs {
    margin-bottom: 1.4rem;
}

.portal-archive-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
}

.portal-archive-heading > div {
    min-width: 0;
}

.portal-archive-page .blog-hero-title {
    max-width: 18ch;
    margin: 0;
    color: var(--portal-text);
    font-family: "Inter", sans-serif;
    font-size: clamp(2.25rem, 4vw, 3.6rem);
    font-weight: 800;
    line-height: 1.08;
}

.portal-archive-page .blog-lead {
    max-width: 65ch;
    margin: 0.85rem 0 0;
    color: var(--portal-muted);
    font-size: 1rem;
    line-height: 1.65;
}

.portal-result-count {
    margin: 0.7rem 0 0;
    color: var(--portal-green);
    font-size: 0.82rem;
    font-weight: 800;
}

.portal-archive-search {
    display: grid;
    grid-template-columns: auto minmax(190px, 300px) auto;
    align-items: center;
    min-height: 48px;
    padding: 0.25rem 0.3rem 0.25rem 0.8rem;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    background: #f8faf7;
    color: var(--portal-green);
}

.portal-archive-search input {
    min-width: 0;
    height: 42px;
    padding: 0 0.65rem;
    border: 0;
    outline: 0;
    background: transparent;
}

.portal-archive-search button {
    min-height: 40px;
    padding: 0.5rem 0.9rem;
    border: 0;
    border-radius: 8px;
    background: var(--portal-green);
    color: #fff;
    font-weight: 750;
}

.portal-category-nav {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.6rem;
    padding-bottom: 0.15rem;
    overflow-x: auto;
}

.portal-category-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    background: #fff;
    color: #4b5563;
    font-size: 0.78rem;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}

.portal-category-nav a:hover,
.portal-category-nav a:focus-visible,
.portal-category-nav a.active {
    border-color: #b8d2b5;
    background: var(--portal-surface-soft);
    color: var(--portal-green);
}

.portal-archive-content {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.portal-archive-page .blog-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2rem;
}

.portal-archive-page .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-archive-page .blog-sidebar-column {
    top: 140px;
}

.portal-archive-page .blog-post-card {
    padding: 1.25rem;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--portal-shadow);
}

.blog-pagination a,
.blog-pagination span {
    min-width: 42px;
    min-height: 42px;
    border-color: var(--portal-border);
    border-radius: 8px;
    background: #fff;
    color: var(--portal-text);
}

.blog-pagination .active {
    border-color: var(--portal-green);
    background: var(--portal-green);
    color: #fff;
}

/* Footer */
.site-footer-home {
    margin-top: 0;
    padding: 3.25rem 0 1.25rem;
    border-top: 1px solid var(--portal-border);
    background: #fff;
}

.footer-content-home {
    color: #4b5563;
}

.footer-brand {
    color: #153d20;
}

.footer-heading {
    color: var(--portal-text);
}

.footer-link {
    color: #52605a;
}

.footer-link:hover,
.footer-link:focus-visible {
    color: var(--portal-green);
}

/* Admin */
body.admin-panel .admin-wrapper {
    max-width: 1280px;
}

body.admin-panel .admin-page-header {
    border-radius: 16px;
    background: #fff;
}

body.admin-panel .admin-heading {
    color: var(--portal-text);
    font-family: "Inter", sans-serif;
    font-weight: 800;
}

body.admin-panel .admin-kicker {
    color: var(--portal-green);
    font-weight: 800;
}

body.admin-panel .admin-stat-card {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    overflow: hidden;
}

body.admin-panel .admin-stat-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--portal-green);
    content: "";
}

body.admin-panel .admin-stat-card strong {
    display: block;
    color: var(--portal-text);
    font-family: "Inter", sans-serif;
    font-weight: 800;
}

body.admin-panel .admin-stat-card > div > span {
    margin-bottom: 0.35rem;
}

.admin-stat-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 !important;
    border-radius: 12px;
    background: var(--portal-surface-soft);
    color: var(--portal-green) !important;
    font-size: 1.15rem;
}

body.admin-panel .admin-table-header,
body.admin-panel .admin-table thead th {
    background: #f7faf6;
}

body.admin-panel .admin-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

body.admin-panel .btn-rabbit {
    border-color: var(--portal-green);
    background: var(--portal-green);
}

body.admin-panel .btn-rabbit:hover,
body.admin-panel .btn-rabbit:focus-visible {
    border-color: var(--portal-green-dark);
    background: var(--portal-green-dark);
}

@media (max-width: 1199.98px) {
    .home-page .blog-home-grid.blog-grid,
    .home-page .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-topic-link:nth-child(2) {
        border-right: 0;
    }

    .portal-topic-link:nth-child(n + 3) {
        border-top: 1px solid var(--portal-border);
    }
}

@media (max-width: 991.98px) {
    .portal-header .portal-header-inner {
        padding-top: 0.55rem;
        padding-bottom: 0.55rem;
    }

    .home-page .home-hero {
        min-height: 480px;
        padding: 3.25rem 0;
        background-position: 60% center;
    }

    .home-page .home-hero-title {
        max-width: 12ch;
    }

    .home-page .popular-layout,
    .home-page .popular-featured-card,
    .home-page .home-trust-panel {
        grid-template-columns: 1fr;
    }

    .portal-archive-heading {
        display: grid;
        align-items: start;
    }

    .portal-archive-search {
        width: min(100%, 520px);
    }

    .portal-archive-page .blog-layout {
        grid-template-columns: 1fr;
    }

    .portal-archive-page .blog-sidebar-column {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .home-page .home-hero {
        min-height: 0;
        padding: 2.35rem 0 2rem;
        background-position: 66% center;
    }

    .home-page .home-hero::before {
        position: absolute;
        inset: 0;
        background: rgba(12, 35, 20, 0.22);
        content: "";
    }

    .home-page .home-hero-title {
        max-width: 11ch;
        font-size: 2.3rem;
    }

    .home-page .home-hero-lead {
        margin-top: 0.9rem;
        margin-bottom: 1.1rem;
        font-size: 1rem;
    }

    .home-hero-search {
        grid-template-columns: auto minmax(0, 1fr);
        padding-right: 0.75rem;
    }

    .home-hero-search button {
        grid-column: 1 / -1;
        width: 100%;
        margin-bottom: 0.35rem;
    }

    .home-hero-meta {
        display: flex;
        gap: 0.5rem 0.8rem;
        margin-top: 0.85rem;
        font-size: 0.75rem;
    }

    .portal-topic-grid,
    .home-page .blog-home-grid.blog-grid,
    .home-page .category-grid,
    .portal-archive-page .blog-grid {
        grid-template-columns: 1fr;
    }

    .portal-topic-link,
    .portal-topic-link:first-child,
    .portal-topic-link:nth-child(2) {
        min-height: 92px;
        border: 0;
        border-bottom: 1px solid var(--portal-border);
    }

    .home-page .section-heading-row {
        align-items: flex-start;
    }

    .home-page .decor-title {
        font-size: 1.85rem;
    }

    .portal-archive-hero {
        padding-top: 1.25rem;
    }

    .portal-archive-page .blog-hero-title {
        font-size: 2.15rem;
    }

    .portal-archive-search {
        grid-template-columns: auto minmax(0, 1fr);
        padding-right: 0.75rem;
    }

    .portal-archive-search button {
        grid-column: 1 / -1;
        width: 100%;
        margin-bottom: 0.35rem;
    }

    .portal-archive-content {
        padding-top: 1.25rem;
    }

    .blog-card-body {
        padding: 1.1rem;
    }

    .site-footer-home {
        padding-top: 2.5rem;
    }

    body.admin-panel .admin-table-header {
        align-items: flex-start;
    }
}
