/* Shared styles for clearquran.com/about, /contact, /download
   They match the Quran reader (reader.css), on computers and on phones.
   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: the blue bar, like the reader's on phones. */

.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: 788px;           /* a 740px column, as on the Quran pages (740 + 24 + 24) */
  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: 788px;           /* a 740px column, as on the Quran pages (740 + 24 + 24) */
  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; }
/* The small copy icon right after the credit line; a check mark for a moment once copied */
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0 0 0 2px;         /* about 8px of space between the text and the icon itself */
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #767676;
  vertical-align: middle;
  cursor: pointer;
}
.copy-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.copy-button .icon-done { display: none; }
.copy-button.copied .icon-copy { display: none; }
.copy-button.copied .icon-done { display: block; }
.copy-button:hover { color: #0077aa; background: rgba(0, 119, 170, 0.08); }
.copy-button.copied { color: #1e8e4a; background: transparent; }
.copy-button:focus-visible { outline: 2px solid #0077aa; outline-offset: 1px; }

/* 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;
}
blockquote p { margin: 0 0 6px; }
blockquote cite {                /* the reference, after the verse */
  display: block;
  font-style: normal;
  font-size: 14px;
  color: #767676;
}
blockquote cite::before { content: "— "; }

/* Verses, as on the Quran pages: the numbers in their own column, every line of a verse at the same edge */
.verses { list-style: none; padding: 0; margin: 0 0 16px; }
.verses li {
  margin-bottom: 0.5em;
  line-height: 1.5;
  padding-left: 1.65em;    /* a column for two-digit numbers (Surah 81 has 29 verses): 10 to 29 start at the page edge */
  text-indent: -1.65em;
}
.verses .n {
  display: inline-block;
  box-sizing: border-box;
  width: 1.94em;            /* 1.65em of the verse's size (1.65 / 0.85) */
  padding-right: 0.75em;
  text-align: right;
  text-indent: 0;
  font-size: 0.85em;
  color: #2F5B92;           /* the verse numbers' blue on the Quran pages */
}
.bismillah { padding-left: 1.65em; }  /* lined up with the verses' text */

/* About: a little larger text for the long read (the Quran pages' verses are 18px too) */
.about { font-size: 18px; }

/* The end of the About page: the next step, like the Next link at the end of a chapter */
.next-steps { margin-top: 40px; }
.next-step { margin: 0 0 10px; }
.next-step a {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 18px;
  text-decoration: none;
}
.next-step a:hover { text-decoration: underline; }
.next-step svg {
  width: 9px;
  height: 15px;
  margin-left: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* 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: 2.5px solid #1f6f96;   /* darker and a little thicker (was 2px #4b9cc0): easy to spot at the far right */
  border-bottom: 2.5px solid #1f6f96;
  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 */
/* Each field: its label, its box, and sometimes a hint under it */
.form .field { margin: 0 0 18px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;   /* Name and Email side by side */
  column-gap: 20px;
}
.form .hint { margin: 5px 0 0; font-size: 13px; line-height: 1.4; color: #767676; }
.form input,
.form textarea {
  display: block;             /* (inline, a box leaves a little extra space under it) */
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #949494;  /* was #c8c8c8: too faint; field edges need 3:1 contrast to be easy to see */
  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; }
/* An older copy of the page still in a browser's cache (boxes not yet inside .field): keep the space under each box */
.form > input,
.form > textarea { margin-bottom: 16px; }
/* Cloudflare's check: the same space above it as between fields, a little more before Send */
.form .cf-turnstile { margin: 4px 0 20px; line-height: 0; }

.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;
    /* the same shadow as the reader's blue bar */
    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 20px;           /* the arrow 20px from the edge, lined up with the text (as in the reader) */
    color: #fff;
    font-size: 17px;
  }
  .back-mob:hover { color: #fff; }
  .back-mob svg { width: 22px; height: 22px; }

  .page { padding: 6px 20px 40px; }   /* 20px from the edges, as the reader's text on phones */
  .form-row { grid-template-columns: 1fr; }   /* Name, then Email under it */
  .files { padding-left: 20px; }
  .files a { padding: 10px 0; }   /* about 47px a row: an easy tap target (44px or more) with a finger */
  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 .copy-button { color: #8f9aa3; }
html.night .copy-button:hover { color: #5cc4ef; background: rgba(92, 196, 239, 0.12); }
html.night .copy-button.copied { color: #3fbf5f; background: transparent; }
html.night blockquote { border-left-color: #0b8fc4; color: #c0c8cf; }
html.night .verses .n { color: #8aa6c4; }
html.night blockquote cite { 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: #9fd2ec; }

html.night .form label { color: #aab4bd; }
html.night .form label .opt { color: #7d8891; }
html.night .form .hint { color: #8f9aa3; }
html.night .form input,
html.night .form textarea { background: #22282e; border-color: #5a6670; color: #e6e9ec; }   /* border was #3a434b: too faint */
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: #08769f; }
html.night .button:hover { background: #066890; }

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: #34496b; }   /* the reader's blue bar at night */
  html.night .back-mob,
  html.night .back-mob:hover { color: #fff; }       /* white on the bar, as by day (not the night link blue) */
}
