/* ==========================================================================
   Help The Poor Initiative — Stories page
   Page-specific only. Tokens, header, footer, page banner and the CTA band
   all come from css/style.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Featured story
   -------------------------------------------------------------------------- */
.featured { padding: 72px 0 0; }

.feature {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--speed) var(--ease);
}

.feature:hover { box-shadow: var(--shadow-md); }

.feature-media {
  position: relative;
  min-height: 380px;
}

.feature-media .media { height: 100%; border-radius: 0; }

.feature:hover .media > img:not(.is-missing) { transform: scale(1.04); }

.feature-flag {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-family: var(--font-display);
  font-size: .6875rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.feature-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 3.6vw, 46px);
}

.feature-title {
  margin-top: 14px;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  line-height: 1.2;
  color: var(--ink);
}

.feature-title a { color: inherit; }
.feature-title a:hover { color: var(--green); }

.feature-body > p {
  margin-top: 14px;
  font-size: 1.0625rem;
  line-height: 1.78;
  color: var(--muted);
}

.feature-actions { margin-top: 24px; }

/* --------------------------------------------------------------------------
   2. Story meta (shared by feature and cards)
   -------------------------------------------------------------------------- */
.story-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .75rem;
  color: var(--muted);
}

.cat {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, var(--green)) 12%, #fff);
  color: var(--accent, var(--green));
  font-family: var(--font-display);
  font-size: .6875rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.story-meta time { font-variant-numeric: tabular-nums; }

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: .5;
}

/* --------------------------------------------------------------------------
   3. Filters
   -------------------------------------------------------------------------- */
.stream { padding: 62px 0 84px; }

.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 12px;
}

.filter {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-family: var(--font-display);
  font-size: .8125rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--speed) var(--ease);
}

.filter:hover {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  color: var(--green);
}

.filter[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.filter-count {
  margin: 0 0 26px;
  font-size: .875rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   4. Story grid
   -------------------------------------------------------------------------- */
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  scroll-margin-top: calc(var(--header-h) + 24px);
  transition: transform var(--speed) var(--ease),
              box-shadow var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}

.card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent, var(--green)) 38%, var(--line));
  box-shadow: var(--shadow-md);
}

.card:hover .media > img:not(.is-missing) { transform: scale(1.06); }

/* Accent bar sweeps across the top, matching the programme cards */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 3;
  background: var(--accent, var(--green));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .6s cubic-bezier(.16, 1, .3, 1);
}

.card:hover::before { transform: scaleX(1); }

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 22px 24px;
}

.card-title {
  margin-top: 12px;
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--ink);
}

/* The whole card is clickable via the stretched title link */
.card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card-title a { color: inherit; }
.card:hover .card-title a { color: var(--accent, var(--green)); }

.card-body p {
  flex: 1;
  margin: 10px 0 16px;
  font-size: .9375rem;
  line-height: 1.68;
  color: var(--muted);
}

.card-read {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: .8125rem;
  font-weight: 700;
  color: var(--accent, var(--green));
}

.card-read svg { transition: transform var(--speed) var(--ease); }
.card:hover .card-read svg { transform: translateX(4px); }

/* Hidden by the filter — not display:none, so the reveal state survives */
.card[hidden] { display: none; }

/* Empty state */
.no-results {
  display: none;
  padding: 54px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-alt);
}

.no-results.is-shown { display: block; }

.no-results h3 {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--ink);
}

.no-results p {
  margin-top: 8px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   5. Subscribe strip
   -------------------------------------------------------------------------- */
.subscribe { padding: 0 0 84px; }

.subscribe-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  padding: 40px clamp(24px, 4vw, 46px);
  border-radius: var(--radius-lg);
  background: var(--cream);
  border: 1px solid #EFE7D6;
}

.subscribe-card h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  color: var(--ink);
}

.subscribe-card p {
  max-width: 56ch;
  margin-top: 10px;
  line-height: 1.75;
  color: var(--muted);
}

.subscribe-form {
  display: flex;
  width: min(420px, 100%);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
}

.subscribe-input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 0;
  font-size: .9375rem;
  color: var(--ink);
}

.subscribe-input:focus { outline: none; }
.subscribe-form:focus-within { box-shadow: 0 0 0 3px rgba(30, 92, 38, .18); }

.subscribe-btn {
  flex: none;
  border-radius: 0;
  padding: 14px 22px;
  font-size: .75rem;
}

.subscribe-btn:hover { transform: none; }

.subscribe-note {
  min-height: 20px;
  margin-top: 10px;
  font-size: .8125rem;
  font-weight: 500;
}

.subscribe-note.is-ok    { color: var(--green); }
.subscribe-note.is-error { color: var(--red); }

/* --------------------------------------------------------------------------
   6. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .story-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
  .feature { grid-template-columns: 1fr; }
  .feature-media { min-height: 0; aspect-ratio: 16 / 9; }
  .subscribe-card { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 768px) {
  .featured { padding-top: 52px; }
  .stream { padding: 46px 0 62px; }
  .subscribe { padding-bottom: 58px; }
  .story-grid { grid-template-columns: 1fr; }
  .filters { gap: 8px; }
  .filter { padding: 8px 13px; font-size: .75rem; }
}

@media (max-width: 560px) {
  .subscribe-form { flex-direction: column; }
  .subscribe-btn { width: 100%; }
}
