/* article.css — article page styles */

/* ── Article Styles ── */
      .article-header {
        background: linear-gradient(
          135deg,
          var(--korean-blue) 0%,
          var(--korean-red) 100%
        );
        color: white;
        padding: 120px 2rem 100px;
        text-align: center;
      }

      .article-category {
        display: inline-block;
        padding: 0.5rem 1.5rem;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 30px;
        font-size: 0.9rem;
        margin-bottom: 1rem;
        backdrop-filter: blur(10px);
      }

      .article-header h1 {
        font-family: "Outfit", "Noto Sans Thai", sans-serif;
        font-size: clamp(2rem, 5vw, 3rem);
        font-weight: 800;
        margin-bottom: 1.5rem;
        line-height: 1.3;
      }

      .article-meta {
        display: flex;
        gap: 2rem;
        justify-content: center;
        flex-wrap: wrap;
        font-size: 0.95rem;
        opacity: 0.9;
      }

      .article-meta-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
      }

      /* ── Breadcrumb ── */
      /* Override base.css `nav { position: fixed }` which applies to all <nav> tags */
      nav.article-breadcrumb,
      .article-breadcrumb {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        padding: 0;
        background: transparent;
        backdrop-filter: none;
        box-shadow: none;
        z-index: auto;
        margin-bottom: 1.75rem;
      }
      .article-breadcrumb ol {
        list-style: none;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0 0.25rem;
        justify-content: center;
        font-size: 0.82rem;
        font-weight: 500;
      }
      .article-breadcrumb li {
        display: flex;
        align-items: center;
        color: rgba(255, 255, 255, 0.65);
      }
      /* › separator */
      .article-breadcrumb li + li::before {
        content: '›';
        margin: 0 0.35rem;
        opacity: 0.55;
        font-size: 1rem;
        line-height: 1;
      }
      .article-breadcrumb a {
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        transition: color 0.2s ease, opacity 0.2s ease;
        border-bottom: 1px solid transparent;
      }
      .article-breadcrumb a:hover {
        color: white;
        border-bottom-color: rgba(255, 255, 255, 0.5);
      }
      /* current page — truncate with ellipsis */
      .article-breadcrumb li[aria-current="page"] {
        color: rgba(255, 255, 255, 0.55);
        max-width: 280px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block; /* needed for text-overflow */
      }
      @media (max-width: 600px) {
        .article-breadcrumb li[aria-current="page"] {
          max-width: 160px;
        }
      }

      .article-image {
        width: 100%;
        max-width: 900px;
        margin: 0 auto 3rem;
        position: relative;
        z-index: 2;
      }

      .article-body {
        max-width: 800px;
        margin: 0 auto;
        padding: 2rem 2rem 4rem;
        position: relative;
        z-index: 1;
      }

      .article-image img {
        width: 100%;
        height: auto;
        border-radius: 20px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
        display: block;
      }

      .article-content {
        font-size: 1.15rem;
        line-height: 1.9;
        color: var(--text-dark);
      }

      .article-content h1 {
        display: none;
      }

      .article-content h2 {
        font-family: "Outfit", "Noto Sans Thai", sans-serif;
        font-size: 1.8rem;
        color: var(--primary);
        margin-top: 3rem;
        margin-bottom: 1.5rem;
        line-height: 1.3;
      }

      .article-content h3 {
        font-family: "Outfit", "Noto Sans Thai", sans-serif;
        font-size: 1.4rem;
        color: var(--primary);
        margin-top: 2.5rem;
        margin-bottom: 1rem;
      }

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

      .article-content ul,
      .article-content ol {
        margin-bottom: 1.5rem;
        padding-left: 2rem;
      }

      .article-content li {
        margin-bottom: 0.5rem;
      }

      .article-content strong {
        color: var(--korean-red);
        font-weight: 600;
      }

      .article-content blockquote {
        border-left: 4px solid var(--korean-blue);
        padding: 1.5rem 2rem;
        background: rgba(0, 52, 120, 0.04);
        border-radius: 8px;
        margin: 2rem 0;
        font-style: italic;
      }

      .article-content code {
        background: var(--light);
        padding: 0.2rem 0.5rem;
        border-radius: 4px;
        font-family: "Courier New", monospace;
        font-size: 0.9em;
      }

      .article-tags {
        display: flex;
        gap: 0.8rem;
        flex-wrap: wrap;
        margin-top: 3rem;
        padding-top: 2rem;
        border-top: 2px solid var(--light);
      }

      .tag {
        background: var(--light);
        padding: 0.5rem 1.2rem;
        border-radius: 30px;
        font-size: 0.9rem;
        color: var(--text-dark);
        text-decoration: none;
        transition: all 0.3s ease;
      }

      .tag:hover {
        background: var(--korean-red);
        color: white;
        transform: translateY(-2px);
      }

      .article-footer {
        max-width: 800px;
        margin: 3rem auto;
        padding: 2rem;
        background: var(--light);
        border-radius: 20px;
        text-align: center;
      }

      .article-footer h3 {
        font-family: "Outfit", "Noto Sans Thai", sans-serif;
        font-size: 1.5rem;
        margin-bottom: 1rem;
      }

      .back-to-articles {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        background: var(--korean-red);
        color: white;
        padding: 1rem 2rem;
        border-radius: 50px;
        text-decoration: none;
        font-weight: 600;
        transition: all 0.3s ease;
        margin-top: 1rem;
      }

      .back-to-articles:hover {
        background: var(--korean-blue);
        transform: translateY(-2px);
      }

      .loading {
        text-align: center;
        padding: 100px 20px;
        font-size: 1.2rem;
        color: var(--text-light);
      }

      @media (max-width: 768px) {
        .article-header {
          padding: 100px 1.5rem 40px;
        }
        .article-image {
          margin-top: 0px;
        }
        .article-body {
          padding: 3rem 1.5rem;
        }
        .article-content {
          font-size: 1.05rem;
        }
        .article-meta {
          gap: 1rem;
        }
      }

      /* Social Share Buttons */
      .social-share {
        margin: 3rem 0;
        padding: 2rem;
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
        border-radius: 20px;
        text-align: center;
      }

      .social-share h3 {
        font-family: "Outfit", "Noto Sans Thai", sans-serif;
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
        color: var(--text);
      }

      .share-buttons {
        display: flex;
        gap: 1rem;
        justify-content: center;
        flex-wrap: wrap;
      }

      .share-btn {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1.5rem;
        border: none;
        border-radius: 50px;
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        color: white;
        font-family: "Noto Sans Thai", sans-serif;
      }

      .share-btn i {
        font-size: 1.1rem;
      }

      .share-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
      }

      .share-btn.facebook { background: #1877f2; }
      .share-btn.facebook:hover { background: #0d65d9; }
      .share-btn.twitter { background: #1da1f2; }
      .share-btn.twitter:hover { background: #0c8bd9; }
      .share-btn.line { background: #06c755; }
      .share-btn.line:hover { background: #05a847; }
      .share-btn.whatsapp { background: #25d366; }
      .share-btn.copy-link { background: #6c757d; }
      .share-btn.copy-link:hover { background: #545b62; }

      .copy-notification {
        position: fixed;
        bottom: 30px;
        right: 30px;
        background: #28a745;
        color: white;
        padding: 1rem 1.5rem;
        border-radius: 50px;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-weight: 600;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        z-index: 10000;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s ease;
      }

      .copy-notification.show {
        opacity: 1;
        transform: translateY(0);
      }

      .copy-notification i {
        font-size: 1.2rem;
      }

      @media (max-width: 768px) {
        .share-buttons {
          flex-direction: column;
          align-items: stretch;
        }
        .share-btn {
          justify-content: center;
        }
        .copy-notification {
          right: 20px;
          left: 20px;
          bottom: 20px;
          justify-content: center;
        }
      }

      /* article page guard */
      #article-container .article-image {
        height: auto;
        overflow: visible;
        background: none;
      }
      #article-container .article-image img {
        height: auto;
        object-fit: initial;
      }
      #article-container .article-content {
        padding: 0;
      }

/* Dark Mode — article pages */
/* ---- Article content (article.js rendered) ---- */
[data-theme="dark"] .article-header {
    background: linear-gradient(135deg, #001f5c 0%, #8b1a22 100%);
}
[data-theme="dark"] .article-body {
    background: var(--warm-white);
}
[data-theme="dark"] .article-content {
    color: var(--text-dark);
}
[data-theme="dark"] .article-content h1,
[data-theme="dark"] .article-content h2,
[data-theme="dark"] .article-content h3,
[data-theme="dark"] .article-content h4 {
    color: #e8e8f4;
}
[data-theme="dark"] .article-content a {
    color: #7aaaee;
}
[data-theme="dark"] .article-content a:hover {
    color: #99ccff;
}
[data-theme="dark"] .article-content table {
    background: #1a1a26;
    border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .article-content thead {
    background: #22223a;
}
[data-theme="dark"] .article-content th,
[data-theme="dark"] .article-content td {
    border-color: rgba(255,255,255,0.08);
    color: var(--text-dark);
}
[data-theme="dark"] .article-content tr:nth-child(even) {
    background: rgba(255,255,255,0.03);
}
[data-theme="dark"] .article-content blockquote {
    background: rgba(0,52,120,0.15);
    border-left-color: #4477bb;
    color: #c0c0dc;
}
[data-theme="dark"] .article-content code {
    background: #22223a;
    color: #e0a0c0;
}
[data-theme="dark"] .article-content pre {
    background: #16161e;
    border-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .article-content hr {
    border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .article-tags .tag {
    background: rgba(255,255,255,0.07);
    color: #aaaacc;
}
[data-theme="dark"] .article-tags .tag:hover {
    background: rgba(0,52,120,0.3);
    color: #88aaee;
}
[data-theme="dark"] .social-share {
    background: #131320;
    border-color: rgba(255,255,255,0.06);
}

/* ---- Related Articles ---- */
[data-theme="dark"] .related-articles {
    border-top-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .related-card {
    background: #1a1a26;
    border-color: rgba(255,255,255,0.06);
}

/* ========================================
   Related Articles
   ======================================== */
.related-articles {
    max-width: 900px;
    margin: 3rem auto 0;
    padding: 2.5rem 2rem 4rem;
    border-top: 1px solid rgba(0,0,0,0.08);
}
.related-articles-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.related-articles-bar {
    display: inline-block;
    width: 4px;
    height: 1.4em;
    background: var(--gradient-korean);
    border-radius: 2px;
    flex-shrink: 0;
}
.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
.related-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}
.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 36px rgba(0,0,0,0.13);
}
.related-card-img {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: linear-gradient(135deg, var(--korean-blue), var(--korean-red));
}
.related-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.related-card:hover .related-card-img img {
    transform: scale(1.06);
}
.related-card-body {
    padding: 1rem 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}
.related-card-cat {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--korean-red);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.related-card-body h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}
.related-card-body p {
    font-size: 0.82rem;
    color: var(--text-light);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    flex: 1;
}
.related-card-time {
    font-size: 0.78rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.2rem;
}
@media (max-width: 768px) {
    .related-articles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .related-card {
        flex-direction: row;
        border-radius: 12px;
    }
    .related-card-img {
        width: 110px;
        min-width: 110px;
        aspect-ratio: unset;
        height: auto;
        border-radius: 0;
    }
    .related-card-body p {
        display: none;
    }
}
@media (min-width: 480px) and (max-width: 768px) {
    .related-articles-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 480px) {
    .related-articles {
        padding: 2rem 1.25rem 3rem;
    }
}

/* Affiliate CTA Box */
.affiliate-cta{background:linear-gradient(135deg,rgba(0,52,120,0.05),rgba(205,46,58,0.04));border:1.5px solid rgba(0,52,120,0.14);border-radius:14px;padding:1.2rem 1.5rem;margin:1.75rem 0;display:flex;align-items:flex-start;gap:1rem}
.affiliate-cta-icon{font-size:1.75rem;flex-shrink:0;line-height:1;margin-top:0.1rem}
.affiliate-cta-body{flex:1;min-width:0}
.affiliate-cta-label{font-size:0.7rem;font-weight:700;color:var(--korean-blue);text-transform:uppercase;letter-spacing:0.6px;margin-bottom:0.3rem;display:block}
.affiliate-cta-body p{font-size:0.95rem;color:var(--text-dark);margin:0 0 0.7rem;line-height:1.55}
.affiliate-cta-btn{display:inline-flex;align-items:center;gap:0.35rem;background:var(--korean-red);color:white;padding:0.5rem 1.2rem;border-radius:50px;text-decoration:none;font-weight:700;font-size:0.88rem;transition:background-color 0.2s ease,transform 0.2s ease;box-shadow:0 3px 10px rgba(205,46,58,0.25)}
.affiliate-cta-btn:hover{background:var(--korean-blue);transform:translateY(-1px);box-shadow:0 5px 16px rgba(0,52,120,0.3)}
.affiliate-inline-btn{display:inline-flex;align-items:center;gap:0.3rem;background:var(--korean-red);color:white;padding:0.38rem 1rem;border-radius:50px;text-decoration:none;font-weight:700;font-size:0.88rem;transition:background-color 0.2s ease,transform 0.2s ease;vertical-align:middle}
.affiliate-inline-btn:hover{background:var(--korean-blue)}
[data-theme="dark"] .affiliate-cta{background:rgba(255,255,255,0.04);border-color:rgba(255,255,255,0.1)}
[data-theme="dark"] .affiliate-cta-body p{color:rgba(255,255,255,0.85)}

/* Last Updated badge */
.article-meta-updated{opacity:0.75;font-size:0.85em}
.article-meta-updated i{font-size:0.8em}

/* Author Box */
.author-box{display:flex;align-items:flex-start;gap:1.25rem;background:var(--warm-white,#faf9f7);border:1px solid rgba(0,0,0,0.07);border-radius:16px;padding:1.5rem;max-width:800px;margin:2rem auto;box-sizing:border-box}
[data-theme="dark"] .author-box{background:rgba(255,255,255,0.04);border-color:rgba(255,255,255,0.1)}
.author-box-avatar{width:80px;height:80px;border-radius:50%;object-fit:cover;flex-shrink:0;border:3px solid var(--korean-blue,#003478)}
.author-box-info{flex:1;min-width:0}
.author-box-label{display:block;font-size:0.72rem;font-weight:700;text-transform:uppercase;letter-spacing:0.8px;color:var(--korean-blue,#003478);margin-bottom:0.2rem;opacity:0.7}
.author-box-name{font-size:1.1rem;font-weight:800;margin:0 0 0.5rem;color:var(--text-dark,#1a1a1a)}
[data-theme="dark"] .author-box-name{color:#fff}
.author-box-bio{font-size:0.9rem;color:var(--text-light,#555);line-height:1.6;margin:0 0 0.75rem}
[data-theme="dark"] .author-box-bio{color:rgba(255,255,255,0.7)}
.author-box-links{display:flex;gap:0.75rem;flex-wrap:wrap}
.author-box-link{display:inline-flex;align-items:center;gap:0.35rem;font-size:0.85rem;font-weight:600;color:var(--korean-blue,#003478);text-decoration:none;padding:0.3rem 0.75rem;border-radius:50px;border:1.5px solid rgba(0,52,120,0.2);transition:all 0.2s}
.author-box-link:hover{background:var(--korean-blue,#003478);color:#fff;border-color:var(--korean-blue,#003478)}
[data-theme="dark"] .author-box-link{color:rgba(255,255,255,0.8);border-color:rgba(255,255,255,0.2)}
[data-theme="dark"] .author-box-link:hover{background:rgba(255,255,255,0.15);color:#fff}
@media(max-width:480px){.author-box{flex-direction:column;align-items:center;text-align:center}.author-box-links{justify-content:center}}

/* App Card — แสดงโลโก้แอปพร้อม store links */
.app-card{display:flex;align-items:center;gap:1rem;background:var(--warm-white,#faf9f7);border:1.5px solid rgba(0,52,120,0.1);border-radius:14px;padding:1rem 1.25rem;margin:1rem 0 1.5rem}
[data-theme="dark"] .app-card{background:rgba(255,255,255,0.04);border-color:rgba(255,255,255,0.1)}
.app-icon{width:56px;height:56px;border-radius:14px;object-fit:cover;flex-shrink:0;box-shadow:0 2px 8px rgba(0,0,0,0.12)}
.app-card-body{flex:1;min-width:0}
.app-card-header{display:flex;align-items:center;gap:0.6rem;flex-wrap:wrap;margin-bottom:0.5rem}
.app-card-name{font-size:1rem;font-weight:700;color:var(--text-dark,#1a1a1a)}
[data-theme="dark"] .app-card-name{color:#e8e8f4}
.badge-before-flight{background:#e8f5e9;color:#2e7d32;padding:2px 10px;border-radius:30px;font-size:0.78em;font-weight:700;white-space:nowrap}
.badge-on-arrival{background:#fff8e1;color:#f57f17;padding:2px 10px;border-radius:30px;font-size:0.78em;font-weight:700;white-space:nowrap}
.badge-urgent{background:#fce4ec;color:#c62828;padding:2px 10px;border-radius:30px;font-size:0.78em;font-weight:700;white-space:nowrap}
.app-store-links{display:flex;gap:0.5rem;flex-wrap:wrap}
.store-btn{display:inline-flex;align-items:center;gap:0.3rem;padding:0.3rem 0.85rem;border-radius:50px;font-size:0.8rem;font-weight:600;text-decoration:none;transition:all 0.2s;border:1.5px solid}
.store-btn.ios{background:#000;color:#fff;border-color:#000}
.store-btn.ios:hover{background:#333;border-color:#333}
.store-btn.android{background:#fff;color:#01875f;border-color:#01875f}
.store-btn.android:hover{background:#01875f;color:#fff}
[data-theme="dark"] .store-btn.android{background:rgba(1,135,95,0.15);color:#4caf8a;border-color:#4caf8a}
[data-theme="dark"] .store-btn.android:hover{background:rgba(1,135,95,0.35);color:#fff}
@media(max-width:480px){.app-card{flex-wrap:nowrap;gap:0.75rem}.app-icon{width:48px;height:48px}}

/* Ad Slot Placeholders */
.ad-slot{position:relative;border:2px dashed rgba(0,52,120,0.28);border-radius:14px;background:linear-gradient(135deg,rgba(0,52,120,0.03),rgba(0,52,120,0.015));display:flex;align-items:center;justify-content:center;text-align:center;gap:0.75rem;padding:1rem 1.5rem;flex-wrap:wrap}
.ad-slot--leaderboard{max-width:728px;min-height:90px;margin:2rem auto}
.ad-slot--rectangle{width:300px;min-height:220px;float:right;margin:0.25rem 0 1.25rem 2rem;flex-direction:column;gap:0.5rem}
.ad-slot-badge{font-size:0.62rem;font-weight:800;text-transform:uppercase;letter-spacing:0.7px;color:#fff;background:var(--korean-blue);padding:0.2rem 0.6rem;border-radius:4px;white-space:nowrap}
.ad-slot-name{font-weight:700;font-size:0.9rem;color:var(--korean-blue)}
.ad-slot-size{font-size:0.75rem;color:var(--text-light)}
.ad-slot-link{font-size:0.75rem;font-weight:700;color:var(--korean-red);text-decoration:none;white-space:nowrap;border:1px solid rgba(205,46,58,0.35);padding:0.25rem 0.75rem;border-radius:50px}
.ad-slot-link:hover{background:var(--korean-red);color:#fff}
[data-theme="dark"] .ad-slot{border-color:rgba(255,255,255,0.18);background:rgba(255,255,255,0.03)}
[data-theme="dark"] .ad-slot-name{color:rgba(255,255,255,0.85)}
@media(max-width:640px){.ad-slot--rectangle{float:none;width:100%;min-height:100px;margin:1.25rem 0;flex-direction:row}}
