/* =============================================
   ARTICLE STYLESHEET — marcelopereira.me/articles/
   Shared prose styles for the articles section.
   Load AFTER style.css (which provides reset, typography,
   header, footer, skip-nav, focus and reduced-motion).
   Tokens come from tokens.css via mp-ds.
   ============================================= */

@import url('tokens.css');

/* ===== PAGE LAYOUT — sticky footer ===== */
/* Keeps the footer pinned to the bottom on short pages (e.g. the
   articles index) instead of floating mid-viewport. */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

/* ===== HEADER BACK-LINK (stays visible on mobile) ===== */

.article-backlink {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  color: var(--clay);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.article-backlink:hover { color: var(--catalyst); text-decoration: none; }
.article-backlink:visited { color: var(--clay); }

/* ===== LAYOUT ===== */

.article {
  max-width: var(--prose-max-width);
  margin: 0 auto;
  padding: calc(var(--header-height) + var(--space-2xl)) var(--space-lg) var(--space-4xl);
}

.article p {
  font-size: 17px;
  line-height: 1.7;
  font-weight: 300;
  margin-bottom: var(--space-md);
}

.article p strong { font-weight: 600; }

/* ===== HERO ===== */

.article-hero {
  margin: 0 0 var(--space-2xl);
}

.article-hero__image {
  width: 100%;
  border-radius: var(--border-radius-lg);
  background: var(--sand);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-hero__caption,
.article-figure__caption {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 13px;
  font-style: italic;
  color: var(--clay);
  text-align: center;
  margin-top: var(--space-sm);
}

/* ===== HEADER ===== */

.article-header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--sand);
}

.article-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin-bottom: var(--space-md);
}

.article-byline {
  font-size: 15px;
  line-height: 1.5;
  color: var(--clay);
}

.article-byline strong {
  font-weight: 600;
  color: var(--foundation);
}

.article-date {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--clay);
  margin-top: var(--space-xs);
}

/* ===== SECTION HEADINGS ===== */

.article h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(22px, 2.5vw, 28px);
  line-height: 1.2;
  margin: var(--space-3xl) 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--sand);
}

/* ===== BADGES — mp-ds .badge idiom; semantic color lives here, not the box ===== */

.prompt__label,
.response__label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-sm);
}

.prompt__label { background: var(--info-subtle); color: var(--info); }
.response__label { background: var(--warning-subtle); color: var(--maturation-dark); }

/* ===== TL;DR — elevated summary card with a craft overline ===== */

.tldr {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
  margin: var(--space-xl) 0 var(--space-2xl);
}

.tldr__label {
  display: block;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--craft);
  margin-bottom: var(--space-sm);
}

.tldr p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  font-weight: 300;
}

/* ===== PROMPT (experimenter input) — recessed sand surface, mono ===== */

.prompt {
  margin: var(--space-xl) 0;
}

.prompt__body {
  background: var(--sand);
  border-radius: var(--border-radius-md);
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6;
  color: var(--foundation);
}

.prompt__body p { margin: 0; }

/* ===== RESPONSE (model output) — elevated white card ===== */

.response {
  margin: var(--space-xl) 0;
}

.response__body {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
  font-style: italic;
}

.response__body p {
  font-size: 16px;
  line-height: 1.7;
  font-weight: 300;
  margin: 0 0 var(--space-md);
}

.response__body p:last-child { margin-bottom: 0; }

.response__body strong { font-weight: 600; }

/* ===== TOPIC LIST — numbered, italic (Claude's enumerated topics) ===== */

.topic-list {
  margin: var(--space-lg) 0;
  padding-left: var(--space-xl);
  font-style: italic;
}

.topic-list li {
  font-size: 16px;
  line-height: 1.7;
  font-weight: 300;
  color: var(--foundation);
  margin: var(--space-xs) 0;
}

/* ===== SPECIFICATIONS LIST — sand surface ===== */

.specs {
  background: var(--sand);
  border-radius: var(--border-radius-md);
  padding: var(--space-md) var(--space-xl);
  margin: var(--space-lg) 0;
  list-style: none;
}

.specs li {
  font-size: 15px;
  line-height: 1.6;
  font-weight: 300;
  margin: var(--space-xs) 0;
}

.specs strong { font-weight: 600; }

/* ===== NOTES (advisory asides) — quiet info-tinted surface ===== */

.note {
  background: var(--info-subtle);
  border-radius: var(--border-radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 300;
  color: var(--foundation);
}

.note strong { font-weight: 600; }

/* ===== FIGURE (in-body images, e.g. the concrete poem) ===== */

.article-figure {
  margin: var(--space-xl) 0;
}

.article-figure__image {
  width: 100%;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--sand);
}

/* ===== ARTICLES INDEX (listing page) ===== */

.articles-index {
  max-width: var(--prose-max-width);
  margin: 0 auto;
  padding: calc(var(--header-height) + var(--space-2xl)) var(--space-lg) var(--space-4xl);
}

.articles-index__header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--sand);
}

.articles-index__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin-bottom: var(--space-sm);
}

.articles-index__intro {
  font-size: 17px;
  line-height: 1.7;
  font-weight: 300;
  color: var(--clay);
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  list-style: none;
}

.article-card {
  position: relative;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.article-card__media {
  display: block;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  background: var(--sand);
}

.article-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.article-card:hover .article-card__image { transform: scale(1.03); }

.article-card__date {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--craft);
  margin-bottom: var(--space-xs);
}

.article-card__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(20px, 2.5vw, 26px);
  line-height: 1.25;
  margin-bottom: var(--space-sm);
}

.article-card__title a { color: var(--foundation); }
.article-card__title a:hover { color: var(--catalyst); text-decoration: none; }
.article-card__title a:visited { color: var(--foundation); }

/* Stretched link — the whole card is one large click target (Fitts's Law) */
.article-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius-md);
}

.article-card__dek {
  font-size: 16px;
  line-height: 1.6;
  font-weight: 300;
  color: var(--foundation);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 600px) {
  .article {
    padding: calc(var(--header-height) + var(--space-xl)) var(--space-md) var(--space-3xl);
  }

  .article p,
  .response p { font-size: 16px; }

  .articles-index {
    padding: calc(var(--header-height) + var(--space-xl)) var(--space-md) var(--space-3xl);
  }

  .article-card {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}
