/* =============================================
   SOLVERSTOP — Resource Cards (Footer)
   -----------------------------------------------
   Shared styles for the 3 footer resource cards
   (Latest News, Upcoming Event, Latest Article).

   Default: inner-page layout (220×260, horizontal expand).
   Homepage overrides these in homepage.css (300×360, vertical expand).
   ============================================= */

/* ---------- Final section wrapper ----------
   Used on every page as the last section. Contains:
   Part 1: CTA strip (blue bg, heading, text, button)
   Part 2: Resource cards (auto-generated from data files by resource-cards.js)
   Part 3: Footer (injected by components.js)
   min-height is auto — content determines height, no forced viewport fill. */
.final-section {
  width: 100%;
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  scroll-snap-align: start;
}
.final-cta-intro {
  width: 100%;
  background: var(--blue);
  text-align: center;
  padding: 32px 0;
}
.final-cta-intro h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.4;
  margin-bottom: 14px;
  text-wrap: balance;
}
.final-cta-intro p {
  color: var(--white);
  font-size: 1rem;
  opacity: 0.9;
  margin: 0 auto 20px;
  max-width: 900px;
  text-align: center;
  white-space: normal;
}
.final-top {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

/* ---------- Card row ---------- */
.resource-cards-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: var(--container-max);
  padding: 0 var(--container-pad);
}

/* ---------- Card wrap ---------- */
.resource-card-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Card (default: inner-page 220×260) ---------- */
.resource-card {
  position: relative;
  width: 220px;
  height: 260px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid var(--white);
  transition: width 0.45s ease, height 0.45s ease,
              box-shadow 0.35s ease, transform 0.35s ease,
              border-color 0.3s ease;
}
.resource-card:hover {
  box-shadow: var(--shadow-lg);
  transform: scale(1.10);
  border-color: var(--gold);
}
.resource-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Overlay (label + heading + body + readmore) ---------- */
.resource-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  transition: opacity 0.35s ease, top 0.45s ease;
}
.resource-card-label {
  background: var(--white);
  color: var(--black);
  padding: 6px 22px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.3s ease;
}
.resource-card:hover .resource-card-label {
  background: var(--gold);
}
.resource-card-heading {
  background: var(--black);
  color: var(--white);
  padding: 16px 22px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
}
.resource-card-heading .hover-letter { color: var(--white); }
.resource-card-heading .hover-letter:hover { color: var(--gold); }

/* Body text (hidden until expanded) */
.resource-card-body {
  background: rgba(245, 245, 245, 0.92);
  color: var(--black);
  padding: 18px 20px;
  font-size: 0.88rem;
  line-height: 1.7;
  text-align: left;
  margin: 0 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

/* ---------- "Click to open" button ---------- */
.resource-card-btn {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--white);
  background: rgba(0, 0, 0, 0.45);
  border: 1.5px solid var(--white);
  border-radius: var(--radius);
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.3s ease, background 0.3s ease,
              border-color 0.3s ease, opacity 0.3s ease;
  white-space: nowrap;
  font-family: var(--font);
  line-height: 1.3;
  z-index: 2;
}
.resource-card:hover .resource-card-btn {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.55);
}

/* ---------- Gold line under card ---------- */
.resource-card-line {
  margin-top: 14px;
  width: 60%;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.35s ease, width 0.35s ease;
  pointer-events: none;
}

/* ---------- "Read more" link ---------- */
.resource-card-readmore {
  display: none;
  padding: 10px 22px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  background: rgba(245, 245, 245, 0.92);
  margin: 0 10px;
  text-align: left;
  transition: color 0.3s ease;
}
.resource-card-readmore:hover { color: var(--gold); }

/* ---------- Expanded state (horizontal, inner pages) ---------- */
.resource-card.expanded {
  width: 506px;
  height: 260px;
  box-shadow: var(--shadow-lg);
  transform: none;
}
.resource-card.expanded:hover { transform: none; }
.resource-card.expanded img {
  width: 220px;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}
.resource-card.expanded .resource-card-overlay {
  top: 0;
  left: 220px;
  width: 286px;
  height: 100%;
  overflow-y: auto;
}
.resource-card.expanded .resource-card-label { background: var(--gold); }
.resource-card.expanded .resource-card-body {
  opacity: 1;
  pointer-events: auto;
  margin: 0;
  font-size: 0.82rem;
  padding: 14px 16px;
  line-height: 1.55;
}
.resource-card.expanded .resource-card-heading {
  padding: 12px 16px;
  font-size: 0.85rem;
}
.resource-card.expanded .resource-card-btn { opacity: 0; pointer-events: none; }
.resource-card.expanded .resource-card-readmore {
  display: block;
  margin: 0;
  padding: 8px 16px 12px;
  font-size: 0.8rem;
}
.resource-card-wrap:has(.resource-card.expanded) .resource-card-line {
  opacity: 1;
  width: 80%;
}

/* ---------- Full-card clickable link ---------- */
.resource-card-link-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}
.resource-card.expanded .resource-card-link-overlay { display: none; }

/* ---------- Responsive (inner pages) ---------- */
@media (max-width: 768px) {
  .final-section { min-height: auto; }
  .resource-cards-row { flex-direction: column; gap: 20px; align-items: center; padding: 0 16px; }
  .resource-card-wrap { min-width: 0; width: 100%; max-width: 340px; }
  .resource-card { width: 100%; max-width: 100%; height: 220px; }
  .resource-card-overlay { top: 0; }
  /* On mobile, expanded cards go vertical instead of horizontal */
  .resource-card.expanded { width: 100%; max-width: 100%; height: auto; min-height: 220px; }
  .resource-card.expanded img { width: 100%; height: 160px; position: static; }
  .resource-card.expanded .resource-card-overlay { left: 0; width: 100%; position: static; }
  .resource-card.expanded .resource-card-body { margin: 0; font-size: 0.82rem; padding: 12px 16px; }
  .resource-card.expanded .resource-card-heading { padding: 10px 16px; font-size: 0.85rem; }
  .resource-card.expanded .resource-card-readmore { margin: 0; padding: 8px 16px 12px; }
  .resource-card-btn { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  /* Disable hover scale on touch */
  .resource-card:hover { transform: none; }
  /* Ensure clickable overlay covers the card */
  .resource-card-link-overlay { z-index: 3; }
}

@media (max-width: 480px) {
  .resource-cards-row { gap: 16px; }
  .resource-card-wrap { max-width: 100%; }
  .resource-card { height: 200px; }
  .resource-card-heading { padding: 12px 16px; font-size: 0.85rem; }
}
