/* ============================================================
   eDA — End-to-end Data Analytics
   Minimalist UI: white background, black text, green accent
   Design tokens kế thừa từ AIO Course (aio_new), tinh giản lại
   ============================================================ */

:root {
    /* Accent lấy trực tiếp từ logo.jpg (#11501b) */
    --brand: #11501b;
    --brand-hover: #0c3a14;
    --brand-subtle: #eef4ef;
    --brand-border: #cfe0d3;

    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    --border: #e5e7eb;
    --border-light: #f3f4f6;

    --bg-page: #ffffff;
    --bg-soft: #fafafa;
    --bg-white: #ffffff;
    --bg-ink: #111111;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
    --shadow: 0 2px 8px rgba(0, 0, 0, .08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .1);

    --transition: .25s cubic-bezier(.4, 0, .2, 1);

    --header-h: 64px;
    --maxw: 1140px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: .9375rem;
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--brand-hover);
}

img {
    max-width: 100%;
    display: block;
    /* BẮT BUỘC đi kèm max-width: thẻ <img> có width/height attr để chống
       layout shift; thiếu height:auto thì bề rộng co lại còn chiều cao giữ
       nguyên -> ảnh bị kéo dãn dọc trên màn hẹp. */
    height: auto;
}

::selection {
    background: var(--brand-subtle);
    color: var(--text-primary);
}

/* Chỉ dành cho screen reader — ẩn khỏi màn hình nhưng vẫn đọc được */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

h1,
h2,
h3,
h4 {
    letter-spacing: -.022em;
    line-height: 1.25;
    margin: 0;
}

/* <figure> mặc định có margin 1em 40px của trình duyệt — ở màn 375px thì
   80px đó ăn mất ~24% bề ngang khả dụng. */
figure {
    margin: 0;
}

.wrap {
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: 24px;
}

/* ===== HEADER ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.site-header .wrap {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand img {
    height: 30px;
    width: auto;
}

.brand-sub {
    font-size: .72rem;
    color: var(--text-secondary);
    border-left: 1px solid var(--border);
    padding-left: 10px;
    line-height: 1.3;
    max-width: 130px;
}

.nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
    align-items: center;
}

.nav a {
    color: var(--text-secondary);
    font-size: .82rem;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
}

.nav a:hover {
    color: var(--text-primary);
    background: var(--bg-soft);
}

.nav a.is-active {
    color: var(--brand);
    background: var(--brand-subtle);
}

/* Icon Facebook: nút tròn ở cuối nav, desktop chỉ hiện icon */
.nav a.nav-fb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 34px;
    height: 34px;
    padding: 0;
    margin-left: 6px;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.nav a.nav-fb:hover {
    background: var(--brand-subtle);
    border-color: var(--brand-border);
    color: var(--brand);
}

.nav a.nav-fb svg {
    display: block;
}

.nav-fb-label {
    display: none;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-primary);
    line-height: 1;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: #000;
    color: #fff;
    box-shadow: var(--shadow);
}

.btn-primary:active {
    transform: scale(.985);
}

.btn-ghost {
    background: var(--bg-white);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: var(--bg-soft);
    border-color: #d1d5db;
    color: var(--text-primary);
}

/* ===== SECTION ===== */
.section {
    padding: 76px 0;
    border-top: 1px solid var(--border-light);
}

.section-soft {
    background: var(--bg-soft);
}

.section-head {
    max-width: 660px;
    margin-bottom: 40px;
}

.eyebrow {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 12px;
}

.section-head h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
}

.section-head p {
    color: var(--text-secondary);
    margin: 12px 0 0;
    font-size: .95rem;
}

/* ===== HERO ===== */
.hero {
    padding: 84px 0 68px;
}

.hero-grid {
    display: grid;
    /* Ưu tiên cột ảnh: sơ đồ dày chữ, càng rộng càng dễ đọc */
    grid-template-columns: 1fr 1.35fr;
    gap: 48px;
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -.035em;
}

.hero h1 em {
    font-style: normal;
    color: var(--brand);
}

.hero-lead {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin: 20px 0 28px;
    max-width: 46ch;
}

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

.hero-meta {
    display: flex;
    gap: 28px;
    margin-top: 36px;
    padding-top: 26px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.hero-meta div {
    min-width: 84px;
}

.hero-meta b {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
}

.hero-meta span {
    font-size: .75rem;
    color: var(--text-secondary);
}

.hero-visual {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
}

/* <a> bọc ảnh mặc định là inline -> co lại, ảnh không lấp đầy khung */
.hero-visual a,
.hero-visual picture {
    display: block;
}

.hero-visual img {
    width: 100%;
}

.hero-visual figcaption {
    font-size: .74rem;
    color: var(--text-secondary);
    padding: 10px 14px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-soft);
}

/* ===== PILLARS ===== */
.pillars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.pillar {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: all var(--transition);
}

.pillar:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
    border-color: var(--brand-border);
}

.pillar-no {
    font-size: .7rem;
    font-weight: 700;
    color: var(--brand);
    letter-spacing: .08em;
}

.pillar h3 {
    font-size: .98rem;
    font-weight: 700;
    margin: 8px 0 6px;
}

.pillar p {
    font-size: .82rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ===== MODULES ===== */
.module-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.module {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.module:hover {
    border-color: #d8dde3;
}

.module.is-open {
    border-color: var(--brand-border);
    box-shadow: var(--shadow-sm);
}

.module-head {
    display: grid;
    grid-template-columns: 84px 1fr auto;
    gap: 18px;
    align-items: center;
    width: 100%;
    padding: 18px 20px;
    background: none;
    border: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
    color: inherit;
}

.module-code {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.module.is-open .module-code {
    color: var(--brand);
}

.module-title {
    font-size: .98rem;
    font-weight: 600;
}

.module-sub {
    font-size: .78rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

.module-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.module-count {
    font-size: .74rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.chev {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.module.is-open .chev {
    transform: rotate(180deg);
    color: var(--brand);
}

.module-body {
    display: none;
    border-top: 1px solid var(--border-light);
}

.module.is-open .module-body {
    display: block;
}

.module-body-inner {
    padding: 4px 0 8px;
}

.subhead {
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-secondary);
    padding: 18px 20px 6px;
}

/* ===== TABLE (theo style AIO) ===== */
.table-scroll {
    overflow-x: auto;
}

table.sched {
    width: 100%;
    border-collapse: collapse;
    font-size: .84rem;
}

table.sched thead th {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-secondary);
    padding: 9px 20px;
    text-align: left;
    white-space: nowrap;
}

table.sched tbody td {
    padding: 11px 20px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

table.sched tbody tr:last-child td {
    border-bottom: none;
}

table.sched tbody tr:hover {
    background: var(--bg-soft);
}

.c-no {
    width: 46px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.c-day {
    width: 52px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.c-date {
    width: 116px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

.c-time {
    width: 150px;
    white-space: nowrap;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.task {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== BADGES (theo style AIO) ===== */
.tag {
    display: inline-flex;
    align-items: center;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.tag-seminar   { background: #e0f2fe; color: #075985; }
.tag-exercise  { background: #f1f5f9; color: #475569; }
.tag-softskill { background: #fef3c7; color: #92400e; }
.tag-project   { background: var(--brand-subtle); color: var(--brand); }
.tag-exam,
.tag-final     { background: #fee2e2; color: #991b1b; }
.tag-optional  { background: #ede9fe; color: #5b21b6; }

/* ===== DOMAIN MATRIX ===== */
.matrix-scroll {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    /* BẮT BUỘC: các .sr-only bên trong dùng position:absolute. Không có
       containing block này, chúng lấy viewport làm gốc, thoát khỏi vùng
       clip của overflow-x và kéo cả trang tràn ngang ~814px. */
    position: relative;
}

table.matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
    min-width: 820px;
}

table.matrix th,
table.matrix td {
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    padding: 10px 8px;
    text-align: center;
}

table.matrix thead th {
    background: var(--bg-soft);
    font-size: .68rem;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.3;
    vertical-align: bottom;
    border-bottom: 1px solid var(--border);
}

table.matrix th:first-child,
table.matrix td:first-child {
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    padding-left: 16px;
    position: sticky;
    left: 0;
    background: var(--bg-white);
    border-right: 1px solid var(--border);
}

table.matrix thead th:first-child {
    background: var(--bg-soft);
}

table.matrix tbody tr:last-child th,
table.matrix tbody tr:last-child td {
    border-bottom: none;
}

.dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.dot-core     { background: var(--brand); }
.dot-relevant { background: #86ac8e; }
.dot-minimal  { background: #d7dfd9; }
.dot-rare     { background: transparent; border: 1px solid var(--border); }

.legend {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    margin-top: 16px;
    font-size: .78rem;
    color: var(--text-secondary);
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ===== PROJECTS ===== */
.proj-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.proj {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    background: var(--bg-white);
    transition: all var(--transition);
}

.proj:hover {
    border-color: var(--brand-border);
    box-shadow: var(--shadow-sm);
}

.proj b {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .07em;
    color: var(--brand);
    margin-bottom: 4px;
}

.proj span {
    font-size: .9rem;
    font-weight: 600;
}

/* ===== CTA ===== */
.cta {
    background: var(--bg-ink);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 52px 44px;
    text-align: center;
}

.cta h2 {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 700;
}

.cta p {
    color: #a9adb4;
    margin: 12px auto 26px;
    max-width: 52ch;
    font-size: .95rem;
}

.cta .btn-primary {
    background: #fff;
    color: #111;
}

.cta .btn-primary:hover {
    background: #f3f4f6;
    color: #111;
}

.cta .btn-ghost {
    background: transparent;
    color: #fff;
    border-color: #3a3d42;
}

.cta .btn-ghost:hover {
    background: #1d1f23;
    border-color: #55585e;
    color: #fff;
}

/* ===== FOOTER ===== */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 34px 0;
    font-size: .82rem;
    color: var(--text-secondary);
}

.site-footer .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.site-footer img {
    height: 24px;
    /* Cần width:auto — thẻ img có width attr, nếu không sẽ lấy 120px làm bề
       rộng trong khi height bị ép 24px -> logo bẹp ngang. */
    width: auto;
    margin-bottom: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; gap: 36px; }
    .pillars   { grid-template-columns: repeat(2, 1fr); }
    .proj-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    .wrap { padding-inline: 18px; }
    .section { padding: 54px 0; }
    .hero { padding: 52px 0 44px; }

    .nav-toggle { display: block; }

    .nav {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border);
        padding: 8px;
        box-shadow: var(--shadow);
    }

    .nav.is-open { display: flex; }
    .nav a { padding: 11px 12px; }

    /* Trong menu dọc: trả về dạng hàng có chữ, bỏ nút tròn */
    .nav a.nav-fb {
        width: auto;
        height: auto;
        padding: 11px 12px;
        margin-left: 0;
        border: 0;
        border-radius: var(--radius-sm);
        justify-content: flex-start;
    }

    .nav-fb-label { display: inline; }

    .brand-sub { display: none; }

    .module-head { grid-template-columns: 1fr auto; gap: 10px; }
    .module-code { grid-column: 1 / -1; }
    .module-count { display: none; }

    .c-day, .c-time { display: none; }
    table.sched thead th, table.sched tbody td { padding-inline: 16px; }

    .pillars, .proj-grid { grid-template-columns: 1fr; }
    .cta { padding: 38px 24px; }
    .hero-meta { gap: 20px; }
}

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

/* ===== PRINT ===== */
@media print {
    .site-header, .cta, .hero-actions, .nav-toggle { display: none; }
    .module-body { display: block !important; }
    .section { padding: 20px 0; border: 0; }
}
