:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-soft: #f8f9fd;
    --text: #1b2240;
    --muted: #63719a;
    --primary: #3357d7;
    --primary-dark: #1f3fad;
    --border: #e4e9f7;
    --radius: 18px;
    --shadow: 0 12px 40px rgba(15, 35, 95, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

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

.container {
    width: min(1160px, 92vw);
    margin-inline: auto;
}

.site-header {
    position: relative;
    z-index: 20;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.site-brand-band {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid var(--border);
}

.brand-band-inner {
    min-height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 0;
}

.site-brand-logo {
    width: min(380px, 74vw);
    max-width: 100%;
    height: auto;
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 90px;
}

.brand {
    display: flex;
    align-items: center;
}

.brand-small {
    width: 165px;
    height: auto;
}

.main-nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    height: 40px;
}

.main-nav a + a {
    border-left: 1px solid #dfe5f3;
    padding-left: 14px;
}

.main-nav a:hover {
    color: var(--primary);
}

.main-nav a.is-active {
    color: var(--primary-dark);
}

.btn {
    border: 0;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

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

.btn.secondary {
    background: #e8eeff;
    color: var(--primary-dark);
}

.btn.ghost {
    border: 1px solid var(--border);
    background: var(--surface);
}

.nav-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.icon-search {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-search:hover {
    color: var(--primary);
    border-color: #c8d3f8;
}

.icon-search svg {
    width: 22px;
    height: 22px;
}

.hero {
    padding: 56px 0 26px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 28px;
    align-items: stretch;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.hero h1 {
    margin: 0 0 14px;
    font-size: clamp(1.8rem, 3.2vw, 3rem);
    line-height: 1.15;
}

.lead {
    margin: 0;
    color: var(--muted);
    max-width: 60ch;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(100px, 1fr));
    gap: 12px;
}

.stats article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}

.stats strong {
    display: block;
    font-size: 1.4rem;
}

.stats span {
    color: var(--muted);
    font-size: .9rem;
}

.hero-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-card img {
    width: 100%;
    height: 290px;
    object-fit: cover;
}

.hero-card-body {
    padding: 18px;
}

.hero-card-body span {
    color: var(--primary);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.hero-card-body h3 {
    margin: 8px 0;
}

.hero-card-body p {
    color: var(--muted);
    margin: 0 0 10px;
}

.hero-card-body a {
    color: var(--primary-dark);
    font-weight: 700;
}

section {
    padding: 28px 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 14px;
    margin-bottom: 16px;
}

.section-head h2 {
    margin: 0;
    font-size: clamp(1.2rem, 2.4vw, 1.9rem);
}

.section-head p,
.section-head a {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.section-head a:hover {
    color: var(--primary-dark);
}

.categories .category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.category-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 18px;
    box-shadow: var(--shadow);
}

.category-card h3 {
    margin: 0 0 8px;
}

.category-card span {
    color: var(--muted);
}

.listing.alt {
    background: var(--surface-soft);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.cards-grid {
    display: grid;
    gap: 16px;
}

.cards-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.comment-section {
    margin-top: 24px;
}

.comment-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 26px;
}

.comment-card h2 {
    margin: 0 0 18px;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.comment-alert {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.comment-alert p {
    margin: 0;
}

.comment-alert p + p {
    margin-top: 4px;
}

.comment-alert.success {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #067647;
}

.comment-alert.error {
    background: #fef3f2;
    border: 1px solid #fecdca;
    color: #b42318;
}

.comment-form {
    display: grid;
    gap: 14px;
}

.comment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.comment-form label {
    display: grid;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0;
    background: #fff;
    color: var(--text);
    padding: 14px 16px;
    font: inherit;
}

.comment-form textarea {
    resize: vertical;
    min-height: 82px;
}

.comment-form small {
    color: var(--muted);
    font-weight: 500;
}

.comment-submit {
    justify-self: start;
    border: 1px solid #1b2240;
    background: #fff;
    color: #1b2240;
    border-radius: 0;
    padding: 10px 16px;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.comment-submit:hover {
    background: #f8f9fd;
}

.approved-comments {
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    display: grid;
    gap: 12px;
}

.approved-comments h3 {
    margin: 0;
    font-size: 1.1rem;
}

.approved-comment-item {
    border: 1px solid var(--border);
    background: var(--surface-soft);
    padding: 12px 14px;
}

.approved-comment-item header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}

.approved-comment-item header span {
    color: var(--muted);
    font-size: .86rem;
}

.approved-comment-item p {
    margin: 0;
    color: var(--text);
}

.approved-pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.approved-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    padding: 0 10px;
    font-weight: 600;
}

.approved-pagination a:hover {
    border-color: #c7d5ff;
    color: var(--primary-dark);
}

.approved-pagination a.is-current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.media-card,
.mini-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
}

.media-card .thumb,
.mini-card a {
    display: block;
}

.media-card .thumb::after,
.mini-card > a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
}

.media-card .card-body,
.mini-card .card-body {
    position: relative;
    z-index: 3;
}

.media-card .thumb img,
.mini-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.card-body {
    padding: 14px;
}

.card-body h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.card-body h3 a {
    color: inherit;
    text-decoration: none;
}

.card-body h3 a:hover {
    color: var(--primary-dark);
}

.card-body p {
    margin: 0;
    color: var(--muted);
    font-size: .74rem;
}

.card-body .meta,
.card-body .badge {
    margin-bottom: 6px;
    font-size: .82rem;
    font-weight: 700;
    color: var(--primary);
}

.media-card.horizontal .thumb img {
    aspect-ratio: 16 / 10;
}

.placeholder {
    min-height: 120px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: .9rem;
}

.newsletter-wrap {
    background: linear-gradient(120deg, #2d4fc6, #5a79eb);
    border-radius: 20px;
    padding: 28px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.newsletter-wrap h2 {
    margin: 6px 0;
}

.newsletter-wrap p {
    margin: 0;
    max-width: 56ch;
    opacity: .92;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    width: min(420px, 100%);
}

.newsletter-form input {
    flex: 1;
    border: 1px solid #2746b8;
    background: rgba(255, 255, 255, .15);
    border-radius: 12px;
    padding: 12px 14px;
    color: #fff;
}

.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, .8);
}

.search-form input {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

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

.newsletter-form .btn.primary {
    background: #fff;
    color: #2746b8;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.page-hero {
    padding: 44px 0 16px;
}

.page-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.page-hero p {
    margin: 0;
    color: var(--muted);
    max-width: 70ch;
}

.empty-state {
    margin: 12px 0 0;
    color: var(--muted);
}

.listing-with-sidebar {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}

.listing-sidebar {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    padding: 14px;
    position: sticky;
    top: 18px;
}

.listing-sidebar h3 {
    margin: 0 0 12px;
    text-transform: uppercase;
    color: var(--primary-dark);
    font-size: 1.45rem;
    letter-spacing: .02em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.sidebar-link {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecf8;
    color: var(--text);
    font-weight: 500;
    font-size: 13px;
}

.sidebar-link:last-child {
    border-bottom: 0;
}

.sidebar-link:hover,
.sidebar-link.is-active {
    color: var(--primary-dark);
}

.listing-content .empty-state {
    margin-top: 0;
    margin-bottom: 10px;
}

.filter-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.filter-tab {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 14px;
    background: var(--surface);
    color: var(--muted);
    font-weight: 700;
    font-size: .9rem;
}

.filter-tab:hover {
    color: var(--primary-dark);
    border-color: #c8d3f8;
}

.filter-tab.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border-radius: 10px;
    padding: 0 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-weight: 700;
}

.page-link:hover {
    color: var(--primary-dark);
    border-color: #c8d3f8;
}

.page-link.is-current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.detail-shell {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.detail-title {
    margin: 0 0 8px;
    font-size: clamp(1.4rem, 2.8vw, 2.2rem);
}

.detail-meta {
    color: var(--muted);
    margin: 0 0 16px;
}

.detail-main-image {
    width: 100%;
    max-height: 640px;
    object-fit: contain;
    border-radius: 12px;
    background: #eef2ff;
    margin: 6px 0 18px;
}

.detail-content {
    color: #303b65;
    line-height: 1.9;
}

.detail-content p {
    margin: 0 0 14px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.gallery-grid a {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.gallery-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.timeline-vertical {
    position: relative;
    display: grid;
    gap: 18px;
    padding: 4px 0;
}

.timeline-vertical::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, var(--primary), #9fb2f3);
}

.timeline-item {
    position: relative;
    width: calc(50% - 26px);
}

.timeline-item::before {
    content: "";
    position: absolute;
    top: 22px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(51, 87, 215, .2);
}

.timeline-item:nth-child(odd) {
    margin-right: auto;
}

.timeline-item:nth-child(odd)::before {
    right: -31px;
}

.timeline-item:nth-child(even) {
    margin-left: auto;
}

.timeline-item:nth-child(even)::before {
    left: -31px;
}

.timeline-item:nth-child(even) .timeline-card,
.timeline-item:nth-child(even) .timeline-year {
    text-align: left;
}

.timeline-item:nth-child(odd) .timeline-card,
.timeline-item:nth-child(odd) .timeline-year {
    text-align: right;
}

.timeline-year {
    margin: 0 0 8px;
    color: var(--primary-dark);
    font-weight: 800;
    letter-spacing: .02em;
}

.timeline-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f9fbff;
    padding: 14px 16px;
}

.timeline-card p {
    margin: 0;
    color: #2f3a64;
    line-height: 1.8;
}

@media (max-width: 900px) {
    .timeline-vertical {
        padding-left: 30px;
    }

    .timeline-vertical::before {
        left: 10px;
        transform: none;
    }

    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        width: 100%;
        margin: 0;
    }

    .timeline-item::before,
    .timeline-item:nth-child(odd)::before,
    .timeline-item:nth-child(even)::before {
        left: -24px;
        right: auto;
    }

    .timeline-item:nth-child(odd) .timeline-card,
    .timeline-item:nth-child(odd) .timeline-year,
    .timeline-item:nth-child(even) .timeline-card,
    .timeline-item:nth-child(even) .timeline-year {
        text-align: left;
    }
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(11, 18, 43, .88);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    z-index: 1000;
}

.lightbox.is-open {
    display: flex;
}

.lightbox img {
    max-width: min(1100px, 94vw);
    max-height: 88vh;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 45px rgba(0, 0, 0, .35);
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: 0;
    border-radius: 999px;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    border-radius: 999px;
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox-prev {
    left: 16px;
}

.lightbox-next {
    right: 16px;
}

.footer-wrap {
    min-height: 74px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    color: var(--muted);
}

.footer-wrap nav {
    display: flex;
    gap: 14px;
}

.sr-only {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

@media (max-width: 1024px) {
    .brand-band-inner {
        min-height: 150px;
    }

    .hero-grid,
    .categories .category-grid,
    .cards-grid.cols-4,
    .cards-grid.cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .newsletter-wrap {
        flex-direction: column;
        align-items: flex-start;
    }

    .cards-grid.cols-4.related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .listing-with-sidebar {
        grid-template-columns: 1fr;
    }

    .listing-sidebar {
        position: static;
    }
}

@media (max-width: 720px) {
    .brand-band-inner {
        min-height: 120px;
    }

    .brand-small {
        width: 130px;
    }

    .main-nav {
        display: none;
    }

    .nav-actions {
        margin-left: auto;
    }

    .hero-grid,
    .categories .category-grid,
    .cards-grid.cols-4,
    .cards-grid.cols-3,
    .comment-grid,
    .stats,
    .newsletter-form,
    .footer-wrap {
        grid-template-columns: 1fr;
        display: grid;
    }

    .footer-wrap nav {
        flex-wrap: wrap;
    }

    .lightbox {
        padding: 16px;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.6rem;
    }
}
