/*
Theme Name: AMA Corporate
Theme URI: https://amaconts.com
Author: AMA Team
Description: Giao diện động WordPress cho Công ty Cổ phần Kiến Thiết AMA
Version: 1.0.0
*/

html { 
    scroll-behavior: smooth; 
}

.glass-nav { 
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(10px); 
}

.ticker-wrap { 
    overflow: hidden; 
    white-space: nowrap; 
    box-sizing: border-box; 
}

.ticker { 
    display: inline-block; 
    animation: ticker 30s linear infinite; 
    padding-left: 100%; 
}

.ticker-item { 
    display: inline-block; 
    padding: 0 2rem; 
}

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

.service-card { 
    transition: all 0.4s ease; 
}

.service-card:hover { 
    transform: translateY(-10px); 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); 
    border-color: #00A651; 
}

.icon-glow { 
    transition: all 0.4s ease; 
}

.service-card:hover .icon-glow { 
    filter: drop-shadow(0 0 8px rgba(0, 166, 81, 0.5)); 
    color: #00A651; 
}

/* In đậm và nổi bật tiêu đề trong bài viết */
.prose h1, .prose h2, .prose h3, .prose h4 {
    color: #0F2C59 !important;
    font-weight: 800 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.3 !important;
}

.prose h1 { font-size: 1.875rem !important; }
.prose h2 { 
    font-size: 1.5rem !important; 
    border-left: 4px solid #00A651 !important;
    padding-left: 0.75rem !important;
}
.prose h3 { font-size: 1.25rem !important; }
.prose h4 { font-size: 1.125rem !important; }

.prose strong, .prose b {
    font-weight: 700 !important;
    color: #111827 !important;
}

/* 1. Khung chứa Gallery và Cột luôn dàn ngang cạnh nhau */
.wp-block-gallery,
.gallery,
.wp-block-columns {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 1rem !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

/* 2. Chia đều chiều rộng cho từng ảnh/cột nằm trên cùng một hàng */
.wp-block-gallery .wp-block-image,
.wp-block-gallery figure,
.gallery-item,
.wp-block-columns .wp-block-column {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* 3. Cố định chiều cao bằng nhau, chống méo ảnh */
.wp-block-gallery img,
.gallery img,
.wp-block-columns img {
    width: 100% !important;
    height: 320px !important;
    object-fit: cover !important;
    border-radius: 0.75rem !important;
}

/* 4. Tự chuyển dạng dọc trên di động */
@media (max-width: 640px) {
    .wp-block-gallery,
    .gallery,
    .wp-block-columns {
        flex-direction: column !important;
    }
    .wp-block-gallery img,
    .gallery img,
    .wp-block-columns img {
        height: 220px !important;
    }
}

/* ==========================================================================
   HERO ENTRANCE ANIMATIONS & EFFECTS
   ========================================================================== */

/* Zoom chậm ảnh nền Hero (Ken Burns) */
@keyframes heroKenBurns {
    0% { transform: scale(1.12); }
    100% { transform: scale(1); }
}
.hero-bg-zoom {
    animation: heroKenBurns 3.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform;
}

/* Hiệu ứng chữ và nút xuất hiện trượt từ dưới lên so le */
@keyframes heroFadeUp {
    0% {
        opacity: 0;
        transform: translateY(28px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
.hero-fade-1 { animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both; }
.hero-fade-2 { animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both; }
.hero-fade-3 { animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both; }
.hero-fade-4 { animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.75s both; }

/* Vệt sáng lướt qua nút CTA */
.btn-shimmer {
    position: relative;
    overflow: hidden;
}
.btn-shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 60%;
    height: 200%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.35),
        transparent
    );
    transform: rotate(25deg);
    animation: btnShine 4.5s infinite ease-in-out;
}
@keyframes btnShine {
    0%, 35% { left: -100%; }
    55%, 100% { left: 160%; }
}

/* ==========================================================================
   SCROLL REVEAL ANIMATIONS
   ========================================================================== */

/* Trạng thái mặc định trước khi cuộn tới */
.reveal-item {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

/* Biến thể trượt từ bên hông vào (dùng cho ảnh và chữ phần About) */
.reveal-item.reveal-left {
    transform: translateX(-40px);
}
.reveal-item.reveal-right {
    transform: translateX(40px);
}

/* Khi cuộn tới tầm mắt: kích hoạt hiện hình */
.reveal-item.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Độ trễ so le (Stagger) giúp các thẻ trong lưới xuất hiện lần lượt */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }

/* ==========================================================================
   PAGE TRANSITION (HIỆU ỨNG CHUYỂN TRANG)
   ========================================================================== */
#page-transition-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Thanh tiến trình chạy nhẹ ở mép trên cùng */
#page-transition-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #00A651, #F97300);
    transition: width 0.35s ease;
}

/* Trạng thái kích hoạt khi đang thoát trang */
body.is-leaving #page-transition-overlay {
    opacity: 1;
    pointer-events: auto;
}

body.is-leaving #page-transition-bar {
    width: 100%;
}

/* ==========================================================================
   ĐỊNH DẠNG KHU VỰC BÌNH LUẬN (COMMENTS & REPLIES)
   ========================================================================== */

/* Danh sách phản hồi cấp con (Nested comments) */
.comment-list .children {
    margin-left: 1.5rem;
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (max-width: 640px) {
    .comment-list .children {
        margin-left: 0.75rem;
        padding-left: 0.5rem;
    }
}

/* Nút hủy trả lời */
#cancel-comment-reply-link {
    font-size: 0.8rem;
    color: #ef4444;
    margin-left: 0.75rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
#cancel-comment-reply-link:hover {
    color: #b91c1c;
}

/* Tinh chỉnh form comment mặc định của WP */
#commentform p.logged-in-as {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1rem;
}
#commentform p.logged-in-as a {
    color: #0F2C59;
    font-weight: 600;
}
#commentform p.logged-in-as a:hover {
    color: #00A651;
}