/* =============================================================
   COMPONENTS.CSS
   Reusable component styles. Loaded after layout.css.
   ============================================================= */


/* -------------------------------------------------------------
   1. SECTION LABEL (eyebrow)
   Small all-caps label used above lists: "Latest", "Currently",
   "Get in touch". Editorial / newspaper feel.
   ------------------------------------------------------------- */

.eyebrow {
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 500;
  margin: 0 0 var(--space-4);
}


/* -------------------------------------------------------------
   2. DIVIDER
   Subtle horizontal rule. Hair-thin so it disappears at glance
   distance but anchors the rhythm.
   ------------------------------------------------------------- */

.divider {
  height: 1px;
  background-color: var(--border-default);
  border: 0;
  margin: var(--space-6) 0;
}


/* -------------------------------------------------------------
   3. TAG CHIP
   Tiny uppercase pill: "Project", "Essay", "Data Analysis".
   ------------------------------------------------------------- */

.tag {
  display: inline-block;
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tag-fg);
  background-color: var(--tag-bg);
  padding: 0.2em 0.55em;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  /* Sit slightly above the baseline so it doesn't drag titles down. */
  vertical-align: 0.12em;
}


/* -------------------------------------------------------------
   4. ARTICLE ROW
   Used in the home page "Latest" list. Thumb + title + tag + date.
   ------------------------------------------------------------- */

.article-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-subtle);
  color: inherit;
  transition: background-color var(--t-fast);
}

.article-row:hover {
  background-color: color-mix(in srgb, var(--text-primary) 3%, transparent);
}

/* Provide left/right hover bleed so the highlight isn't too tight. */
.article-row {
  margin-inline: calc(var(--space-3) * -1);
  padding-inline: var(--space-3);
}

.article-row__thumb {
  width: 80px;
  height: 56px;
  flex-shrink: 0;
  background-color: var(--surface-muted);
  border-radius: var(--radius-sm);
  object-fit: cover;
  overflow: hidden;
}

.article-row__body {
  flex: 1;
  min-width: 0;     /* allows the title to wrap inside flex */
}

.article-row__title {
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
  margin: 0 0 var(--space-1);
}

.article-row__title .tag {
  margin-left: var(--space-2);
}

.article-row__meta {
  font-size: var(--fs-meta);
  color: var(--text-tertiary);
}

@media (max-width: 480px) {
  .article-row__thumb { width: 64px; height: 48px; }
}


/* -------------------------------------------------------------
   5. LIST ROW
   Used on the articles index. Compact: date — title — tag.
   No thumbnail (denser view for a long list).
   ------------------------------------------------------------- */

.list-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-5);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
  color: inherit;
  transition: background-color var(--t-fast);

  margin-inline: calc(var(--space-3) * -1);
  padding-inline: var(--space-3);
}

.list-row:hover {
  background-color: color-mix(in srgb, var(--text-primary) 3%, transparent);
}

.list-row__date {
  font-size: var(--fs-meta);
  color: var(--text-tertiary);
  min-width: 92px;
  flex-shrink: 0;
  /* Tabular numbers keep the date column aligned vertically. */
  font-variant-numeric: tabular-nums;
}

.list-row__title {
  flex: 1;
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
  min-width: 0;
}

.list-row__tag {
  flex-shrink: 0;
}

@media (max-width: 480px) {
  /* Stack: title on top, date + tag on a row below. */
  .list-row {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  .list-row__title {
    flex-basis: 100%;
    order: 1;
  }
  .list-row__date  { order: 2; min-width: 0; }
  .list-row__tag   { order: 3; }
}


/* -------------------------------------------------------------
   6. FILTER CHIPS
   The "All / Projects / Data Analysis / Essays" toggle row on
   the articles page.
   ------------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-5);
}

.filter-chip {
  font-size: var(--fs-small);
  font-family: inherit;
  padding: 0.35em 0.95em;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: color var(--t-fast),
              background-color var(--t-fast),
              border-color var(--t-fast);
}

.filter-chip:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.filter-chip[aria-pressed="true"] {
  color: var(--accent-fg);
  background-color: var(--accent);
  border-color: var(--accent);
}


/* -------------------------------------------------------------
   7. ARROW LINK
   "All articles →" style. Inline, underlined, with a
   small arrow that nudges on hover.
   ------------------------------------------------------------- */

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-top: var(--space-5);
  font-size: var(--fs-small);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1px;
  transition: color var(--t-fast), border-color var(--t-fast);
}

.arrow-link:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.arrow-link__arrow {
  transition: transform var(--t-default);
}

.arrow-link:hover .arrow-link__arrow {
  transform: translateX(3px);
}


/* -------------------------------------------------------------
   8. ABOUT PAGE — bio, currently, social links
   ------------------------------------------------------------- */

.bio {
  font-size: var(--fs-body);
  line-height: 1.85;
  color: var(--text-primary);
  max-width: 34rem;
  margin: 0 0 var(--space-4);
}

.currently {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.currently__item {
  font-size: var(--fs-body);
  color: var(--text-primary);
  line-height: 1.7;
  /* The "→" lives in the HTML, not as a pseudo, so it can be
     swapped for "·" or removed without editing CSS. */
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}

.socials__link {
  font-size: var(--fs-body);
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: color var(--t-fast);
}

.socials__link:hover {
  color: var(--text-primary);
}


/* -------------------------------------------------------------
   9. ARTICLE PAGE — header, meta, body, prev/next
   ------------------------------------------------------------- */

/* "← Articles" back link at top of article pages. */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: var(--fs-small);
  color: var(--text-tertiary);
  margin-bottom: var(--space-5);
  transition: color var(--t-fast);
}

.back-link:hover {
  color: var(--text-primary);
}

.back-link__arrow {
  transition: transform var(--t-default);
}

.back-link:hover .back-link__arrow {
  transform: translateX(-3px);
}

/* The single small line under the hero on article pages:
   "12 May 2026 · 8 min read". Tabular numerals keep digits aligned. */
.article-meta {
  font-size: var(--fs-small);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-6);
}


/* Prev / next nav row at the bottom of an article. */
.prev-next {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-default);
  font-size: var(--fs-small);
}

.prev-next__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--text-secondary);
  max-width: 48%;
  transition: color var(--t-fast);
}

.prev-next__item:hover {
  color: var(--text-primary);
}

.prev-next__item--next {
  text-align: right;
  margin-left: auto;
}

.prev-next__label {
  font-size: var(--fs-meta);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.prev-next__title {
  font-weight: 500;
  line-height: 1.35;
}


/* -------------------------------------------------------------
   10. PROSE
   Article body content. The .prose class wraps the long-form
   HTML in an article page so default <p>, <h2>, <h3>, <ul>,
   <ol>, <blockquote>, <a>, <code>, <pre>, <hr> styles all apply.
   ------------------------------------------------------------- */

.prose {
  font-size: 1.0625rem;      /* 17px — generous for long-form reading */
  line-height: 1.8;
  color: var(--text-primary);
}

/* Vertical rhythm: paragraphs flow with consistent spacing. */
.prose > * + * {
  margin-top: var(--space-4);
}

.prose p {
  margin: 0;
}

/* Headings within prose — serif, with breathing room above. */
.prose h2 {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-size: var(--fs-h2);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-top: var(--space-7);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
}

.prose h3 {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-size: var(--fs-h3);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-top: var(--space-6);
}

/* Don't add a divider above the very first h2/h3. */
.prose > h2:first-child,
.prose > h3:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* Links in prose are underlined — for readability and to
   distinguish them from in-app links elsewhere. */
.prose a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--border-strong);
  transition: text-decoration-color var(--t-fast);
}

.prose a:hover {
  text-decoration-color: var(--text-primary);
}

.prose strong { font-weight: 600; }
.prose em { font-style: italic; }

.prose ul,
.prose ol {
  padding-left: var(--space-5);
}

.prose li {
  margin-bottom: var(--space-2);
}

.prose ul li {
  list-style: disc;
}

.prose ol li {
  list-style: decimal;
}

.prose blockquote {
  border-left: 2px solid var(--text-tertiary);
  padding-left: var(--space-4);
  margin-left: 0;
  font-style: italic;
  color: var(--text-secondary);
}

.prose hr {
  border: 0;
  height: 1px;
  background-color: var(--border-default);
  margin: var(--space-6) 0;
}

.prose code {
  font-size: 0.9em;
  background-color: var(--surface-muted);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

.prose pre {
  background-color: var(--surface-muted);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: var(--fs-small);
  line-height: 1.6;
}

.prose pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

/* TODO: brief specifies "no inline images" — so no .prose img
   styles are intentionally provided. If that changes later, this
   is where they'd go. */
