/* ============================================
   Questions About Islam — Global Stylesheet
   Design: Clarity through Light
   ============================================ */

:root {
  --green-deep:  #0c3b22;
  --green-mid:   #1a6b42;
  --green-light: #2d8a57;
  --gold:        #c4892a;
  --gold-light:  #e8b64b;
  --bg:          #faf8f5;
  --surface:     #ffffff;
  --surface-warm:#f5f0e8;
  --border:      #ddd7cc;
  --border-light:#ede8e0;
  --text:        #1c1916;
  --text-muted:  #6b6258;
  --link:        #0c5c33;
  --link-hover:  #0a3d22;
  --quran-bg:    #f0f6f2;
  --quran-border:#2d8a57;
  --hadith-bg:   #f7f5f0;
  --hadith-border:#c4892a;
  --radius:      6px;
  --radius-lg:   10px;
  --shadow-sm:   0 1px 4px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-w: 880px;
}

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

html { font-size: 17px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--green-deep);
}
h1 { font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 3px solid transparent; border-image: linear-gradient(to right, var(--gold) 0%, transparent 72%) 1; }
h2 { font-size: 1.35rem; margin: 1.75rem 0 .75rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; color: var(--green-mid); }
h4 { font-size: 1rem; margin: 1.25rem 0 .4rem; }

p { margin-bottom: 1.1rem; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
.article-content a:visited { color: #7c4daa; }

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: .35rem; }

hr { border: none; border-top: 1px solid var(--border); margin: 1.75rem 0; }

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.content-wrapper {
  padding: 2.25rem 0 3rem;
}

/* ---- Header ---- */
#site-header {
  background: var(--green-deep);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 58px;
}

.site-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo:hover,
.site-logo:visited { color: var(--gold-light) !important; }
.logo-icon { font-size: 1.25rem; }

#site-nav {
  display: flex;
  align-items: center;
  gap: .15rem;
  margin-left: auto;
}

#site-nav a {
  color: rgba(255,255,255,.88);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
  padding: .35rem .65rem;
  border-radius: var(--radius);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
#site-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
#site-nav a.nav-yt { color: var(--gold-light); }
#site-nav a.nav-yt:hover { background: rgba(200,140,40,.2); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* ---- Breadcrumb ---- */
.breadcrumb-bar {
  background: var(--surface-warm);
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .5rem 0;
  font-size: .82rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--link); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.crumb-sep { color: var(--green-mid); margin: 0 .15rem; }
.crumb-current { color: var(--text-muted); }

/* ---- Footer ---- */
#site-footer {
  background: var(--green-deep);
  color: rgba(255,255,255,.82);
  margin-top: 3rem;
}

#site-footer .container { padding-top: 2.25rem; padding-bottom: 1.5rem; }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.footer-col h3 {
  color: var(--gold-light);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .75rem;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: .4rem; }
.footer-col a { color: rgba(255,255,255,.75); text-decoration: none; font-size: .9rem; }
.footer-col a:hover { color: #fff; }

.footer-copy {
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 1.25rem;
}
.copy-notice {
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  margin-bottom: .6rem;
  line-height: 1.5;
}
.copy-notice a { color: rgba(255,255,255,.7); }
.copy-year {
  font-size: .78rem;
  color: rgba(255,255,255,.45);
}

/* ---- Home Page ---- */
.home-hero {
  text-align: center;
  padding: 3rem 0 2.25rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 2.5rem;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(12,59,34,.055) 0%, transparent 100%);
}
.home-hero h1 {
  border: none;
  border-image: none;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  color: var(--green-deep);
  margin-bottom: 1rem;
}
.home-hero p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.home-block {
  margin-bottom: 2rem;
}

.home-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--green-deep);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.home-section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
  margin-bottom: 2rem;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green-mid);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  transition: border-color .15s, box-shadow .15s, transform .1s, background .15s;
}
.category-card:hover {
  border-color: var(--green-mid);
  border-left-color: var(--green-deep);
  background: var(--surface-warm);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.category-card a {
  text-decoration: none;
  font-size: .92rem;
  font-weight: 600;
  color: var(--green-deep);
  display: block;
  line-height: 1.35;
}
.category-card a:hover { color: var(--green-mid); }

/* Article List (home) */
.article-links {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.article-links li {
  list-style: none;
  border-bottom: 1px solid var(--border-light);
}
.article-links li:last-child { border-bottom: none; }
.article-links a {
  display: block;
  padding: .7rem 1rem;
  text-decoration: none;
  font-size: .92rem;
  color: var(--link);
  transition: background .12s;
}
.article-links a:hover { background: var(--surface-warm); }

/* Muslim World feature banner */
.muslim-world-banner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  background: url('/images/muslim-world/cairo-skyline.jpg') center/cover no-repeat;
}
.muslim-world-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(12,59,34,.88) 45%, rgba(12,59,34,.55) 100%);
}
.muslim-world-content {
  position: relative;
  z-index: 1;
  padding: 2.25rem 2.5rem;
  max-width: 520px;
}
.muslim-world-eyebrow {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--gold);
  margin: 0 0 .4rem;
}
.muslim-world-heading {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  color: #fff;
  margin: 0 0 .75rem;
  font-weight: 700;
  line-height: 1.2;
  border: none;
}
.muslim-world-desc {
  color: rgba(255,255,255,.82);
  font-size: .95rem;
  line-height: 1.6;
  margin: 0 0 1.25rem;
}
.muslim-world-btn {
  display: inline-block;
  padding: .6rem 1.25rem;
  background: var(--gold);
  color: #1a1a1a;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  font-size: .92rem;
  transition: opacity .15s;
}
.muslim-world-btn:hover { opacity: .88; }

/* Social strip */
.social-strip {
  display: flex;
  gap: .75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.social-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
}
.social-box h3 { margin-top: 0; }
.social-box p { font-size: .85rem !important; }
.social-links { display: flex; flex-direction: column; gap: .6rem; }
.social-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1.1rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
  transition: opacity .15s;
}
.social-link:hover { opacity: .85; }
.social-link.fb { background: #1877f2; color: #fff; }
.social-link.yt { background: #ff0000; color: #fff; }
.social-link.ask { background: var(--green-mid); color: #fff; }
.social-icon { font-size: 1.1rem; }

/* ---- Category Index Pages ---- */
.cat-header {
  margin-bottom: 1.75rem;
}
.cat-header h1 { font-size: 1.65rem; }
.cat-description { color: var(--text-muted); margin-top: .25rem; }

.question-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: 0;
}

.question-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green-mid);
  border-radius: var(--radius);
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.question-list li:hover {
  border-color: var(--green-light);
  border-left-color: var(--green-deep);
  background: var(--surface-warm);
  box-shadow: var(--shadow-sm);
}
.question-list a {
  display: block;
  padding: .9rem 1.1rem;
  text-decoration: none;
  font-size: .97rem;
  font-weight: 500;
  color: var(--green-deep);
  transition: color .12s;
}
.question-list a::before {
  content: '›';
  margin-right: .5rem;
  color: var(--gold);
  font-weight: 700;
}
.question-list a:hover { color: var(--green-mid); }

/* ---- Article / Q&A Content Pages ---- */
.article-content {
  overflow-wrap: break-word;
  word-break: break-word;
}

.article-content h1 {
  font-size: clamp(1.35rem, 4vw, 1.8rem);
}

/* "Question:" eyebrow label — sits on its own line above the question text */
.q-label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .16em;
  margin-bottom: .45rem;
}

/* Answer section H2s ("Video Answer:", "Text Answer:") — match the Q label style */
.article-content h2 {
  font-size: .68rem;
  font-weight: 700;
  color: var(--green-mid);
  text-transform: uppercase;
  letter-spacing: .16em;
  margin: 2.25rem 0 1rem;
  border-bottom: none;
  border-image: none;
  padding-bottom: 0;
}

/* Quran quotes */
.quran, p.quran, p[class="quran"], .article-content .quran {
  background: var(--quran-bg);
  border-left: 4px solid var(--quran-border);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  font-style: italic;
  font-size: 1rem;
  color: #1a3d28;
  margin: 1.25rem 0;
  line-height: 1.7;
}

/* Hadith quotes */
.hadith, p.hadith, p[dir="rtl"] {
  background: var(--hadith-bg);
  border-right: 4px solid var(--hadith-border);
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 1rem 1.25rem;
  direction: rtl;
  text-align: right;
  font-size: 1rem;
  color: #3d2800;
  margin: 1.25rem 0;
  line-height: 1.9;
}

/* Inline quote */
.inlinequote {
  font-weight: 700;
  font-style: italic;
  color: var(--green-deep);
}

/* Article images */
.article-img {
  float: right;
  margin: 0 0 1.25rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  max-width: 260px;
}

/* Video iframe */
.iframe-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  background: #000;
}
.iframe-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* Video divider */
hr[style*="8B0000"] {
  border-color: var(--border) !important;
}

/* Figures in Muslim World pages */
figure {
  float: right;
  margin: 0 0 1.25rem 1.5rem;
  max-width: 220px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
figure img { width: 100%; height: auto; border: none !important; }
figcaption {
  text-align: center;
  font-style: italic;
  font-size: .8rem;
  color: var(--text-muted);
  padding: .4rem .5rem;
  background: var(--surface-warm);
}

/* Clearfix for floated elements */
.article-content::after {
  content: '';
  display: table;
  clear: both;
}

/* Old grid class compatibility */
.col-12, .col-12-medium, .col-6, .col-6-medium,
.col-4, .col-4-medium, .col-8, .col-8-medium {
  display: block;
  width: 100%;
}

/* Old alignment compatibility */
[align="justify"] { text-align: justify; }
center { text-align: center; }

/* Legacy link classes */
a.category, a.question {
  font-weight: 500;
}

/* Old section content-box styling */
section#content-box, section[id="content-box"] {
  background: transparent !important;
}

/* Article list for category pages */
.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.article-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green-mid);
  border-radius: var(--radius);
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.article-list li:hover {
  border-color: var(--green-light);
  border-left-color: var(--green-deep);
  background: var(--surface-warm);
  box-shadow: var(--shadow-sm);
}
.article-list a {
  display: block;
  padding: .9rem 1.1rem;
  text-decoration: none;
  font-size: .97rem;
  font-weight: 500;
  color: var(--green-deep);
}
.article-list a::before {
  content: '›';
  margin-right: .5rem;
  color: var(--gold);
  font-weight: 700;
}
.article-list a:hover { color: var(--green-mid); }

/* Category list (find-answers / index) */
.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.category-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green-mid);
  border-radius: var(--radius);
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.category-list li:hover {
  border-color: var(--green-light);
  border-left-color: var(--green-deep);
  background: var(--surface-warm);
  box-shadow: var(--shadow-sm);
}
.category-list a {
  display: block;
  padding: .85rem 1.1rem;
  text-decoration: none;
  font-size: .97rem;
  font-weight: 500;
  color: var(--green-deep);
}
.category-list a::before {
  content: '›';
  margin-right: .5rem;
  color: var(--gold);
  font-weight: 700;
}
.category-list a:hover { color: var(--green-mid); }

/* Support page */
table { border-collapse: collapse; width: 100%; }
td, th { padding: .5rem; vertical-align: top; }
b { font-weight: 700; }

/* About / info boxes */
.info-box {
  background: var(--surface-warm);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.5rem 1.75rem;
  margin: 1.25rem 0;
}

/* ---- Muslim World Carousel ---- */
.mw-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--green-deep);
  box-shadow: var(--shadow-md);
  margin: 1.5rem 0 1.75rem;
  user-select: none;
}

.mw-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .6s ease;
}
.mw-slide.active { opacity: 1; }

.mw-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Gradient caption bar */
.mw-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 2rem 1.25rem .85rem;
  background: linear-gradient(to top, rgba(0,0,0,.72) 0%, transparent 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.mw-caption-city {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.mw-caption-count {
  color: rgba(255,255,255,.75);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .04em;
}

/* Prev / Next arrows */
.mw-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.38);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 50%;
  width: 2.6rem;
  height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background .15s, border-color .15s;
  z-index: 2;
  line-height: 1;
}
.mw-btn:hover {
  background: rgba(12,59,34,.72);
  border-color: var(--gold);
}
.mw-btn-prev { left: .75rem; }
.mw-btn-next { right: .75rem; }

/* Dot indicators */
.mw-dots {
  position: absolute;
  bottom: .6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .4rem;
  z-index: 2;
}
.mw-dot {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: rgba(255,255,255,.45);
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background .2s, transform .2s;
}
.mw-dot.active {
  background: var(--gold);
  transform: scale(1.35);
}

/* Progress bar */
.mw-progress {
  position: absolute;
  top: 0; left: 0;
  height: 3px;
  background: var(--gold);
  width: 0%;
  transition: width linear;
  z-index: 2;
}

@media (max-width: 500px) {
  .mw-caption-city { font-size: 1rem; }
  /* Keep buttons at a comfortable touch target (≥44px) on phones */
  .mw-btn { width: 2.75rem; height: 2.75rem; font-size: 1rem; }
}

/* ---- Muslim World Grid ---- */
.world-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
  margin: 1.25rem 0;
}
.world-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  text-align: center;
  transition: border-color .12s, box-shadow .12s, transform .1s;
}
.world-card:hover {
  border-color: var(--green-mid);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.world-card a {
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  color: var(--green-deep);
}
.world-card a:hover { color: var(--green-mid); }
.world-flag { font-size: 1.6rem; display: block; margin-bottom: .3rem; }

/* ---- Responsive ---- */

/* Tablet (≤768px) — hamburger nav, 2-column category grid, stacked footer */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  #site-nav {
    display: none;
    position: absolute;
    top: 58px;
    left: 0; right: 0;
    background: var(--green-deep);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem 0;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
    border-top: 1px solid rgba(255,255,255,.12);
  }
  #site-nav.open { display: flex; }
  #site-nav a { padding: .75rem 1.25rem; border-radius: 0; font-size: .95rem; }
  #site-header { position: relative; }

  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .muslim-world-content { padding: 1.5rem; }
  .social-strip { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; gap: 1rem; }

  .article-img { float: none !important; max-width: 100% !important; margin: 1rem 0 !important; }
  /* !important overrides inline style="float:right" on <figure> elements in country pages */
  figure { float: none !important; clear: none !important; max-width: 100% !important; width: auto !important; margin: 1rem 0 !important; }

  .content-wrapper { padding: 1.5rem 0 2rem; }
  h1 { font-size: 1.5rem; }
}

/* Phone (≤480px) — single-column category grid, tighter banner */
@media (max-width: 480px) {
  :root { --max-w: 100%; }
  .container { padding: 0 1rem; }
  .category-grid { grid-template-columns: 1fr; }
  .muslim-world-banner { min-height: 200px; }
  .muslim-world-content { padding: 1.25rem; }
  .muslim-world-heading { font-size: 1.4rem; }
  .muslim-world-desc { font-size: .88rem; }
  .home-hero { padding: 2rem 0 1.5rem; }
}
