/*
Theme Name: ช่างเบิร์ด
Theme URI: https://changbird.com
Author: ช่างเบิร์ด
Description: WordPress Theme สำหรับเว็บไซต์ช่างเบิร์ด งานไฟฟ้า โซล่าเซลล์ แอร์ กล้องวงจรปิด
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: Private
Text Domain: changbird
*/

/* ── Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Prompt', sans-serif;
    background-color: #111827;
    color: #fff;
}

/* ── Hero ─────────────────────────────── */
#hero {
    background-image:
        linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)),
        url('https://www.saengsaha.com/wp-content/uploads/2024/03/1-%E0%B8%A3%E0%B8%B0%E0%B8%9A%E0%B8%9A%E0%B9%84%E0%B8%9F%E0%B8%9F%E0%B9%89%E0%B8%B2-1-%E0%B9%80%E0%B8%9F%E0%B8%AA-%E0%B8%81%E0%B8%B1%E0%B8%9A-3-%E0%B9%80%E0%B8%9F%E0%B8%AA-%E0%B8%84%E0%B8%A7%E0%B8%B2%E0%B8%A1%E0%B8%AA%E0%B8%B3%E0%B8%84%E0%B8%B1%E0%B8%8D%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%84%E0%B8%B8%E0%B8%93%E0%B8%95%E0%B9%89%E0%B8%AD%E0%B8%87%E0%B8%A3%E0%B8%B9%E0%B9%89.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 1.5s ease-in-out;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.text-shadow-lg { text-shadow: 3px 3px 6px rgba(0,0,0,0.8); }

/* ── Skeleton loader ─────────────────── */
.skeleton {
    background: linear-gradient(90deg, #374151 25%, #4B5563 50%, #374151 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Gallery ─────────────────────────── */
.gallery-grid {
    columns: 2;
    column-gap: 0.75rem;
}
@media (min-width: 640px) { .gallery-grid { columns: 3; } }
@media (min-width: 1024px) { .gallery-grid { columns: 4; } }

.gallery-item {
    break-inside: avoid;
    margin-bottom: 0.75rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
}
.gallery-item img {
    width: 100%; display: block;
    transition: transform 0.4s ease, filter 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.06); filter: brightness(0.75); }
.gallery-item-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s;
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }

/* ── Lightbox ────────────────────────── */
#lightbox {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.93);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
#lightbox.open { opacity: 1; visibility: visible; }
#lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 0.5rem; }
#lightbox-close {
    position: fixed; top: 1.25rem; right: 1.5rem;
    font-size: 1.5rem; color: #fff; cursor: pointer;
    background: rgba(255,255,255,0.15); border-radius: 50%;
    width: 2.5rem; height: 2.5rem;
    display: flex; align-items: center; justify-content: center;
    border: none; z-index: 10000;
}
#lightbox-prev, #lightbox-next {
    position: fixed; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.15); border: none; color: white;
    font-size: 1.5rem; padding: 0.75rem 1rem;
    cursor: pointer; border-radius: 0.5rem; z-index: 10000;
}
#lightbox-prev { left: 1rem; }
#lightbox-next { right: 1rem; }
#lightbox-caption {
    position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,0.6); font-size: 0.8rem; z-index: 10000;
}

/* ── Blog cards ──────────────────────── */
.blog-card-img-wrap { overflow: hidden; height: 12rem; }
.blog-card-img-wrap img { width:100%; height:100%; object-fit:cover; transition: transform 0.5s; }
.blog-card:hover .blog-card-img-wrap img { transform: scale(1.07); }

/* ── Single post ─────────────────────── */
.post-content { color: #D1D5DB; line-height: 1.9; }
.post-content h2, .post-content h3 { color: #fff; margin: 2rem 0 1rem; }
.post-content p { margin-bottom: 1.25rem; }
.post-content ul, .post-content ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.post-content li { margin-bottom: 0.5rem; }
.post-content img { max-width: 100%; border-radius: 0.75rem; margin: 1.5rem 0; }
.post-content a { color: #34D399; text-decoration: underline; }
.post-content blockquote {
    border-left: 4px solid #10B981;
    padding: 1rem 1.5rem;
    background: #1F2937;
    border-radius: 0 0.5rem 0.5rem 0;
    margin: 1.5rem 0;
    font-style: italic;
    color: #9CA3AF;
}
.post-content pre, .post-content code {
    background: #1F2937;
    border-radius: 0.375rem;
    padding: 0.2em 0.5em;
    font-size: 0.9em;
}

/* ── State boxes ─────────────────────── */
.state-box {
    text-align: center; padding: 3rem 1rem;
    color: #6B7280; border: 1px dashed #374151;
    border-radius: 0.75rem;
}

/* ── Back to top ─────────────────────── */
#back-to-top {
    position: fixed; bottom: 2rem; right: 2rem;
    background-color: #10B981; color: white;
    padding: 0.75rem 1rem; border-radius: 9999px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: opacity 0.3s, visibility 0.3s;
    opacity: 0; visibility: hidden; z-index: 50;
    border: none; cursor: pointer;
}
#back-to-top.show { opacity: 1; visibility: visible; }

/* ── Testimonial ─────────────────────── */
.testimonial-card { border-left: 4px solid #10B981; }
