/* ==========================================================================
   1. GLOBAL RESET & BASE STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
}

body {
  background-color: #F8F9FA;
  margin: 0;
  font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
  color: #333333;
}

/* ==========================================================================
   2. HOMEPAGE SPECIFIC STYLING (Dark Green Hero Layout)
   ========================================================================== */
.home-page {
  background-color: #043c0c;
  overflow: hidden;
}

.hero-home {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 20px;
  text-align: center;
}

.hero-title {
  color: #ffffff;
  font-size: 56px;
  font-weight: 800;
  margin: 0 0 10px 0;
  letter-spacing: -1px;
}

.hero-subtitle {
  color: #C2A45F;
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 40px 0;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hero-nav {
  display: flex;
  gap: 15px;
  margin-bottom: 50px;
}

.hero-nav a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 30px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.hero-nav a:hover,
.hero-nav a.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.search-container {
  width: 100%;
  max-width: 500px;
}

#siteSearch {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

#siteSearch::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#siteSearch:focus {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: #C2A45F;
  box-shadow: 0 0 20px rgba(194, 164, 95, 0.2);
}

/* ==========================================================================
   3. SUBPAGES GLOBAL STYLING (Clean White Headers)
   ========================================================================== */
.site-header {
  background-color: rgba(255, 255, 255, 0.85);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  padding: 15px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#mainLogo {
  color: #043c0c;
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

#subLogo {
  color: #666666;
  font-size: 12px;
  margin: 2px 0 0 0;
}

.header-nav a {
  display: inline-block;
  padding: 8px 16px;
  color: #444444;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.header-nav a:hover,
.header-nav a.active {
  background-color: rgba(4, 60, 12, 0.08);
  color: #043c0c;
}

.page-title {
  color: #043c0c;
  text-align: center;
  font-size: 36px;
  margin-top: 60px;
  margin-bottom: 40px;
}

/* ==========================================================================
   4. BIOGRAPHIES EXTENDED CARD GRID & SIDE-BY-SIDE PANELS
   ========================================================================== */
.bioCard {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 20px; 
  padding: 20px;
  max-width: 1200px; 
  margin: 0 auto;
}

.card {
  background-color: #FFFFFF;
  flex: 1 1 calc(33.333% - 20px);
  min-width: 280px; 
  max-width: calc(33.333% - 20px);
  padding: 30px 20px !important;
  text-decoration: none;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  text-align: center;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(4, 60, 12, 0.08);
  background-color: #FFFFFF;
}

.card p {
  margin: 0;
  color: #333333;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.card .ar-title {
  font-family: 'Amiri', 'Traditional Arabic', serif;
  font-size: 21px;
  color: #043c0c;
  display: block;
  margin-top: 10px;
  font-weight: normal;
}

.bio-split-row {
  display: flex;
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  margin-top: 20px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.bio-panel {
  width: 50%;
  padding: 35px;
  line-height: 1.8;
  font-size: 16px;
  color: #333333 !important;
}

.bio-english-panel {
  border-right: 1px solid #EDF2F7;
  text-align: left;
}

.bio-arabic-panel {
  text-align: right;
  font-family: 'Amiri', 'Traditional Arabic', serif;
  font-size: 28px;
  background-color: #FAFDFB;
}

.bio-meta-bar {
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #64748B;
  margin-bottom: 10px;
}

.bio-index-tag {
  background-color: #043c0c;
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
}

.bio-layer-tag {
  color: #8C733E;
  font-weight: 600;
}

/* ==========================================================================
   5. ARTICLES FEED & SINGLE ARTICLE LAYOUT
   ========================================================================== */
.articles-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px 60px 20px;
}

.articles-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.article-item {
  background-color: #FFFFFF;
  padding: 35px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(4, 60, 12, 0.05);
}

.article-meta {
  font-size: 13px;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.article-title {
  margin: 0 0 12px 0;
  font-size: 24px;
  font-weight: 700;
}

.article-title a {
  color: #043c0c;
  text-decoration: none;
  transition: color 0.2s ease;
}

.article-title a:hover {
  color: #8C733E;
}

.article-excerpt {
  color: #555555;
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 20px 0;
}

.read-more {
  display: inline-block;
  color: #8C733E;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: letter-spacing 0.2s ease;
}

.read-more:hover {
  letter-spacing: 0.5px;
  color: #043c0c;
}

/* ==========================================================================
   6. LIBRARY GRID SYSTEM & BOOK HOVER FOCUS STYLES
   ========================================================================== */
.library-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 80px 20px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 250px); /* Locks every book to a tight, identical width */
  gap: 25px; /* Brings the books much closer together */
  justify-content: center; /* Centers the whole shelf cleanly without spreading individual items */
  align-items: start;
}


.book-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.03);
  width: 100%;
  max-width: 260px;
  text-align: center;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
  overflow: hidden; /* Clips elements until expansion */
}

/* Smooth expansion and modern green glow border depth on hover */
.book-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 35px rgba(4, 60, 12, 0.08);
}

.book-cover {
  width: 100%;
  height: 240px;
  border-radius: 6px 12px 12px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  position: relative;
  box-shadow: 3px 6px 15px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.book-cover::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  width: 3px;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
}

.cover-text-calligraphy {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.25);
  font-size: 50px;
  font-weight: 700;
}

.color-1 { background: linear-gradient(135deg, #043c0c, #022507); }

.book-title {
  font-size: 16px;
  font-weight: 700;
  color: #043c0c;
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.book-author {
  font-size: 13px;
  color: #777777;
  margin: 0 0 0 0; /* Clears bottom margin at rest state */
  transition: margin-bottom 0.3s ease;
}

/* ==========================================================================
   HIDDEN REVEAL EXTRA PANEL DETAILS (Description + Download elements)
   ========================================================================== */
.book-revealed-details {
  max-height: 0; /* Fully collapsed by default */
  opacity: 0; /* Invisible by default */
  transform: translateY(10px);
  transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), 
              opacity 0.3s ease, 
              transform 0.3s ease;
}

/* Trigger reveal states sequentially when parent card element is hovered */
.book-card:hover .book-revealed-details {
  max-height: 200px; /* Expands container smoothly */
  opacity: 1; /* Fades in content cleanly */
  transform: translateY(0);
}

.book-card:hover .book-author {
  margin-bottom: 15px; /* Injects breathing room before paragraph divider */
}

/* ==========================================================================
   7. ABOUT PAGE CONTENT LAYOUT
   ========================================================================== */
.about-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px 80px 20px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
  align-items: start;
}

.about-card {
  background-color: #FFFFFF;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.03);
  text-align: left;
}

.about-section-title {
  color: #043c0c;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 20px 0;
  position: relative;
  padding-bottom: 10px;
}

.about-section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background-color: #c2a45f;
  border-radius: 2px;
}

.about-text {
  font-size: 16px;
  line-height: 1.7;
  color: #444444;
  margin: 0 0 20px 0;
}

.about-text:last-child {
  margin-bottom: 0;
}

.about-text strong {
  color: #043c0c;
  font-weight: 600;
}

.profile-card {
  background-color: #FFFFFF;
  padding: 35px 25px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.03);
  text-align: center;
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
  color: #043c0c;
  margin: 0 0 12px 0;
}

.profile-bio {
  font-size: 14px;
  line-height: 1.6;
  color: #666666;
  margin: 0 0 25px 0;
}

.profile-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 15px;
  font-size: 12px;
  color: #999999;
  font-weight: 500;
}

/* ==========================================================================
   8. DYNAMIC VIEWS STYLING (Injected Content Panels)
   ========================================================================== */
#fullArticleView {
  background-color: #FFFFFF;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
  margin-top: 30px;
}

#view-content {
  color: #444444 !important;
  font-size: 16px !important;
  line-height: 1.8 !important;
  margin-top: 25px;
}

#fullArticleView a[href="Articles.html"],
#bookView a[href="Library.html"],
#bioView a[href="Biographies.html"] {
  color: #8C733E !important;
  font-weight: 600;
  transition: letter-spacing 0.2s ease;
}

#fullArticleView a:hover,
#bookView a:hover,
#bioView a:hover {
  color: #043c0c !important;
}

#bookView {
  background-color: #FFFFFF !important;
  color: #333333 !important;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
  padding: 40px !important;
  margin-top: 30px;
}

#book-title {
  color: #043c0c !important;
  font-size: 32px;
}

#book-author {
  color: #8C733E !important;
  font-style: italic;
}

#book-description {
  color: #555555 !important;
}

#bioView {
  background-color: transparent !important;
  padding: 0 !important;
  margin-top: 0 !important;
}

blockquote {
  font-style: italic;
  font-size: 1.15rem;
  color: #8C733E;
  border-left: 4px solid #043c0c;
  padding-left: 20px;
  margin: 30px 0;
  line-height: 1.7;
}

/* ==========================================================================
   9. RESPONSIVE BREAKPOINTS (Media Queries Collapse Rules)
   ========================================================================== */
@media (max-width: 900px) {
  .card {
    flex: 1 1 calc(50% - 20px);
    max-width: calc(50% - 20px);
  }
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .bio-split-row { 
    flex-direction: column-reverse; 
  }
  .bio-panel { 
    width: 100%; 
    border-right: none; 
  }
  .bio-arabic-panel { 
    border-bottom: 1px solid #EDF2F7; 
  }
}

@media (max-width: 600px) {
  .card {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* ==========================================================================
   10. SIYAR TEXT VIEW SPACING & LAYOUT REFINEMENTS
   ========================================================================== */
.bio-view-wrapper {
  max-width: 1200px;
  margin: 30px auto 60px auto;
  padding: 0 20px;
}

.back-to-bios-btn {
  display: inline-block !important;
  margin-top: 20px !important;
  margin-bottom: 25px !important;
  font-size: 15px;
  text-decoration: none; /* Completely removes the anchor text underline */
}

.back-to-bios-btn:hover {
  text-decoration: none !important; /* Prevents underline from appearing on hover */
}

.bio-split-row {
  margin-top: 15px !important;
}

.bio-panel {
  padding: 40px !important;
}

/* ==========================================================================
   11. TEXT VIEW TOGGLE CONTROLS (English / Arabic / Both)
   ========================================================================== */
.view-toggles {
  display: flex;
  background-color: #EDF2F7;
  padding: 4px;
  border-radius: 6px;
  gap: 4px;
}

.toggle-btn {
  background: none;
  border: none;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #4A5568;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  color: #043c0c;
}

.toggle-btn.active {
  background-color: #FFFFFF;
  color: #043c0c;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Panel state rules driven by toggle button clicks */
.hide-panel {
  display: none !important;
}

.full-width-panel {
  width: 100% !important;
  border-right: none !important;
}

/* ==========================================================================
   12. LOCAL BIO FILTER BAR FOCUS EFFECTS
   ========================================================================== */
#localBioSearch {
  border: 1px solid #E2E8F0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#localBioSearch:focus {
  border-color: #043c0c !important; /* Matches your chosen dark green */
  box-shadow: 0 0 0 3px rgba(4, 60, 12, 0.15) !important; /* Soft dark green outer glow halo */
  outline: none;
}
	
/* ==========================================================================
   13. COMPACT SKELETON LOADING FRAME ANIMATION
   ========================================================================== */
.skeleton-card {
  background-color: #E2E8F0;
  border-radius: 12px;
  flex: 1 1 calc(33.333% - 20px);
  min-width: 280px;
  max-width: calc(33.333% - 20px);
  height: 120px;
  animation: pulse-glow 1.5s infinite ease-in-out;
}

@keyframes pulse-glow {
  0% { opacity: 0.6; background-color: #E2E8F0; }
  50% { opacity: 1; background-color: #EDF2F7; }
  100% { opacity: 0.6; background-color: #E2E8F0; }
}

/* ==========================================================================
   14. FILTER DROPDOWN FIELDS ROW STYLING
   ========================================================================== */
.search-filter-row {
  display: flex;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto 30px auto;
  padding: 0 20px;
}

#localBioSearch {
  flex: 1; /* Allows search input to dynamically stretch and fill space */
  padding: 12px 20px;
  font-size: 15px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  outline: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#localBioSearch:focus {
  border-color: #043c0c !important;
  box-shadow: 0 0 0 3px rgba(4, 60, 12, 0.15) !important;
}

#eraSelectFilter {
  max-width: 180px; /* Constrains the drop-down to a compact, neat width */
  width: auto;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #4A5568;
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  transition: border-color 0.2s ease;
}

#eraSelectFilter:focus,
#eraSelectFilter:hover {
  border-color: #043c0c;
}

@media (max-width: 480px) {
  .search-filter-row {
    flex-direction: column; /* Stacks inputs vertically on narrow mobile viewports */
  }
}

/* ==========================================================================
   GLOBAL RESPONSIVE DESIGN (Fixes Home, Bio, Library, Articles, and About)
   ========================================================================== */
@media (max-width: 768px) {
  
  /* --- 1. Global Page Layout & Containers --- */
  body, html {
    overflow-x: hidden; /* Stops horizontal shaking and ugly side-scrolling */
  }

  /* Target all primary page wrappers, main sections, and containers */
  .hero-home, .container, .wrapper, main, section, .content-area {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 16px !important;  /* Creates consistent, safe screen gutters */
    padding-right: 16px !important;
    box-sizing: border-box !important;
  }

  /* --- 2. Typography Adjustments --- */
  h1, .hero-title, .page-title {
    font-size: 1.85rem !important;
    line-height: 1.25 !important;
  }

  h2, .section-title {
    font-size: 1.5rem !important;
  }

  p, .hero-subtitle, li, span {
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
  }

  /* --- 3. Unified Navigation & Headers --- */
  nav, .hero-nav, .main-nav, .navbar {
    display: flex !important;
    flex-wrap: wrap !important;      /* Drops links cleanly to a new line if they crowd */
    justify-content: center !important;
    gap: 8px 12px !important;        /* Tap spacing for phone thumbs */
    width: 100% !important;
    padding: 0 4px !important;
  }

  nav a, .hero-nav a, .navbar a {
    font-size: 0.95rem !important;
    padding: 6px 12px !important;
  }

  /* --- 4. Inputs, Search Bars & UI Controls --- */
  .search-container, .input-group, form {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
  }

  input[type="text"], input[type="search"], textarea, select {
    width: 100% !important;
    font-size: 1rem !important;      /* Strictly 16px to stop mobile browsers from auto-zooming input fields */
    padding: 12px 14px !important;
    box-sizing: border-box !important;
  }

  /* --- 5. Flexbox Grids, Cards, and Sidebars (Bio / Library Layouts) --- */
  /* This automatically unstacks columns so content displays vertically on phones */
  .row, .grid, .flex-container, .bio-layout, .library-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 16px !important;
  }

  /* Keeps multi-column data cards, bio panels, or text sidebars readable */
  .card, .sidebar, .main-content, .bio-card, .article-preview {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

.isnad {
    color: #777777;
    font-size: 0.95em;
}

/* Custom theme styling for links in biography text and articles */
.bio-panel a, 
#view-content a {
    color: #8C733E; /* Matches your elegant gold accent color */
    text-decoration: none; /* Removes the standard underline */
    font-weight: 600; /* Makes the linked names distinct and readable */
    transition: color 0.2s ease; /* Smooth hover appearance */
}

/* Hover state effect */
.bio-panel a:hover, 
#view-content a:hover {
    color: #043c0c; /* Switches to your signature dark green on hover */
}


/* Quote Section Styling */
/* Elegant Dark Theme Quote Card */
/* Redesigned Glassmorphism Quote Card with Gold Accents */
.quote-container {
    max-width: 550px;
    /* REDUCED GAP: Tighter spacing below navbar and above search box */
    margin: -11px auto 20px auto; 
    padding: 22px 30px;
    background: rgba(255, 255, 255, 0.07); 
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.8s ease-out;
}

.quote-text {
    font-size: 18px;
    font-style: italic;
    color: #FFFFFF;
    line-height: 1.6;
    margin: 0 0 10px 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.quote-author {
    font-size: 14px;
    font-weight: 500;
    color: #D1D5DB; 
    letter-spacing: 0.5px;
    margin: 0 0 16px 0;
}

/* GOLD THEMED BUTTON: Matches your exact subtitle typography color */
.quote-link {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #C2A45F; /* Subtitle Gold */
    text-decoration: none;
    padding: 6px 16px;
    background: rgba(194, 164, 95, 0.08); /* Semi-transparent gold backdrop */
    border: 1px solid rgba(194, 164, 95, 0.25);
    border-radius: 20px;
    transition: all 0.2s ease;
}

.quote-link:hover {
    background: rgba(194, 164, 95, 0.2);
    color: #FFFFFF; /* Flips text to crisp white on hover */
    border-color: rgba(194, 164, 95, 0.5);
    box-shadow: 0 0 12px rgba(194, 164, 95, 0.25);
}

.quote-link .arrow {
    margin-left: 6px;
    transition: transform 0.2s ease;
}

.quote-link:hover .arrow {
    transform: translateX(4px);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ========================================================================
   STANDALONE SAYINGS READING LOUNGE (MINIMAL EDITORIAL SYSTEM)
   ======================================================================== */
.sayings-viewport {
    max-width: 780px; /* Restricts presentation span for comfortable reading profiles */
    margin: 60px auto 100px auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 60vh;
    color: #043C0C !important
}

.sayings-intro {
    text-align: center;
    margin-bottom: 50px;
    color: #043C0C !important
}

.sayings-tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--accent-gold);
    font-weight: 600;
    display: inline-block;
    margin-bottom: 12px;
    color: #043C0C !important
}

.sayings-subtitle {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 500px;
    margin: 0 auto;
    color: #043C0C !important
}

/* Focused Presentation Display Framework */
.sayings-display-vault {
    width: 100%;
    padding: 20px 10px;
    text-align: center;
    margin-bottom: 60px;
}

.saying-main-prose {
    font-family: 'Playfair Display', serif;
    font-size: 2rem; /* Visually dominant text element core */
    line-height: 1.6;
    color: var(--text-light);
    margin: 0 0 30px 0;
    font-style: italic;
    font-weight: 400;
    transition: opacity 0.3s ease, transform 0.3s ease;
    color: #043C0C !important
}

.saying-meta-attribution {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.saying-author-sig {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--accent-gold);
    text-shadow: 0 0 8px var(--glow-gold-subtle);
    color: #043C0C !important
}

.saying-source-tag {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    color: #043C0C !important
}

.saying-context-trigger {
    color: #C2A45F !important; /* Premium Noble Gold link color */
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    border-bottom: 1px dashed rgba(194, 164, 95, 0.4);
    padding-bottom: 2px;
    margin-top: 4px;
    text-decoration: none !important; /* Instantly kills the default underline */
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.saying-context-trigger:hover {
    color: #043C0C !important; /* Sharp signature dark green hover state */
    border-bottom-style: solid;
    text-shadow: 0 0 10px rgba(194, 164, 95, 0.6);
}

/* Exploration Interface Controllers Track */
.sayings-controls-track {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    border-top: 1px solid var(--border-gold-alpha);
    padding-top: 40px;
}

.control-actions-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.saying-nav-btn {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-gold-alpha);
    color: var(--text-light);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 24px;
    cursor: pointer;
    border-radius: 30px; /* Elegant matching structural rounds */
    transition: var(--transition-smooth);
    min-width: 120px;
    color: #043C0C !important
}

.saying-nav-btn:hover:not(:disabled) {
    border-color: var(--accent-gold);
    background-color: var(--bg-card);
    color: var(--accent-gold);
}

.saying-nav-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.another-saying-accent {
    background-color: transparent;
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.another-saying-accent:hover {
    background-color: var(--accent-gold) !important;
    color: var(--bg-primary) !important;
    box-shadow: 0 0 15px var(--glow-gold-subtle);
}

.saying-counter-string {
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
    color: #043C0C !important
}

/* Global Footer Layout Alignment Overrides */
.site-footer-colophon {
    margin-top: 100px;
    border-top: 1px solid var(--border-gold-alpha);
    padding: 40px 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* --- Mobile Presentation Media Profiles --- */
@media (max-width: 768px) {
    .saying-main-prose {
        font-size: 1.45rem;
        line-height: 1.55;
    }
    .control-actions-group {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    .saying-nav-btn {
        width: 100%;
    }
}

/* Superscript plus element trigger marker look tuning */
.isnad-data {
    color: #C2A45F !important; /* Theme Noble Gold metallic tone */
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    vertical-align: super; /* Snaps text upwards to look like a clean footnote badge */
    cursor: pointer;
    margin-left: 5px;
    padding: 0 4px;
    display: inline-block;
    user-select: none;
}

.isnad-data:hover {
    color: #FFF1D6 !important;
    text-shadow: 0 0 8px rgba(194, 164, 95, 0.6);
}

/* Floating overlay presentation information card */
.isnad-popover-card {
    position: absolute;
    z-index: 2500;
    width: 100%;
    max-width: 400px;
    background-color: #052D0B !important; /* Rich deep secondary layering green */
    border: 1px solid #C2A45F !important;   /* Thin noble gold bounding frame trim */
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 
                0 0 15px rgba(194, 164, 95, 0.15);
    transition: opacity 0.2s ease;
}

.popover-academic-header {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8FA493; /* Sage gray-green descriptive tracking text signature */
    border-bottom: 1px solid rgba(194, 164, 95, 0.12);
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.popover-traditional-arabic {
    font-family: 'Amiri', serif;
    font-size: 1.3rem;
    line-height: 1.6;
    color: #F4F7F5;
    direction: rtl; /* Forces proper right-to-left layout order flows for Arabic script strings */
    text-align: right;
}
/* Generates breathing room for stacked lines inside your popup box */
.popover-traditional-arabic br {
    content: "";
    margin-bottom: 12px;
    display: block;
}
