.article-detail-page {
  width: min(1360px, 95%);
  max-width: none;
}

.article-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.72fr);
  gap: 26px;
  align-items: start;
}

.article-detail-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d8e6da;
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(13, 33, 20, 0.08);
  padding: 26px;
}

.article-detail-cover {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid #d8e6da;
  margin-bottom: 24px;
}

.article-detail-cover img {
  width: 100%;
  height: 340px;
  display: block;
  object-fit: cover;
}

.article-detail-title {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1.06;
}

.article-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.article-detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid #d2e3d3;
  background: #f7fbf5;
  padding: 0.42rem 0.78rem;
  color: #2f5e44;
  font-size: 0.86rem;
  font-weight: 700;
}

.article-detail-lede {
  max-width: 86%;
  margin: 0 0 16px;
  color: #4b6556;
  font-size: 1.03rem;
  line-height: 1.72;
}

.article-detail-heading {
  margin: 36px 0 16px;
  font-family: var(--font-serif);
  font-size: 1.26rem;
  line-height: 1.15;
}

.article-detail-copy {
  margin: 0 0 16px;
  color: #4b6556;
  line-height: 1.72;
}

.article-detail-grid {
  display: grid;
  gap: 22px;
  margin: 28px 0 38px;
}

.article-detail-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #d8e6da;
  border-radius: 20px;
  padding: 24px 26px;
  background: #f8fcf8;
  color: #345b47;
}

.article-detail-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: #9dd2ac;
}

.article-detail-card--worldgen {
  background: linear-gradient(180deg, #f2fbf4 0%, #f9fdf9 100%);
  border-color: #cfe7d5;
}

.article-detail-card--cultures {
  background: linear-gradient(180deg, #f1fbf8 0%, #f8fdfb 100%);
  border-color: #cfe7df;
}

.article-detail-card--horticulture {
  background: linear-gradient(180deg, #f2f9ff 0%, #f9fcff 100%);
  border-color: #d4e3ef;
}

.article-detail-card--cuisine {
  background: linear-gradient(180deg, #fff9ef 0%, #fffdf8 100%);
  border-color: #f1e1bf;
}

.article-detail-card--fermentation {
  background: linear-gradient(180deg, #fff4f8 0%, #fffafd 100%);
  border-color: #efd7e2;
}

.article-detail-card--survie {
  background: linear-gradient(180deg, #fff5f2 0%, #fffaf9 100%);
  border-color: #efd8d0;
}

.article-detail-card--integration {
  background: linear-gradient(180deg, #f4f8ff 0%, #fafdff 100%);
  border-color: #d8e1f1;
}

.article-detail-card--compat {
  background: linear-gradient(180deg, #f9f7ff 0%, #fcfbff 100%);
  border-color: #ddd8f0;
}

.article-detail-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.15;
  color: #1b472f;
}

.article-detail-card-index {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(18, 58, 35, 0.08);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  flex: none;
}

.article-detail-list {
  margin: 0;
  padding-left: 1.35rem;
  display: grid;
  gap: 13px;
}

.article-detail-list li {
  line-height: 1.72;
}

.article-detail-list strong {
  color: #1b472f;
}

.article-detail-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 14px;
}

.article-detail-summary-card {
  min-height: 150px;
  border: 1px solid #d8e6da;
  border-radius: 18px;
  background: #f8fcf8;
  padding: 20px 22px;
  color: #345b47;
}

.article-detail-summary-card strong {
  display: block;
  margin-bottom: 8px;
  color: #1b472f;
  font-size: 1rem;
}

.article-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-self: start;
  position: relative;
}

.article-detail-actions-spacer {
  display: none;
}

.article-detail-actions-spacer.is-active {
  display: block;
}

.article-detail-actions {
  position: relative;
  z-index: 3;
}

.article-detail-actions.is-fixed {
  position: fixed;
  top: 108px;
  width: min(100%, 360px);
  left: 0;
}

.article-detail-button-list {
  display: grid;
  gap: 12px;
}

.article-detail-button {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  border-radius: 14px;
  padding: 0.95rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid transparent;
  box-shadow: 0 8px 18px rgba(17, 49, 29, 0.08);
}

.article-detail-button--main {
  background: var(--accent);
  color: #fff;
}

.article-detail-button--main:hover {
  background: var(--accent-strong);
}

.article-detail-button--alt {
  background: #eef7ef;
  color: #2a6039;
  border-color: #d3e6d6;
}

.article-detail-kicker {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #2f6e46;
  font-size: 0.76rem;
  font-weight: 700;
}

.article-detail-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.article-detail-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #d8e6da;
  cursor: zoom-in;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.article-detail-gallery img:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(17, 49, 29, 0.12);
}

.article-detail-tech {
  border-color: #bddcc5;
  background: linear-gradient(180deg, #f5fbf6 0%, #edf8ef 100%);
}

.article-detail-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid #b9dabc;
  background: #fff;
  box-shadow: 0 8px 18px rgba(28, 95, 56, 0.08);
}

.article-detail-table th,
.article-detail-table td {
  padding: 0.78rem 0.84rem;
  border-bottom: 1px solid #e2ece3;
  text-align: left;
  vertical-align: top;
}

.article-detail-table th {
  background: linear-gradient(180deg, #dff2e3 0%, #d2eac8 100%);
  color: #1c4d31;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.article-detail-table tr:last-child td {
  border-bottom: 0;
}

.article-detail-table td:first-child {
  width: 40%;
  font-weight: 700;
  color: #24543b;
  background: rgba(216, 240, 219, 0.4);
}

.article-detail-note {
  margin: 0;
  color: #456150;
  line-height: 1.7;
}

.article-detail-lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(10, 18, 12, 0.78);
  backdrop-filter: blur(6px);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.26s ease, visibility 0.26s ease;
}

.article-detail-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.article-detail-lightbox-dialog {
  position: relative;
  width: min(1100px, 100%);
  max-height: 92vh;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(233, 244, 234, 0.9);
  background: #f6fbf5;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.28);
  transform: translateY(18px) scale(0.985);
  transition: transform 0.28s ease;
}

.article-detail-lightbox.is-open .article-detail-lightbox-dialog {
  transform: translateY(0) scale(1);
}

.article-detail-lightbox-image {
  display: block;
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  background: linear-gradient(180deg, #edf5eb 0%, #f7fbf6 100%);
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.article-detail-lightbox-image.is-switching {
  opacity: 0.18;
  transform: scale(0.985);
}

.article-detail-lightbox-close,
.article-detail-lightbox-nav {
  position: absolute;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 35, 21, 0.72);
  color: #fff;
  cursor: pointer;
  z-index: 3;
}

.article-detail-lightbox-close {
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
}

.article-detail-lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
}

.article-detail-lightbox-prev {
  left: 18px;
}

.article-detail-lightbox-next {
  right: 18px;
}

body.theme-dark .article-detail-panel {
  background: rgba(19, 38, 29, 0.94);
  border-color: var(--line);
  box-shadow: none;
}

body.theme-dark .article-detail-cover,
body.theme-dark .article-detail-gallery img,
body.theme-dark .article-detail-table,
body.theme-dark .article-detail-summary-card,
body.theme-dark .article-detail-card,
body.theme-dark .article-detail-button--alt {
  border-color: var(--line);
  box-shadow: none;
}

body.theme-dark .article-detail-card,
body.theme-dark .article-detail-summary-card,
body.theme-dark .article-detail-button--alt,
body.theme-dark .article-detail-table,
body.theme-dark .article-detail-lightbox-dialog {
  background: var(--surface-strong);
}

body.theme-dark .article-detail-tech {
  background: linear-gradient(180deg, #162f22 0%, #13271d 100%);
}

body.theme-dark .article-detail-table th {
  background: #1a3627;
  color: #b9ddc5;
  border-color: var(--line);
}

body.theme-dark .article-detail-table td,
body.theme-dark .article-detail-table td:first-child {
  color: #d5e7db;
  background: transparent;
  border-color: var(--line);
}

body.theme-dark .article-detail-chip,
body.theme-dark .article-detail-card-index {
  background: var(--surface-strong);
  border-color: var(--line);
  color: #b5e1c4;
}

body.theme-dark .article-detail-title,
body.theme-dark .article-detail-heading,
body.theme-dark .article-detail-card-title,
body.theme-dark .article-detail-list strong,
body.theme-dark .article-detail-summary-card strong {
  color: #edf7f0;
}

body.theme-dark .article-detail-copy,
body.theme-dark .article-detail-lede,
body.theme-dark .article-detail-list,
body.theme-dark .article-detail-note,
body.theme-dark .article-detail-summary-card {
  color: #c6dbcd;
}

@media (max-width: 1100px) {
  .article-detail-layout {
    grid-template-columns: 1fr;
  }

  .article-detail-lede {
    max-width: 100%;
  }

  .article-detail-actions,
  .article-detail-actions.is-fixed {
    position: static;
    top: auto;
    width: 100%;
  }

  .article-detail-actions-spacer {
    display: none !important;
  }
}

@media (max-width: 780px) {
  .article-detail-page {
    width: min(94%, 100%);
  }

  .article-detail-panel {
    padding: 20px;
  }

  .article-detail-summary {
    grid-template-columns: 1fr;
  }

  .article-detail-cover img {
    height: 260px;
  }
}

@media (max-width: 640px) {
  .article-detail-gallery {
    grid-template-columns: 1fr;
  }

  .article-detail-lightbox {
    padding: 16px;
  }

  .article-detail-lightbox-nav {
    width: 44px;
    height: 44px;
  }

  .article-detail-lightbox-prev {
    left: 12px;
  }

  .article-detail-lightbox-next {
    right: 12px;
  }
}
