/* ============================================================
   bretthalperin.com — style.css
   Mobile-first. Base: ~390px. Enhancement: min-width 900px.
   ============================================================ */

/* — Google Fonts — */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@400;500&display=swap');

/* — Tokens — */
:root {
  --ink:    #111;
  --paper:  #fff;
  --rule:   #111;
  --muted:  #9a9a9a;
  --serif:  "Source Serif 4", "Tiempos Text", Georgia, serif;
  --sans:   "Inter", "Söhne", "Helvetica Neue", Arial, sans-serif;
  --gap:    clamp(1.25rem, 5vw, 3.5rem);
  --measure: 62ch;
}

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

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* — Links — */
a {
  color: inherit;
  text-decoration: none;
}
a:hover,
a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* — Bio links — */
.bio-link {
  text-decoration: none;
}
.bio-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* — Layout container — */
.site-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* ============================================================
   1. MASTHEAD
   ============================================================ */

.masthead {
  padding-top: 2rem;
  padding-bottom: 1.1rem;
}

.masthead-inner {
  padding-top: 0.75rem;
  padding-bottom: 1.1rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.35rem;
  border-bottom: 1px solid var(--rule);
}

.masthead-name,
.masthead-desc {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.3;
}

.masthead-name { color: var(--ink); }
.masthead-desc { color: var(--ink); }

/* ============================================================
   2. HERO
   ============================================================ */

.hero {
  padding-top: 2rem;
  padding-bottom: 1.5rem;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-photo {
  width: 100%;
  max-width: 340px;
}

.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center top;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0.45rem;
}

.hero-display {
  font-family: var(--serif);
  font-weight: 400;
  font-style: normal;
  font-size: 1.5rem;
  line-height: 1.2;
  max-width: var(--measure);
}

.hero-bio,
.hero-bio p {
  font-family: var(--serif);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: var(--measure);
}

/* ============================================================
   3 & 4. PUBLICATIONS — shared
   ============================================================ */

.section {
  padding-top: 1rem;
  padding-bottom: 2rem;
}

.section-label {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.section-rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0 0 0 0;
}

/* — Publication list — */
.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* MOBILE: stacked single-column block */
.pub-list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}

#all-pub-list li:first-child {
  border-top: none;
}

/* Mobile meta line: "YEAR · TAG" */
.pub-meta-mobile {
  display: flex;
  gap: 0.4em;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums lining-nums;
}

/* Hide desktop columns on mobile */
.pub-year,
.pub-tag {
  display: none;
}

.pub-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 0.97rem;
  line-height: 1.45;
}

/* Title link: underline always on, no color shift */
.pub-title a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.pub-title a:hover,
.pub-title a:focus-visible {
  text-decoration: none;
}

.pub-authors {
  font-family: var(--serif);
  font-size: 0.78rem;
  line-height: 1.45;
  margin-top: 0.2rem;
  color: var(--ink);
}

.pub-venue {
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 0.15rem;
}

.pub-award {
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.1rem;
}

/* ============================================================
   5. FOOTER
   ============================================================ */

footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  align-items: baseline;
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--ink);
}

.footer-dot {
  color: var(--muted);
  user-select: none;
}

.footer-colophon {
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Featured inline label — desktop only */
.pub-featured-label {
  display: none;
}

/* ============================================================
   DESKTOP ENHANCEMENT — min-width: 1000px
   ============================================================ */

@media (min-width: 1000px) {

  html { font-size: 16px; }

  /* Hero: two-column 5/12 + 7/12 */
  .hero-inner {
    display: grid;
    grid-template-columns: 5fr 7fr;
    column-gap: calc(var(--gap) * 1.5);
    align-items: start;
  }

  .hero-photo {
    width: 100%;
    max-width: none;
  }

  .hero-photo img {
    aspect-ratio: 3 / 4;
    max-height: 420px;
  }

  .hero-display {
    font-size: 1.6rem;
    line-height: 1.15;
  }

  /* Publication list: 4-column grid */
  .pub-list li {
    display: grid;
    grid-template-columns: 4rem 1fr 10rem 7rem;
    column-gap: 2rem;
    align-items: start;
    flex-direction: unset;
    gap: unset;
  }

  /* Hide mobile meta, show desktop columns */
  .pub-meta-mobile { display: none; }
  .pub-year        { display: block; }
  .pub-tag         { display: block; }

  .pub-year {
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums lining-nums;
    color: var(--muted);
    padding-top: 0.22rem;
    line-height: 1.4;
  }

  .pub-tag {
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums lining-nums;
    color: var(--muted);
    text-align: right;
    padding-top: 0.28rem;
    line-height: 1.4;
  }

  .pub-venue {
    color: var(--ink);
  }

  .masthead-name,
  .masthead-desc {
    font-size: 0.72rem;
  }

  .footer-links {
    font-size: 0.72rem;
    gap: 0 0.8rem;
  }

  .pub-featured-label {
    display: block;
    font-family: var(--sans);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.15rem;
  }
}

/* ============================================================
   Prevent horizontal scroll at all widths
   ============================================================ */

img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* ============================================================
   PUBLICATION FILTER
   ============================================================ */

.pub-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.1rem 0 0;
}

.pub-filter-btn {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid #d0d0d0;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  line-height: 1.4;
  transition: color 0.12s, border-color 0.12s;
  -webkit-font-smoothing: antialiased;
}

.pub-filter-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.pub-filter-btn.active {
  color: var(--ink);
  border-color: var(--ink);
}

.pub-filter-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}