/* ============================================================
   PALETTE VARIABLES
============================================================ */
:root {
    --jet: #292929;
    --gray: #585757;
    --linen: #F5ECE4;
    --pumpkin: #FC6A0A;
    --golden: #E74504;
}

@font-face {
  font-family: "NotoSansDevanagariUI";
  src: url("/static/fonts/NotoSansDevanagariUI-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   GLOBAL
============================================================ */
body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--linen);
    color: var(--gray);
}
html, body, button, input, textarea, select {
  font-family: "NotoSansDevanagariUI", sans-serif;
}
h1,
h2,
h3,
h4 {
    margin: 0;
    color: var(--jet);
}

/* Smooth transitions everywhere */
*, *::before, *::after {
    box-sizing: border-box;
    transition: 0.2s ease;
}
/* ============================================
   CHANNEL BANNER / YOUTUBE-STYLE HEADER
============================================ */
.channel-banner {
    width: 100%;
    max-height: 423px;        /* adjust to taste */
    overflow: hidden;
    background: #000;
}

.channel-banner img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;        /* fills width, trims top/bottom softly */
}

/* Hide on mobile – only show on desktop */
.desktop-only {
    display: block;
}

@media (max-width: 900px) {
    .channel-banner.desktop-only {
        display: none;
    }
}

/* ============================================================
   TOP BAR
============================================================ */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, var(--jet), var(--gray));
    color: var(--linen);
    padding: 12px 25px;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    position:sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
}
/* DESKTOP vs MOBILE helpers */

/* DESKTOP vs MOBILE helpers */
.desktop-only {
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Hamburger visible on ALL devices */
.mobile-menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dropdown container – shared for desktop + mobile */
.mobile-dropdown-menu {
    position: absolute;
    top: 100%;           /* exactly below the top-bar */
    right: 10px;
    display: none;       /* JS will toggle this to 'flex' */
    flex-direction: column;
    background: #111;    /* adjust to your theme */
    padding: 10px 12px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    z-index: 1100;
}

/* Base dropdown (hidden by default) */
.top-bar .mobile-dropdown-menu {
    position: absolute;
    top: 100%;          /* directly below the top bar */
    right: 10px;

    display: none;      /* JS will toggle this via a class */
    flex-direction: column;

    background: #111;   /* adjust to your theme */
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    gap: 6px;

    z-index: 1100;
}

/* Links inside dropdown */
.top-bar .mobile-dropdown-menu a {
    text-decoration: none;
    color: inherit;
    font-size: 14px;
    padding: 4px 0;
}

/* Small row for theme toggle */
.dropdown-theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    cursor: pointer;
}

/* When open */
.top-bar .mobile-dropdown-menu.mobile-dropdown-open {
    display: flex;
}

.mobile-dropdown-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    padding: 4px 0;
}

.mobile-dropdown-menu a.active-lang {
    color: var(--pumpkin);
    font-weight: 700;
}

.dropdown-theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #444;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
}
/* -------- Instagram-style story strip in top bar (mobile) ------- */

/* Hide by default on desktop */
.mobile-stories-strip {
    display: none;
}

/* Story avatar base styles */
.story-avatar-link {
    display: inline-flex;
    text-decoration: none;
}

.story-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--pumpkin);
    padding: 2px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #fff, #f3f0ec);
}

.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* For video stories (no image) */
.story-avatar-icon {
    font-size: 20px;
    color: #ffffff;
    text-shadow: 0 0 6px rgba(0,0,0,0.8);
}

/* Dark mode tweaks */
body.dark .story-avatar {
    background: radial-gradient(circle at top, #333, #000);
    border-color: var(--pumpkin);
}

/* ============================================================
   SIDEBAR + POSTS
============================================================ */
.layout-wrapper {
    display: flex;
    padding: 20px;
    gap: 20px;
}

/* ---------------- Sidebar ---------------- */
.sidebar {
    width: 22%;

    padding: 20px;
    border-radius: 12px;

    position: sticky;
    top: 20px;
}

.sidebar h3 {
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--jet);
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 0px;
}

.category-list a {
    text-decoration: none;
    color: var(--gray);
    font-weight: 500;
    padding: 8px 10px;
    display: block;
    border-radius: 6px;
}

.category-list a:hover {
    background: rgba(252, 106, 10, 0.12);
    /* soft pumpkin tint */
}

.active-cat {
    background: var(--pumpkin) !important;
    color: var(--linen) !important;
    font-weight: 700 !important;
    border-radius: 6px;
    padding: 8px 10px;
    box-shadow: 0 2px 6px rgba(252, 106, 10, 0.4);
    transform: translateX(5px);
}

/* ---------------- Posts Area ---------------- */
.posts-container {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.detail-page .layout-wrapper {
    max-width: 1100px;
    margin: 20px auto;
}

.detail-page .posts-container {
    width: 100%;
    max-width: 100%;
}
.post-detail-card {
  padding: 20px;
}

/* Use GRID on desktop (more stable than flex for galleries) */
.post-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 24px;
  align-items: start;
}

.post-detail-text {
  min-width: 0;
}
/* Make post-card titles bold */
.post-card .post-title-mobile {
  font-weight: 1000 !important;
    margin-bottom: 10px;
}

/* (Optional) If you also want reel titles bold */
.story-card .story-title,
.story-card .story-title-link {
  font-weight: 700 !important;
}

/* Description looks like readable paragraphs */
.post-description-short {
  margin: 0;
  line-height: 1.55;
}
/* Paragraph spacing after expansion */
.post-description-short.expanded p {
  margin: 0 0 10px 0;
}
.post-description-short.expanded {
  max-height: 220px;
  overflow: auto;
  padding-right: 6px;
}
/* Read more styling */
.read-more {
  margin-left: 6px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
/* Make the actual media behave */
#mediaViewer img,
#mediaViewer video {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  background: #000;
}

/* Gallery strip */
.detail-gallery-strip {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.detail-gallery-strip::-webkit-scrollbar { display: none; }

/* Thumbs */
.detail-thumb {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
  position: relative;

  width: 86px;
  height: 86px;
  border-radius: 12px;
  overflow: hidden;

  outline: 2px solid transparent;
  outline-offset: 2px;
}

/* Active thumb */
.detail-thumb.active {
  outline-color: var(--pumpkin);
  transform: translateY(-1px);
}

/* Thumb media */
.detail-thumb img,
.detail-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

/* Better focus for keyboard users */
.detail-thumb:focus-visible {
  outline-color: var(--pumpkin);
}

/* MOBILE: stack media above text */
@media (max-width: 900px) {
  .post-detail-layout {
    grid-template-columns: 1fr;
  }

  #mediaViewer,
  #mediaViewer img,
  #mediaViewer video {
    max-height: 55vh;
  }
}

/* If you want your 16:9 "landscape-detail" to force media on top */
.landscape-detail {
  grid-template-columns: 1fr !important;
}
.post-detail-media {
  min-width: 0;
}
.post-detail-media img,
.post-detail-media video {
    width: 100%;
    height: auto;
    object-fit: contain;
}
.post-card {
    background: #ffffff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* ===========================
   Detail: show first 4 media stacked
=========================== */
.detail-stack-four {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.detail-stack-item img,
.detail-stack-item video {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  background: #000;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Mobile: a bit smaller */
@media (max-width: 900px) {
  .detail-stack-item img,
  .detail-stack-item video {
    max-height: 55vh;
  }
}
/* ============================================================
   MEDIA PREVIEW (Homepage image/video preview)
============================================================ */

/* Wrapper inside post-card is already styled by .post-card */

.post-media-image,
.post-media-video {
    width: 100%;
    max-height: 380px;       /* 🔥 Adjust this as per your design */
    border-radius: 12px;
    object-fit: contain;       /* zoom-crop without distortion */
    background: #000;        /* clean black bg for videos */
    display: block;
}

/* Video element styling */
.post-media-video {
    display: block;
    aspect-ratio: 16 / 9;
}

/* Default placeholder */
.post-media-placeholder {
    width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
}


/* Desktop: show full image, no cropping */
@media (min-width: 901px) {
    .post-card img {
        height: auto;
        max-height: 420px;
        object-fit: contain;
        background: var(--linen);
    }
}

.post-card h2 {
    font-size: 20px;
    margin: 12px 0 6px;
    color: var(--jet);
}

.post-card p {
    color: var(--gray);
}
.post-main-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.post-main-link:hover {
    text-decoration: none;
}

/* Category Badge */
.cat-label {
    background: var(--pumpkin);
    color: var(--linen);
    padding: 4px 10px;
    border-radius: 5px;
    display: inline-block;
    font-size: 13px;
    margin-top: 8px;
}
/* ============================================================
   DESKTOP CATEGORY BAR
============================================================ */
.desktop-category-bar {
    width: 100%;
    background: #ffffff;
    padding: 10px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;   /* just below top-bar */
    z-index: 9000;
    display: block;
}

.desktop-category-scroll {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;

    overflow-x: auto;
    white-space: nowrap;
    padding: 0 20px;

    flex: 1;              /* take center space in top-bar */
    text-align: center;
}



.desktop-category-scroll::-webkit-scrollbar {
    display: none;
}

.desk-cat {
    padding: 8px 16px;
    background: #f3f0ec;
    border-radius: 20px;
    color: var(--gray);
    text-decoration: none;
    border: 1px solid rgba(88,87,87,0.25);
    font-size: 14px;
}

.desk-cat:hover {
    background: rgba(252,106,10,0.12);
    color: var(--golden);
}

.desk-active {
    background: var(--pumpkin) !important;
    color: var(--linen) !important;
    font-weight: 700;
    border: 1px solid var(--golden);
}

/* ============================================================
   INPUTS & BUTTONS (Admin & Frontend forms)
============================================================ */
.input-box {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 6px;
    border: 1px solid rgba(88, 87, 87, 0.4);
    font-size: 15px;
    background: #ffffff;
    color: var(--gray);
}

.input-box:focus {
    border-color: var(--pumpkin);
    outline: none;
    box-shadow: 0 0 3px rgba(252, 106, 10, 0.6);
}

.btn {
    padding: 12px 20px;
    background: var(--pumpkin);
    color: var(--linen);
    border-radius: 6px;
    cursor: pointer;
    border: none;
    font-size: 15px;
    font-weight: 600;
}

.btn:hover {
    background: var(--golden);
}

/* ============================================================
   TABLE (Users Page)
============================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

table th {
    background: var(--pumpkin);
    color: var(--linen);
    padding: 10px;
    font-size: 15px;
    text-align: left;
}

table td {
    padding: 10px;
    border-bottom: 1px solid rgba(88, 87, 87, 0.15);
    color: var(--gray);
}

table tr:hover {
    background: rgba(245, 236, 228, 0.8);
}

/* ============================================================
   MOBILE CATEGORY BAR
============================================================ */
.mobile-category-bar {
    display: none;
    width: 100vw;
    background: #ffffff;
    padding: 8px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.10);
    position: sticky;
    top: 0;
    left: 0;
    overflow-x: auto;
    z-index: 9999;
}

.mobile-category-scroll {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    gap: 10px;
    padding: 4px 10px 8px;
    height: 48px;
    align-items: center;
    scrollbar-width: none;
}

.mobile-category-scroll::-webkit-scrollbar {
    display: none;
}

.mobile-cat {
    padding: 8px 14px;
    background: #f3f0ec;
    /* light linen tint */
    border-radius: 20px;
    font-size: 14px;
    color: var(--gray);
    border: 1px solid rgba(88, 87, 87, 0.25);
    text-decoration: none;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.mobile-cat:hover {
    background: rgba(252, 106, 10, 0.12);
    color: var(--golden);
}

/* Active category on mobile */
.active-mob-cat {
    background: var(--pumpkin) !important;
    color: var(--linen) !important;
    font-weight: 700;
    border: 1px solid var(--golden);
}



/* ============================================================
   SHARE BAR
============================================================ */
.share-bar {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 13px;
}

.share-label {
    color: var(--gray);
    margin-right: 4px;
}

.share-link {
    border: 1px solid rgba(88, 87, 87, 0.25);
    background: #f3f0ec;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    color: var(--gray);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.share-link i {
    font-size: 13px;
}

.share-link:hover {
    background: rgba(252, 106, 10, 0.12);
    color: var(--golden);
}

/* ============================================================
   FLOATING HOME BUTTON
============================================================ */
.home-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 10000;

    background: var(--pumpkin);
    color: var(--linen);
    text-decoration: none;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 10px 18px;
    border-radius: 999px;
    /* pill on desktop */
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);

    font-size: 14px;
    font-weight: 600;
}

.home-fab i {
    font-size: 16px;
}

/* Hover state (desktop) */
.home-fab:hover {
    background: var(--golden);
}
/* Default: hide mobile version on desktop */
.home-mobile {
    display: none;
}


.logo img {
    height: 120px;
    /* adjust as you like */
    width: auto;
}

/* Splash container */
#splash-screen {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    overflow: hidden;
    transition: opacity 0.5s ease;
}

/* Video takes full space */
#splash-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;   /* hidden until ready */
}

/* Fallback image shown until video loads */
#splash-fallback {
    max-width: 100%;
    max-height: 100%;
}


/* ⭐ Compact Centered Logo Above Categories */
.compact-logo {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 8px 0 10px 0;
}

.compact-logo img {
    width: 150px;
    /* small size */
    height: auto;
    display: block;
}

/* Ensure this section does NOT expand height of page */
.top-bar {
    margin-bottom: 5px !important;
}

/* Sidebar Logo */
.sidebar-logo {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.sidebar-logo img {
    width: 95%;
    /* perfectly fits sidebar width */
    height: auto;
    border-radius: 10px;
}

/* ============================================================
   SIDEBAR FULL-WIDTH VIDEO LIST
============================================================ */

.sidebar-videos {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 20px;
}

.video-item {
    display: block;
    text-decoration: none;
    color: var(--jet);
}

/* Full sidebar width video */
.video-thumb-full {
    width: 100%;
    height: auto;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

.video-thumb-full video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;   /* show full video without cropping */
}

.video-thumb-full img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Title below video */
.video-title-full {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--jet);
}

.video-item:hover .video-title-full {
    color: var(--pumpkin);
}

.post-title-link {
    text-decoration: none;
    color: var(--jet);
}

.post-title-link:hover {
    color: var(--pumpkin);
}
/* ============================================================
   RIGHT SIDEBAR (COMICS SECTION)
============================================================ */
.right-sidebar {
    width: 22%;
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

.comics-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comic-item {
    text-decoration: none;
    color: var(--jet);
    padding: 6px 0;
    border-radius: 6px;
}

.comic-item:hover {
    color: var(--pumpkin);
}

.comic-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}
.comic-thumb {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    background: #000;
    margin-bottom: 6px;
}


.lang-switch {
    display: flex;
    gap: 10px;
    color: white;
    font-weight: 600;
}

.lang-switch a {
    color: var(--linen);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.15);
}

.lang-switch a:hover {
    background: var(--pumpkin);
    color: white;
}

.active-lang {
    background: var(--pumpkin) !important;
    color: white !important;
}
/* ---------------------------
   THEME TOGGLE BUTTON
--------------------------- */
.theme-toggle {
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.15);
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.25);
}

.theme-toggle i {
    color: white;
    font-size: 20px;
}



/* -----------------------------------
   🌙 DARK THEME GLOBAL RULES
----------------------------------- */

body.dark {
    background: #121212 !important;
    color: var(--pumpkin) !important;
}

body.dark .top-bar {
    background: #1e1e1e !important;
    color: #eee !important;
}

body.dark .sidebar,
body.dark .right-sidebar,
body.dark .post-card {
    background: #1b1b1b !important;
    color: #f0f0f0 !important;
    box-shadow: 0 0 10px rgba(255,255,255,0.08) !important;
}

body.dark .post-title-link {
    color: #fff !important;
}

body.dark .post-title-link:hover {
    color: var(--pumpkin) !important;
}

body.dark .cat-label {
    background: var(--golden) !important;
    color: black !important;
}

body.dark .desk-cat,
body.dark .mobile-cat {
    background: #222 !important;
    color: #fff !important;
    border-color: #444 !important;
}

body.dark .desk-active,
body.dark .active-mob-cat {
    background: var(--pumpkin) !important;
    color: #000 !important;
}

body.dark .share-link {
    background: #222 !important;
    color: #ddd !important;
}

body.dark .share-link:hover {
    background: #333 !important;
    color: var(--pumpkin) !important;
}

body.dark .home-fab {
    background: #222 !important;
    color: #fff !important;
}

body.dark .right-sidebar h3,
body.dark .sidebar h3 {
    color: #fff !important;
}

/* 🌙 DARK MODE CATEGORY BAR FIX */
body.dark .desktop-category-bar {
    background: #1b1b1b !important;   /* matches sidebar/post background */
    box-shadow: 0 2px 6px rgba(255,255,255,0.05) !important;
}

body.dark .desktop-category-scroll {
    background: transparent !important; /* no white tint */
}


/* Apply black background to all images EXCEPT logo */
body.dark img:not(.no-dark-bg),
body.dark video:not(.no-dark-bg) {
    background: #000;
}

/* Explicitly allow logo to stay transparent */
.sidebar-logo img,
.top-bar img,
.logo img {
    background: transparent !important;
}

/* Make all text pumpkin in dark theme */
body.dark,
body.dark h1,
body.dark h2,
body.dark h3,
body.dark h4,
body.dark p,
body.dark span,
body.dark a,
body.dark li,
body.dark .post-card p,
body.dark .video-title-full,
body.dark .comic-title,
body.dark .date {
    color: var(--pumpkin) !important;
}
/* ----------------------------------------------
   🟧 DARK MODE — FORCE BLACK TEXT ON PUMPKIN BG
---------------------------------------------- */
body.dark .active-lang,
body.dark .cat-label,
body.dark .desk-active,
body.dark .active-mob-cat,
body.dark .lang-switch a.active-lang,
body.dark .lang-switch a:hover,
body.dark .cat-label,
body.dark .home-fab.active,
body.dark .pumpkin-bg {
    color: #000 !important;      /* text becomes BLACK */
    background: var(--pumpkin) !important;
}
/* Fix button text on pumpkin background in dark mode */
body.dark .btn {
    color: var(--linen) !important;      /* light text */
    background: var(--pumpkin) !important;
}

body.dark .btn:hover {
    color: var(--linen) !important;      /* keep readable on hover too */
}

/* Fix hover pumpkin areas */
body.dark .desk-cat:hover,
body.dark .mobile-cat:hover {
    background: var(--pumpkin) !important;
    color: #000 !important;
}

/* 🌙 DARK MODE — MOBILE CATEGORY BAR FIX */
body.dark .mobile-category-bar {
    background: #1b1b1b !important;   /* same dark background */
    box-shadow: 0 2px 6px rgba(255,255,255,0.05) !important;
}

body.dark .mobile-category-scroll {
    background: transparent !important;
}

/* --------------------------------------------------
   INSTAGRAM STYLE STORY PLAYERS (VIDEO + ARTICLE)
-------------------------------------------------- */

/* Shared base for all looping players */
@media (min-width: 901px) {
    #story-player,
    #article-story-player,
    #comics-story-player {
        width: 100%;
        max-width: 360px;               /* desktop limiting width */
        margin: 20px auto;
        background: #000;
        border-radius: 18px;
        overflow: hidden;
        position: relative;
        z-index: 5;
        box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    }

/* Video story screen (9:16) */
#story-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#story-screen video {
    height: 100%;
    width: auto;
    object-fit: cover;
    background: #000;
}

/* Article + Comics story frames (desktop) */
#article-story-screen{
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Images inside those frames */
#article-story-screen img{
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center center;
    display: block;
    margin: 0 auto;
    background: #000;
}
/* Center play button overlay on desktop reels */
.story-play-overlay {
    position: absolute;
    inset: 0;
    display: none; /* default hidden, JS + desktop will show it */
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.story-play-overlay i {
    font-size: 60px;
    color: #ffffff;
    text-shadow: 0 0 12px rgba(0,0,0,0.9);
    opacity: 0.9;
}

/* Optional: small hover effect on desktop */
@media (min-width: 901px) {
    .story-play-overlay:hover i {
        transform: scale(1.1);
    }
}


/* ============================
   COMICS STORY SCREEN (IMAGE/VIDEO)
============================ */


/* Shared progress bar row for ALL looping sections */
#story-progress,
#article-story-progress,
#comics-story-progress {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    padding: 0 8px;
    display: flex;        /* 🔥 this ensures even horizontal bars */
    gap: 6px;
    z-index: 10;
}


/* Each bar takes equal share */
.story-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.story-bar span {
    display: block;
    height: 100%;
    width: 0%;
    background: #ff6a00;
    border-radius: 2px;
}
}
/* DARK MODE SUPPORT */
body.dark #story-player,
body.dark #article-story-player {
    background: #000 !important;
}

body.dark .story-bar {
    background: rgba(255,255,255,0.15) !important;
}

body.dark .story-bar span {
    background: var(--pumpkin) !important;
}

/* Story card layout: left = media, right = text  (DESKTOP ONLY) */
/* Story card layout: left = media, right = text  (DESKTOP ONLY) */
@media (min-width: 901px) {
    .story-card {
        display: flex;
        gap: 18px;
        align-items: flex-start;
    }

    /* Left column: video, article, comics */
    .story-card #story-player,
    .story-card #article-story-player,
    .story-card #comics-story-player {
        flex: 0 0 40%;
        max-width: 40%;
        margin: 0;
    }

    /* Right column: title / description */
    .story-info-panel {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 8px;
    }
}


/* Optional: description styling */
.story-desc {
    font-size: 14px;
    line-height: 1.4;
}

/* Story title text */
.story-title {
    margin: 10px 10px 4px;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    color: var(--jet);
}

body.dark .story-title {
    color: var(--pumpkin) !important;
}

/* Mobile: let both players go full width */
@media (max-width: 600px) {
    #story-player,
    #article-story-player {
        max-width: 100%;
        border-radius: 0;
    }
}
.story-title-link {
    text-decoration: none;
    color: inherit;
}

.story-title-link:hover {
    color: var(--pumpkin);
}
.story-share-bar {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
/* ============================================================
   📱 MOBILE MODE (Only <900px) — MERGED
============================================================ */
@media (max-width: 900px) {

    /* 1) GLOBAL PAGE BEHAVIOUR */
    html,
    body {
        padding: 0 !important;
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        overflow-x: hidden !important;
        overflow-y: scroll !important;
padding-bottom: 60px;
        /* scroll-snap-type: y mandatory !important;  snapping */
        scroll-behavior: smooth !important;
        background: #000 !important;
    }

    .right-sidebar,
    .desktop-category-bar,
    .sidebar {
        display: none !important;
    }

    .mobile-category-bar {
        display: block !important;
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0;
        width: 100vw;
        background: #ffffff;
        box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.10);
        z-index: 9999;
    }

    .mobile-category-scroll {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        gap: 12px;                 /* a bit tighter spacing */
        padding: 4px 10px 8px;
        height: 40px;              /* slightly shorter bar */
        align-items: center;
        justify-content: center;   /* ⭐ CENTER PILLS HORIZONTALLY */
        scrollbar-width: none;
    }

    .mobile-category-scroll::-webkit-scrollbar {
        display: none;
    }

    .mobile-cat {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 16px;
    }


    /* 2) LAYOUT WRAPPER & POSTS CONTAINER */
    .layout-wrapper {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }

    .posts-container {
        width: 100vw !important;
        max-width: 100vw !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
    }

    /* 3) REEL CARDS (HOME TOP 3 STORY CARDS) */
    .post-card.story-card {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        min-height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #000 !important;
        /* scroll-snap-align: start !important; */
        position: relative !important;
    }

    /* 4) NORMAL POSTS AFTER REELS (feed) */
    .post-card:not(.story-card) {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 0 16px 0 !important;
        border-radius: 0 !important;
    }

    /* 5) REELS PLAYER AREA */
    #story-player,
    #article-story-player,
    #comics-story-player {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        position: relative !important;
        background: #000 !important;
    }

    #story-screen,
    #article-story-screen{
        width: 100vw !important;
        height: 100vh !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #000 !important;
    }

/* 6) MEDIA FIT — CENTERED, FULLY VISIBLE (NO CROP) */

/* Video + article behave as before */
#story-screen video,
#article-story-screen img {
    width: 100vw !important;
    height: 100vh !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: #000 !important;
    display: block !important;
    margin: 0 auto !important;
}

    /* 7) HIDE DESKTOP RIGHT INFO PANEL */
    .story-info-panel {
        display: none !important;
    }

    /* 8) OVERLAY TEXT (TITLE + DESC) */
    .reel-overlay {
        position: absolute;
        bottom: 100px;
        left: 16px;
        right: 16px;
        padding: 0 8px;
        z-index: 50;
        color: #fff !important;
        text-shadow: 0 4px 16px rgba(0, 0, 0, 0.95);
        pointer-events: none;
    }

    .reel-title {
        font-size: 22px;
        font-weight: 800;
        margin-bottom: 6px;
        line-height: 1.25;
    }

    .reel-desc {
        font-size: 15px;
        font-weight: 400;
        opacity: 0.96;
        line-height: 1.35;
    }

    /* 9) PROGRESS BAR ON TOP */
    #story-progress,
    #article-story-progress,
    #comics-story-progress {
        top: 12px !important;
        padding: 0 16px !important;
        z-index: 40 !important;
    }

    /* 10) TAP ZONES FOR NEXT/PREV */
    .tap-zone {
        position: absolute;
        top: 0;
        width: 50vw;
        height: 100vh;
        z-index: 99;
    }

    .tap-left {
        left: 0;
    }

    .tap-right {
        right: 0;
    }

    .home-fab {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        background: transparent; /* since logo is circular */
        box-shadow: none; /* or keep if you want */
        top: 16px;
        right: 16px;
    }

    .home-fab img.home-logo {
        width: 60px;
        height: 60px;
        object-fit: contain;
        border-radius: 50%;
    }

    /* Hide text if present */
    .home-fab .home-text {
        display: none !important;
    }

    /* 12) ONLY SHOW OVERLAY BLOCKS ON MOBILE */
    .mobile-only {
        display: block !important;
    }

    .top-bar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        z-index: 99999 !important;
        background: linear-gradient(to right, var(--jet), var(--gray)) !important;

        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* push content down so top-bar is not overlapped */
    .posts-container {
        padding-top: 60px !important;
    }

        /* hide time/date on mobile */
    /* hide date + desktop categories on mobile */
    .desktop-date {
        display: none !important;
    }
    .desktop-only {
        display: none !important;
    }

    /* show mobile logo */
    .mobile-top-logo {
        display: flex !important;
        align-items: center;
        justify-content: center;

    }

    .mobile-top-logo img {
        height: 50px;     /* adjust size */
        width: auto;
        object-fit: contain;
    }
        .desktop-only {
        display: none !important;
    }
        .mobile-menu-icon {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Detail page: stack text + media on mobile */
    .post-detail-layout {
        flex-direction: column;
    }
    .post-detail-media {
        order: -1;             /* move media above text */
        max-width: 100%;
        width: 100%;
        margin-bottom: 16px;
    }
    /* stories strip sits between logo and hamburger */
    .mobile-stories-strip {
        display: flex;
        flex: 1;
        overflow-x: auto;
        white-space: nowrap;
        gap: 8px;
        padding: 0 8px;
        scrollbar-width: none;
    }

    .mobile-stories-strip::-webkit-scrollbar {
        display: none;
    }

    /* hamburger pinned to right */
    .mobile-menu-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
    }
        .top-bar .mobile-dropdown-menu {
        position: fixed;
        top: 60px;     /* just below fixed top-bar */
        right: 12px;
        left: auto;
        width: auto;
    }
}



/* Hide mobile overlays on desktop */
.mobile-only {
    display: none;
}
/* ===== Reels overlay text improvements ===== */

/* Allow clicks on description but not whole overlay */
.reel-overlay {
    pointer-events: none;
}

.reel-desc {
    pointer-events: auto;
}

/* "more" link style in overlay */
.reel-desc .overlay-more {
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
/* ===== Reels overlay text — force readable white ===== */
.reel-title,
.reel-desc {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(0,0,0,0.9);
}


/* ============================================
   FINAL COMICS REEL LAYOUT (DESKTOP + MOBILE)
   Centers image / video, no crop, no shifting
============================================ */

/* The comics player fills its card */
#comics-story-player {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* The inner screen is a flex box that centers its child */
#comics-story-screen {
    position: relative;
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #000;
    overflow: hidden;
}

/* The actual comics media (image OR video) */
#comicsStoryImage,
#comicsStoryVideo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;

    object-fit: contain;
    object-position: center center;

    display: block;
    margin-left: auto;
    margin-right: auto;
    background: #000;
}

/* Mobile: the comics card itself is full-screen like other reels */
@media (max-width: 900px) {
    .post-card.story-card {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        min-height: 100vh;
    }
.post-card:not(.story-card) {
    padding-bottom: 72px;  /* ~40px bar height + a little breathing room */
}
    #comics-story-player,
    #comics-story-screen {
        width: 100vw;
        height: 100vh;
    }
}
/* -------------------------------
   FIX 1: Mobile top bar logo ONLY
--------------------------------*/
.mobile-top-logo {
    display: none !important;   /* hide everywhere by default */
}

@media (max-width: 900px) {
    .mobile-top-logo {
        display: flex !important;
        justify-content: center;
        align-items: center;
    }

    .desktop-date {
        display: none !important;  /* hide date in mobile */
    }
}

/* -------------------------------
   FIX 2: Remove home button on ALL devices
--------------------------------*/
.home-fab {
    display: none !important;
}
/* =======================
   Transcript blocks
======================= */
.transcript-toggle-row {
    margin-top: 8px;
}

.transcript-box {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(88,87,87,0.25);
    background: #f9f6f2;
    max-height: 260px;
    overflow-y: auto;
}

.transcript-text {
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-line;
}

/* Reuse share-pill style for transcript button */
.transcript-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Dark mode transcript styling */
body.dark .transcript-box {
    background: #1b1b1b;
    border-color: #444;
}
/* 16:9 detail layout: video on top, text below (YouTube-style) */
.landscape-detail {
    flex-direction: column;
}

.landscape-detail .post-detail-media {
    order: -1;
    max-width: 100%;
    width: 100%;
    margin-bottom: 16px;
}
/* ============================================
   Blur-fill side bars for portrait (9:16) media
============================================ */

.blurfill-media{
  position: relative;
  width: 100%;
  max-height: 380px;        /* keep your existing look */
  aspect-ratio: 16 / 9;     /* keep the card wide */
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

/* background layer */
.blurfill-media .blurfill-bg{
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  object-fit: cover;
  filter: blur(28px);
  transform: scale(1.18);
  opacity: 0.95;
  pointer-events: none;
}

/* soft vignette (optional but looks premium) */
.blurfill-media::after{
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.35) 100%);
  z-index: 1;
  pointer-events: none;
}

/* foreground layer */
.blurfill-media .blurfill-fg{
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  display: block;
}
.story-avatar { position: relative; }

.story-avatar-video{
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  pointer-events: none; /* important: clicking goes to the <a> link, not the video */
}

.story-play-badge{
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-play-badge i{
  font-size: 10px;
  color: #fff;
}

/* ==============================
   DESKTOP REELS: clamp long desc + readmore
================================ */
@media (min-width: 901px) {
  .story-desc.desktop-clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--clamp-lines, 6); /* change 6 if you want */
    overflow: hidden;
  }

  .desktop-readmore {
    display: inline-block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    color: var(--golden);
  }

  .desktop-readmore:hover {
    color: var(--pumpkin);
  }

  body.dark .desktop-readmore {
    color: var(--pumpkin) !important;
  }
}
/* ============================================================
   CONTINUE WATCHING (YouTube-style row)
============================================================ */

.continue-section{
  margin-top: 18px;
}

.continue-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.continue-header h3{
  font-size: 18px;
  font-weight: 700;
  color: var(--jet);
}


.continue-arrows{
  display: flex;
  gap: 8px;
}

/* Arrow buttons look like share pills */
.continue-btn{
  border: 1px solid rgba(88, 87, 87, 0.25);
  background: #f3f0ec;
  color: var(--gray);
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.continue-btn:hover{
  background: rgba(252, 106, 10, 0.12);
  color: var(--golden);
  transform: translateY(-1px);
}

/* Horizontal scroll row */
.continue-row{
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.continue-row::-webkit-scrollbar{ display:none; }

/* Each card like your post-card mini */
.continue-card{
  flex: 0 0 auto;
  width: 200px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  overflow: hidden;
}

.continue-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.20);
}

/* Thumb area */
.continue-thumb{
  position: relative;
  width: 100%;
  height: 120px;
  background: #000;
  overflow: hidden;
}

.continue-thumb img,
.continue-thumb video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

/* Play overlay */
.continue-play{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.continue-play i{
  color: #fff;
  font-size: 18px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

/* Title */
.continue-title{
  padding: 10px 10px 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--jet);
}

/* Dark mode support */
body.dark .continue-card{
  background: #1b1b1b !important;
  box-shadow: 0 0 10px rgba(255,255,255,0.08) !important;
}

body.dark .continue-title{
  color: var(--pumpkin) !important;
}

body.dark .continue-btn{
  background: #222 !important;
  color: #ddd !important;
  border-color: #444 !important;
}

body.dark .continue-btn:hover{
  background: #333 !important;
  color: var(--pumpkin) !important;
}

/* Mobile: slightly smaller cards */
@media (max-width: 900px){
  .continue-card{ width: 170px; }
  .continue-thumb{ height: 105px; }
  .continue-header h3{
  font-size: 18px;
  font-weight: 700;
  color: var(--linen);
}
}
/* Make the story link stack avatar + text */
.mobile-stories-strip .story-avatar-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
}

/* Caption under each avatar */
.mobile-stories-strip .story-title-mini {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.1;
  max-width: 64px;          /* adjust to your avatar size */
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;  /* safety if a 2-word title is still long */
  color: inherit;           /* respects theme */
  opacity: 0.9;
}
/* Stories strip title – light theme */
.mobile-stories-strip .story-title-mini {
    color: var(--linen);   /* black */
}

/* Dark theme override */
body.dark .mobile-stories-strip .story-title-mini {
    color: var(--pumpkin);
}

/* Remove link blue everywhere in stories strip */
.mobile-stories-strip a {
    color: inherit;
}

.toast{
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 9999;

  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;

  background: #ff7a00;          /* orange */
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);

  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

/* Optional: dark theme tweak if you want */
body.dark .toast{
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
