/*
Theme Name: Vietnamese Story Theme
Theme URI: https://example.com/vietnamese-story-theme
Author: Custom Theme Developer
Author URI: https://example.com
Description: Theme đọc truyện chữ tiếng Việt chuẩn SEO, hỗ trợ grid/list archive, single page tương tác, homepage sections chuyên biệt. Tối ưu hiệu suất và SEO.
Version: 1.7.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vietnamese-story-theme
Tags: stories, reading, vietnamese, seo, responsive
*/

/* ============================================
   GLOBAL STYLES - Chung cho toàn bộ theme
   ============================================ */
:root {
    --primary-color: #006537;
    --secondary-color: #003d21;
    --text-color: #333;
    --background-color: #ffffff;
    --surface-color: #ffffff;
    --header-background: #006537;
    --header-text-color: #ffffff;
    --footer-background: #006537;
    --footer-text-color: #dddddd;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Nút cuộn lên đầu trang dùng trên toàn website */
.scroll-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999;
    display: inline-flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #fff;
    background: var(--primary-color);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    cursor: pointer;
    transform: translateY(12px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.scroll-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-to-top:hover,
.scroll-to-top:focus-visible {
    color: #fff;
    background: var(--secondary-color);
}

.scroll-to-top:focus-visible {
    outline: 3px solid rgba(0, 101, 55, 0.28);
    outline-offset: 3px;
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

@media (max-width: 767px) {
    .scroll-to-top {
        right: 16px;
        bottom: 16px;
        width: 42px;
        height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-to-top {
        transition: none;
    }
}

@media print {
    .scroll-to-top {
        display: none;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--secondary-color);
}

/* Utility classes */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-15 { gap: 15px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Button styles */
.btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    background-color: #c11212;
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

/* Card styles */
.story-card {
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.story-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.story-card .card-image {
    position: relative;
    overflow: hidden;
}

.story-card .card-image img {
    width: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.story-card:hover .card-image img {
    transform: scale(1.05);
}

.story-card .card-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.story-card .card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-card .card-meta {
    font-size: 13px;
    color: #666;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.story-card .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.story-card .meta-item i {
    color: var(--primary-color);
}

/* List view styles */
.story-list-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.story-list-item:last-child {
    border-bottom: none;
}

.story-list-item .list-image {
    width: 120px;
    flex-shrink: 0;
}

.story-list-item .list-image img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
}

.story-list-item .list-content {
    flex: 1;
}

.story-list-item .list-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--secondary-color);
}

.story-list-item .list-desc {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-list-item .list-meta {
    font-size: 13px;
    color: #777;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Section title */
.section-title {
    font-size: 24px;
    margin-bottom: 24px;
    position: relative;
    padding-bottom: 12px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .story-list-item {
        flex-direction: column;
        gap: 12px;
    }
    
    .story-list-item .list-image {
        width: 100%;
        max-width: 200px;
    }
}

/* ============================================
   HEADER STYLES (Common)
   ============================================ */
.site-header {
    background: var(--header-background);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.custom-header-html {
    margin-top: 12px;
    padding-top: 10px;
    color: var(--header-text-color);
    font-size: 14px;
    line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.custom-header-html a {
    color: var(--header-text-color);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.custom-header-html a:hover,
.custom-header-html a:focus-visible {
    color: #fff;
}

.custom-header-html img,
.custom-footer-html img {
    max-width: 100%;
    height: auto;
}

.custom-header-html > .container > :last-child,
.custom-footer-html > :last-child {
    margin-bottom: 0;
}

.site-logo{
width: 170px;    
}

.site-logo .logo-desktop {
    max-height: 52px;
    width: auto;
}

.site-logo .logo-mobile {
    display: none;
    max-height: 42px;
    width: auto;
}

.site-title-text {
    font-size: 26px;
    font-weight: 800;
    color: var(--header-text-color);
    letter-spacing: -0.5px;
}

.main-navigation .nav-menu {
    list-style: none;
    gap: 28px;
}

.main-navigation .nav-menu > li > a {
    font-weight: 500;
    color: var(--header-text-color);
    padding: 8px 0;
    position: relative;
}

.main-navigation .nav-menu > li > a:hover {
    color: #a8e6cf;
}

.main-navigation .nav-menu > li > a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.main-navigation .nav-menu > li > a:hover:after {
    width: 100%;
}

/* Search */
.search-wrapper {
    position: relative;
}

.search-icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.search-icon-btn:hover {
    color: #a8e6cf;
}

.search-form-container {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    padding: 8px;
    display: none;
    z-index: 1001;
}

.search-form-container.active {
    display: block;
}

.search-form {
    display: flex;
    align-items: center;
}

.search-field {
    flex: 1;
    border: 1px solid #ddd;
    padding: 10px 14px;
    border-radius: 6px 0 0 6px;
    font-size: 15px;
    outline: none;
}

.search-field:focus {
    border-color: var(--primary-color);
}

.search-submit {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: #fff;
    padding: 8px;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: flex-end;
}

.mobile-menu-overlay.active {
    display: flex;
}

.mobile-menu-content {
    background: var(--primary-color);
    width: 280px;
    height: 100%;
    padding: 20px;
    position: relative;
    overflow-y: auto;
    color: #fff;
}

.mobile-menu-content a {
    color: #fff;
}

.mobile-menu-content .close-btn {
    color: #fff;
}

.mobile-menu-content .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
}

.mobile-nav-menu {
    list-style: none;
    margin-top: 50px;
}

.mobile-nav-menu li {
    border-bottom: 1px solid #eee;
}

.mobile-nav-menu a {
    display: block;
    padding: 14px 0;
    font-size: 17px;
    color: #fff;
}

/* ============================================
   FOOTER STYLES (Common)
   ============================================ */
.site-footer {
    position: relative;
    background: var(--footer-background);
    color: var(--footer-text-color);
    padding: 0 0 24px;
    margin-top: 90px;
    overflow: visible;
}

.site-footer:before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.08), transparent 34%),
        linear-gradient(135deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.18));
}

.site-footer > .container {
    position: relative;
    z-index: 1;
}

.footer-designed {
    padding-top: 1px;
}

.footer-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 4px;
    padding: 26px 30px;
    color: var(--text-color);
    background: var(--surface-color);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.2);
    transform: translateY(-36px);
}

.footer-cta-content {
    max-width: 760px;
}

.footer-cta-title {
    margin: 0 0 6px;
    color: var(--secondary-color);
    font-size: clamp(22px, 3vw, 30px);
    line-height: 1.25;
}

.footer-cta p {
    margin: 0;
    color: var(--text-color);
}

.footer-cta-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 11px 20px;
    color: #fff !important;
    background: var(--primary-color);
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.footer-cta-button:hover,
.footer-cta-button:focus-visible {
    color: #fff;
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.footer-widget-title {
    position: relative;
    margin: 0 0 18px;
    padding-bottom: 10px;
    color: #fff;
    font-size: 17px;
    line-height: 1.35;
}

.footer-widget-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 38px;
    height: 2px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 999px;
}

.site-footer a {
    color: var(--footer-text-color);
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: #fff;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 36px;
    margin: 0 0 34px;
}

.footer-col {
    min-width: 0;
}

.footer-brand {
    color: #fff !important;
    font-size: 20px;
    font-weight: 800;
}

.footer-about-text,
.footer-extra-content {
    overflow-wrap: anywhere;
}

.footer-about-text p,
.footer-extra-content p {
    margin: 0 0 10px;
}

.footer-menu,
.footer-category-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-menu li,
.footer-category-list li {
    margin-bottom: 9px;
}

.footer-menu a,
.footer-category-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 3px 0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.footer-menu a:before {
    content: '›';
    margin-right: 7px;
    color: #fff;
    font-weight: 700;
}

.footer-menu a {
    justify-content: flex-start;
}

.footer-menu a:hover,
.footer-menu a:focus-visible,
.footer-category-list a:hover,
.footer-category-list a:focus-visible {
    transform: translateX(3px);
}

.footer-category-count {
    display: inline-flex;
    min-width: 28px;
    height: 24px;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    font-size: 12px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    color: var(--footer-text-color);
    font-size: 13px;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
}

.custom-footer-html {
    padding: 46px 0 20px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.custom-footer-html a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.custom-footer-html a:hover,
.custom-footer-html a:focus-visible {
    color: var(--footer-text-color);
}

@media (max-width: 767px) {
    .site-footer {
        margin-top: 72px;
    }

    .footer-cta {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
        padding: 22px;
        transform: translateY(-28px);
    }

    .footer-cta-button {
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 30px 22px;
    }
}

@media (max-width: 520px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   GRID UTILITIES
   ============================================ */
.grid-2-columns,
.grid-3-columns,
.grid-4-columns {
    display: grid;
    gap: 24px;
}

.grid-2-columns { grid-template-columns: repeat(2, 1fr); }
.grid-3-columns { grid-template-columns: repeat(3, 1fr); }
.grid-4-columns { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .grid-3-columns { grid-template-columns: repeat(2, 1fr); }
    .grid-4-columns { grid-template-columns: repeat(2, 1fr); }
}

/* Giữ 2 cột trên mobile cho các box lưới (theo yêu cầu) */
@media (max-width: 576px) {
    .grid-2-columns,
    .grid-3-columns,
    .grid-4-columns { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 16px;
    }
    
    .story-card .card-content {
        padding: 12px;
    }
}

/* ============================================
   MISC
   ============================================ */
.flex-1 { flex: 1; }

.loading {
    opacity: 0.7;
    pointer-events: none;
}

.heart-animation {
    position: absolute;
    color: #e63939;
    animation: heartPop 0.8s ease forwards;
    pointer-events: none;
}

@keyframes heartPop {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* ============================================
   AUTHOR / PROFILE PAGE STYLES
   ============================================ */
.author-page-wrapper {
    padding: 40px 0 60px;
}

.author-profile-header {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    background: var(--light-bg);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 40px;
}

.author-avatar img {
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: var(--shadow);
}

.author-name {
    font-size: 28px;
    margin-bottom: 10px;
}

.author-bio {
    font-size: 16px;
    color: #444;
    max-width: 600px;
}

.author-stats {
    font-size: 15px;
    color: #555;
}

.author-stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.author-stats i {
    color: var(--primary-color);
}

/* ============================================
   HEADER RESPONSIVE - Menu PC & Mobile
   ============================================ */
@media (max-width: 992px) {
    .main-navigation {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .header-inner {
        gap: 10px;
    }
    
    .site-logo.has-mobile-logo .logo-desktop {
        display: none;
    }
    
    .site-logo .logo-mobile {
        display: block;
    }
}

@media (max-width: 576px) {
    .site-logo .logo-mobile {
        max-height: 36px;
    }
}
/* ==================== CÁC ICON SVG THAY THẾ ==================== */

/* Ẩn nội dung Font Awesome cũ */
.fas.fa-search,
.fas.fa-bars,
.fas.fa-eye,
.fas.fa-heart {
    font-size: 0 !important;
    width: 15px;
    height: 15px;
    display: inline-block;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
	
}

/* ==================== ICON SEARCH ==================== */
.fas.fa-search {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}

/* ==================== ICON MENU (Hamburger) ==================== */
.fas.fa-bars {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cline x1='3' y1='12' x2='21' y2='12'/%3E%3Cline x1='3' y1='18' x2='21' y2='18'/%3E%3C/svg%3E");
}

/* ==================== ICON CLOSE (X) ==================== */
.mobile-menu-btn.active .fas.fa-bars {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}

/* ==================== ICON EYE (Mắt) ==================== */
.fas.fa-eye {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23012232' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

/* ==================== ICON HEART (Tim) ==================== */
.fas.fa-heart {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ff0000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E");
}

/* Hover effect chung */
.fas.fa-search:hover,
.fas.fa-bars:hover,
.fas.fa-eye:hover,
.fas.fa-heart:hover {
    filter: brightness(0.8);
}

/* Màu hover riêng cho từng icon (tùy chỉnh) */
.fas.fa-search:hover { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23e74c3c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") !important; }





/* ===== Box chung ===== */
.home-box {
    margin-bottom: 20px;
}
.section-title .more-link {
    font-size: 0.8em;
    margin-left: 15px;
}

/* ===== Grid wrapper ===== */
.grid-wrapper {
    display: grid;
    gap: 20px;
}

/* Số cột mặc định cho desktop (dùng class từ PHP) */
.cols-desktop-1 .grid-wrapper { grid-template-columns: repeat(1, 1fr); }
.cols-desktop-2 .grid-wrapper { grid-template-columns: repeat(2, 1fr); }
.cols-desktop-3 .grid-wrapper { grid-template-columns: repeat(3, 1fr); }
.cols-desktop-4 .grid-wrapper { grid-template-columns: repeat(4, 1fr); }
.cols-desktop-5 .grid-wrapper { grid-template-columns: repeat(5, 1fr); }
.cols-desktop-6 .grid-wrapper { grid-template-columns: repeat(6, 1fr); }

/* Số cột trên mobile (dùng class) */
@media (max-width: 767px) {
    .cols-mobile-1 .grid-wrapper { grid-template-columns: repeat(1, 1fr); }
    .cols-mobile-2 .grid-wrapper { grid-template-columns: repeat(2, 1fr); }
    .cols-mobile-3 .grid-wrapper { grid-template-columns: repeat(3, 1fr); }
    .cols-mobile-4 .grid-wrapper { grid-template-columns: repeat(4, 1fr); }
}

/* ===== List ===== */
.list-wrapper {
    list-style: none;
    padding: 0;
    margin: 0;
}
.list-wrapper .story-list-item {
    display: flex;
    gap: 15px;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}
.list-wrapper .list-thumb {
    flex-shrink: 0;
    width: 100px;
}
.list-wrapper .list-content {
    flex: 1;
}
.list-wrapper .list-title {
    margin: 0 0 5px;
}
.list-wrapper .list-desc {
    font-size: 0.9em;
    color: #555;
}
.list-wrapper .list-meta {
    font-size: 0.8em;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ===== Tỉ lệ ảnh ===== */
.card-image.ratio-16-9,
.list-thumb.ratio-16-9 {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    display: block;
}
.card-image.ratio-4-3,
.list-thumb.ratio-4-3 {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: block;
}
.card-image.ratio-2-3,
.list-thumb.ratio-2-3 { aspect-ratio: 2 / 3; overflow: hidden; display: block; }
.card-image.ratio-19-6,
.list-thumb.ratio-19-6 { aspect-ratio: 19 / 6; overflow: hidden; display: block; }
.card-image img,
.list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Card trong grid ===== */
.story-card {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.card-content {
    padding: 10px;
}
.card-title {
    margin: 0 0 8px;
    font-size: 1rem;
}
.card-meta {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.card-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ===== Category / Tag list ===== */
.category-list-grid,
.tag-list-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.category-item,
.tag-item {
    background: #f0f0f0;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
}
.category-item .cat-count {
    font-size: 0.8em;
    color: #777;
    margin-left: 5px;
}
.ratio-3-4 {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    display: block;
}
.ratio-3-4 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
