/* The Fenbendazole — Minimalist Editorial Theme */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap');

:root {
  --paper: #f7f3ec;
  --paper-2: #efe7db;
  --card: #fffdf9;
  --ink: #2a2320;
  --body: #4a423c;
  --muted: #8a7f75;
  --terra: #c26b3a;
  --terra-deep: #a3562c;
  --gold: #d99a4e;
  --oxblood: #8a3a2e;
  --forest: #4b6b4a;
  --line: rgba(42, 35, 32, 0.12);
  --line-2: rgba(42, 35, 32, 0.07);
  --shadow: 0 18px 48px -22px rgba(60, 40, 25, 0.35), 0 4px 14px -8px rgba(60, 40, 25, 0.2);
  --shadow-sm: 0 8px 24px -16px rgba(60, 40, 25, 0.4);
  --sans: 'Geist', system-ui, sans-serif;
  --wrap: 1180px;
  --measure: 38rem;
}

[data-theme="dark"] {
  --paper: #191512;
  --paper-2: #211b16;
  --card: #221c17;
  --ink: #f4ece1;
  --body: #d3c7ba;
  --muted: #9b8c7c;
  --line: rgba(244, 236, 225, 0.14);
  --line-2: rgba(244, 236, 225, 0.07);
  --terra: #e08a52;
  --terra-deep: #e8a066;
  --gold: #e6b56a;
  --shadow: 0 20px 50px -22px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 8px 24px -16px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--body);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terra-deep);
}

.sans {
  font-family: var(--sans);
}

/* ============ LAYOUT ============ */
.shell {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 40px);
}

.home-grid {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 0;
}

/* ============ SIDEBAR ============ */
.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  border-right: 1px solid var(--line);
  padding: 30px 26px 30px 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  overflow: auto;
}

.side .logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.side .logo img {
  max-width: 100%;
  height: auto;
}

.side nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side nav a {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--body);
  padding: 9px 12px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 11px;
  transition: 0.18s;
}

.side nav a .i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--line);
  transition: 0.18s;
}

.side nav a:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.side nav a.active {
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 600;
}

.side nav a.active .i,
.side nav a:hover .i {
  background: var(--terra);
}

.side .lbl {
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 12px;
}

.side .tags {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.side .tags a {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 8px;
}

.side .tags a:hover {
  color: var(--terra-deep);
  background: var(--paper-2);
}

.side .foot {
  margin-top: auto;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.5;
}

.side .soc {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.side .soc a {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  color: var(--body);
  font-size: 0.8rem;
}

/* ============ MAIN ============ */
.main {
  padding: 34px 0 60px 42px;
  min-width: 0;
}

/* ============ HERO MASTHEAD ============ */
.hero {
  position: relative;
  background: linear-gradient(150deg, var(--paper-2), var(--card));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 42px 44px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero:before {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(217, 154, 78, 0.4), rgba(194, 107, 58, 0.05) 70%);
  filter: blur(6px);
}

.hero .in {
  position: relative;
  max-width: 620px;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.3rem);
  font-weight: 600;
  margin: 14px 0 16px;
}

.hero h1 em {
  font-style: italic;
  color: var(--terra-deep);
}

.hero p {
  font-size: 1.08rem;
  color: var(--body);
  max-width: 520px;
}

.hero .stats {
  display: flex;
  gap: 36px;
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.hero .stats .n {
  font-family: var(--sans);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--terra-deep);
  line-height: 1;
}

.hero .stats .t {
  font-family: var(--sans);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 6px;
}

/* ============ CARDS ============ */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 30px 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: 0.22s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: transparent;
}

.card .ph {
  aspect-ratio: 16/10;
  background: linear-gradient(160deg, #4a3527, #2c211a);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

.card .ph.g2 {
  background: linear-gradient(160deg, #6a4028, #3a2b22);
}

.card .ph.g3 {
  background: linear-gradient(160deg, #7a5233, #43301f);
}

.card .ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.card .ph .tag {
  position: absolute;
  top: 13px;
  left: 13px;
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 5px 11px;
  border-radius: 999px;
  backdrop-filter: blur(3px);
  z-index: 10;
}

.card .ph .rt {
  position: absolute;
  bottom: 13px;
  right: 13px;
  font-family: var(--sans);
  font-size: 0.68rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 10;
}

.card .b {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card .b h3 {
  font-size: 1.22rem;
  font-weight: 600;
  margin-bottom: 9px;
}

.card .b p {
  font-family: var(--sans);
  font-size: 0.93rem;
  color: var(--body);
  flex: 1;
}

.card .b .meta {
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}

.card .b .meta .av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(var(--terra), var(--gold));
}

/* ============ SECTION HEAD ============ */
.shead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 44px 0 20px;
}

.shead h2 {
  font-size: 1.6rem;
  position: relative;
  padding-left: 16px;
}

.shead h2:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 5px;
  border-radius: 3px;
  background: linear-gradient(var(--terra), var(--gold));
}

.shead a {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--terra-deep);
}

/* ============ ARTICLE VIEW ============ */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--terra), var(--gold));
  z-index: 900;
  transition: width 0.1s;
}

.art-top {
  max-width: 760px;
  margin: 0 auto;
  padding: 44px 24px 0;
  text-align: center;
}

.art-top .crumb {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 22px;
}

.art-top .crumb a {
  color: var(--terra-deep);
  font-weight: 600;
}

.art-top h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 600;
  margin: 14px 0 18px;
  letter-spacing: -0.02em;
}

.art-top .dek {
  font-family: var(--sans);
  font-size: 1.24rem;
  color: var(--body);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.55;
}

.byline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 28px 0 6px;
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.byline .av {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(var(--terra), var(--gold));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-family: var(--sans);
  object-fit: cover;
}

.byline b {
  color: var(--ink);
  font-weight: 600;
}

.byline .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
}

.art-hero {
  max-width: 1000px;
  margin: 34px auto 0;
  padding: 0 24px;
}

.art-hero .img {
  aspect-ratio: 2/1;
  border-radius: 20px;
  background: linear-gradient(155deg, #3a2b22 0%, #6a4028 55%, #8a5a32 100%);
  position: relative;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.art-hero .img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-hero .cap {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  margin-top: 12px;
  font-style: italic;
}

.art-wrap {
  max-width: 1000px;
  margin: 44px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 52px;
  align-items: start;
}

.art-body {
  min-width: 0;
  max-width: var(--measure);
  margin: 0 auto;
}

.art-body p {
  margin: 0 0 22px;
}

.art-body h2 {
  font-size: 1.75rem;
  margin: 44px 0 16px;
  padding-top: 8px;
  position: relative;
}

.art-body h2 .num {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--terra);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 6px;
}

.art-body h3 {
  font-size: 1.28rem;
  margin: 30px 0 12px;
}

.art-body a {
  color: var(--terra-deep);
  font-weight: 600;
  text-decoration: none;
}

.art-body sup a {
  color: var(--terra-deep);
  font-family: var(--sans);
  font-size: 0.7em;
  font-weight: 700;
  text-decoration: none;
}

/* ============ CALLOUTS ============ */
.kt {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--terra);
  border-radius: 14px;
  padding: 24px 26px;
  margin: 26px 0;
  box-shadow: var(--shadow-sm);
}

.kt .h {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terra-deep);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kt p {
  margin: 0;
  font-size: 1.02rem;
  color: var(--ink);
}

.warn {
  background: linear-gradient(160deg, rgba(138, 58, 46, 0.08), rgba(138, 58, 46, 0.03));
  border: 1px solid rgba(138, 58, 46, 0.25);
  border-left: 5px solid var(--oxblood);
  border-radius: 14px;
  padding: 22px 26px;
  margin: 28px 0;
}

.warn .h {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--oxblood);
  font-size: 0.95rem;
  margin-bottom: 8px;
  display: flex;
  gap: 9px;
  align-items: center;
}

.warn p {
  margin: 0;
  font-size: 0.98rem;
}

.pquote {
  margin: 34px 0;
  padding: 6px 0 6px 28px;
  border-left: 4px solid var(--gold);
  font-family: var(--sans);
  font-size: 1.32rem;
  line-height: 1.4;
  color: var(--ink);
  font-weight: 500;
}

.pquote cite {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-top: 12px;
}

/* ============ TABLE ============ */
.tbl {
  margin: 30px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.tbl table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.88rem;
}

.tbl caption {
  caption-side: top;
  text-align: left;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 18px 0;
}

.tbl th {
  background: var(--ink);
  color: var(--paper);
  text-align: left;
  padding: 13px 16px;
  font-weight: 600;
}

.tbl td {
  padding: 13px 16px;
  border-top: 1px solid var(--line-2);
  color: var(--body);
}

.tbl tbody tr:nth-child(even) td {
  background: var(--paper-2);
}

.tbl .good {
  color: var(--forest);
  font-weight: 600;
}

.tbl .bad {
  color: var(--oxblood);
  font-weight: 600;
}

/* ============ STICKY TOC ============ */
.toc {
  position: sticky;
  top: 20px;
  align-self: start;
  font-family: var(--sans);
}

.toc .h {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.toc a {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 7px 0 7px 14px;
  border-left: 2px solid var(--line);
  transition: 0.18s;
  line-height: 1.35;
}

.toc a:hover {
  color: var(--ink);
}

.toc a.active {
  color: var(--terra-deep);
  border-left-color: var(--terra);
  font-weight: 600;
}

/* ============ FOOTER ============ */
footer {
  margin-top: 70px;
  border-top: 1px solid var(--line);
  padding: 34px 0;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* ============ KOENIG EDITOR CARDS ============ */
.kg-width-wide {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.kg-width-full {
  max-width: 100%;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.kg-card {
  margin: 28px 0;
}

.kg-image {
  max-width: 100%;
  height: auto;
}

.kg-bookmark-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  gap: 16px;
  text-decoration: none;
  transition: 0.2s;
}

.kg-bookmark-card:hover {
  box-shadow: var(--shadow-sm);
}

.kg-bookmark-content {
  flex: 1;
}

.kg-bookmark-title {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.kg-bookmark-description {
  font-size: 0.9rem;
  color: var(--body);
  margin-bottom: 8px;
}

.kg-bookmark-metadata {
  font-size: 0.8rem;
  color: var(--muted);
}

.kg-bookmark-thumbnail {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1000px) {
  .home-grid {
    grid-template-columns: 1fr;
  }

  .side {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
  }

  .side .lbl,
  .side .tags,
  .side .foot {
    display: none;
  }

  .side nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .main {
    padding: 26px 0 50px;
  }

  .art-wrap {
    grid-template-columns: 1fr;
  }

  .toc {
    display: none;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 17px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 30px 26px;
  }

  .hero .stats {
    gap: 22px;
  }
}
