/* ============================================================
   Hope Springs — shared lesson stylesheet
   Link this from every lesson:  <link rel="stylesheet" href="hopesprings.css">
   Edit THIS file to change the look of EVERY lesson at once.
   ============================================================ */

/* Chalk font for chalkboard word-banks — embedded so it renders on any
   machine (and when printing) without needing to be installed. */
@font-face {
  font-family: "DustyErasers";
  src: url("fonts/DustyErasers.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "DustyErasersLight";
  src: url("fonts/DustyErasersLight.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* ---- 1. The two knobs you'll most likely change ---- */
:root {
  /* Fonts — set these to your real fonts. First name that exists wins. */
  --font-en: "Times New Roman", Georgia, "Liberation Serif", "DejaVu Serif", serif;
  --font-jp:
    "HGMaruGothicMPRO", "Hiragino Kaku Gothic ProN", "Yu Gothic", "MotoyaLMaru", sans-serif;
  /* chalk / handwriting font for chalkboard word-banks. DustyErasers is
     download-only (install to print with it); Chalkduster ships on every Mac. */
  --font-chalk: "DustyErasers", "Chalkduster", cursive;

  /* Brand colours (sampled from your Publisher lessons) */
  --blue: #6498fe; /* title banner            */
  --green: #8bff8b; /* section banner          */
  --green2: #c9f7c9; /* lighter banner (Practice)*/
  --rule: #2b5fd0; /* footer rule / underline  */
  --ink: #1a1a1a; /* body text               */
  --gloss: #333333; /* Japanese gloss          */

  /* Default type sizes — override per page if a lesson needs bigger/smaller
     (e.g. <div class="page" style="--t-body:15pt">) */
  --t-title: 30pt;
  --t-section: 17pt;
  --t-head: 14pt; /* grammar pattern headings */
  --t-body: 14pt; /* example sentences (Steve's standard) */
  --t-vocab: 10.5pt;
}

/* ---- 2. Page setup (A4 portrait by default) ---- */
@page {
  size: A4 portrait;
  margin: 0;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font-en);
  color: var(--ink);
  background: #fff;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.page {
  width: 210mm;
  /* 292mm, not a full 297mm: a page block sized to exactly one sheet rounds a
     hair over and spills a near-empty extra page when printing. */
  min-height: 292mm;
  padding: 13mm 15mm 10mm;
  display: flex;
  flex-direction: column;
}
.page + .page {
  page-break-before: always;
} /* extra pages in the same file */

/* Landscape lesson: add class "land" to .page, and add a one-line rule to the
   page's own style block:   @page{ size: A4 landscape }                     */
.page.land {
  width: 297mm;
  min-height: 210mm;
}

/* Japanese text helper */
.jp {
  font-family: var(--font-jp);
}

/* ---- 3. Title banner ---- */
.title-banner {
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  text-align: center;
  font-size: var(--t-title);
  line-height: 1.1;
  padding: 9px 18px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

/* ---- 4. Section banner (green bar; the number/letter hangs out in the margin) ----
   .section-banner is the banner row; .section-banner-inner is the green bar itself.
   The bar runs full width; the mark sits in the left margin, e.g.
   <div class="section-banner"><div class="mark">1.</div>
     <div class="section-banner-inner light"><span>Practice</span></div></div>       */
.section-banner {
  position: relative;
  margin-top: 10px;
}
.section-banner .mark {
  position: absolute;
  left: -30px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  font-size: var(--t-section);
}
.section-banner-inner {
  background: var(--green);
  font-weight: 700;
  font-size: var(--t-section);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-banner-inner.light {
  background: var(--green2);
}
.section-banner-inner .note {
  font-size: var(--t-vocab);
  font-weight: 400;
} /* JP note on right */

/* Sub-exercise heading (a. / b.) — the letter hangs in the margin, text full width.
   Wrap the letter:  <div class="subex"><span class="ltr">a.</span> Fill the blanks.</div> */
.subex {
  position: relative;
  font-weight: 700;
  font-size: var(--t-body);
  margin: 12px 0 2px 2px;
}
.subex .ltr {
  position: absolute;
  left: -30px;
  font-weight: 700;
}

/* ---- 5. Grammar pattern block ---- */
.pattern {
  margin: 10px 0 0 2px;
}
.pattern .head {
  font-weight: 700;
  font-size: var(--t-head);
}
.pattern .ex,
.pattern .tr {
  font-size: var(--t-body);
  line-height: 1.35;
}
.pattern .tr {
  margin-left: 2px;
}
.pattern .tr .arw {
  color: #555;
}

/* two-column pattern (label | sentence), e.g. present: / past: */
.rows {
  margin-top: 6px;
}
.rows .row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 4px 10px;
  font-size: var(--t-body);
  line-height: 1.35;
  margin-bottom: 9px;
}
.rows .row .lbl {
  font-weight: 700;
}
.rows .row .tr {
  grid-column: 2;
}

/* ---- 6. Practice ---- */
/* (sub-exercise headings use .subex + .ltr — see §4) */
.q {
  font-size: var(--t-body);
  line-height: 1.3;
  margin: 6px 0 0 2px;
}
.choices {
  margin: 2px 0 0 22px;
  /* fixed-width columns so the a. / b. / c. options line up at tab stops
     across every row, whatever the option lengths (or how many there are) */
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 4.5em;
  justify-content: start;
  font-size: var(--t-body);
}

/* ---- 7. Fill-in blank: a line to write on ---- */
.blank {
  display: inline-block;
  min-width: 80px;
  height: 1.15em;
  vertical-align: -0.28em;
  border-bottom: 1.6px solid #333;
  margin: 0;
}

/* ---- 8. Vocab / word-bank footer (OPTIONAL — delete the block to omit) ---- */
.vocab {
  position: relative; /* anchor for the page number */
  margin-top: auto;
  border-top: 2px solid var(--rule);
  padding-top: 6px;
  padding-right: 24px; /* keep the last line clear of the page number */
  font-size: var(--t-vocab);
  line-height: 1.5;
}
.vocab .term {
  font-weight: 700;
}
.vocab .g {
  color: var(--gloss);
  font-size: smaller;
}
/* keep each English+Japanese pair together — wrap the pair in <span class="vp"> */
.vocab .vp {
  display: inline-block;
  white-space: nowrap;
  margin-right: 16px;
}

/* page number, bottom-right corner of the footer */
.pageno {
  position: absolute;
  right: 0;
  bottom: 0;
  font-weight: 700;
}

/* ---- 8b. Photo frame / placeholder ----
   Shows a labelled grey box now. To use a real picture, swap the whole
   <div class="ph">…</div> for:  <img class="ph" src="images/<lesson>/name.png" alt="">
   (put each lesson's images in images/<lesson-name>/ next to the lesson).      */
.ph {
  border: 1px solid #b7bfc7;
  background: #eef1f4;
  color: #8a97a3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 9pt;
  line-height: 1.2;
  padding: 4px;
  object-fit: cover;
  overflow: hidden;
}

/* ---- 9. Emphasis helpers (your causative conventions) ---- */
.b {
  font-weight: 700;
}
.u {
  text-decoration: underline;
}
.i {
  font-style: italic;
}

/* ---- 10. Part-of-speech colours (from the was/were sheet; use if wanted) ---- */
.subj {
  color: #1558b7;
} /* subject / pronoun        */
.be {
  color: #c8553c;
} /* be-verb / target verb    */
.comp {
  color: #fdcc65;
} /* complement (adj / noun)  */

/* Miscellaneous styles for the lessons */
.note.jp {
  font-size: smaller;
}

/* ---- 11. Screen-specific styles ---- */

@media screen {
  /* On screen, show each .page as a separate centered sheet on a soft grey
     ground with a drop shadow — matching the reader series. Print is untouched. */
  body {
    background: #eef1f4;
    padding: 16px;
  }
  .page {
    margin: 0 auto 16px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  }
}
