/* ---------- top-of-page reading ticker ---------- */
.story-ticker {
  background: linear-gradient(var(--brand) , 90%, var(--brand-deep));
  overflow: hidden;
  white-space: nowrap;
  padding: 9px 0;
}

.story-ticker-track {
  display: inline-flex;
  width: max-content;
  animation: story-ticker-scroll 26s linear infinite;
  will-change: transform;
}

.story-ticker-segment {
  display: inline-block;
  padding-right: 56px;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

@keyframes story-ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .story-ticker-track { animation: none; }
  .story-ticker { overflow-x: auto; }
}

/* ---------- views / likes as icons ---------- */
.metric-item { display: inline-flex; align-items: center; gap: 5px; }
.metric-icon { width: 15px; height: 15px; flex-shrink: 0; }

/* ---------- copy link row, underneath views/word count/likes ---------- */
.story-metrics-group {display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.story-copy-link-row { align-self: stretch;width: 100%;margin-top: 0; background-color: transparent;}
.copy-link-btn, .copy-link-btn span {
  width: 100%;
  font-weight: 900;
  display: inline-block; align-items: end; gap: 6px; border: none; background: transparent;
  color: var(--brand-deep); padding: 6px 12px; font: inherit; font-size: 0.8rem;
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.copy-link-icon { width: 14px; height: 14px; flex-shrink: 0; }

/* ---------- share row: copy button + WhatsApp / Facebook / X ---------- */
.story-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* border: 1px solid var(--line); */
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  padding: 7px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.share-btn .share-icon { width: 22px; height: 22px; flex-shrink: 0; object-fit: contain; }
/* The X mark ships as a black glyph; flip it on the dark theme so it stays visible. */
html[data-theme="dark"] .share-btn-twitter .share-icon { filter: invert(1); }
.share-btn:hover { background: var(--paper-dim); }
.share-btn-copy { color: var(--brand-deep); border-color: var(--brand-deep); }
.share-btn-whatsapp { color: #128c42; border-color: #128c42; }
.share-btn-facebook { color: #1467c4; border-color: #1467c4; }
.share-btn-twitter { color: var(--ink); border-color: var(--ink); }

@media (max-width: 768px) {
    .story-metrics-group {
        width: 100%;
        align-items: center;
    }

    .story-metrics {
        justify-content: center;
    }

    .story-copy-link-row {
        width: 100%;
        justify-content: center;
    }

    .copy-link-btn {
        width: 100%;
    }
}

/* ---------- comment timestamp ---------- */
.comment-date { color: var(--ink); font-size: 0.76rem; font-weight: 400; }

/* ---------- follow button duplicated next to the byline ---------- */
.meta-author-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.follow-btn-inline {
  min-height: auto; padding: 5px 12px; font-size: 0.72rem; border-radius: 999px;
}
.follow-btn-inline .follow-icon { width: 14px; height: 14px; }

/* Inline story-report form */
.story-report-note {
  margin: 28px 0 0; padding: 14px 16px; border: 1px solid var(--line);
  border-left: 3px solid var(--brand-deep); border-radius: 12px;
  background: var(--paper-dim); color: var(--ink); font-size: 0.9rem;
}
.story-report-note summary { color: var(--ink); font-weight: 700; cursor: pointer; }
.story-report-note summary:hover { color: var(--brand-deep); }
.story-report-note > p { margin: 12px 0; color: var(--ink); }
.story-report-note form { display: grid; gap: 9px; }
.story-report-note label { font-weight: 600; }
.story-report-note textarea {
  width: 100%; min-height: 120px; resize: vertical; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit;
}
.story-report-note form button {
  justify-self: start; min-height: 42px; padding: 9px 16px;
  border: 0; border-radius: 8px; background: var(--brand-deep);
  color: #fff; font: inherit; font-weight: 700;
  transition: transform 160ms ease, filter 160ms ease;
}
.story-report-note form button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.story-report-note form button:disabled { opacity: .65; cursor: wait; transform: none; }
.story-report-status { margin: 0; color: var(--brand-deep); font-weight: 600; }
.story-report-status[hidden] { display: none; }

/* ---------- story like action ---------- */
.article-actions .story-like-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 7px 9px 7px 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--line));
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(14, 27, 44, 0.08);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease,
    box-shadow 200ms ease, transform 200ms cubic-bezier(.2,.8,.2,1);
}
.article-actions .story-like-btn:hover {
  transform: translateY(-2px);
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
  box-shadow: 0 8px 22px rgba(179, 64, 42, 0.14);
}
.article-actions .story-like-btn:active { transform: translateY(0) scale(.98); }
.article-actions .story-like-btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--danger) 38%, transparent);
  outline-offset: 3px;
}
.story-like-icon-wrap {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: var(--danger);
  transition: background-color 200ms ease, color 200ms ease, transform 240ms ease;
}
.story-like-icon {
  width: 18px;
  height: 18px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill 200ms ease, transform 240ms cubic-bezier(.2,.8,.2,1);
}
.story-like-copy { white-space: nowrap; }
.article-actions .story-like-btn .like-badge {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: var(--paper-dim);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.article-actions .story-like-btn[data-liked="true"] {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
  box-shadow: 0 7px 20px rgba(179, 64, 42, 0.22);
}
.article-actions .story-like-btn[data-liked="true"] .story-like-icon-wrap {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.article-actions .story-like-btn[data-liked="true"] .story-like-icon { fill: currentColor; }
.article-actions .story-like-btn[data-liked="true"] .like-badge {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.article-actions .story-like-btn[data-liked="true"]:hover {
  background: color-mix(in srgb, var(--danger) 88%, #000);
}
.article-actions .story-like-btn.is-pending {
  opacity: 0.72;
  cursor: progress;
  transform: scale(.985);
}
.article-actions .story-like-btn.is-pending .story-like-icon {
  animation: story-like-pending 800ms ease-in-out infinite;
}
@keyframes story-like-pending {
  50% { transform: scale(.84); }
}
@media (max-width: 420px) {
  .article-actions .story-like-btn {
    gap: 8px;
    min-height: 48px;
    padding: 6px 7px;
    font-size: 0.84rem;
  }
  .story-like-icon-wrap { width: 34px; height: 34px; flex-basis: 34px; }
  .article-actions .story-like-btn .like-badge { min-width: 29px; height: 29px; }
}
@media (prefers-reduced-motion: reduce) {
  .article-actions .story-like-btn,
  .story-like-icon-wrap,
  .story-like-icon,
  .article-actions .story-like-btn .like-badge { transition: none; }
  .article-actions .story-like-btn.is-pending .story-like-icon { animation: none; }
}

/* ---------- story reading rails ---------- */
.story-reading-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.story-reading-column { min-width: 0; }
.story-rail { min-width: 0; }
.story-reading-column .story-body {
  margin-left: auto;
  margin-right: auto;
}
.story-reading-column .story-body h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24.6px;
  word-break: break-all;
}
.story-reading-column .story-body h3 {
  font-size: 20.5px;
  word-break: break-all;
}
.story-reading-column .story-body h4 {
  font-size: 17.22px;
  word-break: break-all;
}
.story-reading-column .story-body p,
.story-reading-column .story-body li {
  text-align: start;
  text-justify: auto;
}
.story-rail-read-also { order: 1; }
.story-rail-author { order: 2; }
.story-rail-author .author-more-stories {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.story-rail-heading {
  display: flex;
  margin: 0 0 14px;
}
.story-rail-heading h2 {
  max-width: 100%;
  margin: 0;
  padding: 7px 15px;
  background: var(--nav-bg);
  color: var(--nav-fg);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  font-family: var(--font-display);
  font-size: clamp(.88rem, 1vw, 1rem);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.story-rail-author .story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.read-also-panel {
  display: grid;
  gap: 0;
  margin: 0;
  color: var(--ink);
}
.read-also-panel[hidden] { display: none; }
.read-also-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.read-also-skeleton {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 84px;
  padding: 11px 0 11px 16px;
  border-bottom: 1px solid var(--line);
}
.read-also-skeleton-image,
.read-also-skeleton-line {
  display: block;
  border-radius: 2px;
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--slate) 8%, var(--surface)) 20%,
    color-mix(in srgb, var(--slate) 14%, var(--surface)) 42%,
    color-mix(in srgb, var(--slate) 8%, var(--surface)) 64%
  );
  background-size: 220% 100%;
  animation: read-also-shimmer 1.6s ease-in-out infinite;
}
.read-also-skeleton-image { width: 64px; height: 58px; }
.read-also-skeleton-copy { display: grid; gap: 8px; }
.read-also-skeleton-line { width: 92%; height: 9px; }
.read-also-skeleton-line-meta { width: 46%; height: 7px; }
.read-also-skeleton-line-short { width: 62%; }
.read-also-skeleton::before,
.read-also-card::before {
  position: absolute;
  left: 1px;
  color: var(--slate);
  content: "•";
  font-size: 1rem;
  line-height: 1;
}
.read-also-skeleton::before { color: color-mix(in srgb, var(--slate) 18%, var(--surface)); }
@keyframes read-also-shimmer {
  to { background-position: -220% 0; }
}
.read-also-card {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 84px;
  padding: 11px 0 11px 16px;
  border-bottom: 1px solid var(--line);
  opacity: 0;
  animation: read-also-arrive 420ms cubic-bezier(.2,.75,.25,1) forwards;
  animation-delay: calc(var(--card-index, 0) * 75ms);
}
.read-also-card-image {
  display: block;
  width: 64px;
  height: 58px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--paper-dim);
}
.read-also-card-image img { width: 100%; height: 100%; object-fit: cover; }
.read-also-card-content { min-width: 0; }
.read-also-card-meta {
  margin: 0 0 5px;
  color: var(--slate);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.read-also-card h3 {
  margin: 0;
  font-size: .86rem;
  line-height: 1.32;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
}
.read-also-card h3 a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--ink) 45%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
  font: inherit;
  line-height: inherit;
}
.read-also-card h3 a:hover,
.read-also-card h3 a:focus-visible { color: var(--amber-deep); text-decoration-color: currentColor; }
@keyframes read-also-arrive {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.read-also-error { margin: 12px 0; color: var(--ink); font-size: .82rem; }
.read-also-retry {
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.read-also-retry:hover,
.read-also-retry:focus-visible {
  background: var(--paper-dim);
  color: var(--ink);
}

@media (min-width: 900px) {
  .story-article-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-right: 0;
    padding-left: 0;
  }
  .story-article { width: 100%; min-width: 0; }
  .story-reading-layout {
    display: grid;
    grid-template-columns: minmax(150px, 260px) minmax(0, 1fr) minmax(150px, 260px);
    gap: 24px;
    align-items: start;
  }
  .story-reading-column { grid-column: 2; grid-row: 1; }
  .story-reading-column .story-header,
  .story-reading-column .story-hero-figure,
  .story-reading-column .story-body { max-width: none; }
  .story-rail-read-also,
  .story-rail-author {
    position: sticky;
    top: calc(var(--header-h, 0px) + 18px);
    align-self: start;
    height: calc(100vh - var(--header-h, 0px) - 36px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .story-rail-read-also { grid-column: 1; grid-row: 1; order: 0; justify-self: end; width: 100%; max-width: 260px; }
  .story-rail-author { grid-column: 3; grid-row: 1; order: 0; justify-self: start; width: 100%; max-width: 260px; }
}

@media (max-width: 899.98px) {
  .story-body > .story-rail-read-also {
    width: 100%;
    margin: 24px 0;
  }
}

@media (max-width: 899.98px) {
  .story-rail-read-also .story-rail-heading h2 {
    padding: 6px 12px;
    font-size: .8rem;
    line-height: 1.2;
  }
  .story-rail-read-also .read-also-card h3,
  .story-rail-read-also .read-also-card h3 a {
    font-size: .78rem !important;
    line-height: 1.25 !important;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: normal;
    text-transform: none;
  }
  .story-rail-read-also .read-also-card-meta {
    font-size: .58rem;
    margin-bottom: 3px;
  }
}

@media (max-width: 560px) {
  .story-rail-heading h2 { padding: 6px 12px; font-size: .8rem; }
  .read-also-skeleton,
  .read-also-card {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
    min-height: 64px;
    padding: 7px 0 7px 13px;
  }
  .read-also-skeleton-image,
  .read-also-card-image { width: 48px; height: 44px; }
  .read-also-skeleton-copy { gap: 5px; }
  .read-also-skeleton-line { height: 8px; width: 94%; }
  .read-also-skeleton-line-meta { height: 6px; width: 42%; margin-bottom: 1px; }
  .read-also-skeleton-line-short { width: 58%; height: 8px; }
  .story-rail-read-also .read-also-card h3,
  .story-rail-read-also .read-also-card h3 a {
    font-size: .74rem !important;
    line-height: 1.22 !important;
    font-weight: 700;
    font-family: inherit;
    margin: 0;
  }
  .read-also-card-meta { margin-bottom: 3px; font-size: .56rem; line-height: 1.2; }
}

@media (prefers-reduced-motion: reduce) {
  .read-also-skeleton-image,
  .read-also-skeleton-line { animation: none; }
  .read-also-card { opacity: 1; animation: none; }
  .read-also-card h3 a,
  .read-also-retry { transition: none; }
}
