/* ============================================================
   TERRY CABEEN — styles.css
   Single file. No imports. No framework.

   PALETTE:
   --yellow:      #EEFF00  electric yellow-green (CTA, slab, featured accent)
   --lilac:       #9B6FCC  rich lilac (nav, links, section labels, standard accent)
   --cream:       #F5F0E8  warm cream (page bg, card bg)
   --ink:         #1C1C18  warm near-black (body text, headings)
   --violet:      #2E2040  deep violet (footer)

   RULES:
   - #EEFF00 is never used as text on light backgrounds (fails contrast)
   - CTA button text is always #1C1C18 (not white)
   - Dark mode is intentionally not implemented
   - The grid is the skeleton; nobody should see it
   ============================================================ */

/* ============================================================
   CUSTOM PROPERTIES
   ============================================================ */
:root {
  --yellow:  #EEFF00;
  --lilac:   #9B6FCC;
  --cream:   #F5F0E8;
  --ink:     #1C1C18;
  --violet:  #2E2040;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --content-width: 700px;
  --side-pad: 2.5rem;

  /* Vertical slab dimensions — adjust here if tweaking the hero accent */
  --slab-width: 1.2rem;
  --slab-height: 14rem;  /* visual bottom ends in heading area, above the CTA button */
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background-color: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: clip; /* prevents left-bleeding rule from adding a scrollbar */
}

a {
  color: var(--lilac);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.section__inner,
.site-header__inner,
.site-footer__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--side-pad);
}

/* ============================================================
   HEADER
   The yellow slab lives on .hero, not the header.
   The header sits above it via z-index so nav is always readable.
   ============================================================ */
.site-header {
  position: relative;
  z-index: 10;
  padding: 1.25rem 0;
  background: transparent;
}

/* Vertical electric yellow slab — right side weight anchor. */
.site-header::before {
  content: '';
  position: absolute;
  top: 0rem;
  /* sits just inside the right edge of the content container */
  left: calc(50% + (var(--content-width) / 2) - var(--slab-width) - 2.5rem);
  width: var(--slab-width);
  height: var(--slab-height);
  background: var(--yellow);
  pointer-events: none;
  z-index: -100;
}

.site-header__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
}

.site-header__name-wrap {
  position: relative;
  flex-shrink: 0;
}

.site-name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  display: block;
  padding-bottom: 0.2rem;
}

.site-name:hover {
  text-decoration: none;
  color: var(--ink);
}

/* Horizontal yellow rule — bleeds off left edge of viewport.
   Anchored to the right edge of the site name, extends leftward. */
.site-name__rule {
  position: absolute;
  bottom: -3px;
  right: 0;
  height: 3px;
  width: calc(100% + 100vw); /* bleeds left indefinitely */
  background: var(--yellow);
  pointer-events: none;
}

/* ============================================================
   NAV
   ============================================================ */
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.site-nav__link {
  font-size: 0.8125rem;
  color: rgba(28, 28, 24, 0.5);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: var(--lilac);
  text-decoration: none;
}

/* ============================================================
   HERO
   The vertical yellow slab is a ::before pseudo on .hero.
   It bleeds from the top of the section down the right side.
   ============================================================ */
.hero {
  position: relative;
  padding: 4rem 0 3rem;
  /* overflow intentionally not hidden — slab ascends behind the transparent nav */
}

.hero__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--side-pad);
  position: relative;
  z-index: 1;
}

/* Two-line poster heading */
.hero__heading {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0;
  line-height: 1.05;
}

.hero__heading-line {
  display: block;
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.hero__heading-line--primary {
  color: var(--ink);
}

/* Second line — lilac, indented slightly for intentional tension */
.hero__heading-line--secondary {
  color: var(--lilac);
  padding-left: 1.5rem;
}

/* Horizontal yellow rule — bleeds off LEFT edge */
.hero__rule {
  height: 4px;
  background: var(--yellow);
  margin: 1.5rem 0 1.75rem;
  /* Bleeds off the left edge, stops before the slab on the right */
  margin-left: calc(-1 * var(--side-pad));
  width: 55%;
}

.hero__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero__bio {
  font-size: 0.875rem;
  color: rgba(28, 28, 24, 0.65);
  line-height: 1.7;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  text-decoration: none;
}

/* Primary CTA — electric yellow bg, ink text */
.btn--primary {
  background: var(--yellow);
  color: var(--ink);
}

/* ============================================================
   SECTION SHARED
   ============================================================ */
.section {
  padding: 3.5rem 0;
  border-top: 1px solid rgba(28, 28, 24, 0.08);
}

/* Section label — small caps, lilac, letter-spaced */
.section-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--lilac);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.section__footer {
  margin-top: 2rem;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  position: relative;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
}

.card__accent {
  width: 6px;
  flex-shrink: 0;
  border-radius: 3px 0 0 3px;
}

.card__accent--yellow { background: var(--yellow); }
.card__accent--lilac  { background: var(--lilac); }

.card__content {
  padding: 1.375rem 1.375rem 1.375rem 1.125rem;
  flex: 1;
}

.card__eyebrow {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--lilac);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.card__title {
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

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

.card__title a:hover {
  color: var(--lilac);
  text-decoration: none;
}

.card__excerpt {
  font-size: 0.8125rem;
  color: rgba(28, 28, 24, 0.6);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.card__meta {
  font-size: 0.75rem;
  color: rgba(28, 28, 24, 0.45);
  margin-bottom: 1rem;
}

.card__read-link {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--lilac);
  text-decoration: none;
}

.card__read-link:hover {
  text-decoration: underline;
}

/* Featured card — full width */
.card--featured {
  margin-bottom: 1.25rem;
}

.card--featured .card__title {
  font-size: 1.125rem;
}

/* Card row — asymmetric two-up layout (the Still move) */
.card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start; /* allows cards to be different heights */
}

/* Second card in the row floats lower — intentional misalignment */
.card--offset {
  margin-top: 1.75rem;
}

/* ============================================================
   SUBTLE LINK
   ============================================================ */
.link-subtle {
  font-size: 0.8125rem;
  color: rgba(28, 28, 24, 0.45);
  text-decoration: none;
}

.link-subtle:hover {
  color: var(--lilac);
  text-decoration: none;
}

/* ============================================================
   WORK WITH ME SECTION
   ============================================================ */
.work-with-me__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  flex-wrap: wrap;
}

.work-with-me__heading {
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 0.5rem 0 0.75rem;
  color: var(--ink);
}

.work-with-me__sub {
  font-size: 0.8125rem;
  color: rgba(28, 28, 24, 0.6);
  line-height: 1.7;
}

.work-with-me__cta {
  flex-shrink: 0;
}

/* ============================================================
   WRITING INDEX PAGE
   ============================================================ */
.writing-index {
  padding: 3rem 0;
}

.writing-index__header {
  margin-bottom: 2.5rem;
}

.writing-index__title {
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.tag-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag-filter__item {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  background: rgba(28, 28, 24, 0.06);
  color: rgba(28, 28, 24, 0.55);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.tag-filter__item:hover,
.tag-filter__item.is-active {
  background: var(--lilac);
  color: #fff;
  text-decoration: none;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ============================================================
   POST PAGE
   ============================================================ */
.post {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3rem var(--side-pad);
}

.post__header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(28, 28, 24, 0.08);
}

.post__meta {
  font-size: 0.75rem;
  color: rgba(28, 28, 24, 0.45);
  margin-bottom: 0.75rem;
}

.post__meta-sep {
  margin: 0 0.4rem;
}

.post__tags {
  display: inline;
}

.post__tag {
  color: var(--lilac);
  text-decoration: none;
}

.post__tag:hover {
  text-decoration: underline;
}

.post__title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.post__excerpt {
  font-size: 1rem;
  color: rgba(28, 28, 24, 0.6);
  line-height: 1.6;
}

/* Post body typography */
.post__body {
  font-size: 1rem;
  line-height: 1.75;
  max-width: 65ch;
}

.post__body h2 {
  font-size: 1.375rem;
  font-weight: 500;
  margin: 2.5rem 0 0.75rem;
}

.post__body h3 {
  font-size: 1.125rem;
  font-weight: 500;
  margin: 2rem 0 0.5rem;
}

.post__body p {
  margin-bottom: 1.25rem;
}

.post__body a {
  color: var(--lilac);
}

.post__body ul,
.post__body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.post__body li {
  margin-bottom: 0.4rem;
}

.post__body pre,
.post__body code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.875em;
  background: rgba(28, 28, 24, 0.05);
  border-radius: 4px;
}

.post__body pre {
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.post__body code {
  padding: 0.1em 0.35em;
}

.post__body pre code {
  background: none;
  padding: 0;
}

.post__body blockquote {
  border-left: 4px solid var(--lilac);
  padding-left: 1.25rem;
  color: rgba(28, 28, 24, 0.7);
  margin: 1.5rem 0;
}

/* Post body — tables */
.post__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.post__body th,
.post__body td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(28, 28, 24, 0.1);
}

.post__body th {
  font-weight: 500;
  color: var(--lilac);
  border-bottom: 2px solid rgba(28, 28, 24, 0.14);
}

.post__body tr:last-child td {
  border-bottom: none;
}

.post__footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(28, 28, 24, 0.08);
}

.post__back {
  font-size: 0.8125rem;
  color: rgba(28, 28, 24, 0.45);
  text-decoration: none;
}

.post__back:hover {
  color: var(--lilac);
  text-decoration: none;
}

/* ============================================================
   IMAGES
   ============================================================ */

.img-figure {
  display: block;
  margin: 1.75rem 0;
}

.img-figure img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

figcaption {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: rgba(28, 28, 24, 0.45); /* matches .post__meta, .card__meta */
  font-style: italic;
  line-height: 1.5;
}

/* Float alignment — figures */
.img-figure.img-left {
  float: left;
  margin: 0.25rem 2rem 1rem 0;
  max-width: 45%;
}

.img-figure.img-right {
  float: right;
  margin: 0.25rem 0 1rem 2rem;
  max-width: 45%;
}

.img-figure.img-center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  max-width: 100%;
}

/* Float alignment — bare <img> (no caption) */
img.img-left {
  float: left;
  margin: 0.25rem 2rem 1rem 0;
  max-width: 45%;
  border-radius: 6px;
}

img.img-right {
  float: right;
  margin: 0.25rem 0 1rem 2rem;
  max-width: 45%;
  border-radius: 6px;
}

img.img-center {
  margin: 1.75rem auto;
  max-width: 100%;
  border-radius: 6px;
}

/* Clear floats so subsequent prose isn't disrupted */
.img-figure::after {
  content: "";
  display: block;
  clear: both;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--violet);
  padding: 1.25rem 0;
  margin-top: 5rem;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.site-footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-footer__sub {
  font-size: 0.8rem;
  color: var(--cream);
}

.site-footer__copy {
  font-size: 0.8rem;
  color: var(--cream);
}

.site-footer__link {
  font-size: 0.8rem;
  color: var(--lilac);
  text-decoration: none;
}

.site-footer__link:hover {
  text-decoration: underline;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  :root {
    --side-pad: 1.25rem;
    --slab-right: 1rem;
    --slab-height: 260px;
  }

  .site-header::before {
    right: 3rem;
  }

  .site-header__inner {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .site-nav {
    gap: 1.25rem;
  }

  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero__body {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .card-row {
    grid-template-columns: 1fr;
  }

  .card--offset {
    margin-top: 0;
  }

  .work-with-me__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  /* Responsive — collapse floats on small screens */
  @media (max-width: 640px) {
    .img-figure.img-left,
    .img-figure.img-right,
    img.img-left,
    img.img-right {
      float: none;
      margin: 1.25rem 0;
      max-width: 100%;
    }
  }
}
