.elementor-645 .elementor-element.elementor-element-740b24a{--display:flex;--flex-direction:row;--container-widget-width:initial;--container-widget-height:100%;--container-widget-flex-grow:1;--container-widget-align-self:stretch;--flex-wrap-mobile:wrap;--gap:0px 0px;--row-gap:0px;--column-gap:0px;}.elementor-645 .elementor-element.elementor-element-740b24a:not(.elementor-motion-effects-element-type-background), .elementor-645 .elementor-element.elementor-element-740b24a > .elementor-motion-effects-container > .elementor-motion-effects-layer{background-color:#FAFAFA;}.elementor-645 .elementor-element.elementor-element-8c2e808{--display:flex;--flex-direction:column;--container-widget-width:100%;--container-widget-height:initial;--container-widget-flex-grow:0;--container-widget-align-self:initial;--flex-wrap-mobile:wrap;}.elementor-645 .elementor-element.elementor-element-6b19ff2{--display:flex;--flex-direction:column;--container-widget-width:100%;--container-widget-height:initial;--container-widget-flex-grow:0;--container-widget-align-self:initial;--flex-wrap-mobile:wrap;}.elementor-645 .elementor-element.elementor-element-f16d882{--display:flex;--flex-direction:column;--container-widget-width:100%;--container-widget-height:initial;--container-widget-flex-grow:0;--container-widget-align-self:initial;--flex-wrap-mobile:wrap;}@media(min-width:768px){.elementor-645 .elementor-element.elementor-element-8c2e808{--width:25%;}.elementor-645 .elementor-element.elementor-element-6b19ff2{--width:50%;}.elementor-645 .elementor-element.elementor-element-f16d882{--width:25%;}}/* Start custom CSS for shortcode, class: .elementor-element-03e5469 *//* ===================================== */
/* 1. Base Post Card Styles (Facebook-like) */
/* ===================================== */

/* Container สำหรับฟีดทั้งหมด */
.social-feed-container {
    display: flex;
    flex-direction: column;
    gap: 15px; /* ระยะห่างระหว่างโพสต์ */
}

/* โครงสร้างโพสต์การ์ดหลัก */
.social-post-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); /* เงาเหมือน Facebook */
    padding: 15px;
    margin-bottom: 10px; /* ใช้ gap ใน social-feed-container เป็นหลัก แต่ใส่เผื่อไว้ */
    font-family: Arial, sans-serif;
}

/* ===================================== */
/* 2. Header and Author Info */
/* ===================================== */

.social-post-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.author-image img {
    width: 40px;
    height: 40px;
    border-radius: 50%; /* รูปโปรไฟล์วงกลม */
    margin-right: 10px;
    object-fit: cover;
}

.post-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.author-name {
    font-weight: bold;
    color: #050505;
    font-size: 14px;
}

.post-date-public {
    color: #65676b; /* ใช้สีที่ดูเป็นกลางมากขึ้น */
    font-size: 12px;
    display: flex;
    align-items: center;
}

.post-date-public .dashicons {
    font-size: 10px;
    width: 10px;
    height: 10px;
    margin-left: 5px;
    vertical-align: middle;
}

/* ===================================== */
/* 3. Post Content and Read More */
/* ===================================== */

.post-content {
    color: #1c1e21;
    font-size: 15px;
    line-height: 1.35; /* ใช้ค่า 1.35 ที่ละเอียดขึ้น */
    margin-bottom: 10px;
}

/* คลาสสำหรับจำกัดความสูงของเนื้อหา */
.post-content .post-text {
    max-height: none; /* ค่าเริ่มต้นคือแสดงเต็ม */
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    position: relative;
}

/* เมื่อมีคลาส 'collapsed' ให้จำกัดความสูง (ประมาณ 6 บรรทัด) */
.post-content .post-text.collapsed {
    max-height: 8.1em; /* คำนวณจาก line-height 1.35 * 6 */
}

.read-more-toggle {
    margin-top: 5px;
    display: inline-block;
}

/* จัดการการซ่อน/แสดงลิงก์ 'อ่านเพิ่มเติม' / 'ย่อ' ผ่าน JS แต่ CSS นี้กำหนดลักษณะเริ่มต้น */
.read-more-toggle a {
    color: #65676b;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

/* ===================================== */
/* 4. Media Gallery (Grid Layouts) */
/* ===================================== */

.post-media-gallery {
    display: grid;
    gap: 3px; /* ระยะห่างระหว่างภาพ */
    margin: 10px 0;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    width: 100%;
    /* max-height: 500px; */// กำหนดความสูงตามจำนวนรูป
}

.gallery-item {
    position: relative;
    overflow: hidden;
    height: 100%;
    /* ป้องกันการบิดเบือนของ aspect ratio เมื่อใช้ grid */
}

.post-media-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 1 รูป (ใช้ padding-bottom เพื่อคง aspect ratio 4:3) */
.post-media-gallery.count-1 {
    grid-template-columns: 1fr;
    max-height: 450px;
}
.post-media-gallery.count-1 .gallery-item {
    padding-bottom: 75%; /* 4:3 aspect ratio */
    height: 0;
}
.post-media-gallery.count-1 .gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
}


/* 2 รูป */
.post-media-gallery.count-2 {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 250px;
}

/* 3 รูป (1 รูปใหญ่ซ้าย + 2 รูปเล็กขวา) */
.post-media-gallery.count-3 {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 150px; /* ความสูงของแถว */
    height: 303px; /* 2 แถว * 150px + 3px gap */
}
.post-media-gallery.count-3 .gallery-item:first-child {
    grid-row: span 2; /* รูปแรกสูง 2 แถว */
}

/* 4 รูป */
.post-media-gallery.count-4 {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 150px;
    height: 303px; /* 2 แถว * 150px + 3px gap */
}

/* 5 รูป หรือมากกว่า (แสดง 5 รูปแรก - ใช้ Grid แบบแรกที่ให้มาเพราะดูเหมือน Facebook มากกว่า) */
.post-media-gallery.count-5,
.post-media-gallery.count-6,
.post-media-gallery.count-7,
.post-media-gallery.count-8,
.post-media-gallery.count-9 {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 100px; /* ปรับขนาดแถวให้เล็กลง */
    height: 203px; /* 2 แถว * 100px + 3px gap */
}
.post-media-gallery.count-5 .gallery-item:first-child {
    grid-row: span 2;
    grid-column: 1;
}
.post-media-gallery.count-5 .gallery-item:nth-child(2),
.post-media-gallery.count-5 .gallery-item:nth-child(3),
.post-media-gallery.count-5 .gallery-item:nth-child(4),
.post-media-gallery.count-5 .gallery-item:nth-child(5) {
    /* ใช้พื้นที่ที่เหลือใน grid */
    /* ไม่ต้องกำหนดเพิ่มเติมเพราะ grid-auto-rows จัดการแล้ว */
}


/* สไตล์สำหรับตัวเลข +Extra (รูปสุดท้ายในชุด 5+ รูป) */
.extra-count {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 24px;
    font-weight: bold;
    z-index: 10;
}

/* ===================================== */
/* 5. Footer Buttons (Like, Comment, Share) */
/* ===================================== */

.social-post-footer {
    border-top: 1px solid #f0f2f5; /* ใช้สีที่อ่อนลง */
    padding-top: 8px;
    margin-top: 8px;
}

.social-actions {
    display: flex;
    justify-content: space-around;
    padding: 5px 0;
}

.social-actions button {
    background: none;
    border: none;
    color: #65676b;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.15s ease-in-out;
}

.social-actions button:hover {
    background-color: #f2f2f2;
    color: #050505;
}

.social-actions button .dashicons {
    margin-right: 5px;
    font-size: 16px;
}

/* ===================================== */
/* 6. Lightbox/Modal Styles */
/* ===================================== */

.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    margin: auto;
    width: 95%;
    max-width: 1400px;
    height: 95vh;
    display: flex;
    flex-direction: column;
}

.lightbox-close {
    position: fixed; /* ใช้ fixed เพื่อให้ปุ่มลอยเหนือน้ำ */
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
}

.lightbox-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.lightbox-gallery-wrap {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

#lightbox-main-image {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

/* ปุ่มนำทาง */
.lightbox-prev, .lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    padding: 0;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.3s ease;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.lightbox-prev {
    left: 10px;
}

.lightbox-next {
    right: 10px;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* ส่วน Thumbnails */
.lightbox-thumbnail-container {
    display: flex;
    justify-content: center;
    gap: 5px;
    overflow-x: auto;
    padding: 10px 0;
    max-height: 100px;
}

.lightbox-thumbnail {
    width: 70px;
    height: 70px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.7;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.lightbox-thumbnail.active {
    opacity: 1;
    border-color: #1877f2;
}

/* ===================================== */
/* 7. Loading Skeleton Styles */
/* ===================================== */

.social-post-card.loading {
    padding: 15px;
}

/* Animation สำหรับ Skeleton (ใช้แบบ linear-gradient ที่ดูทันสมัยกว่า) */
@keyframes loading-skeleton {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: #eee;
    animation: loading-skeleton 1.2s infinite linear;
    background-image: linear-gradient(to right, #eee 0%, #f5f5f5 50%, #eee 100%);
    background-size: 800px 100%;
}

.skeleton-line {
    height: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    background-color: #eee;
    animation: loading-skeleton 1.2s infinite linear;
    background-image: linear-gradient(to right, #eee 0%, #f5f5f5 50%, #eee 100%);
    background-size: 800px 100%;
}

/* ใช้สำหรับบรรทัดข้อความ */
.skeleton-text-small {
    width: 60%;
    height: 10px;
    margin-bottom: 8px;
}

.skeleton-text-line {
    width: 100%;
    height: 12px;
    margin-bottom: 8px;
}


.skeleton-media {
    width: 100%;
    height: 200px; /* ความสูงโดยประมาณของภาพ */
    margin: 10px 0;
    border-radius: 4px;
    background-color: #eee;
    animation: loading-skeleton 1.2s infinite linear;
    background-image: linear-gradient(to right, #eee 0%, #f5f5f5 50%, #eee 100%);
    background-size: 800px 100%;
}

.skeleton-actions {
    display: flex;
    justify-content: space-around;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.skeleton-button {
    width: 80px;
    height: 30px;
    border-radius: 6px;
    background-color: #eee;
    animation: loading-skeleton 1.2s infinite linear;
    background-image: linear-gradient(to right, #eee 0%, #f5f5f5 50%, #eee 100%);
    background-size: 800px 100%;
}/* End custom CSS */