/* Ngo Hoang Nguyen theme — homepage section styles (Phase 4).
 *
 * Consumes the Phase 2 semantic tokens, so both colour schemes work with no
 * per-scheme duplication. Classes are theme-scoped; no icon/font/image assets are
 * added. Every interactive control inherits the global :focus-visible ring and the
 * reduced-motion / forced-colors handling from theme.css. Layouts use logical
 * properties for direction-awareness. */

/* ---- shared shell ---- */
.home-sections {
    display: flex;
    flex-direction: column;
}

.section {
    padding-block: var(--nhn-space-section);
}

.section__inner {
    inline-size: 100%;
    max-inline-size: var(--nhn-content-width);
    margin-inline: auto;
    padding-inline: var(--nhn-space-5);
}
.section__inner--measure { max-inline-size: var(--nhn-prose-width); }
.section__inner--wide { max-inline-size: var(--nhn-content-width); }

.section--align-center { text-align: center; }

/* Backgrounds (token-driven; flip automatically in dark). */
.section--bg-surface { background-color: var(--nhn-surface); }
.section--bg-muted,
.section--bg-tint { background-color: var(--nhn-surface-muted); }
.section--bg-accent {
    background-color: var(--nhn-accent);
    color: var(--nhn-accent-contrast);
}
.section--bg-accent :is(h1, h2, h3, .section-header__title, .cta__title) {
    color: var(--nhn-accent-contrast);
}
.section--bg-accent .section-header__subtitle,
.section--bg-accent .cta__subtitle { color: var(--nhn-accent-contrast); opacity: 0.9; }

/* ---- section header ---- */
.section-header {
    max-inline-size: var(--nhn-prose-width);
    margin-block-end: var(--nhn-space-8);
}
.section--align-center .section-header { margin-inline: auto; }
.section-header__title { font-size: var(--nhn-h2); margin: 0; }
.section-header__subtitle {
    margin-block: var(--nhn-space-3) 0;
    color: var(--nhn-text-muted);
    font-size: var(--nhn-text-lg);
}

/* ---- buttons ---- */
.section-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-block-size: 2.75rem;
    padding: var(--nhn-space-2) var(--nhn-space-5);
    font-weight: var(--nhn-weight-semibold);
    text-decoration: none;
    border-radius: var(--nhn-radius-md);
    border: 2px solid transparent;
    transition: transform var(--nhn-duration-fast) var(--nhn-ease);
}
.section-btn--solid {
    background-color: var(--nhn-accent);
    color: var(--nhn-accent-contrast);
}
.section-btn--pill {
    background-color: var(--nhn-accent);
    color: var(--nhn-accent-contrast);
    border-radius: var(--nhn-radius-pill);
}
.section-btn--outline {
    background-color: transparent;
    color: var(--nhn-accent-ink);
    border-color: var(--nhn-accent-ink);
}
.section-btn:hover { transform: translateY(-2px); }
/* On an accent panel, keep buttons visible against the accent background. */
.section--bg-accent .section-btn--solid,
.section--bg-accent .section-btn--pill {
    background-color: var(--nhn-surface);
    color: var(--nhn-accent-ink);
}
.section--bg-accent .section-btn--outline {
    color: var(--nhn-accent-contrast);
    border-color: var(--nhn-accent-contrast);
}

/* ---- media ---- */
.section-media {
    display: block;
    inline-size: 100%;
    block-size: auto;
    border-radius: var(--nhn-radius-lg);
}

/* ---- hero (Mulan "Home" panel: full-height, centered, optional masked media) ---- */
.section--hero {
    position: relative;
    overflow: hidden;
    min-block-size: clamp(28rem, 70vh, 48rem);
    display: grid;
    place-items: center;
    padding-block: var(--nhn-space-10);
    background-color: var(--nhn-surface-muted);
}
.hero__bg {
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    z-index: 0;
}
.hero__mask { position: absolute; inset: 0; background-color: var(--nhn-hero-overlay); z-index: 1; }
.hero__inner { position: relative; z-index: 2; text-align: center; }
.hero__content { max-inline-size: var(--nhn-content-width); margin-inline: auto; }

.hero__eyebrow {
    margin: 0 0 var(--nhn-space-3);
    color: var(--nhn-accent-ink);
    font-weight: var(--nhn-weight-semibold);
    letter-spacing: var(--nhn-tracking-wide);
    text-transform: uppercase;
    font-size: var(--nhn-text-sm);
}
.hero__title {
    font-size: clamp(2.5rem, 1rem + 6vw, 4.375rem);
    font-weight: var(--nhn-weight-semibold);
    margin: 0 0 var(--nhn-space-4);
    letter-spacing: -0.01em;
}
.hero__subtitle {
    font-size: clamp(1.25rem, 1rem + 1.4vw, 1.875rem);
    color: var(--nhn-text-muted);
    margin: 0;
}
.hero__ctas { display: flex; flex-wrap: wrap; gap: var(--nhn-space-3); justify-content: center; margin-block-start: var(--nhn-space-8); }
.hero__highlights {
    list-style: none; margin: var(--nhn-space-6) 0 0; padding: 0;
    display: flex; flex-wrap: wrap; gap: var(--nhn-space-2) var(--nhn-space-4); justify-content: center;
}
.hero__highlight {
    padding: var(--nhn-space-1) var(--nhn-space-3);
    background-color: var(--nhn-surface-muted);
    border-radius: var(--nhn-radius-pill);
    font-size: var(--nhn-text-sm);
    color: var(--nhn-text-strong);
}
/* Over media: white text on the mask. */
.hero--has-media .hero__title,
.hero--has-media .hero__subtitle { color: #fff; }
.hero--has-media .hero__eyebrow { color: var(--nhn-cyan-400); }
.hero--has-media .hero__highlight { background-color: rgba(255, 255, 255, 0.14); color: #fff; }

/* ---- feature grid ---- */
.feature-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: var(--nhn-grid-gap);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
@media (min-width: 62rem) {
    .feature-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
    .feature-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
    .feature-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
}
.feature-card {
    padding: var(--nhn-space-5);
    background-color: var(--nhn-card-surface);
    border: var(--nhn-border-width) solid var(--nhn-border-subtle);
    border-radius: var(--nhn-radius-lg);
    box-shadow: var(--nhn-shadow-sm);
    text-align: start;
}
.feature-card__media { margin: 0 0 var(--nhn-space-4); }
.feature-card__media .section-media { border-radius: var(--nhn-radius-md); }
.feature-card__title { font-size: var(--nhn-h4); margin: 0 0 var(--nhn-space-2); }
.feature-card__title a { color: var(--nhn-heading); text-decoration: none; }
.feature-card__title a:hover { color: var(--nhn-accent-ink); }
.feature-card__text { margin: 0; color: var(--nhn-text-muted); }

/* ---- feature split ---- */
.split__grid { display: grid; gap: var(--nhn-space-8); align-items: center; }
@media (min-width: 48rem) {
    .split__grid:not(.split__grid--single) { grid-template-columns: 1fr 1fr; }
    .split--media-left .split__media { order: 0; }
    .split--media-left .split__body { order: 1; }
    .split--media-right .split__media { order: 1; }
}
.split__media { margin: 0; }
.split__media .section-media { box-shadow: var(--nhn-card-shadow); }
.split__title { font-size: var(--nhn-h2); margin: 0 0 var(--nhn-space-4); }
.split__bullets {
    list-style: none; margin: var(--nhn-space-4) 0; padding: 0;
    display: grid; gap: var(--nhn-space-2);
}
.split__bullet { padding-inline-start: 1.5em; position: relative; }
.split__bullet::before {
    content: ""; position: absolute; inset-inline-start: 0; inset-block-start: 0.55em;
    inline-size: 0.5em; block-size: 0.5em; border-radius: 50%;
    background-color: var(--nhn-accent);
}
.split__body .section-btn { margin-block-start: var(--nhn-space-4); }

/* ---- stats ---- */
.stats {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: var(--nhn-grid-gap);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
}
@media (min-width: 48rem) {
    .stats--cols-2 { grid-template-columns: repeat(2, 1fr); }
    .stats--cols-3 { grid-template-columns: repeat(3, 1fr); }
    .stats--cols-4 { grid-template-columns: repeat(4, 1fr); }
}
.stat__number { margin: 0; font-size: var(--nhn-h1); font-weight: var(--nhn-weight-bold); color: var(--nhn-accent-ink); line-height: 1.1; }
.section--bg-accent .stat__number { color: var(--nhn-accent-contrast); }
.stat__label { margin: var(--nhn-space-2) 0 0; color: var(--nhn-text-muted); font-size: var(--nhn-text-sm); }
.section--bg-accent .stat__label { color: var(--nhn-accent-contrast); opacity: 0.9; }

/* ---- testimonials ---- */
.testimonials {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: var(--nhn-grid-gap);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}
@media (min-width: 62rem) {
    .testimonials--cols-1 { grid-template-columns: 1fr; max-inline-size: var(--nhn-prose-width); margin-inline: auto; }
    .testimonials--cols-2 { grid-template-columns: repeat(2, 1fr); }
    .testimonials--cols-3 { grid-template-columns: repeat(3, 1fr); }
}
.testimonial__figure {
    margin: 0; block-size: 100%;
    display: flex; flex-direction: column; gap: var(--nhn-space-3);
    padding: var(--nhn-space-5);
    background-color: var(--nhn-card-surface);
    border: var(--nhn-border-width) solid var(--nhn-border-subtle);
    border-radius: var(--nhn-radius-lg);
    box-shadow: var(--nhn-shadow-sm);
}
.testimonial__rating { margin: 0; font-size: var(--nhn-text-sm); color: var(--nhn-accent-ink); font-weight: var(--nhn-weight-semibold); }
.testimonial__quote { margin: 0; color: var(--nhn-text-strong); font-size: var(--nhn-text-lg); }
.testimonial__author { display: flex; align-items: center; gap: var(--nhn-space-3); margin-block-start: auto; }
.testimonial__author .section-media { inline-size: 3rem; block-size: 3rem; border-radius: 50%; object-fit: cover; flex: none; }
.testimonial__author-text { display: flex; flex-direction: column; }
.testimonial__name { font-weight: var(--nhn-weight-semibold); color: var(--nhn-heading); }
.testimonial__role { font-size: var(--nhn-text-sm); color: var(--nhn-text-muted); }

/* ---- faq (native details) ---- */
.faq__list { display: grid; gap: var(--nhn-space-3); }
@media (min-width: 62rem) { .faq--two-column .faq__list { grid-template-columns: 1fr 1fr; } }
.faq__item {
    border: var(--nhn-border-width) solid var(--nhn-border);
    border-radius: var(--nhn-radius-md);
    background-color: var(--nhn-surface);
    padding-inline: var(--nhn-space-4);
}
.faq__question {
    cursor: pointer;
    padding-block: var(--nhn-space-4);
    font-weight: var(--nhn-weight-semibold);
    color: var(--nhn-heading);
    list-style: none;
    display: flex; align-items: center; justify-content: space-between; gap: var(--nhn-space-3);
}
.faq__question::-webkit-details-marker { display: none; }
.faq__question::after {
    content: ""; flex: none; inline-size: 0.55em; block-size: 0.55em;
    border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform var(--nhn-duration-fast) var(--nhn-ease);
}
.faq__item[open] .faq__question::after { transform: rotate(-135deg); }
.faq__answer { padding-block-end: var(--nhn-space-4); color: var(--nhn-text); }

/* ---- cta ---- */
.cta__inner { max-inline-size: var(--nhn-prose-width); margin-inline: auto; }
.cta__title { font-size: var(--nhn-h2); margin: 0 0 var(--nhn-space-3); }
.cta__subtitle { font-size: var(--nhn-text-lg); margin: 0 0 var(--nhn-space-6); }
.section--align-center .cta__subtitle { color: var(--nhn-text-muted); }
.cta__actions { display: flex; flex-wrap: wrap; gap: var(--nhn-space-3); }
.section--align-center .cta__actions { justify-content: center; }

/* ---- post cards + featured (card grids) ---- */
.post-cards {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: var(--nhn-grid-gap);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
@media (min-width: 62rem) {
    .post-cards--cols-1 { grid-template-columns: 1fr; max-inline-size: var(--nhn-prose-width); margin-inline: auto; }
    .post-cards--cols-2 { grid-template-columns: repeat(2, 1fr); }
    .post-cards--cols-3 { grid-template-columns: repeat(3, 1fr); }
}
.post-card__inner,
.featured__item-inner,
.featured__lead {
    block-size: 100%;
    display: flex; flex-direction: column;
    background-color: var(--nhn-card-surface);
    border: var(--nhn-border-width) solid var(--nhn-border-subtle);
    border-radius: var(--nhn-radius-lg);
    box-shadow: var(--nhn-card-shadow);
    overflow: hidden;
}
.post-card__media,
.featured__lead-media,
.featured__item-media { aspect-ratio: 16 / 9; overflow: hidden; }
.post-card__media .section-media,
.featured__lead-media .section-media,
.featured__item-media .section-media { block-size: 100%; object-fit: cover; border-radius: 0; }
.post-card__body,
.featured__lead-body,
.featured__item-body { padding: var(--nhn-space-5); display: flex; flex-direction: column; gap: var(--nhn-space-2); }
.post-card__category,
.featured__category {
    margin: 0; font-size: var(--nhn-text-xs); text-transform: uppercase;
    letter-spacing: var(--nhn-tracking-wide); color: var(--nhn-accent-ink); font-weight: var(--nhn-weight-semibold);
}
.post-card__title,
.featured__lead-title,
.featured__item-title { margin: 0; font-size: var(--nhn-h4); }
.post-card__title a,
.featured__link { color: var(--nhn-heading); text-decoration: none; }
.post-card__title a:hover,
.featured__link:hover { color: var(--nhn-accent-ink); }
.post-card__excerpt,
.featured__excerpt { margin: 0; color: var(--nhn-text-muted); font-size: var(--nhn-text-sm); }
.post-card__date,
.featured__date { margin: auto 0 0; color: var(--nhn-text-muted); font-size: var(--nhn-text-xs); }

.featured__grid { display: grid; gap: var(--nhn-grid-gap); }
@media (min-width: 62rem) {
    .featured--editorial .featured__grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
}
.featured__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--nhn-grid-gap); }
@media (min-width: 48rem) {
    .featured--grid .featured__list { grid-template-columns: repeat(2, 1fr); }
}
.featured__lead-title { font-size: var(--nhn-h3); }
