/* ==========================================================================
   Home's bento tiles (includes/home-sections.php), shared with Platform Tour.
   Final handoff, 2026-10-30. Each tile names its grid-area; the page's sheet
   lays the areas out. Breakpoints follow the design's: phone < 700,
   tablet 700–1099 (Capabilities and Explore pair up from 900), desktop.
   ========================================================================== */

/* Bento pattern placements (base styles: css/pattern.css). */

.ffb-pattern--cap {
  right: 0;
  bottom: 0;
  width: 62%;
  height: 80%;
}

.ffb-pattern--explore {
  --pat-line-a: 0.14;
  display: block;
  width: 100%;
  height: 100%;
}

.ffb-pattern--accr {
  left: 0;
  bottom: 0;
  width: 40%;
  height: 100%;
  transform: scaleX(-1);
  opacity: 0.5;
}

/* ---------------------------------------------------------- Shared bits --- */

.hs-tile {
  position: relative;
  isolation: isolate;
  border-radius: var(--ffb-r-bento);
}

.hs-eyebrow {
  margin-bottom: 10px;
  font-weight: 500;
  font-size: var(--ffb-eyebrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ffb-blue);
}

.hs-title {
  font-size: clamp(32px, 2.8vw, 44px);
  line-height: 1.08;
  color: var(--ffb-navy-deep);
}

.hs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 32px;
}

/* "See all six capabilities ↗": a label and a round arrow that steps up and
   right while its tile is hovered. */
.hs-go {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  font-family: var(--ffb-poppins);
  font-weight: 600;
  font-size: 15px;
  color: var(--ffb-navy-deep);
}

.hs-go__dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ffb-green);
  color: var(--ffb-green-ink);
  display: grid;
  place-items: center;
  transition: transform 0.3s var(--ffb-ease-shrink);
}

.hs-go__dot svg {
  width: 16px;
  height: 16px;
}

.hs-go--dark {
  color: var(--ffb-green-ink);
}

.hs-go--dark .hs-go__dot {
  background: var(--ffb-green-ink);
  color: var(--ffb-green-hover);
}

a:hover .hs-go__dot,
a:focus-visible .hs-go__dot {
  transform: translate(4px, -4px);
}

/* "All news →" */
.hs-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--ffb-r-pill);
  border: 1px solid var(--ffb-outline-border);
  background: #ffffff;
  font-family: var(--ffb-poppins);
  font-weight: 600;
  font-size: 15px;
  color: var(--ffb-navy-deep);
  white-space: nowrap;
  transition: border-color var(--ffb-t-fast) ease, color var(--ffb-t-fast) ease;
}

.hs-pill:hover {
  border-color: var(--ffb-blue);
  color: var(--ffb-blue);
}

.hs-pill svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------- Capabilities --- */

.hs-cap {
  grid-area: cap;
  z-index: 4;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 340px;
  padding: 30px 0 0 30px;
  border: 1px solid var(--ffb-cap-tile-border);
  background: var(--ffb-cap-tile);
  color: var(--ffb-navy-deep);
  scroll-margin-top: 20px;
  transition: transform var(--ffb-t-ui) ease, box-shadow var(--ffb-t-ui) ease;
}

.hs-cap:hover {
  transform: translateY(-3px);
  box-shadow: var(--ffb-shadow-cap-tile);
  color: var(--ffb-navy-deep);
}

.hs-cap__text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 28px;
}

.hs-cap__lead {
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ffb-text-body-alt);
}

.hs-cap .hs-go {
  padding-top: 22px;
}

.hs-cap__figure {
  position: relative;
  align-self: stretch;
  min-height: 220px;
}

/* The design's 349px, but never more than 115% of its column: below ~1280px
   the tile narrows and a fixed figure ran into the "See all six
   capabilities" link (Keith, 2026-11-02). Height follows the image. */
.hs-cap__figure img {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(349px, 115%);
  max-width: none;
  height: auto;
  filter: var(--ffb-cap-figure-shadow);
}

/* -------------------------------------------------------------- Explore --- */

.hs-explore {
  grid-area: explore;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  /* Top and left 30px like Capabilities beside it (design: 28px / 44px;
     Keith, 2026-11-02). */
  padding: 30px clamp(140px, 34%, 240px) 28px 30px;
  background: var(--ffb-green);
  color: var(--ffb-green-ink);
  transition: transform var(--ffb-t-ui) ease, box-shadow var(--ffb-t-ui) ease;
}

.hs-explore:hover {
  transform: translateY(-3px);
  box-shadow: var(--ffb-shadow-explore-tile);
  color: var(--ffb-green-ink);
}

.hs-explore__pattern {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 62%;
  z-index: -1;
  overflow: hidden;
}

.hs-explore__pattern .ffb-pattern {
  position: static;
}

.hs-explore__icon {
  flex: none;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  box-shadow: var(--ffb-shadow-explore-icon);
}

.hs-explore__text {
  flex: 1 1 auto;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hs-explore__title {
  font-size: clamp(30px, 2.8vw, 42px);
  line-height: 1.05;
  color: var(--ffb-green-ink);
}

.hs-explore__lead {
  font-size: 18px;
  line-height: 1.45;
  font-weight: 500;
}

/* ------------------------------------------------------- Learning Areas --- */

.hs-areas {
  grid-area: areas;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px;
  background: var(--ffb-areas-panel);
  border: 1px solid var(--ffb-areas-panel-border);
  scroll-margin-top: 20px;
}

.hs-areas__grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(240px, 1fr);
  gap: 12px;
  list-style: none;
}

.hs-area {
  position: relative;
  isolation: isolate;
  min-height: 230px;
  border-radius: var(--ffb-r-area);
  overflow: hidden;
  background: var(--ffb-navy-deep);
  color: #ffffff;
}

/* Below both shades (::before would otherwise paint under it, being first). */
.hs-area__img {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ffb-ease-shrink);
}

.hs-area:hover .hs-area__img {
  transform: scale(1.05);
}

/* Two shades: under the name, and in the corner under the categories. */
.hs-area::before,
.hs-area::after {
  content: "";
  position: absolute;
  inset: 0;
}

.hs-area::before {
  background: var(--ffb-area-fade);
}

.hs-area::after {
  background: var(--ffb-area-corner);
}

.hs-area__cats {
  position: absolute;
  z-index: 1;
  top: 22px;
  right: 22px;
  left: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  list-style: none;
  text-align: right;
  font-family: var(--ffb-jakarta);
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.3;
  text-shadow: var(--ffb-area-cat-shadow);
}

.hs-area__copy {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hs-area__eyebrow {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ffb-green-hover);
}

.hs-area__name {
  font-size: 32px;
  line-height: 1.05;
  color: #ffffff;
}

/* ------------------------------------------------------------------ FAQ --- */

.hs-faq {
  grid-area: path;
}

/* Learning Areas and What's New are left out when the database has nothing
   (or is down). Their neighbours then take the space, at every breakpoint,
   instead of leaving the named areas empty: the FAQ spans the areas + path
   block, Partners the logos + accr block. Named lines, so one rule fits the
   Home and Platform Tour templates alike. */
:where(.home-grid, .vid-grid):not(:has(> .hs-areas)) > .hs-faq {
  grid-area: areas-start / areas-start / path-end / path-end;
}

:where(.home-grid, .vid-grid):not(:has(> .hs-news)) > .hs-accr {
  grid-area: logos-start / logos-start / accr-end / accr-end;
}

/* ----------------------------------------------------------- What's New --- */

.hs-news {
  grid-area: logos;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px;
  background: #ffffff;
  border: 1px solid var(--ffb-hairline);
}

.hs-news__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  list-style: none;
}

.hs-news__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
  color: var(--ffb-navy-deep);
  transition: background var(--ffb-t-ui) ease, color var(--ffb-t-ui) ease;
}

.hs-news__card:hover {
  background: var(--ffb-card-hover-cool);
  color: var(--ffb-blue);
}

.hs-news__media {
  display: block;
  overflow: hidden;
  aspect-ratio: var(--ffb-news-ratio);
  background: var(--ffb-news-well);
}

.hs-news__media img {
  width: 100%;
  height: auto;
  transition: transform 0.6s var(--ffb-ease-shrink);
}

.hs-news__card:hover .hs-news__media img {
  transform: scale(1.06);
}

.hs-news__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 16px 0;
  padding: 0 18px;
  border-left: 1px solid var(--ffb-hairline);
}

.hs-news__date {
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ffb-text-muted);
}

.hs-news__title {
  font-family: var(--ffb-jakarta);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.35;
  text-wrap: pretty;
}

/* ------------------------------------------- Partners & Accreditations --- */

.hs-accr {
  grid-area: accr;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px clamp(32px, 5vw, 80px);
  padding: clamp(32px, 3.6vw, 56px) clamp(24px, 4vw, 64px);
  background: #ffffff;
  border: 1px solid var(--ffb-green);
}

.hs-accr__head {
  flex: 1 1 260px;
}

.hs-accr__head .hs-eyebrow {
  margin-bottom: 12px;
}

.hs-accr__groups {
  flex: 3 1 520px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hs-accr__group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hs-accr__label {
  font-weight: 600;
  font-size: var(--ffb-eyebrow);
  letter-spacing: var(--ffb-track-eyebrow);
  text-transform: uppercase;
  color: var(--ffb-nav-link);
  text-align: center;
}

.hs-accr__logos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  list-style: none;
}

.hs-accr__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 88px;
  padding: 0 20px;
  border-radius: var(--ffb-r-card);
  transition: transform var(--ffb-t-ui) var(--ffb-ease-shrink), opacity var(--ffb-t-ui) ease;
}

.hs-accr__logo:hover {
  transform: translateY(-3px);
  opacity: 0.8;
}

.hs-accr__img {
  width: auto;
  height: 40px;
  object-fit: contain;
}

.hs-accr__img--32 {
  height: 32px;
}

.hs-accr__img--36 {
  height: 36px;
}

/* Two-line wordmarks (GRC Solutions) need the extra height to read. */
.hs-accr__img--50 {
  height: 50px;
}

/* ------------------------------------------------------------ Desktop --- */

@media (min-width: 1100px) {
  /* Learning Areas: a tall first tile, a wide second, two below. */
  .hs-areas__grid--four {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
  }

  .hs-areas__grid--four .hs-area:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .hs-areas__grid--four .hs-area:nth-child(2) {
    grid-column: 2 / 4;
    grid-row: 1;
  }

  .hs-areas__grid--four .hs-area:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }

  .hs-areas__grid--four .hs-area:nth-child(4) {
    grid-column: 3;
    grid-row: 2;
  }

  .hs-areas__grid--four .hs-area:nth-child(1) .hs-area__name {
    font-size: 46px;
  }
}

/* Tablet, wide enough for Capabilities and Explore side by side. */
@media (min-width: 900px) and (max-width: 1099px) {
  .hs-cap {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }

  .hs-cap__figure img {
    width: min(150%, 300px);
    height: auto;
  }
}

/* -------------------------------------------------------------- Phone --- */

@media (max-width: 699px) {
  /* Stacked: two columns at phone width squeezed the title onto three lines
     and shrank the figure (Keith, 2026-11-02). Text full width, figure below
     on the right. */
  .hs-cap {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-right: 30px;
  }

  .hs-cap__text {
    padding-bottom: 0;
  }

  .hs-cap__figure {
    min-height: 0;
    margin-right: -30px;
  }

  .hs-cap__figure img {
    position: static;
    width: min(349px, 85%);
    margin-left: auto;
  }

  .hs-areas__grid {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(230px, auto);
  }

  .hs-area__cats {
    display: none;
  }
}
