/* Editorial blog layer built strictly on burgar.dev's "hecho a mano" identity. */

.blog-shell {
  max-width: 1080px;
}

.blog-nav-active {
  text-decoration-line: underline !important;
  text-decoration-color: var(--pink) !important;
  text-decoration-thickness: 2.5px !important;
  text-underline-offset: 5px !important;
}

/* Reading progress strip (editorial red marker at top) */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3.5px;
  background: var(--pink);
  z-index: 100;
  transition: width 0.08s linear;
}

/* Blog index header */
.blog-hero {
  padding: 58px 0 42px;
  max-width: 780px;
}

.blog-hero h1 {
  font-size: clamp(42px, 6vw, 66px);
  line-height: 1.05;
  letter-spacing: -2px;
  margin: 14px 0 18px;
}

.blog-hero .lead {
  font-size: 20px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 640px;
}

.blog-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  margin-top: 22px;
  font-size: 14px;
  color: var(--muted);
}

.blog-meta-bar a {
  color: var(--ink);
  font-weight: 800;
  text-decoration-line: underline;
  text-decoration-color: var(--pink);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* Featured essay card (taped editorial sheet) */
.essay-featured {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 36px;
  align-items: center;
  background: #fff;
  padding: 34px 36px;
  margin: 12px 0 56px;
  box-shadow: 0 14px 32px #1f24332e;
  transform: rotate(-0.45deg);
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.essay-featured:hover {
  transform: rotate(-0.15deg) translateY(-2px);
  box-shadow: 0 18px 38px #1f24333a;
  color: inherit;
}

.essay-featured::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 50%;
  width: 126px;
  height: 30px;
  margin-left: -63px;
  background: #e9d9a6cc;
  transform: rotate(-3.5deg);
  box-shadow: 0 1px 3px #0002;
  z-index: 2;
}

.essay-featured .eyebrow {
  margin-bottom: 10px;
}

.essay-featured h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.1;
  letter-spacing: -1.2px;
  font-weight: 900;
  color: var(--ink);
  margin: 0 0 14px;
}

.essay-featured p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 18px;
}

.essay-featured .essay-date {
  font-family: "Special Elite", ui-monospace, monospace;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
  display: block;
}

.essay-featured-media {
  position: relative;
  background: #fafaf8;
  border: 6px solid #fff;
  box-shadow: 0 8px 20px #1f243324;
  transform: rotate(1.1deg);
  overflow: hidden;
}

.essay-featured-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

/* Blog sections */
.blog-section {
  padding: 42px 0;
  border-top: 3px solid var(--ink);
}

.blog-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.blog-section-head h2 {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.6px;
  color: var(--ink);
}

.blog-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.blog-card {
  background: #fff;
  padding: 26px 28px;
  box-shadow: 0 8px 20px #1f243322;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.blog-card:nth-child(odd) {
  transform: rotate(-0.6deg);
}

.blog-card:nth-child(even) {
  transform: rotate(0.65deg);
}

.blog-card:hover {
  transform: rotate(0deg) translateY(-2px);
  box-shadow: 0 12px 26px #1f24332e;
  color: inherit;
}

.blog-card .card-kicker {
  font-family: "Special Elite", ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.blog-card h3 {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -0.4px;
  color: var(--ink);
  margin: 0 0 10px;
}

.blog-card p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 18px;
}

/* External archive list (Dev.to & older posts) */
.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.archive-item {
  border-bottom: 1.5px solid #14161d24;
}

.archive-item:first-child {
  border-top: 1.5px solid #14161d24;
}

.archive-link {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  gap: 8px 24px;
  align-items: baseline;
  padding: 18px 6px;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.12s ease;
}

.archive-link:hover {
  background: #ffffff90;
  color: var(--ink);
}

.archive-link:hover .archive-title {
  text-decoration: underline;
  text-decoration-color: var(--pink);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.archive-date {
  font-family: "Special Elite", ui-monospace, monospace;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.archive-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.archive-title {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--ink);
}

.archive-desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.archive-source {
  font-family: "Special Elite", ui-monospace, monospace;
  font-size: 12px;
  color: var(--pink);
  white-space: nowrap;
  font-weight: 700;
}

/* ================================
   LONG-FORM ESSAY READING EXPERIENCE
   ================================ */
.essay-page {
  max-width: 740px;
  margin: 54px auto 80px;
}

.essay-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--pink);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  margin-bottom: 26px;
}

.essay-header {
  margin-bottom: 34px;
}

.essay-header .eyebrow {
  margin-bottom: 10px;
}

.essay-header h1 {
  font-size: clamp(36px, 5.4vw, 56px);
  line-height: 1.06;
  letter-spacing: -1.8px;
  margin: 8px 0 18px;
  color: var(--ink);
}

.essay-subtitle {
  font-size: clamp(19px, 2.3vw, 22px);
  line-height: 1.55;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 22px;
}

.essay-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1.5px solid #14161d2e;
  font-family: "Special Elite", ui-monospace, monospace;
  font-size: 13px;
  color: var(--muted);
}

.essay-byline strong {
  color: var(--ink);
  font-family: var(--font);
  font-weight: 800;
  font-size: 14px;
}

.essay-byline .byline-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px #0003;
}

/* Essay body typography */
.essay-content {
  font-size: 19px;
  line-height: 1.82;
  color: #1f2430;
}

.essay-content > p {
  margin: 22px 0;
}

.essay-content p strong {
  color: var(--ink);
  font-weight: 800;
}

.essay-content h2 {
  font-size: clamp(25px, 3.2vw, 31px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.7px;
  color: var(--ink);
  margin: 56px 0 18px;
  padding-top: 14px;
  border-top: 2px solid #14161d1c;
}

.essay-content h2 .sec-num {
  font-family: var(--hand);
  font-size: 28px;
  color: var(--pink);
  margin-right: 8px;
  font-weight: 700;
}

.essay-content a {
  color: var(--ink);
  font-weight: 700;
  text-decoration-line: underline;
  text-decoration-color: var(--pink);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.essay-content a:hover {
  color: var(--pink);
}

.essay-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em;
  background: #14161d10;
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--ink);
}

/* Pull quote (handmade paper note with red marker left bar) */
.essay-quote {
  position: relative;
  margin: 34px 0;
  padding: 24px 28px;
  background: #fff;
  border-left: 5px solid var(--pink);
  box-shadow: 0 10px 24px #1f24331f;
  transform: rotate(-0.45deg);
}

.essay-quote p {
  margin: 0;
  font-size: clamp(20px, 2.5vw, 24px);
  line-height: 1.48;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.essay-quote cite {
  display: block;
  margin-top: 12px;
  font-style: normal;
  font-family: var(--hand);
  font-size: 21px;
  color: var(--pink);
  font-weight: 700;
}

/* Taped editorial illustrations */
.essay-figure {
  position: relative;
  margin: 42px -28px;
  background: #fff;
  padding: 14px 14px 16px;
  box-shadow: 0 14px 32px #1f24332c;
  transform: rotate(0.45deg);
}

.essay-figure.tilt-left {
  transform: rotate(-0.55deg);
}

.essay-figure::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 118px;
  height: 28px;
  margin-left: -59px;
  background: #e9d9a6cc;
  transform: rotate(-3.5deg);
  box-shadow: 0 1px 3px #0002;
  z-index: 2;
}

.essay-figure img {
  width: 100%;
  height: auto;
  display: block;
  background: #fafaf8;
}

.essay-figure figcaption {
  margin-top: 13px;
  font-family: var(--hand);
  font-size: 22px;
  line-height: 1.2;
  text-align: center;
  color: var(--ink);
  font-weight: 700;
}

/* Interactive HTML Exhibit 1: Timeline / Continuity Switcher */
.exhibit {
  position: relative;
  margin: 42px -18px;
  background: #fff;
  border: 2.5px solid var(--ink);
  box-shadow: 7px 7px 0 var(--yellow);
  padding: 26px 28px 28px;
}

.exhibit-kicker {
  font-family: var(--hand);
  font-size: 23px;
  font-weight: 700;
  color: var(--pink);
  margin: 0 0 4px;
  line-height: 1.1;
}

.exhibit-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.4px;
  margin: 0 0 18px;
}

.exhibit-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.exhibit-tab {
  appearance: none;
  background: var(--paper);
  border: 2px solid var(--ink);
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.12s ease;
}

.exhibit-tab:hover {
  transform: translateY(-1px);
}

.exhibit-tab[aria-selected="true"] {
  background: var(--ink);
  color: #fff;
  box-shadow: 3px 3px 0 var(--yellow);
}

.exhibit-panel {
  display: none;
}

.exhibit-panel.is-active {
  display: block;
  animation: fadeSlide 0.2s ease;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.timeline-svg {
  width: 100%;
  height: auto;
  display: block;
  margin: 8px 0 16px;
  background: #fafaf8;
  border: 1.5px solid #14161d22;
  padding: 10px;
}

.exhibit-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.exhibit-stat {
  background: var(--paper);
  padding: 12px 14px;
  border-left: 3px solid var(--ink);
}

.exhibit-stat.is-accent {
  border-left-color: var(--pink);
}

.exhibit-stat-label {
  display: block;
  font-family: "Special Elite", ui-monospace, monospace;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.exhibit-stat-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
}

/* Interactive HTML Exhibit 2: Friction Matrix */
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 15.5px;
}

.matrix-table th {
  text-align: left;
  font-family: "Special Elite", ui-monospace, monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 2.5px solid var(--ink);
}

.matrix-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #14161d1e;
  vertical-align: top;
  line-height: 1.48;
  color: #252b38;
}

.matrix-table td:first-child {
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.badge-comod {
  display: inline-block;
  font-family: "Special Elite", ui-monospace, monospace;
  font-size: 11px;
  padding: 2px 7px;
  background: #14161d12;
  color: var(--muted);
  border-radius: 2px;
}

.badge-vivo {
  display: inline-block;
  font-family: "Special Elite", ui-monospace, monospace;
  font-size: 11px;
  padding: 2px 7px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
  border-radius: 2px;
}

/* Marginal note / footnote box */
.hand-callout {
  background: #fffdf4;
  border: 2px dashed #14161d55;
  padding: 20px 22px;
  margin: 32px 0;
  font-size: 16.5px;
  line-height: 1.65;
  color: #272d3b;
}

.hand-callout .callout-tag {
  font-family: var(--hand);
  font-size: 23px;
  font-weight: 700;
  color: var(--pink);
  display: block;
  margin-bottom: 4px;
}

/* Essay footer / share / related */
.essay-end {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 3px solid var(--ink);
}

.essay-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

.essay-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn-copy {
  appearance: none;
  background: var(--ink);
  color: #fff;
  border: 0;
  padding: 10px 18px;
  font-weight: 800;
  font-size: 14px;
  border-radius: 3px;
  box-shadow: 4px 4px 0 var(--yellow);
  cursor: pointer;
  transform: rotate(-0.8deg);
  transition: transform 0.12s, box-shadow 0.12s;
}

.btn-copy:hover {
  transform: rotate(-0.8deg) translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--yellow);
}

.essay-author-box {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 20px;
  align-items: center;
  background: #fff;
  padding: 22px 24px;
  box-shadow: 0 8px 22px #1f24331f;
  transform: rotate(0.35deg);
  margin-bottom: 34px;
}

.essay-author-box img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 4px 12px #0003;
}

.essay-author-box h3 {
  font-size: 19px;
  font-weight: 900;
  margin: 0 0 6px;
  color: var(--ink);
}

.essay-author-box p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 10px;
}

.essay-author-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 14px;
}

@media (max-width: 820px) {
  .essay-featured {
    grid-template-columns: 1fr;
    padding: 26px 22px;
    gap: 22px;
  }
  .blog-cards-grid {
    grid-template-columns: 1fr;
  }
  .archive-link {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .essay-figure {
    margin: 34px 0;
  }
  .exhibit {
    margin: 34px 0;
    padding: 20px 18px;
  }
  .exhibit-stats {
    grid-template-columns: 1fr;
  }
  .matrix-table td:first-child {
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .essay-page {
    margin: 34px auto 60px;
  }
  .essay-content {
    font-size: 17.5px;
    line-height: 1.76;
  }
  .essay-author-box {
    grid-template-columns: 1fr;
  }
}
