/* MOAZN user guide, styled to match the main site.
   Same tokens as the main site: near-black ink, graphite cards, one orange. Dark throughout. */

:root,
body,
body[data-md-color-scheme],
body[data-md-color-primary],
body[data-md-color-accent] {
  --adhan-ink: #0b0c0e;
  --adhan-graphite: #15181b;
  --adhan-fog: #15181b;          /* cards, table headers, tips */
  --adhan-orange: #cc792b;
  --adhan-orange-hi: #db8a3c;
  --adhan-orange-deep: #955012;
  --adhan-text-on-ink: #f4f5f6;
  --adhan-dim-on-ink: #a6acb2;
  --adhan-line-on-ink: rgba(244, 245, 246, 0.16);
  --adhan-link: #db8a3c;

  --md-text-font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;

  --md-primary-fg-color: #0b0c0e;
  --md-primary-fg-color--light: #15181b;
  --md-primary-fg-color--dark: #0b0c0e;
  --md-primary-bg-color: #f4f5f6;
  --md-primary-bg-color--light: #a6acb2;
  --md-accent-fg-color: #db8a3c;
  --md-accent-fg-color--transparent: rgba(219, 138, 60, 0.12);

  --md-default-fg-color: #f4f5f6;
  --md-default-fg-color--light: #a6acb2;
  --md-default-fg-color--lighter: rgba(244, 245, 246, 0.3);
  --md-default-fg-color--lightest: rgba(244, 245, 246, 0.12);
  --md-default-bg-color: #0b0c0e;
  --md-default-bg-color--light: rgba(11, 12, 14, 0.7);
  --md-default-bg-color--lighter: rgba(11, 12, 14, 0.3);
  --md-default-bg-color--lightest: rgba(11, 12, 14, 0.12);
  --md-typeset-color: #f4f5f6;
  --md-typeset-a-color: #db8a3c;
  --md-code-bg-color: #15181b;
  --md-code-fg-color: #f4f5f6;
  --md-typeset-table-color: rgba(244, 245, 246, 0.12);
  --md-shadow-z1: none;
  --md-shadow-z2: 0 10px 30px rgba(0, 0, 0, 0.5);
  --md-shadow-z3: 0 14px 48px rgba(0, 0, 0, 0.6);

  --md-footer-bg-color: #0b0c0e;
  --md-footer-bg-color--dark: #0b0c0e;
  --md-footer-fg-color: #f4f5f6;
  --md-footer-fg-color--light: #a6acb2;
  --md-footer-fg-color--lighter: #a6acb2;
}

html {
  scroll-padding-top: 4.5rem;
  background: #0b0c0e;
  color-scheme: dark;
}

body {
  background: #0b0c0e;
}

:focus-visible {
  outline: 2px solid var(--adhan-orange);
  outline-offset: 3px;
}

/* Header ------------------------------------------------------------ */

.md-header,
.md-header--shadow {
  background: var(--adhan-ink);
  color: var(--adhan-text-on-ink);
  box-shadow: none;
  border-bottom: 1px solid var(--adhan-line-on-ink);
}

.md-header :focus-visible {
  outline-color: var(--adhan-orange);
}

.md-header__inner {
  align-items: center;
  gap: 0.25rem;
}

.adhan-wordmark {
  margin-inline: 0.5rem auto;
  padding-left: 0.16em;
  color: var(--adhan-text-on-ink);
  font-size: 1.25rem;
  font-weight: 200;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.adhan-links {
  display: none;
  margin-inline: auto 1rem;
  gap: 2rem;
}

.adhan-links a {
  padding-block: 0.5rem;
  color: var(--adhan-dim-on-ink);
  font-size: 0.8rem;
  font-weight: 300;
  text-decoration: none;
  transition: color 0.2s ease;
}

.adhan-links a:hover,
.adhan-links a[aria-current] {
  color: var(--adhan-text-on-ink);
}

.adhan-notify {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-inline: 0.25rem 0.5rem;
  padding: 0.4rem 1.1rem;
  border-radius: 980px;
  background: var(--adhan-orange);
  color: var(--adhan-ink);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.adhan-notify:hover {
  background: var(--adhan-orange-hi);
  color: var(--adhan-ink);
}

@media (min-width: 60em) {
  .adhan-links {
    display: flex;
  }

  .adhan-wordmark {
    margin-inline: 0.5rem 0;
  }

  .adhan-notify {
    min-height: 2.25rem;
  }
}

.md-search__form {
  background: rgba(244, 245, 246, 0.08);
  border-radius: 980px;
}

.md-search__form:hover {
  background: rgba(244, 245, 246, 0.14);
}

.md-search__input::placeholder {
  color: var(--adhan-dim-on-ink);
}

[data-md-toggle="search"]:checked ~ .md-header .md-search__form {
  background: var(--adhan-graphite);
}

.md-search__overlay,
.md-search__output {
  background-color: #0b0c0e;
}

.md-search-result__meta {
  background: var(--adhan-graphite);
}

/* Page type --------------------------------------------------------- */

.md-typeset {
  font-weight: 300;
}

.md-typeset strong,
.md-typeset b {
  font-weight: 500;
}

.md-typeset h1 {
  margin: 0 0 1em;
  color: var(--md-default-fg-color);
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.75rem);
  font-weight: 200;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.md-typeset h2 {
  margin: 2em 0 0.7em;
  font-size: 1.5em;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.md-typeset h3 {
  color: var(--md-default-fg-color--light);
  font-size: 0.95rem;
  font-weight: 500;
}

.md-typeset a:not(.md-button) {
  color: var(--adhan-link);
  text-decoration: underline;
  text-decoration-color: rgba(219, 138, 60, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

.md-typeset a:not(.md-button):hover {
  color: var(--adhan-orange-hi);
  filter: brightness(1.12);
  text-decoration-color: currentColor;
}

.md-typeset .headerlink {
  display: none;
}

/* Sidebar ----------------------------------------------------------- */

.md-nav__link {
  font-weight: 300;
}

.md-nav__link--active,
.md-nav__item .md-nav__link--active {
  color: var(--md-default-fg-color);
  font-weight: 500;
}

.md-nav__link:is(:hover, :focus) {
  color: var(--adhan-orange-hi);
}

.md-nav--primary .md-nav__title {
  background: transparent;
  color: var(--md-default-fg-color--light);
  font-weight: 500;
  box-shadow: none;
}

@media (max-width: 76.1875em) {
  .md-nav--primary .md-nav__title {
    background: var(--adhan-ink);
    color: var(--adhan-text-on-ink);
  }
}

/* Images ------------------------------------------------------------ */

.md-typeset img.screen {
  display: block;
  width: 100%;
  max-width: 330px;
  height: auto;
  margin: 1.2em auto;
}

.md-typeset img.screen-wide {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  margin: 1.2em auto;
}

.md-typeset img.phone {
  display: block;
  width: 100%;
  max-width: 215px;
  height: auto;
  margin: 1.2em auto;
}

/* Front page -------------------------------------------------------- */

.hero {
  margin: 0 -0.8rem 1.6rem;
  padding: 2rem 1rem 0;
  overflow: hidden;
  border: 1px solid var(--adhan-line-on-ink);
  border-radius: 12px;
  background: var(--adhan-ink);
  color: var(--adhan-text-on-ink);
  text-align: center;
}

.hero .mark {
  margin: 0;
  padding-left: 0.14em;
  font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem);
  font-weight: 200;
  line-height: 1;
  letter-spacing: 0.14em;
}

.hero .title {
  margin: 0.75rem 0 0;
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.2;
}

.hero .sub {
  margin: 0.25rem 0 0.75rem;
  color: var(--adhan-dim-on-ink);
  font-size: 0.9rem;
}

.hero img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%);
}

/* Buttons ----------------------------------------------------------- */

.md-typeset .md-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.4rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 980px;
  background: transparent;
  color: var(--md-default-fg-color);
  font-weight: 500;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.md-typeset .md-button:hover {
  border-color: var(--md-default-fg-color);
  background: transparent;
  color: var(--md-default-fg-color);
}

.md-typeset .md-button--primary {
  border-color: var(--adhan-orange);
  background: var(--adhan-orange);
  color: var(--adhan-ink);
}

.md-typeset .md-button--primary:hover {
  border-color: var(--adhan-orange-hi);
  background: var(--adhan-orange-hi);
  color: var(--adhan-ink);
}

/* Chips for on-screen messages and upcoming features ---------------- */

.md-typeset .scr {
  padding: 0.2em 0.6em;
  border: 1px solid var(--adhan-line-on-ink);
  border-radius: 6px;
  background: var(--adhan-graphite);
  color: var(--adhan-text-on-ink);
  font-family: ui-monospace, "SF Mono", Menlo, "DejaVu Sans Mono", Consolas, monospace;
  font-size: 0.8em;
  font-weight: 400;
  white-space: nowrap;
}

.md-typeset .soon {
  display: inline-block;
  margin-right: 0.5em;
  padding: 0 0.7em;
  border: 1px solid var(--adhan-orange);
  border-radius: 980px;
  color: var(--adhan-orange-hi);
  font-size: 0.75em;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: 1px;
}

/* Tips and warnings ------------------------------------------------- */

.md-typeset .admonition,
.md-typeset details {
  border: 1px solid var(--adhan-line-on-ink);
  border-radius: 12px;
  background: var(--adhan-fog);
  box-shadow: none;
  color: var(--md-default-fg-color);
  font-size: 0.8rem;
}

.md-typeset .admonition > .admonition-title,
.md-typeset summary {
  background: transparent;
  font-weight: 500;
}

.md-typeset .admonition > .admonition-title::before,
.md-typeset summary::before {
  background-color: var(--md-default-fg-color);
}

/* Tables ------------------------------------------------------------ */

.md-typeset table:not([class]) {
  border: 0;
  border-top: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.8rem;
}

.md-typeset table:not([class]) th {
  background: var(--adhan-fog);
  color: var(--md-default-fg-color);
  font-weight: 500;
}

.md-typeset table:not([class]) td,
.md-typeset table:not([class]) th {
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

/* Footer ------------------------------------------------------------ */

.md-footer {
  background: var(--adhan-ink);
}

.md-footer__link:is(:hover, :focus) {
  opacity: 1;
  color: var(--adhan-orange-hi);
}

.md-footer-meta {
  border-top: 1px solid var(--adhan-line-on-ink);
  background: var(--adhan-ink);
}

.md-footer-meta .md-typeset {
  color: var(--adhan-dim-on-ink);
}

.adhan-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

.adhan-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

.md-typeset .adhan-footer__links a,
.adhan-footer__links a {
  display: inline-block;
  padding-block: 0.6rem;
  color: var(--adhan-dim-on-ink);
  font-size: 0.7rem;
  text-decoration: none;
}

.adhan-footer__links a:hover {
  color: var(--adhan-text-on-ink);
}

@media print {
  .md-header,
  .md-footer {
    display: none;
  }
}

/* Button rows: keep buttons apart and let them wrap on narrow screens -- */

.md-typeset .btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 1.5rem 0;
}

.md-typeset .btn-row p {
  display: contents;
}

.md-typeset .btn-row .md-button {
  margin: 0;
}

/* Prayer calculation helper ------------------------------------------ */

.md-typeset .helper {
  margin: 1.8rem 0;
}

.md-typeset .helper fieldset {
  min-width: 0;
  box-sizing: border-box;
  margin: 0 0 1.2rem;
  padding: 1.1rem 1.2rem 1.3rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 18px;
  background: var(--adhan-fog);
}

.md-typeset .helper legend {
  padding: 0 0.5rem;
  font-weight: 500;
}

.md-typeset .helper legend span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--adhan-orange);
  color: var(--adhan-ink);
  font-size: 0.75rem;
  font-weight: 500;
}

.md-typeset .helper label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.md-typeset .helper input[type="search"],
.md-typeset .helper input[type="time"] {
  box-sizing: border-box;
  width: 100%;
  min-height: 3rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 12px;
  background: rgba(244, 245, 246, 0.06);
  color: var(--md-default-fg-color);
  color-scheme: dark;
  font: inherit;
  font-size: 1.05rem;
  -webkit-appearance: none;
  appearance: none;
}

.md-typeset .helper input[type="time"] {
  min-width: 0;
  text-align: left;
}

.md-typeset .helper input:focus-visible,
.md-typeset .helper button:focus-visible {
  outline: 2px solid var(--adhan-orange);
  outline-offset: 2px;
}

.md-typeset .helper .h-inline {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
}

.md-typeset .helper .h-inline input {
  flex: 1 1 auto;
  min-width: 0;
}

.md-typeset .helper .h-inline .md-button,
.md-typeset .helper #h-locate {
  min-height: 3rem;
  padding-inline: 1.6rem;
  justify-content: center;
}

.md-typeset .helper .md-button {
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}

.md-typeset .helper .h-or {
  margin: 0.8rem 0;
  color: var(--md-default-fg-color--light);
  font-size: 0.8rem;
}

.md-typeset .helper .h-hint,
.md-typeset .helper .h-note {
  color: var(--md-default-fg-color--light);
  font-size: 0.85rem;
}

.md-typeset .helper .h-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 12rem));
  gap: 1rem 1.5rem;
  margin-top: 0.4rem;
}

.md-typeset .helper .h-row {
  display: block;
  min-width: 0;
}

.md-typeset .helper .h-results {
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.md-typeset .helper .h-results li {
  margin: 0.35rem 0;
}

.md-typeset .helper .h-results button {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 12px;
  background: rgba(244, 245, 246, 0.06);
  color: var(--md-default-fg-color);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.md-typeset .helper .h-results button:hover {
  border-color: var(--md-default-fg-color);
}

.md-typeset .helper .h-chosen {
  margin: 0.9rem 0 0;
}

.md-typeset .helper .h-link {
  margin-left: 0.4rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--adhan-orange-hi);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.md-typeset .helper .h-status {
  min-height: 1.4rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.85rem;
}

.md-typeset .helper .h-out {
  margin-top: 0.8rem;
  padding: 0.4rem 1.4rem 1.2rem;
  border: 1px solid var(--adhan-orange);
  border-radius: 18px;
}

.md-typeset .helper .h-out h2 {
  margin-top: 1rem;
}

.md-typeset .helper .h-out table {
  display: table;
  width: 100%;
}

.md-typeset .helper .h-out th {
  width: 40%;
  font-weight: 500;
}

.md-typeset .helper .h-scroll {
  overflow-x: auto;
}

.md-typeset .helper .h-alts {
  display: table;
  width: 100%;
  font-size: 0.85rem;
}

.md-typeset .helper .h-alts th,
.md-typeset .helper .h-alts td {
  width: auto;
  text-align: left;
  vertical-align: top;
}

.md-typeset .helper .h-alts th[scope="row"] {
  min-width: 11rem;
}

.md-typeset .helper .h-alts td {
  white-space: nowrap;
}

@media (max-width: 30em) {
  .md-typeset .helper .h-inline {
    flex-direction: column;
  }
  .md-typeset .helper .h-times {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
  }
}

/* Floating prayer calculation button and panel ----------------------- */

.pcw-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
}

.pcw-open {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.5rem 1.2rem 0.5rem 1rem;
  border: 0;
  border-radius: 980px;
  background: var(--adhan-orange);
  color: var(--adhan-ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 6px 22px rgba(11, 12, 14, 0.28);
  cursor: pointer;
  touch-action: none;
}

.pcw-open:hover {
  background: var(--adhan-orange-hi);
}

.pcw-hide {
  position: absolute;
  top: -10px;
  right: -6px;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border: 1px solid var(--adhan-line-on-ink);
  border-radius: 50%;
  background: var(--adhan-graphite);
  color: var(--adhan-text-on-ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.pcw-hide::after {
  content: "";
  position: absolute;
  inset: -0.5rem;
}

.pcw-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(28rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 20px;
  background: var(--adhan-ink);
  box-shadow: 0 14px 48px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.pcw-panel[hidden],
.pcw-fab[hidden] {
  display: none;
}

.pcw-panel:focus {
  outline: none;
}

.pcw-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem 0.7rem 1.1rem;
  border-bottom: 1px solid var(--adhan-line-on-ink);
  background: var(--adhan-graphite);
  color: var(--adhan-text-on-ink);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.pcw-title {
  flex: 1 1 auto;
  font-size: 0.85rem;
  font-weight: 500;
}

.md-typeset .pcw-bar a.pcw-full {
  color: var(--adhan-dim-on-ink);
  font-size: 0.75rem;
  text-decoration: underline;
  text-decoration-color: rgba(166, 172, 178, 0.5);
}

.md-typeset .pcw-bar a.pcw-full:hover {
  color: var(--adhan-text-on-ink);
}

.pcw-close {
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--adhan-text-on-ink);
  font: inherit;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.pcw-close:hover {
  background: rgba(244, 245, 246, 0.16);
}

.pcw-body {
  overflow-y: auto;
  padding: 0.2rem 1rem 1rem;
}

.pcw-intro {
  margin: 0.8rem 0 0.6rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.8rem;
}

.pcw-panel .helper {
  margin: 0;
}

.pcw-panel .helper fieldset {
  padding: 0.8rem 0.9rem 1rem;
}

.pcw-panel .helper .h-times {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.pcw-open:focus-visible,
.pcw-hide:focus-visible,
.pcw-close:focus-visible,
.pcw-panel a:focus-visible {
  outline: 2px solid var(--adhan-orange);
  outline-offset: 2px;
}

@media (max-width: 40em) {
  .pcw-fab {
    right: 16px !important;
    bottom: 16px !important;
  }

  .pcw-panel {
    right: 0 !important;
    bottom: 0 !important;
    left: 0;
    width: auto;
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
  }

  .pcw-bar {
    cursor: default;
  }
}

@media print {
  .pcw-fab,
  .pcw-panel {
    display: none !important;
  }
}

/* Printing: light page, to save ink */
@media print {
  html,
  body,
  body[data-md-color-scheme] {
    background: #fff;
    color: #14161a;
    --md-default-fg-color: #14161a;
    --md-default-fg-color--light: #575d63;
    --md-default-fg-color--lighter: rgba(20, 22, 26, 0.32);
    --md-default-fg-color--lightest: rgba(20, 22, 26, 0.08);
    --md-default-bg-color: #fff;
    --md-typeset-color: #14161a;
    --md-typeset-a-color: #14161a;
    --adhan-fog: #f3f4f5;
  }
}

/* Tips and notes: one neutral dark card, whatever the type */
.md-typeset .admonition:is(.tip, .note, .warning, .danger, .info, .example, .question, .success, .failure, .bug, .abstract, .quote) {
  border-color: var(--adhan-line-on-ink);
}

.md-typeset :is(.tip, .note, .warning, .danger, .info, .example, .question, .success, .failure, .bug, .abstract, .quote) > .admonition-title {
  background: transparent;
}

.md-typeset :is(.tip, .note, .warning, .danger, .info, .example, .question, .success, .failure, .bug, .abstract, .quote) > .admonition-title::before {
  background-color: var(--adhan-orange-hi);
}
