/*
 * Homepage (index.php). Everything is prefixed hm- and scoped under .hm-home so it cannot leak into other pages
 * and always outranks the legacy rules in style.css (global link colour, .content-section h2 underline, .stat-item p ...).
 * Light theme only (site-wide). Motion is transform/opacity only and switched off for prefers-reduced-motion.
 *
 * NOT restyled on purpose: .submission-card / .submission-card-link (the Creative Showcase cards). Their look and their
 * hover (lift, shadow, gold border, type tint, icon scale) live in style.css and are shared with views/partials/
 * submission_card.php, so this file never sets a property on them.
 */

.hm-home {
  --hm-navy: var(--primary-color, #0a2342);
  --hm-gold: var(--accent-gold, #c9a46b);
  --hm-gold-ink: #8a6420;          /* gold dark enough for text on white / cream (>= 4.5:1) */
  --hm-gold-soft: #ecd9b0;         /* gold for text on dark navy (the impact band, the hero's date tile) */
  --hm-ink: #1f2a40;
  --hm-muted: #4f5b73;
  --hm-line: rgba(10, 35, 66, 0.12);
  --hm-cream: #faf6ec;
  --hm-radius: 18px;
  --hm-ease: cubic-bezier(0.22, 0.8, 0.3, 1);
  --hm-serif: var(--heading-font, 'Playfair Display', Georgia, 'Times New Roman', serif);
  --hm-sans: var(--body-font, 'Lato', system-ui, sans-serif);
  --hm-section-y: clamp(3.5rem, 2rem + 5vw, 6.5rem);
  overflow-x: clip;
}

.hm-home .hm-section {
  position: relative;
  padding-block: var(--hm-section-y);
  background: #fff;
}
.hm-home .hm-section--cream { background: var(--hm-cream); }

.hm-home a:focus-visible:not(.submission-card-link) {   /* the Showcase card links keep the browser's own ring, as before */
  outline: 3px solid var(--hm-gold-ink);
  outline-offset: 3px;
}

/* text for screen readers only (the card links say which event / post they belong to) */
.hm-home .hm-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Section header: eyebrow, title, lead, optional "view all" ---------- */

.hm-home .hm-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.1rem 2rem;
  margin: 0 0 clamp(2rem, 1.2rem + 2.5vw, 3.25rem);
}
.hm-home .hm-head--center {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.hm-home .hm-head__text { max-width: 48rem; }

.hm-home .hm-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 0.8rem;
  font: 700 0.78rem/1 var(--hm-sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hm-gold-ink);
}
/* a short gold rule before the label, and after it too when the header is centred */
.hm-home .hm-eyebrow::before,
.hm-home .hm-head--center .hm-eyebrow::after {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--hm-gold);
}

.hm-home .hm-title {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  font: 700 clamp(1.9rem, 1.35rem + 2.2vw, 2.9rem) / 1.12 var(--hm-serif);
  color: var(--hm-navy);
  text-align: inherit;
}
.hm-home .hm-title,
.hm-home .hm-lead { text-wrap: balance; }   /* no one-word last lines */
.hm-home .hm-lead {
  margin: 0.9rem 0 0;
  max-width: 38rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--hm-muted);
}

.hm-home a.hm-more {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--hm-line);
  border-radius: 999px;
  background: #fff;
  color: var(--hm-navy);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
.hm-home a.hm-more i { font-size: 0.8em; transition: transform 0.25s var(--hm-ease); }
.hm-home a.hm-more:hover,
.hm-home a.hm-more:focus-visible {
  background: var(--hm-navy);
  border-color: var(--hm-navy);
  color: #fff;
}
.hm-home a.hm-more:hover i,
.hm-home a.hm-more:focus-visible i { transform: translateX(3px); }

/* ---------- Buttons ---------- */

.hm-home .hm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}
.hm-home a.hm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.8rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.2s var(--hm-ease), box-shadow 0.25s, background-color 0.25s, color 0.25s, border-color 0.25s;
}
.hm-home a.hm-btn i { font-size: 0.9em; transition: transform 0.25s var(--hm-ease); }
.hm-home a.hm-btn:hover i { transform: translateX(3px); }

.hm-home a.hm-btn--gold {
  background: linear-gradient(135deg, #f2cb7e, #d4a24a);
  color: #1a1305;
  box-shadow: 0 10px 22px -6px rgba(138, 100, 32, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.hm-home a.hm-btn--gold:hover {
  color: #1a1305;
  transform: translateY(-2px);
  box-shadow: 0 16px 28px -8px rgba(138, 100, 32, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.hm-home a.hm-btn--line {
  background: transparent;
  border-color: rgba(10, 35, 66, 0.35);
  color: var(--hm-navy);
}
.hm-home a.hm-btn--line:hover { background: var(--hm-navy); border-color: var(--hm-navy); color: #fff; }

.hm-home a.hm-btn--navy {
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.92rem;
  background: var(--hm-navy);
  color: #fff;
}
.hm-home a.hm-btn--navy:hover { background: #12345f; color: #fff; transform: translateY(-2px); }

/* ---------- Event + blog cards (scoped; the same classes are used elsewhere) ---------- */

.hm-home .event-preview-grid,
.hm-home .post-preview-grid { gap: clamp(1.25rem, 1rem + 1.2vw, 1.9rem); }

.hm-home .hm-event,
.hm-home .hm-post {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hm-line);
  border-radius: var(--hm-radius);
  background: #fff;
  text-align: left;
  box-shadow: 0 1px 2px rgba(10, 35, 66, 0.05), 0 12px 30px -20px rgba(10, 35, 66, 0.3);
  transition: transform 0.35s var(--hm-ease), box-shadow 0.35s var(--hm-ease);
}
@media (hover: hover) {
  .hm-home .hm-event:hover,
  .hm-home .hm-post:hover {
    transform: translateY(-6px);
    box-shadow: 0 2px 4px rgba(10, 35, 66, 0.06), 0 26px 44px -22px rgba(10, 35, 66, 0.38);
  }
}

.hm-home .hm-event__media,
.hm-home .hm-post__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #ebe4d2;
}
.hm-home .hm-event__media a,
.hm-home .hm-post__media a { display: block; width: 100%; height: 100%; }
.hm-home .hm-event__media img,
.hm-home .hm-post__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--hm-ease);
}
@media (hover: hover) {
  .hm-home .hm-event:hover .hm-event__media img,
  .hm-home .hm-post:hover .hm-post__media img { transform: scale(1.05); }
}

.hm-home .hm-event .event-card-date {
  top: 0.9rem;
  left: 0.9rem;
  min-width: 3.2rem;
  padding: 0.5rem 0.7rem 0.55rem;
  border-radius: 12px;
  background: #fff;
  color: var(--hm-navy);
  line-height: 1;
  box-shadow: 0 6px 18px rgba(6, 16, 36, 0.25);
}
.hm-home .hm-event .event-card-date .day {
  display: block;
  font: 700 1.55rem / 1 var(--hm-serif);
  font-variant-numeric: lining-nums;
}
.hm-home .hm-event .event-card-date .month {
  display: block;
  margin-top: 0.25rem;
  font: 700 0.68rem / 1 var(--hm-sans);
  letter-spacing: 0.14em;
  color: var(--hm-gold-ink);
}

.hm-home .hm-event .event-countdown {
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  width: auto;
  padding: 0.55rem 0.5rem;
  gap: 0;
  justify-content: space-around;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(8, 20, 42, 0.78);
  font-size: 1rem;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.hm-home .hm-event .countdown-part {
  font-size: 0.66rem;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}
.hm-home .hm-event .countdown-part span {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  font-variant-numeric: tabular-nums;
  color: #fff;
  opacity: 1;
}
.hm-home .hm-chip {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(8, 20, 42, 0.8);
  color: #fff;
  font: 700 0.72rem / 1 var(--hm-sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.hm-home .hm-chip i { color: var(--hm-gold-soft); }

.hm-home .hm-event .event-card-content,
.hm-home .hm-post .post-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.45rem 1.5rem;
}
.hm-home .hm-event__when,
.hm-home .hm-post .post-card-meta {
  margin: 0 0 0.55rem;
  font: 700 0.76rem / 1.3 var(--hm-sans);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--hm-gold-ink);
}
.hm-home .hm-event .event-card-title,
.hm-home .hm-post .post-card-title {
  margin: 0 0 0.65rem;
  font: 700 1.3rem / 1.25 var(--hm-serif);
  color: var(--hm-navy);
  text-align: left;
}
.hm-home .hm-event .event-card-title a,
.hm-home .hm-post .post-card-title a {
  color: inherit;
  text-decoration: none;
  background: linear-gradient(var(--hm-gold), var(--hm-gold)) 0 100% / 0 2px no-repeat;
  transition: background-size 0.35s var(--hm-ease);
}
.hm-home .hm-event .event-card-title a:hover,
.hm-home .hm-post .post-card-title a:hover { background-size: 100% 2px; }

.hm-home .hm-event .event-card-meta {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--hm-muted);
}
.hm-home .hm-event .event-card-meta i { margin-right: 0.45rem; color: var(--hm-gold-ink); }

.hm-home .hm-event .event-card-excerpt,
.hm-home .hm-post .post-card-excerpt {
  flex-grow: 1;
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--hm-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hm-home a.hm-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--hm-navy);
  text-decoration: none;
}
.hm-home a.hm-link i { font-size: 0.8em; color: var(--hm-gold-ink); transition: transform 0.25s var(--hm-ease); }
.hm-home a.hm-link:hover { color: var(--hm-gold-ink); }
.hm-home a.hm-link:hover i { transform: translateX(4px); }

/* the "more is waiting" placeholder that pads a short row */
.hm-home .hm-ghost {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-height: 18rem;
  padding: 2rem 1.5rem;
  border: 1.5px dashed rgba(10, 35, 66, 0.22);
  border-radius: var(--hm-radius);
  background: transparent;
  text-align: center;
  color: var(--hm-muted);
}
.hm-home .hm-ghost__icon {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background: rgba(201, 164, 107, 0.18);
  color: var(--hm-navy);
  font-size: 1.25rem;
}
.hm-home .hm-ghost p { margin: 0; font-family: var(--hm-serif); font-size: 1.1rem; color: var(--hm-navy); }

/* ---------- Creative Showcase: only the section frame; cards are untouched (see top of file) ---------- */

.hm-home .hm-showcase .submission-preview-grid { margin-top: 0; }
.hm-home .hm-empty { margin: 0 0 1.5rem; color: var(--hm-muted); }

/* ---------- Responsive ---------- */

/* Tablet: responsive.css makes the events grid one column here, which would stretch every 16:10 picture to ~700px.
   Lay those cards out sideways instead: picture on the left, text on the right. (The blog grid stays two columns.) */
@media (min-width: 600px) and (max-width: 992px) {
  .hm-home .hm-event { flex-direction: row; }
  .hm-home .hm-event__media { flex: 0 0 42%; aspect-ratio: auto; min-height: 15rem; }
  .hm-home .hm-event__media a { position: absolute; inset: 0; }
}

@media (max-width: 560px) {
  .hm-home .hm-actions { flex-direction: column; align-items: stretch; }
  .hm-home .hm-head { align-items: flex-start; }
  .hm-home .hm-head--center { align-items: center; }
}

/* ---------- Reduced motion: no loops, no zoom, no lift (explicit list so the Showcase cards are never touched) ---------- */

@media (prefers-reduced-motion: reduce) {
  /* the scroll-reveal library (AOS) slides every [data-aos] block up by 100px; people who asked for less motion get it in place */
  .hm-home [data-aos] { opacity: 1 !important; transform: none !important; transition: none !important; }

  .hm-home .hm-event,
  .hm-home .hm-post,
  .hm-home .hm-event__media img,
  .hm-home .hm-post__media img,
  .hm-home a.hm-btn,
  .hm-home a.hm-btn i,
  .hm-home a.hm-more i,
  .hm-home a.hm-link i { transition: none; }

  .hm-home .hm-event:hover,
  .hm-home .hm-post:hover,
  .hm-home a.hm-btn:hover,
  .hm-home .hm-event:hover .hm-event__media img,
  .hm-home .hm-post:hover .hm-post__media img { transform: none; }
}

/* ---------- Print: nothing may stay hidden because it was never scrolled into view ---------- */

@media print {
  .hm-home [data-aos] { opacity: 1 !important; transform: none !important; transition: none !important; }
}
