/*
Theme Name: Wassite Modern Pro
Theme URI: https://wassiteonline.com
Author: Wassite Editorial Team
Author URI: https://wassiteonline.com
Description: قالب إرشادي وخدمي عصري فائق السرعة، مصمم ومبسط لتقديم شروحات منحة البطالة، خدمات منصة وسيط، ودليل الطالب الجامعي في الجزائر. متوافق 100% مع معايير Google AdSense وتجربة المستخدم السريعة.
Version: 3.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wassit
Domain Path: /languages
Tags: guides, minha, anem, students, speed, core-web-vitals, mobile, rtl, arabic
*/

/* ==========================================================================
   1. CSS Variables & Theme Engine (Light / Dark)
   ========================================================================== */
:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  /* Forest Emerald - Human, Trustworthy, Non-Governmental */
  --primary: #0f766e;
  --primary-hover: #115e59;
  --primary-light: #f0fdfa;
  --primary-border: #99f6e4;
  --primary-contrast: #ffffff;

  /* Pillar Accent Colors */
  --accent-minha: #0f766e;
  --accent-minha-bg: #f0fdfa;
  --accent-job: #0284c7;
  --accent-job-bg: #f0f9ff;
  --accent-student: #7c3aed;
  --accent-student-bg: #faf5ff;

  --border-light: #e2e8f0;
  --border-subtle: #f1f5f9;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 4px 16px -2px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 10px 22px -4px rgba(15, 118, 110, 0.14), 0 4px 6px -2px rgba(15, 23, 42, 0.04);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-family: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --container-width: 1240px;
  --header-height: 72px;
}

/* Dark Mode Theme Definition */
html.dark,
body.dark {
  --bg-page: #0b1120;
  --bg-card: #131c31;
  --bg-card-subtle: #1c2742;
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --primary: #14b8a6;
  --primary-hover: #2dd4bf;
  --primary-light: rgba(20, 184, 166, 0.12);
  --primary-border: rgba(20, 184, 166, 0.3);
  --primary-contrast: #0b1120;

  --accent-minha: #2dd4bf;
  --accent-minha-bg: rgba(45, 212, 191, 0.12);
  --accent-job: #38bdf8;
  --accent-job-bg: rgba(56, 189, 248, 0.12);
  --accent-student: #a78bfa;
  --accent-student-bg: rgba(167, 139, 250, 0.12);

  --border-light: #24324f;
  --border-subtle: #192338;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 18px -2px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 12px 28px -4px rgba(20, 184, 166, 0.2);
}

/* ==========================================================================
   2. Reset & Global Styles
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  direction: rtl;
  text-align: right;
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.7;
  padding-bottom: 70px; /* Space for mobile sticky nav */
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

@media (min-width: 992px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

button, input, select, textarea {
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ==========================================================================
   3. Site Header & Brand Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  height: var(--header-height);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

html.dark .site-header {
  background-color: rgba(19, 28, 49, 0.95);
  border-bottom-color: var(--border-light);
}

.header-main {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.25);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.logo-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.main-nav {
  display: none;
  align-items: center;
  gap: 8px;
}

@media (min-width: 992px) {
  .main-nav {
    display: flex;
  }
}

.main-nav a {
  padding: 8px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.main-nav a:hover {
  color: var(--primary);
  background-color: var(--primary-light);
}

.main-nav a.active {
  color: var(--primary);
  background-color: var(--primary-light);
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: var(--border-light);
  color: var(--primary);
}

.theme-toggle-btn .sun-icon {
  display: none;
}

.theme-toggle-btn .moon-icon {
  display: block;
}

html.dark .theme-toggle-btn .sun-icon {
  display: block;
}

html.dark .theme-toggle-btn .moon-icon {
  display: none;
}

.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  cursor: pointer;
}

@media (min-width: 992px) {
  .mobile-menu-toggle {
    display: none;
  }
}

/* ==========================================================================
   4. Mobile Drawer
   ========================================================================== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  z-index: 1090;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(2px);
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 290px;
  max-width: 85vw;
  height: 100%;
  background: var(--bg-card);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px;
  overflow-y: auto;
}

.mobile-drawer.open {
  right: 0;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.drawer-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 0;
}

.drawer-nav a {
  padding: 12px 14px;
  font-weight: 600;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.drawer-nav a:hover,
.drawer-nav a.active {
  background: var(--primary-light);
  color: var(--primary);
}

.drawer-footer-note {
  margin-top: auto;
  padding: 14px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   5. Hero & Search Section
   ========================================================================== */
.hero-section {
  padding: 34px 0 24px;
  background: radial-gradient(circle at 50% 0%, var(--primary-light) 0%, transparent 70%);
  margin-bottom: 24px;
  border-radius: var(--radius-lg);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 12px;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 2.3rem;
  }
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.hero-search-form {
  position: relative;
  max-width: 620px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, box-shadow 0.2s;
  padding: 6px;
}

.hero-search-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 18px;
  font-size: 1rem;
  color: var(--text-main);
  outline: none;
}

.search-submit {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

.search-submit:hover {
  background: var(--primary-hover);
}

.hero-categories {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
}

.hero-cat-label {
  color: var(--text-muted);
  font-weight: 600;
}

.hero-cat-pill {
  padding: 5px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  color: var(--text-secondary);
  font-weight: 600;
  transition: all 0.2s;
}

.hero-cat-pill:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Category Filter Bar (Archive / General) */
.category-filter-bar {
  overflow-x: auto;
  white-space: nowrap;
  padding: 8px 0;
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
}

.filter-pills {
  display: inline-flex;
  gap: 8px;
}

.filter-pill {
  display: inline-block;
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.filter-pill:hover,
.filter-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* ==========================================================================
   6. Main Layout & Sidebar System
   ========================================================================== */
.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 992px) {
  .main-layout {
    grid-template-columns: 1fr 340px;
  }
}

.content-area {
  min-width: 0; /* Prevents CSS grid blowout */
}

.section-header-bar {
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-subtle);
}

.section-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.section-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* ==========================================================================
   7. Guides Grid & Card Components
   ========================================================================== */
.guides-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

@media (min-width: 640px) {
  .guides-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .guides-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Featured Lead Card (Hero Guide on Homepage) */
.featured-lead-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-top: 5px solid var(--accent-minha);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 768px) {
  .featured-lead-card {
    padding: 30px 32px;
  }
}

.featured-lead-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.featured-lead-card.card-cat-minha { border-top-color: var(--accent-minha); }
.featured-lead-card.card-cat-job { border-top-color: var(--accent-job); }
.featured-lead-card.card-cat-student { border-top-color: var(--accent-student); }

.featured-lead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.featured-lead-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topic-type-chip.featured-chip {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.featured-lead-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 12px;
}

@media (min-width: 768px) {
  .featured-lead-title {
    font-size: 1.7rem;
  }
}

.featured-lead-title a {
  color: var(--text-main);
  transition: color 0.2s;
}

.featured-lead-title a:hover {
  color: var(--primary);
}

.featured-lead-excerpt {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
  max-width: 900px;
}

.featured-lead-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.88rem;
}

.featured-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #ffffff !important;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, transform 0.2s;
}

.featured-read-btn:hover {
  background: var(--primary-hover);
  transform: translateX(-3px);
}

/* Typographic Card (Clean, Zero Image Dependency) */
.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.guide-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-border);
}

.typographic-card {
  padding: 22px 20px;
  border-top: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.typographic-card.card-cat-minha { border-top-color: var(--accent-minha); }
.typographic-card.card-cat-job { border-top-color: var(--accent-job); }
.typographic-card.card-cat-student { border-top-color: var(--accent-student); }

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-badges-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.topic-type-chip {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.card-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.card-badge.minha {
  background: var(--accent-minha-bg);
  color: var(--accent-minha);
}

.card-badge.job-seeker,
.card-badge.job {
  background: var(--accent-job-bg);
  color: var(--accent-job);
}

.card-badge.students,
.card-badge.student {
  background: var(--accent-student-bg);
  color: var(--accent-student);
}

.card-reading-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typographic-card .guide-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.45;
  margin-bottom: 10px;
}

.typographic-card .guide-card-title a {
  color: var(--text-main);
  transition: color 0.2s;
}

.typographic-card .guide-card-title a:hover {
  color: var(--primary);
}

.typographic-card .guide-card-excerpt {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 18px;
  flex: 1;
}

.typographic-card .guide-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.guide-card-date {
  color: var(--text-muted);
}

.guide-read-btn {
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
}

.guide-read-btn:hover {
  gap: 8px;
  color: var(--primary-hover);
}
  gap: 8px;
  color: var(--primary-hover);
}

/* ==========================================================================
   8. Numbered Pagination
   ========================================================================== */
.pagination-wrapper {
  margin: 36px 0;
  display: flex;
  justify-content: center;
}

.pagination-wrapper .nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-wrapper .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.pagination-wrapper .page-numbers:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.pagination-wrapper .page-numbers.current {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.pagination-wrapper .page-numbers.dots {
  background: transparent;
  border-color: transparent;
}

/* ==========================================================================
   9. Helper App Banner / Section
   ========================================================================== */
.helper-app-section {
  margin: 40px 0;
}

.helper-app-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--primary-light) 100%);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-card);
}

@media (min-width: 768px) {
  .helper-app-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 34px;
  }
}

.helper-app-text {
  flex: 1;
}

.helper-app-badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--primary);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.helper-app-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.helper-app-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
}

.helper-app-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

@media (min-width: 768px) {
  .helper-app-action {
    align-items: flex-end;
  }
}

.helper-app-btn {
  display: inline-block;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
  transition: all 0.2s;
  text-align: center;
}

.helper-app-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.helper-app-disclaimer {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   10. Single Article Styling
   ========================================================================== */
.article-container {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
}

@media (min-width: 768px) {
  .article-container {
    padding: 34px 40px;
  }
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumbs a {
  color: var(--text-secondary);
}

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

.breadcrumb-current {
  color: var(--text-muted);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-header {
  margin-bottom: 24px;
}

.article-title {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-main);
  margin: 12px 0 16px;
}

@media (min-width: 768px) {
  .article-title {
    font-size: 2.2rem;
  }
}

.article-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.article-meta-bar span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.font-sizer-controls {
  margin-right: auto;
  display: flex;
  gap: 4px;
}

.font-sizer-controls button {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

/* Executive Guide Briefing Card (Replaces generic raster images) */
.article-summary-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-right: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin: 22px 0 28px;
}

.summary-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.summary-card-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary-border);
}

.summary-card-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.summary-lead-text {
  font-size: 1.05rem;
  color: var(--text-main);
  line-height: 1.75;
  margin-bottom: 14px;
}

.summary-features-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: var(--radius-xl);
}

/* Fallback for legacy featured images if present */
.article-featured-image {
  margin: 20px 0 28px;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-card-subtle);
}

.article-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Interactive Table of Contents (TOC) */
.toc-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 24px 0 32px;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.toc-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
}

.toc-toggle-icon {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.toc-content {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-light);
}

.toc-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-content a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color 0.2s;
  display: inline-block;
}

.toc-content a:hover {
  color: var(--primary);
  font-weight: 600;
}

/* Article Body Typography */
.article-body {
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--text-main);
  word-wrap: break-word;
}

.article-body p {
  margin-bottom: 1.4rem;
}

.article-body h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 36px 0 16px;
  padding-right: 14px;
  border-right: 4px solid var(--primary);
  line-height: 1.4;
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 26px 0 12px;
  line-height: 1.4;
}

.article-body ul,
.article-body ol {
  margin: 16px 0 24px;
  padding-right: 24px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--bg-card-subtle);
  border-right: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  font-style: italic;
  color: var(--text-secondary);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}

.article-body th,
.article-body td {
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  text-align: right;
}

.article-body th {
  background: var(--bg-card-subtle);
  font-weight: 700;
  color: var(--text-main);
}

.article-body tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.015);
}

html.dark .article-body tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Callout & Notice Boxes */
.source-reference-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 26px 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.source-reference-box strong {
  color: var(--text-main);
  display: block;
  margin-bottom: 4px;
}

.notice-box.independence-alert {
  background: rgba(15, 118, 110, 0.06);
  border: 1px solid var(--primary-border);
  border-right: 5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 26px 0;
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.65;
}

.notice-box.independence-alert strong {
  color: var(--primary);
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

/* Share Buttons Bar */
.share-section {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 0;
  margin: 30px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.share-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.share-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.share-btn {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
}

.share-btn:hover {
  opacity: 0.9;
}

.share-btn.wa { background-color: #25d366; }
.share-btn.tg { background-color: #229ed9; }
.share-btn.fb { background-color: #1877f2; }
.share-btn.copy { background-color: var(--text-secondary); }

/* Editorial Bio Box */
.author-bio-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 30px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  flex-shrink: 0;
}

.author-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.author-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Related Guides */
.related-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 2px solid var(--border-subtle);
}

.related-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.related-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.related-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.related-card.typographic-related {
  padding: 16px 18px;
  border-top: 3px solid var(--primary);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.related-card-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  display: inline-block;
}

.related-card.typographic-related .related-card-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
  padding: 0;
  line-height: 1.45;
  flex: 1;
}

.related-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.related-card-btn {
  font-weight: 700;
  color: var(--primary);
}

/* ==========================================================================
   11. Sidebar Styling
   ========================================================================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.widget-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

/* Minhati Widget */
.app-widget-box {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--primary-light) 100%);
  border: 1px solid var(--primary-border);
}

.app-widget-badge {
  display: inline-block;
  padding: 3px 8px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.app-widget-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.app-widget-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}

.app-widget-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app-widget-btn {
  display: block;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  transition: background 0.2s;
}

.app-widget-btn:hover {
  background: var(--primary-hover);
}

.app-widget-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* CCP Calendar Widget */
.calendar-widget-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.calendar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.cal-digits {
  font-weight: 700;
  color: var(--text-main);
}

.cal-day {
  font-weight: 800;
  color: var(--primary);
}

/* Sidebar Navigation Pills */
.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-cat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  transition: all 0.2s;
}

.sidebar-cat-link:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.cat-arrow {
  color: var(--text-muted);
}

/* Helpful Portals */
.sidebar-portals-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-portals-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.sidebar-portals-list a:hover {
  color: var(--primary);
}

.ext-badge {
  font-size: 0.72rem;
  padding: 2px 6px;
  background: var(--border-light);
  border-radius: 3px;
  color: var(--text-muted);
}

/* Sidebar Articles List (Related & Recent Guides) */
.related-sidebar-widget {
  border-top: 3px solid var(--primary);
}

.popular-sidebar-widget {
  border-top: 3px solid var(--accent-job);
}

.sidebar-articles-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
}

.sidebar-articles-list li {
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-light);
}

.sidebar-articles-list li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.sidebar-article-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.sidebar-article-item:hover {
  transform: translateX(-3px);
}

.sidebar-item-bullet {
  color: var(--primary);
  font-size: 1.25rem;
  line-height: 1.1;
  flex-shrink: 0;
}

.sidebar-item-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-item-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-main);
  transition: color 0.2s;
}

.sidebar-article-item:hover .sidebar-item-title {
  color: var(--primary);
}

.sidebar-item-submeta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ==========================================================================
   12. Footer Styling
   ========================================================================== */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 50px 0 24px;
  border-top: 1px solid var(--border-light);
  margin-top: 50px;
}

html.dark .site-footer {
  background: #070b14;
  border-top-color: var(--border-light);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 36px;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }
}

.footer-brand {
  margin-bottom: 12px;
}

.footer-brand-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
}

.footer-brand-subtitle {
  font-size: 0.78rem;
  color: #64748b;
}

.footer-about-text {
  font-size: 0.88rem;
  line-height: 1.65;
  color: #94a3b8;
}

.footer-heading {
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 0.88rem;
  color: #94a3b8;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #14b8a6;
}

.footer-disclaimer-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 28px 0;
  font-size: 0.85rem;
  line-height: 1.65;
  color: #94a3b8;
}

.footer-disclaimer-card strong {
  color: #f1f5f9;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    text-align: right;
  }
}

.footer-sub-links {
  display: flex;
  gap: 10px;
  align-items: center;
}

.footer-sub-links a {
  color: #64748b;
}

.footer-sub-links a:hover {
  color: #14b8a6;
}

/* ==========================================================================
   13. Mobile Bottom Sticky Bar
   ========================================================================== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1050;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

@media (min-width: 992px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.mobile-bottom-nav a,
.mobile-bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  flex: 1;
  height: 100%;
}

.mobile-bottom-nav a.active,
.mobile-bottom-nav a:hover {
  color: var(--primary);
}

.mobile-bottom-nav button .sun-icon {
  display: none;
}
.mobile-bottom-nav button .moon-icon {
  display: block;
}
html.dark .mobile-bottom-nav button .sun-icon {
  display: block;
}
html.dark .mobile-bottom-nav button .moon-icon {
  display: none;
}

/* ==========================================================================
   14. Utility Components: Progress Bar & Toast
   ========================================================================== */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s linear;
}

.toast-msg {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-xl);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.empty-state-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
}
