/* ==========================================================================
   Hebrew to Suno - stylesheet

   EVERY COLOUR IN THIS FILE IS DEFINED IN THE :root BLOCK BELOW.
   Nothing further down hard-codes a colour. To restyle the site, edit only
   that block. The palette is sampled from yadayah.com so the two sites read
   as related: deep navy header, indigo band, gold accents, light neutral page.

   No external fonts, no CDNs, no build step. System fonts only.
   ========================================================================== */

:root {
  /* Brand - sampled from yadayah.com */
  --ink-deep:     #1a1a2e;   /* header band */
  --indigo:       #31345a;   /* secondary band, headings */
  --gold:         #e5c86c;   /* primary accent, wordmark */
  --gold-muted:   #b6a563;   /* accent on light backgrounds */

  /* Surfaces */
  --page:         #f8f9fa;   /* page background */
  --surface:      #ffffff;   /* panels */
  --tint:         #eef2ff;   /* output panel, subtle fills */

  /* Text */
  --text:         #2c3e50;   /* body */
  --text-soft:    #666666;   /* secondary */
  --text-on-dark: #ffffff;

  /* Lines and states */
  --line:         #d9dde5;
  --line-strong:  #b9c0cc;
  --link:         #295daf;
  --focus:        #295daf;
  --error-bg:     #fdf3f3;
  --error-line:   #c0392b;
  --error-text:   #922b21;
  --ok:           #2e7d5b;
  --disabled:     #9aa2ae;

  /* Type - system stack only */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;
  --font-hebrew: "Times New Roman", "Frank Ruehl CLM", "Noto Sans Hebrew",
                 David, serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

.site-header {
  background: var(--ink-deep);
  border-bottom: 3px solid var(--gold);
  padding: 26px 0 22px;
  text-align: center;
}

.wordmark {
  display: inline-block;
  color: var(--gold);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Sizing is ready for the client's header image - see TODO_HEADER_GRAPHIC. */
.header-graphic {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 90px;
  margin: 0 auto;
}

.tagline {
  margin: 8px 0 0;
  color: var(--text-on-dark);
  opacity: 0.75;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Layout ---------- */

main { padding: 28px 20px 40px; }

.tool {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 860px) {
  .tool { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  min-height: 34px;
}

.panel-head h2 {
  margin: 0;
  color: var(--indigo);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Input ---------- */

textarea {
  width: 100%;
  min-height: 320px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-hebrew);
  font-size: 21px;
  line-height: 1.9;
  resize: vertical;
}

textarea::placeholder { color: var(--disabled); }

textarea:focus-visible,
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Options ---------- */

.options {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 15px;
}

.check input { width: 17px; height: 17px; margin: 0; cursor: pointer; accent-color: var(--indigo); }

/* Greyed out until verse structure is switched on. */
.check input:disabled { cursor: not-allowed; }
.check input:disabled + span { color: var(--disabled); cursor: not-allowed; }

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  padding: 10px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.btn:hover { border-color: var(--indigo); color: var(--indigo); }

.btn-primary {
  background: var(--indigo);
  border-color: var(--indigo);
  color: var(--text-on-dark);
}

.btn-primary:hover {
  background: var(--ink-deep);
  border-color: var(--ink-deep);
  color: var(--gold);
}

.btn-small { padding: 5px 13px; font-size: 13px; }
.btn-small.copied { border-color: var(--ok); color: var(--ok); }

.file-pick { position: relative; overflow: hidden; }
.file-pick input { position: absolute; left: -9999px; }

.file-pick span {
  display: inline-block;
  padding: 5px 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
}

.file-pick span:hover { border-color: var(--indigo); color: var(--indigo); }
.file-pick input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.file-pick.has-file span { border-style: solid; border-color: var(--gold-muted); color: var(--text); }

/* ---------- Output ---------- */

.output {
  margin: 0;
  min-height: 320px;
  max-height: 620px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--tint);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.empty {
  margin: 0;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  color: var(--text-soft);
  font-size: 15px;
  text-align: center;
}

/* ---------- Alerts ---------- */

.alert {
  margin: 0 0 20px;
  padding: 12px 16px;
  border: 1px solid var(--error-line);
  border-left-width: 4px;
  border-radius: 4px;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 15px;
}

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

.site-footer {
  margin-top: 10px;
  padding: 22px 0 30px;
  border-top: 3px solid var(--gold);
  background: var(--ink-deep);
  text-align: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 26px;
}

.site-footer a {
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.site-footer a:hover { text-decoration: underline; }

.site-footer .note {
  margin: 14px 0 0;
  color: var(--text-on-dark);
  opacity: 0.6;
  font-size: 12.5px;
}
