/* VMFit Journal-specific layout and article styles.
   Shared foundations, header, controls and buttons come from:
   https://vmfit.me/assets/styles.css */

.primary-nav a[aria-current="page"] {
  color: var(--green-800);
  background: var(--green-50);
}

.journal-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 10vw, 132px) 0 clamp(88px, 12vw, 152px);
  color: var(--on-image);
  background: linear-gradient(135deg, var(--green-700), var(--green-950));
}

.journal-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.3;
  background-image: url("mountain_valley_1920.webp");
  background-image: -webkit-image-set(
    url("mountain_valley_1920.webp") 1x,
    url("mountain_valley_2560.webp") 1.333x,
    url("mountain_valley_3840.webp") 2x
  );
  background-image: image-set(
    url("mountain_valley_1920.webp") 1x,
    url("mountain_valley_2560.webp") 1.333x,
    url("mountain_valley_3840.webp") 2x
  );
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.journal-hero > .container {
  position: relative;
  z-index: 1;
}

.journal-hero .eyebrow {
  color: #d1ed9e;
}

.journal-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  align-items: end;
  gap: clamp(40px, 8vw, 120px);
}

.journal-hero h1 {
  max-width: 800px;
  margin: 0;
  color: var(--on-image);
  font-size: clamp(3.1rem, 7vw, 6.5rem);
  font-weight: 820;
  letter-spacing: -0.065em;
  line-height: 0.94;
}

.journal-hero-grid > p {
  max-width: 420px;
  margin: 0 0 8px;
  color: var(--on-image-muted);
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.55;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.topic-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 112px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.topic-card:hover {
  border-color: var(--green-500);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.topic-card-title {
  font-size: 1.1rem;
  font-weight: 760;
  line-height: 1.2;
}

.topic-card-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.featured-wrap {
  position: relative;
  z-index: 2;
  margin-top: -64px;
}

.featured-article {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  overflow: hidden;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.featured-image {
  min-height: 440px;
  background: var(--surface-container);
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 5vw, 68px);
}

.featured-label {
  align-self: flex-start;
  margin-bottom: 24px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--green-200);
  color: var(--green-700);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.featured-copy h2,
.section-heading h2,
.archive-header h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.7rem);
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.featured-copy h2 a,
.article-card h2 a {
  text-decoration: none;
}

.featured-copy > p {
  margin: 24px 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.83rem;
}

.text-link {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  align-self: flex-start;
  margin-top: 32px;
  color: var(--green-700);
  font-weight: 750;
  text-decoration: none;
}

.text-link span {
  font-size: 1.25em;
  transition: transform 160ms ease;
}

.text-link:hover span {
  transform: translateX(4px);
}

.article-list-section {
  padding: clamp(60px, 7vw, 88px) 0 clamp(80px, 10vw, 136px);
}

.section-heading {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 48px;
  text-align: center;
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.tag-filter a,
.tag-list a {
  display: inline-flex;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.tag-filter a:hover,
.tag-filter .is-active,
.tag-list a:hover {
  border-color: var(--green-700);
  background: var(--green-200);
  color: var(--green-700);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 42px 28px;
}

.article-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.article-card-image {
  overflow: hidden;
  aspect-ratio: 40 / 21;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-container);
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}

.article-card-image.image-contain img {
  object-fit: contain;
  padding: 14px 14px 0;
}

.article-card:hover .article-card-image img {
  transform: scale(1.025);
}

.article-card-body {
  padding: 22px 4px 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 15px;
  padding: 0;
  list-style: none;
}

.article-card h2 {
  margin: 0 0 12px;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.article-card h2 a:hover {
  color: var(--green-700);
}

.article-card-body > p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 3.3em;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 70px;
}

.pagination a,
.pagination span {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.pagination a:hover,
.pagination a.is-current {
  border-color: var(--green-700);
  background: var(--green-700);
  color: var(--surface);
}

.pagination .is-disabled {
  opacity: 0.36;
}

.archive-header {
  padding: 76px 0;
  background: var(--surface-soft);
}

.archive-header h1 {
  max-width: 800px;
}

.archive-header > .container > p:last-child {
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.breadcrumbs {
  display: flex;
  overflow: hidden;
  gap: 10px;
  align-items: center;
  margin-bottom: 42px;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.breadcrumbs a {
  color: var(--green-700);
  text-decoration: none;
}

.breadcrumbs span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-header {
  max-width: 980px;
  padding-top: clamp(58px, 8vw, 104px);
  padding-bottom: clamp(42px, 6vw, 72px);
}

.article-header .tag-list {
  margin-bottom: 24px;
}

.article-header h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2.7rem, 6vw, 5.5rem);
  font-weight: 820;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.article-deck {
  max-width: 790px;
  margin: 28px 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.article-cover {
  overflow: hidden;
  max-height: 720px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-container);
}

.article-cover img {
  width: 100%;
  height: auto;
  max-height: 720px;
  object-fit: cover;
}

.article-cover.image-contain img {
  object-fit: contain;
}

.article-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 730px);
  gap: clamp(50px, 8vw, 100px);
  justify-content: center;
  padding-top: clamp(62px, 8vw, 104px);
  padding-bottom: clamp(80px, 10vw, 140px);
}

.article-toc {
  min-width: 0;
}

.article-toc details {
  position: sticky;
  top: 118px;
}

.article-toc summary {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  list-style: none;
  text-transform: uppercase;
}

.article-toc summary::-webkit-details-marker {
  display: none;
}

.article-toc nav > ul {
  padding-left: 0;
}

.article-toc ul {
  margin: 0;
  padding-left: 16px;
  list-style: none;
}

.article-toc li + li {
  margin-top: 9px;
}

.article-toc a {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  text-decoration: none;
}

.article-toc a:hover {
  color: var(--green-700);
}

.article-content {
  min-width: 0;
  color: var(--ink);
  font-size: clamp(1.03rem, 1.4vw, 1.12rem);
}

.article-content p {
  color: var(--ink);
}

.article-content > p:first-child {
  font-size: 1.18em;
}

.article-content h2,
.article-content h3 {
  scroll-margin-top: 118px;
  letter-spacing: -0.035em;
  line-height: 1.16;
}

.article-content h2 {
  margin: 2.8em 0 0.75em;
  font-size: clamp(1.9rem, 3vw, 2.65rem);
}

.article-content h3 {
  margin: 2.2em 0 0.7em;
  font-size: 1.45rem;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote {
  margin-block: 1.15em;
}

.article-content a {
  color: var(--green-700);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-content blockquote {
  margin-inline: 0;
  padding: 18px 24px;
  border-left: 4px solid var(--green-700);
  border-radius: 0 12px 12px 0;
  background: var(--surface-soft);
  color: var(--muted);
}

.article-content code {
  padding: 0.15em 0.35em;
  border-radius: 5px;
  background: var(--surface-container);
  font-size: 0.9em;
}

.article-content table {
  width: 100%;
  margin: 1.8em 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 0.94em;
  line-height: 1.45;
}

.article-content th,
.article-content td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-content th {
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 750;
}

.article-content th + th,
.article-content td + td {
  border-left: 1px solid var(--line);
}

.article-content tbody tr:last-child td {
  border-bottom: 0;
}

.article-content tbody tr:hover td {
  background: var(--surface-soft);
}

.article-content table caption {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.85em;
  text-align: left;
}

.content-figure {
  margin: 2.5em 0;
}

.content-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 760px;
  margin-inline: auto;
}

.content-figure figcaption {
  margin-top: 11px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.article-end {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  justify-content: space-between;
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.article-end .tag-list {
  margin: 0;
}

.next-article {
  padding: 68px 0;
  background: var(--feature-tint);
}

.next-article a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  max-width: 900px;
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 1.1;
  text-decoration: none;
}

@media (max-width: 980px) {
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured-article {
    grid-template-columns: 1fr 0.8fr;
  }

  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-layout {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 45px;
  }
}

@media (max-width: 820px) {
  .journal-hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

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

  .featured-image {
    min-height: 300px;
  }

  .article-layout {
    display: block;
  }

  .article-toc {
    margin-bottom: 42px;
  }

  .article-toc details {
    position: static;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-soft);
  }

  .article-toc summary {
    margin: 0;
    cursor: pointer;
  }

  .article-toc details[open] summary {
    margin-bottom: 16px;
  }
}

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

  .journal-hero {
    padding-top: 58px;
    padding-bottom: 104px;
  }

  .journal-hero h1 {
    font-size: clamp(3rem, 15vw, 4.5rem);
  }

  .featured-wrap {
    margin-top: -44px;
  }

  .featured-article {
    min-height: 0;
    border-radius: 20px;
  }

  .featured-image {
    min-height: 240px;
  }

  .featured-copy {
    padding: 30px 24px 34px;
  }

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

  .article-header h1 {
    font-size: clamp(2.55rem, 13vw, 4rem);
  }

  .article-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    font-size: 0.88em;
    -webkit-overflow-scrolling: touch;
  }

  .article-content th,
  .article-content td {
    min-width: 150px;
    padding: 11px 12px;
  }

  .article-content th:first-child,
  .article-content td:first-child {
    min-width: 130px;
  }

  .article-cover {
    width: 100%;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .article-end {
    align-items: flex-start;
    flex-direction: column;
  }
}

