/* --- CORE DESIGN SYSTEM & VARIABLES --- */
:root {
  --background: #edf4f3;
  --foreground: #12233a;
  --text: #24384e;
  --text-secondary: #63788a;
  --primary: #123e68;
  --primary-dark: #0a2847;
  --primary-light: #2d7890;
  --accent: #d06b4c;
  --card-bg: rgba(255, 255, 255, 0.78);
  --nav-bg: rgba(237, 244, 243, 0.88);
  --hover-bg: #e1eeed;
  --border: rgba(18, 62, 104, 0.11);
  --shadow: rgba(18, 62, 104, 0.09);
  --primary-glow: rgba(45, 120, 144, 0.22);
  --success: #258f83;
  --error: #e11d48;
  --aurora-color-1: rgba(37, 143, 131, 0.09);
  --aurora-color-2: rgba(208, 107, 76, 0.06);
}

[data-theme="dark"] {
  --background: #081725;
  --foreground: #f8fafc;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --primary: #8fd3d0;
  --primary-dark: #5bb4b1;
  --primary-light: #76b9d2;
  --accent: #ef9a76;
  --card-bg: rgba(17, 39, 55, 0.78);
  --nav-bg: rgba(8, 23, 37, 0.88);
  --hover-bg: #123247;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: rgba(0, 0, 0, 0.3);
  --primary-glow: rgba(118, 185, 210, 0.2);
  --success: #5dc7b4;
  --error: #f87171;
  --aurora-color-1: rgba(93, 199, 180, 0.1);
  --aurora-color-2: rgba(239, 154, 118, 0.08);
}

/* --- GENERAL RESET & LAYOUT --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--foreground);
  background-color: var(--background);
  min-height: 100vh;
  padding-top: 60px;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.prayer-data-status {
  min-height: 1.25rem;
  margin: -1.25rem auto 1.25rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-align: center;
}

.prayer-data-status:empty {
  display: none;
}

.prayer-data-status[data-stale="true"] {
  color: var(--accent);
}

.prayer-guidance {
  margin-top: 0.9rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(225, 238, 237, 0.48);
}

.prayer-guidance summary {
  padding: 0.8rem 1rem;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
}

.prayer-guidance-body {
  padding: 0 1rem 1rem 1.65rem;
  font-size: 0.82rem;
  line-height: 1.55;
}

.prayer-guidance-body ul {
  display: grid;
  gap: 0.45rem;
  margin: 0.65rem 0;
}

.prayer-guidance-source {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

[data-theme="dark"] .prayer-guidance {
  background: rgba(18, 50, 71, 0.58);
}

/* --- THE SOUL: BACKGROUND PATTERNS & ANIMATIONS --- */
/* Slow shifting Aurora Glow in background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: radial-gradient(circle at 10% 20%, var(--aurora-color-1) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, var(--aurora-color-2) 0%, transparent 45%);
  animation: auroraFlow 15s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Subtly overlayed Crystalline Geometric Star Grid (Islamic + Ice snowflake structure) */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z M30 15 L45 30 L30 45 L15 30 Z M0 0 L15 15 M60 0 L45 15 M60 60 L45 45 M0 60 L15 45 M30 0 L30 15 M30 45 L30 60 M0 30 L15 30 M45 30 L60 30' fill='none' stroke='%230b2f64' stroke-width='1'/%3E%3C/svg%3E");
  pointer-events: none;
}

[data-theme="dark"]::after {
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z M30 15 L45 30 L30 45 L15 30 Z M0 0 L15 15 M60 0 L45 15 M60 60 L45 45 M0 60 L15 45 M30 0 L30 15 M30 45 L30 60 M0 30 L15 30 M45 30 L60 30' fill='none' stroke='%2360a5fa' stroke-width='1'/%3E%3C/svg%3E");
}

@keyframes auroraFlow {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(2%, 3%) scale(1.05);
  }
  100% {
    transform: translate(-1%, -2%) scale(0.98);
  }
}

/* --- STRUCTURED COMPONENTS --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.content {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 10px 30px var(--shadow);
  padding: 2.5rem;
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: contentFadeIn 0.5s ease-out;
}

@keyframes contentFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- GENERAL BUTTONS --- */
.button {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  background: var(--primary);
  color: white !important;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px var(--shadow);
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.button:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--primary-glow);
}

.button:active {
  transform: translateY(0);
}

/* --- GENERAL GRID LAYOUTS --- */
.mainGrid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.leftColumn, .rightColumn {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--hover-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 6px 20px var(--shadow);
}

/* --- RESPONSIVE BREAKPOINTS --- */
@media (max-width: 968px) {
  .mainGrid {
    grid-template-columns: 1fr;
  }
}

/* On smaller screens the home page behaves like a prayer-times app:
   countdown first, then today's schedule, then secondary content. */
@media (max-width: 968px) {
  .mainGrid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .leftColumn,
  .rightColumn {
    display: contents;
  }

  #next-prayer-countdown {
    order: -3;
  }

  .prayer-grid {
    order: -2;
    margin-top: 0;
  }

  .bento-section-title {
    order: 1;
  }

  .bento-grid {
    order: 2;
  }

  #upcoming-event-container {
    order: 3;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 56px;
  }
  .container {
    padding: 1rem;
  }
  .content {
    padding: 1.5rem 1rem;
  }
}

/* --- HOME PAGE PRAYER GRID --- */
.prayer-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.prayer-widget-shell {
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: 0 8px 22px rgba(18, 62, 104, 0.06);
}

.prayer-widget {
  display: block;
  width: 100%;
  min-height: 358px;
  border: 0;
  background: white;
}

.prayer-widget-note {
  margin: 0;
  padding: 0.55rem 0.8rem;
  color: var(--text-secondary);
  font-size: 0.72rem;
  text-align: center;
  background: var(--hover-bg);
}

.prayer-row-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  transition: all 0.25s ease;
}

.prayer-row-card:hover {
  transform: translateX(4px);
  border-color: var(--primary-light);
  box-shadow: 0 4px 12px var(--shadow);
}

.prayer-title-text {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}

.prayer-times-block {
  display: flex;
  gap: 2rem;
}

.azan-time, .iqamah-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.azan-time .label, .iqamah-time .label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.azan-time .time, .iqamah-time .time {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--foreground);
}

/* --- COUNTDOWN WIDGET --- */
.countdown-widget {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 12px;
  padding: 1.5rem;
  color: white;
  text-align: center;
  box-shadow: 0 8px 24px var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.countdown-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  position: relative;
}

.pulse-dot::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--success);
  border-radius: 50%;
  animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.8); opacity: 0; }
}

.countdown-widget .label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  opacity: 0.85;
}

.countdown-title {
  font-size: 1.6rem;
  font-weight: 800;
}

.countdown-clock {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: monospace;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.25rem 1rem;
  border-radius: 8px;
  letter-spacing: 1px;
}

/* --- HERO CAMPAIGN CARD --- */
.campaign-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 8px 24px var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.campaign-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px var(--primary-glow);
}

.campaign-title-text {
  font-size: 1.35rem;
  font-weight: 700;
  color: white;
}

.campaign-desc-text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

.campaign-btn {
  background: white;
  color: var(--primary) !important;
  font-weight: 700;
  width: 100%;
}

.campaign-btn:hover {
  background: var(--hover-bg);
}

@media (max-width: 992px) {
  .campaign-card {
    display: none !important; /* Hide Campaign Card on Mobile/Tablet */
  }
}

/* --- CALENDAR EVENT CARD --- */
.event-card-inner {
  background: var(--hover-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.islamic-events-widget {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--card-bg);
  box-shadow: 0 8px 22px rgba(18, 62, 104, 0.06);
}

.islamic-events-widget iframe {
  display: block;
  width: 100%;
  height: 460px;
  border: 0;
  background: white;
}

.event-card-inner .badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.event-title {
  color: var(--primary);
  font-size: 1.15rem;
  margin: 0.25rem 0;
  font-weight: 700;
}

.event-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* --- CITY SELECTOR --- */
.city-select-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card-bg);
  padding: 0.58rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 143, 131, 0.2);
  margin-bottom: 0;
  box-shadow: 0 7px 18px rgba(18, 62, 104, 0.06);
}

.city-selector-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0;
}

.home-toolbar {
  display: flex;
  align-items: center;
  margin-bottom: 0.25rem;
}

.construction-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  color: #ffd166;
}

.construction-icon svg {
  width: 100%;
  height: 100%;
}

.city-select-box label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.city-select-box select {
  border: none;
  background: var(--hover-bg);
  color: var(--primary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
}

/* --- DARK MODE SELECTOR OVERRIDES --- */
[data-theme="dark"] .prayer-row-card {
  background: rgba(17, 28, 48, 0.45);
}

[data-theme="dark"] .campaign-card,
[data-theme="dark"] .countdown-widget {
  background: linear-gradient(135deg, #091322 0%, #15294a 100%);
  border-color: rgba(255, 255, 255, 0.08);
}

/* --- SECTION PANELS --- */
.section-panel {
  display: none;
  animation: panelFadeIn 0.3s ease-out;
}

.section-panel.active {
  display: block;
}

@keyframes panelFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- VIVID LANDING HERO BANNER --- */
.landing-hero {
  background: linear-gradient(120deg, var(--primary) 0%, var(--primary-light) 48%, var(--success) 100%);
  background-size: 180% 180%;
  padding: 3rem 2rem;
  border-radius: 16px;
  text-align: center;
  color: white;
  box-shadow: 0 10px 30px var(--shadow);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  animation: heroGradientShift 14s ease-in-out infinite alternate;
}

@keyframes heroGradientShift {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

.landing-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(6, 28, 60, 0.72), rgba(6, 28, 60, 0.18) 70%, rgba(6, 28, 60, 0.34)), radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
  animation: heroGlow 8s ease-in-out infinite alternate;
}

.landing-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
  z-index: 0;
  animation: heroImageDrift 18s ease-in-out infinite alternate;
}

.landing-hero > *:not(.landing-hero-image) {
  position: relative;
  z-index: 2;
}

@keyframes heroImageDrift {
  from { transform: scale(1.02); }
  to { transform: scale(1.08); }
}

.landing-hero::after {
  content: "";
  position: absolute;
  width: 22rem;
  height: 22rem;
  right: -7rem;
  bottom: -13rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 2rem rgba(255, 255, 255, 0.04), 0 0 0 4rem rgba(255, 255, 255, 0.025);
  transform: rotate(-18deg);
  pointer-events: none;
  z-index: 1;
  animation: heroOrbit 18s linear infinite;
}

@keyframes heroGlow {
  from { opacity: 0.55; transform: scale(1); }
  to { opacity: 1; transform: scale(1.08); }
}

@keyframes heroOrbit {
  to { transform: rotate(342deg); }
}

.landing-hero-title {
  font-size: 2.5rem;
  font-weight: 850;
  margin-bottom: 0.75rem;
  letter-spacing: -1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  color: white;
}

.landing-hero-desc {
  font-size: 1.15rem;
  max-width: 650px;
  margin: 0 auto;
  opacity: 0.95;
  line-height: 1.6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  color: rgba(255, 255, 255, 0.92);
}

[data-theme="dark"] .landing-hero {
  background: linear-gradient(135deg, #091322 0%, #15294a 50%, #115e59 100%);
  border-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  .landing-hero {
    padding: 2rem 1.5rem;
  }
  .landing-hero-title {
    font-size: 1.8rem;
  }
  .landing-hero-desc {
    font-size: 0.98rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-hero,
  .landing-hero-image,
  .landing-hero::before,
  .landing-hero::after {
    animation: none;
  }
}

/* --- INSTALL GUIDANCE MODAL --- */
.install-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 16, 34, 0.58);
  backdrop-filter: blur(8px);
  animation: modalFadeIn 0.22s ease-out;
}

.install-modal {
  width: min(100%, 430px);
  position: relative;
  padding: 2rem;
  text-align: center;
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.install-modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.85rem;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.install-modal-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 0.75rem;
  color: white;
  background: linear-gradient(135deg, var(--primary-light), var(--success));
  border-radius: 1.1rem;
  font-size: 1.6rem;
}

.install-modal-kicker {
  margin-bottom: 0.35rem;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.install-modal h2 { margin-bottom: 0.65rem; color: var(--primary); }
.install-modal > p { color: var(--text-secondary); line-height: 1.55; }
.install-modal-guide {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  text-align: left;
  background: var(--hover-bg);
  border-radius: 12px;
  line-height: 1.45;
}
.install-modal-guide span { color: var(--primary); font-weight: 800; }
.install-modal-action { width: 100%; }
.install-modal-later {
  margin-top: 0.8rem;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- BENTO GALLERY GRID --- */
.bento-section-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.bento-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 160px 160px;
  gap: 1rem;
  margin-bottom: 2rem;
}

.bento-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bento-item-large {
  grid-row: span 2;
}

.bento-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.bento-item:hover img {
  transform: scale(1.06);
}

.bento-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(9, 19, 34, 0.85) 0%, rgba(9, 19, 34, 0.2) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  box-sizing: border-box;
}

.bento-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.bento-title {
  font-size: 1.1rem;
  font-weight: 750;
  color: white;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@media (max-width: 600px) {
  .bento-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, 180px);
  }
  .bento-item-large {
    grid-row: span 1;
  }
}

/* --- BLOG POST ARCHITECTURAL STYLING --- */
.blog-post {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 1.5rem;
}

.blog-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-section-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.blog-image-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px var(--shadow);
}

.blog-image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.blog-image-wrapper:hover img {
  transform: scale(1.02);
}

.blog-text {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.blog-chapter-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.blog-h3 {
  font-size: 1.45rem;
  font-weight: 750;
  color: var(--primary);
  margin: 0;
}

.blog-p {
  color: var(--text);
  line-height: 1.7;
  font-size: 1.02rem;
  margin: 0;
}

@media (max-width: 768px) {
  .blog-section-row {
    grid-template-columns: 1fr;
  }
  .blog-section-row.reverse {
    direction: ltr; /* Reset order on mobile */
  }
  .landing-hero { margin-bottom: 1.5rem; }
}

/* --- ATMOSPHERIC FINISH --- */
h1, h2, h3, h4 {
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  letter-spacing: -0.025em;
}

body {
  background-image:
    radial-gradient(circle at 8% 8%, rgba(37, 143, 131, 0.1), transparent 28rem),
    radial-gradient(circle at 92% 88%, rgba(208, 107, 76, 0.08), transparent 25rem);
}

.container {
  padding-top: 2.25rem;
  padding-bottom: 3rem;
}

.home-toolbar + .prayer-data-status {
  margin: -0.35rem auto 0.5rem;
}

.home-toolbar + .prayer-data-status + .mainGrid {
  margin-top: 0.25rem;
}

.home-toolbar + .prayer-data-status:empty + .mainGrid {
  margin-top: 0.25rem;
}

.content {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 18px 55px rgba(18, 62, 104, 0.1);
}

.content::before {
  content: "";
  position: absolute;
  top: -8rem;
  right: -6rem;
  width: 18rem;
  height: 18rem;
  border: 1px solid rgba(37, 143, 131, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 1.5rem rgba(37, 143, 131, 0.035), 0 0 0 3rem rgba(37, 143, 131, 0.025);
  pointer-events: none;
}

.content > * {
  position: relative;
  z-index: 1;
}

.city-select-box {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(37, 143, 131, 0.18);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(18, 62, 104, 0.06);
}

.city-select-box label svg {
  color: var(--accent);
}

.prayer-grid {
  gap: 0.65rem;
}

.prayer-row-card {
  position: relative;
  overflow: hidden;
  min-height: 76px;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0.84), rgba(225, 238, 237, 0.62));
  border-radius: 15px;
  box-shadow: 0 5px 16px rgba(18, 62, 104, 0.045);
}

.prayer-row-card::after {
  content: "";
  position: absolute;
  right: -1.5rem;
  bottom: -2.4rem;
  width: 6rem;
  height: 6rem;
  border: 1px solid rgba(37, 143, 131, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.prayer-row-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 143, 131, 0.28);
  box-shadow: 0 10px 22px rgba(18, 62, 104, 0.1);
}

.prayer-title-text {
  position: relative;
  z-index: 1;
}

.azan-time .time, .iqamah-time .time {
  font-variant-numeric: tabular-nums;
}

.countdown-widget,
.campaign-card {
  position: relative;
  overflow: hidden;
  border: 0;
  background: linear-gradient(145deg, #123e68 0%, #2d7890 58%, #258f83 100%);
  box-shadow: 0 16px 32px rgba(18, 62, 104, 0.18);
}

.countdown-widget::before,
.campaign-card::before {
  content: "";
  position: absolute;
  width: 13rem;
  height: 13rem;
  top: -8rem;
  right: -5rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 0 1.25rem rgba(255, 255, 255, 0.05), 0 0 0 2.5rem rgba(255, 255, 255, 0.03);
}

.countdown-widget > *,
.campaign-card > * {
  position: relative;
  z-index: 1;
}

.countdown-clock {
  border-radius: 12px;
  background: rgba(5, 29, 48, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.event-card-inner {
  background: rgba(255, 255, 255, 0.58);
  border-radius: 15px;
  box-shadow: 0 7px 20px rgba(18, 62, 104, 0.05);
}

.bento-item,
.blog-image-wrapper {
  border-radius: 18px;
  border-color: rgba(18, 62, 104, 0.12);
  box-shadow: 0 10px 24px rgba(18, 62, 104, 0.08);
}

.bento-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 30px rgba(18, 62, 104, 0.14);
}

.bento-tag,
.blog-chapter-num {
  color: var(--accent);
}

[data-theme="dark"] .content::before {
  border-color: rgba(93, 199, 180, 0.15);
  box-shadow: 0 0 0 1.5rem rgba(93, 199, 180, 0.045), 0 0 0 3rem rgba(93, 199, 180, 0.025);
}

[data-theme="dark"] .city-select-box,
[data-theme="dark"] .event-card-inner {
  background: rgba(18, 50, 71, 0.72);
}

[data-theme="dark"] .prayer-row-card {
  background: linear-gradient(105deg, rgba(17, 48, 68, 0.86), rgba(18, 50, 71, 0.62));
}

/* --- ABOUT PAGE: A MORE LIVING INTRODUCTION --- */
.about-header {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
  padding: 2.5rem 2rem 2.25rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(18, 62, 104, 0.08), rgba(37, 143, 131, 0.12));
  border: 1px solid rgba(37, 143, 131, 0.14);
  border-radius: 20px;
}

.about-header::after {
  content: "";
  position: absolute;
  width: 17rem;
  height: 17rem;
  right: -5rem;
  top: -11rem;
  border: 1px solid rgba(37, 143, 131, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 1.25rem rgba(37, 143, 131, 0.04), 0 0 0 2.5rem rgba(37, 143, 131, 0.025);
  animation: aboutOrbit 16s linear infinite;
}

.about-header > * {
  position: relative;
  z-index: 1;
}

.about-header-mark {
  width: 3.3rem;
  height: 3.3rem;
  margin: 0 auto 0.75rem;
  color: var(--accent);
}

.about-header-mark svg {
  width: 100%;
  height: 100%;
}

.about-kicker {
  margin-bottom: 0.55rem;
  color: var(--primary-light);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.about-header h1 {
  margin-bottom: 0.5rem;
  color: var(--primary);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 850;
}

.about-header > p:not(.about-kicker) {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-secondary);
  line-height: 1.6;
}

.about-header-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  margin-top: 1.25rem;
}

.about-text-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.about-text-link:hover {
  color: var(--accent);
}

.about-facts-card {
  display: grid;
  gap: 0.7rem;
  padding: 1.25rem;
  background: linear-gradient(145deg, rgba(225, 238, 237, 0.82), rgba(255, 255, 255, 0.7));
  border: 1px solid rgba(37, 143, 131, 0.15);
  border-radius: 16px;
  box-shadow: 0 9px 22px rgba(18, 62, 104, 0.06);
}

.about-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}

.about-fact:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.about-fact-label {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.about-fact strong {
  color: var(--primary);
  font-size: 0.95rem;
  text-align: right;
}

[data-theme="dark"] .about-header {
  background: linear-gradient(135deg, rgba(118, 185, 210, 0.1), rgba(93, 199, 180, 0.1));
}

[data-theme="dark"] .about-facts-card {
  background: linear-gradient(145deg, rgba(18, 50, 71, 0.86), rgba(17, 39, 55, 0.72));
}

@keyframes aboutOrbit {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .about-header::after { animation: none; }
}

@media (max-width: 768px) {
  .container {
    padding-top: 1.25rem;
  }

  .content {
    border-radius: 20px;
  }

  .landing-hero {
    display: none;
  }

  .landing-hero-title {
    font-size: 1.45rem;
    margin-bottom: 0.35rem;
  }

  .landing-hero-desc {
    font-size: 0.86rem;
    line-height: 1.4;
  }

  .prayer-data-status {
    margin-top: -0.35rem;
    margin-bottom: 0.8rem;
  }

  #next-prayer-countdown {
    margin-bottom: 0.25rem;
  }

  .countdown-widget {
    padding: 1.15rem 1rem;
    border-radius: 17px;
  }

  .countdown-title {
    font-size: 1.4rem;
  }

  .countdown-clock {
    font-size: 2rem;
  }

  .prayer-row-card {
    min-height: 68px;
    padding: 0.8rem 1rem;
  }

  .prayer-title-text {
    font-size: 0.96rem;
  }

  .prayer-times-block {
    gap: 1rem;
  }

  .azan-time .time, .iqamah-time .time {
    font-size: 1.05rem;
  }

  .bento-section-title {
    margin-top: 1rem;
    font-size: 1.3rem;
  }

  .bento-grid {
    margin-bottom: 0;
  }

  .city-select-box {
    width: 100%;
    justify-content: center;
  }

  .home-toolbar {
    margin-bottom: 0.25rem;
  }

  .city-selector-row {
    justify-content: center;
  }

  .about-header {
    padding: 1.75rem 1rem;
  }

  .about-header-actions {
    flex-direction: column;
    gap: 0.8rem;
  }

  .about-header-actions .button {
    width: 100%;
  }

  .about-fact {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .about-fact strong {
    text-align: left;
  }
}
