/*
Theme Name: Portal BCH Quân sự Lâm Đồng
Theme URI: https://nguyentronghieu.io.vn
Author: NGUYỄN TRỌNG HIẾU
Author URI: https://nguyentronghieu.io.vn
Description: Cổng thông tin điện tử Bộ Chỉ huy Quân sự tỉnh Lâm Đồng 
Version: 1.0.5
Text Domain: portal-quan-su
Tags: military, news, government, tailwindcss, responsive
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
*/

/* ===== Root Variables ===== */
:root {
    --color-military-green: #1e3a1e;
    --color-military-olive: #3d4f2f;
    --color-military-khaki: #8b7355;
    --color-military-gold: #d4af37;
    --color-accent-red: #dc2626;
    --color-accent-yellow: #fbbf24;
    
    --font-primary: 'Roboto', Arial, sans-serif;
    --font-heading: 'Roboto Condensed', 'Arial Narrow', sans-serif;
    
    --transition-default: all 0.3s ease;
}

/* ===== Base Styles ===== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

/* ===== Custom Utilities ===== */
.line-clamp-1 {
    display: -webkit-box !important;
    -webkit-line-clamp: 1 !important;
    line-clamp: 1 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.line-clamp-2 {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== Marquee (Seamless Loop) ===== */
.marquee-wrapper {
    overflow: hidden;
    width: 100%;
    position: relative;
}

.marquee-content {
    display: inline-flex;
    white-space: nowrap;
    animation: marquee-scroll linear infinite;
}

.marquee-wrapper:hover .marquee-content {
    animation-play-state: paused;
}

.marquee-item {
    display: inline-flex;
    align-items: center;
    padding: 0 24px;
}

.marquee-item > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.marquee-item i {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.marquee-item span {
    line-height: 1;
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-33.33%);
    }
}

/* ===== Vertical Marquee (Auto Scroll News) ===== */
.vertical-marquee-wrapper {
    overflow: hidden;
    position: relative;
}

.vertical-marquee-content {
    animation: vertical-marquee-scroll 20s linear infinite;
}

.vertical-marquee-wrapper:hover .vertical-marquee-content {
    animation-play-state: paused;
}

@keyframes vertical-marquee-scroll {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

/* Dropdown Menu Animation */
.group:hover .group-hover\:visible {
    visibility: visible;
    opacity: 1;
}

/* Desktop Mega Dropdown Enhancements */
.group > div[class*="absolute"] {
    pointer-events: none;
}

.group:hover > div[class*="absolute"] {
    pointer-events: auto;
}

.group > div[class*="absolute"] a:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.group > div[class*="absolute"]::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.05);
}

/* Card Hover Effects */
.card-hover {
    transition: var(--transition-default);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* ===== Scrollbar Customization ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--color-military-olive);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-military-green);
}

/* ===== Print Styles ===== */
@media print {
    header nav,
    footer,
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    a {
        color: #000;
        text-decoration: none;
    }
    
    @page {
        margin: 2cm;
    }
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav ul li a {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* ===== Animation Classes ===== */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Loading States ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===== Focus States (Accessibility) ===== */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--color-military-gold);
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-military-green);
    color: white;
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* ===== WordPress Specific Styles ===== */
.wp-block-image img {
    max-width: 100%;
    height: auto;
}

.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.875rem;
    color: #666;
    text-align: center;
    margin-top: 0.5rem;
}

/* Screen Reader Text */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 0.375rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    color: #374151;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.pagination .page-numbers:hover {
    background-color: var(--color-military-green);
    color: white;
    border-color: var(--color-military-green);
}

.pagination .page-numbers.current {
    background-color: var(--color-military-green);
    color: white;
    border-color: var(--color-military-green);
}

/* Comments */
.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    padding: 1.5rem;
    background: white;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.comment-author img {
    border-radius: 50%;
}

.comment-reply-link {
    color: var(--color-military-green);
    font-size: 0.875rem;
}

.comment-reply-link:hover {
    text-decoration: underline;
}

/* ===== Footer Logo Customization ===== */
footer .custom-logo-link {
    display: block;
    width: 48px;
    height: 48px;
}

footer .custom-logo-link img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}
