/* ═══════════════════════════════════════════════════════════════════
   post_detail.css  —  Post detail page: blocks, interactions, comments
   โหลดเฉพาะ /{lang}/posts/{slug}
   ขึ้นอยู่กับ tokens.css, jertam.css, post.css
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. Skeleton shimmer (YouTube-style) ─────────────────────────── */
@keyframes jt-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

.jt-skel-wrapper {
    padding: 8px 0;
}

.jt-skel {
    background: linear-gradient(
        90deg,
        var(--jt-line) 25%,
        var(--jt-cream) 50%,
        var(--jt-line) 75%
    );
    background-size: 1200px 100%;
    animation: jt-shimmer 1.6s infinite linear;
    border-radius: 6px;
}

/* ── 2. Block: SUB_TITLE ─────────────────────────────────────────── */
.jt-block-subtitle {
    font-family: var(--jt-font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--jt-ink);
    margin: 2.5rem 0 1.25rem;
    padding-left: 16px;
    line-height: 1.25;
    position: relative;
}
.jt-block-subtitle::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 5px;
    border-radius: var(--jt-r-pill);
    background: var(--jt-grad-sun);
}

/* ── 3. Block: PARAGRAPH ────────────────────────────────────────── */
.jt-block-paragraph {
    font-size: 1.03rem;
    line-height: 1.85;
    color: var(--jt-ink-2);
    margin-bottom: 1.75rem;
}
.jt-rich-text h1, .jt-rich-text h2, .jt-rich-text h3 {
    font-family: var(--jt-font-display);
    font-weight: 700;
    color: var(--jt-ink);
    margin-top: 1.5rem;
    margin-bottom: .75rem;
}
.jt-rich-text p   { margin-bottom: 1.25rem; }
.jt-rich-text a   { color: var(--jt-orange-600); }
.jt-rich-text img { max-width: 100%; border-radius: var(--jt-r-md); }
.jt-rich-text ul,
.jt-rich-text ol  { padding-left: 1.5rem; margin-bottom: 1.25rem; }

/* ── 4. Block: PARTITION ────────────────────────────────────────── */
.jt-block-partition {
    border: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        rgba(245,130,32,0) 0%,
        var(--jt-orange-300) 50%,
        rgba(245,130,32,0) 100%
    );
    margin: 3rem 0;
    opacity: .8;
}

/* ── 5. Block: IMG ──────────────────────────────────────────────── */
.jt-block-img-wrapper {
    border-radius: var(--jt-r-lg);
    overflow: hidden;
    margin: 2.25rem 0;
    box-shadow: var(--jt-shadow-md);
    border: 1px solid var(--jt-line);
}
.jt-block-img-wrapper img {
    display: block;
    width: 100%;
    height: auto;
}
.jt-block-img-caption {
    font-size: .84rem;
    color: var(--jt-muted);
    text-align: center;
    padding: 10px 16px;
    background: var(--jt-cream);
    font-style: italic;
}

/* ── 6. Block: GALLERY (Facebook-style) ─────────────────────────── */
.jt-block-gallery {
    margin: 2.25rem 0;
    border-radius: var(--jt-r-lg);
    overflow: hidden;
}

/* ── 1 image: landscape banner ── */
.jt-block-gallery--1 { display: grid; grid-template-columns: 1fr; }
.jt-block-gallery--1 .jt-gallery-tile { aspect-ratio: 16 / 9; max-height: 480px; }

/* ── 2 images: side-by-side ── */
.jt-block-gallery--2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
}
.jt-block-gallery--2 .jt-gallery-tile { aspect-ratio: 1 / 1; }

/* ── 3 images: left tall + right stacked ── */
.jt-block-gallery--3 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 210px 210px;
    gap: 3px;
}
.jt-block-gallery--3 .jt-gallery-tile:first-child { grid-row: 1 / 3; }

/* ── 4+ images: 2 × 2 ── */
.jt-block-gallery--4plus {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 3px;
    aspect-ratio: 4 / 3;
    max-height: 480px;
}

@media (max-width: 576px) {
    .jt-block-gallery--3  { grid-template-rows: 145px 145px; }
    .jt-block-gallery--4plus { max-height: 300px; }
    .jt-block-gallery--1 .jt-gallery-tile { max-height: 260px; }
}

/* ── Tile base ── */
.jt-gallery-tile {
    position: relative;
    overflow: hidden;
    background: var(--jt-cream);
    padding: 0;
    border: none;
    display: block;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
}
.jt-gallery-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s cubic-bezier(.165,.84,.44,1);
}
.jt-gallery-tile:hover img,
.jt-gallery-tile:focus-visible img { transform: scale(1.06); }
.jt-gallery-tile:focus-visible {
    outline: 3px solid var(--jt-orange-500);
    outline-offset: -3px;
    position: relative;
    z-index: 1;
}

/* ── "+N" overflow tile ── */
.jt-gallery-tile--more::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    transition: background .2s;
    pointer-events: none;
}
.jt-gallery-tile--more:hover::after { background: rgba(0, 0, 0, .42); }
.jt-gallery-more {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 800;
    font-family: var(--jt-font-display);
    letter-spacing: -.02em;
    pointer-events: none;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .5);
}

/* ══════════════════════════════════════════════════════════════════════
   Gallery Lightbox
   WCAG 2.2 AA checklist:
   · 1.4.11 Non-text contrast: button borders rgba(255,255,255,.50)
     over #0d0d0d backdrop ≈ #868686 → ratio 5.5:1  ✅ (req. 3:1)
   · 1.4.3  Text contrast: white counter text on dark pill ≈ 15:1 ✅
   · 2.4.11 Focus appearance: 3px solid #fff, offset 3px ✅
   · 2.5.8  Target size: 44×44 px minimum on all interactive items ✅
   ══════════════════════════════════════════════════════════════════════ */

/* Outer shell — flex column so stage sits between topbar and thumb strip */
.jt-lb {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 0 96px; /* reserve space for topbar + thumb strip */
    visibility: hidden;
    opacity: 0;
    transition: opacity .24s ease, visibility 0s linear .24s;
    outline: none;
}
.jt-lb.is-open {
    visibility: visible;
    opacity: 1;
    transition: opacity .24s ease, visibility 0s;
}

/* Backdrop */
.jt-lb__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .92);
}

/* ── Top bar: counter (left) + close (right) ─────────────────────── */
.jt-lb__topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    /* gradient so close button is always readable */
    background: linear-gradient(rgba(0,0,0,.55) 0%, transparent 100%);
    pointer-events: none; /* let backdrop receive clicks in empty space */
}
.jt-lb__topbar > * { pointer-events: auto; }

/* Counter — inline pill in topbar */
.jt-lb__counter {
    color: rgba(255, 255, 255, .95);
    font-size: .84rem;
    font-weight: 700;
    letter-spacing: .06em;
    background: rgba(0, 0, 0, .55);
    padding: 5px 16px;
    border-radius: 20px;
    border: 1.5px solid rgba(255, 255, 255, .50); /* 5.5:1 vs #0d0d0d ✅ */
    backdrop-filter: blur(4px);
    white-space: nowrap;
    user-select: none;
}

/* Close button — 44×44 min */
.jt-lb__close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    border: 2px solid rgba(255, 255, 255, .50); /* 5.5:1 ✅ */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    padding: 0;
    transition: background .18s, border-color .18s, transform .18s;
    backdrop-filter: blur(6px);
}
.jt-lb__close svg { width: 20px; height: 20px; }
.jt-lb__close:hover {
    background: rgba(0, 0, 0, .78);
    border-color: rgba(255, 255, 255, .88);
    transform: scale(1.08);
}
.jt-lb__close:focus-visible {
    outline: 3px solid #ffffff; /* white on dark: ~15:1 ✅ */
    outline-offset: 3px;
}

/* ── Stage (image + caption) ─────────────────────────────────────── */
.jt-lb__stage {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: min(90vw, 1200px);
    max-height: calc(100vh - 56px - 96px);
    pointer-events: none; /* clicks fall through to backdrop */
}
.jt-lb__img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 56px - 96px - 12px);
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 48px rgba(0, 0, 0, .55);
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    transition: opacity .16s ease;
    pointer-events: auto;
}
.jt-lb__caption {
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-size: .82rem;
    font-style: italic;
    text-align: center;
    padding: 0 20px;
    max-width: 600px;
    line-height: 1.5;
}

/* ── Nav arrows — 44×44 min target ──────────────────────────────── */
.jt-lb__nav {
    position: absolute;
    /* sit in the image area, not the topbar/thumb zones */
    top: calc(50% + 28px);  /* +28px ≈ offset below topbar midpoint */
    transform: translateY(-50%);
    z-index: 3;
    width: 48px;
    height: 48px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    border: 2px solid rgba(255, 255, 255, .50); /* 5.5:1 ✅ */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    padding: 0;
    transition: background .18s, border-color .18s, transform .22s, opacity .18s;
    backdrop-filter: blur(6px);
}
.jt-lb__nav svg { width: 22px; height: 22px; }
.jt-lb__nav--prev { left: 16px; }
.jt-lb__nav--next { right: 16px; }
.jt-lb__nav:hover {
    background: rgba(0, 0, 0, .78);
    border-color: rgba(255, 255, 255, .88);
    transform: translateY(-50%) scale(1.1);
}
.jt-lb__nav:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}
.jt-lb__nav--hidden { opacity: 0; pointer-events: none; }

/* ── Thumbnail strip ─────────────────────────────────────────────── */
.jt-lb__thumbs {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px 14px;
    background: linear-gradient(transparent 0%, rgba(0,0,0,.70) 30%, rgba(0,0,0,.88) 100%);
    overflow-x: auto;
    scroll-behavior: smooth;
    /* Thin unobtrusive scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.28) transparent;
}
.jt-lb__thumbs::-webkit-scrollbar       { height: 3px; }
.jt-lb__thumbs::-webkit-scrollbar-track { background: transparent; }
.jt-lb__thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); border-radius: 2px; }

/* Thumbnail button — 60×60 image inside 44px+ touch area */
.jt-lb__thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: rgba(255,255,255,.08);
    /* Inactive ring — rgba(255,255,255,.40) → ~#666 → 3.7:1 vs #0d0d0d ✅ */
    border: 2.5px solid rgba(255, 255, 255, .40);
    opacity: 0.58;
    transition: opacity .18s, border-color .18s, transform .18s, box-shadow .18s;
}
.jt-lb__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}
.jt-lb__thumb:hover {
    opacity: 0.88;
    border-color: rgba(255, 255, 255, .78);
    transform: scale(1.06);
}
/* Active: full opacity + white border (far exceeds 3:1) */
.jt-lb__thumb.is-active {
    opacity: 1;
    border: 3px solid #ffffff;
    transform: scale(1.10);
    box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .7);
}
.jt-lb__thumb:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
    opacity: 1;
}

/* Scroll lock */
.jt-noscroll { overflow: hidden; }

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .jt-lb { padding: 50px 0 86px; }
    .jt-lb__nav--prev { left: 6px; }
    .jt-lb__nav--next { right: 6px; }
    .jt-lb__nav { width: 44px; height: 44px; }
    .jt-lb__nav svg { width: 18px; height: 18px; }
    .jt-lb__thumb { width: 52px; height: 52px; }
    .jt-lb__topbar { padding: 8px 10px; }
}

/* ── 7. Block: HASHTAG ──────────────────────────────────────────── */
.jt-block-hashtag {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 1.5rem 0;
}
.jt-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: var(--jt-r-pill);
    background: var(--jt-orange-50);
    color: var(--jt-orange-700);
    font-family: var(--jt-font-mono);
    font-size: .875rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.jt-tag:hover {
    background: var(--jt-orange-100);
    color: var(--jt-orange-900);
    text-decoration: none;
}

/* ── 8. Block: PLACE ────────────────────────────────────────────── */
.jt-block-place {
    background: #fff;
    border: 1px solid var(--jt-line);
    border-radius: var(--jt-r-lg);
    overflow: hidden;
    margin: 2.25rem 0;
    box-shadow: var(--jt-shadow-sm);
}
.jt-block-place__map {
    height: 220px;
    background: var(--jt-cream);
    position: relative;
    overflow: hidden;
}
.jt-block-place__map iframe {
    display: block;
}
.jt-block-place__no-map {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--jt-muted);
    font-size: .85rem;
}
.jt-block-place__info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 20px;
}
.jt-block-place__name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--jt-ink);
}
.jt-block-place__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .84rem;
    font-weight: 600;
    color: var(--jt-orange-600);
    text-decoration: none;
    white-space: nowrap;
}
.jt-block-place__link:hover { color: var(--jt-orange-700); text-decoration: underline; }

/* ── 9. Block: CLIP ─────────────────────────────────────────────── */
.jt-block-clip {
    margin: 2.25rem 0;
    border-radius: var(--jt-r-lg);
    overflow: hidden;
    box-shadow: var(--jt-shadow-md);
}
.jt-block-clip__wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}
.jt-block-clip__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── 10. Block: CLIPJT ──────────────────────────────────────────── */
.jt-block-clipjt {
    border-radius: var(--jt-r-lg);
    overflow: hidden;
    background: #000;
    margin: 2.25rem 0;
    box-shadow: var(--jt-shadow-md);
}
.jt-clipjt-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    cursor: pointer;
}
.jt-clipjt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.jt-clipjt-thumb:hover img { transform: scale(1.04); }

.jt-clipjt-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.28);
    border: 0;
    cursor: pointer;
    transition: background .2s;
}
.jt-clipjt-play:hover { background: rgba(0,0,0,.42); }
.jt-clipjt-play svg {
    width: 60px;
    height: 60px;
    background: var(--jt-orange-500);
    border-radius: 50%;
    padding: 14px;
    box-shadow: var(--jt-shadow-glow-orange);
    transition: transform .2s;
}
.jt-clipjt-play:hover svg { transform: scale(1.08); }

.jt-clipjt-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 14px;
    background: linear-gradient(to top, rgba(0,0,0,.65), transparent);
    color: #fff;
    font-family: var(--jt-font-mono);
    font-size: .75rem;
}
/* ── Player wrapper ── */
.jt-clipjt-player {
    position: relative;
    background: #000;
    border-radius: var(--jt-r-lg);
    overflow: hidden;
    line-height: 0;        /* collapse inline-block gap under <video> */
}

.jt-clipjt-video {
    display: block;
    width: 100%;
    height: auto;
    cursor: pointer;
    background: #000;
}

/* ── Custom controls overlay ── */
.jt-clipjt-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 22px 12px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,.72));
    border-radius: 0 0 var(--jt-r-lg) var(--jt-r-lg);
    opacity: 0;
    transition: opacity .22s ease;
    pointer-events: none;
}

/* Visible on hover OR when paused/ended */
.jt-clipjt-player:hover .jt-clipjt-controls,
.jt-clipjt--paused      .jt-clipjt-controls {
    opacity: 1;
    pointer-events: auto;
}

/* ── Icon buttons ── */
.jt-clipjt-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    line-height: 0;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.6));
    transition: transform .15s;
}
.jt-clipjt-btn:hover { transform: scale(1.15); }
/* width/height only — NO display:block here (would beat the hide rules below) */
.jt-clipjt-btn svg   { width: 20px; height: 20px; }

/* ── Play icon: paused = show ▶, playing = show ⏸
     Specificity must beat .jt-clipjt-btn svg (0,1,1) → use (0,2,0) ── */
.jt-clipjt-btn .jt-icon-play  { display: block; }
.jt-clipjt-btn .jt-icon-pause { display: none;  }

.jt-clipjt--playing .jt-clipjt-btn .jt-icon-play  { display: none;  }
.jt-clipjt--playing .jt-clipjt-btn .jt-icon-pause { display: block; }

/* ── Sound icon: unmuted = show 🔊, muted = show 🔇 ── */
.jt-clipjt-btn .jt-icon-sound { display: block; }
.jt-clipjt-btn .jt-icon-muted { display: none;  }

.jt-clipjt--muted .jt-clipjt-btn .jt-icon-sound { display: none;  }
.jt-clipjt--muted .jt-clipjt-btn .jt-icon-muted { display: block; }

/* ── Progress bar ── */
.jt-clipjt-progress {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,.3);
    border-radius: 2px;
    overflow: hidden;
}
.jt-clipjt-progress__fill {
    height: 100%;
    width: 0;
    background: var(--jt-orange-400, #f97316);
    border-radius: 2px;
    transition: width .25s linear;
}

/* ── Orientation classes (set by JS loadedmetadata) ── */
.jt-block-clipjt--landscape .jt-clipjt-video {
    max-height: 540px;
    object-fit: contain;
}
.jt-block-clipjt--portrait .jt-clipjt-player {
    max-width: min(360px, 100%);
    margin-inline: auto;
}
.jt-block-clipjt--portrait .jt-clipjt-video {
    max-height: 640px;
}

/* ── 11. Block: CROSS_CONTENT ───────────────────────────────────── */
.jt-block-cross {
    border-left: 5px solid var(--jt-green-300);
    background: var(--jt-cream);
    border-radius: 0 var(--jt-r-md) var(--jt-r-md) 0;
    padding: 16px 20px;
    margin: 2.25rem 0;
    box-shadow: var(--jt-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.jt-block-cross__label {
    font-family: var(--jt-font-mono);
    font-size: .75rem;
    font-weight: 700;
    color: var(--jt-green-600);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.jt-block-cross__card {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--jt-ink);
    transition: color .15s;
}
.jt-block-cross__card:hover { color: var(--jt-orange-600); text-decoration: none; }
.jt-block-cross__card img {
    width: 56px;
    height: 56px;
    border-radius: var(--jt-r-sm);
    object-fit: cover;
    flex-shrink: 0;
}
.jt-block-cross__title {
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.4;
}

/* ── 12. Block: BOOK_TRANSPORT ──────────────────────────────────── */
.jt-block-transport {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: linear-gradient(135deg, #1A2B1F 0%, #111D15 100%);
    border-radius: var(--jt-r-lg);
    padding: 24px 28px;
    margin: 2.25rem 0;
    color: #fff;
    box-shadow: var(--jt-shadow-lg);
    position: relative;
    overflow: hidden;
}
.jt-block-transport::after {
    content: '';
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--jt-orange-500);
    opacity: .12;
    filter: blur(20px);
    pointer-events: none;
}
.jt-block-transport__logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--jt-r-sm);
    background: rgba(255,255,255,.12);
    flex-shrink: 0;
}
.jt-block-transport__body { flex: 1; min-width: 0; }
.jt-block-transport__name {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}
.jt-block-transport__route {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    color: rgba(255,255,255,.75);
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.jt-block-transport__arrow { color: var(--jt-orange-300); font-weight: 700; }

/* shared caption */
.jt-block-caption {
    display: block;
    font-size: .84rem;
    color: var(--jt-muted);
    text-align: center;
    margin-top: 8px;
    font-style: italic;
}

/* ── 13. Inline interaction buttons ──────────────────────────────── */
.jt-pd-interact-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.jt-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--jt-line);
    border-radius: var(--jt-r-pill);
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(4px);
    color: var(--jt-ink-2);
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
.jt-inline-btn:hover,
.jt-inline-btn:focus-visible {
    background: var(--jt-cream);
    border-color: var(--jt-orange-300);
    color: var(--jt-ink);
    outline: none;
}
.jt-inline-btn--lg { padding: 8px 18px; font-size: .9rem; }

/* Like count — คลิกเพื่อดูรายชื่อคนที่กดถูกใจ */
.jt-pd-like-count { cursor: pointer; border-radius: 4px; padding: 1px 2px; }
.jt-pd-like-count:hover { text-decoration: underline; }

/* Active states per type */
.jt-inline-btn.is-active[data-type="like"]     { background: #FFF5F5; border-color: #FEB2B2; color: #E53E3E; }
.jt-inline-btn.is-active[data-type="love"]     { background: #FFF5F7; border-color: #FBB6CE; color: #D53F8C; }
.jt-inline-btn.is-active[data-type="bookmark"] { background: var(--jt-orange-50); border-color: var(--jt-orange-300); color: var(--jt-orange-700); }

/* Active reaction — ปุ่ม react ใช้ data-action (ไม่ใช่ data-type) → ใส่ is-active แล้วเปลี่ยนสี+เติม svg */
.jt-inline-btn.jt-react-btn.is-active[data-action="like"]         { background: #FFF5F5; border-color: #FEB2B2; color: #E53E3E; }
.jt-inline-btn.jt-react-btn.is-active[data-action="like"] svg     { fill: #E53E3E; stroke: #E53E3E; }
.jt-inline-btn.jt-react-btn.is-active[data-action="bookmark"]     { background: var(--jt-orange-50); border-color: var(--jt-orange-300); color: var(--jt-orange-700); }
.jt-inline-btn.jt-react-btn.is-active[data-action="bookmark"] svg { fill: var(--jt-orange-200, #fed7aa); stroke: var(--jt-orange-700); }

/* Hero area — force white on dark cover */
.jt-post-hero--has-cover .jt-inline-btn {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.35);
    color: #fff;
}
.jt-post-hero--has-cover .jt-inline-btn:hover {
    background: rgba(255,255,255,.32);
    border-color: rgba(255,255,255,.6);
    color: #fff;
}

/* ── 14. Bottom interaction panel ───────────────────────────────── */
.jt-pd-panel {
    background: #fff;
    border: 1px solid var(--jt-line);
    border-radius: var(--jt-r-lg);
    padding: 24px;
    margin: 2.5rem 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--jt-shadow-sm);
}
.jt-pd-panel__text strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--jt-ink);
    margin-bottom: 2px;
}
.jt-pd-panel__text p {
    font-size: .84rem;
    color: var(--jt-muted);
    margin: 0;
}
@media (max-width: 576px) {
    .jt-pd-panel { flex-direction: column; align-items: flex-start; }
}

/* ── 15. Comments ────────────────────────────────────────────────── */
.jt-pd-comments {
    background: #fff;
    border: 1px solid var(--jt-line);
    border-radius: var(--jt-r-lg);
    padding: 28px 32px;
    box-shadow: var(--jt-shadow-sm);
    margin-bottom: 40px;
}
.jt-pd-comments__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--jt-ink);
    margin-bottom: 24px;
}
.jt-pd-comments__empty { padding: 16px 0; }
.jt-pd-comments__count {
    font-size: .9rem; font-weight: 600; color: var(--jt-muted);
    margin-left: 6px;
}
/* Avatar รองรับรูปจริง (ถ้าไม่มีรูป จะ fallback เป็นตัวอักษร/SVG ผ่าน data-jt-avatar) */
.jt-comment-avatar { text-decoration: none; }
.jt-comment-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jt-comment-time { color: var(--jt-muted); }
/* ชื่อผู้คอมเมนต์เป็นลิงก์ไปโปรไฟล์ */
a.jt-comment-author { text-decoration: none; }
a.jt-comment-author:hover { text-decoration: underline; }

/* Comment thread */
.jt-comment-thread {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}
.jt-comment-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.jt-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--jt-orange-500);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.jt-comment-body { flex: 1; min-width: 0; }
.jt-comment-bubble {
    display: inline-block;
    max-width: 100%;
    background: var(--jt-paper);
    border: 1px solid rgba(26,43,31,.05);
    border-radius: 18px;
    padding: 12px 18px;
    box-shadow: var(--jt-shadow-sm);
}
.jt-comment-author {
    font-size: .875rem;
    font-weight: 700;
    color: var(--jt-ink);
    margin-bottom: 3px;
}
.jt-comment-text {
    font-size: .94rem;
    line-height: 1.55;
    color: var(--jt-ink-2);
    white-space: pre-wrap;
    word-break: break-word;
}
.jt-comment-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 7px;
    padding-left: 8px;
    font-size: .8rem;
    color: var(--jt-muted);
}
.jt-comment-reply-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--jt-muted);
    font-size: .8rem;
    font-weight: 600;
    padding: 0;
    transition: color .15s;
}
.jt-comment-reply-btn:hover { color: var(--jt-orange-600); }

/* Nested replies */
.jt-comment-replies {
    margin-top: 14px;
    margin-left: 54px;
    border-left: 2px solid var(--jt-line);
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Comment form */
.jt-reply-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .84rem;
    color: var(--jt-orange-700);
    background: var(--jt-orange-50);
    border-radius: var(--jt-r-sm);
    padding: 6px 12px;
    margin-bottom: 10px;
    width: fit-content;
}
.jt-reply-cancel {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--jt-muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 2px;
    transition: color .15s;
}
.jt-reply-cancel:hover { color: var(--jt-orange-600); }
.jt-comment-form { border-top: 1px solid var(--jt-line); padding-top: 20px; }
.jt-comment-form__row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.jt-comment-input {
    flex: 1;
    height: 44px;
    border: 1.5px solid var(--jt-line);
    border-radius: var(--jt-r-md);
    padding: 0 14px;
    font-size: .94rem;
    background: var(--jt-paper);
    color: var(--jt-ink);
    transition: border-color .2s, box-shadow .2s;
}
.jt-comment-input:focus {
    outline: none;
    border-color: var(--jt-orange-500);
    box-shadow: 0 0 0 4px rgba(245,130,32,.1);
    background: #fff;
}

/* ── 16. Toast notification ──────────────────────────────────────── */
.jt-toast-container {
    position: fixed;
    bottom: 28px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.jt-toast {
    background: var(--jt-ink);
    color: #fff;
    padding: 12px 22px;
    border-radius: var(--jt-r-md);
    box-shadow: var(--jt-shadow-lg);
    font-size: .9rem;
    font-weight: 500;
    transform: translateY(20px);
    opacity: 0;
    transition: transform .3s cubic-bezier(.175,.885,.32,1.275), opacity .3s ease;
    max-width: 320px;
}
.jt-toast.show {
    transform: translateY(0);
    opacity: 1;
}
.jt-toast--warn {
    background: #c0392b;
}
@media (max-width: 576px) {
    .jt-toast-container { right: 12px; left: 12px; }
    .jt-toast { max-width: 100%; }
}
