/* ==========================================================================
   Marlowe & Finch — base.css
   Design tokens, reset, typography, buttons/links, section heading pattern,
   accessibility utilities. Ported from design-mockup/css/style.css — values
   are reproduced exactly, not reinterpreted.
   ========================================================================== */

:root{
  /* ---- color ---- */
  --bg:            #F3EFE4;
  --bg-alt:        #ECE5D3;
  --surface:       #E8E1D2;
  --surface-line:  #DAD0B8;
  --primary:       #25382D;
  --primary-light: #33493B;
  --secondary:     #7A4038;
  --accent:        #C39A52;
  --accent-dark:   #A9813E;
  --ink:           #272722;
  --ink-muted:     #706C61;
  --cream:         #F6F2E8;
  --border:        rgba(39, 39, 34, 0.14);
  --border-strong: rgba(39, 39, 34, 0.28);

  /* ---- type ---- */
  --font-serif: "Libre Baskerville", "Lora", Georgia, serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* ---- layout ---- */
  --max: 1240px;
  --gutter: 40px;
  --radius: 3px;
  --header-h: 82px;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  border: none;
  border-radius: 0;
  overflow-x: hidden;
}

/**
 * On the Dashboard and Learning Area only, Tutor adds
 * data-tutor-theme="system" to <html> (classes/UserPreference.php, hooked
 * to the language_attributes filter, gated to is_dashboard_page() ||
 * is_learning_area()). Under the visitor's OS/browser dark-mode preference,
 * Tutor's own tutor-core.min.css has `@media (prefers-color-scheme: dark){
 * [data-tutor-theme=system]{ --tutor-surface-base:#161b26;
 * --tutor-text-primary:#f0f1f1; … } }`, and a separate unconditional rule
 * `[data-tutor-theme] body, body{ background-color: var(--tutor-surface-
 * base); color: var(--tutor-text-primary); … }`. `[data-tutor-theme] body`
 * has higher specificity (0,0,1,1) than the plain `body{}` rule above, so
 * it wins regardless of load order — producing a near-black "dark navy"
 * body with light text, on top of which this theme's own Forest-toned
 * headings (meant for the light Paper background) become unreadable. This
 * rule matches real classes WordPress already puts on the body tag on
 * every Tutor student/frontend page (`tutor-frontend`), giving it the same
 * (0,0,1,1) specificity — so, loaded after Tutor's CSS, it wins the tie and
 * restores the real Marlowe & Finch Paper background/ink text there.
 */
body.tutor-frontend{
  background-color: var(--bg);
  color: var(--ink);
}

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
ul{ margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4{
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.wrap{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* subtle paper grain overlay */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---- eyebrow / labels ---- */
.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--secondary);
}
.eyebrow::before{
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent-dark);
  display: inline-block;
}
.eyebrow.center{ justify-content: center; }

.section-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 56px;
}
.section-head h1,
.section-head h2{
  font-size: 40px;
  line-height: 1.15;
  margin-top: 14px;
  max-width: 620px;
}
.section-head .desc{
  max-width: 340px;
  color: var(--ink-muted);
  font-size: 15px;
  padding-bottom: 6px;
}
.section-head-compact{ margin-top: 48px; margin-bottom: 40px; }
.section-head-compact h2{ font-size: 28px; margin-top: 8px; }

/* ---- buttons ---- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 15px 28px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
  white-space: nowrap;
}
.btn-primary{
  background: var(--primary);
  color: var(--cream);
  border-color: var(--primary);
}
.btn-primary:hover{ background: var(--primary-light); transform: translateY(-1px); }

.btn-outline{
  background: transparent;
  color: var(--primary);
  border-color: var(--border-strong);
}
.btn-outline:hover{ border-color: var(--primary); background: rgba(37,56,45,0.05); }

.btn-cream{
  background: var(--cream);
  color: var(--primary);
  border-color: var(--cream);
}
.btn-cream:hover{ background: var(--accent); border-color: var(--accent); color: var(--primary); }

.btn-ghost-light{
  background: transparent;
  color: var(--cream);
  border-color: rgba(246,242,232,0.4);
}
.btn-ghost-light:hover{ border-color: var(--cream); background: rgba(246,242,232,0.08); }

.link-underline{
  position: relative;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border-strong);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.link-underline:hover{ border-color: var(--secondary); color: var(--secondary); }

/* ==========================================================================
   ACCESSIBILITY UTILITIES
   ========================================================================== */
.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;
}
.skip-link{
  position: absolute;
  left: 16px; top: -60px;
  background: var(--primary);
  color: var(--cream);
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  z-index: 1000;
  transition: top 0.2s ease;
}
.skip-link:focus{ top: 16px; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.course-card:focus-visible,
.instructor-card:focus-visible{
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
}

/* card components used as anchors */
a.course-card, a.instructor-card, a.journal-row, a.index-row{
  color: inherit;
}
