/* ============================================================
   pc-events.css — sitewide Planning Center events component.

   Loaded via the footer partial. Renders the cards produced by
   /js/pc-events.js (data source: /data/events/<tag>.json built
   by scripts/build-pc-events.py).

   Anatomy:

   .pc-events                              outer container the page drops in
     .pc-events__grid                      auto-fit grid of cards
       .pc-events__card                    one card per upcoming event
         .pc-events__link                  full-card anchor
           .pc-events__media               16:10 image with rounded corners
             img
           .pc-events__body                copy stack
             .pc-events__tag               small pill (e.g. "Church wide")
             .pc-events__date              prominent date row
               <strong>                    e.g. "Wed, Jun 17"
               .pc-events__time            e.g. "6:00 PM"
             .pc-events__title             event name
             .pc-events__desc              one short line of summary
             .pc-events__cta               "See details ›"
     .pc-events__empty                     fallback when zero events return
       .pc-events__empty-link              link to full calendar

   Designed to inherit the host page's color tokens. Uses the same
   --nh-* and --fg/--bg variables as the rest of the site, so a kids
   page using this component looks consistent with a /care/ page
   using the same component.
   ============================================================ */

.pc-events { display: block; }

/* Subtle loading shim so cards landing don't shift the page. */
.pc-events--loading { min-height: 320px; }

.pc-events__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(20px, 2.5vw, 32px);
  margin: 0;
}

.pc-events__card {
  background: var(--bg, #fff);
  border: 1px solid var(--line, #e6e2da);
  border-radius: var(--r-lg, 14px);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.pc-events__card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -16px rgba(20, 18, 12, 0.22);
  border-color: rgba(184, 50, 39, 0.30);
}

.pc-events__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.pc-events__media {
  position: relative;
  overflow: hidden;
  background: var(--nh-cream, #f6f2ec);
  aspect-ratio: 16 / 10;
}
.pc-events__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Placeholder media — used when the PC event has no image set. Keeps the
   card visually consistent with image-bearing cards. Brand-cream tint, big
   tag label, calendar glyph bottom-right. */
.pc-events__media--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg,
      rgba(184, 50, 39, 0.06) 0%,
      rgba(45, 91, 94, 0.06) 100%),
    var(--nh-cream, #f6f2ec);
  color: var(--nh-teal-deep, #1C3F42);
  padding: clamp(16px, 2.4vw, 32px);
  text-align: center;
}
.pc-events__placeholder-label {
  font-family: var(--font-display, "Outfit", sans-serif);
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--nh-teal-deep, #1C3F42);
  opacity: 0.92;
  max-width: 16ch;
}
.pc-events__placeholder-glyph {
  position: absolute;
  bottom: 12px; right: 14px;
  width: 22px; height: 22px;
  color: var(--nh-red, #B83227);
  opacity: 0.55;
}

.pc-events__body {
  padding: clamp(16px, 2vw, 22px) clamp(18px, 2.2vw, 24px) clamp(18px, 2.2vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.pc-events__tag {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--nh-red, #b83227);
  margin: 0;
}

.pc-events__date {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-display, "Bitter", serif);
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.2;
  color: var(--fg, #141210);
}
.pc-events__date strong { font-weight: 700; }
.pc-events__time {
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-mute, #6b6862);
  letter-spacing: 0.01em;
}

.pc-events__title {
  font-family: var(--font-display, "Bitter", serif);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  line-height: 1.18;
  margin: 0;
  color: var(--fg, #141210);
}

.pc-events__desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--nh-ink-2, #3d3a35);
  margin: 0;
  /* Cap at ~3 lines so cards don't grow unevenly when one event has a long summary. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-events__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nh-red, #b83227);
  letter-spacing: 0.01em;
}
.pc-events__cta svg {
  transition: transform 160ms ease;
}
.pc-events__card:hover .pc-events__cta svg {
  transform: translateX(2px);
}

/* ----------------------------------------------------------------
   Empty state — shown when a tag has zero upcoming events.
   Intentionally calm; no error treatment, no scarcity vibe.
---------------------------------------------------------------- */
.pc-events__empty {
  padding: clamp(28px, 4vw, 40px);
  background: var(--nh-cream, #f6f2ec);
  border: 1px dashed var(--line, #e6e2da);
  border-radius: var(--r-lg, 14px);
  text-align: center;
  color: var(--fg-mute, #6b6862);
}
.pc-events__empty p {
  margin: 0 0 12px;
  font-size: 15px;
}
.pc-events__empty-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--nh-red, #b83227);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid rgba(184, 50, 39, 0.30);
  padding-bottom: 1px;
}
.pc-events__empty-link:hover { border-bottom-color: var(--nh-red, #b83227); }
