/* ============================================================
   COMPONENTS.CSS
   Batten University — Reusable UI Components

   Shared across section and content pages.
   Homepage maintains its own component styles (homepage.css).

   Contents:
     1. Card Grid
     2. Card Base
     3. Card Structural Variants
        — card--link
        — card--content
        — card--horizontal
     4. Card Skin Modifiers
        — card--teal-border
        — card--light-blue
     5. Card Link System
        — card-link--text
        — card-link--blue-btn
     6. Page CTA Block
     7. Event List
     8. Reduced Motion

   NEW PALETTE ADDITIONS (add these to global.css :root):
     --color-border-tint:  #EBF7FF   (subtle blue-tinted borders)
     --text-muted-mid:     #555555   (page-cta body text)
     --text-muted-dark:    #666666   (event timestamps, secondary info)
/* ============================================================
   CARD GRID SYSTEM
   Batten University — components.css

   Converted from CSS Grid to Flexbox to solve the orphaned
   last-row alignment problem. A 5-card 3-up grid no longer
   dumps a single card hard left — orphans center naturally.

   Class names are identical to the old system.
   No HTML changes required.

   .card-grid               base — single column, mobile first
   .card-grid--2up          max 2 columns, centers orphans
   .card-grid--3up          max 3 columns, centers orphans
   .card-grid--4up          max 4 columns, centers orphans
   .card-grid--content      max 2 columns, sidemenu content area

   HOW THE FLEX SIZING WORKS:
   Cards use flex-basis to set their target width per breakpoint.
   The gap is accounted for in the calc() so columns stay true.
   flex: 0 1 [basis] means cards won't grow past their column
   width but will shrink if needed. min-width prevents cards
   from getting too narrow on small containers.
============================================================ */


/* ============================================================
   BASE — single column, mobile first
   justify-content: center is the key — this is what makes
   orphaned last-row cards center instead of left-align.
============================================================ */

.card-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 1.5rem;
  margin: 0 auto;
  padding: 0;
}

/* All direct card children default to full width */
.card-grid > .card,
.card-grid > [class*="card"] {
  flex: 0 1 100%;
  min-width: 0;
}


/* ============================================================
   2-UP
   1 column mobile → 2 columns at 768px
   Orphan of 1: centers perfectly.
============================================================ */

@media (min-width: 768px) {
  .card-grid--2up {
    gap: 2rem;
  }

.card-grid--2up > .card, .card-grid--2up > [class*="card"] {
	flex: 0 1 calc(50% - 1rem);
	min-width: 280px;
	max-width: 515px;
  height: auto;
}
}


/* ============================================================
   3-UP
   1 column mobile → 2 columns at 768px → 3 columns at 1200px
   Orphan of 1: centers. Orphan of 2: centers as a pair.
============================================================ */

@media (min-width: 768px) {
  .card-grid--3up {
    gap: 2rem;
    padding: 0 1rem;
  }

  .card-grid--3up > .card,
  .card-grid--3up > [class*="card"] {
    flex: 0 1 calc(50% - 1rem);
    min-width: 260px;
  }
}

@media (min-width: 1200px) {
  .card-grid--3up {
    gap: 3rem 1.25rem;
    padding: 0;
  }

  .card-grid--3up > .card,
  .card-grid--3up > [class*="card"] {
    /* 1.25rem gap × 2 gaps ÷ 3 cards = ~0.833rem per card */
    flex: 0 1 calc(33.333% - 0.834rem);
    min-width: 260px;
  }
}

@media (min-width: 1600px) {
  .card-grid--3up {
    gap: 3rem 2rem;
  }

  .card-grid--3up > .card,
  .card-grid--3up > [class*="card"] {
    /* 2rem gap × 2 gaps ÷ 3 cards = ~1.333rem per card */
    flex: 0 1 calc(33.333% - 1.334rem);
  }
}


/* ============================================================
   4-UP
   1 column → 2 at 768px → 4 at 1200px
   Orphan of 1: centers. Orphan of 2: centers as pair.
   Orphan of 3: centers as trio.
============================================================ */

@media (min-width: 768px) {
  .card-grid--4up {
    gap: 2rem;
  }

  .card-grid--4up > .card,
  .card-grid--4up > [class*="card"] {
    flex: 0 1 calc(50% - 1rem);
    min-width: 240px;
  }
}

@media (min-width: 1200px) {
  .card-grid--4up {
    gap: 2rem 1.25rem;
  }

  .card-grid--4up > .card,
  .card-grid--4up > [class*="card"] {
    /* 1.25rem gap × 3 gaps ÷ 4 cards = ~0.9375rem per card */
    flex: 0 1 calc(25% - 0.938rem);
    min-width: 200px;
  }
}

@media (min-width: 1600px) {
  .card-grid--4up {
    gap: 2rem;
  }

  .card-grid--4up > .card,
  .card-grid--4up > [class*="card"] {
    /* 2rem gap × 3 gaps ÷ 4 cards = 1.5rem per card */
    flex: 0 1 calc(25% - 1.5rem);
  }
}


/* ============================================================
   CONTENT
   Max 2-up, sized for sidemenu content area.
   Orphan centers the same as 2-up.
============================================================ */

@media (min-width: 768px) {
  .card-grid--content {
    gap: 2rem;
  }

  .card-grid--content > .card,
  .card-grid--content > [class*="card"] {
    flex: 0 1 calc(50% - 1rem);
    min-width: 240px;
  }
}


/* ============================================================
   CARD BASE
   No changes from your current version — kept here for
   reference. The internal flex column is what makes equal
   heights work across the flex row.
============================================================ */

.card {
  position: relative;
  background: var(--color-white);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(99, 99, 99, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: auto;
  transition: transform .25s ease, box-shadow .25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card:not(.card--link):hover .card-title {
  color: var(--brand-primary-dark);
}

/* Image wrapper */
.card-image {
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Body */
.card-body {
  padding: 1.25rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Title */
.card-title {
  font-family: var(--font-kanit);
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  color: var(--brand-primary-dark);
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

/* Text */
.card-text {
  color: var(--text-body);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}


/* ============================================================
   3. CARD STRUCTURAL VARIANTS
============================================================ */

/* ── card--link ─────────────────────────────────────────────
   The entire card is a clickable link.
   Used on section landing pages for navigation cards.
   Arrow appended to title indicates clickability.
── */
.card--link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  height: auto;
}

.card--link .card-body {
  display: block;
}

.card--link .card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand-primary);
  transition: color .25s ease;
}

.card--link:hover .card-title {
  color: var(--brand-accent);
}

/* Arrow indicator */
.card-arrow {
  width: .4em;
  height: .4em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  display: inline-block;
  flex-shrink: 0;
  transition: transform .25s ease;
  color: var(--brand-primary);
}

.card--link:hover .card-arrow {
  transform: translateX(4px) rotate(-45deg);
  color: var(--brand-accent);
}


/* ── card--content ──────────────────────────────────────────
   Image on top, body below with title, text, and button CTA.
   The standard card for visit pages, program listings, etc.
   Uses card-link system for the CTA (see section 5).
── */
.card--content .card-image img {
  height: 220px;
  object-fit: cover;
}

@media (min-width: 1200px) {
  .card--content .card-image img {
    height: 240px;
  }
}


/* ── card--horizontal ───────────────────────────────────────
   Image/logo left, body right.
   Always single column — use with base .card-grid only.
   Good for hotel listings, staff profiles, accommodations.
── */
@media (min-width: 576px) {
  .card--horizontal {
    flex-direction: row;
  }

  .card--horizontal .card-image {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    border-bottom: none;
    border-right: 1px solid #eee;
    padding: 1rem;
  }

  .card--horizontal .card-image img {
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
  }

  .card--horizontal .card-body {
    width: calc(100% - 220px);
  }
}


/* ============================================================
   4. CARD SKIN MODIFIERS

   Stack on top of any structural variant.
   Control color and border treatment.
   Always imageless — border replaces image as visual anchor.
============================================================ */

/* ── card--teal-border ──────────────────────────────────────
   White background, teal left accent border.
   Use on white or light section backgrounds.
── */
.card--teal-border {
  border-left: 4px solid var(--brand-accent);
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(99, 99, 99, 0.15);
}

.card--teal-border .card-body {
  padding: 1.5rem 1.5rem 1.5rem 1.25rem;
}


/* ── card--light-blue ───────────────────────────────────────
   Light blue background, teal left accent border.
   Use on white backgrounds — directions, info blocks, etc.
── */
.card--light-blue {
  background: var(--surface-tint);
  border-left: 3px solid var(--brand-accent);
  border-radius: 0 3px 3px 0;
  box-shadow: none;
}

.card--light-blue .card-body {
  padding: 1rem 1rem 1rem 1.25rem;
}

.card--light-blue .card-title {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
}

.card--light-blue .card-text {
  font-size: .975rem;
  line-height: 1.6;
}

.card--light-blue p + p {
  margin-top: .5rem;
}


/* ============================================================
   5. CARD LINK SYSTEM

   CTA links and buttons inside card-body.
   Base handles resets and transitions.
   Always pair with a modifier.

   .card-link--text        teal underline, inline link style
   .card-link--blue-btn    filled blue button, teal ring on hover
============================================================ */

/* Base */
.card-link {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  margin-top: 1rem;
  transition:
    color .2s ease,
    background-color .2s ease,
    border-color .2s ease,
    box-shadow .2s ease;
}

/* Text link with teal underline */
.card-link--text {
  color: var(--brand-primary-dark);
  padding-bottom: 2px;
  border-bottom: 2px solid var(--brand-accent);
}

.card-link--text:hover,
.card-link--text:focus-visible {
  color: var(--brand-accent);
  border-color: var(--brand-primary-dark);
}

/* Breathing room between adjacent text links */
.card-link--text + .card-link--text {
  margin-left: 1.5rem;
}

/* Filled blue button, teal ring on hover */
.card-link--blue-btn {
  display: block;
  text-align: center;
  background: var(--brand-primary-dark);
  color: var(--color-white);
  border: 1px solid var(--brand-primary-dark);
  border-radius: 2px;
  padding: .75rem .5rem;
  font-size: clamp(.95rem, 1vw, 1.05rem);
  align-self: flex-start;
  min-width: 160px;
}

@media (max-width: 991px) {
  .card-link--blue-btn {
    align-self: stretch; /* full width below desktop */
  }
}

.card-link--blue-btn:hover,
.card-link--blue-btn:focus-visible {
  background: transparent;
  color: var(--brand-primary-dark);
  box-shadow:
    0 0 0 2px var(--brand-accent),
    0 4px 12px rgba(0, 145, 184, 0.2);
}


/* ============================================================
   6. PAGE CTA BLOCK

   Reusable call-to-action container.
   Light blue background, centered content.
   Use at the bottom of content pages for registration
   links, contact prompts, or primary page actions.

   Usage:
     <div class="page-cta">
       <a class="btn btn--blue" href="...">Register Now</a>
       <p>Questions? Call or email us.</p>
     </div>
============================================================ */

.page-cta {
  background: var(--surface-tint);
  border: 1px solid var(--color-border-tint);
  border-radius: 3px;
  padding: 1.5rem;
  margin-top: 2rem;
  text-align: center;
}

.page-cta p {
  margin-top: .75rem;
  font-size: .925rem;
  color: var(--text-muted-mid);
}

.page-cta p:last-child {
  margin-bottom: 0;
}


/* ============================================================
   7. EVENT LIST

   Reusable date/event row component.
   Used on Marlins Day, Marlin Mondays, info session pages,
   and anywhere else dated events need to be listed.

   Standalone usage (list of dates, e.g. Marlins Day):
     <div class="event-list">
       <a class="event-item" href="...">...</a>
     </div>

   Inside a card (e.g. Marlin Mondays):
     <a class="event-item event-item--card" href="...">...</a>

   Markup pattern:
     <a class="event-item" href="..." target="_blank" rel="noopener">
       <div class="event-item--cal">
         <span class="event-item--month">Jan</span>
         <span class="event-item--day">12</span>
       </div>
       <div class="event-item--info">
         <div class="event-item--label">Session title or Register</div>
         <div class="event-item--time">Monday, January 12, 2026 — 6:00 p.m.</div>
       </div>
       <span class="event-item--arrow">›</span>
     </a>
============================================================ */

/* ── Wrapper for standalone date lists ── */
.event-list {
  margin: 1.5rem 0 2rem;
}

/* ── Row ── */
.event-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: .875rem 1rem;
  border-bottom: 1px solid #eee;
  text-decoration: none;
  color: inherit;
  transition: background .2s ease, padding-left .2s ease;
}

.event-list .event-item:first-child {
  border-top: 1px solid #eee;
}

.event-item:hover {
  background: var(--surface-tint);
  padding-left: 1.5rem;
  color: inherit;
}

.event-item:hover .event-item--label {
  color: var(--brand-accent);
}

/* ── Calendar badge ── */
.event-item--cal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface-dark);
  color: var(--color-white);
  border-radius: 3px;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  text-align: center;
  line-height: 1;
  padding: .35rem;
}

.event-item--month {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--brand-accent-light);
}

.event-item--day {
  font-family: var(--font-merriweather);
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: .1rem;
}

/* ── Text block ── */
.event-item--info {
  flex: 1;
  min-width: 0;
}

.event-item--label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-primary-dark);
  transition: color .2s ease;
}

.event-item--time {
  font-size: .875rem;
  color: var(--text-muted-dark);
  margin-top: .1rem;
}

/* ── Arrow ── */
.event-item--arrow {
  margin-left: auto;
  color: var(--brand-accent);
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ── Modifier: inside a card ──
   Replaces outer borders with a single top separator.
   Slightly smaller badge to suit the tighter context.
── */
.event-item--card {
  padding: .875rem 0 0;
  border-bottom: none;
  margin-top: 1.25rem;
  border-top: 1px solid var(--color-border-tint);
}

.event-item--card:hover {
  background: transparent;
  padding-left: 0;
}

.event-item--card .event-item--cal {
  width: 48px;
  height: 48px;
}

.event-item--card .event-item--day {
  font-size: 1.35rem;
}


/* ============================================================
   8. REDUCED MOTION
============================================================ */

@media (prefers-reduced-motion: reduce) {
  .card,
  .card--link,
  .card-arrow {
    transition: none !important;
    transform: none !important;
  }
}