/* ============================================================================
   style.css — Blog thể thao 3 môn (BƠI · ĐẠP · CHẠY)
   Phong cách: thiên nhiên – tối giản – thoáng. CSS thuần, không framework.
   ----------------------------------------------------------------------------
   Palette
     #0E4C92  BƠI   (swim)  xanh nước sâu
     #3E7C4A  ĐẠP   (bike)  xanh lá rừng
     #E07A3F  CHẠY  (run)   cam đất nắng
     #F7F5EF  nền            trắng ngà (giấy tái chế)
     #1F2933  chữ            than mực

   Font
     Inter       -> body / UI
     Oswald      -> toàn bộ heading (h1..h4, tiêu đề card, widget)
     Bebas Neue  -> logo & số liệu lớn (đậm, cao, cảm giác thể thao)

   Cấu trúc file
     1. Token thiết kế (light + dark)        5. Card bài viết
      5b. Hero trang chủ
     2. Reset & nền tảng                     6. Trang chi tiết bài viết
     3. Nút, header, tiêu đề trang           7. Tag 3 môn, sidebar, footer, 404
     4. Layout & phân trang                  8. Responsive (mobile-first), print
      ----------------------------------------------------------------------------
      15. Video YouTube dạng "facade"         17. Trang tĩnh: giới thiệu / liên hệ
      16. Module luyện tập (/tap-luyen)       18. Bổ sung responsive + print
   ============================================================================ */

/* Webfont được nạp bằng <link rel="preconnect"> + <link rel="stylesheet">
   trong header.php (xem hàm fonts_links()) — nhanh hơn @import vì trình duyệt
   không phải chờ tải & phân tích xong style.css mới biết cần tải font. */


/* ==========================================================================
   1. TOKEN THIẾT KẾ — LIGHT (mặc định)
   ========================================================================== */
:root {
    color-scheme: light dark;

    /* --- Ba môn: màu gốc cho khối màu, gradient, icon --- */
    --swim: #0E4C92;
    --bike: #3E7C4A;
    --run:  #E07A3F;

    /* --- Ba môn: bản dùng cho CHỮ trên nền sáng.
           Cam gốc (#E07A3F) chỉ đạt ~2.8:1 nên phải tối lại thành #A8541F
           để đủ 4.5:1 (WCAG AA) khi làm màu chữ / viền nhãn. --- */
    --swim-ink: #0E4C92;
    --bike-ink: #3E7C4A;
    --run-ink:  #A8541F;

    /* --- Nền nhạt + viền của tag theo môn --- */
    --swim-bg: #E8EFF8;  --swim-bd: #B7CFE8;
    --bike-bg: #E9F2EA;  --bike-bd: #BFD8C5;
    --run-bg:  #FBEBE1;  --run-bd:  #F1C4A4;

    /* --- Bản SÁNG của 3 màu, dùng khi chữ nằm trên nền tối/ảnh (hero) --- */
    --swim-on-dark: #8CBCF0;
    --bike-on-dark: #93D3A2;
    --run-on-dark:  #F6AC71;

    /* --- Nền & chữ --- */
    --bg:            #F7F5EF;
    --surface:       #FFFFFF;
    --surface-2:     #F1EEE6;
    --surface-3:     #E7E2D7;
    --border:        #E4DFD2;
    --border-strong: #D3CCBB;
    --text:          #1F2933;
    --heading:       #16202A;
    --muted:         #6B7280;

    /* --- Màu hành động / trạng thái --- */
    --brand:        #0E4C92;
    --brand-hover:  #0A3A72;
    --on-brand:     #FFFFFF;
    --danger:       #C0392B;
    --danger-hover: #9E2D22;

    /* --- Khối nội dung bài viết --- */
    --code-bg:    #17222B;
    --code-text:  #E4EBF1;
    --icode-bg:   #EDEAE1;
    --icode-text: #A8541F;
    --quote-bg:   #EEF1E7;
    --footer-bg:  #1B2A24;   /* xanh rừng tối — chân trang */
    --footer-text: #C9D6CE;
    --video-bg:   #0B1014;
    --thumb-bg:   #EDEAE1;

    /* --- Bo góc: card bài viết đúng 12px --- */
    --radius:      12px;
    --radius-sm:   8px;
    --radius-pill: 999px;

    /* --- Đổ bóng nhẹ; hover thì "nhấc lên" --- */
    --shadow:       0 1px 2px rgba(31, 41, 51, .04), 0 6px 18px rgba(31, 41, 51, .06);
    --shadow-hover: 0 4px 10px rgba(31, 41, 51, .07), 0 18px 34px rgba(31, 41, 51, .13);
    --lift:         translateY(-4px);

    /* --- Nhịp & kích thước --- */
    --container: 1160px;
    --gutter: 18px;
    --gap: 18px;
    --header-h: 64px;
    --section-y: 26px;

    /* --- Font --- */
    --font:         'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Oswald', 'Bebas Neue', 'Inter', system-ui, sans-serif;
    --font-logo:    'Bebas Neue', 'Oswald', system-ui, sans-serif;

    /* --- Dải 3 màu = dấu nhận diện thương hiệu (header, footer, tiêu đề) --- */
    --tri: linear-gradient(90deg,
        var(--swim) 0 33.33%,
        var(--bike) 33.33% 66.66%,
        var(--run)  66.66% 100%);
}


/* ==========================================================================
   1b. TOKEN THIẾT KẾ — DARK (theo cài đặt hệ điều hành, không cần nút bật/tắt)
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        /* Ba môn sáng hơn để nổi trên nền tối */
        --swim: #5AA0E8;
        --bike: #78BF88;
        --run:  #F0A06A;

        --swim-ink: #7FB6EE;
        --bike-ink: #8CCB9A;
        --run-ink:  #F0A06A;

        --swim-bg: rgba(90, 160, 232, .16);  --swim-bd: rgba(90, 160, 232, .42);
        --bike-bg: rgba(120, 191, 136, .16); --bike-bd: rgba(120, 191, 136, .42);
        --run-bg:  rgba(240, 160, 106, .16); --run-bd:  rgba(240, 160, 106, .42);

        --bg:            #11171C;
        --surface:       #182027;
        --surface-2:     #1F2930;
        --surface-3:     #273239;
        --border:        #2A353E;
        --border-strong: #3A4753;
        --text:          #E7ECF1;
        --heading:       #F3F7FA;
        --muted:         #9BA8B4;

        --brand:        #5AA0E8;
        --brand-hover:  #7FB6EE;
        --on-brand:     #0B1014;   /* chữ than đậm trên nền xanh sáng */
        --danger:       #E06B5B;
        --danger-hover: #EC8878;

        --code-bg:    #0E141A;
        --code-text:  #DCE6EF;
        --icode-bg:   #25313A;
        --icode-text: #F0A06A;
        --quote-bg:   #1D271F;
        --footer-bg:  #0D1317;
        --footer-text: #A9B6C0;
        --video-bg:   #05080B;
        --thumb-bg:   #1F2930;

        --shadow:       0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .35);
        --shadow-hover: 0 4px 12px rgba(0, 0, 0, .45), 0 18px 34px rgba(0, 0, 0, .5);
    }
}

/* ==========================================================================
   2. RESET & NỀN TẢNG
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.75;
    letter-spacing: -.003em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg,
iframe,
video { max-width: 100%; }

img { height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 .55em;
    color: var(--heading);
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.01em;
}

h1 { font-size: clamp(1.65rem, 1.25rem + 1.7vw, 2.3rem); }
h2 { font-size: clamp(1.35rem, 1.15rem + 1vw, 1.75rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

a {
    color: var(--brand);
    text-decoration: none;
    text-underline-offset: 3px;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}
a:hover { color: var(--brand-hover); text-decoration: underline; }

ul, ol { padding-left: 1.25em; }

hr {
    height: 1px;
    margin: 32px 0;
    border: 0;
    background: var(--border);
}

/* Vòng focus rõ ràng cho người dùng bàn phím */
:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

::selection { background: var(--swim); color: #fff; }

/* Nền trang: hai vệt gradient rất nhạt -> thoáng, không bệt màu */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(58% 38% at 10% 0,   rgba(14, 76, 146, .055), transparent 70%),
        radial-gradient(52% 38% at 90% 100%, rgba(62, 124, 74, .055), transparent 70%);
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* Lưu ý: chỉ đặt padding-top/bottom để KHÔNG ghi đè lề ngang của .container */
.section { padding-top: var(--section-y); padding-bottom: 48px; }

.site-main { display: block; min-height: 50vh; }

/* Khối thông báo rỗng / không có kết quả */
.empty {
    padding: 36px 24px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    text-align: center;
}


/* ==========================================================================
   3. NÚT & ĐIỀU KHIỂN
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease,
                color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn:hover {
    border-color: var(--brand);
    background: var(--surface-2);
    color: var(--brand);
    text-decoration: none;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--on-brand);
    box-shadow: var(--shadow);
}
.btn--primary:hover {
    border-color: var(--brand-hover);
    background: var(--brand-hover);
    color: var(--on-brand);
}

.btn--danger { border-color: var(--danger); background: var(--danger); color: #fff; }
.btn--danger:hover { border-color: var(--danger-hover); background: var(--danger-hover); color: #fff; }

.btn--sm { padding: 7px 13px; font-size: 13px; }

/* ==========================================================================
   4. HEADER — mobile-first: logo + nút menu, nav xổ xuống thành 1 cột
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);                                    /* fallback */
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(150%) blur(10px);
    -webkit-backdrop-filter: saturate(150%) blur(10px);
}

/* Dải 3 màu BƠI · ĐẠP · CHẠY ở chân header */
.site-header::after {
    content: "";
    display: block;
    height: 3px;
    background: var(--tri);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    min-height: var(--header-h);
    padding-top: 10px;
    padding-bottom: 10px;
}

.site-logo {
    margin-right: auto;
    color: var(--heading);
    font-family: var(--font-logo);
    font-size: clamp(1.5rem, 1.2rem + 1vw, 1.85rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.site-logo:hover { color: var(--brand); text-decoration: none; }

/* Nút mở menu — chỉ hiện ở mobile */
.nav-toggle {
    display: inline-flex;
    order: 2;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 42px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
}

.site-nav {
    display: none;                       /* mobile: ẩn, hiện khi có .is-open */
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0 2px;
    border-top: 1px solid var(--border);
}
.site-nav.is-open { display: flex; }

.site-nav a {
    padding: 9px 2px;
    border-bottom: 2px solid transparent;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
}
.site-nav a:hover {
    border-bottom-color: var(--brand);
    color: var(--brand);
    text-decoration: none;
}

.site-search {
    display: flex;
    order: 4;
    flex-basis: 100%;
    gap: 8px;
}
.site-search input {
    flex: 1;
    min-width: 0;
    padding: 10px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
}
.site-search input::placeholder { color: var(--muted); }
.site-search input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(14, 76, 146, .18);
}
.site-search button {
    padding: 10px 18px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--brand);
    color: var(--on-brand);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .18s ease;
}
.site-search button:hover { background: var(--brand-hover); }


/* ==========================================================================
   5. TIÊU ĐỀ TRANG, BREADCRUMB
   ========================================================================== */
.page-heading { margin: 0 0 22px; }
.page-heading h1 { margin-bottom: 8px; }

/* Gạch chân 3 màu dưới H1 — dấu nhận diện, chỉ 64px nên vẫn tối giản */
.page-heading h1::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    margin-top: 12px;
    border-radius: var(--radius-pill);
    background: var(--tri);
}

.page-heading__sub { color: var(--muted); margin: 0 0 8px; }
.page-heading__count { color: var(--muted); font-size: 14px; margin: 0; }
.page-heading__count strong { color: var(--heading); font-weight: 600; }

.breadcrumb {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 13px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { color: var(--border-strong); margin: 0 5px; }
.breadcrumb__current { color: var(--muted); }

.section__title {
    position: relative;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.section__title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 72px;
    height: 3px;
    border-radius: var(--radius-pill);
    background: var(--tri);
}

/* ==========================================================================
   5B. HERO TRANG CHỦ — ảnh nền phủ kín màn hình (bơi · đạp · chạy)
   Ảnh nằm trong .hero__media (thẻ <img> thật) nên vẫn có SEO + fetchpriority,
   không phải background-image của CSS.
   Dùng: class .btn--light / .btn--ghost cho nút đặt trên ảnh nền.
   ========================================================================== */
.hero {
    position: relative;
    display: grid;
    align-items: center;
    /* Cao bằng màn hình (trừ header) nhưng không quá 860px, và luôn đủ chỗ cho chữ:
       min() + height auto => màn hình thấp thì khối tự cao thêm, không bị cắt. */
    min-height: min(calc(100vh - var(--header-h)), 860px);        /* fallback máy cũ */
    min-height: min(calc(100svh - var(--header-h)), 860px);       /* 100svh: bỏ thanh địa chỉ */
    overflow: hidden;
    background: #0B1014;                              /* nền tối, ảnh chưa tải cũng không chói */
}

.hero__media { position: absolute; inset: 0; }
.hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 38%;                      /* giữ chủ thể hơi cao */
}

/* Lớp phủ tối: chữ trắng đủ tương phản dù ảnh sáng hay tối */
.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(8, 16, 22, .72) 0%,
        rgba(8, 16, 22, .46) 42%,
        rgba(8, 16, 22, .84) 100%);
}

.hero__inner {
    position: relative;                               /* nằm TRÊN ảnh + lớp phủ */
    padding-top: calc(var(--section-y) + 20px);
    padding-bottom: calc(var(--section-y) + 20px);
    text-align: center;
}

.hero__eyebrow {
    margin: 0 0 16px;
    color: rgba(255, 255, 255, .78);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
}
/* 3 môn in màu riêng cho đúng nhận diện */
.hero__eyebrow .s-boi  { color: var(--swim-on-dark); }
.hero__eyebrow .s-dap  { color: var(--bike-on-dark); }
.hero__eyebrow .s-chay { color: var(--run-on-dark); }

.hero__title {
    margin: 0 0 18px;
    color: #FFFFFF;
    font-family: var(--font-display);
    font-size: clamp(2.05rem, 1.1rem + 5.6vw, 3.9rem);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -.015em;
    text-transform: uppercase;
    text-wrap: balance;
}
.hero__title em {
    font-style: normal;
    color: var(--run-on-dark);                        /* phần nhấn của tiêu đề */
}

.hero__slogan {
    max-width: 58ch;
    margin: 0 auto 26px;
    color: rgba(255, 255, 255, .9);
    font-size: clamp(1rem, .95rem + .45vw, 1.18rem);
    line-height: 1.65;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

/* Nút trên ảnh nền: bản nền trắng + bản viền trắng mờ */
.hero .btn--light {
    border-color: #FFFFFF;
    background: #FFFFFF;
    color: #0E4C92;
}
.hero .btn--light:hover {
    border-color: #FFFFFF;
    background: rgba(255, 255, 255, .88);
    color: #0A3A72;
}
.hero .btn--ghost {
    border-color: rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .1);
    color: #FFFFFF;
}
.hero .btn--ghost:hover {
    border-color: #FFFFFF;
    background: rgba(255, 255, 255, .2);
    color: #FFFFFF;
}

/* Lối tắt 3 môn */
.hero__sports {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}
.hero__sport {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .1);
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.hero__sport::before {
    content: "";
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.hero__sport--boi  { color: var(--swim-on-dark); }
.hero__sport--dap  { color: var(--bike-on-dark); }
.hero__sport--chay { color: var(--run-on-dark); }
.hero__sport:hover {
    border-color: #FFFFFF;
    background: rgba(255, 255, 255, .2);
    color: #FFFFFF;
    text-decoration: none;
}
.hero__sport-count {
    color: rgba(255, 255, 255, .7);
    font-size: 12px;
    font-weight: 500;
}

/* Dải 3 màu ở chân hero */
.hero__bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: var(--tri);
}


/* ==========================================================================
   6. LAYOUT & CARD BÀI VIẾT
   ========================================================================== */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); align-items: start; }
.layout__main { min-width: 0; }
.layout__sidebar { display: flex; flex-direction: column; gap: var(--gap); }

/* --- Card bài viết: bo góc 12px, bóng nhẹ, hover nhấc lên --- */
.post-list { display: flex; flex-direction: column; gap: var(--gap); }

.post-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);                     /* 12px */
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.post-card:hover,
.post-card:focus-within {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-hover);
    transform: var(--lift);                           /* nhấc lên 4px */
}

.post-card__thumb {
    display: block;
    overflow: hidden;
    background: var(--thumb-bg);
}
.post-card__thumb img {
    width: 100%;
    height: 208px;
    object-fit: cover;
    transition: transform .5s cubic-bezier(.2, .7, .3, 1);
}
.post-card:hover .post-card__thumb img { transform: scale(1.04); }

.post-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
}
.post-card__title {
    margin: 0 0 8px;
    font-size: 1.24rem;
    line-height: 1.28;
}
.post-card__title a { color: var(--heading); }
.post-card__title a:hover { color: var(--brand); text-decoration: none; }

.post-card__meta {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: .01em;
}
.post-card__meta span { margin: 0 3px; }
.post-card__meta time { white-space: nowrap; }

/* Nhãn môn (bơi / đạp / chạy) trên card: nhỏ gọn, đứng TRƯỚC tiêu đề */
.post-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
}
.post-card__tags .tag {
    margin: 0;                                        /* khoảng cách do gap lo */
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
}

.post-card__excerpt {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
}

.readmore {
    margin-top: auto;
    color: var(--brand);
    font-size: 14px;
    font-weight: 600;
}
.readmore:hover { text-decoration: none; }
.readmore::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 1px;
    margin-left: 2px;
    vertical-align: middle;
    background: currentColor;
    transition: width .22s ease;
}
.readmore:hover::after { width: 14px; }

/* --- Lưới card (bài viết mới nhất, bài viết liên quan): 1 cột ở mobile --- */
.post-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gap);
}
/* Ảnh card trong lưới giữ tỉ lệ 16:10 nên tự co giãn theo bề rộng cột */
.post-card--grid .post-card__thumb img {
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 10;
}
.post-card--grid .post-card__title { font-size: 1.06rem; }


/* ==========================================================================
   7. PHÂN TRANG
   ========================================================================== */
.pagination { margin: 28px 0 0; }
.pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.pagination a,
.pagination span {
    display: inline-block;
    min-width: 42px;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}
.pagination a:hover {
    border-color: var(--brand);
    color: var(--brand);
    text-decoration: none;
}
.pagination .active span {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--on-brand);
    box-shadow: var(--shadow);
}
.pagination .disabled span {
    background: var(--surface-2);
    color: var(--muted);
    cursor: not-allowed;
}
.pagination .dots span {
    min-width: 24px;
    border: 0;
    background: transparent;
    color: var(--muted);
}

/* ==========================================================================
   8. TRANG CHI TIẾT BÀI VIẾT
   ========================================================================== */
.post-single {
    margin: 26px auto;
    padding: 26px 22px 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.post-single__header { margin-bottom: 18px; }
.post-single__title {
    margin-bottom: 10px;
    font-size: clamp(1.7rem, 1.25rem + 2vw, 2.35rem);
    line-height: 1.15;
}
/* Gạch 3 màu ngắn dưới tiêu đề bài viết */
.post-single__title::after {
    content: "";
    display: block;
    width: 84px;
    height: 4px;
    margin-top: 14px;
    border-radius: var(--radius-pill);
    background: var(--tri);
}

.post-meta {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}
.post-meta span { margin: 0 3px; }

.post-single__thumb { margin: 0 0 24px; }
.post-single__thumb img { width: 100%; border-radius: var(--radius); }

/* Khung nhúng video 16:9 */
.video-embed {
    position: relative;
    width: 100%;
    margin: 0 0 24px;
    padding-top: 56.25%;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--video-bg);
}
.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- 8b. Thanh chia sẻ (Facebook + copy link) --- */
.post-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.post-share__label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease,
                color .18s ease, transform .18s ease;
}
.share-btn:hover {
    border-color: var(--brand);
    background: var(--surface-2);
    color: var(--brand);
    text-decoration: none;
}
.share-btn:active { transform: translateY(1px); }
.share-btn__icon { flex: none; }

/* Nút Facebook: dùng đúng màu thương hiệu để nhận ra ngay */
.share-btn--facebook {
    border-color: #1877F2;
    background: #1877F2;
    color: #FFFFFF;
}
.share-btn--facebook:hover {
    border-color: #0E5FD8;
    background: #0E5FD8;
    color: #FFFFFF;
}

/* Ô link chỉ đọc: bấm là bôi đen hết để người dùng tự copy nếu JS bị chặn */
.post-share__url {
    flex: 1 1 220px;
    min-width: 0;
    padding: 8px 12px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--muted);
    font-family: inherit;
    font-size: 13px;
    text-overflow: ellipsis;
}
.post-share__url:focus {
    border-style: solid;
    border-color: var(--brand);
    color: var(--text);
}

/* --- Typography nội dung bài viết --- */
.post-content {
    color: var(--text);
    font-size: 1.0625rem;
    line-height: 1.8;
}
.post-content > * + * { margin-top: 1em; }
.post-content h2 { margin-top: 1.7em; font-size: 1.5rem; }
.post-content h3 { margin-top: 1.5em; font-size: 1.2rem; }
.post-content h2::after,
.post-content h3::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    margin-top: 8px;
    border-radius: var(--radius-pill);
    background: var(--bike);   /* mạch xanh rừng cho tiêu đề mục */
}
.post-content ul,
.post-content ol { padding-left: 1.35em; }
.post-content li { margin: .4em 0; }
.post-content li::marker { color: var(--bike); }
.post-content a { text-decoration: underline; text-decoration-color: rgba(14, 76, 146, .35); }
.post-content a:hover { text-decoration-color: currentColor; }
.post-content img { border-radius: var(--radius-sm); }
.post-content figure { margin: 1.4em 0; }
.post-content figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.post-content pre {
    overflow-x: auto;
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    background: var(--code-bg);
    color: var(--code-text);
    font-size: 14px;
    line-height: 1.65;
}
.post-content :not(pre) > code {
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--icode-bg);
    color: var(--icode-text);
    font-size: .9em;
}

.post-content blockquote {
    margin: 1.3em 0;
    padding: 14px 18px;
    border-left: 4px solid var(--bike);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--quote-bg);
    color: var(--text);
    font-style: italic;
}
.post-content blockquote p:last-child { margin-bottom: 0; }

.post-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}
.post-content th,
.post-content td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    text-align: left;
}
.post-content th {
    background: var(--surface-2);
    color: var(--heading);
    font-weight: 600;
}

/* ==========================================================================
   9. TAG — NHÃN THẺ THEO MÔN (BƠI / ĐẠP / CHẠY)
   Dùng: <a class="tag tag-boi">…</a> · <a class="tag tag-dap">…</a> · <a class="tag tag-chay">…</a>
   ========================================================================== */
.post-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.post-tags__label {
    margin-right: 8px;
    color: var(--muted);
    font-size: 14px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 6px 6px 0;
    padding: 5px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}
.tag:hover {
    background: var(--surface-3);
    color: var(--brand);
    text-decoration: none;
}
.tag span { color: var(--muted); font-size: 12px; }

/* --- .tag-boi : BƠI — xanh nước #0E4C92 --- */
.tag-boi {
    border-color: var(--swim-bd);
    background: var(--swim-bg);
    color: var(--swim-ink);
}
.tag-boi:hover {
    border-color: var(--swim-ink);
    background: var(--swim-ink);
    color: var(--on-brand);
}

/* --- .tag-dap : ĐẠP — xanh rừng #3E7C4A --- */
.tag-dap {
    border-color: var(--bike-bd);
    background: var(--bike-bg);
    color: var(--bike-ink);
}
.tag-dap:hover {
    border-color: var(--bike-ink);
    background: var(--bike-ink);
    color: var(--on-brand);
}

/* --- .tag-chay : CHẠY — cam nắng #E07A3F --- */
.tag-chay {
    border-color: var(--run-bd);
    background: var(--run-bg);
    color: var(--run-ink);
}
.tag-chay:hover {
    border-color: var(--run-ink);
    background: var(--run-ink);
    color: var(--on-brand);
}

/* Chấm màu nhỏ trước nhãn môn để nhìn là biết môn nào */
.tag-boi::before,
.tag-dap::before,
.tag-chay::before {
    content: "";
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.tag-boi span,
.tag-dap span,
.tag-chay span { color: inherit; opacity: .72; }

/* Thẻ đang được lọc (trang chủ, sidebar) */
.tag.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--on-brand);
    box-shadow: var(--shadow);
}
.tag.is-active span { color: var(--on-brand); opacity: .85; }
.tag-boi.is-active { border-color: var(--swim-ink); background: var(--swim-ink); color: var(--on-brand); }
.tag-dap.is-active { border-color: var(--bike-ink); background: var(--bike-ink); color: var(--on-brand); }
.tag-chay.is-active { border-color: var(--run-ink); background: var(--run-ink); color: var(--on-brand); }

.tag-cloud { display: flex; flex-wrap: wrap; }


/* ==========================================================================
   10. SIDEBAR WIDGET
   ========================================================================== */
.widget {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.widget__title {
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 1.06rem;
}
.widget-list { margin: 0; padding: 0; list-style: none; }
.widget-list li { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.widget-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.widget-list a {
    color: var(--heading);
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.5;
}
.widget-list a:hover { color: var(--brand); }
.widget-list small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

/* Widget "Giới thiệu": đoạn giới thiệu ngắn + vài số liệu nhanh */
.widget__text {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.7;
}
.widget-facts {
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 13.5px;
}
.widget-facts li { padding: 7px 0; border-top: 1px dashed var(--border); }
.widget-facts li:first-child { border-top: 0; }
.widget-facts strong { color: var(--heading); font-weight: 600; }

/* Widget "Bài nổi bật": số thứ hạng + tiêu đề + ngày/lượt xem */
.widget-list--ranked li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.widget-list--ranked li > div { min-width: 0; }
.widget-list__rank {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    margin-top: 3px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    font-family: var(--font-logo);
    font-size: 15px;
    line-height: 24px;
    text-align: center;
}
/* Top 3 tô đúng màu 3 môn: chạy · bơi · đạp */
.widget-list--ranked li:nth-child(1) .widget-list__rank {
    border-color: var(--run-bd);
    background: var(--run-bg);
    color: var(--run-ink);
}
.widget-list--ranked li:nth-child(2) .widget-list__rank {
    border-color: var(--swim-bd);
    background: var(--swim-bg);
    color: var(--swim-ink);
}
.widget-list--ranked li:nth-child(3) .widget-list__rank {
    border-color: var(--bike-bd);
    background: var(--bike-bg);
    color: var(--bike-ink);
}


/* ==========================================================================
   11. FOOTER
   ========================================================================== */
.site-footer {
    position: relative;
    margin-top: 36px;
    background: var(--footer-bg);
    color: var(--footer-text);
}
.site-footer::before {
    content: "";
    display: block;
    height: 3px;
    background: var(--tri);
}
.site-footer__inner {
    padding: 28px var(--gutter);
    font-size: 14px;
    text-align: center;
}
.site-footer p { margin: 5px 0; }
.site-footer a { color: #FFFFFF; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); }
.site-footer a:hover { color: #FFFFFF; text-decoration-color: currentColor; }
.site-footer__meta { font-size: 13px; opacity: .85; }


/* ==========================================================================
   12. TRANG 404
   ========================================================================== */
.http-error {
    padding: 54px 20px 72px;
    text-align: center;
}
.http-error__code {
    margin: 0 0 10px;
    font-family: var(--font-logo);
    font-size: clamp(64px, 12vw, 104px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: .02em;
    background: var(--tri);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--swim);            /* fallback nếu không hỗ trợ background-clip */
}
.http-error__title { font-size: 1.5rem; }
.http-error__text { max-width: 46ch; margin: 0 auto 22px; color: var(--muted); }

/* ==========================================================================
   13. RESPONSIVE — MOBILE-FIRST (viết cho mobile trước, mở rộng dần lên)
   ========================================================================== */

/* --- ≥ 600px: lưới 2 cột, thoáng hơn --- */
@media (min-width: 600px) {
    :root { --gutter: 22px; --section-y: 30px; }

    .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .post-card__thumb img { height: 200px; }
}

/* --- ≥ 760px: header 1 hàng ngang, nav dàn phải --- */
@media (min-width: 760px) {
    :root { --gutter: 26px; --header-h: 72px; --section-y: 34px; }

    .site-header__inner {
        flex-wrap: nowrap;
        gap: 22px;
        padding-top: 0;
        padding-bottom: 0;
    }

    .site-logo { margin-right: 0; }

    .nav-toggle { display: none; }              /* desktop: dùng nav ngang */

    .site-nav {
        display: flex;
        order: 0;
        flex-basis: auto;
        flex-direction: row;
        gap: 20px;
        margin-right: auto;
        padding: 0;
        border-top: 0;
    }
    .site-nav a { padding: 0 0 2px; }

    .site-search { order: 0; flex-basis: auto; }
    .site-search input { min-width: 220px; }

    .post-card__excerpt { font-size: 15.5px; }
}

/* --- ≥ 900px: card bài viết chuyển sang dạng ngang (ảnh | chữ) --- */
@media (min-width: 900px) {
    .post-card { grid-template-columns: 268px minmax(0, 1fr); }
    .post-card__thumb { height: 100%; }
    .post-card__thumb img { height: 100%; min-height: 196px; }
    .post-card__body { justify-content: center; padding: 22px 24px 22px 0; }
    .post-card__title { font-size: 1.32rem; }

    /* Card trong lưới vẫn xếp dọc (ảnh đã theo tỉ lệ 16:10 ở phần trên) */
    .post-card--grid { grid-template-columns: minmax(0, 1fr); }
    .post-card--grid .post-card__thumb { height: auto; }
    .post-card--grid .post-card__body { padding: 16px; }
    .post-card--grid .post-card__title { font-size: 1.06rem; }

    /* Lưới bài viết mới nhất: 3 cột ở desktop */
    .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .post-single { padding: 34px 38px 40px; }
}

/* --- ≥ 1000px: màn hình lớn, giãn nhịp dọc --- */
@media (min-width: 1000px) {
    :root { --section-y: 38px; }

    .hero__inner {
        padding-top: calc(var(--section-y) + 30px);
        padding-bottom: calc(var(--section-y) + 30px);
    }
}

/* --- ≥ 1200px: đủ chỗ mới bật sidebar để lưới 3 cột vẫn thoáng --- */
@media (min-width: 1200px) {
    .layout {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 34px;
    }
    .layout__sidebar {
        position: sticky;
        top: calc(var(--header-h) + 22px);
    }
}

/* ==========================================================================
   14. GIẢM CHUYỂN ĐỘNG · TIỆN ÍCH · KHI IN
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        transition-duration: .001ms !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
    }
    .post-card:hover,
    .post-card:focus-within { transform: none; }
    .post-card:hover .post-card__thumb img { transform: none; }
    .readmore:hover::after { width: 0; }
}

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.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;
}

@media print {
    :root { --bg: #fff; }

    body::before { display: none; }

    /* Hero: bỏ ảnh nền khi in để tiết kiệm mực */
    .hero { min-height: 0; background: #fff; color: var(--text); }
    .hero__media,
    .hero__overlay,
    .hero__bar,
    .hero__sports,
    .hero__actions { display: none !important; }
    .hero__eyebrow,
    .hero__title,
    .hero__slogan { color: var(--text); }
    .hero__title em { color: var(--run-ink); }

    .site-header,
    .site-footer,
    .site-nav,
    .site-search,
    .nav-toggle,
    .layout__sidebar,
    .post-tags,
    .post-share,
    .pagination { display: none !important; }

    .post-single,
    .post-card,
    .widget {
        border: 0;
        box-shadow: none;
    }
    .post-card { break-inside: avoid; }
    a { color: var(--text); text-decoration: underline; }
}

/* ==========================================================================
   15. VIDEO YOUTUBE — "FACADE" (chỉ tải iframe khi người dùng bấm)
   ----------------------------------------------------------------------------
   Thay vì nhúng <iframe> ngay (kéo theo ~1MB JS/ảnh của YouTube cho mọi lượt
   xem), trang chỉ hiện ẢNH THUMBNAIL + nút play. Khi bấm, assets/js/main.js
   (§7) mới tạo iframe và nạp đúng URL nhúng trong data-embed-url.
   Khung .video-embed (§8) vẫn giữ tỉ lệ 16:9 nên bố cục không nhảy.
   ========================================================================== */
.video-facade { cursor: pointer; }

.video-facade__poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .9;
    transition: opacity .2s ease, transform .35s ease;
}
.video-facade:hover .video-facade__poster,
.video-facade:focus-within .video-facade__poster {
    opacity: 1;
    transform: scale(1.02);
}

/* Nút play: một <button> thật nên bấm được cả bằng bàn phím */
.video-facade__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    background: none;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.video-facade__play-icon {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--run);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .38);
    transition: transform .18s ease, background-color .18s ease;
}
.video-facade__play-icon svg { margin-left: 4px; }   /* canh tam giác ra giữa vòng tròn */
.video-facade__play:hover .video-facade__play-icon {
    transform: scale(1.08);
    background: var(--run-ink);
}
.video-facade__label {
    padding: 5px 13px;
    border-radius: var(--radius-pill);
    background: rgba(11, 16, 20, .62);
    font-size: 13px;
    letter-spacing: .01em;
}

/* Sau khi bấm: ẩn nút play, giữ nền tối cho tới khi iframe hiện ra */
.video-facade--loading .video-facade__play { display: none; }


/* ==========================================================================
   16. MODULE LUYỆN TẬP — /tap-luyen
   Màu theo môn: bơi = --swim · đạp = --bike · chạy = --run (xem §1)
   ========================================================================== */

/* --- 16a. Tiêu đề trang + thẻ số liệu --- */
.page-head { margin-bottom: 24px; }
.page-head h1 { margin-bottom: 8px; }
.page-intro {
    max-width: 64ch;
    margin: 0;
    color: var(--muted);
    font-size: 15.5px;
}

.workout-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-tile {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--border-strong);
}
.stat-tile--boi  { border-top-color: var(--swim); }
.stat-tile--dap  { border-top-color: var(--bike); }
.stat-tile--chay { border-top-color: var(--run); }

.stat-tile__value {
    display: block;
    font-family: var(--font-logo);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: .01em;
    color: var(--heading);
}
.stat-tile__label {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

/* --- 16b. Biểu đồ (Chart.js — assets/js/workouts-chart.js) --- */
.workout-chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gap);
    margin-bottom: 26px;
}

.workout-chart-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    min-width: 0;
}
.workout-chart-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.workout-chart-card__title { margin: 0; font-size: 1.06rem; }

/* Khung vẽ: cố định chiều cao để biểu đồ không nhảy khi đổi số liệu */
.workout-chart-wrap {
    position: relative;
    height: 260px;
    min-height: 200px;
}
.workout-chart-wrap canvas { max-width: 100%; }
.workout-chart-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
    padding: 0 20px;
}

/* Nút đổi đơn vị đo: km ↔ phút */
.workout-metric-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface-2);
}
.workout-metric-toggle button {
    padding: 6px 14px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}
.workout-metric-toggle button:hover { color: var(--heading); }
.workout-metric-toggle button.is-active {
    background: var(--surface);
    color: var(--heading);
    box-shadow: var(--shadow);
}

/* Chú giải màu theo môn (thay cho legend mặc định của Chart.js) */
.workout-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 13px;
}
.workout-legend li { display: inline-flex; align-items: center; gap: 7px; }
.workout-legend__dot {
    width: 11px;
    height: 11px;
    border-radius: 3px;
    background: var(--muted);
}
.workout-legend__dot--boi  { background: var(--swim); }
.workout-legend__dot--dap  { background: var(--bike); }
.workout-legend__dot--chay { background: var(--run); }

/* --- 16c. Bộ lọc theo môn --- */
.workout-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 22px;
}
.workout-filter__chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
}
.workout-filter__chip:hover {
    border-color: var(--brand);
    background: var(--surface-2);
    color: var(--brand);
    text-decoration: none;
}
.workout-filter__chip.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--on-brand);
}
.workout-filter__chip--boi.is-active  { border-color: var(--swim-ink); background: var(--swim-ink); }
.workout-filter__chip--dap.is-active  { border-color: var(--bike-ink); background: var(--bike-ink); }
.workout-filter__chip--chay.is-active { border-color: var(--run-ink);  background: var(--run-ink); }
.workout-filter__count { font-size: 12px; opacity: .75; }

/* --- 16d. Dòng thời gian các buổi tập --- */
.workout-timeline {
    position: relative;
    margin: 0;
    padding: 0 0 0 30px;
    list-style: none;
}
.workout-timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    border-radius: 2px;
    background: var(--border);
}

.workout-item { position: relative; margin-bottom: 18px; }
.workout-item:last-child { margin-bottom: 0; }

/* Chấm màu trên trục thời gian = môn tập */
.workout-item__dot {
    position: absolute;
    left: -30px;
    top: 17px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid var(--bg);
    background: var(--muted);
    box-shadow: 0 0 0 1px var(--border);
}
.workout-item--boi  .workout-item__dot { background: var(--swim); }
.workout-item--dap  .workout-item__dot { background: var(--bike); }
.workout-item--chay .workout-item__dot { background: var(--run); }

.workout-item__card {
    padding: 15px 17px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: box-shadow .18s ease;
}
.workout-item__card:hover { box-shadow: var(--shadow-hover); }
.workout-item--boi  .workout-item__card { border-left-color: var(--swim); }
.workout-item--dap  .workout-item__card { border-left-color: var(--bike); }
.workout-item--chay .workout-item__card { border-left-color: var(--run); }

.workout-item__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
}
.workout-item__date { color: var(--muted); font-size: 13.5px; }
.workout-item__title { margin: 0; font-size: 1.08rem; }

.workout-item__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}
.workout-item__metrics li {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    color: var(--muted);
    font-size: 13.5px;
}
.workout-item__metrics strong {
    font-family: var(--font-logo);
    font-size: 1.22rem;
    font-weight: 400;
    letter-spacing: .02em;
    color: var(--heading);
}
.workout-item__notes { margin: 12px 0 0; font-size: 14.5px; }
.workout-item__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 13.5px;
    font-weight: 600;
}

/* Nhãn môn (dùng chung với bảng admin) */
.sport-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
}
.sport-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.sport-badge--boi  { border-color: var(--swim-bd); background: var(--swim-bg); color: var(--swim-ink); }
.sport-badge--dap  { border-color: var(--bike-bd); background: var(--bike-bg); color: var(--bike-ink); }
.sport-badge--chay { border-color: var(--run-bd);  background: var(--run-bg);  color: var(--run-ink); }

/* --- 16e. Widget "Tuần này tôi đã…" ở sidebar --- */
.workout-widget__list { margin: 0; padding: 0; list-style: none; }
.workout-widget__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px dashed var(--border);
    font-size: 14px;
}
.workout-widget__row:first-child { border-top: 0; }
.workout-widget__sport {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--heading);
}
.workout-widget__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--muted);
}
.workout-widget__row--boi  .workout-widget__dot { background: var(--swim); }
.workout-widget__row--dap  .workout-widget__dot { background: var(--bike); }
.workout-widget__row--chay .workout-widget__dot { background: var(--run); }
.workout-widget__value { color: var(--muted); font-size: 13.5px; text-align: right; }
.workout-widget__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 14px;
}
.workout-widget__total strong {
    font-family: var(--font-logo);
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--heading);
}
.workout-widget__empty { margin: 0 0 10px; color: var(--muted); font-size: 14px; }


/* ==========================================================================
   17. TRANG TĨNH — GIỚI THIỆU · LIÊN HỆ (+ bổ sung cho footer)
   ========================================================================== */

/* --- 17a. Footer: 3 khối (thương hiệu · liên kết · mạng xã hội) --- */
.site-footer__inner { text-align: left; }
.site-footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding-bottom: 18px;
}
.site-footer__name {
    margin: 0;
    color: #FFFFFF;
    font-family: var(--font-logo);
    font-size: 1.5rem;
    letter-spacing: .04em;
}
.site-footer__slogan { margin: 6px 0 0; max-width: 44ch; opacity: .9; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }
.site-footer__social { display: flex; flex-wrap: wrap; gap: 8px; }

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .06);
    color: #FFFFFF;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background-color .18s ease, border-color .18s ease;
}
.social-btn:hover { background: rgba(255, 255, 255, .16); color: #FFFFFF; text-decoration: none; }
.social-btn--strava:hover    { border-color: #FC4C02; }
.social-btn--instagram:hover { border-color: #E1306C; }
.social-btn--youtube:hover   { border-color: #FF0000; }
.social-icon { flex: none; }

/* Bản dùng trên nền sáng (trang Liên hệ) */
.social-btn--light {
    border-color: var(--border-strong);
    background: var(--surface);
    color: var(--text);
}
.social-btn--light:hover {
    border-color: var(--brand);
    background: var(--surface-2);
    color: var(--brand);
}

/* --- 17b. Trang Giới thiệu --- */
.about-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gap);
    align-items: start;
    margin-bottom: 34px;
}
.about-photo { margin: 0; }
.about-photo img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.about-photo figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; text-align: center; }

.about-role {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 4px 13px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}
.about-story { font-size: 1.0625rem; }
.about-facts { margin: 18px 0 0; padding: 0; list-style: none; }
.about-facts li {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 8px 0;
    border-top: 1px dashed var(--border);
    font-size: 14.5px;
}
.about-facts li:first-child { border-top: 0; }
.about-facts strong { min-width: 104px; color: var(--heading); }

/* Thẻ kỷ lục cá nhân (PR) — viền trái theo môn */
.pr-card {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.pr-card--boi  { border-left-color: var(--swim); }
.pr-card--dap  { border-left-color: var(--bike); }
.pr-card--chay { border-left-color: var(--run); }
.pr-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.pr-card__sport { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; color: var(--heading); }
.pr-card__value {
    display: block;
    margin-top: 10px;
    font-family: var(--font-logo);
    font-size: 2.1rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: .02em;
    color: var(--heading);
}
.pr-card__meta { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

.achievement-list { margin: 0; padding: 0; list-style: none; }
.achievement-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    padding: 11px 0;
    border-top: 1px dashed var(--border);
}
.achievement-list li:first-child { border-top: 0; }
.achievement-list time { min-width: 64px; color: var(--muted); font-size: 13px; }
.achievement-list strong { color: var(--heading); }

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.gallery figure { margin: 0; }
.gallery a { display: block; border-radius: var(--radius-sm); overflow: hidden; }
.gallery img {
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .3s ease;
}
.gallery a:hover img { transform: scale(1.04); }
.gallery figcaption { margin-top: 6px; color: var(--muted); font-size: 12.5px; }

/* --- 17c. Trang Liên hệ --- */
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gap);
    align-items: start;
}
.contact-form { display: grid; gap: 14px; }
.form-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

.form-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--heading);
    font-size: 14px;
    font-weight: 600;
}
.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
}
.form-field textarea { line-height: 1.65; resize: vertical; }
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(14, 76, 146, .18);
}
.form-field .hint { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }

/* Bẫy bot: ẩn khỏi mắt người nhưng bot vẫn "thấy" và điền vào */
.form-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.form-actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.notice {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 14.5px;
}
.notice--success { border-color: var(--bike-bd); background: var(--bike-bg); color: var(--bike-ink); }
.notice--error {
    border-color: rgba(192, 57, 43, .38);
    background: rgba(192, 57, 43, .08);
    color: var(--danger);
}
.notice h2 { margin-bottom: 6px; font-size: 1.05rem; }
.notice p:last-child { margin-bottom: 0; }
.notice ul { margin: 6px 0 0; padding-left: 1.25em; }


/* ==========================================================================
   18. BỔ SUNG RESPONSIVE — cho các thành phần mới (§15 · §16 · §17)
   Đặt sau cùng để các media query bên dưới thắng khi cùng độ ưu tiên.
   ========================================================================== */

/* Menu: 3 liên kết trang tĩnh chỉ hiện ở màn hình rộng (footer có lối vào song song) */
.site-nav__pages { display: flex; flex-direction: column; gap: 2px; }

@media (min-width: 600px) {
    .form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 760px) {
    .site-nav__pages { flex-direction: row; gap: 20px; }
    .site-footer__grid { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
}

@media (max-width: 999px) {
    /* Chưa đủ chỗ cho 7 mục menu -> giấu 3 liên kết trang tĩnh */
    .site-nav__pages { display: none; }
}

@media (min-width: 900px) {
    .workout-chart-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
    .about-hero { grid-template-columns: 320px minmax(0, 1fr); gap: 30px; }
    .contact-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 30px; }
}

@media (min-width: 1200px) {
    .site-footer__grid { grid-template-columns: minmax(0, 1.4fr) auto auto; }
}

/* Khi in: bỏ các thành phần tương tác của video & bộ lọc */
@media print {
    .video-facade__play,
    .workout-filter,
    .workout-metric-toggle,
    .site-nav__pages { display: none !important; }

    .video-facade__poster { position: static; opacity: 1; }
    .workout-item__card,
    .stat-tile,
    .pr-card { border: 0; box-shadow: none; }
}

