/*
 * BS5 news / event feed cards — shared by BS5 Modern and BS5 Legacy chrome.
 * Markup: newsreaders/_feed_bs5.html.erb + events/_feed_bs5.html.erb
 * (Card / Image Left / Image Right / Photo + list/calendar/headlines/…).
 *
 * Loaded from layouts/bs5/partials/_meta.html.erb (Modern) and, for Legacy,
 * still also present under .default-layout--bs5-chrome in
 * default_shared_custom.css until that duplicate is retired.
 */

.dfc-bs5-feed-card {
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: #fff;
  transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}
.dfc-bs5-feed-card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12) !important;
  transform: translateY(-2px);
}
/* Show the full image at its natural aspect ratio (no cropping) so admins'
   chosen framing is preserved. The media block fills the card width.
   border-radius matches the card so the image reads as its own polished
   element — same rule applies to the inner <img> for cases where the
   image is narrower than the card (portrait photo, square logo, etc.). */
.dfc-bs5-feed-card__media {
  display: block;
  overflow: hidden;
  background-color: #f5f5f5;
  border-radius: 0.5rem;
}
.dfc-bs5-feed-card__img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 0.5rem;
  transition: transform 0.4s ease-in-out;
}
.dfc-bs5-feed-card:hover .dfc-bs5-feed-card__img {
  transform: scale(1.04);
}
.dfc-bs5-feed-card .card-body {
  position: relative;
}
.dfc-bs5-feed-card h2.title,
.dfc-bs5-feed-card h2.event {
  line-height: 1.25;
  margin: 0 0 0.5rem;
}
.dfc-bs5-feed-card h2.title a,
.dfc-bs5-feed-card h2.event a {
  color: inherit;
}
.dfc-bs5-feed-card h2.title a:hover,
.dfc-bs5-feed-card h2.event a:hover {
  text-decoration: underline;
}
.dfc-bs5-feed-card .newsbodyclip {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dfc-bs5-feed-card .read-more {
  color: var(--bs-primary, #0d6efd);
}
.dfc-bs5-feed-card:hover .read-more {
  text-decoration: underline;
}
/* Keep the "from parish" attribution link clickable alongside .stretched-link
   on the title (Bootstrap docs: sibling links need z-index above the overlay). */
.dfc-bs5-feed-card .from a {
  position: relative;
  z-index: 2;
}
/* Cancel the legacy .item zoom/scale hover effect inside the BS5 card so the
   stretched-link surface stays stable. */
.dfc-bs5-feed-card .item,
.dfc-bs5-feed-card .item:hover,
.dfc-bs5-feed-card .item img,
.dfc-bs5-feed-card .item img:hover {
  transform: none;
  box-shadow: none;
}

/* =========================================================================
 * BS5 feed display-style variants
 * Shared by newsreaders/_feed_bs5.html.erb (Card / Image Left / Image Right /
 * Photo), plus the list/calendar/headlines/accordion/accessible styles. The
 * goal: a full-width single-column page should never blow a feed image up to
 * an enormous size on desktop — image-left/right and the capped hero solve
 * the "too much image" problem, while everything stacks cleanly on phones.
 * ========================================================================= */

/* ── Feed section heading (the admin's "Feed Title") ── */
.dfc-bs5-feed-heading {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--bs-border-color, #e0e0e0);
}
.dfc-bs5-feed-heading__link { color: inherit; text-decoration: none; }
.dfc-bs5-feed-heading__link:hover,
.dfc-bs5-feed-heading__link:focus {
  color: var(--bs-primary, #0d6efd);
  text-decoration: underline;
}

/* ── Card (stacked): cap the hero height on wide desktop columns so a
   full-width feed reads as a tidy card rather than a giant photo. Phones
   keep the natural image. ── */
@media (min-width: 768px) {
  .dfc-bs5-feed-card--stacked .dfc-bs5-feed-card__media {
    max-height: 340px;
  }
  .dfc-bs5-feed-card--stacked .dfc-bs5-feed-card__media .dfc-bs5-feed-card__img {
    height: 100%;
    object-fit: cover;
  }
}

/* ── Image Left / Image Right: two-column card on tablet/desktop, media at a
   constrained share of the width; collapses to a stacked card on phones. ── */
@media (min-width: 768px) {
  .dfc-bs5-feed-card--image-left { flex-direction: row; }
  .dfc-bs5-feed-card--image-right { flex-direction: row-reverse; }
  .dfc-bs5-feed-card--image-left,
  .dfc-bs5-feed-card--image-right {
    align-items: stretch;
  }
  .dfc-bs5-feed-card--image-left .dfc-bs5-feed-card__media,
  .dfc-bs5-feed-card--image-right .dfc-bs5-feed-card__media {
    flex: 0 0 38%;
    max-width: 38%;
    min-height: 180px;
    border-radius: 0.5rem;
  }
  .dfc-bs5-feed-card--image-left .dfc-bs5-feed-card__media .dfc-bs5-feed-card__img,
  .dfc-bs5-feed-card--image-right .dfc-bs5-feed-card__media .dfc-bs5-feed-card__img {
    height: 100%;
    object-fit: cover;
  }
  .dfc-bs5-feed-card--image-left .dfc-bs5-feed-card__body,
  .dfc-bs5-feed-card--image-right .dfc-bs5-feed-card__body {
    flex: 1 1 62%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* ── Photo: image-forward card with the title + date overlaid on a gradient. ── */
.dfc-bs5-feed-card--photo .dfc-bs5-feed-card__media {
  position: relative;
  max-height: 440px;
}
.dfc-bs5-feed-card--photo .dfc-bs5-feed-card__media .dfc-bs5-feed-card__img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}
.dfc-bs5-feed-card--photo .dfc-bs5-feed-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem 1.1rem 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0) 75%);
  color: #fff;
}
.dfc-bs5-feed-card--photo .dfc-bs5-feed-card__overlay-title a,
.dfc-bs5-feed-card--photo .dfc-bs5-feed-card__overlay-date {
  color: #fff;
}

/* ── List (Title & Date) ── */
.dfc-bs5-feed--list .dfc-bs5-feed-item {
  position: relative;
  padding: 1rem 0;
  border-bottom: 1px solid #eaeaea;
}
.dfc-bs5-feed--list .dfc-bs5-feed-item:last-child { border-bottom: 0; }
.dfc-bs5-feed--list .dfc-bs5-feed-item__title a { color: inherit; }
.dfc-bs5-feed--list .dfc-bs5-feed-item:hover .dfc-bs5-feed-item__title a { text-decoration: underline; }
/* Sibling links (parish attribution) must sit above the stretched-link overlay. */
.dfc-bs5-feed--list .dfc-bs5-feed-item__from a {
  position: relative;
  z-index: 2;
}
.dfc-bs5-feed--list .read-more,
.dfc-bs5-feed--calendar .read-more {
  color: var(--bs-primary, #0d6efd);
}

/* ── Calendar (date badge) ── */
.dfc-bs5-feed--calendar .dfc-bs5-cal-item {
  position: relative;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid #eaeaea;
}
.dfc-bs5-feed--calendar .dfc-bs5-cal-item:last-child { border-bottom: 0; }
.dfc-bs5-cal-item__date {
  flex: 0 0 64px;
  width: 64px;
  text-align: center;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  padding: 0.4rem 0;
  line-height: 1.1;
}
.dfc-bs5-cal-item__month {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-primary, #0d6efd);
}
.dfc-bs5-cal-item__day { display: block; font-size: 1.4rem; font-weight: 700; color: #212529; }
.dfc-bs5-cal-item__title a { color: inherit; }
.dfc-bs5-feed--calendar .dfc-bs5-cal-item:hover .dfc-bs5-cal-item__title a { text-decoration: underline; }

/* ── Headlines (compact link list) ── */
.dfc-bs5-feed--headlines .dfc-bs5-headline + .dfc-bs5-headline { border-top: 1px solid #eaeaea; }
.dfc-bs5-headline__link { padding: 0.65rem 0; color: #212529; }
.dfc-bs5-headline__link:hover .dfc-bs5-headline__title,
.dfc-bs5-headline__link:focus .dfc-bs5-headline__title {
  color: var(--bs-primary, #0d6efd);
  text-decoration: underline;
}
.dfc-bs5-headline__chevron { color: #adb5bd; flex: 0 0 auto; }

/* ── Accessible (high-contrast, larger type, visible focus) ── */
.dfc-bs5-feed--ada .dfc-bs5-ada-item {
  padding: 1.25rem 0;
  border-bottom: 2px solid #dee2e6;
}
.dfc-bs5-feed--ada .dfc-bs5-ada-item:last-child { border-bottom: 0; }
.dfc-bs5-feed--ada .dfc-bs5-ada-item__title-link { color: #0b3d91; text-decoration: underline; }
.dfc-bs5-feed--ada .dfc-bs5-ada-item__title-link:hover,
.dfc-bs5-feed--ada .dfc-bs5-ada-item__title-link:focus { color: #06245c; }
.dfc-bs5-feed--ada .dfc-bs5-ada-item__meta { font-size: 1rem; color: #3f474e; }
.dfc-bs5-feed--ada .dfc-bs5-ada-item__body { font-size: 1.05rem; line-height: 1.7; color: #212529; }
.dfc-bs5-feed--ada .dfc-bs5-ada-item__img { width: 100%; max-height: 360px; object-fit: cover; }
.dfc-bs5-feed--ada .dfc-bs5-ada-item__more { color: #0b3d91; text-decoration: underline; }
.dfc-bs5-feed--ada a:focus-visible { outline: 3px solid #0b5ed7; outline-offset: 2px; }

/* ── Accordion (Well) ── */
.dfc-bs5-feed--well .accordion-button { font: inherit; }
.dfc-bs5-well__head { display: flex; align-items: center; gap: 0.85rem; width: 100%; }
.dfc-bs5-well__thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 0.4rem; flex: 0 0 auto; }
.dfc-bs5-well__title { display: block; }
.dfc-bs5-feed--well .accordion-body > :last-child { margin-bottom: 0; }

