/*
Theme Name:  Austin Ortega
Theme URI:   https://austinortega.com
Author:      Austin Ortega
Description: Personal site for Austin Ortega — medical device operations engineer.
Version:     1.1
License:     GNU General Public License v2 or later
Text Domain: austin-ortega
*/

/* ─── TOKENS ──────────────────────────────────────────────── */
:root {
  --bg:         #222222;
  --off-white:  #f0ece3;
  --reading-w:  680px;
  --radius:     4px;
  --ease:       0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── RESET ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── BASE ────────────────────────────────────────────────── */
html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--off-white);
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ─── SHELL ───────────────────────────────────────────────── */
#shell {
  max-width: var(--reading-w);
  margin: 0 auto;
  padding: 0 24px 96px;
}

/* ─── BREADCRUMB BAR ──────────────────────────────────────── */
#crumb-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding: 28px 0 20px;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}

/* The pill — no fixed width, grows with content, capped at half column */
#crumb-inner {
  display: inline-flex;
  align-items: center;
  background: var(--off-white);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 340px; /* never wider than half the reading column */
  /* width is driven entirely by content — no transitions needed,
     segments animate in via opacity+translate which feels like expansion */
}

/* ── Home chip ────────────────────────────────────────────── */
.crumb-home {
  display: flex;
  align-items: center;
  padding: 0.55em 0.85em;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

.crumb-home span {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--bg);
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: opacity var(--ease);
}

/* ── Chevron ──────────────────────────────────────────────── */
.crumb-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0;
  flex-shrink: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity var(--ease), width var(--ease);
}

.crumb-chevron svg {
  width: 10px;
  height: 10px;
  min-width: 10px; /* prevent svg collapsing when parent width animates */
  stroke: var(--bg);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.crumb-chevron.visible {
  opacity: 1;
  width: 22px;
}

/* ── Crumb segment ────────────────────────────────────────── */
.crumb-seg {
  display: flex;
  align-items: center;
  padding: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  cursor: pointer;
  line-height: 1;
  transition: max-width var(--ease), opacity var(--ease), padding var(--ease);
  white-space: nowrap;
}

.crumb-seg span {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--bg);
  letter-spacing: 0.02em;
  transition: font-weight 0.2s, opacity 0.2s;
  white-space: nowrap;
}

/* When visible: expand to fit content */
.crumb-seg.visible {
  opacity: 1;
  max-width: 220px; /* wide enough for any segment label */
  padding: 0.55em 0.85em 0.55em 0;
}

/* Active = bold */
.crumb-seg.active span { font-weight: 700; }

/* Ancestor = dimmed */
.crumb-home.ancestor span,
.crumb-seg.ancestor span { opacity: 0.42; }
.crumb-chevron.ancestor svg { opacity: 0.42; }

/* ─── CONTENT ─────────────────────────────────────────────── */
#content { padding-top: 64px; }

/* ─── HOME ────────────────────────────────────────────────── */
.home-prose p {
  font-size: 18px;
  line-height: 1.78;
  color: var(--off-white);
}

.home-prose a {
  color: var(--off-white);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  opacity: 0.9;
  transition: opacity 0.2s;
}
.home-prose a:hover { opacity: 1; }

/* ─── ARTICLES LIST ───────────────────────────────────────── */
#articles-list { list-style: none; padding: 0; }

#articles-list li {
  border-bottom: 1px solid rgba(240, 236, 227, 0.1);
}

#articles-list li a {
  display: block;
  padding: 18px 0;
  font-size: 17px;
  font-weight: 400;
  color: var(--off-white);
  opacity: 0.82;
  transition: opacity 0.2s, padding-left 0.2s;
}
#articles-list li a:hover { opacity: 1; padding-left: 6px; }

.articles-loading {
  opacity: 0.45;
  font-size: 15px;
  padding: 12px 0;
}

/* ─── ARTICLE TITLE (shown above body) ───────────────────── */
.article-title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.3;
  color: var(--off-white);
  margin-bottom: 2rem;
}

/* ─── SINGLE ARTICLE BODY ─────────────────────────────────── */
#article-body {
  font-family: 'IBM Plex Serif', serif;
  font-size: 17px;
  line-height: 1.82;
  color: rgba(240, 236, 227, 0.88);
}

#article-body h1,
#article-body h2,
#article-body h3,
#article-body h4 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700;
  color: var(--off-white);
  margin: 2em 0 0.6em;
  line-height: 1.3;
}
#article-body h1 { font-size: 1.4em; }
#article-body h2 { font-size: 1.2em; }
#article-body h3 { font-size: 1.05em; }
#article-body h4 { font-size: 0.95em; text-transform: uppercase; letter-spacing: 0.06em; }

/* Ensure WordPress adds bold via <strong> correctly */
#article-body strong,
#article-body b {
  font-weight: 700;
  color: var(--off-white);
}

#article-body p          { margin-bottom: 1.3em; }
#article-body ul,
#article-body ol         { padding-left: 1.6em; margin-bottom: 1.3em; }
#article-body li         { margin-bottom: 0.4em; }
#article-body a          { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
#article-body img        { max-width: 100%; border-radius: 4px; margin: 1.5em 0; }
#article-body blockquote {
  border-left: 2px solid rgba(240, 236, 227, 0.22);
  padding-left: 1.2em;
  margin: 1.5em 0;
  color: rgba(240, 236, 227, 0.58);
  font-style: italic;
}

/* ─── ANIMATION ───────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
#content > * { animation: fadeUp 0.4s ease both; }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 600px) {
  #shell { padding: 0 20px 72px; }
  .home-prose p { font-size: 16px; }
  #crumb-inner { max-width: calc(100vw - 48px); }
  .crumb-seg.visible { max-width: 140px; }
}
