/* Shared thread/timeline cards (X-style): the Short News feed (/{lang}/short-news) and an article's continuous updates
   timeline (category-article.blade.php + Story.vue → StoryUpdates.vue). Colours come from the theme tokens in
   style.css (--ink, --muted, --line, --card-bg, --soft, --red-text), so light and dark mode both work. */

.md-thread { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.md-thread-item { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 96px; }
.md-thread-item:last-child { border-bottom: 0; }
/* The rail: a dot per item joined by a thin line, as in a thread. */
.md-thread-item::before { content: ""; grid-column: 1; grid-row: 1; width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(213, 42, 49, .16); }
.md-thread-item:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 38px; bottom: -6px; border-left: 2px solid rgba(213, 42, 49, .25); }
.md-thread-body { grid-column: 2; min-width: 0; }

.md-thread-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 6px; font: 600 12px/1.4 system-ui, sans-serif; color: var(--muted); }
.md-thread-meta time b { color: var(--red-text); font-weight: 800; font-variant-numeric: tabular-nums; }
.md-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line); background: var(--soft); color: var(--ink); font: 800 10.5px/1.5 system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase; }
.md-chip.is-breaking { background: var(--red); border-color: var(--red); color: #fff; }
.md-chip.is-pinned { background: rgba(26, 144, 208, .1); border-color: rgba(26, 144, 208, .4); color: #0f5f8a; }
.md-chip.is-key { background: rgba(247, 146, 39, .12); border-color: rgba(247, 146, 39, .45); color: #8a4b05; }

.md-thread-title { margin: 0 0 6px; font-size: calc(19px * var(--reading-scale, 1)); line-height: 1.45; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.md-thread-title a { color: inherit; text-decoration: none; }
.md-thread-title a:hover { color: var(--red-text); text-decoration: underline; text-underline-offset: 3px; }
.md-thread-text { color: var(--ink); overflow-wrap: anywhere; }
.md-thread-text > :first-child { margin-top: 0; }
.md-thread-text > :last-child { margin-bottom: 0; }
.md-thread-text p { margin: 0 0 8px; font-size: calc(16px * var(--reading-scale, 1)); line-height: 1.75; }
.md-thread-text img { max-width: 100%; height: auto; border-radius: 8px; }
.md-thread-media { margin: 10px 0 0; }
.md-thread-media img { display: block; width: 100%; max-height: 420px; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.md-thread-media figcaption { margin-top: 4px; font-size: 12px; color: var(--muted); }
.md-thread-source { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.md-thread-source a { color: inherit; }

.md-thread-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.md-share, .md-thread-open { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--card-bg); color: var(--ink); font: 700 12.5px/1.2 system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.md-share i, .md-thread-open i { font-size: 14px; line-height: 1; }
.md-share.is-whatsapp i { color: #128c4b; }
.md-share:hover, .md-thread-open:hover { border-color: var(--red); color: var(--red-text); }
.md-thread-open { margin-left: auto; border-color: transparent; color: var(--red-text); }
.md-share:focus-visible, .md-thread-open:focus-visible, .md-thread-title a:focus-visible, .md-sort button:focus-visible,
.md-load-more:focus-visible, .md-new-updates:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.md-share[data-copied="1"] { border-color: #16a34a; color: #15803d; }

.md-load-more { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 4px; padding: 9px 20px; border: 1px solid var(--line); border-radius: 999px; background: var(--card-bg); color: var(--ink); font: 700 14px/1.2 system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.md-load-more:hover { border-color: var(--red); color: var(--red-text); }
.md-load-more[aria-busy="true"] { opacity: .65; cursor: progress; }
.md-empty { max-width: 760px; padding: 32px 16px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; color: var(--muted); }
.md-empty i { font-size: 28px; color: var(--red-text); }
.md-empty h2 { margin: 8px 0 4px; font-size: 18px; color: var(--ink); }
.md-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Short News feed page */
.short-news-page .short-news-intro { max-width: 760px; margin: 0 0 6px; color: var(--muted); }
.short-news-page .md-thread { margin-top: 4px; }

/* Article continuous updates */
.md-updates { margin: 28px 0 8px; padding: 6px 18px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-bg); }
.md-updates-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.md-updates-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: calc(19px * var(--reading-scale, 1)); line-height: 1.3; color: var(--ink); }
.md-updates-head p { margin: 2px 0 0; font: 600 12px/1.4 system-ui, sans-serif; color: var(--muted); }
.md-updates .md-thread { max-width: none; }
.md-updates .md-thread-title { font-size: calc(17px * var(--reading-scale, 1)); }
.md-updates .md-thread-item.is-pinned { margin: 8px -10px; padding: 14px 10px; border: 1px solid rgba(26, 144, 208, .35); border-left: 4px solid var(--brand-blue, #1a90d0); border-radius: 6px; background: rgba(26, 144, 208, .05); }
.md-updates .md-thread-item.is-highlighted:not(.is-pinned) { margin: 0 -10px; padding-inline: 10px; border-left: 3px solid var(--brand-orange, #f79227); background: rgba(247, 146, 39, .06); }
.md-updates .md-thread-item:target { box-shadow: 0 0 0 2px rgba(213, 42, 49, .35); border-radius: 6px; }
.md-sort { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); }
.md-sort button { min-height: 30px; padding: 3px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 700 12.5px/1.2 system-ui, sans-serif; cursor: pointer; }
.md-sort button[aria-pressed="true"] { background: var(--card-bg); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.md-new-updates { position: sticky; top: 84px; z-index: 2; display: flex; align-items: center; gap: 8px; margin: 10px auto 0; padding: 7px 16px; border: 0; border-radius: 999px; background: var(--red); color: #fff; font: 800 13px/1.2 system-ui, sans-serif; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.md-updates-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.story-updated { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0; font: 700 12.5px/1.4 system-ui, sans-serif; color: var(--red-text); }
.md-live-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 4px; background: var(--red); color: #fff; font: 800 10.5px/1.5 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.md-live-tag.is-done { background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.md-pulse { position: relative; display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.md-pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #fff; opacity: 0; animation: md-ping 1.6s ease-out infinite; }
@keyframes md-ping { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }

/* Premium paywall (partials/paywall.blade.php and Story.vue). The preview above it is already only the server's
   teaser; the fade simply ends that preview softly into the subscription card. */
.story-paywall { --paywall-fade: #fff; position: relative; margin: -72px 0 28px; padding-top: 72px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--paywall-fade) 72px); }
.story-paywall-card { max-width: 640px; margin: 0 auto; padding: 26px 24px 22px; border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: 12px; background: var(--card-bg); box-shadow: 0 10px 30px rgba(15, 23, 42, .08); text-align: center; color: var(--ink); }
.story-paywall-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; margin-bottom: 8px; border-radius: 50%; background: rgba(213, 42, 49, .1); color: var(--red-text); font-size: 20px; }
.story-paywall-kicker { margin: 0 0 4px; font: 800 11.5px/1.4 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--red-text); }
.story-paywall-card h2 { margin: 0 0 8px; font-size: calc(21px * var(--reading-scale, 1)); line-height: 1.4; font-weight: 800; color: var(--ink); }
.story-paywall-text { max-width: 520px; margin: 0 auto 16px; font-size: calc(15px * var(--reading-scale, 1)); line-height: 1.7; color: var(--muted); }
.story-paywall-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 26px; border-radius: 999px; background: var(--red); color: #fff !important; font: 800 15px/1.2 system-ui, sans-serif; text-decoration: none; }
.story-paywall-cta:hover { background: var(--red-dark, #b72027); }
.story-paywall-signin { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }
.story-paywall-signin a { color: var(--red-text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.story-paywall-cta:focus-visible, .story-paywall-signin a:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

html[data-theme="dark"] .story-paywall { --paywall-fade: var(--bg); background: linear-gradient(to bottom, rgba(15, 20, 25, 0), var(--paywall-fade) 72px); }
html[data-theme="dark"] .story-paywall-card { box-shadow: none; }
html[data-theme="dark"] .story-paywall-icon { background: rgba(255, 123, 131, .14); }
html[data-theme="dark"] .md-chip.is-pinned { color: #9fd3f0; background: rgba(26, 144, 208, .16); border-color: rgba(26, 144, 208, .45); }
html[data-theme="dark"] .md-chip.is-key { color: #f8c77a; background: rgba(247, 146, 39, .16); border-color: rgba(247, 146, 39, .45); }
html[data-theme="dark"] .md-share.is-whatsapp i { color: #4ade80; }
html[data-theme="dark"] .md-share[data-copied="1"] { border-color: #4ade80; color: #4ade80; }
html[data-theme="dark"] .md-sort button[aria-pressed="true"] { box-shadow: none; outline: 1px solid var(--line); }

@media (max-width: 575px) {
  .story-paywall-card { padding: 22px 16px 18px; border-radius: 10px; }
  .story-paywall-card h2 { font-size: calc(18px * var(--reading-scale, 1)); }
  .story-paywall-cta { width: 100%; }
  .md-thread-item { grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 14px 0; }
  .md-thread-item::before { width: 10px; height: 10px; }
  .md-thread-item:not(:last-child)::after { left: 4px; }
  .md-thread-title { font-size: calc(17px * var(--reading-scale, 1)); }
  .md-updates { padding: 4px 12px 12px; }
  .md-thread-open { margin-left: 0; }
  .md-share span.md-share-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .md-pulse::after { animation: none; }
}
