/*
 * article styles.
 * Keep rule order intact: later rules refine earlier layouts and responsive states.
 */

.article-page {
  padding-top: 0;
}
.breadcrumbs {
  display: flex;
  gap: 12px;
  color: var(--body);
  font-size: 12px;
  padding-top: 24px;
}
.article-meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--body);
  font-size: 14px;
  margin: 80px 0 32px;
}
.article-heading {
  max-width: 850px;
  margin-bottom: 48px;
}
.article-heading h1 {
  font-family: var(--font-heading);
  font-size: clamp(38px, 4vw, 62px);
  line-height: 1.13;
  letter-spacing: -0.035em;
  margin: 0;
}
.article-share-disclosure {
  margin-bottom: 75px;
  position: relative;
  width: fit-content;
}
.article-share-disclosure > summary {
  display: flex;
  gap: 12px;
  font-size: 14px;
  cursor: pointer;
  padding: 10px 0;
}
.article-share-disclosure > summary span {
  font-size: 22px;
  line-height: 1;
}
.article-share-disclosure[open] > summary span {
  transform: rotate(45deg);
}
.article-share {
  padding: 20px;
  margin-top: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  max-width: min(420px, 76vw);
}
.article-share h2 {
  font: 600 14px var(--font-sans);
  margin: 0 0 15px;
}
.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.share-buttons a,
.share-buttons button {
  font: 13px var(--font-sans);
  border: 1px solid var(--line);
  padding: 9px 12px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.share-buttons a:hover,
.share-buttons button:hover {
  background: var(--ink);
  color: var(--paper);
}
.share-note,
#share-status {
  font-size: 12px;
  color: var(--body);
}
#share-fallback {
  width: 100%;
  padding: 8px;
}
.article-figure {
  width: 100vw;
  margin: 0 0 0 calc(50% - 50vw);
}
.article-figure > img {
  display: block;
  width: 100%;
  max-height: 760px;
  object-fit: contain;
  background: var(--tint);
}
.article-figure figcaption {
  width: 84%;
  max-width: 1400px;
  margin: 14px auto 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--body);
}
.article-layout {
  max-width: 760px;
  margin: 65px auto 100px;
}
.article-body p {
  font-size: 18px;
  line-height: 1.85;
  color: var(--body);
  margin: 0 0 28px;
}
.article-body .article-lead {
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 45px;
}
.article-body h2 {
  font-family: var(--font-heading);
  font-size: 30px;
  line-height: 1.3;
  margin: 40px 0 22px;
}
.article-body .source-note {
  font-size: 13px;
  margin-top: 35px;
}
.article-contact {
  border-top: 1px solid var(--line);
  margin-top: 55px;
  padding-top: 15px;
}
.article-contact a {
  font-weight: 600;
}
.related-stories {
  border-top: 1px solid var(--line);
  padding-top: 40px;
  margin-bottom: 90px;
}
.related-stories > h2 {
  font-family: var(--font-heading);
  font-size: 32px;
  margin: 0 0 35px;
}
.related-stories > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 35px;
}
.related-stories img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.related-stories h3 {
  font-family: var(--font-sans);
  font-size: 23px;
  line-height: 1.4;
  letter-spacing: 0;
  margin: 16px 0;
}
.related-stories span {
  font-size: 13px;
  color: var(--body);
  display: block;
  margin-top: 12px;
}
.related-stories a:hover h3 {
  text-decoration: underline;
  text-underline-offset: 4px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  .article-meta {
    margin-top: 45px;
  }
  .article-heading {
    margin-bottom: 28px;
  }
  .article-heading h1 {
    font-size: 38px;
  }
  .article-share-disclosure {
    margin-bottom: 40px;
  }
  .article-layout {
    margin-block: 40px 65px;
  }
  .article-figure figcaption {
    width: calc(100% - 36px);
  }
  .article-body p {
    font-size: 17px;
  }
  .related-stories > div {
    grid-template-columns: 1fr;
    gap: 35px;
  }
}

/* Inline share reveal inspired by the reference story interaction. */
.article-share-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  min-height: 44px;
  margin-bottom: 65px;
}
.share-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 14px var(--font-sans);
  cursor: pointer;
}
.share-label {
  max-width: 55px;
  opacity: 1;
  overflow: hidden;
  transition:
    max-width 0.3s ease,
    opacity 0.2s ease;
}
.share-toggle-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}
.share-toggle-icon::before,
.share-toggle-icon::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 3px;
  width: 12px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s ease;
}
.share-toggle-icon::after {
  transform: rotate(90deg);
}
.is-open .share-toggle-icon::after {
  transform: rotate(0);
}
.is-open .share-label {
  max-width: 0;
  opacity: 0;
}
.is-open .share-toggle {
  gap: 0;
}
.share-reveal {
  display: grid;
  grid-template-columns: 0fr;
  opacity: 0;
  visibility: hidden;
  transition:
    grid-template-columns 0.35s ease,
    opacity 0.25s ease,
    visibility 0.35s;
}
.is-open .share-reveal {
  grid-template-columns: 1fr;
  opacity: 1;
  visibility: visible;
}
.share-reveal .share-buttons {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
}
.share-reveal .share-buttons a,
.share-reveal .share-buttons button {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 44px;
  border: 0;
  padding: 8px;
  background: transparent;
  color: var(--ink);
  transform: translateX(-8px);
  transition:
    transform 0.3s ease,
    opacity 0.2s ease;
}
.is-open .share-buttons > * {
  transform: translateX(0);
}
.share-reveal .share-buttons > :nth-child(2) {
  transition-delay: 0.04s;
}
.share-reveal .share-buttons > :nth-child(3) {
  transition-delay: 0.08s;
}
.share-reveal .share-buttons > :nth-child(4) {
  transition-delay: 0.12s;
}
.share-reveal svg {
  display: block;
  width: 18px;
  height: 18px;
}
.share-reveal .share-buttons a:hover,
.share-reveal .share-buttons button:hover {
  opacity: 0.55;
  background: transparent;
}
.article-share-inline #share-status {
  flex-basis: 100%;
  margin: 0;
}
.article-share-inline #share-status:not(:empty) {
  margin-top: 10px;
}
.article-share-inline #share-fallback {
  flex-basis: 100%;
  margin-top: 10px;
}
@media (max-width: 760px) {
  .article-share-inline {
    margin-bottom: 35px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .share-label,
  .share-toggle-icon::before,
  .share-toggle-icon::after,
  .share-reveal,
  .share-reveal .share-buttons > * {
    transition: none;
  }
}

/* Compact article image aligned with the page frame. */
.article-figure {
  width: 100%;
  margin: 0;
}
.article-figure > img {
  width: 100%;
  height: clamp(240px, 32vw, 460px);
  max-height: 460px;
  object-fit: cover;
  object-position: center;
}
.article-figure figcaption {
  width: 100%;
  max-width: none;
  margin: 12px 0 0;
}
@media (max-width: 760px) {
  .article-figure > img {
    height: auto;
    max-height: 320px;
    aspect-ratio: 16/9;
  }
}

/* Add 60px to the article image frame. */
.article-figure > img {
  height: clamp(300px, calc(32vw + 60px), 520px);
  max-height: 520px;
}
@media (max-width: 760px) {
  .article-figure > img {
    height: calc((100vw - 36px) * 0.5625 + 60px);
    max-height: 380px;
    aspect-ratio: auto;
  }
}

/* Related story images reveal color on rollover or keyboard focus. */
.related-stories img {
  filter: grayscale(1);
  transition: filter 0.35s ease;
}
@media (hover: hover) {
  .related-stories a:hover img {
    filter: grayscale(0);
  }
}
.related-stories a:focus-visible img {
  filter: grayscale(0);
}
@media (prefers-reduced-motion: reduce) {
  .related-stories img {
    transition: none;
  }
}

/* Balanced share icons with consistent centers and touch targets. */
.share-reveal .share-buttons {
  gap: 4px;
  align-items: center;
}
.share-reveal .share-buttons a,
.share-reveal .share-buttons button {
  flex-basis: 40px;
  width: 40px;
  height: 44px;
  padding: 12px 10px;
  line-height: 1;
}
.share-reveal svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.share-reveal [data-share="facebook"] svg {
  width: 19px;
  height: 19px;
}
.share-reveal [data-share="x"] svg {
  width: 18px;
  height: 18px;
}
.share-toggle {
  justify-content: center;
}
.is-open .share-toggle {
  width: 40px;
}
.share-toggle-icon::before,
.share-toggle-icon::after {
  top: 8.25px;
}
