
/* =========================================================
   IQRANIX — GUIDE TO SWALAH
   MIDNIGHT NAVY • IVORY • CHAMPAGNE GOLD
   ========================================================= */

:root {
  --navy: #101f38;
  --navy-deep: #0a172b;
  --navy-soft: #1b3152;
  --gold: #b89b62;
  --gold-light: #d7c49a;
  --ivory: #f7f5f0;
  --paper: #fffefa;
  --ink: #293344;
  --muted: #667080;
  --line: #e7e1d5;
  --soft-blue: #eef2f7;
  --soft-gold: #f6f1e7;
  --shadow: 0 12px 35px rgba(16,31,56,.07);
  --content-width: 900px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  background: var(--ivory);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--ivory);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
}

a {
  color: var(--navy-soft);
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}

a:hover {
  color: #8c713d;
}

button {
  font: inherit;
}

/* ================= COVER PAGE ================= */

.cover-page {
  width: 100%;
  min-height: 100svh;
  padding: 28px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(184,155,98,.13), transparent 42%),
    var(--navy);
  page-break-after: always;
  break-after: page;
}

.cover-image {
  display: block;
  width: min(100%, 820px);
  height: calc(100svh - 56px);
  max-height: 1120px;
  min-height: 420px;
  object-fit: contain;
  object-position: center;
  border-radius: 4px;
}

/* ================= DOCUMENT HEADER ================= */

.document-header {
  position: relative;
  width: min(calc(100% - 40px), var(--content-width));
  margin: 42px auto 28px;
  padding: clamp(28px, 6vw, 62px) clamp(22px, 6vw, 66px);
  overflow: hidden;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 90% 10%, rgba(215,196,154,.14), transparent 30%),
    linear-gradient(145deg, var(--navy-deep), var(--navy) 65%, #20395d);
  border: 1px solid rgba(184,155,98,.55);
  border-radius: 3px;
  box-shadow: var(--shadow);
}

.document-header::before,
.document-header::after {
  position: absolute;
  width: 180px;
  height: 180px;
  content: "";
  border: 1px solid rgba(215,196,154,.16);
  transform: rotate(45deg);
  pointer-events: none;
}

.document-header::before {
  top: -125px;
  left: -100px;
}

.document-header::after {
  right: -115px;
  bottom: -135px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-bottom: 26px;
}

.brand-symbol {
  color: var(--gold-light);
  font-family: Georgia, serif;
  font-size: 36px;
  line-height: 1;
}

.brand-details h1 {
  margin: 0;
  color: #fff;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.15;
}

.brand-details p {
  margin: 5px 0 0;
  color: rgba(255,255,255,.76);
  font-size: 12px;
  letter-spacing: .035em;
}

.document-label {
  margin: 30px 0 16px;
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
}

.document-header h2 {
  margin: 0;
  color: #fff;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(32px, 6.5vw, 54px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .015em;
}

.document-subtitle {
  max-width: 650px;
  margin: 18px auto 0;
  color: rgba(255,255,255,.84);
  font-size: clamp(15px, 2.5vw, 18px);
  line-height: 1.75;
}

.document-divider {
  margin: 27px auto 22px;
  color: var(--gold-light);
  font-size: 17px;
  letter-spacing: .13em;
}

.document-actions {
  margin-top: 24px;
}

.print-button {
  min-height: 48px;
  padding: 12px 24px;
  color: #fff;
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.print-button:hover {
  background: rgba(184,155,98,.18);
  transform: translateY(-1px);
}

/* ================= MAIN DOCUMENT ================= */

.guide-document {
  width: min(calc(100% - 40px), var(--content-width));
  margin: 0 auto 54px;
  padding: clamp(24px, 5vw, 58px) clamp(20px, 6vw, 68px);
  background: var(--paper);
  border: 1px solid #eee9df;
  box-shadow: var(--shadow);
}

.guide-section,
.guide-chapter {
  margin: 0;
  padding: 0 0 48px;
  scroll-margin-top: 24px;
}

.guide-section + .guide-section,
.guide-chapter + .guide-chapter {
  padding-top: 42px;
  border-top: 1px solid var(--line);
}

.chapter-number {
  display: inline-block;
  margin: 0 0 12px;
  color: #9b804d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  line-height: 1.5;
  text-transform: uppercase;
}

.guide-section > h2,
.chapter-heading h2,
.contents-section > h2 {
  margin: 0 0 22px;
  color: var(--navy);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(27px, 4.5vw, 37px);
  font-weight: 600;
  line-height: 1.25;
}

.chapter-heading {
  margin-bottom: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.chapter-heading .chapter-number {
  margin-bottom: 10px;
}

.chapter-heading h2 {
  margin-bottom: 10px;
}

.chapter-intro {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.guide-section h3,
.guide-chapter h3 {
  margin: 32px 0 11px;
  color: var(--navy-soft);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(20px, 3.3vw, 24px);
  font-weight: 600;
  line-height: 1.4;
}

.guide-section h4,
.guide-chapter h4 {
  margin: 22px 0 8px;
  color: var(--navy);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.guide-section p,
.guide-chapter p {
  margin: 0 0 17px;
}

.guide-section ul,
.guide-section ol,
.guide-chapter ul,
.guide-chapter ol {
  padding-left: 25px;
  margin: 12px 0 22px;
}

.guide-section li,
.guide-chapter li {
  padding-left: 5px;
  margin: 7px 0;
}

.guide-section li::marker,
.guide-chapter li::marker {
  color: var(--gold);
  font-weight: 700;
}

/* ================= TABLE OF CONTENTS ================= */

.contents-section {
  padding-bottom: 46px;
}

.contents-section > h2 {
  margin-bottom: 14px;
}

.contents-section > p {
  color: var(--muted);
}

.contents-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
  padding: 18px 0 18px 28px !important;
  margin: 22px 0 26px !important;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.contents-list li {
  padding: 7px 0 7px 4px;
  margin: 0;
  border-bottom: 1px solid #f0ede7;
}

.contents-list a {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.contents-list a:hover,
.contents-list a.active {
  color: #967844;
  text-decoration: underline;
  text-decoration-color: var(--gold);
}

/* ================= INFORMATION BOXES ================= */

.editorial-note,
.reference-box,
.instruction-card,
.prayer-information,
.information-card,
.school-card,
.resource-card,
.quran-reference {
  margin: 22px 0;
  padding: 20px 22px;
  border-radius: 8px;
}

.editorial-note {
  background: var(--soft-gold);
  border-left: 3px solid var(--gold);
}

.editorial-note > strong,
.reference-box > strong,
.quran-reference > strong {
  display: block;
  margin-bottom: 7px;
  color: var(--navy);
  font-size: 14px;
}

.editorial-note p:last-child,
.reference-box p:last-child,
.quran-reference p:last-child {
  margin-bottom: 0;
}

.reference-box {
  background: #f3f5f8;
  border: 1px solid #e3e8ef;
  border-left: 3px solid var(--navy-soft);
}

.reference-box p,
.reference-box li {
  color: #536071;
  font-size: 14px;
}

.reference-box ul {
  margin-bottom: 0;
}

.instruction-card {
  padding: 24px 26px;
  background: #fbfaf7;
  border: 1px solid var(--line);
}

.instruction-card h4:first-child {
  margin-top: 0;
}

.instruction-card h4 {
  color: #967844;
}

.prayer-information {
  background: var(--soft-blue);
  border: 1px solid #e0e7f0;
}

.prayer-information > strong {
  color: var(--navy);
}

.prayer-information p:last-child {
  margin-bottom: 0;
}

.information-card,
.school-card,
.resource-card {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 5px 18px rgba(16,31,56,.035);
}

.information-card h4,
.school-card h4,
.resource-card h4 {
  margin-top: 0;
  color: var(--navy);
}

.quran-reference {
  background: var(--soft-gold);
  border: 1px solid #e9dfcb;
}

.quran-reference p {
  margin-bottom: 0;
}

/* ================= ARABIC TEXT ================= */

.arabic-quote,
.arabic-text {
  direction: rtl;
  unicode-bidi: isolate;
  color: var(--navy);
  font-family: "Amiri", "Noto Naskh Arabic", serif;
  font-weight: 700;
  text-align: center;
  line-height: 2.05;
  overflow-wrap: anywhere;
}

.arabic-quote {
  margin: 24px 0 12px;
  padding: 18px 20px;
  background: #f7f4ed;
  border-top: 1px solid #e9dfcb;
  border-bottom: 1px solid #e9dfcb;
  font-size: clamp(23px, 4.5vw, 31px);
}

.arabic-text {
  margin: 18px 0;
  padding: 20px 16px;
  background: #f7f4ed;
  border: 1px solid #e9dfcb;
  border-radius: 8px;
  font-size: clamp(25px, 5vw, 34px);
  white-space: normal;
}

.large-arabic {
  font-size: clamp(30px, 6vw, 42px);
  line-height: 2.15;
}

.arabic-cell {
  direction: rtl;
  font-family: "Amiri", "Noto Naskh Arabic", serif;
  font-size: 22px;
  text-align: right;
}

.transliteration {
  margin: 12px 0 8px !important;
  color: #8b7040;
  font-size: 15px;
  font-style: italic;
  line-height: 1.8;
}

.translation {
  margin: 8px 0 18px !important;
  color: #596575;
  font-size: 14px;
  line-height: 1.8;
}

.recitation-location {
  margin: 12px 0 22px !important;
  padding: 10px 14px;
  color: #5c6674;
  background: #f3f5f8;
  border-left: 2px solid var(--gold);
  font-size: 13px;
}

.surah-label {
  margin: 24px 0 8px !important;
  color: #987d49;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ================= TABLES ================= */

.guide-table {
  width: 100%;
  margin: 22px 0 28px;
  border-collapse: collapse;
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.6;
}

.guide-table th {
  padding: 13px 14px;
  color: #fff;
  background: var(--navy);
  font-weight: 700;
  text-align: left;
}

.guide-table td {
  padding: 12px 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.guide-table tbody tr:nth-child(even) {
  background: #f8f7f3;
}

.guide-table tbody tr:last-child td {
  border-bottom: 0;
}

/* ================= TWO-COLUMN LAYOUT ================= */

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0;
}

.grid-two > * {
  min-width: 0;
  margin: 0;
}

/* ================= CHECKLISTS ================= */

.learning-checklist {
  padding: 20px 24px 20px 46px !important;
  background: #f8f7f3;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.learning-checklist li {
  padding: 5px 0 5px 4px;
}

.learning-checklist li::marker {
  color: #a48750;
}

/* ================= CLOSING SECTION ================= */

.closing-quote {
  margin: 28px 0;
  padding: 28px 22px;
  color: #fff;
  text-align: center;
  background: var(--navy);
  border: 1px solid var(--gold);
}

.closing-quote .arabic-text {
  color: var(--gold-light);
  background: transparent;
  border: 0;
}

.closing-quote p:not(.arabic-text) {
  margin: 10px 0;
  color: rgba(255,255,255,.9);
}

.closing-quote span {
  color: var(--gold-light);
  font-size: 12px;
  letter-spacing: .08em;
}

.guide-contact {
  margin: 30px 0 0;
  padding: 24px;
  background: #f4f5f7;
  border: 1px solid #e3e7ed;
  border-radius: 8px;
}

.guide-contact h3 {
  margin-top: 0;
}

.guide-contact a {
  font-weight: 700;
}

.final-disclaimer {
  padding-bottom: 24px;
}

/* ================= FOOTER ================= */

.document-footer {
  width: min(calc(100% - 40px), var(--content-width));
  margin: 0 auto 38px;
  padding: 22px 16px;
  color: #dce3ed;
  text-align: center;
  background: var(--navy);
  border-top: 2px solid var(--gold);
}

.document-footer p {
  margin: 3px 0;
  font-size: 12px;
}

/* ================= GENERAL DETAILS ================= */

strong {
  color: #26364e;
}

hr {
  height: 1px;
  margin: 30px 0;
  background: var(--line);
  border: 0;
}

:focus-visible {
  outline: 3px solid rgba(184,155,98,.65);
  outline-offset: 3px;
}

/* ================= TABLET ================= */

@media (max-width: 760px) {
  .cover-page {
    min-height: 72svh;
    padding: 18px;
  }

  .cover-image {
    height: 68svh;
    min-height: 320px;
  }

  .document-header {
    width: min(calc(100% - 24px), var(--content-width));
    margin: 18px auto;
    padding: 34px 24px;
  }

  .guide-document {
    width: min(calc(100% - 24px), var(--content-width));
    padding: 30px 25px;
  }

  .document-footer {
    width: min(calc(100% - 24px), var(--content-width));
  }

  .contents-list {
    grid-template-columns: 1fr;
  }
}

/* ================= MOBILE ================= */

@media (max-width: 520px) {
  body {
    font-size: 15px;
    line-height: 1.75;
  }

  .cover-page {
    min-height: 58svh;
    padding: 12px;
  }

  .cover-image {
    width: 100%;
    height: 54svh;
    min-height: 260px;
  }

  .document-header {
    width: 100%;
    margin: 0 auto;
    padding: 32px 22px 30px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .brand {
    gap: 10px;
    margin-bottom: 22px;
  }

  .brand-symbol {
    font-size: 30px;
  }

  .brand-details h1 {
    font-size: 34px;
  }

  .brand-details p {
    font-size: 11px;
  }

  .document-label {
    margin: 25px 0 13px;
    font-size: 10px;
    letter-spacing: .19em;
  }

  .document-header h2 {
    font-size: 34px;
  }

  .document-subtitle {
    margin-top: 14px;
    font-size: 15px;
  }

  .document-divider {
    margin: 20px auto 16px;
    font-size: 14px;
    letter-spacing: .04em;
  }

  .print-button {
    width: 100%;
    min-height: 48px;
  }

  .guide-document {
    width: 100%;
    margin: 0 auto 30px;
    padding: 28px 20px 34px;
    border-right: 0;
    border-left: 0;
    box-shadow: none;
  }

  .guide-section,
  .guide-chapter {
    padding-bottom: 34px;
  }

  .guide-section + .guide-section,
  .guide-chapter + .guide-chapter {
    padding-top: 30px;
  }

  .chapter-number {
    margin-bottom: 9px;
    font-size: 10px;
    letter-spacing: .18em;
  }

  .guide-section > h2,
  .chapter-heading h2,
  .contents-section > h2 {
    margin-bottom: 16px;
    font-size: 27px;
  }

  .guide-section h3,
  .guide-chapter h3 {
    margin-top: 26px;
    font-size: 21px;
  }

  .guide-section h4,
  .guide-chapter h4 {
    font-size: 15px;
  }

  .chapter-heading {
    margin-bottom: 24px;
    padding-bottom: 18px;
  }

  .chapter-intro {
    font-size: 14px;
  }

  .contents-list {
    padding: 14px 0 14px 24px !important;
    margin: 18px 0 22px !important;
  }

  .contents-list li {
    padding: 7px 0 7px 2px;
  }

  .contents-list a {
    font-size: 14px;
  }

  .editorial-note,
  .reference-box,
  .instruction-card,
  .prayer-information,
  .information-card,
  .school-card,
  .resource-card,
  .quran-reference {
    margin: 18px 0;
    padding: 16px;
  }

  .arabic-quote {
    margin: 20px 0 10px;
    padding: 14px 10px;
    font-size: 25px;
    line-height: 2;
  }

  .arabic-text {
    padding: 16px 10px;
    font-size: 27px;
    line-height: 2;
  }

  .large-arabic {
    font-size: 31px;
  }

  .transliteration {
    font-size: 14px;
  }

  .translation {
    font-size: 13px;
  }

  .guide-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 13px;
  }

  .guide-table th,
  .guide-table td {
    min-width: 105px;
    padding: 10px;
  }

  .grid-two {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .learning-checklist {
    padding: 16px 16px 16px 38px !important;
  }

  .closing-quote {
    padding: 22px 15px;
  }

  .guide-contact {
    padding: 18px;
  }

  .document-footer {
    width: 100%;
    margin: 0;
    padding: 20px 14px;
  }
}

/* ================= VERY SMALL PHONES ================= */

@media (max-width: 360px) {
  .document-header h2 {
    font-size: 29px;
  }

  .brand-details h1 {
    font-size: 30px;
  }

  .guide-document {
    padding-right: 15px;
    padding-left: 15px;
  }

  .arabic-quote {
    font-size: 22px;
  }

  .arabic-text {
    font-size: 24px;
  }
}

/* ================= PRINT / SAVE AS PDF ================= */

@page {
  size: A4;
  margin: 17mm 16mm;
}

@media print {
  :root {
    --ink: #202938;
  }

  html,
  body {
    background: #fff !important;
    color: #202938 !important;
    font-size: 10.5pt;
    line-height: 1.65;
  }

  .cover-page {
    min-height: 260mm;
    height: 260mm;
    padding: 0;
    background: var(--navy) !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
    break-after: page;
  }

  .cover-image {
    width: 100%;
    height: 255mm;
    max-height: 255mm;
    object-fit: contain;
  }

  .document-header {
    width: 100%;
    margin: 0;
    padding: 25mm 15mm;
    border-radius: 0;
    box-shadow: none;
    background: var(--navy) !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
    break-after: page;
  }

  .guide-document {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .document-footer {
    width: 100%;
    margin: 0;
    background: var(--navy) !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .no-print,
  .print-button {
    display: none !important;
  }

  .guide-section,
  .guide-chapter {
    break-inside: auto;
  }

  h2,
  h3,
  h4 {
    break-after: avoid;
  }

  .arabic-quote,
  .arabic-text,
  .reference-box,
  .editorial-note,
  .instruction-card,
  .prayer-information,
  .information-card,
  .school-card,
  .resource-card,
  .quran-reference,
  .closing-quote {
    break-inside: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .guide-table {
    font-size: 9pt;
  }

  .guide-table th {
    color: #fff !important;
    background: var(--navy) !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}

/* =====================================================
   MOBILE WIDTH FIX — PREVENT SIDEWAYS PAGE MOVEMENT
   ===================================================== */

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
}

body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  overflow-x: hidden !important;
}

*, 
*::before,
*::after {
  box-sizing: border-box;
  min-width: 0;
}

img,
video,
iframe,
table {
  max-width: 100%;
}

@media screen and (max-width: 600px) {

  body {
    width: 100% !important;
  }

  .guide-document,
  .document-header,
  .document-footer {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .guide-document {
    overflow-wrap: break-word;
  }

  .grid-two {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .contents-list {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .guide-table {
    max-width: 100%;
  }
}

/* =====================================================
   FULL-SCREEN SWALAH GUIDE COVER
   ===================================================== */

.cover-page {
  width: 100vw !important;
  height: 100vh !important;
  height: 100svh !important;
  min-height: 100vh !important;
  min-height: 100svh !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  overflow: hidden !important;
  border: none !important;
  border-radius: 0 !important;
}

.cover-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
  border: none !important;
  border-radius: 0 !important;
}
