/* ============================================================
   Feed List Item — subpage feed style
   Used on department pages, resource pages, etc.
   ============================================================ */

/* Spacing & dividers between view rows */
.dept-feed .views-row + .views-row,
.resource-feed .views-row + .views-row {
  padding-top: var(--space-8, 2rem);
  border-top: 1px solid var(--color-border, #e0e0e0);
  margin-top: var(--space-8, 2rem);
}

/* ── Title with accent underline (only under the text, not full width) ── */
.feed-list-item__title {
  font-size: var(--font-size-xl, 1.25rem);
  font-weight: var(--font-weight-bold, 700);
  line-height: 1.3;
  margin: 0 0 var(--space-4);
  color: var(--color-primary);
}

/* Hover/focus animation comes from the unified `.mvsd-link-anim` rule
   in base.css (the gradient-as-underline grow). No per-component
   overrides here; the title inherits color from `.feed-list-item__title`
   and gets the accent grow-in on hover via the shared rule. */
.feed-list-item__title a {
  color: inherit;
  padding-bottom: 0.15em;
}

/* ── Body: image left + summary right ── */
.feed-list-item__body {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space-5);
  align-items: start;
  margin-top: var(--space-3);
}

/* When no image, summary takes full width */
.feed-list-item__body:not(:has(.feed-list-item__image)) {
  grid-template-columns: 1fr;
}

/* ── Image ── */
.feed-list-item__image {
  flex-shrink: 0;
}

.feed-list-item__image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm, 4px);
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* Neutralise Drupal field wrapper */
.feed-list-item__image > a > div,
.feed-list-item__image > div,
.feed-list-item__image .field--type-image,
.feed-list-item__image .field__item {
  margin: 0;
  padding: 0;
}

/* ── Summary ── */
.feed-list-item__summary {
  font-size: var(--font-size-base, 1rem);
  line-height: 1.65;
  color: var(--color-text, #333);
}

.feed-list-item__summary p {
  margin: 0 0 var(--space-3);
}

.feed-list-item__readmore {
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: var(--font-weight-medium, 500);
  color: var(--color-primary-mid, #1a5276);
  text-decoration: none;
}

.feed-list-item__readmore:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Meta (date) — matches front page card date style ── */
.feed-list-item__meta {
  margin-top: var(--space-3);
  font-size: 0.75rem;
  color: var(--color-text-muted, #5a5a5a);
  text-transform: uppercase;
  letter-spacing: var(--ls-loose);
  font-weight: 500;
}

/* ── Mobile: stack image above summary ── */
@media (max-width: 540px) {
  .feed-list-item__body {
    grid-template-columns: 1fr;
  }

  .feed-list-item__image {
    max-width: 240px;
  }
}

/* ============================================================
   Pager (core pager.pager) — used on /departments/posts/{tid},
   /news, /news/schools, /news/district, /parents/all, etc.
   ============================================================ */

.pager {
  margin-top: var(--space-10, 2.5rem);
  padding-top: var(--space-6, 1.5rem);
  border-top: 1px solid var(--color-border, #e0e0e0);
}

.pager__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  align-items: center;
}

.pager__item { margin: 0; }

.pager__item a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm, 4px);
  background: var(--color-bg-subtle, #fafafb);
  border: 1px solid var(--color-border, #e0e0e0);
  color: var(--color-primary, #01491f);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.pager__item a:hover {
  background: var(--color-primary-light, #e8f5ed);
  border-color: var(--color-primary, #01491f);
  transform: translateY(-1px);
}

.pager__item a:focus-visible {
  outline: 2px solid var(--color-accent, #c5a000);
  outline-offset: 2px;
}

/* Active page — solid primary, no hover lift */
.pager__item.is-active a {
  background: var(--color-primary, #01491f);
  border-color: var(--color-primary, #01491f);
  color: #fff;
  cursor: default;
  transform: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}
.pager__item.is-active a:hover {
  background: var(--color-primary, #01491f);
  border-color: var(--color-primary, #01491f);
  color: #fff;
  transform: none;
}

/* Prev / Next / First / Last — wider with text + arrow */
.pager__item--first a,
.pager__item--previous a,
.pager__item--next a,
.pager__item--last a {
  padding: 0 0.95rem;
  font-size: 0.85rem;
  letter-spacing: var(--ls-snug);
  color: var(--color-text, #333);
}
.pager__item--first a:hover,
.pager__item--previous a:hover,
.pager__item--next a:hover,
.pager__item--last a:hover {
  color: var(--color-primary, #01491f);
}

/* Ellipsis (Drupal renders it as a span when present) */
.pager__item--ellipsis,
.pager__item span:not(.visually-hidden) {
  color: var(--color-text-muted, #5a5a5a);
  padding: 0 0.4rem;
}
.pager__item--ellipsis {
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .pager__item a { transition: none; }
  .pager__item a:hover { transform: none; }
}

@media (max-width: 540px) {
  .pager__items { gap: 0.3rem; }
  .pager__item a {
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 0.55rem;
    font-size: 0.85rem;
  }
  .pager__item--first a,
  .pager__item--previous a,
  .pager__item--next a,
  .pager__item--last a {
    padding: 0 0.7rem;
  }
}

/* ── feed list item: play badge over YouTube thumb ── */
.feed-list-item__image--video {
  position: relative;
}

.feed-list-item__image--video img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-list-item__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1.05rem;
  border-radius: 50%;
  pointer-events: none;
}

/* ── "District Announcements" (/news) — thumbnail-left teasers, a bit larger ───
   (2026-06-02) Desktop/tablet only. Reuses the shared feed-list-item style but a
   step LARGER, scoped via the page_1 display's css_class (`announcements-feed`).
   Supplies row dividers too (base dividers are scoped to .dept-feed/.resource-feed,
   which this view does not carry). */
.announcements-feed .views-row + .views-row {
  padding-top: var(--space-8, 2rem);
  border-top: 1px solid var(--color-border, #e0e0e0);
  margin-top: var(--space-8, 2rem);
}
.announcements-feed .feed-list-item__body {
  grid-template-columns: 220px 1fr;
  gap: var(--space-6, 1.5rem);
}
.announcements-feed .feed-list-item__title {
  font-size: 1.45rem;
}
.announcements-feed .feed-list-item__summary {
  font-size: 1.08rem;
  line-height: 1.6;
}

/* ── Mobile (<=600px): EVERY "view all posts" feed becomes a clean image-top card ─
   (2026-06-02, user ask) Generalized from .announcements-feed to the shared
   .feed-list-item so ALL feed-list pages get the same clean mobile design:
   department article feeds, parent/student/staff resource feeds, /news, etc.
   Each item = a self-framed card with a full-bleed 16:9 image on top, then
   padded title / summary / read-more / date. `display: contents` on the inner
   body promotes the image + summary into the card flex column so we can reorder
   to image-first via `order` without touching node--list.html.twig (DOM order
   is title -> [image, summary] -> date). */
@media (max-width: 600px) {
  /* Drop the row dividers in every feed context (each card self-frames). */
  .dept-feed .views-row + .views-row,
  .resource-feed .views-row + .views-row,
  .announcements-feed .views-row + .views-row {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
  }

  .feed-list-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e2e8e5);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  }

  /* Promote image + summary out of the inner grid into the card flex flow. */
  .feed-list-item__body {
    display: contents;
  }

  /* Visual order: image -> title -> summary -> date. */
  .feed-list-item__image {
    order: 1;
    max-width: none;
    margin: 0;
  }
  .feed-list-item__title {
    order: 2;
    margin: 0.9rem 1rem 0;
    font-size: 1.2rem;
    line-height: 1.3;
  }
  .feed-list-item__summary {
    order: 3;
    padding: 0.5rem 1rem 0;
    font-size: 0.98rem;
    line-height: 1.55;
  }
  .feed-list-item__meta {
    order: 4;
    margin: 0.7rem 1rem 1rem;
  }

  /* Full-bleed 16:9 cover image at the top of the card. */
  .feed-list-item__image img {
    width: 100%;
    border-radius: 0;
    aspect-ratio: 16 / 9;
    display: block;
  }

  .feed-list-item__readmore {
    display: inline-block;
    margin-top: 0.5rem;
  }
}
