/* ===============================
   1. CORE VARIABLES & RESET
=============================== */
:root {
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  --primary: #d32f2f; 
  --primary-hover: #b71c1c;
  --text-main: #1a1a1a;
  --text-muted: #666;
  --bg-body: #f0f2f5;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="dark"] {
  --glass-bg: rgba(18, 18, 18, 0.65);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --text-main: #f0f0f0;
  --text-muted: #aaa;
  --bg-body: #0a0a0a;
}

[data-theme="light"] {
  --bg-body: #f4f6f8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  padding-top: 90px;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.5s ease;
}

/* ===============================
   2. GLASSMORPHISM & UTILITIES
=============================== */
.glass {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: var(--transition);
}

/* ===============================
   3. NAVBAR
=============================== */
.navbar {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 96%;
  max-width: 1400px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  z-index: 1000;
}

.nav-left { display: flex; align-items: center; gap: 15px; }
.nav-logo { height: 45px; width: auto; border-radius: var(--radius-sm); object-fit: contain; }
.powered-box { border-left: 2px solid var(--text-muted); padding-left: 12px; }
@media (min-width: 768px) { .powered-box { display: block; } }
.nav-left .powered { text-transform: none; letter-spacing: normal; }
.nav-right { display: flex; align-items: center; gap: 20px; }

.nav-link {
  text-decoration: none; font-size: 0.9rem; font-weight: 500; color: inherit;
  position: relative; opacity: 0.8; transition: var(--transition); cursor: pointer;
}
.nav-link::after {
  content: ''; position: absolute; width: 0; height: 2px; bottom: -4px; left: 0;
  background: var(--primary); transition: var(--transition);
}
.nav-link:hover { opacity: 1; }
.nav-link:hover::after { width: 100%; }

.toggle-btn {
  border: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,0.05); color: var(--text-main); font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
[data-theme="dark"] .toggle-btn { background: rgba(255,255,255,0.1); color: #ffccbc; }
.toggle-btn:hover { transform: rotate(15deg) scale(1.1); background: var(--primary); color: white; }

.hamburger-btn {
  font-size: 1.4rem; background: transparent; border: none; cursor: pointer;
  color: var(--text-main); transition: var(--transition);
}
.hamburger-btn:hover { color: var(--primary); transform: scale(1.1); }

/* ===============================
   4. SIDEBAR / DRAWER
=============================== */
.sidebar {
  position: fixed; top: 0; left: -300px; width: 280px; height: 100vh;
  z-index: 2000; padding: 25px;
  transition: left 0.4s cubic-bezier(0.77, 0, 0.175, 1);
  box-shadow: 4px 0 25px rgba(0,0,0,0.2);
}
.sidebar.open { left: 0; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; border-bottom: 1px solid var(--glass-border); padding-bottom: 15px; }
.sidebar-title { font-size: 1.1rem; font-weight: 700; }
.close-sidebar { font-size: 1.2rem; background: none; border: none; cursor: pointer; color: var(--text-main); }
.sidebar-menu-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 15px; font-weight: 700; }

.search-input {
  width: 100%; margin: 16px 0; padding: 12px 16px; border-radius: 30px;
  border: 1px solid var(--glass-border); outline: none; font-size: 0.9rem;
  background: rgba(255,255,255,0.1); color: inherit;
}
.search-input:focus { background: rgba(255,255,255,0.2); border-color: var(--primary); }

.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li {
  display: flex; align-items: center; padding: 14px 16px; margin-bottom: 8px;
  cursor: pointer; border-radius: var(--radius-md); color: var(--text-main);
  font-weight: 500; transition: var(--transition); gap: 12px;
}
.sidebar-list li:hover { background: rgba(211, 47, 47, 0.1); color: var(--primary); transform: translateX(5px); }
.sidebar-list li i { width: 20px; text-align: center; opacity: 0.8; }

.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); display: none; z-index: 1500; opacity: 0; transition: opacity 0.3s; }
.sidebar-overlay.show { display: block; opacity: 1; }

/* ===============================
   5. SECTIONS & CARDS
=============================== */
.section { width: 90%; max-width: 1200px; margin: 40px auto; padding: 40px 30px; text-align: center; }
.section-header h2 { margin: 0 0 10px; font-size: 1.8rem; }
.divider { height: 4px; width: 60px; background: var(--primary); margin: 0 auto 30px; border-radius: 2px; }

.gist-card {
  display: flex; gap: 20px; padding: 20px; margin-bottom: 20px; width: 100%;
  cursor: pointer; border-radius: var(--radius-md); text-align: left;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: var(--transition); align-items: center;
}
.gist-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.gist-img { width: 160px; height: 120px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.gist-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.gist-title { font-weight: 600; margin-bottom: 6px; font-size: 1.1rem; }
.gist-meta { font-size: 0.8rem; opacity: 0.7; margin-bottom: 8px; }
.gist-preview { font-size: 0.9rem; opacity: 0.9; line-height: 1.5; }

mark { background: #ffeb3b; color: #000; padding: 0 2px; border-radius: 2px; }
.no-results { margin-top: 20px; opacity: 0.8; }

/* ===============================
   6. FOOTER
=============================== */
footer { width: 100%; padding: 50px 20px 30px; margin-top: 50px; }

.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; max-width: 1200px; margin: 0 auto 40px; }
.footer-col h4 { margin: 0 0 20px; font-size: 1.1rem; color: var(--primary); }
.footer-col { display: flex; flex-direction: column; gap: 12px; }

.footer-link {
  text-decoration: none; color: var(--text-main); opacity: 0.7; font-size: 0.9rem;
  transition: var(--transition); display: flex; align-items: center; gap: 8px;
}
.footer-link:hover { opacity: 1; color: var(--primary); transform: translateX(5px); }

.footer-bottom { text-align: center; border-top: 1px solid var(--glass-border); padding-top: 20px; max-width: 800px; margin: 0 auto; }
.footer-socials { display: flex; justify-content: center; gap: 22px; margin-bottom: 20px; }
.footer-socials a { color: var(--text-main); opacity: 0.7; transition: 0.3s; }
.footer-socials a:hover { opacity: 1; color: var(--primary); transform: translateY(-3px); }

.footer-disclaimer { font-size: 0.8rem; opacity: 0.6; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.copyright { font-size: 0.85rem; opacity: 0.5; margin: 0; }

/* Trusted Section - FIXED SIZE */
.trusted-grid { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; margin-top: 20px; }
.trusted-item { text-align: center; max-width: 180px; }

/* FIXED: Reduced size to small standard (50px) */
.trusted-logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--primary); /* Thinner border */
  padding: 4px;
  background: white;
  object-fit: contain;
  margin-bottom: 10px;
  transition: transform 0.3s ease;
}

.trusted-logo:hover { transform: scale(1.1); }
.trusted-name { margin: 10px 0 0; font-size: 0.85rem; font-weight: 500; }

/* ===============================
   7. MODAL / POPUP
=============================== */
.popup-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); display: none; z-index: 3000; }
.popup {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 90%; max-width: 600px; max-height: 80vh; display: none; z-index: 3001; overflow-y: auto;
}
.popup-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--glass-border); padding-bottom: 15px; }
.popup-header span { font-size: 1.2rem; font-weight: 700; }
.popup-close { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--text-main); transition: 0.2s; }
.popup-close:hover { color: var(--primary); transform: rotate(90deg); }
.popup-content { max-height: 60vh; overflow-y: auto; }

.share-btn {
  background: var(--primary); border: none; border-radius: 8px; padding: 8px 12px;
  margin: 6px 6px 0 0; cursor: pointer; color: white; font-size: 0.85rem; transition: 0.25s;
}
.share-btn:hover { opacity: 0.85; transform: translateY(-2px); }

/* ===============================
   8. ANIMATIONS & FX
=============================== */
.background-blobs {
  position: fixed; top:0; left:0; width:100vw; height:100vh; z-index: -2; pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,0,0,0.08), transparent 40%),
    radial-gradient(circle at 80% 50%, rgba(255,0,0,0.06), transparent 40%),
    radial-gradient(circle at 40% 80%, rgba(211,47,47,0.05), transparent 40%);
  filter: blur(60px);
}

/* ================= NEWSPAPER / HERO SECTION ================= */
.newspaper-grid {
    display: block; max-width: 900px; margin: 0 auto;
    background: #fdfbf7; padding: 50px; border: 1px solid #dcdcdc;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); color: #111;
}
.newspaper-header { text-align: center; border-bottom: 4px double #111; margin-bottom: 40px; padding-bottom: 20px; }
.newspaper-header h2 { font-family: 'Playfair Display', serif; font-size: 3rem; font-weight: 900; text-transform: uppercase; letter-spacing: 2px; color: #111; margin: 0; }
.newspaper-header p { font-family: 'Merriweather', serif; font-size: 1rem; font-style: italic; color: #555; margin-top: 10px; }

.newspaper-card {
    width: 100%; background: transparent; border: none; border-radius: 0;
    cursor: pointer; display: flex; flex-direction: column;
    padding-bottom: 40px; border-bottom: 1px solid #ccc; margin-bottom: 30px;
}
.newspaper-card:hover .newspaper-title { color: var(--primary); text-decoration: underline; }

.newspaper-title {
    font-family: 'Playfair Display', serif; font-size: 2.5rem; font-weight: 700;
    line-height: 1.1; margin-bottom: 15px; text-align: left; text-transform: capitalize;
}
.newspaper-img {
    width: 100%; height: auto; max-height: 400px; object-fit: cover;
    filter: grayscale(100%) contrast(110%); border: 1px solid #000; margin: 20px 0;
    transition: filter 0.3s;
}
.newspaper-card:hover .newspaper-img { filter: grayscale(0%); }
.newspaper-content { width: 100%; }
.newspaper-desc {
    font-family: 'Merriweather', serif; font-size: 1.05rem; line-height: 1.8; color: #222;
    text-align: justify; column-count: 2; column-gap: 40px; column-rule: 1px solid #eee;
}

/* =========================================================
   CATEGORY BROWSER STYLES (UNIQUE & ANIMATED)
========================================================= */
.category-browser-section { padding: 40px 20px; margin-top: 20px; text-align: center; }
.category-browser-section h2 { font-size: 1.5rem; margin-bottom: 30px; color: var(--text-main); display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; max-width: 1000px; margin: 0 auto; }

.category-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 16px;
    padding: 20px; cursor: pointer; transition: all 0.3s ease;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    position: relative; overflow: hidden;
    opacity: 0; transform: translateY(30px) scale(0.9);
    animation: popIn 0.5s ease forwards;
}
.category-card:hover { transform: translateY(-5px) scale(1.02); border-color: var(--primary); box-shadow: 0 10px 25px rgba(211, 47, 47, 0.15); }
.category-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--primary); transform: scaleX(0); transition: transform 0.3s ease; }
.category-card:hover::before { transform: scaleX(1); }

.category-icon-box {
    width: 50px; height: 50px; border-radius: 50%; background: rgba(211, 47, 47, 0.1);
    display: flex; align-items: center; justify-content: center; margin-bottom: 15px;
    color: var(--primary); font-size: 1.3rem; transition: all 0.3s ease;
}
.category-card:hover .category-icon-box { background: var(--primary); color: white; transform: rotate(-10deg) scale(1.1); }

.category-card h3 { font-size: 1rem; margin: 0 0 8px 0; color: var(--text-main); font-weight: 600; }
.category-card p { font-size: 0.75rem; color: var(--text-muted); margin: 0; line-height: 1.4; }

@keyframes popIn { 0% { opacity: 0; transform: translateY(30px) scale(0.9); } 100% { opacity: 1; transform: translateY(0) scale(1); } }

/* =========================================================
   NEWSPAPER SHARE BUTTONS (FIXED RESPONSIVE)
========================================================= */
.newspaper-share-actions {
    display: flex; gap: 10px; margin-top: 25px; padding-top: 20px;
    border-top: 1px solid #ddd; justify-content: flex-start;
}

.newspaper-share-btn {
    background: transparent; border: 1px solid #111; color: #111;
    padding: 8px 16px; border-radius: 0; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 6px;
    transition: all 0.2s; text-transform: uppercase;
}
.newspaper-share-btn:hover { background: #111; color: #fff; }
.newspaper-share-btn i { font-size: 0.9rem; }

/* ===============================
   9. RESPONSIVE FIXES
=============================== */
@media (max-width: 768px) {
  .nav-link { display: none; }
  .gist-card { flex-direction: column; text-align: center; align-items: center; }
  .gist-img { width: 100%; height: 200px; }

  /* Newspaper Mobile Fixes */
  .newspaper-grid { padding: 20px 15px; } /* Reduced padding */
  .newspaper-header h2 { font-size: 2rem; }
  .newspaper-title { font-size: 1.6rem; } /* Smaller title */
  .newspaper-desc { column-count: 1; font-size: 0.95rem; }
  
  /* Share Buttons Mobile Fixes */
  .newspaper-share-actions {
      flex-wrap: wrap; /* Allow wrapping */
      justify-content: center; /* Center them */
      gap: 8px;
      margin-top: 20px;
  }
  .newspaper-share-btn {
      flex: 1 1 45%; /* Take up 45% width (2 per row) */
      justify-content: center;
      padding: 10px; /* Comfortable touch size */
      font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .navbar { width: 94%; padding: 10px 15px; }
  .nav-logo { height: 35px; }
  .popup { width: 95%; max-width: 350px; padding: 20px; }
  
  /* Footer Trusted Logos - Even smaller on very small screens */
  .trusted-logo { width: 40px; height: 40px; }
  .trusted-name { font-size: 0.75rem; }
}
/* =========================================
   12. AD NOTICE BANNER
   ========================================= */

.ad-notice-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(90deg, #ff9f43, #ff6b6b);
  color: #fff;
  text-align: center;
  padding: 10px 15px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1.4;
}

.ad-notice-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.ad-notice-content i {
  font-size: 1rem;
  opacity: 0.9;
}

.ad-notice-content strong {
  text-decoration: underline;
  font-weight: 800;
}

/* --- Text Switching for Mobile --- */
.ad-short { display: none; } /* Hidden on Desktop */
.ad-long { display: inline; } /* Shown on Desktop */

/* --- LAYOUT ADJUSTMENTS FOR BANNER --- */

/* Push Navbar down (Desktop) */
.navbar {
  top: 42px !important; 
}

/* Push Hero Section down (Desktop) */
.hero-section {
  margin-top: 142px !important; 
}

/* =========================================
   13. MOBILE FIXES (BANNER & LAYOUT)
   ========================================= */
@media (max-width: 600px) {
  /* Switch text visibility */
  .ad-long { display: none; }
  .ad-short { display: inline; }

  /* Adjust banner padding for mobile */
  .ad-notice-banner {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  /* Move Navbar down to fit short banner */
  .navbar {
    top: 38px !important;
  }

  /* Move Hero down to fit navbar + banner */
  .hero-section {
    margin-top: 130px !important;
  }
}