/*
 * 21-interests-nav.css — "Browse by interest" (IA spec v2, 17 Oct 2026).
 * Approved mockups: Projects/RiverHouse-Design/comps-ia-v2/home.html and nav-open.html.
 *
 * Loads after 20-home.css (filename order), so the homepage rules below win
 * over the four-tile ones there at equal specificity. Adds function in the
 * site's existing style; restyles nothing else.
 *
 * 1. Homepage: the line under "Choose your interest".
 * 2. Homepage: the rust button at the foot of every tile. It is the site's own
 *    rust button (.rhcx-btn, "See the calendar"): white Source Sans semibold on
 *    rust, square corners, 52px tall, with an arrow. The whole tile is the link,
 *    so hovering, pressing or focusing ANY part of the tile changes the button.
 * 3. Homepage: five tiles, 3 across then 2 centered on a laptop; 2, 2, then 1
 *    centered on a tablet; one column on a phone. Buttons line up per row.
 * 4. The menus: every target at least 44px tall, without moving the header.
 */

/* ------------------------------------------------------------- 1. the line */

.rhcx-home .rhcx-studios__h {
  margin-block-end: 10px;
}

.rhcx-home .rhcx-studios__instr {
  margin: 0 0 clamp(24px, 3vw, 36px);
  max-width: 60ch;
  color: var(--tx-2);
  font-family: var(--b);
  font-size: 18px;
  line-height: 1.45;
}

/* ----------------------------------------------------------- 2. the button */

.rhcx-home .rhcx-tile {
  display: flex;
  flex-direction: column;
}

.rhcx-home .rhcx-tile .rhcx-tile__line {
  flex: 1 1 auto;
}

.rhcx-home .rhcx-tile__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  align-self: flex-start;
  min-height: 52px;
  margin-block-start: 16px;
  padding: 13px 24px;
  border: 1.5px solid var(--rust);
  border-radius: 0;
  background: var(--rust);
  color: #fff;
  font-family: var(--b);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, transform .08s ease;
}

.rhcx-home .rhcx-tile__arrow {
  display: inline-block;
  transition: transform .15s ease;
}

/* Hover or keyboard focus anywhere on the tile: the darker rust the live buttons use. */
.rhcx-home .rhcx-tile:hover .rhcx-tile__btn,
.rhcx-home .rhcx-tile:focus-visible .rhcx-tile__btn {
  border-color: #97401f;
  background: #97401f;
  color: #fff;
}

.rhcx-home .rhcx-tile:hover .rhcx-tile__arrow,
.rhcx-home .rhcx-tile:focus-visible .rhcx-tile__arrow {
  transform: translateX(4px);
}

/* Press: darker still, and the button drops 2px. */
.rhcx-home .rhcx-tile:active .rhcx-tile__btn {
  border-color: #7a3418;
  background: #7a3418;
  transform: translateY(2px);
}

/* Keyboard focus rings the whole tile, which is the thing that has focus. */
.rhcx-home .rhcx-tile:focus-visible {
  outline: 3px solid var(--river);
  outline-offset: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .rhcx-home .rhcx-tile__btn,
  .rhcx-home .rhcx-tile__arrow {
    transition: none;
  }

  .rhcx-home .rhcx-tile:hover .rhcx-tile__arrow,
  .rhcx-home .rhcx-tile:focus-visible .rhcx-tile__arrow,
  .rhcx-home .rhcx-tile:active .rhcx-tile__btn {
    transform: none;
  }
}

/* --------------------------------------------------------- 3. five tiles */

/* Phone: one column (20-home.css), and the button runs the tile's full width. */
@media (max-width: 600px) {
  .rhcx-home .rhcx-tile__btn {
    align-self: stretch;
  }
}

/* Each tile spans two columns of a 4- or 6-column grid, so a short last row
   can sit centered. Written by position, not by count, so the row still
   centers if the owner hides a tile in Site content. */

/* Tablet: 2, 2, then the fifth centered. */
@media (min-width: 601px) and (max-width: 899px) {
  .rhcx-home .rhcx-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rhcx-home .rhcx-tiles > .rhcx-tile {
    grid-column: span 2;
  }

  .rhcx-home .rhcx-tiles > .rhcx-tile:nth-child(odd):last-child {
    grid-column: 2 / span 2;
  }
}

/* Laptop: 3 across, then the last two centered under them. */
@media (min-width: 900px) {
  .rhcx-home .rhcx-tiles {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .rhcx-home .rhcx-tiles > .rhcx-tile {
    grid-column: span 2;
  }

  .rhcx-home .rhcx-tiles > .rhcx-tile:nth-child(3n+1):nth-last-child(2) {
    grid-column: 2 / span 2;
  }

  .rhcx-home .rhcx-tiles > .rhcx-tile:nth-child(3n+1):last-child {
    grid-column: 3 / span 2;
  }
}

/* ------------------------------------------------------------ 4. menus */

/* Desktop bar: the links and the Interests button are 15px text in a ~26px box.
   An invisible extension above and below makes each one a 46px target without
   moving the bar, the underline or the dropdown. */
.rh-shell-nav > ul > li > a,
.rh-shell-nav .rh-shell-sub-toggle {
  position: relative;
}

.rh-shell-nav > ul > li > a::after,
.rh-shell-nav .rh-shell-sub-toggle::after {
  content: "";
  position: absolute;
  inset: -10px 0;
}

/* Desktop dropdown rows: 44px tall. */
.rh-shell-sub a {
  display: flex;
  align-items: center;
  min-height: 44px;
}

/* Phone panel rows inside the Interests group: 44px even on short phones,
   where 11-nav-mobile.css tightens their padding. */
.rh-shell-panel-nav .rh-shell-panel-sub > li > a {
  min-height: 44px;
}
