/* Custom styles — complements Tailwind */

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans Thai', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Job post card — Facebook-like */
.job-post {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.job-post:hover {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.job-post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.job-post-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e293b, #334155);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.profile-avatar-img {
    object-fit: cover;
    background: #e5e7eb;
}

/* โพสต์ยาว — ย่อแบบเฟสบุ๊ค */
.job-post-text-wrap {
    position: relative;
    overflow: hidden;
    max-height: clamp(100px, 22vh, 200px);
    transition: max-height 0.4s ease;
}

.job-post-text-wrap.is-expanded {
    max-height: none;
    overflow: visible;
}

.job-post-text-fade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3.5rem;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 85%);
    pointer-events: none;
    transition: opacity 0.2s;
}

.job-post-text-wrap.is-expanded .job-post-text-fade,
.job-post-text-wrap.no-overflow .job-post-text-fade {
    opacity: 0;
    visibility: hidden;
}

.job-post-expand.hidden {
    display: none;
}

.job-post-expand.is-visible {
    display: inline-block;
}

@media (min-width: 640px) {
    .job-post-text-wrap {
        max-height: clamp(120px, 26vh, 240px);
    }
}

.job-post-images {
    display: grid;
    gap: 2px;
}

.job-post-images.count-1 { grid-template-columns: 1fr; }
.job-post-images.count-2 { grid-template-columns: 1fr 1fr; }
.job-post-images.count-3 { grid-template-columns: 1fr 1fr; }
.job-post-images.count-3 .img-main { grid-row: span 2; }
.job-post-images.count-4 { grid-template-columns: 1fr 1fr; }

.job-post-images img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center top;
    cursor: pointer;
    transition: opacity 0.2s;
}

.job-post-images.count-1 img { height: 320px; }

.job-post-images img:hover {
    opacity: 0.92;
}

/* Contact list */
.contact-row {
    padding: 16px 20px;
}

.contact-row-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.contact-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-qr-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

.contact-qr-large {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.contact-qr-full {
    margin-top: 12px;
    padding: 12px 20px 16px;
    border-top: 1px dashed #e5e7eb;
}

.contact-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    text-align: center;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 10px;
    transition: opacity 0.2s;
    border: none;
    cursor: pointer;
}

.contact-btn:hover {
    opacity: 0.92;
}

/* Lightbox Gallery — Facebook-style carousel */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    user-select: none;
    -webkit-user-select: none;
}

.lightbox.active {
    display: block;
}

.lightbox-viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}

.lightbox-viewport.is-dragging {
    cursor: grabbing;
}

.lightbox-track {
    display: flex;
    height: 100%;
    will-change: transform;
}

.lightbox-track.no-transition {
    transition: none !important;
}

.lightbox-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px 72px;
    box-sizing: border-box;
}

.lightbox-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
}

.lightbox-close {
    position: absolute;
    top: 12px;
    right: 16px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    z-index: 20;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: background 0.2s;
}

.lightbox.has-multiple .lightbox-nav {
    display: flex;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.35);
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-dots {
    position: absolute;
    bottom: 44px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 20;
    padding: 0 16px;
}

.lightbox-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.lightbox-dot.active {
    background: #fff;
    transform: scale(1.2);
}

.lightbox-counter {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    text-align: center;
    z-index: 20;
    margin: 0;
}

@media (max-width: 640px) {
    .lightbox-nav { display: none !important; }
    .lightbox-slide { padding: 40px 0 68px; }
}

.gallery-more {
    background: #f9fafb;
    border: none;
    cursor: pointer;
}

/* Reviews */
.review-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.review-avatar-letter {
    background: #e5e7eb;
    color: #6b7280;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stars {
    display: inline-flex;
    gap: 1px;
    line-height: 1;
}

.star {
    font-size: 14px;
}

.star-filled {
    color: #f59e0b;
}

.star-empty {
    color: #d1d5db;
}

.job-reviews {
    background: #fafafa;
}

.review-item {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.review-item:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

/* Banner gradient */
.hero-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

/* Floating contact bar (mobile) */
.floating-contact {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid #e5e7eb;
    padding: 10px 16px;
    display: none;
}

@media (max-width: 768px) {
    .floating-contact { display: flex; }
    body { padding-bottom: 70px; }
}

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

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