/*
Theme Name: 51Sports News
Theme URI: https://51sports.com.vn/
Author: 51Sports
Description: Giao diện tin tức thể thao responsive cho 51Sports.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: 51sports
*/

/* Fonts hỗ trợ tiếng Việt */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&family=Montserrat:wght@500;600;700;800&display=swap');

:root {
    --primary: #08a9e6;
    --primary-dark: #007db5;
    --navy: #061522;
    --navy-2: #0b2435;
    --accent: #ff6b1a;
    --accent-2: #ffc107;
    --ink: #101828;
    --muted: #667085;
    --line: #e4ebf0;
    --soft: #f2f7fa;
    --white: #fff;
    --max: 1240px;
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Be Vietnam Pro', Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: #f7fafc;
    line-height: 1.65;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(var(--max), calc(100% - 32px));
    margin-inline: auto;
}

/* Header */
.site-top {
    background: #06131e;
    color: #d9e6ee;
    font-size: 13px;
}

.site-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 34px;
}

.site-top a {
    color: #d9e6ee;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 10px rgba(0, 0, 0, .04);
    backdrop-filter: blur(10px);
}

.header-main {
    min-height: 88px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.brand {
    display: flex;
    align-items: center;
}

.brand img {
    width: 260px;
    max-height: 62px;
    object-fit: contain;
    object-position: left center;
}

.header-search {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search input {
    width: 230px;
    border: 1px solid #dce5ea;
    border-radius: 8px;
    padding: 10px 12px;
    outline: none;
    font: inherit;
}

.header-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 169, 230, .12);
}

.header-search button {
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #ff6b1a, #ff8a3d);
    box-shadow: 0 5px 12px rgba(255, 107, 26, .2);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.main-nav {
    color: #fff;
    background: linear-gradient(90deg, #008fd0 0%, #08a9e6 55%, #12b9ec 100%);
    box-shadow: 0 4px 14px rgba(8, 169, 230, .18);
}

.main-nav ul {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav li {
    flex: 0 0 auto;
}

.main-nav a {
    position: relative;
    display: block;
    padding: 13px 15px;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    transition: background .2s ease;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 5px;
    height: 2px;
    background: #fff;
    transform: scaleX(0);
    transition: transform .2s ease;
}

.main-nav a:hover,
.main-nav .current-menu-item > a {
    background: rgba(0, 0, 0, .12);
}

.main-nav a:hover::after,
.main-nav .current-menu-item > a::after {
    transform: scaleX(1);
}

.menu-toggle {
    display: none;
}

/* Thanh tin mới */
.breaking {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.breaking .container {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 44px;
}

.breaking-label {
    padding: 5px 9px;
    border-radius: 5px;
    background: linear-gradient(135deg, #f04438, #ff6b1a);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.breaking-list {
    display: flex;
    gap: 24px;
    overflow: hidden;
    white-space: nowrap;
    font-size: 14px;
}

/* Khung trang */
.page-wrap {
    padding: 24px 0 44px;
}

/* Trang chủ: nội dung và quảng cáo bên phải */
.homepage-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 300px !important;
    align-items: start !important;
    gap: 25px !important;
    width: min(var(--max), calc(100% - 32px)) !important;
    margin-inline: auto;
    box-sizing: border-box !important;
}

.homepage-main {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

.homepage-sidebar {
    display: block !important;
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-self: start !important;
    box-sizing: border-box !important;
}

.homepage-ad {
    display: block !important;
    width: 300px !important;
    max-width: 300px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, .12);
    box-sizing: border-box !important;
}

.homepage-ad a {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
}

.homepage-ad img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    object-fit: contain !important;
}

/* Tin nổi bật */
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 18px;
}

/*
 * ẢNH CHÍNH:
 * Dùng object-position để ưu tiên phần đầu ảnh.
 * Thay đổi 15% thành 0%-10% nếu đầu nhân vật vẫn bị cắt.
 */
.hero-main {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    height: 390px;
    min-height: 0;
    border-radius: var(--radius);
    background: #10202c;
    box-shadow: 0 12px 30px rgba(6, 21, 34, .16);
}

.hero-main > a {
    position: absolute;
    inset: 0;
    display: block;
    z-index: 0;
}

.hero-main > a > img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center 12%;
    opacity: .95;
    transition: transform .35s ease;
}

.hero-main:hover > a > img {
    transform: scale(1.015);
}

.hero-main .overlay {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 28px;
    color: #fff;
    background: linear-gradient(
        to bottom,
        rgba(6, 21, 34, 0) 20%,
        rgba(6, 21, 34, .16) 48%,
        rgba(6, 21, 34, .94) 100%
    );
    pointer-events: none;
}

.hero-main .overlay > div {
    width: 100%;
}

.hero-main .overlay a {
    color: #fff;
    pointer-events: auto;
}

.hero-main .overlay h1 {
    margin: 0;
    color: #fff;
    font-family: 'Montserrat', 'Be Vietnam Pro', Arial, sans-serif;
    font-size: clamp(24px, 2vw, 32px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.hero-main .overlay h1 a:hover {
    color: #d8f5ff;
}

.hero-main .overlay .kicker {
    color: #ff6b1a;
}

.hero-main .overlay .meta {
    margin-top: 5px;
    color: #d7e0e8;
    font-size: 12px;
}

.hero-placeholder {
    width: 100%;
    height: 100%;
    min-height: 390px;
    background: #10202c;
}

/* Hai bài bên cạnh ảnh chính */
.hero-side {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 18px;
    min-width: 0;
}

.story-card {
    display: grid;
    grid-template-columns: 42% minmax(0, 1fr);
    gap: 14px;
    min-width: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    transition: transform .2s ease;
}

.story-card:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.story-card:hover {
    transform: translateY(-2px);
}

.story-card > a {
    display: block;
    overflow: hidden;
    border-radius: 10px;
}

.story-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 10px;
}

.story-card h3 {
    margin: 3px 0 8px;
    font-family: 'Montserrat', 'Be Vietnam Pro', Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.015em;
}

.story-card h3 a:hover,
.news-item h3 a:hover,
.category-card h3 a:hover {
    color: var(--primary-dark);
}

.story-placeholder {
    height: 150px;
    border-radius: 10px;
    background: #edf3f6;
}

/* Tiêu đề chuyên mục */
.kicker {
    display: inline-block;
    margin-bottom: 7px;
    color: var(--accent);
    font-family: 'Be Vietnam Pro', Arial, sans-serif;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.meta {
    color: var(--muted);
    font-size: 12px;
}

/* Tin mới nhất */
.section {
    margin-top: 32px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 2px solid #102534;
}

.section-title h2 {
    position: relative;
    margin: 0;
    padding-bottom: 8px;
    font-family: 'Montserrat', 'Be Vietnam Pro', Arial, sans-serif;
    font-size: 22px;
    font-weight: 700;
}

.section-title h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 62px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.section-title a {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 28px;
}

.news-list {
    display: grid;
    gap: 16px;
}

.news-item {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
    transition: transform .2s ease;
}

.news-item:hover {
    transform: translateY(-2px);
}

.news-item img {
    width: 240px;
    height: 145px;
    object-fit: cover;
    border-radius: 10px;
}

.news-item h3 {
    margin: 4px 0 8px;
    font-family: 'Montserrat', 'Be Vietnam Pro', Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.015em;
}

.news-item p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.news-placeholder {
    width: 240px;
    height: 145px;
    border-radius: 10px;
    background: #edf3f6;
}

/* Widget thể thao */
.sports-widget {
    max-width: 600px;
    margin: 20px auto;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .08);
    font-family: 'Be Vietnam Pro', Arial, sans-serif;
}

.widget-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    background: #f4f6f8;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: 0;
    background: transparent;
    color: #4b5563;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
}

.tab-btn.active {
    border-bottom: 3px solid #d32f2f;
    background: #fff;
    color: #d32f2f;
}

.tab-content {
    display: none;
    padding: 15px;
}

.tab-content.active {
    display: block;
}

.match-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #f3f4f6;
}

.team {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.team.away {
    justify-content: flex-end;
}

.team img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.match-score {
    min-width: 50px;
    padding: 4px 10px;
    border-radius: 4px;
    background: #1f2937;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.table-responsive {
    overflow-x: auto;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: center;
}

.standings-table th,
.standings-table td {
    padding: 10px 6px;
    border-bottom: 1px solid #f3f4f6;
}

.standings-table th {
    background: #f9fafb;
    color: #6b7280;
    font-weight: 600;
}

.standings-table .text-left {
    text-align: left;
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.team-cell img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.status-msg {
    padding: 20px;
    color: #6b7280;
    text-align: center;
}

/* Hộp thông tin / sidebar dùng ở các trang khác */
.sidebar-box {
    overflow: hidden;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 5px 18px rgba(6, 21, 34, .05);
}

.sidebar-box h3 {
    margin: 0;
    padding: 12px 15px;
    border-left: 4px solid var(--accent);
    background: linear-gradient(90deg, var(--navy), var(--navy-2));
    color: #fff;
    font-size: 16px;
}

.sidebar-box .inner {
    padding: 14px;
}

.ad-box {
    display: grid;
    min-height: 180px;
    place-items: center;
    border: 1px dashed #cbd5dd;
    border-radius: 10px;
    background: var(--soft);
    color: #98a2b3;
    font-size: 12px;
}

.score {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.score:last-child {
    border-bottom: 0;
}

.score strong {
    color: var(--primary-dark);
}

/* Thẻ chuyên mục */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.category-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 5px 18px rgba(6, 21, 34, .05);
    transition: transform .2s ease, box-shadow .2s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(6, 21, 34, .11);
}

.category-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.category-card .pad {
    padding: 13px;
}

.category-card h3 {
    margin: 0;
    font-family: 'Montserrat', 'Be Vietnam Pro', Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

/* Footer */
.site-footer {
    margin-top: 42px;
    background: linear-gradient(135deg, #061522 0%, #092536 65%, #063b55 100%);
    color: #c8d5dd;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
    padding: 40px 0;
}

.footer-brand img {
    width: 250px;
    max-height: 62px;
    margin-bottom: 16px;
    object-fit: contain;
    object-position: left center;
}

.footer-brand p {
    color: #b9cbd5;
}

.footer-title {
    position: relative;
    margin: 0 0 12px;
    padding-bottom: 7px;
    color: #fff;
    font-size: 16px;
    font-weight: 900;
}

.footer-title::after {
    content: "";
    display: block;
    width: 36px;
    height: 2px;
    margin-top: 6px;
    background: var(--accent);
}

.footer-links {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
}

.footer-bottom {
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: 13px;
}

/* Font tiêu đề và nội dung */
h1, h2, h3, h4, h5, h6,
.entry-title,
.post-title {
    font-family: 'Montserrat', 'Be Vietnam Pro', Arial, sans-serif;
    font-weight: 700;
}

body,
button,
input,
textarea,
select,
.site-top,
.breaking-list,
.meta,
.news-item p,
.footer-links,
.footer-bottom,
.tab-btn,
.match-card,
.team,
.standings-table,
.status-msg {
    font-family: 'Be Vietnam Pro', Arial, Helvetica, sans-serif;
}

.entry-content,
.entry-content p,
.post-content,
.post-content p {
    font-family: 'Be Vietnam Pro', Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.8;
}

/* Responsive: máy tính bảng và màn hình nhỏ */
@media (max-width: 991px) {
    .header-main {
        min-height: 72px;
    }

    .brand img {
        width: 210px;
    }

    .header-search input {
        width: 170px;
    }

    .homepage-layout {
        display: block !important;
        width: calc(100% - 32px) !important;
    }

    .homepage-main {
        width: 100% !important;
    }

    .homepage-sidebar {
        position: static !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        margin-top: 25px !important;
    }

    .homepage-ad {
        width: 100% !important;
        max-width: 100% !important;
    }

    .homepage-ad img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }

    .hero-grid,
    .content-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-main {
        height: 320px;
    }

    .hero-placeholder {
        min-height: 320px;
    }

    .hero-side {
        grid-template-rows: auto;
    }

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Responsive: điện thoại */
@media (max-width: 640px) {
    .container {
        width: calc(100% - 20px);
    }

    .site-top .container {
        min-height: 30px;
    }

    .site-top .right {
        display: none;
    }

    .header-main {
        gap: 10px;
    }

    .brand img {
        width: 165px;
    }

    .header-search {
        display: none;
    }

    .main-nav ul {
        padding-bottom: 0;
    }

    .main-nav a {
        padding: 11px 12px;
        font-size: 13px;
    }

    .breaking-list {
        gap: 14px;
    }

    .page-wrap {
        padding-top: 16px;
    }

    .homepage-layout {
        width: calc(100% - 20px) !important;
    }

    .hero-main {
        height: 300px;
        border-radius: 10px;
    }

    .hero-main > a > img {
        object-position: center 8%;
    }

    .hero-main .overlay {
        padding: 18px;
    }

    .hero-main .overlay h1 {
        font-size: 23px;
        line-height: 1.3;
    }

    .hero-side {
        gap: 12px;
    }

    .story-card img {
        height: 110px;
    }

    .story-placeholder {
        height: 110px;
    }

    .story-card h3 {
        font-size: 16px;
    }

    .news-item {
        grid-template-columns: 125px minmax(0, 1fr);
        gap: 12px;
    }

    .news-item img {
        width: 125px;
        height: 90px;
    }

    .news-placeholder {
        width: 125px;
        height: 90px;
    }

    .news-item h3 {
        margin-top: 0;
        font-size: 17px;
    }

    .news-item p {
        display: none;
    }

    .category-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .footer-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }
}
