/* Layout 3 - Chinese New Year Style (Fixed + Support Horizontal/Vertical Layouts) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&display=swap');

:root {
    --red-chinese: #D32F2F;
    --gold-chinese: #FFC107;
    --deep-red: #B71C1C;
    --lucky-gold: #FFD54F;
    --dark-bg: #1A0A0A;
    --card-bg: rgba(139, 0, 0, 0.3);
    --lantern-glow: #FF6B35;
}

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

body.layout-3 {
    background: linear-gradient(180deg, #1A0A0A 0%, #2C0F0F 50%, #1A0A0A 100%);
    font-family: 'Noto Sans Thai', 'Noto Serif SC', sans-serif;
    color: #FFF8E1;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ลายมงคลพื้นหลัง */
body.layout-3::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 193, 7, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(211, 47, 47, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Header - Fixed Sticky */
.header-layout-3 {
    background: linear-gradient(135deg, rgba(183, 28, 28, 0.95), rgba(211, 47, 47, 0.95));
    backdrop-filter: blur(15px);
    border-bottom: 3px solid var(--gold-chinese);
    box-shadow: 
        0 5px 30px rgba(211, 47, 47, 0.5),
        0 0 60px rgba(255, 193, 7, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-layout-3 .header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-layout-3 .site-branding {
    flex-shrink: 0;
}

.header-layout-3 .site-title {
    margin: 0;
}

.header-layout-3 .site-title a {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(135deg, #FFD54F, #FFC107, #FFD54F);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: 3px;
    transition: 0.3s;
    text-shadow: 0 0 30px rgba(255, 193, 7, 0.5);
}

.header-layout-3 .site-title a:hover {
    filter: brightness(1.3);
    text-shadow: 0 0 40px rgba(255, 193, 7, 0.8);
}

/* Navigation - Horizontal Menu */
.header-layout-3 .main-navigation {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.header-layout-3 .main-navigation ul {
    display: flex;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-layout-3 .main-navigation li {
    margin: 0;
}

.header-layout-3 .main-navigation a {
    display: inline-block;
    color: #FFF8E1;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    background: linear-gradient(135deg, rgba(183, 28, 28, 0.6), rgba(211, 47, 47, 0.6));
    border: 2px solid rgba(255, 193, 7, 0.4);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.header-layout-3 .main-navigation a:hover,
.header-layout-3 .main-navigation .current_page_item a {
    background: linear-gradient(135deg, #FFD54F, #FFC107);
    color: #B71C1C;
    border-color: var(--gold-chinese);
    box-shadow: 0 5px 20px rgba(255, 193, 7, 0.6);
    transform: translateY(-2px);
}

/* Hero Section */
.layout-3 #primary {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 30px 80px;
    position: relative;
    z-index: 1;
}

/* Welcome Card */
.layout-3 .entry-header {
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(145deg, 
        rgba(139, 0, 0, 0.8), 
        rgba(183, 28, 28, 0.6), 
        rgba(139, 0, 0, 0.8));
    backdrop-filter: blur(15px);
    border-radius: 30px;
    border: 3px solid rgba(255, 193, 7, 0.5);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 100px rgba(255, 193, 7, 0.3),
        inset 0 0 80px rgba(255, 107, 53, 0.1);
    margin-bottom: 60px;
    position: relative;
    overflow: hidden;
}

/* ลายมงคลหมุน */
.layout-3 .entry-header::before {
    content: '福';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 300px;
    font-family: 'Noto Serif SC', serif;
    color: rgba(255, 193, 7, 0.05);
    animation: rotate-fortune 20s linear infinite;
    pointer-events: none;
}

@keyframes rotate-fortune {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* โคมแดงลอย */
.layout-3 .entry-header::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 107, 53, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255, 193, 7, 0.2) 0%, transparent 40%);
    animation: lantern-glow 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes lantern-glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.layout-3 .entry-title {
    font-size: 48px;
    font-weight: 700;
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(135deg, #FFD54F, #FFC107, #FFD54F);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    animation: gold-shine 3s ease-in-out infinite;
}

@keyframes gold-shine {
    0%, 100% { 
        filter: drop-shadow(0 0 20px rgba(255, 193, 7, 0.6));
    }
    50% { 
        filter: drop-shadow(0 0 40px rgba(255, 193, 7, 1));
    }
}

.layout-3 .site-description {
    font-size: 18px;
    color: #FFF8E1;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
    line-height: 1.6;
}

/* Content Area */
.layout-3 .entry-content {
    background: transparent;
    padding: 0;
}

/* ============================================
   ✅ OLD STYLE - สำหรับ content ทั่วไป
   ============================================ */
.layout-3 .entry-content > *:not(.content-section) {
    background: linear-gradient(145deg, 
        rgba(139, 0, 0, 0.7), 
        rgba(183, 28, 28, 0.5));
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 25px;
    border: 2px solid rgba(255, 193, 7, 0.3);
    margin-bottom: 30px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(211, 47, 47, 0.2);
}

/* ============================================
   ✅ NEW STYLE - รองรับ Layout แนวนอน/แนวตั้ง
   ============================================ */

/* Section Container */
.layout-3 .entry-content .content-section {
    background: linear-gradient(145deg, 
        rgba(139, 0, 0, 0.7), 
        rgba(183, 28, 28, 0.5));
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 25px;
    border: 2px solid rgba(255, 193, 7, 0.3);
    margin-bottom: 30px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(211, 47, 47, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.layout-3 .entry-content .content-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.layout-3 .entry-content .content-section:hover {
    border-color: rgba(255, 193, 7, 0.6);
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(255, 193, 7, 0.4);
    transform: translateY(-3px);
}

/* Flex Container สำหรับ Image + Text */
.layout-3 .entry-content .content-section > div[style*="flex"] {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Reset flex items */
.layout-3 .entry-content .content-section > div[style*="flex"] > div {
    flex: 1;
}

/* Image Styling */
.layout-3 .entry-content .content-section img {
    width: 100%;
    /* max-width: 75%; */
    height: auto;
    display: block;
    border-radius: 15px;
    border: 3px solid rgba(255, 193, 7, 0.4);
    box-shadow: 
        0 8px 25px rgba(211, 47, 47, 0.4),
        0 0 30px rgba(255, 193, 7, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.layout-3 .entry-content .content-section img:hover {
    transform: scale(1.05);
    border-color: rgba(255, 193, 7, 0.7);
    box-shadow: 
        0 12px 35px rgba(211, 47, 47, 0.6),
        0 0 40px rgba(255, 193, 7, 0.4);
}

/* Text Content ใน Section */
.layout-3 .entry-content .content-section h2 {
    font-size: 32px;
    font-family: 'Noto Serif SC', serif;
    color: var(--lucky-gold);
    margin-bottom: 20px;
    text-align: left;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 0 20px rgba(255, 193, 7, 0.5);
}

/* ลบเส้นใต้ออกสำหรับ h2 ใน content-section */
.layout-3 .entry-content .content-section h2::after {
    content: none;
}

.layout-3 .entry-content .content-section h3 {
    font-size: 24px;
    color: var(--gold-chinese);
    margin-bottom: 15px;
    margin-top: 25px;
    font-family: 'Noto Serif SC', serif;
}

.layout-3 .entry-content .content-section p {
    color: #FFF8E1;
    line-height: 1.8;
    margin-bottom: 15px;
    font-size: 16px;
}

.layout-3 .entry-content .content-section ul {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.layout-3 .entry-content .content-section li {
    padding: 15px 20px;
    margin-bottom: 12px;
    background: rgba(255, 193, 7, 0.08);
    border-left: 4px solid var(--gold-chinese);
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #FFF8E1;
    position: relative;
}

/* ✅ แสดง bullet เฉพาะ li ที่ไม่มีเลข (ul ที่ไม่มี class numbered-list) */
.layout-3 .entry-content .content-section ul:not(.numbered-list) li::before {
    content: '•';
    color: var(--gold-chinese);
    font-size: 20px;
    position: absolute;
    left: 8px;
}

/* ✅ ปรับ padding สำหรับ li ที่มี bullet */
.layout-3 .entry-content .content-section ul:not(.numbered-list) li {
    padding-left: 35px;
}

.layout-3 .entry-content .content-section li:hover {
    background: rgba(255, 193, 7, 0.15);
    transform: translateX(8px);
    border-left-width: 6px;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.3);
}

/* ============================================
   ✅ OLD CONTENT STYLES (เก็บไว้เพื่อความเข้ากันได้)
   ============================================ */

.layout-3 .entry-content h1,
.layout-3 .entry-content h2,
.layout-3 .entry-content h3 {
    color: var(--lucky-gold);
    margin-bottom: 20px;
    font-weight: 700;
    font-family: 'Noto Serif SC', serif;
}

.layout-3 .entry-content h2 {
    font-size: 32px;
    text-align: center;
    position: relative;
    padding-bottom: 20px;
}

.layout-3 .entry-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(135deg, #D32F2F, #FFC107, #D32F2F);
    border-radius: 2px;
}

.layout-3 .entry-content p {
    color: #FFF8E1;
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 16px;
}

.layout-3 .entry-content ul {
    list-style: none;
    padding: 0;
}

.layout-3 .entry-content li {
    padding: 20px;
    margin-bottom: 15px;
    background: rgba(255, 193, 7, 0.08);
    border-left: 4px solid var(--gold-chinese);
    border-radius: 10px;
    transition: 0.3s;
}

.layout-3 .entry-content li:hover {
    background: rgba(255, 193, 7, 0.15);
    transform: translateX(10px);
    border-left-width: 8px;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.3);
}

.layout-3 .entry-content a {
    color: var(--lucky-gold);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    position: relative;
}

.layout-3 .entry-content a:hover {
    color: var(--gold-chinese);
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.8);
}

/* Footer */
.layout-3 .site-footer {
    background: linear-gradient(135deg, rgba(183, 28, 28, 0.95), rgba(211, 47, 47, 0.95));
    border-top: 3px solid var(--gold-chinese);
    padding: 40px 30px;
    text-align: center;
    margin-top: 80px;
    box-shadow: 0 -5px 30px rgba(211, 47, 47, 0.4);
    position: relative;
}

.layout-3 .site-info {
    color: #FFF8E1;
    font-size: 14px;
    opacity: 0.9;
}

/* Breadcrumbs */
.layout-3 .cool-theme-breadcrumbs {
    background: rgba(255, 193, 7, 0.15);
    border: 2px solid rgba(255, 193, 7, 0.4);
    padding: 12px 25px;
    border-radius: 25px;
    margin-bottom: 30px;
    display: inline-block;
}

.layout-3 .cool-theme-breadcrumbs a {
    color: var(--lucky-gold);
    text-decoration: none;
}

.layout-3 .cool-theme-breadcrumbs a:hover {
    color: var(--gold-chinese);
}

/* ============================================
   ✅ RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .header-layout-3 .header-container {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .header-layout-3 .main-navigation {
        width: 100%;
        justify-content: center;
    }
    
    .header-layout-3 .main-navigation ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .header-layout-3 .site-title a {
        font-size: 24px;
    }
    
    .layout-3 .entry-title {
        font-size: 32px;
    }
    
    .layout-3 .entry-header {
        padding: 40px 25px;
    }
    
    .layout-3 .entry-content > *:not(.content-section) {
        padding: 25px;
    }
    
    /* ✅ Mobile: บังคับให้ทุก Layout เป็นแนวตั้ง */
    .layout-3 .entry-content .content-section {
        padding: 25px;
    }
    
    .layout-3 .entry-content .content-section > div[style*="flex"] {
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    .layout-3 .entry-content .content-section > div[style*="flex"] > div {
        flex: 1 1 100% !important;
        width: 100% !important;
    }
    
    .layout-3 .entry-content .content-section h2 {
        font-size: 24px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .layout-3 #primary {
        padding: 40px 15px 60px;
    }
    
    .header-layout-3 .main-navigation a {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .layout-3 .entry-content .content-section {
        padding: 20px;
    }
}