/* =========================
   Legal Citation: Cases — polish layer (Harlowe)
   Safe: does not rewrite passage text or citation punctuation
   ========================= */

:root{
  --paper: #fbfaf7;
  --ink: #171717;
  --muted: #5a5a5a;
  --rule: rgba(0,0,0,.12);
  --accent: #1f4aa8;
  --accent2: #0b6b5a;
  --card: rgba(255,255,255,.82);
  --shadow: 0 10px 30px rgba(0,0,0,.10);
  --radius: 14px;
}

/* Base page */
tw-story{
  background: linear-gradient(180deg, #f2f0ea 0%, var(--paper) 55%, #f6f5f1 100%);
  color: var(--ink);
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  font-size: 1.18em;
  line-height: 1.55;
  padding: 6vh 6vw;
}

/* Comfortable measure + “card” */
@media (min-width: 760px){
  tw-story{ padding: 7vh 10vw; }
  tw-passage{
    max-width: 44em;
    margin: 0 auto;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.2em 1.35em;
    backdrop-filter: blur(6px);
  }
}

/* Headings in passages (keeps your citation italics intact) */
tw-passage h1, tw-passage h2, tw-passage h3{
  letter-spacing: -0.01em;
  margin-top: .2em;
}
tw-passage h1{ font-size: 1.6em; }
tw-passage h2{ font-size: 1.3em; }
tw-passage h3{ font-size: 1.15em; }

/* Links: readable, “button-ish” but still academic */
tw-link, .enchantment-link{
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  font-weight: 700;
}
tw-link:hover, .enchantment-link:hover{ color: #16357b; }

/* If you like “menu choice” links to feel like choices */
tw-passage tw-link{
  display: inline-block;
  padding: .22em .55em;
  border-radius: 999px;
  background: rgba(31,74,168,.08);
  border: 1px solid rgba(31,74,168,.18);
  text-decoration: none;
}
tw-passage tw-link:hover{
  background: rgba(31,74,168,.14);
  border-color: rgba(31,74,168,.28);
}

/* Examples: make them look like “model” blocks */
tw-passage strong + em,
tw-passage em{
  /* keep italics normal; no forced small-caps etc. */
}
tw-passage blockquote,
tw-passage .example{
  margin: .9em 0;
  padding: .85em 1em;
  border-left: 4px solid rgba(11,107,90,.65);
  background: rgba(11,107,90,.06);
  border-radius: 10px;
}
tw-passage .example-label{
  display: inline-block;
  font-size: .78em;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--accent2);
  font-weight: 800;
  margin-bottom: .35em;
}

/* Horizontal breathing room */
tw-passage p{ margin: .65em 0; }

/* Focus styles for accessibility */
tw-link:focus-visible{
  outline: 3px solid rgba(31,74,168,.35);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Reduce motion if user prefers */
@media (prefers-reduced-motion: reduce){
  .transition-in, .transition-out{ animation: none !important; }
}

/* Print: looks like a handout */
@media print{
  tw-story{ background: #fff !important; color: #000 !important; padding: 0 !important; }
  tw-passage{ box-shadow: none !important; border: none !important; max-width: none !important; padding: 0 !important; }
  tw-sidebar{ display: none !important; }
}
