.article-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2.5rem;
  align-items: start;
}

.article-main {
  min-width: 0;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-meta .badge,
.badge-viral {
  background: var(--logo-blue);
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  flex-shrink: 0;
}

.article-meta .badge:hover {
  opacity: 0.9;
}

.article-headline {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  animation: articleFadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.article-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin: 0 0 0.5rem;
}

.article-share__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 0.15rem;
}

.article-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.article-share__btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.article-share__btn--facebook {
  background: #1877f2;
}

.article-share__btn--twitter {
  background: #000;
}

.article-share__url {
  margin: 0 0 1.25rem;
  font-size: 0.8rem;
  line-height: 1.4;
  word-break: break-all;
}

.article-share__url a {
  color: var(--logo-blue);
  text-decoration: none;
}

.article-share__url a:hover {
  text-decoration: underline;
}

@keyframes articleFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.article-hero {
  margin: 0 0 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  animation: articleFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.article-hero img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  object-position: center;
}

.article-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
}

.article-body h1,
.article-body h2,
.article-body h3 {
  margin: 1.5rem 0 0.75rem;
  line-height: 1.3;
}

.article-body p {
  margin: 0 0 1rem;
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
  background: #111;
}

.article-body video {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
  background: #000;
}

.article-body .embed {
  margin: 1.25rem 0;
  display: flex;
  justify-content: center;
  position: relative;
  width: 100%;
}

/* Loading state while iframe / social widgets load */
.article-body .embed.is-loading {
  background: linear-gradient(110deg, #eef2f7 0%, #f8fafc 45%, #eef2f7 90%);
  background-size: 200% 100%;
  animation: embed-shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
  overflow: hidden;
}

.article-body .embed.is-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  margin: -1.25rem 0 0 -1.25rem;
  border: 3px solid rgba(0, 74, 173, 0.15);
  border-top-color: var(--logo-blue, #004aad);
  border-radius: 50%;
  animation: embed-spin 0.7s linear infinite;
  pointer-events: none;
}

.article-body .embed.is-loaded,
.article-body .embed:not(.is-loading) {
  background: transparent;
  animation: none;
}

.article-body .embed.is-loaded::after,
.article-body .embed:not(.is-loading)::after {
  display: none;
}

.article-body .embed.is-loading iframe,
.article-body .embed.is-loading .twitter-tweet,
.article-body .embed.is-loading .instagram-media {
  opacity: 0;
  pointer-events: none;
}

.article-body .embed.is-loaded iframe,
.article-body .embed.is-loaded .twitter-tweet,
.article-body .embed.is-loaded .instagram-media,
.article-body .embed:not(.is-loading) iframe,
.article-body .embed:not(.is-loading) .twitter-tweet,
.article-body .embed:not(.is-loading) .instagram-media {
  opacity: 1;
  transition: opacity 0.35s ease;
}

.article-body .embed--youtube.is-loading,
.article-body .embed--facebook:not(.embed--facebook-portrait).is-loading {
  min-height: 0;
}

.article-body .embed--instagram.is-loading {
  min-height: 320px;
}

.article-body .embed--twitter.is-loading {
  min-height: 280px;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

@keyframes embed-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes embed-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-body .embed.is-loading {
    animation: none;
    background: #f1f5f9;
  }

  .article-body .embed.is-loading::after {
    animation: none;
    opacity: 0.5;
  }
}

.article-body .embed--youtube,
.article-body .embed--facebook:not(.embed--facebook-portrait) {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
}

.article-body .embed--facebook-portrait {
  position: relative;
  width: 100%;
  max-width: 325px;
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: 9 / 16;
}

.article-body .embed--youtube iframe,
.article-body .embed--facebook iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
}

.article-body .embed--instagram {
  width: 100%;
  max-width: 540px;
}

.article-body .embed--instagram .instagram-media {
  margin: 0 auto !important;
  min-width: 0 !important;
}

.article-body blockquote:not(.twitter-tweet) {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--logo-blue);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.article-body .embed--twitter .twitter-tweet {
  margin: 0 !important;
}

.article-body a {
  color: var(--logo-blue);
  text-decoration: underline;
}

/* Sidebar, more stories */
.article-sidebar {
  position: sticky;
  top: 5.5rem;
}

.more-stories-label {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.35rem 0.65rem;
  background: var(--logo-blue);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.more-stories-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.more-stories-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.more-stories-list li {
  border-bottom: 1px solid var(--border);
}

.more-stories-list li:last-child {
  border-bottom: none;
}

.more-story-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.85rem;
  padding: 1rem 0;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.15s;
}

.more-story-card:hover {
  opacity: 0.85;
}

.more-story-card:hover .more-story-title {
  color: var(--logo-blue);
}

.more-story-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: #111;
}

.more-story-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.more-story-text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.more-story-cat {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--logo-blue);
}

.more-story-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ql-video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1rem 0;
}

.ql-video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (max-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .article-sidebar {
    position: static;
    order: 2;
  }

  .more-stories-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
  }

  .more-stories-list li {
    border-bottom: none;
  }

  .more-story-card {
    padding: 0;
    grid-template-columns: 1fr;
  }

  .more-story-thumb {
    width: 100%;
  }
}

/* Photo album — cover collage */
.article-body .photo-album {
  margin: 1.75rem 0;
  max-width: 520px;
}

.article-body .photo-album__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.article-body .photo-album__title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.article-body .photo-album__count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-body .photo-album__cover {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #0f172a;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-body .photo-album__cover:hover,
.article-body .photo-album__cover:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
}

.article-body .photo-album__cover:focus-visible {
  outline: 2px solid var(--logo-blue);
  outline-offset: 3px;
}

/* Hide editor-only album markup if it leaks into article HTML */
.article-body .photo-album--stored,
.article-body .photo-album__editor,
.article-body .photo-album__cover-preview {
  display: none !important;
}

.article-body .photo-album__cover-grid {
  display: grid;
  gap: 3px;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 160px;
}

.article-body .photo-album__cover-grid--1 {
  grid-template-columns: 1fr;
}

.article-body .photo-album__cover-grid--2 {
  grid-template-columns: 1fr 1fr;
}

.article-body .photo-album__cover-grid--3 {
  grid-template-columns: 1.15fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.article-body .photo-album__cover-grid--3 .photo-album__cover-cell:first-child {
  grid-row: 1 / span 2;
}

.article-body .photo-album__cover-grid--4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.article-body .photo-album__cover-cell {
  position: relative;
  overflow: hidden;
  min-height: 0;
  background: #1e293b;
}

.article-body .photo-album__cover-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  border-radius: 0;
}

.article-body .photo-album__cover-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  pointer-events: none;
}

.article-body .photo-album__cover-more[data-extra]::after {
  content: "+" attr(data-extra);
}

.article-body .photo-album__cover-hint {
  position: absolute;
  right: 0.65rem;
  bottom: 0.55rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.article-body .photo-album__cover:hover .photo-album__cover-hint,
.article-body .photo-album__cover:focus-visible .photo-album__cover-hint {
  opacity: 1;
}

/* Lightbox */
body.photo-lightbox-open {
  overflow: hidden;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(6px);
}

.photo-lightbox[hidden] {
  display: none !important;
}

.photo-lightbox__stage {
  max-width: min(1100px, 100%);
  max-height: calc(100vh - 6rem);
  width: 100%;
}

.photo-lightbox__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.photo-lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.photo-lightbox__caption {
  margin: 0;
  max-width: 720px;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #e2e8f0;
}

.photo-lightbox__caption[hidden] {
  display: none;
}

.photo-lightbox__counter {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

.photo-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.photo-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
}

.photo-lightbox__prev {
  left: 1rem;
}

.photo-lightbox__next {
  right: 1rem;
}

@media (max-width: 640px) {
  .article-body .photo-album {
    max-width: 100%;
  }

  .article-body .photo-album__cover-grid {
    aspect-ratio: 4 / 3;
    min-height: 140px;
  }
}

.article-preview-banner {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1e40af;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
}

/* Related articles carousel */
.article-more-carousel {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.article-more-carousel__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.article-more-carousel__eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--logo-blue);
}

.article-more-carousel__title {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.article-more-carousel__title a {
  color: var(--text);
  text-decoration: none;
}

.article-more-carousel__title a:hover {
  color: var(--logo-blue);
}

.article-more-carousel__nav {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}

.article-more-carousel__frame {
  position: relative;
}

.article-more-carousel__viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.15rem 0 0.35rem;
}

.article-more-carousel__viewport::-webkit-scrollbar {
  display: none;
}

.article-more-carousel__track {
  display: flex;
  gap: 1rem;
}

.article-more-carousel__card {
  flex: 0 0 calc((100% - 2rem) / 3);
  min-width: 240px;
  max-width: 320px;
  scroll-snap-align: start;
}

.article-more-carousel__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.article-more-carousel__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.article-more-carousel__link:hover .article-more-carousel__card-title {
  color: var(--logo-blue);
}

.article-more-carousel__media {
  display: block;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}

.article-more-carousel__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.article-more-carousel__link:hover .article-more-carousel__media img {
  transform: scale(1.03);
}

.article-more-carousel__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.95rem 1rem;
  min-width: 0;
}

.article-more-carousel__cat {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--logo-blue);
}

.article-more-carousel__card-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-more-carousel__date {
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.article-more-carousel__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.article-more-carousel__btn:hover:not(:disabled) {
  border-color: var(--logo-blue);
  color: var(--logo-blue);
  background: #eff6ff;
}

.article-more-carousel__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.article-more-carousel__btn--edge {
  display: none;
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(calc(-50% - 0.5rem));
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}

.article-more-carousel__btn--edge.article-more-carousel__btn--prev {
  left: -0.65rem;
}

.article-more-carousel__btn--edge.article-more-carousel__btn--next {
  right: -0.65rem;
}

@media (min-width: 961px) {
  .article-more-carousel__nav {
    display: none;
  }

  .article-more-carousel__btn--edge {
    display: inline-flex;
  }

  .article-more-carousel__frame {
    padding: 0 0.15rem;
  }
}

@media (max-width: 960px) {
  .article-more-carousel__card {
    flex-basis: min(78vw, 300px);
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .article-more-carousel {
    margin-top: 2rem;
    padding-top: 1.5rem;
  }

  .article-more-carousel__head {
    align-items: center;
  }
}
