/* Header Styles */
.site-header {
    background: var(--bg-card);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo h1,
.logo .blogname {
    font-size: 25px;
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
    display: inline-block;
}

.main-nav ul {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-main);
}

.main-nav a:hover {
    color: var(--accent);
}

.btn-subscribe {
    background: var(--primary);
    color: var(--secondary);
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    display: inline-block;
    vertical-align: middle;
}

.btn-subscribe:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.user-welcome {
    font-size: 0.875rem;
    font-weight: 600;
    margin-right: 0.5rem;
    color: var(--text-main);
    display: inline-block;
    vertical-align: middle;
}

.btn-write {
    background: #10b981 !important;
    color: #ffffff !important;
}

.btn-write:hover {
    background: #059669 !important;
}

.btn-dashboard {
    background: #3b82f6 !important;
    color: #ffffff !important;
}

.btn-dashboard:hover {
    background: #2563eb !important;
}

.btn-logout {
    background: #ef4444 !important;
    color: #ffffff !important;
}

.btn-logout:hover {
    background: #dc2626 !important;
}

.menu-toggle {
    display: none;
}

/* Footer Styles */
.site-footer {
    background: var(--primary);
    color: var(--secondary);
    margin-top: unset;
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: var(--gap-lg);
    margin-bottom: 3rem;
}

.footer-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-menu a {
    font-size: 0.875rem;
    opacity: 0.8;
}

.footer-menu a:hover {
    opacity: 1;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.6;
}


/* Global Mobile Responsiveness */
@media (max-width: 768px) {
    body.mobile-menu-active {
        overflow: hidden;
    }

    .main-nav {
        display: flex;
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        background: var(--bg-card);
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.08);
        z-index: 1000;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 5.5rem 2rem 2rem;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
    }

    .main-nav.is-active {
        right: 0;
    }

    .main-nav ul {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
    }

    .main-nav li {
        width: 100%;
    }

    .main-nav a {
        display: block;
        font-size: 1.125rem;
        font-weight: 600;
        padding: 0.75rem 0;
        color: var(--text-main);
        border-bottom: 1px solid var(--border-color);
        transition: var(--transition);
    }

    .main-nav a:hover {
        color: var(--accent);
        padding-left: 5px;
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
        position: relative;
        order: 3;
    }

    .menu-toggle .hamburger-line {
        display: block;
        width: 100%;
        height: 2px;
        background-color: var(--text-main);
        border-radius: 2px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .menu-toggle.is-active .line-1 {
        transform: translateY(8px) rotate(45deg);
        background-color: var(--text-main);
    }

    .menu-toggle.is-active .line-2 {
        opacity: 0;
        transform: translateX(-10px);
    }

    .menu-toggle.is-active .line-3 {
        transform: translateY(-8px) rotate(-45deg);
        background-color: var(--text-main);
    }

    .header-actions {
        order: 2;
        margin-left: auto;
        margin-right: 1.25rem;
    }

    .btn-subscribe {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Menu Backdrop Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.post-thumbnail-video-wrapper {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    overflow: hidden;
}

.post-thumbnail-video-wrapper img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

/* Specific context: Grid cards */
.post-card .post-thumbnail-video-wrapper {
    height: auto;
}
.post-card .post-thumbnail-video-wrapper img {
    aspect-ratio: 16/10;
    object-fit: cover;
    height: auto;
}

/* Specific context: Featured post (stretches to fill container height) */
.featured-post .post-thumbnail-video-wrapper {
    height: 100%;
}
.featured-post .post-thumbnail-video-wrapper img {
    height: 100%;
    object-fit: cover;
}

/* Specific context: Video single post hero (stretches to fill container height) */
.video-post-hero .post-thumbnail-video-wrapper {
    height: 100%;
}
.video-post-hero .post-thumbnail-video-wrapper img {
    height: 100%;
    object-fit: cover;
}

.play-btn-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.65);
    border: 3px solid #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
    pointer-events: none; /* Tránh cản trở sự kiện click chuột */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Hiệu ứng zoom nhẹ thumbnail và nhấn play khi hover */
a:hover .post-thumbnail-video-wrapper img {
    transform: scale(1.05);
}

a:hover .play-btn-overlay {
    background: rgba(0, 0, 0, 0.85);
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.play-icon-triangle {
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #fff;
    margin-left: 4px; /* Căn chỉnh quang học tâm tam giác */
}

@media (max-width: 768px) {
    .play-btn-overlay {
        width: 46px;
        height: 46px;
        border-width: 2px;
    }
    
    .play-icon-triangle {
        border-top-width: 8px;
        border-bottom-width: 8px;
        border-left-width: 12px;
        margin-left: 3px;
    }
}