/* ==========================================================================
   Rawrkee Posts Feed & Single Post (Reddit / 9GAG-inspired, Light & Dark)
   ========================================================================== */

.rk-posts-section,
.rk-posts-page {
    --rkp-bg: #eef2f6;
    --rkp-surface: #ffffff;
    --rkp-surface-alt: #f8fafc;
    --rkp-ink: #0f172a;
    --rkp-muted: #475569;
    --rkp-line: #cbd5e1;
    --rkp-pill: #e2e8f0;
    --rkp-pill-hover: #cbd5e1;
    --rkp-accent: rgb(var(--rk-accent-600, 220 38 38));
    --rkp-accent-soft: rgb(var(--rk-accent-600, 220 38 38) / 0.12);
    --rkp-accent-ink: #ffffff;

    background: var(--rkp-bg);
    color: var(--rkp-ink);
    font-family: var(--rk-font, "Plus Jakarta Sans", system-ui, sans-serif);
    -webkit-font-smoothing: antialiased;
}

html.dark .rk-posts-section,
html.dark .rk-posts-page {
    --rkp-bg: #09090b;
    --rkp-surface: #18181b;
    --rkp-surface-alt: #1e1e22;
    --rkp-ink: #f4f4f5;
    --rkp-muted: #a1a1aa;
    --rkp-line: #27272a;
    --rkp-pill: #27272a;
    --rkp-pill-hover: #3f3f46;
    --rkp-accent-soft: rgb(var(--rk-accent-500, 239 68 68) / 0.16);
}

.rk-posts-section *,
.rk-posts-section *::before,
.rk-posts-section *::after,
.rk-posts-page *,
.rk-posts-page *::before,
.rk-posts-page *::after {
    box-sizing: border-box;
}

.rk-posts-container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 28px 14px 48px;
}

.rk-posts-container.is-article {
    max-width: 760px;
}

/* Section / Archive Header */
.rk-posts-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.rk-posts-heading {
    margin: 0;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--rkp-ink);
    line-height: 1.2;
}

.rk-posts-sub {
    margin: 4px 0 0;
    font-size: 0.92rem;
    color: var(--rkp-muted);
}

.rk-posts-all-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--rkp-accent);
    text-decoration: none;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--rkp-surface);
    border: 1px solid var(--rkp-line);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.rk-posts-all-link:hover {
    border-color: var(--rkp-accent);
    color: var(--rkp-accent);
}

/* Filter & Search Bar on /posts/ */
.rk-posts-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.rk-posts-cats {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.rk-posts-cats::-webkit-scrollbar {
    display: none;
}

.rk-cat-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    background: var(--rkp-surface);
    color: var(--rkp-muted);
    border: 1px solid var(--rkp-line);
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rk-cat-pill:hover {
    background: var(--rkp-pill-hover);
    color: var(--rkp-ink);
}

.rk-cat-pill.is-active {
    background: var(--rkp-ink);
    border-color: var(--rkp-ink);
    color: var(--rkp-surface);
}

.rk-posts-search {
    display: flex;
    gap: 8px;
}

.rk-posts-search input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--rkp-line);
    background: var(--rkp-surface);
    color: var(--rkp-ink);
    font-size: 0.9rem;
    outline: none;
}

.rk-posts-search input[type="search"]:focus {
    border-color: var(--rkp-accent);
}

.rk-posts-search button {
    height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--rkp-line);
    background: var(--rkp-surface);
    color: var(--rkp-ink);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.rk-posts-search button:hover {
    border-color: var(--rkp-accent);
}

/* Vertical Reddit / 9GAG Feed Stack */
.rk-feed-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rk-post-card {
    background: var(--rkp-surface);
    border: 1px solid var(--rkp-line);
    border-radius: 14px;
    overflow: hidden;
    overflow: clip;
    transition: border-color 0.15s ease;
}

.rk-post-card:hover {
    border-color: rgb(var(--rk-accent-500, 239 68 68) / 0.45);
}

.rk-post-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px 8px;
}

.rk-post-author {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 0.84rem;
    color: var(--rkp-muted);
}

.rk-post-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--rkp-pill);
}

.rk-post-author-name {
    font-weight: 700;
    color: var(--rkp-ink);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.rk-post-author-name:hover {
    color: var(--rkp-accent);
}

.rk-post-dot {
    opacity: 0.6;
}

.rk-post-time {
    white-space: nowrap;
}

.rk-post-cat {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    text-decoration: none;
    background: var(--rkp-pill);
    color: var(--rkp-ink);
    white-space: nowrap;
    flex-shrink: 0;
}

.rk-post-cat:hover {
    background: var(--rkp-pill-hover);
    color: var(--rkp-accent);
}

.rk-post-card-body {
    padding: 0 16px 10px;
}

.rk-post-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.015em;
}

.rk-post-title a {
    color: var(--rkp-ink);
    text-decoration: none;
}

.rk-post-title a:hover {
    color: var(--rkp-accent);
}

.rk-post-excerpt {
    margin: 6px 0 0;
    font-size: 0.96rem;
    line-height: 1.55;
    color: var(--rkp-ink);
    opacity: 0.88;
}

.rk-see-more-btn {
    background: none;
    border: 0;
    padding: 0;
    margin-left: 4px;
    color: var(--rkp-accent);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    vertical-align: baseline;
}

.rk-see-more-btn:hover {
    text-decoration: underline;
}

.rk-see-less-dock {
    position: sticky;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    z-index: 20;
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    pointer-events: none;
}

@media (min-width: 768px) {
    .rk-see-less-dock {
        bottom: 20px;
    }
}

.rk-see-less-btn {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--rkp-line);
    background: var(--rkp-surface);
    color: var(--rkp-ink);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.rk-see-less-btn:hover {
    border-color: var(--rkp-accent);
    color: var(--rkp-accent);
}

.rk-post-full-body {
    margin-top: 8px;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1.58;
    color: var(--rkp-ink);
}

.rk-post-full-body[hidden],
.rk-post-preview[hidden] {
    display: none;
}

.rk-post-media {
    display: block;
    background: #09090b;
    border-top: 1px solid var(--rkp-line);
    border-bottom: 1px solid var(--rkp-line);
    overflow: hidden;
}

.rk-post-media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 580px;
    object-fit: cover;
}

/* Lite YouTube Click-to-Play Facade */
.rk-yt-facade {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000000;
    cursor: pointer;
}

.rk-yt-facade.is-yt-short {
    aspect-ratio: 9 / 16;
    max-width: 390px;
    margin: 0 auto;
    border-radius: 12px;
    border: 1px solid var(--rkp-line);
}

@media (max-width: 639px) {
    .rk-yt-facade.is-yt-short {
        max-width: 100%;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
}

.rk-post-card.is-video-compact .rk-post-media.is-yt-short {
    max-width: none;
    border-radius: 12px;
    border: 1px solid var(--rkp-line);
}

.rk-yt-facade img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.rk-yt-facade:hover img {
    filter: brightness(0.88);
}

.rk-yt-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(9, 9, 11, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    pointer-events: none;
    backdrop-filter: blur(6px);
}

.rk-yt-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 68px;
    height: 48px;
    border: 0;
    border-radius: 14px;
    background: rgba(15, 15, 18, 0.86);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.rk-yt-facade:hover .rk-yt-play-btn,
.rk-yt-play-btn:focus-visible {
    background: var(--rk-crimson, #e11d48);
    transform: translate(-50%, -50%) scale(1.06);
}

.rk-yt-facade.is-playing {
    cursor: default;
}

.rk-yt-facade iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Side-by-Side Shorts-Style Video Grid (/category/videos/) */
.rk-posts-container.is-video-archive {
    max-width: 860px;
}

.rk-video-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (min-width: 640px) {
    .rk-video-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }
}

.rk-post-card.is-video-compact {
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
}

.rk-post-card.is-video-compact .rk-post-media {
    aspect-ratio: 9 / 16;
    border: 1px solid var(--rkp-line);
    border-radius: 12px;
}

.rk-post-card.is-video-compact .rk-post-media img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
}

.rk-post-card.is-video-compact .rk-yt-play-btn {
    width: 50px;
    height: 36px;
    border-radius: 10px;
}

.rk-video-compact-meta {
    padding: 8px 2px 2px;
}

.rk-video-compact-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.32;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rk-video-compact-title a {
    color: var(--rkp-ink);
    text-decoration: none;
}

.rk-video-compact-title a:hover {
    color: var(--rkp-accent);
}

/* Action Bar (Like, Comment, Share — Reddit / 9GAG pill style) */
.rk-post-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 12px;
}

.rk-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid var(--rkp-line);
    background: var(--rkp-pill);
    color: var(--rkp-ink);
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.rk-action-pill:hover {
    background: var(--rkp-pill-hover);
    border-color: var(--rkp-muted);
    color: var(--rkp-ink);
}

.rk-action-pill .bi-heart-fill {
    color: var(--rkp-accent);
}

.rk-action-pill.is-share {
    margin-left: auto;
}

/* Empty State */
.rk-posts-empty {
    background: var(--rkp-surface);
    border: 1px solid var(--rkp-line);
    border-radius: 14px;
    padding: 36px 20px;
    text-align: center;
    color: var(--rkp-muted);
}

/* Pagination */
.rk-posts-pagination {
    margin-top: 22px;
    display: flex;
    justify-content: center;
}

.rk-posts-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rk-posts-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--rkp-line);
    background: var(--rkp-surface);
    color: var(--rkp-ink);
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
}

.rk-posts-pagination .page-numbers.current {
    background: var(--rkp-accent);
    border-color: var(--rkp-accent);
    color: var(--rkp-accent-ink);
}

/* ==========================================================================
   Single Post Article + Comments
   ========================================================================== */
.rk-article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--rkp-muted);
    margin-bottom: 14px;
}

.rk-article-breadcrumb a {
    color: var(--rkp-muted);
    text-decoration: none;
}

.rk-article-breadcrumb a:hover {
    color: var(--rkp-accent);
}

.rk-article-card {
    background: var(--rkp-surface);
    border: 1px solid var(--rkp-line);
    border-radius: 16px;
    overflow: hidden;
}

.rk-article-header {
    padding: 20px 22px 14px;
}

.rk-article-title {
    margin: 10px 0 0;
    font-size: clamp(1.5rem, 3vw, 2.05rem);
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: -0.02em;
    color: var(--rkp-ink);
}

.rk-article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    font-size: 0.86rem;
    color: var(--rkp-muted);
}

.rk-article-hero-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 620px;
    object-fit: cover;
    background: #09090b;
    border-top: 1px solid var(--rkp-line);
    border-bottom: 1px solid var(--rkp-line);
}

.rk-article-content {
    padding: 20px 22px;
    font-size: 1rem;
    line-height: 1.72;
    color: var(--rkp-ink);
    word-break: break-word;
}

.rk-article-content p {
    margin: 0 0 1.15em;
}

.rk-article-content p:last-child {
    margin-bottom: 0;
}

.rk-article-content h2,
.rk-article-content h3,
.rk-article-content h4 {
    margin: 1.5em 0 0.55em;
    font-weight: 800;
    line-height: 1.3;
    color: var(--rkp-ink);
}

.rk-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 12px 0;
}

.rk-article-content a {
    color: var(--rkp-accent);
    text-decoration: underline;
}

.rk-article-content ul,
.rk-article-content ol {
    padding-left: 1.4em;
    margin: 0 0 1.15em;
}

.rk-article-content blockquote {
    margin: 1.2em 0;
    padding: 10px 16px;
    border-left: 3px solid var(--rkp-accent);
    background: var(--rkp-surface-alt);
    border-radius: 0 8px 8px 0;
    color: var(--rkp-muted);
}

.rk-article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 22px 16px;
}

.rk-tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--rkp-pill);
    color: var(--rkp-muted);
}

.rk-tag-pill:hover {
    color: var(--rkp-ink);
    background: var(--rkp-pill-hover);
}

.rk-article-footer {
    border-top: 1px solid var(--rkp-line);
    padding: 12px 22px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Comments Card */
.rk-comments-card {
    margin-top: 18px;
    background: var(--rkp-surface);
    border: 1px solid var(--rkp-line);
    border-radius: 16px;
    padding: 18px 20px;
}

.rk-comments-heading {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--rkp-ink);
}

/* More Posts Strip */
.rk-more-posts {
    margin-top: 26px;
}

.rk-more-posts-title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--rkp-ink);
}

@media (max-width: 639px) {
    .rk-posts-container {
        padding: 14px 0 36px;
    }

    .rk-posts-head,
    .rk-posts-toolbar,
    .rk-posts-pagination,
    .rk-posts-empty,
    .rk-more-posts-title,
    .rk-video-grid {
        padding-left: 14px;
        padding-right: 14px;
    }

    .rk-feed-list .rk-post-card,
    .rk-article-card,
    .rk-comments-card {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .rk-post-card-head {
        padding: 10px 14px 6px;
    }

    .rk-post-card-body {
        padding: 0 14px 10px;
    }

    .rk-post-actions {
        padding: 8px 14px 10px;
    }

    .rk-post-title {
        font-size: 1rem;
        line-height: 1.32;
    }

    .rk-post-excerpt,
    .rk-post-full-body {
        font-size: 0.875rem;
        line-height: 1.48;
    }

    .rk-post-media,
    .rk-article-hero-img {
        width: 100%;
        border-radius: 0;
    }

    .rk-article-title {
        font-size: 1.25rem;
        line-height: 1.26;
    }

    .rk-article-content {
        font-size: 0.92rem;
        line-height: 1.6;
    }

    .rk-article-header,
    .rk-article-content,
    .rk-article-footer,
    .rk-comments-card {
        padding-left: 14px;
        padding-right: 14px;
    }

    .rk-article-tags {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* Clickable YouTube Timestamp Pills in Post Content */
.rk-yt-ts-link {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88em;
    font-weight: 700;
    line-height: 1.3;
    color: var(--rkp-accent);
    background: var(--rkp-accent-soft);
    border: 0;
    border-radius: 6px;
    padding: 1px 6px;
    margin: 0 1px;
    cursor: pointer;
    vertical-align: baseline;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.rk-yt-ts-link:hover,
.rk-yt-ts-link:focus-visible {
    background: var(--rkp-accent);
    color: #ffffff;
}

/* Vertical 9:16 & Standard 16:9 Frames for YouTube Embeds on Single Posts */
.rk-article-content .rk-yt-wide-frame,
.rk-article-content .rk-yt-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 auto 1.25rem;
    border-radius: 12px;
    overflow: hidden;
    background: #000000;
}

.rk-article-content .rk-yt-short-frame,
.rk-article-content .rk-yt-short-embed {
    position: relative;
    width: 100%;
    max-width: 390px;
    aspect-ratio: 9 / 16;
    margin: 0 auto 1.25rem;
    border-radius: 14px;
    overflow: hidden;
    background: #000000;
}

.rk-article-content .wp-block-embed:has(.rk-yt-short-frame) .wp-block-embed__wrapper,
.rk-article-content .wp-block-embed:has(.rk-yt-wide-frame) .wp-block-embed__wrapper {
    position: static !important;
    padding: 0 !important;
}

.rk-article-content .wp-block-embed:has(.rk-yt-short-frame) .wp-block-embed__wrapper::before,
.rk-article-content .wp-block-embed:has(.rk-yt-wide-frame) .wp-block-embed__wrapper::before {
    display: none !important;
    padding-top: 0 !important;
}

.rk-article-content .rk-yt-wide-frame iframe,
.rk-article-content .rk-yt-embed iframe,
.rk-article-content .rk-yt-short-frame iframe,
.rk-article-content .rk-yt-short-embed iframe {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
}

/* Hide duplicate inline YouTube embeds inside feed-card expanded body */
.rk-post-card:has(.rk-yt-facade) .rk-post-full-body iframe[src*="youtube"],
.rk-post-card:has(.rk-yt-facade) .rk-post-full-body .rk-yt-short-frame,
.rk-post-card:has(.rk-yt-facade) .rk-post-full-body .rk-yt-wide-frame,
.rk-post-card:has(.rk-yt-facade) .rk-post-full-body .rk-yt-embed,
.rk-post-card:has(.rk-yt-facade) .rk-post-full-body .rk-yt-short-embed,
.rk-post-card:has(.rk-yt-facade) .rk-post-full-body .wp-block-embed-youtube {
    display: none !important;
}

/* Video posts (Videos category): video hero lifted out of the body by single.php */
.rk-article-card.is-video-post {
    display: flex;
    flex-direction: column;
}

.rk-article-card.is-video-post .rk-article-header {
    order: -1;
}

.rk-video-hero {
    padding: 0 22px;
}

.rk-video-hero .rk-yt-wide-frame,
.rk-video-hero .rk-yt-embed,
.rk-video-hero .rk-yt-short-frame,
.rk-video-hero .rk-yt-short-embed {
    position: relative;
    width: 100%;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    background: #000000;
}

.rk-video-hero .rk-yt-wide-frame,
.rk-video-hero .rk-yt-embed {
    aspect-ratio: 16 / 9;
}

.rk-video-hero .rk-yt-short-frame,
.rk-video-hero .rk-yt-short-embed {
    max-width: 390px;
    aspect-ratio: 9 / 16;
    border-radius: 14px;
}

.rk-video-hero iframe {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
}

/* Phones: video first, edge to edge, right under the site header; compact title + meta below */
@media (max-width: 639px) {
    .rk-posts-container:has(.is-video-post) {
        padding-top: 0;
    }

    .rk-posts-container:has(.is-video-post) .rk-article-breadcrumb {
        display: none;
    }

    .rk-article-card.is-video-post {
        border-top: 0;
    }

    .rk-article-card.is-video-post .rk-article-header {
        order: 0;
        padding-top: 12px;
        padding-bottom: 2px;
    }

    .rk-article-card.is-video-post .rk-post-cat {
        display: none;
    }

    .rk-article-card.is-video-post .rk-article-title {
        margin-top: 0;
        font-size: 1.1rem;
        line-height: 1.3;
    }

    .rk-article-card.is-video-post .rk-article-meta {
        margin-top: 6px;
        gap: 6px;
        font-size: 0.8rem;
    }

    .rk-article-card.is-video-post .rk-article-content {
        padding-top: 10px;
    }

    .rk-video-hero {
        padding: 0;
        background: #000000;
    }

    .rk-video-hero .rk-yt-wide-frame,
    .rk-video-hero .rk-yt-embed,
    .rk-video-hero .rk-yt-short-frame,
    .rk-video-hero .rk-yt-short-embed {
        border-radius: 0;
    }

    /* Shorts: full width, but never taller than the screen minus header + bottom nav */
    .rk-video-hero .rk-yt-short-frame,
    .rk-video-hero .rk-yt-short-embed {
        max-width: none;
        aspect-ratio: auto;
        height: min(177.78vw, calc(100svh - 150px));
    }
}

/* Phones: cancel the theme wrapper's side gutter (header.php .container-fluid) so post pages run edge to edge;
   cards, video hero and body text then use their own 14px padding only */
@media (max-width: 639px) {
    .rk-posts-page {
        margin-left: calc(-0.5 * var(--bs-gutter-x, 1.5rem));
        margin-right: calc(-0.5 * var(--bs-gutter-x, 1.5rem));
    }
}

/* Swipe between video posts (phones only; driven by rk-posts.js initVideoSwipe) */
.rk-video-swipe,
.rk-swipe-peek {
    display: none;
}

@media (max-width: 639px) {
    .rk-article-card.is-video-post {
        position: relative;
    }

    .rk-video-hero {
        position: relative;
    }

    .rk-article-card.is-video-post[data-older-url] .rk-video-hero,
    .rk-article-card.is-video-post[data-newer-url] .rk-video-hero,
    .rk-article-card.is-video-post[data-older-url] .rk-article-header,
    .rk-article-card.is-video-post[data-newer-url] .rk-article-header {
        touch-action: pan-y;
        will-change: transform;
    }

    .rk-video-swipe {
        display: block;
        position: absolute;
        inset: 0;
        z-index: 2;
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        cursor: grab;
        touch-action: pan-y;
        -webkit-tap-highlight-color: transparent;
    }

    .rk-video-swipe-hint {
        position: absolute;
        left: 50%;
        bottom: 14px;
        transform: translateX(-50%);
        display: inline-flex;
        gap: 10px;
        align-items: center;
        white-space: nowrap;
        padding: 6px 12px;
        border-radius: 999px;
        background: rgba(15, 16, 18, 0.72);
        color: #ffffff;
        font-size: 0.74rem;
        font-weight: 600;
        pointer-events: none;
        animation: rk-swipe-hint-out 0.4s ease 3s forwards;
    }

    .rk-swipe-peek {
        display: block;
        position: absolute;
        top: 38%;
        z-index: 0;
        max-width: 46%;
        padding: 8px 10px;
        font-size: 0.8rem;
        font-weight: 700;
        line-height: 1.3;
        color: var(--rkp-muted);
        opacity: 0;
        pointer-events: none;
    }

    .rk-swipe-peek--newer {
        left: 8px;
    }

    .rk-swipe-peek--older {
        right: 8px;
        text-align: right;
    }

    .rk-article-card.is-video-post .rk-video-hero,
    .rk-article-card.is-video-post .rk-article-header {
        z-index: 1;
        background: var(--rkp-surface);
    }

    .rk-article-card.is-video-post .rk-video-hero {
        background: #000000;
    }
}

@keyframes rk-swipe-hint-out {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rk-video-swipe-hint {
        animation: none;
    }
}

