/* Shared by the three homepages. Keep these refinements local to the homepage. */
.home-page {
    --home-green: #22664c;
    --home-mint: #b9ead0;
    --home-border: #dce7df;
}

/* Keep homepage typography and container sizing out of the shared navigation. */
.home-page :where(main, #footer-placeholder) {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

.home-page :where(main, #footer-placeholder) .container {
    max-width: 1360px;
    padding-inline: 32px;
}

/* Use the actual viewport on the homepage instead of desktop-wide zoom. */
.home-page .hero {
    height: auto;
    min-height: clamp(560px, 78svh, 840px);
    padding: 132px 0 84px;
    background-position: center 58%;
}

.home-page .hero-overlay {
    background: linear-gradient(105deg, rgba(9, 32, 33, .86), rgba(9, 32, 33, .57) 55%, rgba(9, 32, 33, .3));
}

.home-page .hero-content {
    max-width: 1060px;
    padding-top: 0;
}

.home-page .hero-content h1 {
    font-size: clamp(36px, 3.5vw, 56px);
    line-height: 1.3;
    letter-spacing: -.02em;
    margin-bottom: 24px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .16);
    text-wrap: balance;
}

.home-page .hero-content h1 .en-title {
    font-size: clamp(17px, 1.6vw, 23px);
    line-height: 1.5;
    letter-spacing: .04em;
    margin-top: 16px;
    color: #dae7e2;
}

.home-page .hero-content p {
    margin-bottom: 32px;
    font-size: clamp(17px, 1.5vw, 21px);
    line-height: 1.9;
    text-shadow: none;
}

.home-page .hero-highlight {
    color: var(--home-mint);
}

.home-page .hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

.home-page .hero-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 54px;
    padding: 14px 26px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    transition: background .2s ease, transform .2s ease, border-color .2s ease;
}

.home-page .hero-button-primary {
    color: #123c2b;
    background: #c5ebd5;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}

.home-page .hero-button-primary:hover {
    background: #dcf5e5;
    transform: translateY(-2px);
}

.home-page .hero-button-secondary {
    color: #fff;
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .55);
}

.home-page .hero-button-secondary:hover {
    background: rgba(255, 255, 255, .16);
    border-color: #fff;
    transform: translateY(-2px);
}

.home-page .hero-button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.home-page :where(main, #footer-placeholder) a:focus-visible {
    outline: 3px solid var(--home-green);
    outline-offset: 5px;
}

.home-page .hero a:focus-visible {
    outline-color: var(--home-mint);
}

/* A shorter, consistent rhythm between content sections. */
.home-page :is(.who-we-are, .why-nm, .what-we-do, .events-section, .news-section) {
    padding-block: clamp(56px, 6vw, 88px);
}

.home-page .section-header,
.home-page .what-we-do .section-header {
    margin-bottom: 36px;
}

.home-page .section-header h2,
.home-page .text-column h2 {
    font-size: clamp(26px, 2.4vw, 34px);
    line-height: 1.35;
}

.home-page .text-column h2 { margin-bottom: 20px; }
.home-page .text-column p { line-height: 1.9; }
.home-page .text-column .lead { color: var(--home-green); font-size: 18px; }
.home-page .split-layout { gap: 56px; }
.home-page .rounded-img { max-height: 340px; }
.home-page .grid-3 { gap: 24px; margin-top: 0; }

.home-page .feature-card {
    padding: 32px 28px;
    border-color: rgba(185, 234, 208, .15);
    background: rgba(255, 255, 255, .04);
}

.home-page .feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(185, 234, 208, .4);
}

.home-page .icon-wrapper {
    width: 68px;
    height: 68px;
    margin-bottom: 24px;
    color: var(--home-mint);
    background: rgba(185, 234, 208, .1);
    border: 1px solid rgba(185, 234, 208, .16);
}

.home-page .icon { width: 32px; height: 32px; }
.home-page .feature-card p { font-size: 16px; line-height: 1.8; }
.home-page .bento-grid { grid-template-rows: repeat(2, minmax(280px, auto)); gap: 24px; }
.home-page .card-content { padding: 24px; }
.home-page .events-section { background: #f0f5f1; }

/* Sage date cards replace the unrelated orange/gold event palette. */
.home-page .events-grid { gap: 24px; }
.home-page .event-card {
    border: 1px solid var(--home-border);
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(22, 59, 42, .04);
}

.home-page .event-card:hover {
    transform: translateY(-4px);
    border-color: #9abda7;
    box-shadow: 0 12px 28px rgba(22, 59, 42, .1);
}

.home-page .event-card .card-header {
    height: 116px;
    flex-shrink: 0;
    background: linear-gradient(120deg, #e1eee5, #eff5f0);
    border-bottom: 1px solid var(--home-border);
}

.home-page .event-card.type-academic .card-header {
    background: linear-gradient(120deg, #dcece7, #edf4f2);
}

.home-page .event-card .card-type-tag {
    top: 22px;
    right: 20px;
    padding: 4px 9px;
    color: #325d47;
    background: rgba(255, 255, 255, .7);
    border-color: #c9ded0;
    border-radius: 5px;
    font-size: 12px;
    text-transform: none;
}

.home-page .event-card .date-badge {
    top: 20px;
    left: 20px;
    bottom: auto;
    width: 66px;
    padding: 8px 10px;
    border: 1px solid #c9ded0;
    border-radius: 9px;
    background: #fff;
}

.home-page .date-badge .month { color: #4c6c58; font-size: 12px; }
.home-page .date-badge .day {
    font-family: inherit;
    font-size: 30px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    color: #1d4f38;
}

.home-page .event-card .past-badge {
    top: auto;
    left: auto;
    right: 20px;
    bottom: 20px;
    padding: 3px 9px;
    font-size: 12px;
    letter-spacing: 0;
    border-radius: 5px;
    text-transform: none;
}

/* The existing feed supplies the ongoing badge's colours inline. */
.home-page .ongoing-event .past-badge {
    color: #1d6545 !important;
    background: #d1e7d9 !important;
    border-color: #b5d4c1 !important;
}

.home-page .event-card .card-body { padding: 24px; }
.home-page .event-card .card-title {
    font-family: inherit;
    font-size: 18px;
    line-height: 1.6;
    color: #203d2f;
}

.home-page .event-card .card-meta span { background: #f0f5f1; color: #536b5d; }
.home-page .event-card .card-detail { flex-grow: 0; }
.home-page .event-card .card-footer { border-color: #e2ebe5; }
.home-page .event-card .btn-link { color: var(--home-green); }
.home-page .event-card:hover .btn-link { color: #154b34; }
.home-page .events-section .btn-outline {
    color: var(--home-green);
    border: 1px solid #a9c6b4;
    border-radius: 8px;
    background: #fff;
}
.home-page .events-section .btn-outline:hover { color: #fff; background: var(--home-green); }

@media (min-width: 768px) and (max-width: 1199px) {
    .home-page .hero { padding-top: 180px; }
    .home-page .split-layout { gap: 32px; }
    .home-page .feature-card { padding: 28px 20px; }
    .home-page .events-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .home-page .bento-grid { grid-template-rows: auto; }
    .home-page .bento-card .card-img { height: 220px; flex-shrink: 0; }
}

@media (max-width: 767px) {
    .home-page :where(main, #footer-placeholder) .container { padding-inline: 22px; }
    .home-page .hero {
        min-height: 620px;
        min-height: clamp(540px, 82svh, 700px);
        padding: 108px 0 60px;
        background-position: 62% center;
    }
    .home-page .hero-overlay { background: rgba(9, 32, 33, .67); }
    .home-page .hero-content h1 { font-size: clamp(28px, 7.8vw, 36px); }
    .home-page .home-title-name { display: block; }
    .home-page .hero-content h1 .en-title { font-size: 15px; letter-spacing: .01em; }
    .home-page .hero-content p { font-size: 16px; margin-bottom: 28px; }
    .home-page .hero-actions { flex-direction: column; align-items: center; gap: 12px; }
    .home-page .hero-button { width: 100%; max-width: 320px; min-height: 52px; padding-inline: 18px; }
    .home-page .split-layout { gap: 28px; }
    .home-page .section-header { margin-bottom: 28px; }
    .home-page .grid-3 { gap: 16px; }
    .home-page .feature-card { padding: 28px 24px; }
    .home-page .icon-wrapper { width: 60px; height: 60px; margin-bottom: 18px; }
    .home-page .events-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .home-page .event-card .card-body { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .home-page .hero-button,
    .home-page .feature-card,
    .home-page .event-card { transition: none !important; }
    .home-page .hero-button:hover,
    .home-page .feature-card:hover,
    .home-page .event-card:hover { transform: none; }
}
