/* Editorial typography — append after the theme's main.css.
 * Existing brand variables and font stack are retained.
 * Scope: opted-in editorial copy, existing worksheet prose/instructions,
 * and directory introductions. Cards, menus and download controls are untouched.
 */
.dt-editorial {
  --dt-editorial-text: #334b5e;
  max-inline-size: 72ch;
  color: var(--dt-editorial-text);
  font-family: inherit;
  font-size: 1.125rem;
  line-height: 1.85;
  text-align: start;
  overflow-wrap: break-word;
}

/* Both current page.php and single-dt_worksheet.php use .entry-content.
 * The alternate wrapper names allow the same class to survive future templates.
 */
:is(.entry-content, .page-content, .worksheet-content) > .dt-editorial {
  inline-size: 100%;
}
.dt-editorial[dir="rtl"] { direction: rtl; }
.dt-editorial :is([dir="ltr"], [lang="en"]) {
  direction: ltr;
  unicode-bidi: isolate;
}
.dt-editorial bdi { unicode-bidi: isolate; }

.dt-editorial p,
.worksheet-single .entry-content > p {
  margin-block: 0 1.05em;
  max-inline-size: 72ch;
  line-height: 1.85;
}
.dt-editorial .dt-editorial__lead {
  margin-block-end: 1.5rem;
  color: var(--dt-navy, #183b5b);
  font-size: clamp(1.14rem, 1.08rem + .2vw, 1.24rem);
  line-height: 1.8;
  font-weight: 400;
}
.dt-editorial h2,
.worksheet-single .entry-content > h2 {
  margin-block: 2rem .75rem;
  color: var(--dt-navy, #183b5b);
  font-size: clamp(1.3rem, 1.2rem + .4vw, 1.55rem);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: normal;
  text-wrap: balance;
}
.dt-editorial h3,
.worksheet-single .entry-content > h3 {
  margin-block: 1.5rem .6rem;
  color: var(--dt-navy, #183b5b);
  font-size: 1.17rem;
  line-height: 1.5;
  letter-spacing: normal;
}
.dt-editorial :is(ul, ol),
.worksheet-single .entry-content > :is(ul, ol) {
  max-inline-size: 72ch;
  margin-block: .5rem 1.25rem;
  padding-inline-start: 1.45em;
  line-height: 1.85;
}
.dt-editorial li,
.worksheet-single .entry-content > :is(ul, ol) > li {
  padding-inline-start: .15em;
  margin-block: .35em;
}
.dt-editorial li::marker,
.worksheet-single .entry-content > :is(ul, ol) > li::marker {
  color: var(--dt-gold-dark, #80601f);
  font-weight: 700;
}
.dt-editorial strong { color: var(--dt-navy, #183b5b); }
.dt-editorial a,
.directory-hero__description a {
  color: var(--dt-navy, #183b5b);
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: .075em;
  text-underline-offset: .18em;
  overflow-wrap: anywhere;
}
.dt-editorial a:hover,
.directory-hero__description a:hover {
  color: var(--dt-gold-dark, #80601f);
}
.dt-editorial a:focus-visible,
.directory-hero__description a:focus-visible {
  outline: 3px solid var(--dt-gold-dark, #80601f);
  outline-offset: 4px;
  border-radius: 2px;
}
.dt-editorial .dt-editorial__tip {
  margin-block: 1.5rem;
  padding: 1rem 1.2rem;
  border-inline-start: 4px solid var(--dt-gold-dark, #80601f);
  border-radius: 8px;
  background: var(--dt-sage-light, #edf4f0);
  color: var(--dt-ink, #183047);
  font-size: 1rem;
  line-height: 1.8;
}
.dt-editorial .dt-editorial__tip > :first-child { margin-block-start: 0; }
.dt-editorial .dt-editorial__tip > :last-child { margin-block-end: 0; }
.dt-editorial > :first-child { margin-block-start: 0; }
.dt-editorial > :last-child { margin-block-end: 0; }

/* Improve the currently published worksheet bodies before text replacement. */
.worksheet-single .entry-content {
  max-inline-size: 72ch;
  color: #334b5e;
  font-size: 1.125rem;
  line-height: 1.85;
  text-align: start;
  overflow-wrap: break-word;
}
.worksheet-single .entry-content > :first-child { margin-block-start: 0; }
.worksheet-single .entry-content > :last-child { margin-block-end: 0; }
.worksheet-single .worksheet-instructions {
  max-inline-size: 72ch;
  padding: clamp(1rem, 2vw, 1.4rem);
  font-size: 1.0625rem;
  line-height: 1.85;
  text-align: start;
}
.worksheet-single .worksheet-instructions h2 {
  margin-block: 0 .65rem;
  font-size: 1.3rem;
  line-height: 1.45;
  letter-spacing: normal;
}
.worksheet-single .worksheet-instructions p {
  max-inline-size: 68ch;
  margin-block-end: 0;
  line-height: 1.85;
}

/* Taxonomy descriptions remain two paragraphs, without another page heading. */
.directory-hero .directory-hero__description {
  max-inline-size: 72ch;
  margin-block: 1.25rem 0;
  margin-inline: auto;
  color: #334b5e;
  font-size: 1.0625rem;
  line-height: 1.85;
  text-align: start;
  overflow-wrap: break-word;
}
.directory-hero .directory-hero__description p {
  max-inline-size: none;
  margin-block: 0 .9em;
  margin-inline: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}
.directory-hero .directory-hero__description p:last-child { margin-block-end: 0; }

@media (max-width: 600px) {
  .dt-editorial,
  .worksheet-single .entry-content { font-size: 1.0625rem; }
  .dt-editorial h2,
  .worksheet-single .entry-content > h2 { margin-block-start: 1.65rem; }
  .dt-editorial .dt-editorial__tip { padding: .9rem 1rem; }
  .directory-hero .directory-hero__description { font-size: 1rem; }
}

@media print {
  .dt-editorial .dt-editorial__tip {
    border: 1px solid #718176;
    background: transparent;
  }
  .dt-editorial h2,
  .dt-editorial h3 { break-after: avoid; }
  .dt-editorial p { orphans: 3; widows: 3; }
}

/* Homepage guidance and standard-page details. */
.hero-section__guide { max-inline-size: 45ch; margin-block: 0 1.5rem; color: #334b5e; font-size: 1.0625rem; line-height: 1.8; }
.dt-editorial .dt-editorial__updated { color: #516172; font-size: .95rem; margin-block-end: 1.5rem; }
.dt-editorial .dt-editorial__contact { margin-block: 1.25rem 1.75rem; font-size: clamp(1.1rem, 3vw, 1.4rem); font-weight: 700; }
