/* =========================================
   1. GLOBAL & VARIABLES
   ========================================= */
:root {
    --forest-green: #000000;
    --candle-gold: #d4af37;
    --text-light: #f5f5f5;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--forest-green);
    color: var(--text-light);
    font-family: 'EB Garamond', serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%;
    overflow-x: hidden;
}

/* =========================================
   2. SHARED BACKGROUND & CONTAINER
   ========================================= */
.bg-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background-image: url('../images/bg.png');
    /* ปรับ Path ให้ถอยออก 1 ชั้นจากโฟลเดอร์ css */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.25;
    z-index: -1;
    pointer-events: none;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.hub-container {
    width: 100%;
    max-width: 480px;
    /* กระชับเหมือนแอปพรีเมียม */
    text-align: center;
    padding: 60px 20px;
    z-index: 1;
}



/* =========================================
   3. TYPOGRAPHY
   ========================================= */
h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    letter-spacing: 3px;
    color: var(--candle-gold);
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.tagline {
    font-size: 1.05rem;
    font-style: italic;
    margin-bottom: 20px;
    line-height: 1.4;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.section-title {
    font-size: 0.8rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin: 30px 0 15px;
    color: var(--candle-gold);
    opacity: 0.8;
    font-weight: 600;
}

/* =========================================
   4. INDEX HUB STYLES (Buttons & Icons)
   ========================================= */
.link-card {
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 18px 25px;
    margin-bottom: 15px;
    border-radius: 15px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 1.15rem;
    min-height: 65px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.link-card:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--candle-gold);
    transform: scale(1.03);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.link-card i {
    font-size: 1.4rem;
    margin-right: 18px;
    width: 28px;
    color: var(--candle-gold);
    text-align: center;
}

.btn-text {
    flex-grow: 1;
    text-align: left;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Podcast Special Buttons */
.icon-link-side {
    display: flex;
    align-items: center;
    /* จัดให้อยู่กลางแนวตั้งเป๊ะๆ */
    text-decoration: none;
    gap: 10px;
    /* ระยะห่างระหว่างไอคอนกับตัวหนังสือ */
    transition: 0.3s;
}

.icon-link-side i {
    font-size: 1.4rem;
    color: var(--candle-gold);
    /* ไอคอนสีทอง */
}

.icon-with-text {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 8px;
    /* ระยะห่างระหว่างรูปกับคำ */
}

.icon-with-text span {
    color: var(--text-light);
    /* ตัวอักษรสีขาวตามโจทย์ */
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    font-weight: 500;
}

.side-label {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-light);
    /* ตัวหนังสือสีขาวตามโจทย์ */
    font-weight: 500;
    opacity: 0.85;
}

.icon-link-side:hover .side-label {
    opacity: 1;
    color: var(--candle-gold);
    /* เวลาเอาเมาส์วางค่อยเปลี่ยนเป็นสีทอง */
}

.podcast-icons {
    display: flex;
    gap: 35px;
    /* เว้นระยะไอคอนอื่นๆ ให้โปร่งๆ ดูแพง */
    align-items: center;
    font-size: 1.8rem;
}

.podcast-icons a {
    color: inherit;
    text-decoration: none;
    line-height: 0;
}

.podcast-icons i {
    color: var(--candle-gold);
    margin-right: 0;
    width: auto;
    transition: 0.3s;
}

.podcast-icons i:hover {
    transform: scale(1.2);
    color: var(--text-light);
}

.lang-tag {
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-right: 20px;
    color: var(--candle-gold);
    border-right: 1px solid var(--glass-border);
    padding-right: 15px;
}

/* =========================================
   5. ARTICLE ARCHIVE STYLES (New Cards)
   ========================================= */
/* --- สไตล์การ์ดแบบแนวนอน (Compact List) --- */
.archive-container {
    width: 100%;
    max-width: 1000px;
    /* กว้างขวางสำหรับ Desktop */
    padding: 0px 20px 20px 20px;
    z-index: 1;
    text-align: center;
}

/* --- ตัวคุม Grid: 2 คอลัมน์บน Desktop --- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* แบ่ง 2 ช่องเท่ากัน */
    gap: 15px;
    /* ระยะห่างระหว่างการ์ด */
    width: 100%;
}

/* --- ตัวการ์ดบทความ (Article Card) --- */
.article-card {
    display: flex;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-light);
    overflow: hidden;
    transition: 0.3s ease;

    /* ล็อคขนาดการ์ด: ถ้ามีเรื่องเดียว มันจะกว้างแค่นี้ ไม่ยืดเต็มหน้าจอ */
    width: 100%;
    max-width: 480px;
    height: 110px;
    /* ฟิกส่วนสูงให้กะทัดรัด */
}

.article-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--candle-gold);
    transform: translateY(-3px);
}

/* ส่วนรูปภาพ: ล็อคจตุรัส 1:1 */
.article-thumb-box {
    flex: 0 0 110px;
    /* กว้างเท่ากับความสูงการ์ดเป๊ะ (1:1) */
    height: 110px;
}

.article-thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ส่วนข้อความ: จัดเรียงซ้าย อาจารย์ > ชื่อตอน > วันที่ */
.article-info {
    padding: 0 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    /* เรียงซ้ายตามโจทย์ */
    min-width: 0;
    /* ป้องกันข้อความดันการ์ดทะลุ */
}

.article-teacher {
    font-size: 0.65rem;
    color: var(--candle-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 2px;
}

.article-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    line-height: 1.2;
    font-weight: 600;
    margin-bottom: 2px;
    /* ตัดคำถ้าชื่อตอนยาวเกินไป */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-date {
    font-size: 0.7rem;
    opacity: 0.4;
    font-style: italic;
}

/* ซ่อน Description (ซ่อนถาวรในหน้า List เพื่อความ Compact) */
.article-desc-hidden {
    display: none;
}

.back-btn-center {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--candle-gold);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(214, 175, 55, 0.3);
    padding-bottom: 5px;
    transition: 0.3s;
}

.back-btn-center:hover {
    border-color: var(--candle-gold);
    letter-spacing: 5px;
    /* กิมมิกเวลาเลื่อนเมาส์วางแล้วตัวอักษรขยายออกนิดๆ */
}

/* =========================================
   6. LOGO & FOOTER
   ========================================= */
.logo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin-top: 40px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.footer {
    margin-top: 10px;
    font-size: 0.95rem;
    opacity: 0.7;
    line-height: 2;
    font-style: italic;
}

/*==========================================
Dhamma Detail
============================================ */
.back-link {
    font-family: 'EB Garamond', serif;
    color: #d4af37;
    /* สีทอง pali-gold */
    opacity: 0.7;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.3s;
}

.back-link:hover {
    opacity: 1;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.detail-header {
    width: 100%;
    margin-bottom: 40px;
    text-align: left;
}

.detail-intro {
    display: flex;
    align-items: center;
    gap: 30px;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 0px;
    padding: 0px 0;
    text-align: left;
    border-bottom: none;
}

/* ล็อครูปเป็น Square 1:1 ขนาดเท่าหน้า List */
.detail-thumb-box {
    flex: 0 0 120px;
    /* ขนาดเดียวกับ Desktop List */
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.detail-thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-teacher {
    font-size: 0.85rem;
    color: var(--candle-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 5px;
}

.detail-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    /* ใหญ่กว่าหน้า List เพื่อความเด่นของหน้าหลัก */
    line-height: 1.1;
    color: var(--text-light);
    margin-bottom: 8px;
}

.detail-desc {
    padding: 15px 0px;
}

/* --- Minimal Sales Hub --- */
/* --- Minimal & Compact Sales Hub --- */
.sales-hub {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    /* ลดระยะห่างระหว่างรายการ */
    padding: 12px 20px;
    /* ลดความหนาของแถบลงเกินครึ่ง */
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    justify-content: flex-start;
    align-items: center;
    margin: 0px 0;
    /* เว้นระยะบนล่างให้พอดี */
}

.sales-item {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-light);
    opacity: 0.8;
    /* ให้ดูถ่อมตัวลง */
    transition: 0.3s ease;
}

.sales-item:hover {
    opacity: 1;
    color: var(--candle-gold);
    transform: translateY(-1px);
}

/* ลดขนาดไอคอนลงให้ดูเป็นระเบียบ */
.sales-item i {
    font-size: 1.2rem;
    color: var(--candle-gold);
    margin-right: 10px;
}

.sales-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sales-label {
    font-size: 0.55rem;
    /* เล็กมากแต่ยังอ่านออก */
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.5;
}

.sales-product {
    font-size: 0.8rem;
    /* ขนาดตัวหนังสือหลักเล็กลง */
    font-weight: 400;
}

.more-btn {
    display: none;
}

/* =========================================
   DHAMMA CONTENT STYLE
   ========================================= */
.dhamma-content {
    width: 100%;
    ;
    /* ล็อคความกว้างให้อ่านง่ายสไตล์ Medium */
    margin: 0 auto;
    padding-bottom: 30px;
}

.dhamma-content p {
    /* 1. สั่งกระจายตัวหนังสือให้เต็มบรรทัดหน้า-หลังเท่ากันเป๊ะ */
    text-align: justify;

    /* 2. ป้องกันช่องว่างระหว่างคำกว้างเกินไป (ป้องกันแม่น้ำขาวในหน้ากระดาษ) */
    text-justify: inter-word;

    /* 3. เปิดระบบตัดคำอัตโนมัติด้วยเครื่องหมายขีด (-) */
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;

    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-light);
    text-align: left;
    margin: 30px 0;
    opacity: 0.95;
}

/* สไตล์สำหรับคำในวงเล็บให้เป็นสีทอง */
.dhamma-content span.pali-gold {
    color: var(--candle-gold);
    font-weight: 500;
}

.master-identity span.pali-gold {
    color: var(--candle-gold);
    font-weight: 500;
}

.bio-text span.pali-gold {
    color: var(--candle-gold);
    font-weight: 500;
}

/* เส้นคั่นสีทองจางๆ ตามรูปตัวอย่าง */
.para-sep {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(212, 175, 55, 0.4), transparent);
    margin: 40px auto;
    width: 100%;
}

/* =========================================
   POST-CONTENT SUPPORT AREA
   ========================================= */
.post-support-section {
    width: 100%;
    margin-top: 0px;
    padding: 10px 20px 20px;
    background: rgba(212, 175, 55, 0.03);
    /* ใส่สีทองจางๆ เป็นพื้นหลังพื้นที่นี้ */
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    text-align: center;
}

.support-quote-bottom {
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-light);
    opacity: 0.85;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
}

/* ปุ่มหัวใจสนับสนุน */
.buy-coffee-btn {
    display: inline-flex;
    align-items: center;
    background-color: transparent;
    color: var(--candle-gold);
    border: 1px solid var(--candle-gold);
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.4s ease;
    cursor: pointer;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.buy-coffee-btn:hover {
    background-color: var(--candle-gold);
    color: #1a1a1a;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    transform: translateY(-3px);
}

.buy-coffee-btn i {
    margin-right: 12px;
}

.dana-disclaimer {
    margin-top: 20px;
    font-size: 0.8rem;
    opacity: 0.4;
    letter-spacing: 1px;
}

/* =========================================
   COPYRIGHT & USAGE SECTION
   ========================================= */
.copyright-section {
    width: 100%;
    margin-top: 00px;
    padding: 20px 20px;
    text-align: center;
    /* จัดกึ่งกลางตามโจทย์ */
}

.copyright-text {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-light);
    opacity: 0.8;
    /* เพิ่มความชัดขึ้นให้ใกล้เคียงส่วน Support */
    font-style: italic;
    max-width: 800px;
    margin: 0 auto;
}

/* เน้นสีทองให้เหมือนปุ่ม Support */
.copyright-text strong,
.copyright-text .brand-gold {
    color: var(--candle-gold);
    opacity: 1;
    font-style: normal;
    font-weight: 600;
}

/* --- Master Profile Header --- */
.master-profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 0;
}

@media (min-width: 768px) {
    .master-profile-header {
        flex-direction: row;
        text-align: left;
        gap: 60px;
    }
}

.master-portrait-box {
    flex: 0 0 350px;
}

.master-sketch {
    width: 100%;
    filter: grayscale(100%) contrast(1.1); /* ทำให้รูปสเก็ตช์ดูคมเข้ม */
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%); /* จางช่วงล่างให้กลืน */
}

.lineage-tag {
    color: #d4af37;
    letter-spacing: 3px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.master-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3rem;
    color: #fff;
    margin: 10px 0;
}

.master-years {
    opacity: 0.5;
    font-style: italic;
    letter-spacing: 2px;
}

/* --- Bio Content --- */
.master-bio-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.bio-sub {
    font-family: 'Cormorant Garamond', serif;
    color: #d4af37;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.key-teachings-box {
    background: rgba(212, 175, 55, 0.05);
    border-left: 3px solid #d4af37;
    padding: 30px;
    margin: 40px 0;
}

.key-teachings-box h3 {
    color: #d4af37;
    margin-top: 0;
}

/* =========================================
   TABLE OF CONTENT
   ========================================= */

.toc-floating-btn {
    position: fixed;
    z-index: 1000;

    /* ตำแหน่งขวาล่าง: กดง่าย ไม่บังหัวประโยค */
    bottom: 30px;
    right: 20px;

    background-color: #d4af37;
    /* ทอง pali-gold */
    color: #1a1a1a;
    width: 50px;
    /* ขนาดใหญ่พอให้นิ้วกดโดน (Touch Target) */
    height: 50px;
    border-radius: 50%;
    /* วงกลมดูเป็นปุ่มเมนูสากล */
    border: none;

    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);

    /* บนมือถือให้เห็นชัดไปเลย 80% ไม่ต้องรอ Hover */
    opacity: 0.8;
    cursor: pointer;
}

/* เอฟเฟกต์ตอนกด (สำหรับมือถือ) */
.toc-floating-btn:active {
    transform: scale(0.9);
    opacity: 1;
}

/* หน้าจอเมนูสารบัญ */
.toc-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    /* มืดแบบขรึมๆ */
    z-index: 1000;
}

.toc-content {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    font-family: 'EB Garamond', serif;
}

/* คลุมหน้าจอทั้งหมด */
.toc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* แก้จุดนี้: เปลี่ยนจากดำทึบ เป็นโปร่งใส หรือดำจางๆ มากๆ */
    background: rgba(0, 0, 0, 0.1);

    display: flex;
    z-index: 9999;
    align-items: center;
    justify-content: center;

    /* --- หัวใจของความ Smooth --- */
    opacity: 0;
    /* เริ่มต้นล่องหน */
    visibility: hidden;
    /* ป้องกันการเผลอไปคลิกโดนตอนซ่อน */
    backdrop-filter: blur(0px);
    /* เริ่มต้นไม่เบลอ */
    transition: opacity 0.4s ease, visibility 0.4s ease, backdrop-filter 0.4s ease;
}

/* 2. ตัวกล่องสารบัญ (Modal) - เพิ่มเงาให้ดูมีมิติ (Float) */
.toc-modal {
    width: 90%;
    max-width: 450px;
    background: #1a1a1a;
    border: 1px solid #d4af37;
    border-radius: 8px;
    max-height: 80vh;
    overflow-y: auto;
    /* ให้เลื่อนได้เฉพาะในนี้ */
    padding: 0;
    /* เอา padding ออกเพื่อให้ header ติดขอบ */
    position: relative;

    /* --- เพิ่มการ "ลอยขึ้น" (Slide Up) --- */
    transform: translateY(30px);
    /* เริ่มต้นอยู่ต่ำกว่าปกตินิดหน่อย */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* จังหวะการเคลื่อนที่แบบนุ่มๆ */
}

.toc-overlay.active .toc-modal {
    transform: translateY(0);
}

/* เมื่อสั่งเปิดสารบัญ */
.toc-overlay.active {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(10px);
    /* ค่อยๆ เบลอหลังฉาก */
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

/* 2. ทำให้ Header ติดหนึบอยู่กับที่ */
.toc-header {
    position: sticky;
    /* หัวใจหลักคืออันนี้ */
    top: 0;
    /* ให้ติดขอบบนสุด */
    background-color: #1a1a1a;
    /* ต้องใส่สีพื้นหลัง ไม่งั้นตัวหนังสือจะซ้อนกัน */
    z-index: 10;

    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    /* ย้าย padding มาใส่ที่นี่แทน */
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    /* เส้นคั่นทองจางๆ */
}

.toc-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.5;
}

/* รายชื่อบทเรียน */
.toc-links a {
    display: block;
    color: #ccc;
    text-decoration: none;
    padding: 10px 25px 25px 25px;
    /* ใส่ padding ให้เนื้อหาไม่ติดขอบกล่อง */
    font-family: 'EB Garamond', serif;
    font-size: 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s;
}

.toc-links a:hover {
    color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
    padding-left: 20px;
    /* กิมมิกเลื่อนตอนชี้ */
}

/* เส้นคั่นระหว่างปุ่มทางออกกับสารบัญ */
.toc-sep {
    border: 0;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    margin: 10px 0;
}

/* สไตล์ปุ่มทางออกในหน้าสารบัญ */
.toc-exit-link {
    display: block;
    color: #d4af37 !important;
    /* บังคับให้เป็นสีทอง */
    font-weight: bold;
    letter-spacing: 1px;
    padding: 15px 25px !important;
    text-transform: uppercase;
    font-size: 0.9rem !important;
    border-bottom: none !important;
    /* ไม่เอาเส้นคั่นแบบ chapter */
}

.toc-exit-link i {
    margin-right: 8px;
    font-size: 0.8rem;
}

.toc-exit-link:hover {
    background: rgba(212, 175, 55, 0.15) !important;
    padding-left: 15px !important;
}

/* =========================================
   7. RESPONSIVE
   ========================================= */
@media (max-width: 850px) {
    .podcast-icons {
        gap: 20px;
    }

    .side-label {
        font-size: 0.65rem;
        letter-spacing: 1px;
    }

    .archive-container {
        padding: 30px 20px;
    }

    .copyright-text {
        font-size: 0.75rem;
    }

    /* --- หน้า Archive List --- */
    .article-grid {
        grid-template-columns: 1fr;
    }

    .article-card {
        max-width: 100%;
        height: 100px;
    }

    .article-thumb-box {
        flex: 0 0 100px;
        height: 100px;
    }

    /* --- หน้า Dhamma Detail --- */

    /* 1. ซ่อนรูปบนมือถือตามสั่ง */
    .back-link {
        font-family: 'EB Garamond', serif;
        color: #d4af37;
        /* สีทอง pali-gold */
        opacity: 0.7;
        text-decoration: none;
        font-size: 0.9rem;
        transition: 0.3s;
    }

    .detail-thumb-box {
        display: none;
    }

    /* 2. จัด Layout ส่วนหัวใหม่ */
    .detail-intro {
        display: block;
        /* ยกเลิก Flex เพื่อให้เท็กซ์ไหลตามปกติ */
        margin-top: 15px;
        padding-bottom: 20px;
        text-align: left;
        /* เรียงซ้าย */
    }

    .detail-info-box {
        width: 100%;
    }

    .detail-teacher {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }

    .bio-separator {
        opacity: 0.3;
        margin: 0 12px;
        font-size: 0.8rem;
    }

    .bio-link {
        text-decoration: none;
        font-family: 'EB Garamond', serif;
        font-size: 0.75rem;
        /* ตัวเล็กแต่ขลัง */
        letter-spacing: 2px;
        color: #d4af37 !important;
        border: 1px solid rgba(212, 175, 55, 0.3);
        padding: 3px 10px;
        border-radius: 20px;
        /* ทำเป็นทรงมนยาว (Capsule) จะดูแพงกว่าสี่เหลี่ยม */
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        /* ระยะห่างไอคอนกับตัวหนังสือ */
        vertical-align: middle;
    }

    .bio-link i {
        font-size: 0.8rem;
        opacity: 0.8;
    }

    .bio-link:hover {
        background: rgba(212, 175, 55, 0.1);
        border-color: #d4af37;
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
        transform: translateY(-1px);
        /* ลอยขึ้นนิดนึงตอนชี้ */
    }

    .detail-title {
        font-size: 1.7rem;
        /* ให้ชื่อตอนเด่นที่สุด */
        line-height: 1.2;
        margin-bottom: 10px;
    }

    .detail-date {
        font-size: 0.85rem;
        display: block;
        /* ให้อยู่บรรทัดใหม่ใต้ชื่อตอน */
        margin-bottom: 0;
        opacity: 0.8;
    }

    /* 3. ซ่อน Description ส่วนหัวบนมือถือ เพื่อความ Compact */
    .detail-desc {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        /* โชว์แค่ 2 บรรทัดพอ */
        -webkit-box-orient: vertical;
        overflow: hidden;

        font-size: 0.9rem;
        line-height: 1.5;
        color: #bbb;
        margin-top: 10px;
        padding-left: 15px;
        border-left: 1px solid var(--candle-gold);
        /* เพิ่มเส้นคั่นให้นิดนึงจะดูขลังมาก */
        opacity: 0.8;
    }

    /* 4. ปรับแถบขายของให้กะทัดรัด */
    .sales-hub {
        position: relative;
        overflow: hidden;
        max-height: 60px;
        /* ปรับความสูงให้พอดีกับ 1 แถวของคุณ */
        transition: max-height 0.5s ease;
        padding-right: 80px;
        /* เว้นที่ว่างด้านขวาให้ปุ่ม more... จะได้ไม่ทับไอคอน */
    }

    .sales-hub.expanded {
        max-height: 500px;
        padding-bottom: 40px;
        /* เพิ่มพื้นที่ด้านล่างเมื่อกางออก */
    }

    .more-btn {
        display: block;
        /* หรือ inline-block */
        position: absolute;
        top: 30px;
        /* ปรับให้ดูอยู่กึ่งกลางแนวตั้งของแถวแรก */
        right: 15px;
        transform: translateY(-50%);

        font-size: 0.8rem;
        color: var(--candle-gold);
        cursor: pointer;
        font-style: italic;
        background: none;
        border: none;
        z-index: 10;
        letter-spacing: 1px;
    }

    .sales-hub.expanded .more-btn {
        top: auto;
        bottom: 10px;
        transform: none;
    }

    .sales-product {
        font-size: 0.75rem;
    }

}

@media (min-width: 850px) {
    .breadcrumb-nav {
        padding-top: 30px;
        /* เพิ่มพื้นที่ "หายใจ" ด้านบนให้ดู Cinematic ขึ้น */
    }

    .toc-floating-btn {
        /* รีเซ็ตตำแหน่งมือถือ */
        bottom: auto;
        right: auto;

        /* กลับไปเป็นที่คั่นหนังสือซ้ายบน */
        top: 0px;
        right: 20px;
        width: 35px;
        height: 100px;
        border-radius: 0 4px 4px 0;
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 50% 85%, 0% 100%);

        display: flex;
        flex-direction: column;
        padding-top: 10px;
        opacity: 0.8;
        /* บน Desktop ให้จางลงหน่อยเพราะมีเมาส์ */
    }

    .toc-floating-btn:hover {
        opacity: 1;
        transform: translateX(0);
    }

    .bio-link {
        text-decoration: none;
        font-family: 'EB Garamond', serif;
        font-size: 0.75rem;
        /* ตัวเล็กแต่ขลัง */
        letter-spacing: 2px;
        color: #d4af37 !important;
        border: 1px solid rgba(212, 175, 55, 0.3);
        padding: 3px 10px;
        border-radius: 20px;
        /* ทำเป็นทรงมนยาว (Capsule) จะดูแพงกว่าสี่เหลี่ยม */
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        /* ระยะห่างไอคอนกับตัวหนังสือ */
        vertical-align: middle;
    }

    .bio-link:hover {
        background: rgba(212, 175, 55, 0.1);
        border-color: #d4af37;
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
        transform: translateY(-1px);
        /* ลอยขึ้นนิดนึงตอนชี้ */
    }
}