/* ---------------------------------------------------------------
   English Conversation — shared course stylesheet
   Used by every lesson and reference card in this workspace.
   Tufte-influenced: generous margins, sidenotes, restrained colour.
   No external fonts or CDNs — works offline and prints cleanly.
   --------------------------------------------------------------- */

:root {
  --ink:        #16150f;
  --ink-soft:   #55524a;
  --ink-faint:  #8a877e;
  --paper:      #fffdf8;
  --rule:       #e2ded2;
  --accent:     #7a2e1d;   /* brick — used sparingly */
  --accent-bg:  #f7efe9;
  --good:       #2f6b3f;
  --good-bg:    #eef5ef;
  --warn:       #8a6d1f;
  --warn-bg:    #faf4e4;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, "Times New Roman", serif;
  --sans:  "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono:  "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0 auto;
  padding: 4rem 2rem 8rem;
  max-width: 42rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

/* --- masthead ------------------------------------------------- */

.eyebrow {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.75rem;
}

h1 {
  font-size: 2.15rem;
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
}

.standfirst {
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 2.5rem;
}

h2 {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 3.25rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
}

p { margin: 0 0 1.1rem; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(122, 46, 29, 0.3);
}
a:hover { border-bottom-color: var(--accent); }

strong { font-weight: 600; }

/* --- the phrases themselves ----------------------------------- */

.chunk {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98em;
  background: var(--accent-bg);
  padding: 0.1em 0.35em;
  border-radius: 2px;
  white-space: nowrap;
}

/* a card holding one group of phrases */
.phrase-set {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: #fff;
  padding: 1.25rem 1.4rem 0.9rem;
  margin: 1.5rem 0;
}
.phrase-set > .label {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.85rem;
}
.phrase-set ul { list-style: none; margin: 0; padding: 0; }
.phrase-set li {
  padding: 0.5rem 0;
  border-top: 1px dotted var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.15rem;
}
.phrase-set li:first-child { border-top: 0; }
.phrase-set .say {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: break-word;
}
.phrase-set .when {
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-style: italic;
  min-width: 0;
}

/* --- asides and callouts -------------------------------------- */

.aside {
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-soft);
  background: var(--warn-bg);
  border-left: 3px solid var(--warn);
  padding: 0.9rem 1.1rem;
  margin: 1.75rem 0;
}
.aside .aside-title {
  display: block;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.citation {
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-style: italic;
}

/* --- interactive blocks --------------------------------------- */

.exercise {
  border: 1px solid var(--rule);
  background: #fff;
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 3px;
}
.exercise-head {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
}

button {
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 3px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: opacity 0.15s;
}
button:hover { opacity: 0.87; }
button:disabled { opacity: 0.35; cursor: default; }
button.ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
}

input[type="text"], textarea {
  font-family: var(--sans);
  font-size: 1rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
}
input[type="text"]:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.verdict {
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  padding: 0.75rem 0.9rem;
  border-radius: 3px;
  margin-top: 0.85rem;
}
.verdict.hit  { background: var(--good-bg); color: var(--good); border-left: 3px solid var(--good); }
.verdict.miss { background: var(--warn-bg); color: var(--warn); border-left: 3px solid var(--warn); }

.progress {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}

/* --- footer navigation ---------------------------------------- */

.footer-nav {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.9rem;
}
.footer-nav ul { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.footer-nav li { margin-bottom: 0.45rem; }

.ask-teacher {
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.55;
  background: var(--accent-bg);
  border: 1px dashed var(--accent);
  border-radius: 3px;
  padding: 1rem 1.2rem;
  color: var(--ink-soft);
}
.ask-teacher strong { color: var(--accent); }

/* --- print ---------------------------------------------------- */

@media print {
  body { padding: 0; max-width: none; font-size: 10.5pt; background: #fff; }
  h2 { break-after: avoid; }
  .phrase-set, .exercise, .aside { break-inside: avoid; }
  .exercise, .footer-nav, .ask-teacher, button { display: none; }
  a { color: var(--ink); border: 0; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: var(--ink-faint);
  }
}

@media (max-width: 34rem) {
  body { padding: 2.5rem 1.25rem 5rem; font-size: 1rem; }
  h1 { font-size: 1.75rem; }
}
