/* ============================================================
   DR SARAL WELLNESS – Frontend Stylesheet
   Fixes: Mobile logo visibility + full responsive layout
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --primary: #FF0000;
  --primary-dark: #cc0000;
  --bg: #0a0a0a;
  --bg2: #141414;
  --bg3: #1c1c1c;
  --surface: #1e1e1e;
  --border: #2a2a2a;
  --text: #f0f0f0;
  --muted: #a0a0a0;
  --font-body: 'DM Sans', sans-serif;
  --font-display: 'Bebas Neue', sans-serif;
  --radius: 8px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ── Navbar ── */
#mainNav {
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  z-index: 1000;
}

/* ── LOGO FIX: Ensure logo displays on ALL screen sizes ── */
.navbar-brand {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 0;
  text-decoration: none;
  flex-shrink: 0;
  max-width: 60vw;           /* prevent overflow on narrow phones */
}

/* Logo image — visible on desktop AND mobile */
.navbar-brand img {
  display: block !important;
  max-height: 44px;
  max-width: 160px;
  width: auto;
  height: auto;
  object-fit: contain;
  /* Ensure it's never hidden by Bootstrap or other rules */
  visibility: visible !important;
  opacity: 1 !important;
}

/* Fallback text when logo image fails to load */
.navbar-brand span {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 1px;
  color: var(--text);
  white-space: nowrap;
}

.brand-icon {
  color: var(--primary);
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* Bootstrap nav overrides for dark theme */
.navbar-toggler {
  border-color: var(--border);
  padding: 6px 10px;
}
.navbar-toggler-icon {
  filter: invert(1);
}
.navbar-toggler:focus {
  box-shadow: none;
}

.nav-link {
  color: var(--muted) !important;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 6px 12px !important;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover,
.nav-link.active {
  color: var(--text) !important;
  background: var(--bg3);
}

/* Dropdown */
.dropdown-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
}
.dropdown-item {
  color: var(--muted);
  font-size: 0.875rem;
  border-radius: 4px;
  padding: 6px 12px;
}
.dropdown-item:hover {
  background: var(--bg3);
  color: var(--text);
}

/* Search bar */
.search-group .form-control {
  background: var(--bg3) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 6px 0 0 6px;
  font-size: 0.875rem;
}
.search-group .form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: none !important;
}
.btn-search {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: 0 6px 6px 0;
}
.btn-search:hover { background: var(--primary-dark); color: #fff; }

/* Collapsed nav on mobile */
#navMenu {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  margin-top: 10px;
  border-radius: var(--radius);
  padding: 8px;
}
@media (min-width: 992px) {
  #navMenu {
    background: transparent;
    border: none;
    margin-top: 0;
    padding: 0;
    border-radius: 0;
  }
}

/* ── Hero / Banner ── */
#siteBannerStrip {
  width: 100%;
  overflow: hidden;
  line-height: 0;
  background: #111;
  display: block;
  margin: 0;
  padding: 0;
}
#siteBannerStrip img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  object-position: center;
  display: block;
  margin: 0;
}

/* ── Red Section Divider Line ── */
.section-redline {
  width: 100%;
  height: 3px;
  background: var(--primary);
  display: block;
  line-height: 0;
  font-size: 0;
  margin: 0;
  padding: 0;
  border: none;
}

/* ── Typography ── */
.hero-title,
.section-title,
.post-title {
  font-family: var(--font-display);
  letter-spacing: 1.5px;
  line-height: 1.1;
}

.hero-title {
  font-size: clamp(2rem, 6vw, 4rem);
  color: var(--text);
}
.hero-title span { color: var(--primary); }

.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--text);
}

.post-title {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  color: var(--text);
  margin-bottom: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Cards ── */
.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  height: 100%;
}
.video-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 0, 0, 0.3);
}

.card-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg3);
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.video-card:hover .card-thumb img {
  transform: scale(1.04);
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 2.5rem;
  color: #fff;
}
.video-card:hover .play-overlay { opacity: 1; }

.card-body {
  padding: 14px;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.card-title:hover { color: var(--primary); }

.card-meta {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.card-meta i { margin-right: 3px; }

/* ── Post Meta ── */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 16px;
  align-items: center;
}
.post-meta i { margin-right: 4px; }
.post-meta .channel { color: var(--primary); }

/* ── Post Content / Description ── */
.post-description {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ── YouTube Embed ── */
.yt-embed-wrap {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.yt-embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Comments ── */
.comment-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.comment-author {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.comment-date {
  font-size: 0.75rem;
  color: var(--muted);
}
.comment-text {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.6;
}

/* ── Forms ── */
.form-control, .form-select {
  background: var(--bg3) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 6px;
  font-size: 0.875rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1) !important;
}
.form-control::placeholder { color: var(--muted); }
.form-label { color: var(--muted); font-size: 0.82rem; margin-bottom: 6px; }

/* ── Buttons ── */
.btn-primary,
.btn-red {
  background: var(--primary);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.2s;
}
.btn-primary:hover, .btn-red:hover {
  background: var(--primary-dark);
  color: #fff;
}
.btn-outline-secondary {
  border-color: var(--border);
  color: var(--muted);
}
.btn-outline-secondary:hover {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border);
}

/* ── Pagination ── */
.pagination .page-link {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px !important;
  margin: 0 2px;
  font-size: 0.875rem;
}
.pagination .page-link:hover {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border);
}
.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Footer ── */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 40px 0 20px;
  color: var(--muted);
  font-size: 0.875rem;
}
footer a {
  color: var(--muted);
  text-decoration: none;
}
footer a:hover { color: var(--primary); }

/* ── Utilities ── */
.text-primary { color: var(--primary) !important; }
.text-muted   { color: var(--muted)   !important; }
.bg-surface   { background: var(--surface); }
.border-dark  { border-color: var(--border) !important; }

/* ── Stat Badge (views/comments on cards) ── */
.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
}
.stat-badge i { font-size: 0.7rem; }

/* ── Sort Tabs ── */
.sort-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}
.sort-tab:hover { background: var(--bg3); color: var(--text); border-color: var(--border); }
.sort-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Footer ── */
footer,
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: auto;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 1.5px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.footer-brand i { color: var(--primary); }
.footer-desc { color: var(--muted); font-size: 0.82rem; line-height: 1.6; }
.footer-heading { font-size: 0.75rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 6px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.82rem; transition: color 0.2s; display: flex; align-items: center; gap: 4px; }
.footer-links a:hover { color: var(--primary); }
.footer-divider { border-color: var(--border); margin: 32px 0 16px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; flex-wrap: wrap; gap: 8px; }
.admin-link { color: var(--muted); text-decoration: none; opacity: 0.4; font-size: 0.72rem; }
.admin-link:hover { opacity: 1; color: var(--primary); }
.btn-subscribe { background: var(--primary); border: none; color: #fff; padding: 8px 18px; border-radius: 6px; font-size: 0.82rem; cursor: pointer; transition: background 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.btn-subscribe:hover { background: var(--primary-dark); }

/* ── Post page specific ── */
.video-embed {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ai-summary {
  background: rgba(255, 152, 0, 0.07);
  border: 1px solid rgba(255, 152, 0, 0.2);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 152, 0, 0.15);
  color: #FF9800;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.widget-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.share-section { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-share:hover { opacity: 0.85; }
.btn-share.twitter  { background: rgba(29, 161, 242, 0.15); color: #1da1f2; border: 1px solid rgba(29,161,242,.3); }
.btn-share.facebook { background: rgba(66, 103, 178, 0.15); color: #4267B2; border: 1px solid rgba(66,103,178,.3); }
.btn-share.whatsapp { background: rgba(37, 211, 102, 0.15); color: #25D366; border: 1px solid rgba(37,211,102,.3); }
.btn-share.copy     { background: rgba(255,255,255,.07); color: var(--muted); border: 1px solid var(--border); }

/* Comment section */
.comment-section { }
.comment-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.comment-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.comment-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.comment-item.reply {
  margin-left: 24px;
  background: var(--bg3);
}
.comment-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.comment-author { font-weight: 600; font-size: 0.875rem; color: var(--text); }
.comment-date { font-size: 0.75rem; color: var(--muted); }
.comment-text { font-size: 0.875rem; color: var(--muted); line-height: 1.6; }
.comment-actions { display: flex; gap: 8px; margin-top: 10px; }
.comment-action-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s;
}
.comment-action-btn:hover { color: var(--primary); }
.delete-comment-btn:hover { color: #f44336; }

/* Related posts */
.recent-post-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: opacity 0.2s;
}
.recent-post-item:last-child { border-bottom: none; }
.recent-post-item:hover { opacity: 0.8; }
.rp-thumb { width: 72px; height: 46px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.rp-title { font-size: 0.8rem; font-weight: 500; color: var(--text); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rp-date  { font-size: 0.72rem; color: var(--muted); margin-top: 3px; }

/* Card channel label */
.card-channel { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--muted); }

/* ── Mobile footer responsive ── */
@media (max-width: 767.98px) {
  .footer-bottom { flex-direction: column; text-align: center; }
  .share-section { gap: 6px; }
  .comment-item.reply { margin-left: 12px; }
  .sidebar-widget { padding: 14px; }
  .ai-summary { padding: 14px 16px; }
}


/* ── Tablet (max 991px) ── */
@media (max-width: 991.98px) {
  /* Logo: ensure it stays visible when hamburger menu is shown */
  .navbar-brand {
    max-width: 55vw;
  }
  .navbar-brand img {
    max-height: 38px;
    max-width: 140px;
  }

  #siteBannerStrip img {
    max-height: 200px;
  }
}

/* ── Mobile (max 767px) ── */
@media (max-width: 767.98px) {
  /* ── MOBILE LOGO FIX ──
     Force the logo image to always show on mobile.
     Bootstrap collapse doesn't affect .navbar-brand,
     but we explicitly enforce visibility here.
  */
  .navbar-brand {
    display: flex !important;
    align-items: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-width: 50vw;
  }

  .navbar-brand img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-height: 36px;
    max-width: 130px;
    width: auto;
    height: auto;
  }

  /* Ensure the fallback icon text is visible too */
  .brand-icon {
    font-size: 1.25rem;
  }

  /* Banner */
  #siteBannerStrip img {
    max-height: 140px;
  }

  /* Typography */
  .post-title   { font-size: 1.4rem; }
  .hero-title   { font-size: 1.8rem; }
  .section-title{ font-size: 1.3rem; }

  /* Cards */
  .card-body { padding: 10px; }
  .card-title { font-size: 0.85rem; }

  /* Post meta wraps nicely */
  .post-meta { gap: 8px; font-size: 0.78rem; }

  /* Tighten comment padding */
  .comment-block { padding: 12px 14px; }
}

/* ── Small phones (max 480px) ── */
@media (max-width: 479.98px) {
  .navbar-brand img {
    max-height: 32px;
    max-width: 110px;
  }
  .navbar-brand {
    max-width: 45vw;
  }

  .hero-title   { font-size: 1.5rem; }
  .post-title   { font-size: 1.25rem; }

  #siteBannerStrip img {
    max-height: 100px;
  }
}

/* ============================================================
   GLOBAL CONTRAST & VISIBILITY FIXES v4
   Ensures all text is readable by default (no hover-only)
   ============================================================ */

/* ── Frontend card titles always visible ── */
.card-title {
  color: #f0f0f0 !important;
}
.card-title a {
  color: #f0f0f0 !important;
  text-decoration: none;
}
.card-title a:hover {
  color: var(--primary) !important;
}

/* ── Card meta — secondary info, improved contrast ── */
.card-meta {
  color: #a8a8a8;
}

/* ── Post description ── */
.post-description {
  color: #b8b8b8;
}

/* ── Comment text ── */
.comment-text {
  color: #c0c0c0;
}

/* ── Nav links — always visible at rest ── */
.nav-link {
  color: #c0c0c0 !important;
}
.nav-link:hover,
.nav-link.active {
  color: #ffffff !important;
  background: var(--bg3);
}

/* ── Footer links ── */
footer a,
.footer-links a {
  color: #a0a0a0;
}
footer a:hover,
.footer-links a:hover {
  color: var(--primary);
}

/* ── Form labels on frontend ── */
.form-label {
  color: #c0c0c0;
}

/* ── Sidebar widget titles ── */
.widget-title {
  color: #b0b0b0;
}

/* ── Recent post titles ── */
.rp-title {
  color: #e8e8e8;
}

/* ── Sort tabs default state ── */
.sort-tab {
  color: #b8b8b8;
}

/* ── Post meta ── */
.post-meta {
  color: #b0b0b0;
}

/* ── Comment author ── */
.comment-author {
  color: #e8e8e8;
}

/* ── Search input text ── */
.search-group .form-control {
  color: #f0f0f0 !important;
}

/* ── Pagination ── */
.pagination .page-link {
  color: #c0c0c0;
  background: var(--surface);
  border-color: var(--border);
}

/* ── No content / empty states ── */
.empty-state,
.no-results {
  color: #909090;
}
