/* ─── HALALL SHARED STYLES v2 ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #040c07;
  --surface: #081510;
  --surface2: #0c1d14;
  --surface3: #112219;
  --green: #2dd87a;
  --green-lt: #5ee89a;
  --green-dim: rgba(45, 216, 122, 0.10);
  --green-glow: rgba(45, 216, 122, 0.06);
  --cream: #e8f2ea;
  --cream-dim: #7a9982;
  --green-ok: #34d17a;
  --red-no: #e05c48;
  --amber-mk: #d4943a;
  --border: rgba(45, 216, 122, 0.11);
  --border-md: rgba(45, 216, 122, 0.18);
  --border-lt: rgba(45, 216, 122, 0.06);
  --glow: 0 0 60px rgba(45, 216, 122, 0.05);
  --radius: 14px;
  --radius-sm: 8px;
}

/* ─── LIGHT MODE ─── */
/* html[data-theme="light"] beats :root in specificity (0,1,1) vs (0,1,0) */
html[data-theme="light"] {
  --bg: #f2f8f4;
  --surface: #ffffff;
  --surface2: #e8f5ee;
  --surface3: #ddf0e6;
  --green: #15994e;
  --green-lt: #1ab85e;
  --green-dim: rgba(21, 153, 78, 0.10);
  --green-glow: rgba(21, 153, 78, 0.06);
  --cream: #0c1a11;
  --cream-dim: #385240;
  --green-ok: #15994e;
  --red-no: #b83228;
  --amber-mk: #b87018;
  --border: rgba(21, 153, 78, 0.16);
  --border-md: rgba(21, 153, 78, 0.28);
  --border-lt: rgba(21, 153, 78, 0.08);
  --glow: 0 0 60px rgba(21, 153, 78, 0.06);
}

html[data-theme="light"] body {
  background: #f2f8f4;
}

/* ─── THEME TOGGLE BUTTON ─── */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-md);
  background: var(--surface2);
  color: var(--cream-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-dim);
}

.theme-toggle svg {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  pointer-events: none;
}

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

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

html[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

html[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

/* ensure icons inherit button color */
.theme-toggle .icon-moon path {
  fill: currentColor;
}

.theme-toggle .icon-sun circle {
  fill: currentColor;
}

.theme-toggle .icon-sun path {
  stroke: currentColor;
}

/* ─── LIGHT MODE OVERRIDES ─── */
html[data-theme="light"] .nav {
  background: rgba(242, 248, 244, 0.92);
}

html[data-theme="light"] .geo-bg {
  opacity: 0.35;
}

html[data-theme="light"] body::before {
  opacity: 0;
}

html[data-theme="light"] footer {
  background: rgba(232, 245, 238, 0.98);
}

html[data-theme="light"] .card {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .card:hover {
  box-shadow: 0 6px 24px rgba(21, 153, 78, 0.10);
}

html[data-theme="light"] .divider-line {
  background: linear-gradient(90deg, transparent, var(--border-md), transparent);
}

html[data-theme="light"] p {
  color: var(--cream-dim);
}

html[data-theme="light"] .section-label {
  color: var(--green);
}

html[data-theme="light"] .badge-halal {
  background: rgba(21, 153, 78, 0.10);
  border-color: rgba(21, 153, 78, 0.28);
  color: var(--green-ok);
}

html[data-theme="light"] .badge-haram {
  background: rgba(184, 50, 40, 0.08);
  border-color: rgba(184, 50, 40, 0.22);
  color: var(--red-no);
}

html[data-theme="light"] .badge-makruh {
  background: rgba(184, 112, 24, 0.08);
  border-color: rgba(184, 112, 24, 0.22);
  color: var(--amber-mk);
}

html[data-theme="light"] .badge-category {
  background: var(--green-dim);
  border-color: var(--border-md);
  color: var(--green);
}

/* Article body light mode */
html[data-theme="light"] .article-body p {
  color: #2a3d30;
}

html[data-theme="light"] .article-body h2,
html[data-theme="light"] .article-body h3 {
  color: #0c1a11;
}

html[data-theme="light"] .quran-quote {
  background: rgba(232, 245, 238, 0.8);
}

html[data-theme="light"] .callout {
  background: rgba(21, 153, 78, 0.07);
  border-color: var(--green);
}

html[data-theme="light"] .callout p {
  color: #1a3324;
}

/* Map light mode */
html[data-theme="light"] .list-panel {
  background: #fff;
}

html[data-theme="light"] .map-wrap {
  background: #e8f5ee;
}

html[data-theme="light"] .rest-card:hover {
  background: var(--surface2);
}

html[data-theme="light"] .rest-card.active {
  background: var(--green-dim);
}

html[data-theme="light"] .sidebar-widget {
  background: #fff;
}

html[data-theme="light"] .toc {
  background: #fff;
}

html[data-theme="light"] .post-sidebar>div {
  background: #fff;
}

html[data-theme="light"] .order-card {
  background: #fff;
}

html[data-theme="light"] .arch-card {
  background: #fff;
  border-color: var(--border-md);
}

html[data-theme="light"] .mosque-shape {
  fill: #ffffff;
  stroke: #8ec4a8;
}

html[data-theme="light"] .floating-badge,
html[data-theme="light"] .floating-badge-2 {
  background: #fff;
  border-color: var(--border-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ─── THEME TRANSITION ─── */
*,
*::before,
*::after {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.15s ease, box-shadow 0.25s ease;
}

.btn,
.nav-cta,
.theme-toggle,
.card {
  transition: all 0.2s;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── NOISE TEXTURE OVERLAY ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 160px;
}

/* ─── GEO BACKGROUND ─── */
.geo-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M48 0 L50 16 L48 12 L46 16Z' fill='none' stroke='%232dd87a' stroke-width='0.5' opacity='0.12'/%3E%3Cpath d='M96 48 L80 50 L84 48 L80 46Z' fill='none' stroke='%232dd87a' stroke-width='0.5' opacity='0.12'/%3E%3Cpath d='M48 96 L46 80 L48 84 L50 80Z' fill='none' stroke='%232dd87a' stroke-width='0.5' opacity='0.12'/%3E%3Cpath d='M0 48 L16 46 L12 48 L16 50Z' fill='none' stroke='%232dd87a' stroke-width='0.5' opacity='0.12'/%3E%3Ccircle cx='48' cy='48' r='18' fill='none' stroke='%232dd87a' stroke-width='0.4' opacity='0.08'/%3E%3Ccircle cx='48' cy='48' r='9' fill='none' stroke='%232dd87a' stroke-width='0.3' opacity='0.06'/%3E%3Ccircle cx='0' cy='0' r='7' fill='none' stroke='%232dd87a' stroke-width='0.3' opacity='0.06'/%3E%3Ccircle cx='96' cy='0' r='7' fill='none' stroke='%232dd87a' stroke-width='0.3' opacity='0.06'/%3E%3Ccircle cx='0' cy='96' r='7' fill='none' stroke='%232dd87a' stroke-width='0.3' opacity='0.06'/%3E%3Ccircle cx='96' cy='96' r='7' fill='none' stroke='%232dd87a' stroke-width='0.3' opacity='0.06'/%3E%3Cline x1='34' y1='34' x2='62' y2='62' stroke='%232dd87a' stroke-width='0.3' opacity='0.07'/%3E%3Cline x1='62' y1='34' x2='34' y2='62' stroke='%232dd87a' stroke-width='0.3' opacity='0.07'/%3E%3Cline x1='48' y1='0' x2='48' y2='96' stroke='%232dd87a' stroke-width='0.2' opacity='0.04'/%3E%3Cline x1='0' y1='48' x2='96' y2='48' stroke='%232dd87a' stroke-width='0.2' opacity='0.04'/%3E%3C/svg%3E");
}

/* ─── GRADIENT SPOTLIGHT ─── */
.geo-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(45, 216, 122, 0.06) 0%, transparent 70%);
}

/* ─── NAVBAR ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 64px;
  background: rgba(4, 12, 7, 0.75);
  backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--cream);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0px;
  letter-spacing: -0.3px;
}

.nav-logo span {
  color: var(--green);
}

.nav-logo-star {
  width: 30px;
  height: 30px;
  background: var(--green-dim);
  border: 1px solid var(--border-md);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  color: var(--cream-dim);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0.2px;
  padding: 6px 14px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.04);
}

.nav-links a.active {
  color: var(--cream);
}

.nav-cta {
  background: var(--green) !important;
  color: #ffffff !important;
  padding: 8px 18px !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  transition: all 0.2s !important;
  letter-spacing: 0.1px;
}

.nav-cta:hover {
  background: var(--green-lt) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(45, 216, 122, 0.2) !important;
}

/* ─── SECTION WRAPPERS ─── */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 1;
}

.section {
  padding: 96px 0;
}

.section-sm {
  padding: 64px 0;
}

.section-label {
  font-size: 12.5px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--green);
  font-weight: 500;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::before {
  content: '';
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--green);
  opacity: 0.5;
  border-radius: 2px;
}

h1,
h2,
h3,
h4 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  line-height: 1.05;
}

h1 {
  font-size: clamp(44px, 5vw, 72px);
}

h2 {
  font-size: clamp(32px, 3.5vw, 48px);
}

h3 {
  font-size: clamp(22px, 2.5vw, 30px);
}

h4 {
  font-size: 20px;
}

p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--cream-dim);
}

.gold-text {
  color: var(--green);
}

.green-text {
  color: var(--green);
}

.divider-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-md), transparent);
  margin: 0;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s;
  letter-spacing: 0.1px;
}

.btn-gold {
  background: var(--green);
  color: var(--bg);
}

.btn-gold:hover {
  background: var(--green-lt);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.2);
}

.btn-green {
  background: var(--green);
  color: #ffffff;
}

.btn-green:hover {
  background: var(--green-lt);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(45, 216, 122, 0.2);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-md);
  color: var(--cream);
}

.btn-outline:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-dim);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

/* ─── CARD ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.card:hover {
  border-color: var(--border-md);
  box-shadow: 0 8px 32px rgba(45, 216, 122, 0.04);
}

/* ─── VERDICT BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.badge-halal {
  background: rgba(52, 209, 122, 0.1);
  border: 1px solid rgba(52, 209, 122, 0.25);
  color: var(--green-ok);
}

.badge-haram {
  background: rgba(224, 92, 72, 0.1);
  border: 1px solid rgba(224, 92, 72, 0.25);
  color: var(--red-no);
}

.badge-makruh {
  background: rgba(212, 148, 58, 0.1);
  border: 1px solid rgba(212, 148, 58, 0.25);
  color: var(--amber-mk);
}

.badge-category {
  background: var(--green-dim);
  border: 1px solid var(--border-md);
  color: var(--green);
}

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  background: rgba(4, 12, 7, 0.96);
  padding: 64px 0 32px;
  position: relative;
  z-index: 1;
}

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

.footer-brand p {
  font-size: 13.5px;
  margin-top: 12px;
  max-width: 280px;
  line-height: 1.8;
}

.footer-col h5 {
  font-family: 'DM Sans', sans-serif;
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 16px;
  font-weight: 500;
}

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

.footer-col a {
  color: var(--cream-dim);
  text-decoration: none;
  font-size: 13.5px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--cream);
}

.footer-bottom {
  padding-top: 28px;
  border-top: 1px solid var(--border-lt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(122, 153, 130, 0.4);
}

.footer-arabic {
  font-family: 'Amiri', serif;
  font-size: 16px;
  font-style: italic;
  color: var(--green);
  opacity: 0.5;
  text-align: right;
}

/* ─── FORM ELEMENTS ─── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label {
  font-size: 11.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--cream-dim);
  font-weight: 500;
}

.form-input,
.form-select,
.form-textarea {
  background: rgba(45, 216, 122, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  width: 100%;
  caret-color: var(--green);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(122, 153, 130, 0.35);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: rgba(45, 216, 122, 0.35);
  box-shadow: 0 0 0 3px rgba(45, 216, 122, 0.06);
}

.form-select {
  appearance: none;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 110px;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(45, 216, 122, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(45, 216, 122, 0.3);
}

/* ─── HAMBURGER (hidden on desktop, shown by media query) ─── */
.nav-hamburger { display: none; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE — TABLET  (max-width: 768px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .container { padding: 0 24px; }
  .section    { padding: 64px 0; }
  .section-sm { padding: 48px 0; }

  .nav { padding: 0 24px; position: relative; justify-content: flex-start; gap: 8px; }
  .nav-hamburger { margin-left: auto; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: rgba(4,12,7,0.97);
    backdrop-filter: blur(28px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 0 20px;
    gap: 0;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    font-size: 15px;
    min-height: 44px;
  }
  .nav-cta { margin: 8px 24px 0 !important; justify-content: center; padding: 12px 18px !important; }
  .nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px; height: 36px;
    background: none;
    border: 1px solid var(--border-md);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px 7px;
    flex-shrink: 0;
  }
  .nav-hamburger span {
    display: block;
    height: 1.5px;
    background: var(--cream-dim);
    border-radius: 2px;
    transition: all 0.25s;
  }
  .nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  html[data-theme="light"] .nav-links { background: rgba(242,248,244,0.97); }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* ═══════════════════════════════════════════════════
   SAFE AREA — iOS/Android gesture bar
   ═══════════════════════════════════════════════════ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
  /* Push page content above the OS gesture bar */
  .container, .section, .section-sm {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — MOBILE  (max-width: 480px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .section    { padding: 48px 0; }
  .section-sm { padding: 36px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}