/* Noor Al-Masir — New interface direction: contemporary Islamic editorial app */
:root {
  --ink: #0d2825;
  --muted: #62736f;
  --green-950: #041f1d;
  --green-900: #072c29;
  --green-800: #0d413b;
  --green-700: #176658;
  --green-100: #e7f0ed;
  --gold: #c8a24d;
  --gold-soft: #f5e7b6;
  --cream: #eef1ed;
  --paper: #fffefa;
  --line: #d9e1dd;
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 16px 45px rgba(4,31,29,.08);
}

body {
  background:
    linear-gradient(90deg, rgba(200,162,77,.035) 1px, transparent 1px),
    linear-gradient(rgba(200,162,77,.035) 1px, transparent 1px),
    var(--cream);
  background-size: 44px 44px;
}

.desktop-rail {
  position: fixed;
  z-index: 80;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 230px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px 13px 13px;
  color: #fff;
  background:
    radial-gradient(circle at 10% 0, rgba(200,162,77,.18), transparent 15rem),
    linear-gradient(160deg, #0b3934 0%, #041f1d 72%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 28px;
  box-shadow: 0 25px 70px rgba(4,31,29,.24);
  scrollbar-width: none;
}
.desktop-rail::-webkit-scrollbar { display: none; }
.rail-brand {
  display: grid;
  grid-template-columns: 47px 1fr;
  gap: 11px;
  align-items: center;
  width: 100%;
  padding: 3px 2px 16px;
  text-align: right;
  color: #fff;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
  cursor: pointer;
}
.rail-brand-mark { width: 47px; height: 47px; display: grid; place-items: center; background: var(--gold-soft); border-radius: 16px; }
.rail-brand-mark svg { width: 31px; }
.rail-brand-mark path:first-child { fill: var(--green-950); }
.rail-brand-mark path:last-child { fill: var(--gold); }
.rail-brand strong, .rail-brand small { display: block; }
.rail-brand strong { font-size: 17px; }
.rail-brand small { margin-top: 3px; color: rgba(255,255,255,.5); font-size: 8px; }

.rail-prayer {
  position: relative;
  overflow: hidden;
  margin: 15px 0 12px;
  padding: 15px;
  background: linear-gradient(135deg, rgba(255,255,255,.1), rgba(255,255,255,.045));
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
}
.rail-prayer::after { content: ""; position: absolute; left: -26px; bottom: -42px; width: 95px; height: 95px; border: 1px solid rgba(200,162,77,.22); border-radius: 50%; box-shadow: 0 0 0 17px rgba(200,162,77,.035); }
.rail-prayer > span { color: var(--gold); font-size: 8px; font-weight: 900; }
.rail-prayer > strong { display: block; margin-top: 5px; font-size: 20px; }
.rail-prayer > small { direction: ltr; display: block; margin-top: 1px; color: rgba(255,255,255,.56); text-align: right; font-size: 9px; }
.rail-prayer > button { position: relative; z-index: 1; margin-top: 11px; padding: 0; color: var(--gold-soft); background: transparent; border: 0; cursor: pointer; font-size: 8px; font-weight: 900; }

.rail-navigation { display: grid; gap: 4px; }
.rail-label { margin: 9px 8px 4px; color: rgba(255,255,255,.34); font-size: 7px; font-weight: 900; letter-spacing: .08em; }
.rail-navigation > button {
  position: relative;
  display: grid;
  grid-template-columns: 35px 1fr;
  gap: 0 9px;
  align-items: center;
  min-height: 52px;
  padding: 7px 8px;
  text-align: right;
  color: rgba(255,255,255,.67);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: .18s ease;
}
.rail-navigation > button:hover { color: #fff; background: rgba(255,255,255,.055); }
.rail-navigation > button.active { color: var(--green-950); background: var(--gold-soft); box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.rail-navigation i { grid-row: 1 / span 2; width: 35px; height: 35px; display: grid; place-items: center; background: rgba(255,255,255,.07); border-radius: 11px; font-size: 16px; font-style: normal; }
.rail-navigation button.active i { color: var(--gold-soft); background: var(--green-900); }
.rail-navigation b { font-size: 9px; }
.rail-navigation small { color: rgba(255,255,255,.38); font-size: 7px; }
.rail-navigation button.active small { color: rgba(4,31,29,.52); }

.rail-footer { display: grid; gap: 7px; margin-top: auto; padding-top: 13px; }
.rail-footer button, .rail-footer a { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; color: rgba(255,255,255,.68); background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08); border-radius: 13px; cursor: pointer; text-decoration: none; font-size: 8px; font-weight: 900; }
.rail-footer button.active { color: var(--green-950); background: var(--gold-soft); }
.rail-footer a i { width: 7px; height: 7px; background: #e34a4a; border-radius: 50%; box-shadow: 0 0 0 4px rgba(227,74,74,.12); }

.topbar {
  top: 14px;
  width: auto;
  max-width: none;
  min-height: 62px;
  margin: 16px 264px 0 18px;
  padding: 9px 13px;
  justify-content: flex-end;
  background: rgba(255,254,250,.82);
  border: 1px solid rgba(13,40,37,.08);
  border-radius: 18px;
  box-shadow: 0 10px 35px rgba(4,31,29,.055);
}
.topbar .brand { display: none; }
.top-actions { gap: 7px; }
.top-actions > * { min-height: 39px; background: rgba(255,255,255,.92); box-shadow: none; }
.prayer-pill { display: none; }

main {
  max-width: 1600px;
  margin: 0 246px 0 0;
  padding: 20px 18px 80px;
}
footer { margin: 0 264px 54px 18px; border-radius: 22px; }
.bottom-nav { display: none; }

.hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr); gap: 15px; }
.hero-card {
  min-height: 555px;
  padding: 58px 50px 42px;
  background:
    radial-gradient(circle at 15% 14%, rgba(200,162,77,.22), transparent 20rem),
    linear-gradient(145deg, #0c443d 0%, #041f1d 67%, #031714 100%);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 30px;
  box-shadow: 0 25px 65px rgba(4,31,29,.22);
}
.hero-card::before { content: ""; position: absolute; top: 73px; left: -125px; width: 360px; height: 360px; border: 1px solid rgba(245,231,182,.17); border-radius: 50% 50% 0 0; box-shadow: 0 0 0 34px rgba(245,231,182,.025), 0 0 0 70px rgba(245,231,182,.02); transform: rotate(-20deg); }
.hero-card::after { width: 270px; height: 270px; inset: auto -95px -115px auto; }
.hero-pattern { opacity: .045; background-size: 37px 65px; }
.hero-card h1 { margin-top: 24px; font-size: clamp(48px, 5vw, 72px); line-height: 1.14; letter-spacing: -.06em; }
.hero-card > p { max-width: 560px; font-size: 15px; }
.hero-quote { right: 42px; left: 42px; bottom: 38px; background: rgba(255,255,255,.055); border-radius: 16px; }

.planner-card { min-height: 555px; padding: 31px 28px; background: rgba(255,254,250,.97); border: 1px solid rgba(13,40,37,.07); border-radius: 30px; box-shadow: var(--shadow); }
.planner-card::before { content: "خطّط · اقرأ · تدبّر"; display: block; margin: -31px -28px 24px; padding: 10px 27px; color: var(--gold-soft); background: var(--green-900); border-radius: 30px 30px 0 0; font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.planner-card .section-heading.compact { margin-bottom: 25px; }
.section-heading.compact h2 { font-size: 28px; }
.input-row { min-height: 52px; background: #f9faf8; border-color: #d8e1dd; }
.mode-selector label span { min-height: 69px; background: #f7f9f7; }
.mode-selector input:checked + span { color: #fff; background: var(--green-900); box-shadow: 0 9px 20px rgba(4,31,29,.16); }
.primary-button { color: var(--green-950); background: var(--gold-soft); box-shadow: 0 10px 25px rgba(200,162,77,.2); }
.primary-button:hover { background: #f8e3a3; }
.primary-button b { background: var(--green-900); color: var(--gold-soft); }

.home-command-bar { grid-template-columns: 1.1fr 1fr 1fr 1.1fr; gap: 9px; margin: 14px 0 40px; }
.home-command-bar > button { min-height: 79px; padding: 12px; background: rgba(255,254,250,.93); border: 1px solid rgba(13,40,37,.07); border-radius: 16px; box-shadow: 0 8px 25px rgba(4,31,29,.045); }
.home-command-bar .command-icon { width: 42px; height: 42px; color: var(--green-950); background: var(--gold-soft); }
.home-command-bar > button:nth-child(3) .command-icon { color: #d7f6ef; background: var(--green-900); }

.value-section { margin-top: 4px; padding: 29px; background: rgba(255,254,250,.58); border: 1px solid rgba(13,40,37,.065); border-radius: 28px; }
.value-section .section-heading { margin-bottom: 22px; }
.feature-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.feature-card { min-height: 195px; padding: 21px; background: rgba(255,254,250,.95); border: 1px solid rgba(13,40,37,.075); border-radius: 18px; box-shadow: none; }
.feature-card:hover { border-color: var(--gold); box-shadow: 0 15px 35px rgba(4,31,29,.08); }
.feature-icon { width: 44px; height: 44px; color: var(--gold-soft); background: var(--green-900); border-radius: 13px; }
.feature-card h3 { margin-top: 18px; }

.content-view { max-width: 1420px; }
.content-view > .page-intro,
.adhkar-hero, .manasik-hero, .heritage-hero, .quiz-hero, .zakat-hero, .ramadan-hero {
  border-radius: 26px;
  box-shadow: 0 18px 45px rgba(4,31,29,.11);
}
.page-intro { padding: 38px; background: rgba(255,254,250,.93); border: 1px solid rgba(13,40,37,.07); }
.page-intro h1 { letter-spacing: -.045em; }
.manasik-hero, .adhkar-hero, .zakat-hero { background: linear-gradient(145deg, #0c443d, #041f1d); }
.heritage-hero { background: linear-gradient(145deg, #4b3123, #1d1713); }
.quiz-hero { background: linear-gradient(145deg, #0b3f46, #041f27); }
.ramadan-hero { background: linear-gradient(145deg, #0c443d, #041f1d); }
.manasik-tabs, .adhkar-tabs, .atlas-tabs { position: sticky; top: 91px; z-index: 18; padding: 6px; background: rgba(255,254,250,.91); border: 1px solid rgba(13,40,37,.07); border-radius: 16px; box-shadow: 0 8px 25px rgba(4,31,29,.07); backdrop-filter: blur(15px); }
.manasik-tabs button, .adhkar-tabs button, .atlas-tabs button { min-height: 43px; border-radius: 11px; }

.ritual-timeline article, .hajj-days article, .science-card, .dhikr-card, .historical-site-card, .atlas-card, .quiz-question-card, .zakat-form-card, .zakat-result-card, .relative-form-card, .relatives-panel {
  border-color: rgba(13,40,37,.075);
  box-shadow: 0 10px 30px rgba(4,31,29,.055);
}
.zamzam-card { background: linear-gradient(135deg, #ebf8fa 0%, #fffefa 58%, #f8f0d8 100%); border-radius: 24px; }

.more-sheet:not([hidden]) { right: calc(50% + 123px); bottom: 22px; width: min(940px, calc(100% - 290px)); border-radius: 25px; }
.nav-scrim:not([hidden]) { right: 246px; }

@media (max-width: 1280px) and (min-width: 1101px) {
  .desktop-rail { width: 210px; }
  .topbar { margin-right: 238px; }
  main { margin-right: 220px; }
  footer { margin-right: 238px; }
  .rail-brand { grid-template-columns: 42px 1fr; }
  .rail-brand-mark { width: 42px; height: 42px; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-grid { grid-template-columns: 1fr minmax(370px, .83fr); }
  .hero-card { padding-right: 39px; padding-left: 39px; }
  .more-sheet:not([hidden]) { right: calc(50% + 110px); width: min(900px, calc(100% - 250px)); }
  .nav-scrim:not([hidden]) { right: 220px; }
}

@media (max-width: 1100px) {
  .desktop-rail { display: none; }
  .topbar { width: calc(100% - 24px); margin: 10px auto 0; justify-content: space-between; }
  .topbar .brand { display: flex; }
  .prayer-pill { display: grid; }
  main { max-width: 1280px; margin: 0 auto; padding: 18px 18px 78px; }
  footer { margin: 0 24px 48px; }
  .bottom-nav { display: flex; }
  .nav-scrim:not([hidden]) { right: 0; }
  .more-sheet:not([hidden]) { right: 50%; bottom: 93px; width: min(920px, calc(100% - 24px)); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card, .planner-card { min-height: 520px; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  body { background-size: 30px 30px; }
  .topbar { width: calc(100% - 14px); min-height: 60px; margin-top: 6px; }
  main { padding: 13px 11px 60px; }
  .hero-card { min-height: 435px; padding: 37px 23px 22px; }
  .hero-card h1 { font-size: clamp(39px, 12vw, 53px); }
  .hero-quote { right: 21px; left: 21px; bottom: 21px; }
  .planner-card { min-height: 0; padding: 23px 18px; }
  .planner-card::before { margin: -23px -18px 20px; padding-right: 18px; border-radius: 25px 25px 0 0; }
  .home-command-bar { display: flex; }
  .value-section { padding: 21px 14px; border-radius: 22px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-card { min-height: 184px; padding: 18px; }
  .manasik-tabs, .adhkar-tabs, .atlas-tabs { top: 77px; }
  .content-view > .page-intro, .adhkar-hero, .manasik-hero, .heritage-hero, .quiz-hero, .zakat-hero, .ramadan-hero { border-radius: 23px; }
}

@media (max-width: 440px) {
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 154px; }
  .feature-card p { min-height: 0; }
  .quran-radio-pill { display: flex; }
}
