/* ============================================================
   UH homepage layout. Loaded by index.hbs only.
   Blocks appear in the order they render on the page.
   ============================================================ */

/* Shared components read --uh-section-gap; this page has to set it. */
.homepage {
  --uh-section-gap: clamp(32px, 4vw, 72px);
}

.homepage > * + * {
  margin-top: var(--uh-section-gap);
}

.homepage > :last-child {
  margin-bottom: var(--uh-section-gap);
}

/* ---- 1. Hero ---------------------------------------------- */

.uh-hero {
  padding: 0 42px;
}

/* Cancels .uh-hero's padding so the image reaches both edges. */
.uh-hero-image {
  display: block;
  margin-left: -42px;
  margin-right: -42px;
}

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

.uh-hero-meta {
  width: 74%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 100px);
  align-items: start;
  padding-top: clamp(20px, 2.5vw, 44px);
}

.uh-hero-title {
  font: var(--t-display-xl);
  text-transform: uppercase;
  margin: 0 0 clamp(12px, 1.2vw, 20px);
}

.uh-hero-title a {
  color: var(--text-color);
}

.uh-hero-excerpt {
  font: var(--t-dek-feature);
  max-width: 56ch;
  opacity: var(--t-emph);
  margin: 0;
}

.uh-hero-excerpt:empty {
  display: none;
}

.uh-hero-side {
  font: var(--t-meta-lg);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: clamp(14px, 1.4vw, 26px);
}

.uh-hero-date {
  display: flex;
  gap: 8px;
  opacity: var(--t-emph);
}

.uh-hero-sep {
  opacity: 0.5;
}

.uh-hero-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: var(--t-track-caps);
  opacity: var(--t-emph-faint);
  margin-bottom: 6px;
}

.uh-hero-writer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.uh-hero-writer-list a {
  color: var(--text-color);
  font-weight: 600;
}

/* ---- 2. Podcast -------------------------------------------- */

.uh-podcast {
  padding: 0 42px;
}

/* Flex so the episode fills the row when it has no related articles. */
.uh-podcast-row {
  display: flex;
  align-items: flex-start;
  gap: clamp(20px, 2.5vw, 48px);
}

.uh-podcast-main {
  flex: 1 1 0;
  min-width: 0;
}

.uh-podcast-related {
  flex: 0 1 clamp(240px, 26%, 380px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.2vw, 20px);
  min-width: 0;
}

.uh-podcast-card {
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 2vw, 36px);
}

.uh-podcast-thumb {
  flex: 0 0 52%;
  display: block;
  min-width: 0;
}

.uh-podcast-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.uh-podcast-body {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.25vw, 24px);
}

.uh-related-date {
  font: var(--t-meta);
  opacity: var(--t-emph-soft);
}

.uh-podcast-kicker {
  font: var(--t-display-sm);
  text-transform: uppercase;
  color: #999999;
  margin: 0;
}

.uh-podcast-headline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(16px, 2vw, 40px);
  align-items: end;
}

.uh-podcast-date {
  font: var(--t-meta-xl);
  opacity: var(--t-emph-soft);
  padding-bottom: 0.15em;
}

.uh-podcast-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(16px, 2vw, 40px);
  align-items: start;
  border-top: 2px solid currentColor;
  padding-top: clamp(12px, 1.25vw, 24px);
}

.uh-podcast-title {
  font: var(--t-display-xl);
  text-transform: uppercase;
  margin: 0;
}

.uh-podcast-title a,
.uh-related-title a {
  color: var(--text-color);
}

.uh-podcast-excerpt {
  font: var(--t-dek-feature);
  opacity: var(--t-emph);
  max-width: 68ch;
  margin: 0;
}

.uh-podcast-excerpt:empty {
  display: none;
}

.uh-podcast-authors {
  font: var(--t-byline);
  opacity: var(--t-emph);
  text-align: right;
}

.uh-related-label {
  font: var(--t-label);
  text-transform: uppercase;
  letter-spacing: var(--t-track-label);
  opacity: var(--t-emph-faint);
  padding-bottom: 10px;
  border-bottom: 1px solid currentColor;
}

.uh-related-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: start;
}

.uh-related-thumb {
  display: block;
}

.uh-related-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.uh-related-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.uh-related-title {
  font: var(--t-headline-sm);
  text-transform: uppercase;
  margin: 0;
}

/* ---- 3. Latest --------------------------------------------- */

.uh-latest {
  padding: 0 42px;
}

.uh-latest .pagination-nav {
  display: flex;
  justify-content: center;
  margin-top: clamp(28px, 3vw, 56px);
}

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

@media (max-width: 1200px) {
  .uh-hero-meta {
    width: 88%;
  }
}

@media (max-width: 991px) {
  .uh-hero,
  .uh-podcast,
  .uh-latest {
    padding: 0 20px;
  }

  .uh-hero-image {
    margin-left: -20px;
    margin-right: -20px;
  }

  .uh-hero-label {
    display: none;
  }

  .uh-podcast-row,
  .uh-podcast-card {
    flex-direction: column;
  }

  .uh-podcast-thumb,
  .uh-podcast-related {
    flex: 1 1 auto;
    width: 100%;
  }

  .uh-podcast-thumb {
    margin-left: -20px;
    margin-right: -20px;
    width: auto;
  }

  .uh-latest .uh-card-image {
    margin-left: -20px;
    margin-right: -20px;
  }

  .uh-podcast-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .uh-podcast-headline,
  .uh-podcast-footer {
    display: contents;
  }

  .uh-podcast-kicker {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .uh-podcast-title {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .uh-podcast-excerpt {
    grid-column: 1 / -1;
    grid-row: 3;
    max-width: none;
  }

  .uh-podcast-date {
    grid-column: 1;
    grid-row: 4;
    justify-self: start;
    align-self: baseline;
    padding-bottom: 0;
  }

  .uh-podcast-authors {
    grid-column: 2;
    grid-row: 4;
    justify-self: end;
    align-self: baseline;
  }

  .uh-hero-meta {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .uh-hero-side {
    align-items: flex-start;
    text-align: left;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px 32px;
  }

  .uh-hero-writers {
    text-align: right;
  }

  .uh-hero-excerpt {
    max-width: none;
  }
}
