/* Shared styles for clearquran.com/about, /contact, /download
   Desktop matches clearquran.com; phones match m.clearquran.com.
   After editing this file, purge the Cloudflare cache
   so visitors get the new version. */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: #222;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

a { color: #0077aa; }
a:hover { color: #005a82; }

/* ---------- Top: link back to the Quran ----------
   Computer: thin light-blue line and a gray link, like clearquran.com.
   Phone: blue bar like m.clearquran.com. */

.site-header { border-top: 4px solid #00aeef; }

.back {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.back svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.back-desk {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 24px 0;
  color: #0077aa;
  font-size: 17px;
  font-weight: 600;
}
.back-desk:hover { color: #005a82; }

.back-mob { display: none; }

/* ---------- Page body ---------- */

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 24px 48px;
}


h1 {
  margin: 44px 0 20px;
  font-size: 26px;
  font-weight: 600;
  color: #444;
  line-height: 1.25;
}

h2 {
  margin: 36px 0 8px;
  font-size: 21px;
  font-weight: 600;
  color: #333;
}

h2 + .subtitle { margin-top: -6px; color: #666; }

p { margin: 0 0 16px; }

.note {
  margin: 24px 0 24px;
  padding: 14px 18px;
  background: #f1f8fc;
  border-left: 4px solid #00aeef;
  border-radius: 4px;
}
.note p:last-child { margin-bottom: 0; }

/* Download page: the paragraph about the two editions, with the same space above and below */
.editions { margin-bottom: 24px; }

blockquote {
  margin: 20px 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid #00aeef;
  color: #333;
}

.verses { list-style: none; padding: 0; margin: 0 0 16px; }
.verses li { margin-bottom: 4px; }
.verses .n {
  display: inline-block;
  min-width: 22px;
  margin-right: 10px;
  text-align: right;
  color: #767676;           /* the lightest gray that is still easy to read on white (4.5:1) */
  font-size: 14px;
}

/* Video that scales with the page */
.video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 12px 0 40px;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video + p + h2 { margin-top: 24px; }	/* About: the line under the video sits closer to the surah below it */

.link-list { list-style: none; padding: 0; margin: 24px 0 0; }
.link-list li { margin-bottom: 8px; }

/* ---------- Download sections (open/close) ---------- */

.section {
  margin: 0;
  border-top: 1px solid #ddd;
}
.section:last-of-type { border-bottom: 1px solid #ddd; }
/* Space after the last section, so it looks the same as the space above the first */
.section + h2 { margin-top: 24px; }

.section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px -12px;
  padding: 11px 12px;
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
  font-size: 18px;
  font-weight: 500;
  color: #333;
  transition: background-color 0.15s, color 0.15s;
}
.section summary::-webkit-details-marker { display: none; }
.section summary:hover { background: #f7f9fc; }
.section summary:focus-visible { outline: 2px solid #0077aa; outline-offset: 2px; }


/* Chevron on the right: points down when closed, up when open */
.section summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin: -5px 4px 0 16px;
  border-right: 2px solid #4b9cc0;
  border-bottom: 2px solid #4b9cc0;
  transform: rotate(45deg);
  transition: transform 0.2s, margin 0.2s;
}
.section[open] summary::after { transform: rotate(-135deg); margin-top: 5px; }

.files { list-style: none; padding: 0 0 14px 28px; margin: 0; }
.files li { margin: 0; }
.files a {
  display: block;
  padding: 5px 0;
  text-decoration: none;
}
.files a:hover { text-decoration: underline; }
.files .gap { height: 18px; }

/* ---------- Contact form ---------- */

.form { margin-top: 20px; }
.form label { display: block; margin: 0 0 4px; font-size: 15px; color: #444; }
.form label .opt { color: #767676; font-size: 13px; }   /* was #999: too faint to read easily */
.form input,
.form textarea {
  width: 100%;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  font: inherit;
  font-size: 16px; /* 16px stops iPhones zooming in on tap */
  color: #222;
  background: #fff;
}
.form input:focus,
.form textarea:focus { outline: none; border-color: #0077aa; box-shadow: 0 0 0 3px rgba(0, 119, 170, 0.15); }
.form textarea { min-height: 170px; resize: vertical; }
.form .hp { position: absolute; left: -9999px; }

.button {
  display: inline-block;
  padding: 11px 28px;
  border: 0;
  border-radius: 4px;
  background: #0077aa;
  color: #fff;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
}
.button:hover { background: #005a82; color: #fff; }

/* ---------- Thank-you page ---------- */

.thanks { margin-top: 72px; text-align: center; }
.thanks h1,
.thanks h2 { margin: 20px 0 8px; font-size: 26px; color: #444; }
.thanks-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  background: #e7f6ec;
}
.thanks-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: #1e8e4a;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.thanks-text { color: #555; font-size: 18px; }
.thanks-links { margin-top: 24px; }
.thanks-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: none;
}
.thanks-links svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.thanks-links a:hover { text-decoration: underline; }

/* Contact page: the thank-you shown in place of the form, and the message if sending fails */
.sent[hidden], .form-error[hidden] { display: none; }
.sent { margin-top: 56px; }
.sent:focus { outline: none; }
.form-error {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 4px;
  background: #fdecea;
  color: #a12a1f;
}
.button:disabled { opacity: 0.6; cursor: default; }

/* ---------- Phones and small tablets ---------- */

@media (max-width: 768px) {
  body { font-size: 17px; }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-top: 0;
    background: #3a569e;
    /* same shadow as the bar on m.clearquran.com */
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
  }
  .back-desk { display: none; }
  .back-mob {
    display: flex;
    gap: 10px;
    height: 56px;
    padding: 0 16px;
    color: #fff;
    font-size: 17px;
  }
  .back-mob:hover { color: #fff; }
  .back-mob svg { width: 22px; height: 22px; }

  .page { padding: 6px 16px 40px; }
  .files { padding-left: 20px; }
  .files a { padding: 6px 0; }
  h1 { font-size: 23px; margin-top: 28px; }
  h2 { font-size: 19px; }

}

/* ---------- Night mode ----------
   Same setting as the Quran reader: the script at the top of each page adds class="night"
   to <html>. Colors are taken from the reader's night palette (reader.css). */

html.night { color-scheme: dark; }
html.night body { background: #15191d; color: #d6dbe0; }

html.night a { color: #5cc4ef; }
html.night a:hover { color: #8fd8f6; }

html.night .site-header { border-top-color: #0b8fc4; }
html.night .back-desk { color: #5cc4ef; }
html.night .back-desk:hover { color: #8fd8f6; }

html.night h1,
html.night .thanks h2 { color: #c0c8cf; }
html.night h2 { color: #e6e9ec; }
html.night h2 + .subtitle { color: #8f9aa3; }

html.night .note { background: #1c2229; border-left-color: #0b8fc4; }
html.night blockquote { border-left-color: #0b8fc4; color: #c0c8cf; }
html.night .verses .n { color: #8f9aa3; }
html.night .video { background: #000; }

html.night .section { border-top-color: #343d45; }
html.night .section:last-of-type { border-bottom-color: #343d45; }
html.night .section summary { color: #e6e9ec; }
html.night .section summary:hover { background: rgba(255, 255, 255, 0.06); }
html.night .section summary::after { border-color: #7fb8d6; }

html.night .form label { color: #aab4bd; }
html.night .form label .opt { color: #7d8891; }
html.night .form input,
html.night .form textarea { background: #22282e; border-color: #3a434b; color: #e6e9ec; }
html.night .form input:focus,
html.night .form textarea:focus { border-color: #0b8fc4; box-shadow: 0 0 0 3px rgba(11, 143, 196, 0.25); }
html.night .button { background: #0b8fc4; }
html.night .button:hover { background: #0a7aa8; }

html.night .thanks-icon { background: rgba(63, 191, 95, 0.15); }
html.night .thanks-icon svg { stroke: #3fbf5f; }
html.night .thanks-text { color: #aab4bd; }
html.night .form-error { background: #3a1f1f; color: #f2b8b0; }

@media (max-width: 768px) {
  html.night .site-header { background: #262c32; }
}
