/* ==========================================================================
   ARTICLES: หน้าบทความ (content.php) และข่าว PR รายตัว (content_1.php)
   ย้ายมาจาก pages.css [3] Single Article, [4] Affiliate & Premium Related
   ต้องเรียกใช้ในหน้าที่ใช้คลาสเหล่านี้: <link rel="stylesheet" href="/css/articles.css">
   ========================================================================== */
/* ==========================================================================
   [3] SINGLE ARTICLE FULL DETAIL VIEW & SHARED BUTTONS
   ========================================================================== */
.single-article-wrapper { 
    background: #ffffff; 
    border-radius: 24px; 
    padding: 35px; 
    border: 1px solid #f1f2f6; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.02); 
}

.post-main-title { 
    font-size: 26px; 
    font-weight: 800; 
    line-height: 1.4; 
    color: #2c3e50; 
    margin: 15px 0; 
}

.post-author-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid #f1f2f6; 
    padding-bottom: 20px; 
    margin-bottom: 25px; 
}

.author-info-mini { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

.author-avatar-img { 
    width: 42px; 
    height: 42px; 
    border-radius: 50%; 
    background-size: cover; 
    background-position: center; 
    background-color: #f1f5f9;
}

.author-name { display: block; font-size: 14px; font-weight: 600; color: #2c3e50; }
.post-date { font-size: 12px; color: #95a5a6; }
.post-feature-image-holder { border-radius: 16px; overflow: hidden; margin-bottom: 30px; }

.article-entry-content { font-size: 18px; line-height: 1.8; color: #333333; }
.article-entry-content p { margin-bottom: 1.5em !important; }
.article-entry-content p.lead-paragraph { font-size: 18px; font-weight: 500; color: #2c3e50; }
.article-entry-content h3 { font-size: 19px; font-weight: 700; color: #2c3e50; margin: 30px 0 15px 0; }
.article-pullquote { border-left: 4px solid #ff527b; background: #fff5f7; padding: 20px; margin: 25px 0; font-size: 16px; font-style: italic; font-weight: 500; color: #db3a60; border-radius: 0 12px 12px 0; }

/* Article Content Image Alignments */
.article-entry-content img { 
    max-width: 100%; 
    height: auto; 
    border-radius: 8px; 
    margin: 15px auto !important; 
    display: block; 
}
.article-entry-content img[align="left"], .article-entry-content img.alignleft { display: inline-block; margin: 5px 15px 15px 0 !important; float: left; }
.article-entry-content img[align="right"], .article-entry-content img.alignright { display: inline-block; margin: 5px 0 15px 15px !important; float: right; }
/* จัดข้อความ/บล็อกกึ่งกลาง: รองรับทั้งแท็กเก่า (<center>, align="center") และคลาสจาก editor */
.article-entry-content center,
.article-entry-content [align="center"]:not(img),
.article-entry-content .text-center,
.article-entry-content .text-align-center,
.article-entry-content .has-text-align-center,
.article-entry-content .ql-align-center,
.article-entry-content .aligncenter:not(img) { text-align: center !important; }
.article-entry-content [align="right"]:not(img),
.article-entry-content .text-right,
.article-entry-content .has-text-align-right,
.article-entry-content .ql-align-right { text-align: right !important; }
.article-entry-content [align="justify"]:not(img),
.article-entry-content .ql-align-justify { text-align: justify !important; }
/* รูปที่ระบุให้อยู่กึ่งกลาง (ค่าเริ่มต้นของรูปในเนื้อหาเป็น block กึ่งกลางอยู่แล้ว) */
.article-entry-content img[align="center"], .article-entry-content img.aligncenter { display: block; float: none; margin: 15px auto !important; }
.article-entry-content figure { margin: 15px auto; text-align: center; }
.article-entry-content figure img { margin-left: auto !important; margin-right: auto !important; }
.article-entry-content figcaption { font-size: 14px; color: #7f8c8d; margin-top: 6px; }
.article-entry-content::after { content: ""; display: table; clear: both; }

/* Social Share Buttons Group */
.article-share-footer-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 15px; padding: 20px 0; margin: 30px 0; border-top: 1px dashed #e2e8f0; border-bottom: 1px dashed #e2e8f0; }
.share-label-text { font-size: 15px; font-weight: 600; color: #475569; }
.share-buttons-group { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-share-social {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; width: 130px; 
    border-radius: 50px; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; border: none; outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); background-color: #475569; color: #ffffff !important; box-sizing: border-box;
}
.btn-share-social i { color: #ffffff !important; font-size: 15px; }
.btn-share-social:hover { transform: translateY(-2px); opacity: 0.95; }
.btn-share-social.line:hover { background-color: #06c755; box-shadow: 0 4px 12px rgba(6, 199, 85, 0.35); }
.btn-share-social.fb:hover { background-color: #1877f2; box-shadow: 0 4px 12px rgba(24, 119, 242, 0.35); }
.btn-share-social.messenger:hover { background-color: #006aff; box-shadow: 0 4px 12px rgba(0, 106, 255, 0.35); }
.btn-share-social.pinterest:hover { background-color: #bd081c; box-shadow: 0 4px 12px rgba(189, 8, 28, 0.35); }
.btn-share-social.twitter:hover { background-color: #000000; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
.btn-share-social.copy-link:hover { background-color: #1e293b; box-shadow: 0 4px 12px rgba(30, 41, 59, 0.35); }

/* Related Articles & Article Tags */
.related-articles-section { margin-top: 40px; }
.related-heading-title { font-size: 16.5px; font-weight: 700; color: #2c3e50; margin-bottom: 20px; }
.related-mini-card { background: #ffffff; border-radius: 14px; padding: 12px; border: 1px solid #f1f2f6; display: flex; flex-direction: column; gap: 10px; }
.related-img { 
    height: 130px; 
    border-radius: 8px; 
    background-size: cover; 
    background-position: center; 
    background-color: #f8f9fa;
}
.related-mini-card h4 { font-size: 13.5px; font-weight: 700; line-height: 1.4; }

.tag-container { margin-top: 30px; padding-top: 15px; border-top: 1px solid #eeeeee; }
.tag-container h4 { display: inline-block; margin-right: 10px; font-size: 16px; color: #555555; }
.tag { display: inline-block; background: #f5f5f5; color: #666666; padding: 4px 12px; border-radius: 20px; font-size: 14px; margin-right: 8px; margin-bottom: 8px; text-decoration: none; transition: background 0.2s; }
.tag:hover { background: #f68d8d; color: #ffffff; }



/* ==========================================================================
   [4] AFFILIATE & PREMIUM RELATED SYSTEM
   ========================================================================== */
.affiliate-section-break { margin-top: 40px; border-top: 2px dashed #f68d8d; padding-top: 20px; }
.affiliate-title { color: #ff4d4d; font-size: 20px; margin-bottom: 15px; }
.affiliate-grid-wrapper { display: flex; justify-content: center; margin: 20px 0; }
.affiliate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; width: 100%; }
.affiliate-box {
    border: 1px solid #ffeded; border-radius: 10px; padding: 15px; text-align: center;
    box-shadow: 0 4px 10px rgba(246, 141, 141, 0.15); transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.5s ease;
    background: #ffffff; display: flex; flex-direction: column; justify-content: space-between; height: 100%; text-decoration: none;
}
.affiliate-box:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(246, 141, 141, 0.3); border-color: #f68d8d; }

.affiliate-box img { 
    width: 100%; 
    height: 140px; 
    border-radius: 8px; 
    object-fit: cover; 
    object-position: center;
    background-color: #f8f9fa;
}
.affiliate-price { margin-top: 10px; font-weight: 700; color: #ffffff; font-size: 15px; background: #f68d8d; padding: 4px 8px; border-radius: 5px; display: block; }

.premium-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; width: 100%; }
.premium-card-item { display: flex; flex-direction: column; background: #ffffff; border: 1px solid #eaeaea; border-radius: 14px; overflow: hidden; text-decoration: none !important; box-shadow: 0 4px 12px rgba(0,0,0,0.03); transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease, border-color 0.3s ease; }
.premium-card-item:hover { transform: translateY(-5px); box-shadow: 0 10px 22px rgba(246, 141, 141, 0.2); border-color: #f68d8d; }
.premium-thumb-wrapper { width: 100%; position: relative; padding-top: 60%; overflow: hidden; background-color: #f9f9f9; }

.premium-card-thumb { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background-size: cover; background-position: center; background-repeat: no-repeat; 
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); 
}
.premium-card-item:hover .premium-card-thumb { transform: scale(1.06); }
.premium-card-info { padding: 15px; background: #ffffff; display: flex; flex-direction: column; justify-content: flex-start; }
.premium-card-title { font-size: 15px; color: #222222; font-weight: 600; line-height: 1.5; margin: 0; height: 3em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; transition: color 0.2s ease; }
.premium-card-item:hover .premium-card-title { color: #ff4d4d; }



/* ---------- Responsive (ย้ายมาจาก pages.css [6]) ---------- */
@media (max-width: 768px) {
    .single-article-wrapper { padding: 20px; }
    .post-main-title { font-size: 20px; }
    .premium-related-grid { grid-template-columns: 1fr !important; gap: 20px; padding: 0 16px !important; box-sizing: border-box; }
    .premium-card-item { border-radius: 12px; }
    .premium-thumb-wrapper { padding-top: 56.25% !important; }
    .premium-card-info { padding: 14px 16px !important; }
    .premium-card-title { font-size: 15px !important; height: auto !important; max-height: 3em; }
}

@media (max-width: 576px) {
    .article-share-footer-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
    .share-buttons-group { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .btn-share-social { width: 100%; justify-content: center; font-size: 13px; padding: 10px 12px; height: 42px; }
}

/* ==========================================================================
   ANTI-COPY: ห้ามลากเลือกข้อความและลากรูปในส่วนบทความ (ใช้คู่กับ /js/anti-copy.js)
   ========================================================================== */
.single-article-wrapper {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;   /* ปิดเมนูกดค้างบน iOS */
}
.single-article-wrapper img {
    -webkit-user-drag: none;
    user-drag: none;
}
/* ช่องกรอกข้อมูลต้องยังพิมพ์/เลือกได้ */
.single-article-wrapper input,
.single-article-wrapper textarea {
    -webkit-user-select: text;
    user-select: text;
}