* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    color: #24313d;
    background: #fbfaf7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.7;
}

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

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

.wrap {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: relative;
    z-index: 20;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid #e7e0d4;
    box-shadow: 0 12px 35px rgba(36, 49, 61, .08);
}

.topline {
    background: #233946;
    color: #e9f4f1;
    font-size: 13px;
}

.topline .wrap {
    min-height: 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.nav-wrap {
    position: relative;
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    min-width: 260px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #b23a31;
    border-radius: 8px;
    font-weight: 800;
    font-size: 26px;
    box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .1);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    color: #1f2e39;
    line-height: 1.2;
    font-size: 18px;
}

.brand small {
    color: #697a86;
    font-size: 12px;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.main-nav > a,
.nav-item > a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 12px;
    color: #2f3c45;
    border-radius: 6px;
    font-size: 15px;
    white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.is-current {
    color: #9c2f29;
    background: #f6ebe3;
}

.nav-item {
    position: relative;
    display: inline-flex;
}

.sub-nav {
    position: absolute;
    left: 0;
    top: 42px;
    min-width: 180px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e7e0d4;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(31, 46, 57, .14);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: .18s ease;
}

.sub-nav a {
    display: block;
    padding: 8px 10px;
    color: #364753;
    border-radius: 6px;
}

.nav-item:hover .sub-nav {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #d7ccbf;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: #24313d;
    transition: transform .2s ease, opacity .2s ease;
}

.nav-toggle.is-open {
    border-color: #b23a31;
    box-shadow: 0 8px 22px rgba(178, 58, 49, .16);
}

.nav-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.hero {
    min-height: 580px;
    display: flex;
    align-items: center;
    color: #fff;
    background: linear-gradient(90deg, rgba(20, 37, 52, .92), rgba(20, 37, 52, .54)), #233946;
    background-size: cover;
    background-position: center;
}

.hero-content {
    padding: 84px 0 98px;
}

.eyebrow {
    margin: 0 0 12px;
    color: #b75a3d;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero .eyebrow,
.page-hero .eyebrow {
    color: #f0c36a;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

.hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: 52px;
    line-height: 1.15;
    letter-spacing: 0;
}

.lead,
.hero p.lead {
    max-width: 680px;
    margin: 24px 0 0;
    color: rgba(255, 255, 255, .88);
    font-size: 18px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 34px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid #d8cec0;
    border-radius: 7px;
    background: #fff;
    color: #283743;
    font-weight: 700;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(36, 49, 61, .12);
}

.button.primary {
    border-color: #b23a31;
    background: #b23a31;
    color: #fff;
}

.button.ghost {
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .55);
}

.button.ghost.dark {
    color: #283743;
    border-color: #bdcfc8;
    background: #eef6f2;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin-top: -54px;
    background: #dfd5c8;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 22px 55px rgba(45, 49, 54, .14);
}

.stats div {
    min-height: 108px;
    padding: 22px 28px;
    background: #fff;
}

.stats strong {
    display: block;
    color: #b23a31;
    font-size: 34px;
    line-height: 1;
}

.stats span {
    color: #60717b;
}

.section {
    padding: 76px 0;
}

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

.section-head.compact {
    display: block;
    margin-bottom: 18px;
}

.section-head h2,
.about-row h2 {
    margin: 0;
    color: #1f2e39;
    font-size: 32px;
    line-height: 1.25;
}

.section-head a {
    color: #b23a31;
    font-weight: 700;
}

.program-grid,
.content-grid,
.certificate-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.program-card,
.content-card,
.certificate-card {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    padding: 22px;
    background: #fff;
    border: 1px solid #e7e0d4;
    border-radius: 8px;
    box-shadow: 0 14px 35px rgba(50, 60, 70, .07);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
    overflow: hidden;
}

.program-card img,
.content-card img {
    width: 100%;
    height: 176px;
    object-fit: cover;
    margin: -22px -22px 18px;
    max-width: calc(100% + 44px);
    border-radius: 8px 8px 0 0;
    transition: transform .35s ease, filter .35s ease;
}

.program-card:hover,
.content-card:hover,
.certificate-card:hover {
    transform: translateY(-4px);
    border-color: #d4c6b7;
    box-shadow: 0 22px 48px rgba(40, 55, 67, .12);
}

.program-card:hover img,
.content-card:hover img {
    transform: scale(1.035);
    filter: saturate(1.04);
}

.program-card h3,
.content-card h2,
.certificate-card h2,
.list-card h3 {
    margin: 0 0 10px;
    color: #21313d;
    line-height: 1.35;
}

.program-card p,
.content-card p,
.certificate-card p,
.list-card p,
.muted,
.empty {
    color: #61717a;
}

.content-card span,
.certificate-card span,
.side-panel span,
.list-card time {
    color: #2f7f73;
    font-size: 13px;
    font-weight: 700;
}

.band {
    background: #eef4f1;
    border-top: 1px solid #d8e5df;
    border-bottom: 1px solid #d8e5df;
}

.split,
.about-row,
.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 38px;
    align-items: start;
}

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

.list-card {
    padding: 18px 0;
    border-top: 1px solid #ceddd7;
}

.list-card:first-of-type {
    border-top: 0;
}

.about-row {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, .75fr);
}

.video-list {
    padding: 26px;
    background: #233946;
    color: #fff;
    border-radius: 8px;
}

.video-list h3 {
    margin-top: 0;
}

.video-list a {
    display: block;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, .16);
}

.page-hero {
    padding: 80px 0;
    color: #fff;
    background: linear-gradient(110deg, #233946, #2f7f73);
}

.page-hero.slim {
    padding: 58px 0;
}

.page-hero h1 {
    max-width: 900px;
    margin: 0;
    font-size: 42px;
    line-height: 1.2;
}

.page-hero p {
    max-width: 760px;
    color: rgba(255, 255, 255, .88);
}

.side-nav,
.side-panel {
    padding: 20px;
    background: #fff;
    border: 1px solid #e7e0d4;
    border-radius: 8px;
}

.side-nav h3,
.side-panel h3 {
    margin: 0 0 12px;
}

.side-nav a,
.side-panel a {
    display: block;
    padding: 11px 0;
    border-top: 1px solid #eee7dd;
}

.side-nav a.is-current {
    color: #b23a31;
}

.article,
.article-body {
    min-width: 0;
}

.article {
    padding: 0;
}

.article-cover {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 24px;
}

.article-body {
    color: #2b3a45;
    font-size: 17px;
    word-break: break-word;
}

.article-body img {
    height: auto !important;
    margin: 18px auto;
    border-radius: 6px;
}

.article-body table {
    width: 100% !important;
    border-collapse: collapse;
}

.article-body td,
.article-body th {
    border: 1px solid #ddd4c7;
    padding: 8px;
}

.download-box,
.certificate-panel {
    margin-top: 28px;
    padding: 22px;
    background: #fff;
    border: 1px solid #e7e0d4;
    border-radius: 8px;
}

.certificate-panel dl {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 8px 14px;
}

.certificate-panel dt {
    color: #60717b;
}

.search-form,
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.search-form input,
.filters input,
.filters select {
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #d8cec0;
    border-radius: 7px;
    background: #fff;
}

.search-form input {
    min-width: min(100%, 360px);
    flex: 1;
}

.pager {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pager a {
    min-width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1px solid #d8cec0;
    border-radius: 6px;
}

.pager a.is-current {
    color: #fff;
    background: #b23a31;
    border-color: #b23a31;
}

.site-footer {
    color: #dce6e2;
    background: #1f2e39;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr .7fr 1fr;
    gap: 34px;
    padding: 48px 0;
}

.site-footer h3 {
    color: #fff;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-links a {
    padding: 6px 9px;
    background: rgba(255, 255, 255, .08);
    border-radius: 6px;
}

.footer-bottom {
    padding: 16px 0;
    color: #b9c8c4;
    background: rgba(0, 0, 0, .18);
}

.footer-bottom a {
    margin-left: 12px;
    color: #f0c36a;
}

/* Redesign pass: clearer content rhythm and safer legacy layouts. */
.program-grid,
.content-grid,
.certificate-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.category-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 34px;
    align-items: start;
}

.category-main {
    min-width: 0;
}

.category-main .content-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.side-nav {
    position: static;
}

.side-nav a {
    color: #40515d;
}

.side-nav a:hover,
.side-nav a.is-current {
    color: #a9342c;
    font-weight: 800;
}

.program-card {
    overflow: hidden;
}

.program-card:focus-visible,
.content-card:focus-within,
.certificate-card:focus-visible {
    outline: 3px solid rgba(47, 127, 115, .28);
    outline-offset: 3px;
}

.content-card h2 {
    font-size: 20px;
}

.content-card p,
.certificate-card p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.article-body {
    max-width: 780px;
}

.article-body img {
    max-width: 100% !important;
}

.article-body iframe,
.article-body video {
    width: 100% !important;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto !important;
    min-height: 420px;
    border: 0;
    border-radius: 8px;
    background: #e8f0ec;
}

.article-body iframe[src*="lxi.me"] {
    aspect-ratio: auto;
    height: min(1500px, 160vh) !important;
}

.join-flow-block,
.support-board,
.volunteer-callout {
    display: grid;
    gap: 24px;
}

.flow-intro,
.support-lead,
.volunteer-callout {
    padding: 28px;
    border: 1px solid #d8e4dd;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff, #f1f7f3);
}

.flow-intro h2,
.support-lead h2,
.volunteer-callout h2 {
    margin: 0;
    color: #1f2e39;
    font-size: 30px;
    line-height: 1.25;
}

.flow-intro p:last-child,
.support-lead p:last-child,
.volunteer-callout p:last-child {
    margin-bottom: 0;
    color: #5d6f69;
}

.flow-poster {
    width: 100%;
    border: 1px solid #dbe5df;
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(36, 49, 61, .12);
}

.flow-steps,
.support-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.flow-step,
.support-tile {
    min-width: 0;
    padding: 22px;
    border: 1px solid #e4ddd0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(42, 55, 65, .07);
}

.flow-step span,
.support-tile span {
    display: inline-grid;
    min-width: 40px;
    min-height: 30px;
    place-items: center;
    margin-bottom: 12px;
    padding: 0 10px;
    color: #9c2f29;
    background: #f7ebe3;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.flow-step h3,
.support-tile h3 {
    margin: 0 0 10px;
    color: #22323d;
    font-size: 19px;
    line-height: 1.35;
}

.flow-step p,
.support-tile p {
    margin: 8px 0 0;
    color: #5e6f69;
}

.support-tile:nth-child(2) span {
    color: #256f64;
    background: #e3f2ec;
}

.support-tile:nth-child(3) span {
    color: #81601e;
    background: #fbf2d4;
}

.support-tile a {
    color: #a9342c;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.join-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-content,
.page-hero .wrap,
.stats {
    animation: fadeUp .7s ease both;
}

.stats {
    animation-delay: .1s;
}

.has-reveal .reveal-item {
    opacity: 1;
    transform: none;
}

.has-reveal .reveal-item.is-visible {
    animation: fadeUp .55s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .nav-toggle {
        display: block;
    }

    .main-nav {
        position: absolute;
        left: 0;
        right: 0;
        top: calc(100% + 8px);
        display: none;
        padding: 10px;
        background: #fff;
        border: 1px solid #e7e0d4;
        border-radius: 8px;
        box-shadow: 0 20px 50px rgba(31, 46, 57, .16);
        max-height: min(72vh, 620px);
        overflow: auto;
    }

    .main-nav.is-open {
        display: block;
    }

    .main-nav > a,
    .nav-item,
    .nav-item > a {
        display: block;
        width: 100%;
    }

    .sub-nav {
        position: static;
        opacity: 1;
        pointer-events: auto;
        transform: none;
        box-shadow: none;
        border: 0;
        background: #f8fbf9;
        padding: 0 0 6px 16px;
    }

    .hero {
        min-height: 520px;
    }

    .hero h1 {
        font-size: 40px;
    }

    .program-grid,
    .content-grid,
    .certificate-grid,
    .category-layout,
    .split,
    .about-row,
    .two-col,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .side-nav {
        position: static;
    }

    .flow-steps,
    .support-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .wrap {
        width: min(100% - 24px, 1160px);
    }

    .topline .wrap {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding: 8px 0;
    }

    .brand {
        min-width: 0;
        gap: 10px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
        font-size: 23px;
    }

    .brand strong {
        font-size: 16px;
    }

    .brand small {
        display: none;
    }

    .hero {
        min-height: 500px;
    }

    .hero-content {
        padding: 62px 0 82px;
    }

    .hero h1,
    .page-hero h1 {
        font-size: 32px;
    }

    .lead,
    .hero p.lead {
        font-size: 16px;
    }

    .page-hero {
        padding: 54px 0;
    }

    .stats {
        grid-template-columns: 1fr;
        margin-top: 0;
        border-radius: 0;
        width: 100%;
    }

    .section {
        padding: 52px 0;
    }

    .section-head {
        display: block;
    }

    .program-grid,
    .content-grid,
    .certificate-grid {
        grid-template-columns: 1fr;
    }

    .flow-intro,
    .support-lead,
    .volunteer-callout,
    .flow-step,
    .support-tile {
        padding: 20px;
    }

    .flow-intro h2,
    .support-lead h2,
    .volunteer-callout h2 {
        font-size: 25px;
    }

    .flow-steps,
    .support-grid {
        grid-template-columns: 1fr;
    }

    .join-actions .button {
        width: 100%;
    }

    .article-body {
        font-size: 16px;
    }

    .article-body iframe,
    .article-body video {
        min-height: 320px;
    }

    .article-body iframe[src*="lxi.me"] {
        height: min(980px, 170vh) !important;
    }
}

@media (max-width: 420px) {
    .topline {
        font-size: 12px;
    }

    .hero h1,
    .page-hero h1 {
        font-size: 29px;
    }

    .button {
        min-height: 44px;
        padding: 0 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }

    .has-reveal .reveal-item {
        opacity: 1;
        transform: none;
    }

    .has-reveal .reveal-item.is-visible {
        animation: none;
    }
}
