/**
 * Homepage components
 *
 * The two sections added in phase 2 — the announcement band and the browse
 * band — plus a fix for the hero heading, which had no mobile size.
 *
 * Enqueued after _components.css so it can override it. Everything here uses
 * the tokens in _tokens.css rather than raw colour values.
 */

/* ------------------------------------------------------------------ */
/*  Hero heading                                                       */
/* ------------------------------------------------------------------ */

/*
 * The sizes are already handled: _utilities.css steps .hero__title down at
 * 768px and again at 480px. Nothing here should restate them, and an earlier
 * draft of this file did, with a clamp() that quietly ran 30% larger than the
 * design intended between 480 and 900px.
 *
 * What was genuinely missing is wrapping. The heading is editable now, so the
 * longest word cannot be predicted, and a long one would push past the viewport
 * rather than breaking. WCAG 1.4.10 asks for no horizontal scrolling at 320px.
 */
.hero__title { overflow-wrap: break-word; }

/* ------------------------------------------------------------------ */
/*  Announcement band                                                  */
/* ------------------------------------------------------------------ */

.ann-band {
  background: #F0F5E2;
  border-bottom: 3px solid var(--color-green);
}
.ann-band__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}
.ann-band__thumb {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.ann-band__text { flex: 1 1 auto; min-width: 0; }
.ann-band__eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  /* On this pale background the mid green would sit at about 2:1, so the
     eyebrow uses a dark tone that clears 4.5:1. */
  color: #4F6410;
  margin: 0 0 2px;
}
.ann-band__heading {
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.3;
  color: #173404;
  margin: 0 0 2px;
}
.ann-band__body {
  font-size: 0.875rem;
  color: #3F4A38;
  margin: 0;
}
.ann-band__link {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-blue-dark);
  text-decoration: none;
  white-space: nowrap;
}
.ann-band__link:hover,
.ann-band__link:focus-visible { text-decoration: underline; }
.ann-band__close {
  flex-shrink: 0;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 1.375rem;
  line-height: 1;
  /* 44px square, so it is a comfortable target on a phone. */
  min-width: 44px;
  min-height: 44px;
  color: #4F6410;
  border-radius: 4px;
}
.ann-band__close:hover { background: rgba(0, 0, 0, 0.06); }
.ann-band__close:focus-visible {
  outline: 2px solid var(--color-blue-dark);
  outline-offset: 2px;
}

/*
 * The announcement as a full hero.
 *
 * It reuses .hero, so it inherits the layout and the overlay. The modifier
 * exists so this variant can be told apart, and it earns its place: an
 * announcement is shorter than the standard hero, so it does not need the same
 * height, and its overlay is a touch stronger because announcement images are
 * supplied ad hoc rather than art-directed.
 */
.hero--announcement { min-height: 0; }
.hero--announcement .hero__overlay { background: rgba(0, 67, 87, 0.72); }
.hero--announcement .hero__inner { padding-top: var(--space-4); padding-bottom: var(--space-4); }

.ann-hero__eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  /* Lightened so small uppercase text clears 4.5:1 on the teal overlay. */
  color: #C7D965;
  margin: 0 0 var(--space-1);
}

@media (max-width: 768px) {
  .ann-band__inner { flex-wrap: wrap; }
  .ann-band__thumb { display: none; }
  .ann-band__link { order: 3; width: 100%; }
  .ann-band__close { order: 2; margin-left: auto; }
}

/* ------------------------------------------------------------------ */
/*  Browse band                                                        */
/* ------------------------------------------------------------------ */

.browse-section { background: var(--color-light-gray); }

.browse-header { text-align: center; margin-bottom: var(--space-5); }
.browse-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-blue-dark);
  margin: 0 0 var(--space-1);
}
.browse-title {
  color: var(--color-blue-darker);
  margin: 0;
}
.browse-accent {
  width: 56px;
  height: 4px;
  background: var(--color-green);
  border-radius: 2px;
  margin: var(--space-2) auto 0;
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  align-items: start;
}
.browse-col__title {
  font-size: 1.125rem;
  color: var(--color-blue-darker);
  margin: 0 0 var(--space-2);
}

.browse-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-1);
}
.browse-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* 44px keeps it a reliable tap target. */
  min-height: 44px;
  padding: var(--space-1);
  border: 1px solid var(--color-blue-dark);
  border-radius: 4px;
  color: var(--color-blue-dark);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.25;
}
.browse-chip:hover {
  background: var(--color-blue-dark);
  color: var(--color-white);
}
.browse-chip:focus-visible {
  outline: 2px solid var(--color-blue-darker);
  outline-offset: 2px;
}

.browse-rows { list-style: none; margin: 0; padding: 0; }
.browse-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-1) 2px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9375rem;
}
.browse-row:hover { color: var(--color-blue-dark); }
.browse-row:focus-visible {
  outline: 2px solid var(--color-blue-dark);
  outline-offset: 2px;
}
.browse-row__arrow {
  /*
   * Not --color-green-dark. That sits at 2.38:1 on this background, and while
   * the chevron is aria-hidden and the link text carries the meaning, it is
   * also the visual cue that the row is clickable, so it should clear the 3.0
   * threshold for non-text content. This tone of the same hue reaches 5.59.
   */
  color: #5C6818;
  font-weight: 700;
  flex-shrink: 0;
}

.browse-all {
  display: inline-block;
  margin-top: var(--space-2);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-blue-dark);
  text-decoration: none;
}
.browse-all:hover,
.browse-all:focus-visible { text-decoration: underline; }

@media (max-width: 1024px) {
  .browse-grid { grid-template-columns: 1fr 1fr; gap: var(--space-4); }
}
@media (max-width: 640px) {
  .browse-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .browse-chips { grid-template-columns: 1fr 1fr; }
}
