/*
 * Purpose: College and locality pages - directory listings, place cards,
 * context blocks, curated search shortcuts and the single-marker map.
 */

/* ------------------------------------------------------------- DIRECTORY */

/*
 * No top padding. These pages open with the breadcrumb trail, and the trail
 * already carries the gap under the header - adding padding here put the
 * listing pages 32px lower than the detail pages they link to.
 */
.rh-place-directory {
  padding-block: 0 var(--space-64);
}

.rh-place-directory__head {
  max-width: 62ch;
  padding-top: var(--rh-crumbs-gap);
  margin-bottom: var(--space-40);
}

.rh-place-directory__title {
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
}

.rh-place-directory__intro {
  margin-top: var(--space-12);
  font-size: var(--fs-lead);
  color: var(--rh-text-secondary);
}

.rh-place-directory__group + .rh-place-directory__group {
  margin-top: var(--space-48);
}

.rh-place-directory__city {
  font-size: var(--fs-h4);
  margin-bottom: var(--space-16);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--rh-border);
}

/* ------------------------------------------------------------ PLACE CARD */

.rh-place-card {
  overflow: hidden;
}

.rh-place-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.rh-place-card__link:hover {
  text-decoration: none;
}

.rh-place-card__link:hover .rh-place-card__name {
  color: var(--rh-teal);
}





.rh-place-card__link:hover .rh-place-card__image {
  transform: scale(1.03);
}



.rh-place-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  flex: 1;
  padding: var(--space-16);
}

.rh-place-card__name {
  display: block;
  font-size: var(--fs-h6);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  transition: color var(--dur-fast) var(--ease-out);
}



.rh-place-card__intro {
  display: block;
  font-size: var(--fs-small);
  color: var(--rh-text-secondary);
  line-height: var(--lh-relaxed);
}

/* ------------------------------------------------------------ PLACE PAGE */

.rh-place {
  padding-bottom: var(--space-64);
}

.rh-place__head {
  max-width: 68ch;
  padding-block: var(--space-24) var(--space-32);
}

.rh-place__eyebrow {
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--rh-teal);
}

.rh-place__title {
  margin-top: var(--space-8);
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
}

.rh-place__location {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-top: var(--space-12);
  font-size: var(--fs-small);
  color: var(--rh-text-secondary);
}

.rh-place__intro {
  margin-top: var(--space-16);
  font-size: var(--fs-lead);
  line-height: var(--lh-relaxed);
  color: var(--rh-text-secondary);
}

.rh-place__actions {
  margin-top: var(--space-24);
}

.rh-place__section {
  padding-block: var(--space-32);
  border-top: 1px solid var(--rh-border);
}

.rh-place__section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-12);
  margin-bottom: var(--space-20);
}

.rh-place__section-title {
  font-size: var(--fs-h3);
  margin-bottom: var(--space-20);
}

.rh-place__section-head .rh-place__section-title {
  margin-bottom: 0;
}

/* --------------------------------------------------------------- CONTEXT */

.rh-context {
  display: grid;
  gap: var(--space-24);
}

@media (min-width: 768px) {
  .rh-context {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.rh-context__item {
  padding: var(--space-20);
  border: 1px solid var(--rh-border);
  border-radius: var(--r-card);
  background-color: var(--rh-surface);
}

.rh-context__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  background-color: var(--rh-white);
  color: var(--rh-teal);
  margin-bottom: var(--space-12);
}

.rh-context__title {
  font-size: var(--fs-h6);
  margin-bottom: var(--space-8);
}

.rh-context__text {
  font-size: var(--fs-small);
  line-height: var(--lh-relaxed);
  color: var(--rh-text-secondary);
}

/*
 * The quick filter chips live in components/buttons.css. They started here
 * because place pages were the only thing using them, but the operations
 * screens use them too and this stylesheet does not load there - so the owner
 * application filters had been rendering as plain links the whole time.
 */

/* ------------------------------------------------------------------- MAP */

.rh-place__map {
  width: 100%;
  height: 360px;
  border: 1px solid var(--rh-border);
  border-radius: var(--r-card);
  background-color: var(--rh-surface);
}

.rh-place__map-note {
  margin-top: var(--space-8);
  font-size: var(--fs-caption);
  color: var(--rh-text-secondary);
}

/* --------------------------------------------------------- INLINE EMPTY */

.rh-empty--inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-40) var(--space-24);
  border: 1px dashed var(--rh-border-strong);
  border-radius: var(--r-card);
  text-align: center;
  color: var(--rh-text-secondary);
}

.rh-empty--inline .rh-empty__icon {
  color: var(--rh-border-strong);
}

.rh-empty--inline .rh-empty__text {
  max-width: 46ch;
  font-size: var(--fs-small);
}

/*
 * Card footer: count on the left, price on the right, on one shared centre
 * line. Baseline alignment was leaving the two at visibly different heights
 * because they carry different weights and colours.
 */
/*
 * The .rh-map-block rules used to live here. They style a partial in
 * template-parts/global/, which the property detail page renders too - and this
 * stylesheet is not enqueued on a single property, so there the map iframe fell
 * back to the browser default 2px inset border. A global partial needs global
 * styles, so they now live in components/sections.css.
 */

/* ------------------------------------------------------------ ATTRIBUTION */

/*
 * Creative Commons images require visible credit. It is kept small and
 * unobtrusive but always present - the licence is not optional.
 */
.rh-place-card__media {
  position: relative;
}

.rh-place-card__credit {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 2px var(--space-8);
  background-color: rgba(3, 38, 34, 0.62);
  color: rgba(255, 255, 255, 0.92);
  font-size: 10px;
  border-top-left-radius: var(--r-sm);
}

.rh-place-card__credit a {
  color: inherit;
  text-decoration: underline;
}

.rh-place__cover {
  position: relative;
  margin: 0;
  border-radius: var(--r-media);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background-color: var(--rh-surface);
}

.rh-place__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rh-place__cover-credit {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: var(--space-4) var(--space-8);
  background-color: rgba(3, 38, 34, 0.62);
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--fs-12);
  border-top-left-radius: var(--r-sm);
}

.rh-place__cover-credit a {
  color: inherit;
  text-decoration: underline;
}

/* Colour only; layout for these lives in components/cards.css. */
.rh-place-card__count { font-weight: var(--fw-semibold); color: var(--rh-text-primary); }
.rh-place-card__from  { font-weight: var(--fw-semibold); color: var(--rh-teal); }
.rh-place-card__none  { color: var(--rh-text-secondary); font-style: italic; font-weight: var(--fw-regular); }

/* ------------------------------------------------------- FLATMATE FINDER */

/* Spacing comes from the shared directory pattern; only the extras differ. */

/* The tabs need room from the intro above and the panel below. */
.rh-flatmates .rh-owner-tabs {
  margin-block: var(--space-8) var(--space-32);
}

.rh-flatmates .rh-empty--inline {
  padding-block: var(--space-64);
  margin-bottom: var(--space-48);
}

.rh-flatmates__gate {
  max-width: 62ch;
  /* Opens straight under the breadcrumbs, like the signed-in head does. */
  padding-block: var(--rh-crumbs-gap) var(--space-64);
}

.rh-flatmates__promises {
  display: grid;
  gap: var(--space-12);
  margin-block: var(--space-24);
}

.rh-flatmates__promises li {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  font-size: var(--fs-small);
  color: var(--rh-text-secondary);
}

.rh-flatmates__promises .rh-icon {
  color: var(--rh-teal);
  flex-shrink: 0;
}

.rh-flatmates__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-12);
  margin-bottom: var(--space-32);
}

.rh-flatmates__filters .rh-field {
  flex: 1 1 200px;
  margin: 0;
}

.rh-flatmate-form__heading {
  margin-top: var(--space-32);
  font-size: var(--fs-h4);
}

.rh-flatmate-form__hint {
  margin-block: var(--space-4) var(--space-16);
  font-size: var(--fs-small);
  color: var(--rh-text-secondary);
}

.rh-flatmate-visibility {
  padding: var(--space-16);
  border: 1px solid var(--rh-teal);
  border-radius: var(--r-card);
  background-color: var(--rh-teal-light);
  margin-bottom: var(--space-24);
}

.rh-switch {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  cursor: pointer;
}

.rh-switch__label {
  display: grid;
  gap: var(--space-4);
}

.rh-switch__label span {
  font-size: var(--fs-caption);
  color: var(--rh-text-secondary);
}

.rh-flatmate-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  padding: var(--space-20);
}

.rh-flatmate-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

.rh-flatmate-card__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  background-color: var(--rh-teal-light);
  color: var(--rh-teal);
  font-weight: var(--fw-bold);
  flex-shrink: 0;
}

.rh-flatmate-card__name {
  font-weight: var(--fw-semibold);
}

.rh-flatmate-card__meta,
.rh-flatmate-card__why {
  font-size: var(--fs-caption);
  color: var(--rh-text-secondary);
}

/*
 * A score, not an action. Solid teal is reserved for things you click - a badge
 * that shouts as loudly as the primary button competes with it for no reason.
 */
.rh-flatmate-card__score {
  margin-left: auto;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--r-pill);
  background-color: var(--rh-teal-12);
  color: var(--rh-teal);
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
}

.rh-flatmate-card__bio {
  font-size: var(--fs-small);
  line-height: var(--lh-relaxed);
}

.rh-flatmate-card__traits {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.rh-flatmate-card__traits li {
  padding: 2px var(--space-8);
  border-radius: var(--r-pill);
  background-color: var(--rh-surface);
  font-size: var(--fs-12);
  color: var(--rh-text-secondary);
}

.rh-flatmate-card__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: var(--space-8);
  padding-top: var(--space-12);
  border-top: 1px solid var(--rh-border);
}

.rh-flatmate-card__facts dt {
  font-size: var(--fs-12);
  color: var(--rh-text-secondary);
}

.rh-flatmate-card__facts dd {
  margin: 0;
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
}

/* The submit button needs clear separation from the last field's help text. */
.rh-flatmate-form button[type="submit"] {
  margin-top: var(--space-32);
}

.rh-flatmate-form .rh-field__error,
.rh-flatmate-form .rh-field__success {
  margin-top: var(--space-12);
}


/* ------------------------------------------------ DETAIL PAGE INTRO ROW */

/*
 * Title and cover side by side. A full-bleed banner made the photograph the
 * loudest thing on the page; the name and what is nearby matter more.
 */
/*
 * The row owns the vertical rhythm, not the header inside it. The cover is
 * taller than the text column, so when the header carried the padding the
 * photograph ran straight into the section rule below it.
 */
.rh-place__intro-row {
  display: grid;
  gap: var(--space-24);
  padding-block: var(--rh-crumbs-gap) var(--space-24);
}

/* The cover is taller than the text, so it needs a little more room below. */
.rh-place__intro-row--with-media {
  padding-bottom: var(--space-32);
}

@media (min-width: 900px) {
  .rh-place__intro-row--with-media {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
    align-items: center;
    gap: var(--space-40);
  }
}

.rh-place__intro-row .rh-place__head {
  padding-block: 0;
}

/* ------------------------------------------ UNIFORM DETAIL PAGE SPACING */

/*
 * College and locality detail pages share one rhythm: the same gap under the
 * breadcrumbs, the same title scale and the same section spacing. They were
 * drifting apart because each template set its own.
 *
 * The property page matches these values from pages/property.css. It cannot be
 * styled from here - this stylesheet is not enqueued on a single property, so
 * any .rh-property rule written in this file would be dead. The shared numbers
 * live in design-system.css tokens instead.
 */
.rh-place {
  padding-bottom: var(--space-64);
}

/* The head opens the page directly under the breadcrumbs. */
.rh-place__head {
  padding-block: var(--rh-crumbs-gap) var(--space-24);
}

.rh-place__title {
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
}

.rh-place__section {
  padding-block: var(--space-32);
  border-top: 1px solid var(--rh-border);
}

.rh-place__section-title {
  font-size: var(--fs-h3);
  margin-bottom: var(--space-20);
}

/* ------------------------------------------------------------- CITY TABS */

.rh-city-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-32);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--rh-border);
  overflow-x: auto;
}

.rh-city-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  min-height: var(--touch-target);
  padding: var(--space-8) var(--space-16);
  border-radius: var(--r-pill);
  color: var(--rh-text-secondary);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}

.rh-city-tab:hover {
  background-color: var(--rh-surface);
  color: var(--rh-teal);
  text-decoration: none;
}

.rh-city-tab.is-active {
  background-color: var(--rh-teal-12);
  color: var(--rh-teal);
  font-weight: var(--fw-semibold);
}

.rh-city-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding-inline: var(--space-4);
  border-radius: var(--r-pill);
  background-color: var(--rh-surface);
  color: var(--rh-text-secondary);
  font-size: var(--fs-12);
}

.rh-city-tab.is-active .rh-city-tab__count {
  background-color: var(--rh-white);
  color: var(--rh-teal);
}
