body {
    background-color: #f5f6fa;
}

/* Navbar Styles - สมูทและสวยงาม */
.navbar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.navbar:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.navbar-brand {
    align-items: center;
    display: flex;
    min-height: 3.25rem;
}

.navbar-burger {
    margin-left: auto;
    transition: transform 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
}

.navbar-burger:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.navbar-burger span {
    display: block;
    width: 16px;
    height: 2px;
    background-color: currentColor;
    border-radius: 1px;
    transition: all 0.3s ease;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transform-origin: center;
}

.navbar-burger span:nth-child(1) {
    top: calc(50% - 8px);
}

.navbar-burger span:nth-child(2) {
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
}

.navbar-burger span:nth-child(3) {
    top: calc(50% + 8px);
}

.navbar-burger.is-active span:nth-child(1) {
    top: 50%;
    transform: translateX(-50%) translateY(-50%) rotate(45deg);
}

.navbar-burger.is-active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-50%) translateY(-50%) scaleX(0);
}

.navbar-burger.is-active span:nth-child(3) {
    top: 50%;
    transform: translateX(-50%) translateY(-50%) rotate(-45deg);
}

.navbar-menu {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

/* ตรวจสอบให้แน่ใจว่า menu แสดงใน desktop */
@media screen and (min-width: 1024px) {
    .navbar-menu {
        display: flex !important;
    }
}

.navbar-item,
.navbar-link {
    transition: background-color 0.2s ease, color 0.2s ease;
    position: relative;
}

.navbar-item:hover,
.navbar-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #3273dc;
}

.navbar-item:active,
.navbar-link:active {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Navbar Dropdown Styles */
.navbar-item.has-dropdown {
    position: relative;
}

.navbar-item.has-dropdown .navbar-dropdown {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    margin-top: 0;
    padding: 0.5rem 0;
    padding-top: 0.75rem;
    min-width: 200px;
}

/* สร้างพื้นที่เชื่อมต่อระหว่างเมนูหลักกับเมนูย่อย */
.navbar-item.has-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0.75rem;
    background: transparent;
    z-index: 1;
}

.navbar-item.has-dropdown.is-active .navbar-dropdown,
.navbar-item.has-dropdown:hover .navbar-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.navbar-dropdown .navbar-item {
    padding: 0.5rem 1.5rem;
    white-space: nowrap;
}

.navbar-dropdown .navbar-item:hover {
    background-color: rgba(50, 115, 220, 0.1);
    color: #3273dc;
}

/* Mobile Navbar Styles */
@media screen and (max-width: 1023px) {
    .navbar-menu {
        display: block !important;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        padding: 0;
        visibility: hidden;
    }

    .navbar-menu.is-active {
        max-height: 1000px;
        opacity: 1;
        padding: 0.5rem 0;
        visibility: visible;
    }

    .navbar-item.has-dropdown {
        flex-direction: column;
    }

    .navbar-item.has-dropdown .navbar-dropdown {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.05);
        margin-top: 0;
        padding-left: 1.5rem;
        display: none;
        width: 100%;
    }

    .navbar-item.has-dropdown.is-active .navbar-dropdown {
        display: block;
    }

    .navbar-item.has-dropdown .navbar-link {
        width: 100%;
        padding-right: 2.5rem;
    }

    .navbar-item.has-dropdown .navbar-link::after {
        content: '';
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 6px solid currentColor;
        border-bottom: none;
        transition: transform 0.3s ease;
        display: inline-block;
    }

    .navbar-item.has-dropdown.is-active .navbar-link::after {
        border-top: none;
        border-bottom: 6px solid currentColor;
        transform: translateY(-50%);
    }
}

/* Desktop Navbar Styles */
@media screen and (min-width: 1024px) {
    .navbar-menu {
        display: flex !important;
        max-height: none !important;
        opacity: 1 !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    .navbar-burger {
        display: none;
    }

    .navbar-item.has-dropdown .navbar-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        margin-top: 0;
        padding-top: 0.75rem;
    }

    .navbar-item.has-dropdown.is-hoverable:hover .navbar-dropdown,
    .navbar-item.has-dropdown:hover .navbar-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* สร้างพื้นที่เชื่อมต่อสำหรับ desktop */
    .navbar-item.has-dropdown::before {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 0.75rem;
        background: transparent;
        z-index: 1;
    }

    .navbar-item.has-dropdown.is-hoverable:hover::before,
    .navbar-item.has-dropdown:hover::before {
        z-index: 1;
    }

    /* Desktop dropdown arrow - แสดงสามเหลี่ยมชี้ลงเมื่อ hover (เหมือน mobile) */
    .navbar-item.has-dropdown .navbar-link::after {
        content: '' !important;
        margin-left: 0.5rem;
        width: 0 !important;
        height: 0 !important;
        border-left: 5px solid transparent !important;
        border-right: 5px solid transparent !important;
        border-top: 6px solid currentColor !important;
        border-bottom: none !important;
        transition: border 0.3s ease !important;
        display: inline-block !important;
        position: relative !important;
        right: auto !important;
        vertical-align: middle !important;
        background: none !important;
        padding: 0 !important;
        font-size: 0 !important;
    }

    .navbar-item.has-dropdown.is-hoverable:hover .navbar-link::after,
    .navbar-item.has-dropdown:hover .navbar-link::after {
        border-top: none !important;
        border-bottom: 6px solid currentColor !important;
        transform: none !important;
    }
}

.content-section {
    padding: 3rem 1.5rem;
}

.feature-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -15px rgba(10, 10, 10, 0.3);
}

/* Post page layout */
.post-content {
    max-width: 800px;
    margin: 0 auto;
}

.post-content .content {
    line-height: 1.8;
}

.post-content .content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.post-content .content p {
    margin-bottom: 1.5rem;
}

.post-content .content h1,
.post-content .content h2,
.post-content .content h3,
.post-content .content h4,
.post-content .content h5,
.post-content .content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Share Buttons */
.share-buttons {
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.share-buttons .buttons {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.share-btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    font-weight: 500;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.share-line {
    background-color: #00C300;
    color: white;
}

.share-line:hover {
    background-color: #00B300;
    color: white;
}

.share-facebook {
    background-color: #1877F2;
    color: white;
}

.share-facebook:hover {
    background-color: #166FE5;
    color: white;
}

.share-x {
    background-color: #000000;
    color: white;
}

.share-x:hover {
    background-color: #1a1a1a;
    color: white;
}

.share-threads {
    background-color: #000000;
    color: white;
}

.share-threads:hover {
    background-color: #1a1a1a;
    color: white;
}

/* Layout Hero Banner */
.layout-hero {
    height: 350px;
    min-height: 350px;
    max-height: 350px;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0;
    color: #ffffff !important;
    overflow: hidden;
}

.layout-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.layout-hero .hero-body {
    position: relative;
    z-index: 2;
    width: 100%;
    color: #ffffff !important;
}

.layout-hero .title,
.layout-hero .subtitle,
.layout-hero h1,
.layout-hero h2,
.layout-hero h3,
.layout-hero h4,
.layout-hero h5,
.layout-hero h6,
.layout-hero p,
.layout-hero span,
.layout-hero div {
    color: #ffffff !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.layout-hero .button {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.layout-hero .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

@media screen and (max-width: 768px) {
    .layout-hero {
        height: 250px;
        min-height: 250px;
        max-height: 250px;
        padding: 0;
    }

    .layout-hero .title.is-1 {
        font-size: 1.75rem !important;
    }

    .layout-hero .subtitle.is-4 {
        font-size: 1.125rem !important;
    }
}

/* Layout Slideshow */
.layout-slideshow {
    padding: 0;
    background: #f5f5f5;
    overflow: hidden;
    width: 100%;
    position: relative;
}

.layout-slideshow .container {
    padding: 0;
    max-width: 100%;
    position: relative;
}

.layout-slideshow__track {
    display: block;
    overflow: visible;
    width: 100%;
    position: relative;
    min-height: 400px;
    /* ความสูงขั้นต่ำตาม aspect ratio */
}

.layout-slideshow__slide {
    width: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    visibility: hidden;
}

.layout-slideshow__slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
    visibility: visible;
    position: relative;
}

.layout-slideshow__slide.active img {
    position: relative;
    z-index: 1;
}

.layout-slideshow__slide img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    /* อัตราส่วน 1676:400 = 4.19:1 */
    aspect-ratio: 1676 / 400;
    max-width: 1676px;
    margin: 0 auto;
    position: relative;
}

/* Slideshow Dots Navigation */
.layout-slideshow__dots {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 30;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    margin: 0;
}

.layout-slideshow__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    outline: none;
}

.layout-slideshow__dot:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.layout-slideshow__dot.active {
    background: #fff;
    border-color: #fff;
    width: 32px;
    border-radius: 6px;
}

.layout-slideshow__dot:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Responsive: ปรับตามขนาดหน้าจอ */
/* หน้าจอใหญ่ (มากกว่า 1676px) - แสดงเต็มขนาด 1676x400 */
@media screen and (min-width: 1677px) {
    .layout-slideshow__slide img {
        width: 100%;
        max-width: 100%;
        height: auto;
        aspect-ratio: 1676 / 400;
    }
}

/* หน้าจอขนาดกลาง (1024px - 1676px) */
@media screen and (max-width: 1676px) {
    .layout-slideshow__slide img {
        width: 100%;
        height: auto;
        aspect-ratio: 1676 / 400;
    }
}

/* หน้าจอแท็บเล็ต (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .layout-slideshow__slide img {
        width: 100%;
        height: auto;
        aspect-ratio: 1676 / 400;
    }
}

/* หน้าจอมือถือ (480px - 768px) */
@media screen and (max-width: 768px) {
    .layout-slideshow__slide img {
        width: 100%;
        height: auto;
        aspect-ratio: 1676 / 400;
    }
}

/* หน้าจอมือถือเล็ก (น้อยกว่า 480px) */
@media screen and (max-width: 480px) {
    .layout-slideshow__slide img {
        width: 100%;
        height: auto;
        aspect-ratio: 1676 / 400;
    }
}

@media screen and (max-width: 768px) {
    .share-btn {
        font-size: 0.875rem;
    }

    .share-btn .icon {
        margin-right: 0.25rem !important;
    }
}

/* Home Page Styles */
.post-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-card-header .title a {
    transition: color 0.2s ease;
}

.post-card-header .title a:hover {
    color: #3273dc !important;
}

/* Post Thumbnail */
.post-thumbnail {
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
}

.post-thumbnail figure {
    margin: 0;
    overflow: hidden;
    background-color: #f5f5f5;
    position: relative;
    width: 100%;
}

.thumbnail-figure {
    display: block;
    width: 100%;
}

.thumbnail-figure img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
    opacity: 0;
}

.thumbnail-figure img.loaded {
    opacity: 1;
}

/* สำหรับภาพแนวตั้ง: ยึดความกว้างเป็นหลัก */
.thumbnail-figure img.portrait {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    object-position: center;
}

/* สำหรับภาพแนวนอน: ใช้ aspect ratio */
.thumbnail-figure img.landscape {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.post-thumbnail:hover img {
    transform: scale(1.05);
}

.thumbnail-placeholder {
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

.empty-state {
    padding: 3rem 1rem;
}

.empty-state-icon {
    opacity: 0.5;
}

/* Category List */
.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.category-item:last-child {
    border-bottom: none;
}

.category-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s ease;
}

.category-item a:hover {
    color: #3273dc !important;
}

/* Top Views List */
.top-views-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-views-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.top-views-item:last-child {
    border-bottom: none;
}

.top-views-item a {
    transition: color 0.2s ease;
}

.top-views-item a:hover {
    color: #3273dc !important;
}

.top-views-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.875rem;
    color: #666;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.top-views-item:first-child .top-views-rank {
    background-color: #ffd700;
    color: #000;
}

/* Custom Button Colors */
.button.is-pink,
.tag.is-pink {
    background-color: #ff8fab;
    border-color: transparent;
    color: #fff;
}

.button.is-pink:hover,
.button.is-pink.is-hovered {
    background-color: #ff7699;
    border-color: transparent;
    color: #fff;
}

.button.is-tomato,
.tag.is-tomato {
    background-color: #f06543;
    border-color: transparent;
    color: #fff;
}

.button.is-tomato:hover,
.button.is-tomato.is-hovered {
    background-color: #e34d28;
    border-color: transparent;
    color: #fff;
}

.button.is-purple,
.tag.is-purple {
    background-color: #8900f2;
    border-color: transparent;
    color: #fff;
}

.button.is-purple:hover,
.button.is-purple.is-hovered {
    background-color: #7200cc;
    border-color: transparent;
    color: #fff;
}

.button.is-forest,
.tag.is-forest {
    background-color: #007f5f;
    border-color: transparent;
    color: #fff;
}

.button.is-forest:hover,
.button.is-forest.is-hovered {
    background-color: #00664c;
    border-color: transparent;
    color: #fff;
}

.button.is-violet,
.tag.is-violet {
    background-color: #5a189a;
    border-color: transparent;
    color: #fff;
}

.button.is-violet:hover,
.button.is-violet.is-hovered {
    background-color: #48127a;
    border-color: transparent;
    color: #fff;
}

.top-views-item:nth-child(2) .top-views-rank {
    background-color: #c0c0c0;
    color: #000;
}

.top-views-item:nth-child(3) .top-views-rank {
    background-color: #cd7f32;
    color: #fff;
}

.sidebar-column .box+.box {
    margin-top: 1.5rem;
}

.related-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.related-post-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.related-post-item:last-child {
    border-bottom: none;
}

.related-post-item a {
    flex: 1;
    margin-right: 0.5rem;
    transition: color 0.2s ease;
}

.related-post-item a:hover {
    color: #3273dc !important;
}

/* Pagination */
.pagination {
    margin-top: 2rem;
}

.pagination-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
}

.pagination-link {
    min-width: 2.5em;
    text-align: center;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .post-card {
        margin-bottom: 1.5rem !important;
    }

    .post-card-header .title {
        font-size: 1.25rem !important;
    }

    .pagination-list {
        gap: 0.125rem;
    }

    .pagination-link {
        min-width: 2.25em;
        font-size: 0.875rem;
    }
}

/* Posts Grid Layout */
.posts-grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.posts-grid-item {
    margin-bottom: 0 !important;
}

.posts-grid-item .post-thumbnail {
    margin-bottom: 1rem;
}

.posts-grid-item .post-thumbnail .image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.posts-grid-item .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.posts-grid-item .title.is-4 {
    font-size: 1.25rem;
    line-height: 1.4;
}

.posts-grid-item .subtitle.is-6 {
    font-size: 0.875rem;
}

.posts-grid-item .content {
    font-size: 0.875rem;
    line-height: 1.6;
}

.posts-grid-item .level.is-mobile {
    margin-bottom: 0.75rem;
}

.posts-grid-item .tags {
    margin-bottom: 0.75rem;
}

.posts-grid-item .button {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

@media screen and (max-width: 1023px) {
    .posts-grid-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media screen and (max-width: 768px) {
    .posts-grid-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}