/*
 * RTE (CKEditor) preview stylesheet — Configuration/RTE/Sflg.yaml's contentsCss.
 *
 * Plain, hand-authored CSS (no build step) — a dedicated, typography-only
 * stylesheet instead of loading the full ~470KB compiled theme CSS into the
 * CKEditor iframe: editors only ever see headings/paragraphs/lists/links in
 * there, so only that subset (plus the handful of design tokens it needs) is
 * defined below, self-contained rather than importing the theme's own tokens.
 *
 * Values are lifted from Resources/Private/Scss/_typography.scss's h1–h6/p/
 * list/link rules — keep the two in sync if the frontend's typography changes.
 */

:root {
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --color-gold: #dab050;
  --color-gold-dark: #956019;
  --color-text-primary: #181d27;
  --color-text-secondary: #414651;
  --color-text-muted: #717680;

  --fs-base: 1rem;          /* 16px */
  --fs-lg: 1.125rem;        /* 18px */
  --fs-xl: 1.25rem;         /* 20px */
  --fs-display-xs: 1.5rem;  /* 24px */
  --fs-display-sm: 1.875rem;/* 30px */
  --fs-display-lg: 3rem;    /* 48px */

  --lh-base: 1.5rem;        /* 24px */
  --lh-lg: 2rem;            /* 32px */
  --lh-xl: 1.875rem;        /* 30px */
  --lh-display-xs: 2rem;    /* 32px */
  --lh-display-sm: 2.375rem;/* 38px */
  --lh-display-lg: 3.75rem; /* 60px */

  --ls-hero: -0.02em;

  --gap-title-body: 1.5rem;        /* 24px desktop */
  --gap-title-body-mobile: 1rem;   /* 16px mobile */
  --gap-paragraph: 3rem;           /* 48px desktop */
  --gap-paragraph-mobile: 1.5rem;  /* 24px mobile */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 1rem;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--color-text-primary);
}

h1,
h2 {
  font-family: var(--font-display);
  font-size: var(--fs-display-sm);
  font-weight: 400;
  line-height: var(--lh-display-sm);
  letter-spacing: 0;
  color: var(--color-gold-dark);
  margin: 0;
}

@media (min-width: 90rem) {
  h1,
  h2 {
    font-size: var(--fs-display-lg);
    line-height: var(--lh-display-lg);
    letter-spacing: var(--ls-hero);
  }
}

h3 {
  font-family: var(--font-display);
  font-size: var(--fs-display-xs);
  font-weight: 500;
  line-height: var(--lh-display-xs);
  color: var(--color-text-primary);
  margin: 0;
}

@media (min-width: 90rem) {
  h3 {
    font-size: var(--fs-display-sm);
    line-height: var(--lh-display-sm);
  }
}

h4 {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 500;
  line-height: var(--lh-xl);
  color: var(--color-text-primary);
  margin: 0;
}

h5 {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 500;
  line-height: var(--lh-lg);
  color: var(--color-text-primary);
  margin: 0;
}

h6 {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: var(--lh-base);
  color: var(--color-text-primary);
  margin: 0;
}

p {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: var(--lh-base);
  color: var(--color-text-secondary);
  margin: 0;
}

@media (min-width: 90rem) {
  p {
    font-size: var(--fs-lg);
    line-height: var(--lh-lg);
  }
}

/* Title → first paragraph, and paragraph → paragraph, gaps — same rhythm as
   .frame-type-text on the frontend (see _typography.scss). */
h1 + p,
h2 + p,
h3 + p {
  margin-top: var(--gap-title-body-mobile);
}

@media (min-width: 90rem) {
  h1 + p,
  h2 + p,
  h3 + p {
    margin-top: var(--gap-title-body);
  }
}

p + p {
  margin-top: var(--gap-paragraph-mobile);
}

@media (min-width: 90rem) {
  p + p {
    margin-top: var(--gap-paragraph);
  }
}

ul,
ol {
  padding-left: 1.25rem;
  margin: 1rem 0;
}

ul {
  list-style: disc;
}

ol {
  list-style: decimal;
}

li {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: var(--lh-base);
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

@media (min-width: 90rem) {
  li {
    font-size: var(--fs-lg);
    line-height: var(--lh-lg);
  }
}

li:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-gold-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover,
a:focus-visible {
  color: var(--color-gold);
}

a:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--color-gold);
  color: var(--color-text-secondary);
}

/* Matches the "Lead paragraph" / "Muted text" style definitions in
   Configuration/RTE/Sflg.yaml so the RTE preview actually reflects them. */
.lead {
  font-size: var(--fs-lg);
  line-height: var(--lh-lg);
}

.text-muted {
  color: var(--color-text-muted);
}
