/* ==========================================================================
   Component: datpro_article
   The reading layout for a single news article. One column, no sidebar, no
   ads, no widgets — the only job of this file is to make CMS-authored prose
   render correctly with zero extra classes.

     .dp-article__masthead   tinted band: breadcrumb · category · h1 · date
     .dp-article__cover      <figure> above the text, one step wider
     .dp-article__notice     muted "this is placeholder content" callout
     .dp-article__body       THE MEASURE — everything typographic lives here
     .dp-article__foot       share row + back link

   MEASURE
   --dp-measure is 47rem (752px) at the 17px body size used here, i.e. roughly
   70–75 characters a line. The container is 1320px; the text deliberately is
   not. Change the token, not the individual rules.

   CMS CONTRACT
   Inside .dp-article__body, plain tags are styled: h2 h3 h4 p ul ol li a
   strong em blockquote figure img figcaption hr table pre code. An editor
   pasting a block of HTML needs no class names at all. Two escape hatches
   exist for content that is intrinsically wide:
     <div class="dp-article__scroll"> … wide table … </div>
     <figure class="dp-article__figure--wide"> … full-measure-plus image … </figure>
   ========================================================================== */

.dp-article {
  --dp-measure: 47rem;
  --dp-measure-wide: 60rem;
}

/* --------------------------------------------------------------------------
   Masthead — the same light wash the rest of Phase 02 opens with, so an
   article still reads as part of the site rather than a bare document.
   -------------------------------------------------------------------------- */

.dp-article__masthead {
  position: relative;
  overflow: hidden;
  background: linear-gradient(168deg, #e7f0fa 0%, #f2f7fc 45%, #fbfdff 100%);
  border-bottom: 1px solid var(--dp-border);
}

.dp-article__masthead-inner {
  max-width: var(--dp-measure);
  margin-inline: auto;
  padding-block: clamp(2rem, 4vw, 3.25rem);
}

.dp-article__masthead .dp-breadcrumb {
  margin-bottom: clamp(1.25rem, 2.4vw, 1.75rem);
}

.dp-article__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-4);
}

.dp-article__category {
  color: var(--dp-blue);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-eyebrow);
  line-height: 1.4;
  text-transform: uppercase;
}

.dp-article__title {
  margin-bottom: clamp(1rem, 2vw, 1.375rem);
  overflow-wrap: break-word;
  text-wrap: balance;
}

.dp-article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-5);
  color: var(--dp-text-subtle);
  font-size: var(--fs-sm);
}

.dp-article__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  min-width: 0;
}

.dp-article__meta-item svg {
  flex: none;
  width: 1em;
  height: 1em;
}

.dp-article__date {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Content column
   -------------------------------------------------------------------------- */

.dp-article__content {
  padding-block: clamp(2rem, 4vw, 3.25rem) clamp(2.5rem, 5vw, 4rem);
}

/* Cover — one step wider than the text so the page has a visual hierarchy,
   still centred on the same axis. */
.dp-article__cover {
  max-width: var(--dp-measure-wide);
  margin: 0 auto clamp(2rem, 3.6vw, 2.75rem);
}

.dp-article__cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-lg);
  background: var(--dp-surface-2);
}

.dp-article__cover figcaption {
  margin-top: var(--sp-3);
  color: var(--dp-text-subtle);
  font-size: var(--fs-xs);
  line-height: 1.6;
  text-align: center;
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   .dp-article__notice — placeholder / editorial disclosure.
   Muted on purpose: it must never read as part of the article's own voice.
   -------------------------------------------------------------------------- */

.dp-article__notice {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
  padding: clamp(0.875rem, 1.6vw, 1.125rem) clamp(1rem, 1.8vw, 1.25rem);
  background: var(--dp-surface);
  border: 1px dashed var(--dp-border-strong);
  border-radius: var(--r-md);
  color: var(--dp-text-subtle);
  font-size: var(--fs-xs);
  line-height: 1.65;
  text-wrap: pretty;
}

.dp-article__notice svg {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: var(--dp-text-muted);
}

.dp-article__notice-label {
  display: block;
  margin-bottom: 0.125rem;
  color: var(--dp-text-muted);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
}

/* The notice sits inside .dp-article__body, so it has to opt out of the
   paragraph rhythm below — and out-specify it, since `.dp-article__body p`
   is declared later in this file with the same weight. */
.dp-article__body .dp-article__notice p {
  margin: 0;
  min-width: 0;
}

/* --------------------------------------------------------------------------
   .dp-article__body — the measure, and the whole CMS type scale
   -------------------------------------------------------------------------- */

.dp-article__body {
  max-width: var(--dp-measure);
  margin-inline: auto;
  color: var(--dp-text-body);
  font-size: 1.0625rem; /* 17px — long-form reading, not the 15px UI size */
  line-height: 1.75;
  overflow-wrap: break-word;
}

.dp-article__lead {
  color: var(--dp-text);
  font-size: clamp(1.125rem, 1.05rem + 0.32vw, 1.25rem);
  font-weight: var(--fw-medium);
  line-height: 1.6;
}

/* ---------- Headings ------------------------------------------------------ */

.dp-article__body h2 {
  margin-top: clamp(2.25rem, 4vw, 3rem);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-h2);
}

.dp-article__body h3 {
  margin-top: clamp(1.875rem, 3vw, 2.375rem);
  margin-bottom: var(--sp-3);
  font-size: var(--fs-h3);
}

.dp-article__body h4 {
  margin-top: clamp(1.5rem, 2.4vw, 1.875rem);
  margin-bottom: var(--sp-2);
  font-size: var(--fs-h4);
}

.dp-article__body > :first-child {
  margin-top: 0;
}

/* ---------- Paragraphs, inline ------------------------------------------- */

.dp-article__body p {
  margin-top: var(--sp-5);
  text-wrap: pretty;
}

.dp-article__body a {
  color: var(--dp-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--dp-blue-200);
  text-underline-offset: 0.18em;
  transition: color var(--dur) var(--ease),
    text-decoration-color var(--dur) var(--ease);
}

.dp-article__body a:hover {
  color: var(--dp-blue-700);
  text-decoration-color: currentColor;
}

.dp-article__body strong,
.dp-article__body b {
  color: var(--dp-text);
  font-weight: var(--fw-semibold);
}

.dp-article__body em {
  font-style: italic;
}

.dp-article__body code {
  padding: 0.1em 0.35em;
  background: var(--dp-surface-2);
  border: 1px solid var(--dp-border);
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
}

.dp-article__body pre {
  overflow-x: auto;
  max-width: 100%;
  margin-top: var(--sp-5);
  padding: var(--sp-4);
  background: var(--dp-surface);
  border: 1px solid var(--dp-border);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.dp-article__body pre code {
  padding: 0;
  background: none;
  border: 0;
}

/* ---------- Lists --------------------------------------------------------- */
/* base.css strips list styling globally; article prose puts it back. */

.dp-article__body ul,
.dp-article__body ol {
  margin-top: var(--sp-5);
  padding-left: 1.375rem;
}

.dp-article__body ul {
  list-style: disc;
}

.dp-article__body ol {
  list-style: decimal;
}

.dp-article__body li {
  margin-top: var(--sp-2);
  padding-left: 0.25rem;
}

.dp-article__body li::marker {
  color: var(--dp-blue);
}

.dp-article__body li > ul,
.dp-article__body li > ol {
  margin-top: var(--sp-2);
}

/* ---------- Images and captions ------------------------------------------ */

.dp-article__body figure {
  margin: clamp(2rem, 3.4vw, 2.75rem) 0;
}

.dp-article__body img {
  width: 100%;
  height: auto;
  border-radius: var(--r-md);
  background: var(--dp-surface-2);
}

.dp-article__body figcaption {
  margin-top: var(--sp-3);
  color: var(--dp-text-subtle);
  font-size: var(--fs-xs);
  line-height: 1.6;
  text-wrap: pretty;
}

/* Optional: an image that breaks out to the cover width on desktop. */
@media (min-width: 1024px) {
  .dp-article__figure--wide {
    width: var(--dp-measure-wide);
    max-width: calc(100vw - 2 * var(--container-pad));
    margin-inline: calc(50% - min(var(--dp-measure-wide), 100vw - 2 * var(--container-pad)) / 2);
  }
}

/* ---------- Pull quote ---------------------------------------------------- */

.dp-article__body blockquote {
  margin: clamp(2rem, 3.4vw, 2.75rem) 0;
  padding: clamp(1.125rem, 2vw, 1.625rem) clamp(1.25rem, 2.4vw, 1.875rem);
  background: var(--dp-surface);
  border-left: 3px solid var(--dp-blue-200);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--dp-text);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  font-weight: var(--fw-medium);
  line-height: 1.6;
  text-wrap: pretty;
}

.dp-article__body blockquote p {
  margin-top: var(--sp-3);
}

.dp-article__body blockquote > :first-child {
  margin-top: 0;
}

.dp-article__body blockquote cite {
  display: block;
  margin-top: var(--sp-3);
  color: var(--dp-text-subtle);
  font-size: var(--fs-sm);
  font-style: normal;
  font-weight: var(--fw-regular);
}

/* ---------- Rules and tables --------------------------------------------- */

.dp-article__body hr {
  height: 1px;
  margin: clamp(2rem, 3.4vw, 2.75rem) 0;
  border: 0;
  background: var(--dp-border);
}

/* A wide table is the one thing prose can do that no measure survives.
   .dp-article__scroll is the wrapper an editor (or the CMS filter) uses. */
.dp-article__scroll {
  max-width: 100%;
  margin-top: var(--sp-5);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dp-article__body table {
  width: 100%;
  margin-top: var(--sp-5);
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.dp-article__scroll table {
  margin-top: 0;
}

.dp-article__body th,
.dp-article__body td {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--dp-border);
  text-align: left;
  vertical-align: top;
}

.dp-article__body th {
  color: var(--dp-text);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   .dp-article__foot — share row + back link
   -------------------------------------------------------------------------- */

.dp-article__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4) var(--sp-6);
  max-width: var(--dp-measure);
  margin: clamp(2.5rem, 4.4vw, 3.5rem) auto 0;
  padding-top: clamp(1.5rem, 2.4vw, 2rem);
  border-top: 1px solid var(--dp-border);
}

.dp-article__share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  min-width: 0;
}

.dp-article__share-label {
  color: var(--dp-text-subtle);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
}

.dp-article__share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  min-height: 38px;
  padding: 0.4375rem 0.875rem;
  background: #fff;
  border: 1px solid var(--dp-border);
  border-radius: var(--r-pill);
  color: var(--dp-text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  line-height: 1.4;
  white-space: nowrap;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.dp-article__share-btn svg {
  flex: none;
  width: 15px;
  height: 15px;
}

.dp-article__share-btn:hover {
  border-color: var(--dp-blue-200);
  color: var(--dp-blue);
}

.dp-article__share-btn.is-done {
  background: var(--dp-blue-50);
  border-color: var(--dp-blue-200);
  color: var(--dp-blue);
}

.dp-article__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  color: var(--dp-blue);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  line-height: 1.4;
  transition: color var(--dur) var(--ease);
}

.dp-article__back svg {
  flex: none;
  width: 1em;
  height: 1em;
  transition: transform var(--dur) var(--ease);
}

.dp-article__back:hover {
  color: var(--dp-blue-700);
}

.dp-article__back:hover svg {
  transform: translateX(-3px);
}

@media (max-width: 559px) {
  .dp-article__foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

