/* Home page polish (v6). Loaded on index.html only, after style.css.
   Radius system (MGM scale, per Jayant's steer): cards and images 20px,
   buttons 10px, rows 16px, icon buttons round. Chips are pill, site-wide
   (v7: home's 10px chips were the odd ones out — life + gallery use pill).
   All colours and fonts come from the tokens in style.css. */

:root {
  --home-r-card: 20px;
  --home-r-img: 20px;
  --home-r-row: 16px;
  --home-green: #2e7d46;
}

/* ---------- Dates strip: three rounded cards ---------- */

.dates-strip .container { align-items: stretch; }
.date-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--home-r-img);
  padding: var(--space-4) var(--space-5);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.dates-strip .date-item + .date-item { border-left: 1px solid var(--line); padding-left: var(--space-5); }
.date-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-1); border-color: var(--line-strong); }

/* ---------- Welcome and Preventive System figures: soft frame, gentle zoom ---------- */

.split figure {
  border-radius: var(--home-r-img);
  overflow: clip;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-1);
}
.split figure img { transition: transform 0.6s var(--ease-out); }
.split figure:hover img { transform: scale(1.03); }
.split figure figcaption { padding: var(--space-3) var(--space-4) var(--space-4); }

/* ---------- Principal's quote: warm rounded card ---------- */

.quote-inline {
  background: var(--paper-warm);
  border-top: 0;
  border-radius: var(--home-r-img);
  padding: var(--space-5) var(--space-6);
}

/* ---------- Numbers: five rounded cards ---------- */

.numbers .number-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--home-r-card);
  padding: var(--space-5);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.number-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
/* One-line buttons, side by side — the old wrapping sentence is gone. */
.numbers-more { margin-top: var(--space-6); display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---------- Clubs, houses and values ---------- */

.home-subhead { margin: var(--space-7) 0 var(--space-4); }
.home-subhead:first-of-type { margin-top: 0; }
/* Clubs live in the shared .tile-grid (style.css): five equal tiles a row
   on desktop, three on tablet, two on a phone — no ragged last row. */
.tile-hint { color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 var(--space-3); }

/* ---------- Houses: four equal tiles, colour band on top ---------- */

.house-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); list-style: none; padding: 0; margin: 0; }
.house-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 96px;
  padding: 0;
  overflow: clip;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-soft);
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.house-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.house-tile[aria-pressed="true"] { border-color: var(--ink); box-shadow: var(--shadow-1); }
.house-swatch { height: 12px; flex-shrink: 0; }
.house-swatch-red { background: var(--red); }
.house-swatch-blue { background: var(--blue); }
.house-swatch-green { background: var(--home-green); }
.house-swatch-yellow { background: var(--gold); }
.house-name { flex: 1; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 1.05rem; color: var(--ink); }

/* ---------- Values: seven equal cards, not seven ragged rows ----------
   Four across on desktop (the seventh spans two, so the last row fills
   the grid exactly); two across on a phone (the seventh spans both). */
.home-values { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-values .meaning:last-child { grid-column: span 2; }

/* ---------- Pillars: three equal cards, numeral in a gold disc ----------
   Desktop: stacked cards, numeral left. The paragraph reserves the same
   number of lines in every card (4 wide, 5 at tablet width), so Reason
   (longest) no longer makes its card taller than Religion (shortest).
   Phone: the stack becomes a swipeable slider — one pillar at a time,
   the next card peeking in from the right, with arrows, dots and a
   "1 of 3" counter, so sliding is obvious. Slides share one row height
   by flex stretch, so all three cards are exactly the same height. */

.pillars { border-top: 0; }
.pillar {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--home-r-card);
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-4);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.pillar:last-child { margin-bottom: 0; }
.pillar:hover { transform: translateY(-3px); box-shadow: var(--shadow-1); border-color: var(--line-strong); }
.pillar p { min-height: calc(5 * 1.65em); }
.pillar-numeral {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}
.pillar-nav { display: none; }

@media (max-width: 1080px) {
  .pillar p { min-height: calc(6 * 1.65em); }
}

@media (max-width: 860px) {
  .pillars-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: var(--space-3);
    padding-bottom: var(--space-2);
    scrollbar-width: thin;
  }
  .pillars-slider .pillar {
    flex: 0 0 86%;
    scroll-snap-align: start;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .pillars-slider .pillar p { min-height: 0; }
  .pillar-nav { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); }
  .pillar-arrow {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: var(--paper);
    font-size: 1.5rem;
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .pillar-arrow:hover { border-color: var(--ink); box-shadow: var(--shadow-1); }
  .pillar-dots { display: flex; gap: 8px; flex: 1; justify-content: center; }
  .pillar-dot { width: 10px; height: 10px; border-radius: 50%; border: 0; background: var(--line-strong); padding: 0; cursor: pointer; transition: width 0.2s var(--ease-out), background-color 0.2s var(--ease-out); }
  .pillar-dot.is-active { width: 26px; border-radius: 5px; background: var(--red); }
  .pillar-count { font-size: 0.9rem; color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
}

/* ---------- Life at Bosco: captioned photo cards ---------- */

.photo-card {
  margin: 0;
  border-radius: var(--home-r-img);
  overflow: clip;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-1);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
.photo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.photo-card img { border-radius: 0; }
.photo-card img:hover { box-shadow: none; }
.photo-card figcaption { padding: var(--space-3) var(--space-4) var(--space-4); }

/* ---------- Toppers: hoverable rows, softer figure ---------- */

.toppers-figure img { border-radius: var(--home-r-img); }
.topper-row {
  border-bottom: 0;
  border-radius: var(--home-r-row);
  padding: var(--space-3) var(--space-5);
  transition: background-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.topper-row:hover { background: var(--band); transform: translateX(4px); }

/* ---------- News: equal cards on home (news.html keeps its list) ----------
   Three cards in a row on desktop, one column on a phone. Every card is
   the same height: heading reserves two lines, description three, and
   the tag sits pinned to the bottom edge of every card. */
.news-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--space-4); border-top: 0; }
.news-cards .news-item {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--home-r-img);
  padding: var(--space-5) var(--space-6);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.news-cards .news-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-1); border-color: var(--line-strong); }
.news-cards .news-item h3 { min-height: calc(2 * 1.3em); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-cards .news-item p { min-height: calc(3 * 1.65em); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: var(--space-4); }
.news-cards .news-item .news-tag { margin-top: auto; align-self: flex-start; }

/* ---------- CTA band: softer corners, two actions ---------- */

.cta-band { border-radius: var(--home-r-card); box-shadow: var(--shadow-2); }
.cta-actions { display: flex; flex-direction: column; gap: var(--space-3); }
.cta-actions .btn { width: 100%; }

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
  .pillar { padding: var(--space-4) var(--space-5); }
  .pillar-numeral { width: 52px; height: 52px; font-size: 1.5rem; }
  .news-item { padding: var(--space-4) var(--space-5); }
  .quote-inline { padding: var(--space-4) var(--space-5); }
  .house-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-values .meaning:last-child { grid-column: span 2; }
  /* Narrower cards, slightly smaller labels, so every stat label still
     fits its two-line budget on a small phone. */
  .numbers .number-item { padding: var(--space-4); }
  .number-label { font-size: 0.9rem; }
}

/* Three news cards across is too narrow at tablet width — two across keeps
   every heading inside two lines and every description in three. (Placed
   last: the base three-column rule sits above, so this must come after
   it to win at tablet widths.) */
@media (max-width: 1080px) {
  .news-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .news-cards { grid-template-columns: minmax(0, 1fr); }
}
