/* ==========================================================================
   1. Global Styles & Variables
   ========================================================================== */
:root {
    --primary-gold: #c5a66a;
    --dark-maroon: #8a0e0e;
    --rama5-pink: #f8e3e9;
    --text-dark: #3a3a3a;
    --text-light: #ffffff;
    --bg-light: #fdfdfa;
    --border-color: #e0e0e0;
}
html { scroll-behavior: smooth; }
body { font-family: 'Sarabun', sans-serif; margin: 0; color: var(--text-dark); background-color: var(--bg-light); font-size: 16px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3, h4 { font-weight: 700; }
a { text-decoration: none; color: var(--primary-gold); }
img { max-width: 100%; height: auto; display: block; }

/* ==========================================================================
   2. Header, Banner & Navigation
   ========================================================================== */
.site-banner { height: 150px; background-image: url('../images/header-bg.jpg'); background-size: cover; background-position: center 30%; }
.main-header { background-color: var(--rama5-pink); border-bottom: 1px solid #f0d8de; position: relative; z-index: 1000; }
.header-top .container { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.logo { font-size: 1.1rem; display: flex; align-items: center; color: var(--text-dark); font-weight: 700; }
.logo img { height: 80px; margin-right: 10px; }
.header-bottom { border-top: 1px solid #fbeff3; }
.header-bottom .container { display: flex; justify-content: center; padding: 10px 20px; }
.search-form input[type="text"] { border: 1px solid #f0d8de; width: 250px; padding: 8px 12px; border-radius: 4px 0 0 4px; }
.search-form button { background: var(--dark-maroon); color: white; border: none; padding: 0 15px; cursor: pointer; border-radius: 0 4px 4px 0; }

/* ==========================================================================
   3. Navigation (Desktop & Mobile)
   ========================================================================== */
.main-nav { display: flex; }
.main-nav ul { list-style-type: none; margin: 0; padding: 0; display: flex; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: 25px 15px; text-decoration: none; font-weight: 500; color: var(--text-dark); }
.main-nav a:hover, .dropdown:hover .dropbtn { color: var(--dark-maroon); }
.dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 200px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1001; border-radius: 4px; }
.dropdown-content a { color: black; padding: 8px 16px; }
.dropdown-content a:hover { background-color: #f1f1f1; }
.dropdown:hover .dropdown-content { display: block; }
.mobile-nav-toggle { display: none; }

/* ==========================================================================
   4. Homepage Styles
   ========================================================================== */
.hero-slider .swiper { width: 100%; height: 50vh; max-height: 500px; min-height: 350px; background-color: #0e0e0e; }
.swiper-slide { text-align: center; font-size: 18px; background-position: center; background-size: cover; }
.welcome-section { text-align: center; padding: 60px 20px; background-color: #ffffffe1; }
.highlights-section { padding: 60px 0; }
.highlight-category h2 { text-align: center; font-size: 2.5rem; margin-bottom: 40px; }
.highlight-grid { display: grid; grid-template-columns: 1fr; gap: 25px; }
.highlight-grid.locations { grid-template-columns: repeat(3, 1fr); } /* 6 items will form 2 rows */
.highlight-card { position: relative; border-radius: 8px; overflow: hidden; display: block; box-shadow: 0 5px 20px rgba(0,0,0,0.1); transition: transform 0.3s; }
.highlight-card:hover { transform: translateY(-5px); }
.highlight-card img { width: 100%; height: 300px; object-fit: cover; }
.highlight-caption { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.85), transparent); color: white; padding: 40px 15px 15px; text-align: center; }
.latest-news-section { padding: 60px 0; }
.latest-news-section h2 { text-align: center; font-size: 2.5rem; margin-bottom: 40px; }
.news-grid { display: grid; grid-template-columns: 1fr; gap: 30px; }

/* ==========================================================================
   5. General Components & Page Styles
   ========================================================================== */
.read-more-btn { display: inline-block; background-color: var(--primary-gold); color: white; padding: 8px 18px; border-radius: 50px; font-weight: bold; font-size: 0.9rem; }
.see-all-link { text-align: center; margin-top: 40px; }
.see-all-link a { background-color: var(--dark-maroon); color: white; padding: 12px 30px; border-radius: 50px; font-weight: bold; }
.page-content-wrapper { padding: 50px 0; }
.page-content-wrapper h1 { font-size: 2.8rem; border-bottom: 2px solid #eee; padding-bottom: 15px; margin-bottom: 25px; }
.detail-page-layout { display: flex; flex-direction: column; gap: 30px; align-items: flex-start; }
.main-content-area { flex-grow: 1; width: 100%; }
.sidebar-nav { flex-shrink: 0; width: 100%; background-color: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.07); border: 1px solid var(--border-color); }
.sidebar-nav h4 { margin-top: 0; font-size: 1.2rem; border-bottom: 2px solid var(--rama5-pink); padding-bottom: 10px; margin-bottom: 10px; }
.sidebar-nav ul { list-style: none; padding: 0; margin: 0; }
.sidebar-nav a { display: block; padding: 10px 12px; color: var(--text-dark); border-radius: 5px; }
.sidebar-nav a:hover { background-color: #f1f1f1; }
.sidebar-nav a.active { background-color: var(--rama5-pink); color: var(--dark-maroon); font-weight: bold; }
.news-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; margin-top: 20px; }
.news-gallery a { display: block; border-radius: 8px; overflow: hidden; }
.news-gallery img { width: 100%; height: 100px; object-fit: cover; }

/* ==========================================================================
   6. Footer
   ========================================================================== */
.main-footer { background-color: #333; color: white; text-align: center; padding: 20px 0; margin-top: 40px; }

/* ==========================================================================
   7. Responsive Design (Media Queries)
   ========================================================================== */
@media (max-width: 991px) {
    .main-nav { display: none; }
    .mobile-nav-toggle { display: flex; }
    .header-top .container { position: relative; }
    /* Mobile nav panel styles */
    .main-nav { position: fixed; z-index: 1000; inset: 0 0 0 30%; background: hsl(0 0% 100% / 0.9); backdrop-filter: blur(1rem); flex-direction: column; padding: min(20vh, 10rem) 2em; transform: translateX(100%); transition: transform 350ms ease-out; }
    .main-nav[data-visible="true"] { transform: translateX(0%); }
    .main-nav ul { flex-direction: column; gap: 1.5rem; }
    .main-nav a { font-size: 1.2rem; color: var(--text-dark); padding: 0.5rem 1rem; }
    .dropdown-content { position: static; display: block; box-shadow: none; padding-left: 1.5rem; background: transparent; }
    .dropdown:hover .dropdown-content { display: block; }
    .dropdown-content a { color: #555; padding: 8px 0; font-size: 1rem; }
}

@media (min-width: 768px) {
    .site-banner { height: 200px; }
    .logo { font-size: 1.5rem; }
    .header-bottom .container { justify-content: flex-end; }
    .hero-slider .swiper { height: 400px; }
    .highlight-grid { grid-template-columns: repeat(2, 1fr); }
    .highlight-grid.locations { grid-template-columns: repeat(3, 1fr); }
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-page-layout { flex-direction: row; }
    .sidebar-nav { width: 280px; position: sticky; top: 140px; }
    .buddha-grid-view, .monk-grid-view, .location-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
    .site-banner { height: 250px; }
    .mobile-nav-toggle { display: none; }
    .main-nav { display: flex; }
    .hero-slider .swiper { height: 450px; }
    .highlight-grid { grid-template-columns: repeat(4, 1fr); }
    .highlight-grid.locations { grid-template-columns: repeat(3, 1fr); }
    .news-grid { grid-template-columns: repeat(4, 1fr); }
}
/* --- Buddha Image List Page Styles (Vertical Card) --- */
.buddha-grid-view {
    display: grid;
    grid-template-columns: 1fr; /* 1 column on mobile */
    gap: 30px;
    margin-top: 40px;
}

.buddha-card-vertical {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    overflow: hidden;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.buddha-card-vertical:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.buddha-card-vertical img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 5px solid #f0f0f0;
}

.buddha-card-vertical .buddha-card-content {
    width: 100%;
}

.buddha-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    text-align: left;
}
.buddha-info-table td {
    padding: 8px 5px;
    border-bottom: 1px dashed #eee;
    vertical-align: top;
}
.buddha-info-table tr:last-child td {
    border-bottom: none;
}
.buddha-info-table td:first-child {
    width: 80px;
    font-weight: bold;
    color: var(--text-dark);
}

.buddha-card-vertical .read-more-btn {
    margin-top: 15px;
}


/* --- Responsive Grid for Buddha List --- */
@media (min-width: 768px) {
    .buddha-grid-view { 
        grid-template-columns: repeat(2, 1fr); 
    }
}

/* --- Administration & Personnel Page Styles --- */
.personnel-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 คอลัมน์บนมือถือ */
    gap: 30px;
    margin-top: 40px;
}

.personnel-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    border: 1px solid var(--border-color);
    text-align: left;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.personnel-card-image img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #f0f0f0;
    margin-bottom: 20px;
}

.personnel-card-info h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.5rem;
}

.personnel-card-info .position {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-gold);
    margin-bottom: 10px;
}

/* Responsive Layout */
@media (min-width: 768px) {
    .personnel-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 992px) {
    .personnel-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* --- Abbot List Page Styles --- */
.abbot-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 column on mobile & default */
    gap: 30px;
    margin-top: 40px;
}
.abbot-card {
    display: flex;
    flex-direction: column; /* Default to vertical layout for mobile */
    gap: 20px;
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    border: 1px solid var(--border-color);
}
.abbot-card img {
    width: 100%; /* Full width on mobile */
    max-width: 150px; /* Max width for larger screens */
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
    margin: 0 auto; /* Center image on mobile */
}
.abbot-info h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.5rem;
    text-align: center; /* Center text on mobile */
}
.abbot-info .period {
    font-size: 1rem;
    color: #777;
    font-style: italic;
    margin-bottom: 10px;
    text-align: center;
}
.abbot-info .status-tag {
    display: inline-block;
    background-color: var(--primary-gold);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    margin-bottom: 15px;
}
.abbot-info .status-tag.unpublished {
    background-color: #888;
}
.abbot-info .details {
    line-height: 1.7;
    color: #555;
    margin-bottom: 15px;
}
.abbot-info .read-more-btn {
    display: inline-block;
}

/* --- Responsive styles for Abbot Card on larger screens --- */
@media (min-width: 768px) {
    .abbot-card {
        flex-direction: row; /* Horizontal layout for tablet and up */
        text-align: left;
    }
    .abbot-card img {
        margin: 0; /* Reset margin */
    }
    .abbot-info h3, .abbot-info .period {
        text-align: left; /* Left align text */
    }
}

/* --- Monk List Page Styles --- */
.monk-list-container {
    display: grid;
    grid-template-columns: 1fr; /* 1 คอลัมน์บนมือถือ */
    gap: 30px;
    margin-top: 40px;
}

.monk-list-item {
    display: flex;
    flex-direction: column; /* แก้ไข: จัดเรียงเป็นแนวตั้ง */
    align-items: center;    /* เพิ่ม: จัดให้อยู่กึ่งกลาง */
    text-align: center;     /* แก้ไข: จัดข้อความกึ่งกลาง */
    gap: 20px;
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    border: 1px solid var(--border-color);
}

.monk-list-details {
    width: 100%; /* เพิ่ม: ให้รายละเอียดเต็มความกว้างการ์ด */
}

.monk-list-details .details-grid {
    text-align: left; /* จัดข้อความในตารางให้ชิดซ้ายเหมือนเดิม */
}
.monk-list-image {
    flex-shrink: 0;
    text-align: center;
}
.monk-list-image img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ff82fb;
    margin-bottom: 20px;
    
}
.monk-list-details {
    flex-grow: 1;
}
.monk-list-details h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.6rem;
    color: var(--dark-maroon);
}
.monk-list-details .details-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 คอลัมน์บนมือถือ */
    gap: 8px 20px;
}
.monk-list-details .details-grid p {
    margin: 0;
    line-height: 1.7;
    color: #555;
}
.monk-list-details .details-grid p strong {
    display: inline-block;
    width: 120px;
    color: var(--text-dark);
}
.monk-list-details .read-more-btn {
    margin-top: 20px;
}


/* --- Responsive Grid for Monk List --- */
@media (min-width: 768px) {
    .monk-list-container {
        grid-template-columns: repeat(2, 1fr); 
    }
    .monk-list-item {
    display: flex;
    flex-direction: column; /* แก้ไข: จัดเรียงเป็นแนวตั้ง */
    align-items: center;    /* เพิ่ม: จัดให้อยู่กึ่งกลาง */
    text-align: center;     /* แก้ไข: จัดข้อความกึ่งกลาง */
    gap: 10px;
    background-color: #fffcfc;
    padding: 15px;
    border-radius: 18px;
    box-shadow: 0 4px 15px rgba(198, 197, 197, 0.771);
    border: 1px solid var(--border-color);
    }

    .monk-list-details {
    width: 100%; /* เพิ่ม: ให้รายละเอียดเต็มความกว้างการ์ด */
    }

    .monk-list-details .details-grid {
    text-align: left; /* จัดข้อความในตารางให้ชิดซ้ายเหมือนเดิม */
}
}

/* --- Monk Detail Page Styles (ส่วนที่แก้ไข/เพิ่มเติม) --- */

.info-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 column for mobile */
    gap: 10px 20px;
    background-color: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.info-grid p {
    margin: 5px 0;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 5px;
}
.info-grid p:last-child {
    border-bottom: none;
}

/* Responsive for Monk Detail Page */
@media (min-width: 768px) {
    .monk-detail-layout {
        flex-direction: row;
        align-items: flex-start;
    }
    .monk-detail-info h1, .monk-detail-info .lay-name {
        text-align: left;
    }
    .info-grid {
        grid-template-columns: 2fr 1fr;
    }
}
/* --- Booking & Payment Page Styles --- */
.stepper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80%;
    max-width: 500px;
    margin: 30px auto 50px;
}
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #ccc;
}
.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    border: 2px solid #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    transition: all 0.3s;
}
.step-label {
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}
.step-line {
    flex-grow: 1;
    height: 2px;
    background-color: #ccc;
    margin: 0 10px;
    transform: translateY(-15px);
}
.step.active .step-icon {
    background-color: var(--primary-gold);
    border-color: var(--primary-gold);
    color: white;
}
.step.active {
    color: var(--text-dark);
}
.step.complete .step-icon {
    background-color: var(--dark-maroon);
    border-color: var(--dark-maroon);
    color: white;
}
.step.complete {
    color: var(--text-dark);
}

.total-summary {
    text-align: right;
    font-size: 1.5rem;
    margin: 20px 0;
    font-weight: bold;
}
/* --- Form Page Specific Styles (Booking, Contact, etc.) --- */
.contact-form-container {
    background: #fff;
    padding: 30px 40px; /* เพิ่ม padding ด้านข้าง */
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}
.contact-form-container label {
    font-weight: bold;
    display: block;
    margin-top: 1.2rem;
    margin-bottom: 8px; /* เพิ่มระยะห่าง label กับ input */
    color: var(--text-dark);
}
.contact-form-container input[type="text"],
.contact-form-container input[type="email"],
.contact-form-container input[type="tel"],
.contact-form-container input[type="date"],
.contact-form-container input[type="number"],
.contact-form-container textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: 'Sarabun', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
/* เพิ่ม effect ตอน focus */
.contact-form-container input:focus,
.contact-form-container textarea:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 2px rgba(197, 166, 106, 0.2);
}

.contact-form-container input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 5px;
    box-sizing: border-box;
    cursor: pointer;
}

.cta-button {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    background-color: var(--dark-maroon);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 30px; /* เพิ่มระยะห่างปุ่ม */
    transition: background-color 0.3s;
}
.cta-button:hover {
    background-color: #6a0b0b;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 30px; /* เพิ่มระยะห่างระหว่างคอลัมน์ */
}
/* ทำให้เหลือ 1 คอลัมน์บนจอเล็ก */
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
}

#form-messages {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 4px;
    display: none;
}
#form-messages.success { display: block; background-color: #d4edda; color: #155724; }
#form-messages.error { display: block; background-color: #f8d7da; color: #721c24; }

/* ... (โค้ด CSS เดิมทั้งหมด) ... */

/* --- Contact Page Layout Styles (ส่วนที่เพิ่มเติม) --- */
.contact-page-layout {
    display: grid;
    grid-template-columns: 1fr; /* 1 คอลัมน์บนมือถือ */
    gap: 30px;
    align-items: flex-start;
    margin-top: 40px;
}
.contact-details-container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    border: 1px solid var(--border-color);
}
.contact-details-container h3 {
    margin-top: 0;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--rama5-pink);
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.contact-department {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
}
.contact-department:last-of-type {
    border-bottom: none;
}
.contact-department h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2rem;
}
.contact-department ul {
    list-style: none;
    padding-left: 0;
    margin: 0 0 10px 0;
    color: #555;
}
.contact-department p {
    margin: 0;
    font-weight: bold;
}
.social-media-links {
    margin-top: 20px;
}

/* --- Responsive for Contact Page --- */
@media (min-width: 992px) {
    .contact-page-layout {
        grid-template-columns: 1.5fr 1fr; /* 2 คอลัมน์บนจอใหญ่ */
    }
}

/* --- Location Page Styles --- */
.location-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 column on mobile */
    gap: 30px;
    margin-top: 40px;
}
.location-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: block;
}
.location-card img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.location-card:hover img {
    transform: scale(1.1);
}
.location-card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 40px 20px 20px;
    text-align: center;
    transition: background 0.3s;
}
.location-card-title h3 {
    margin: 0;
    font-size: 1.5rem;
}

/* --- Responsive Grid for Location List --- */
@media (min-width: 768px) {
    .location-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
}
@media (min-width: 992px) {
    .location-grid { 
        grid-template-columns: repeat(3, 1fr); 
    }
}
/* --- Global Styles & Variables --- */
:root {
    --primary-gold: #c5a66a;
    --dark-maroon: #8a0e0e;
    --rama5-pink: #f8e3e9; 
    --text-dark: #3a3a3a;
    --text-light: #ffffff;
    --bg-light: #fdfdfa;
    --border-color: #e0e0e0;
}
html { scroll-behavior: smooth; }
body {
    font-family: 'Sarabun', sans-serif;
    margin: 0;
    color: var(--text-dark);
    background-color: var(--bg-light);
    font-size: 16px;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ... (โค้ดส่วนอื่นๆ ที่ถูกต้องแล้ว) ... */

/* --- Header & Navigation --- */
.header-top .container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 70px;
}
.logo { font-size: 1.1rem; /* ปรับขนาดเล็กน้อย */ }
.logo img { height: 80px; margin-right: 10px; }

/* ========== Mobile Navigation Styles (ส่วนที่เพิ่ม/แก้ไข) ========== */

.mobile-nav-toggle {
    display: block;
    position: absolute;
    z-index: 2000;
    right: 1rem;
    top: 2rem;
    background: transparent;
    border: 0;
    width: 2rem;
    aspect-ratio: 1;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.7)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
}

.mobile-nav-toggle[aria-expanded="true"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.7)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M6 6l18 18M24 6L6 24'/%3e%3c/svg%3e");
}

.main-nav {
    display: none; /* ซ่อนเมนูแนวนอนบนมือถือ */
}

@media (max-width: 991px) {
    .main-nav {
        display: block; /* ทำให้ JS แสดงผลได้ */
        position: fixed;
        z-index: 1000;
        inset: 0 0 0 30%; /* ตำแหน่งของเมนูที่เลื่อนออกมา */
        background: hsl(0 0% 100% / 0.9);
        backdrop-filter: blur(1rem);
        -webkit-backdrop-filter: blur(1rem);
        flex-direction: column;
        padding: min(20vh, 10rem) 2em;
        transform: translateX(100%);
        transition: transform 350ms ease-out;
    }
    .main-nav[data-visible="true"] {
        transform: translateX(0%);
    }
    .main-nav ul {
        flex-direction: column;
        gap: 1rem;
    }
    .main-nav a {
        padding: 0.5rem 1rem;
    }
    .dropdown-content {
        position: static;
        display: block;
        box-shadow: none;
        padding-left: 1rem;
        background: transparent;
    }

    .dropdown:hover .dropdown-content {
        display: block;
    }
    
    .dropdown-content a {
        color: var(--text-dark);
    }
}

/* --- Desktop Navigation --- */
@media (min-width: 992px) {
    .mobile-nav-toggle {
        display: none; /* ซ่อนปุ่มแฮมเบอร์เกอร์บนจอใหญ่ */
    }
    .main-nav {
        display: block; /* แสดงเมนูแนวนอน */
    }
    .main-nav ul {
        display: flex;
        list-style: none;
        margin: 0;
        padding: 0;
    }
    /* ... (โค้ด CSS เดิมสำหรับเมนูบน Desktop) ... */
}

/* --- Mobile Menu --- */
@media (max-width: 991px) {
    .main-nav {
        display: block;
        position: fixed;
        z-index: 1000;
        inset: 0 0 0 30%;
        background: hsl(0 0% 100% / 0.9);
        backdrop-filter: blur(1rem);
        -webkit-backdrop-filter: blur(1rem);
        flex-direction: column;
        padding: min(20vh, 10rem) 2em;
        transform: translateX(100%);
        transition: transform 350ms ease-out;
        
        overflow-y: auto; /* <-- เพิ่มบรรทัดนี้เข้ามา */
    }
    /* ... (โค้ดส่วนที่เหลือเหมือนเดิม) ... */
}
.slide-caption {
    text-align: center;
    /* เพิ่มพื้นหลังสีดำโปร่งแสง */
    background: rgba(129, 130, 129, 0.64); 
    padding: 20px 40px;
    border-radius: 15 px; /* ทำให้ขอบมนขึ้นเล็กน้อย */
    color: rgb(255, 137, 224);
    text-shadow: 1px 1px 3px rgb(0, 0, 0);
    /* เพิ่มขอบเขตความกว้างไม่ให้ยาวเกินไป */
    max-width: 100%;
}

/* --- Style for Circle Cover Image on Detail Pages --- */
.detail-cover-image-circle {
    display: block;
    width: 300px;
    height: 300px;
    border-radius: 50%; /* ทำให้เป็นวงกลม */
    object-fit: cover;   /* ทำให้ภาพเต็มวงกลมโดยไม่เสียสัดส่วน */
    margin: 20px auto 40px; /* จัดให้อยู่กึ่งกลาง */
    border: 8px solid #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}
/* --- News Card Image Overlay Styles --- */
.news-card-image-container {
    position: relative;
    overflow: hidden;
}
.news-card-image-container img {
    width: 300px;
    height: 200px; /* ความสูงคงที่ตามต้องการ */
    display: block;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.news-card:hover .news-card-image-container img {
    transform: scale(1.1);
}
.news-card-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
}
.news-card-title-overlay h3 {
    margin: 0;
    font-size: 1.2rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}
.news-card-content {
    padding: 20px;
}
/* ซ่อน h3 เดิมใน content เพราะย้ายไปไว้บนรูปแล้ว */
.news-card-content h3 {
    display: none;
}

/* --- Style for Circle Cover Image on Detail Pages --- */
.detail-cover-image-circle {
    display: block;
    width: 300px;
    height: 300px;
    border-radius: 50%; /* ทำให้เป็นวงกลม */
    object-fit: cover;   /* ทำให้ภาพเต็มวงกลมโดยไม่เสียสัดส่วน */
    margin: 20px auto 40px; /* จัดให้อยู่กึ่งกลาง */
    border: 8px solid #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* --- Personnel & Monk Detail Page Styles --- */
.monk-detail-layout {
    display: flex;
    flex-direction: column; /* For mobile */
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.monk-detail-image {
    flex-shrink: 0;
    width: 250px;
}
.monk-detail-image img {
    width: 250px;
    height: 250px;
    border-radius: 50%; /* ทำให้รูปภาพเป็นวงกลม */
    object-fit: cover;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border: 8px solid var(--bg-light);
}
.monk-detail-info {
    flex-grow: 1;
    width: 100%;
}
.monk-detail-info h1 {
    border-bottom: 2px solid var(--rama5-pink);
    padding-bottom: 15px;
    margin-top: 0;
    margin-bottom: 5px;
    text-align: center;
}
.monk-detail-info .position-title,
.monk-detail-info .lay-name {
    font-size: 1.2rem;
    color: #777;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

@media (min-width: 768px) {
    .monk-detail-layout {
        flex-direction: row;
        align-items: flex-start;
    }
    .monk-detail-info h1, 
    .monk-detail-info .position-title,
    .monk-detail-info .lay-name {
        text-align: left;
    }
}