/* Open Props + shared theme tokens, brand fonts and site theme (copied from packages/theme by predev/prebuild) */
@import url("https://unpkg.com/open-props@1.7.23/style");
@import "tokens.css";
@import "fonts.css";
@import "site.css";

/* Blog-only styles below; brand tokens and components (.tt-tag, .tt-btn, callouts) live in
   packages/theme/src/site.css. */

.site-main {
  max-width: 72rem;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.navbar .navbar-nav .nav-link {
  margin-bottom: 0;
  font-family: var(--tt-font-heading);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.navbar .navbar-nav .nav-link.active {
  background: none;
  color: var(--tt-blue);
  box-shadow: inset 0 -2px 0 var(--tt-blue);
}

/* Drafted look: panels sit on the paper with a hairline, no rounding */
.tt-panel {
  background: var(--tt-panel);
  border: 1px solid var(--tt-line);
}

/* ---------- Tally marks ---------- */

.tally {
  display: inline-block;
  vertical-align: middle;
  overflow: visible;
  color: var(--tt-blue);
}

.tally path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: square;
}

.tally-rule {
  display: flex;
  justify-content: center;
  margin: 3rem 0;
}

/* ---------- Section and page heads ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 2px solid var(--tt-ink);
  padding-bottom: 0.6rem;
  margin-bottom: 1.5rem;
}

.section-head__title {
  font-family: var(--tt-font-display);
  font-size: 2rem;
  margin: 0;
}

.section-head .tally-rule {
  margin: 0;
  flex: 1;
  justify-content: flex-start;
}

.section-head__link,
.back-link {
  font-family: var(--tt-font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.section-head__link i,
.back-link i,
.post-card__more i,
.post-pager i {
  color: inherit;
}

.page-head {
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--tt-ink);
}

.page-head__title {
  font-family: var(--tt-font-display);
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1;
  margin-bottom: 0.75rem;
}

.page-head__title .tt-tag {
  font-size: 0.45em;
  vertical-align: middle;
}

.page-head__count {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-family: var(--tt-font-hand);
  font-size: 1.35rem;
  color: var(--tt-ink-soft);
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.year-group + .year-group {
  margin-top: 3rem;
}

.year-group__year {
  font-family: var(--tt-font-heading);
  font-weight: 700;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  color: var(--tt-blue);
  margin-bottom: 1rem;
}

.empty-note {
  padding: 2rem;
  text-align: center;
  border: 1px dashed var(--tt-line);
  font-family: var(--tt-font-hand);
  font-size: 1.4rem;
  color: var(--tt-ink-soft);
}

/* ---------- Post cards ---------- */

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1.25rem;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--tt-panel);
  border: 1px solid var(--tt-line);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.post-card:hover {
  border-color: var(--tt-blue);
  transform: translateY(-2px);
}

.post-card__image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--tt-line);
}

.post-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1.25rem 1rem;
}

.post-card__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  font-family: var(--tt-font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tt-ink-soft);
}

.post-card__kicker .tt-tag {
  font-size: 0.75rem;
  position: relative;
  z-index: 1;
}

.post-card__title {
  font-family: var(--tt-font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 1.45rem;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.post-card__title a {
  color: var(--tt-ink);
  text-decoration: none;
}

/* Whole card is clickable through the title link */
.post-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.post-card__desc {
  color: var(--tt-ink-soft);
  margin-bottom: 1rem;
}

.post-card__more {
  margin: auto 0 0;
  font-family: var(--tt-font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
}

.post-card__more a {
  text-decoration: none;
}

.post-card--featured {
  margin-bottom: 1.25rem;
  border-top: 3px solid var(--tt-blue);
}

.post-card--featured .post-card__body {
  padding: 2rem;
}

.post-card--featured .post-card__title {
  font-family: var(--tt-font-display);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.05;
}

.post-card--featured .post-card__desc {
  font-size: 1.15rem;
  max-width: 40rem;
}

@media (min-width: 768px) {
  .post-card--featured:has(.post-card__image) {
    flex-direction: row;
  }

  .post-card--featured .post-card__image {
    flex: 0 0 50%;
  }

  .post-card--featured .post-card__image img {
    height: 100%;
    aspect-ratio: auto;
    border-bottom: 0;
    border-right: 1px solid var(--tt-line);
  }
}

/* ---------- Single post ---------- */

.post {
  max-width: 44rem;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 2.5rem;
}

.post-header__kicker {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.post-header__title {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.05;
  margin-bottom: 1rem;
}

.post-header__lede {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--tt-ink-soft);
  margin-bottom: 1.25rem;
}

.post-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--tt-line);
  border-bottom: 2px solid var(--tt-ink);
  font-family: var(--tt-font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tt-ink-soft);
}

.post-header__read {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.post-cover {
  margin: 0 0 2.5rem;
}

.post-cover img {
  width: 100%;
  border: 1px solid var(--tt-line);
}

.post-body {
  font-size: 1.125rem;
  line-height: 1.75;
}

.post-body > p:first-of-type::first-letter {
  float: left;
  font-family: var(--tt-font-display);
  font-size: 3.4em;
  line-height: 0.9;
  padding: 0.05em 0.12em 0 0;
  color: var(--tt-blue);
}

.post-body img {
  border: 1px solid var(--tt-line);
}

/* ---------- "What's your line?" call to action ---------- */

.line-cta {
  margin: 3rem auto 0;
  max-width: 44rem;
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--tt-panel);
  border: 1px solid var(--tt-line);
  border-top: 3px solid var(--tt-blue);
}

.line-cta__title {
  font-family: var(--tt-font-display);
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.line-cta__text {
  margin: 0 auto 1.5rem;
  max-width: 30rem;
  color: var(--tt-ink-soft);
}

.post .tally-rule + .line-cta {
  margin-top: 0;
}

/* ---------- Older / newer ---------- */

.post-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.post-pager__link {
  display: block;
  padding: 1rem 1.25rem;
  border: 1px solid var(--tt-line);
  background: var(--tt-panel);
  color: var(--tt-ink);
  text-decoration: none;
}

.post-pager__link:hover {
  border-color: var(--tt-blue);
  color: var(--tt-ink);
}

.post-pager__link--next {
  grid-column: 2;
  text-align: right;
}

.post-pager__dir {
  display: block;
  font-family: var(--tt-font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--tt-blue);
  margin-bottom: 0.25rem;
}

.post-pager__title {
  font-family: var(--tt-font-heading);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 1.05rem;
}

@media (max-width: 575.98px) {
  .post-pager {
    grid-template-columns: 1fr;
  }

  .post-pager__link--next {
    grid-column: 1;
  }

  .section-head .tally-rule {
    display: none;
  }

  .section-head {
    justify-content: space-between;
  }
}

/* Blog headings set their own borders and spacing (overrides the docs-style main h2/h3 rules) */
.section-head__title,
.year-group__year,
.post-card__title {
  border-bottom: 0;
  padding-bottom: 0;
  margin-top: 0;
}

.post-card__title,
.post-card__title a {
  color: var(--tt-ink);
}

/* Resources: one link per format */
.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

/* Keep each format link clickable above the card's full-card title link */
.resource-links a {
  position: relative;
  z-index: 1;
}
