/* Reset and Base Styles - Minimal Red & White Theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #DC2626;
    --dark-red: #991B1B;
    --light-red: #FEE2E2;
    --white: #FFFFFF;
    --black: #000000;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
}

body {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background-color: var(--white);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles - Minimal News Style */
.header {
    background: var(--white);
    border-bottom: 3px solid var(--primary-red);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--gray-900);
    color: var(--white);
    padding: 8px 0;
    font-size: 0.875rem;
}

.header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-date {
    font-weight: 300;
}

.header-social {
    display: flex;
    gap: 1rem;
}

.header-social a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.header-social a:hover {
    color: var(--primary-red);
}

.header-main {
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-red);
    text-decoration: none;
    letter-spacing: -1px;
    line-height: 1;
}

.logo:hover {
    color: var(--dark-red);
}

.nav {
    background: var(--white);
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 0;
}

.nav-link {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--gray-900);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    background: var(--gray-50);
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
}

.nav-link.active {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 200px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid var(--gray-200);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.nav li:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li {
    list-style: none;
}

.dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 400;
    text-transform: none;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.dropdown a:hover {
    background: var(--gray-50);
    color: var(--primary-red);
}

/* Breaking News Ticker */
.breaking-news {
    background: var(--primary-red);
    color: var(--white);
    padding: 0.75rem 0;
    overflow: hidden;
}

.breaking-news-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.breaking-label {
    background: var(--dark-red);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.breaking-ticker {
    flex: 1;
    overflow: hidden;
}

.breaking-ticker ul {
    display: flex;
    animation: ticker 30s linear infinite;
}

.breaking-ticker li {
    white-space: nowrap;
    padding-right: 2rem;
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Main Content */
.main {
    padding: 2rem 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

/* Hero Slider */
.hero-slider {
    margin-bottom: 2rem;
    position: relative;
    height: 400px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.hero-slide {
    position: relative;
    height: 100%;
    display: none;
}

.hero-slide.active {
    display: block;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: var(--white);
    padding: 2rem;
}

.hero-category {
    background: var(--primary-red);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.hero-title a {
    color: var(--white);
    text-decoration: none;
}

.hero-title a:hover {
    text-decoration: underline;
}

.hero-meta {
    font-size: 0.875rem;
    opacity: 0.9;
}

.slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    pointer-events: none;
}

.slider-btn {
    background: rgba(0,0,0,0.5);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    pointer-events: all;
    transition: background 0.3s ease;
}

.slider-btn:hover {
    background: rgba(0,0,0,0.8);
}

.slider-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.slider-dot.active {
    background: var(--white);
}

/* Article Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.article-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.article-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.article-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-video-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-red);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.article-content {
    padding: 1.5rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.category {
    background: var(--primary-red);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date {
    color: var(--gray-500);
    font-weight: 400;
}

.article-title {
    margin-bottom: 0.75rem;
}

.article-title a {
    color: var(--gray-900);
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.article-title a:hover {
    color: var(--primary-red);
}

.article-excerpt {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--gray-500);
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.author {
    font-weight: 600;
    color: var(--gray-700);
}

.views {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Video Section */
.video-section {
    background: var(--gray-50);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-red);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-link {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.section-link:hover {
    color: var(--dark-red);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.video-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.video-thumbnail {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: var(--primary-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-card:hover .play-button {
    background: var(--dark-red);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-content {
    padding: 1rem;
}

.video-title {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.video-title a {
    color: var(--gray-900);
    text-decoration: none;
}

.video-title a:hover {
    color: var(--primary-red);
}

.video-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--gray-900);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-red);
}

.sidebar-list {
    list-style: none;
}

.sidebar-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-link {
    color: var(--gray-900);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.3;
    display: block;
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.sidebar-link:hover {
    color: var(--primary-red);
}

.sidebar-date,
.sidebar-views {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-link {
    padding: 0.5rem 1rem;
    background: var(--white);
    color: var(--gray-700);
    text-decoration: none;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: var(--gray-50);
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.page-link.active {
    background: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-red);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-700);
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* Search Form Styles */
.search-container {
    position: relative;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    min-width: 300px;
    transition: all 0.3s ease;
}

.search-form:focus-within {
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-form input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.25rem;
    font-size: 0.875rem;
    outline: none;
    color: var(--gray-700);
}

.search-form input::placeholder {
    color: var(--gray-500);
}

.search-form button {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--gray-600);
    transition: color 0.3s ease;
}

.search-form button:hover {
    color: var(--primary-red);
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-700);
    padding: 0.5rem;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.breadcrumb a {
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--primary-red);
}

.breadcrumb .separator {
    color: var(--gray-400);
}

.utility-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0 1.5rem;
    flex-wrap: wrap;
}

.action-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.utility-actions button {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-800);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.utility-actions button:hover {
    background: var(--gray-50);
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.filter-badge {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    background: var(--light-red);
    color: var(--dark-red);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
}

.filter-badge .clear-filter {
    color: var(--dark-red);
    text-decoration: underline;
    font-weight: 600;
}

.social-share {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.share-btn {
    padding: 0.5rem 1rem;
    color: var(--white);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.share-btn:hover {
    opacity: 0.8;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.line {
    background: #00c300;
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-red);
    color: var(--white);
    border: none;
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    z-index: 1100;
}

.back-to-top.show {
    display: flex;
}

/* Enhanced Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--white);
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 1000;
    }
    
    .nav.active {
        right: 0;
    }
    
    .nav-list {
        flex-direction: column;
        padding: 2rem;
    }
    
    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: var(--gray-50);
        margin-top: 0.5rem;
        border-radius: 8px;
    }
    
    .nav li:hover .dropdown {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    
    .search-form {
        min-width: 200px;
    }
    
    .header-content {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .logo {
        font-size: 1.75rem;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .hero-slider {
        height: 250px;
    }
    
    .hero-title {
        font-size: 1.25rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .category-header {
        flex-direction: column;
    }
    
    .category-title {
        font-size: 1.75rem;
    }
    
    .sort-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-form {
        min-width: 100%;
        max-width: 300px;
    }
    
    .search-form input::placeholder {
        font-size: 0.75rem;
    }
    
    .logo {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .nav {
        width: 90%;
    }
    
    .hero-slider {
        height: 200px;
    }
    
    .hero-title {
        font-size: 1rem;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .article-card {
        margin-bottom: 1rem;
    }
    
    .article-image {
        height: 150px;
    }
    
    .article-content {
        padding: 1rem;
    }
    
    .article-title {
        font-size: 1rem;
    }
    
    .article-excerpt {
        font-size: 0.8rem;
    }
    
    .sidebar {
        margin-top: 2rem;
    }
    
    .social-share {
        flex-wrap: wrap;
    }
    
    .breadcrumb {
        font-size: 0.75rem;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .page-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .search-header {
        padding: 1rem;
    }
    
    .search-title {
        font-size: 1.25rem;
    }
    
    .search-form-inline {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-actions {
        flex-direction: column;
    }
    
    .category-title {
        font-size: 1.5rem;
    }
    
    .category-header {
        padding: 1rem;
    }
    
    .sort-buttons {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .sort-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-red);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Messages */
.error-message {
    background: var(--light-red);
    color: var(--dark-red);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid var(--primary-red);
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid #28a745;
}

/* Tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: var(--white);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Additional fixes for common issues */
.no-articles, .no-results {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.no-articles h2, .no-results h2 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.no-articles p, .no-results p {
    color: var(--gray-600);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Fix for dropdown positioning */
.nav {
    position: relative;
}

.nav > .nav-list > li {
    position: relative;
}

/* Fix for article detail page */
.article-detail {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.article-header {
    padding: 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.article-image {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-body {
    padding: 2rem;
    line-height: 1.8;
    font-size: 1.125rem;
    color: var(--gray-800);
}

.article-gallery {
    padding: 2rem;
    border-top: 1px solid var(--gray-200);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.article-footer {
    padding: 2rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.article-tags, .article-share {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag-label, .share-label {
    font-weight: 600;
    color: var(--gray-700);
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--primary-red);
    color: var(--white);
}

.share-btn {
    padding: 0.5rem 1rem;
    color: var(--white);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.share-btn:hover {
    opacity: 0.8;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.line {
    background: #00c300;
}

/* Related articles */
.related-articles {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.related-card {
    display: flex;
    flex-direction: column;
    background: var(--gray-50);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.related-card:hover {
    transform: translateY(-2px);
}

.related-image {
    height: 120px;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content {
    padding: 1rem;
    flex: 1;
}

.related-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.related-title a {
    color: var(--gray-900);
    text-decoration: none;
}

.related-title a:hover {
    color: var(--primary-red);
}

.related-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: flex;
    justify-content: space-between;
}

/* Video container fixes */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin: 2rem 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Accessibility improvements */
.nav-open {
    overflow: hidden;
}

/* Focus visible for better keyboard navigation */
.nav-link:focus-visible,
.article-title a:focus-visible,
.sidebar-link:focus-visible,
.btn-back:focus-visible,
.btn-new-search:focus-visible {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* Print improvements */
@media print {
    .header, .sidebar, .footer, .nav, .social-share, .article-footer, .related-articles {
        display: none !important;
    }
    
    .article-detail {
        box-shadow: none;
        border: none;
        margin: 0;
        padding: 0;
    }
    
    .article-body {
        padding: 0;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .article-title {
        font-size: 18pt;
        margin-bottom: 1rem;
    }
}

/* Accessibility */
.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;
}

/* Focus styles */
button:focus,
input:focus,
textarea:focus,
a:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-red);
    color: var(--white);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-to-content:focus {
    top: 6px;
}
