/* Hydmetals — the generic page, the enquiry page and the 404.
   Only .hm-pg-… classes live here: the shell, cards, buttons, fields, prose, crumbs and the closing
   band come from tokens.css and style.css. The password form is styled once at the end, because four
   templates can print it. Mobile first, no !important. */

/* 1. Page head, with an optional hero -------------------------------------- */
.hm-pg-head__inner {
  display: grid;
  gap: clamp(1.2rem, 2.6vw, 2.4rem);
  align-items: center;
}
.hm-pg-head__text { min-width: 0; }
.hm-pg-head__text h1 { max-width: 30ch; }
.hm-pg-head__text .hm-lede { max-width: 58ch; }
.hm-pg-head__text > *:last-child { margin-bottom: 0; }

.hm-pg-hero {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--hm-radius-lg);
  background: var(--hm-tint);
}
.hm-pg-hero img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 900px) {
  .hm-pg-head__inner--media { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
  .hm-pg-hero { aspect-ratio: 4 / 3; max-height: 26rem; }
}

/* 2. Page body ------------------------------------------------------------- */
.hm-pg-body .hm-prose > h2:first-child { margin-top: 0; }

/* 3. Child pages ----------------------------------------------------------- */
.hm-pg-cards { margin-top: clamp(1rem, 2vw, 1.4rem); }
.hm-pg-card__media {
  position: relative;
  display: block;
  aspect-ratio: 3 / 1;
  border-bottom: var(--hm-border);
  background: var(--hm-tint);
}
.hm-pg-card__media .hm-plate {
  position: absolute;
  inset: 0;
  min-height: 0;
}

/* 4. Link rows: the factory pages, a parent and its siblings --------------- */
.hm-pg-links {
  margin: clamp(1rem, 2vw, 1.4rem) 0 0;
  padding: 0;
  list-style: none;
  border-top: var(--hm-border);
}
.hm-pg-links li { margin: 0; border-bottom: var(--hm-border); }
.hm-pg-links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0.1rem;
  text-decoration: none;
}
.hm-pg-links a::after { content: "\2192"; color: var(--hm-blue); font-weight: 400; }
.hm-pg-links a:hover { text-decoration: none; }
.hm-pg-links a:hover .hm-pg-links__title { color: var(--hm-blue); }
.hm-pg-links__body { min-width: 0; }
.hm-pg-links__title {
  display: block;
  color: var(--hm-navy);
  font-family: var(--hm-font-display);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
}
.hm-pg-links__text {
  display: block;
  margin-top: 0.25rem;
  max-width: 62ch;
  color: var(--hm-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.hm-pg-note { margin-top: 1rem; }
.hm-pg-note p + p { margin-top: 0.8rem; }

/* 5. The enquiry page ------------------------------------------------------ */
.hm-pg-contact-section { padding-top: clamp(1rem, 2vw, 1.6rem); }
.hm-pg-contact {
  display: grid;
  gap: clamp(1.6rem, 3vw, 3rem);
  align-items: start;
}
.hm-pg-contact__main { min-width: 0; }
.hm-pg-contact__head h2 { margin-bottom: 0.45rem; }
.hm-pg-contact__lede {
  margin: 0 0 clamp(1.1rem, 2vw, 1.6rem);
  max-width: 54ch;
  color: var(--hm-muted);
  font-size: 0.95rem;
}
.hm-pg-form form { margin: 0; }
.hm-pg-form .hm-field { margin-bottom: 1rem; }
.hm-pg-form .hm-btn-row { margin-top: 0.4rem; }
.hm-pg-form__status { min-height: 1.2rem; margin: 0.6rem 0 0; }
.hm-pg-hint {
  display: block;
  color: var(--hm-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.hm-pg-aside {
  min-width: 0;
  padding: clamp(1.1rem, 2vw, 1.6rem);
  border: var(--hm-border);
  border-radius: var(--hm-radius-lg);
  background: var(--hm-tint);
}
.hm-pg-aside h2 { margin-bottom: 0.9rem; font-size: var(--hm-h4); }
.hm-pg-aside > .hm-eyebrow { margin-bottom: 0.4rem; }
.hm-pg-aside__note { margin-top: 1.1rem; }

@media (min-width: 940px) {
  .hm-pg-contact { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
  .hm-pg-aside { position: sticky; top: 5.6rem; }
}

/* 6. Direct routes and the copied address ---------------------------------- */
.hm-pg-routes { margin: 0; }
.hm-pg-route { padding: 0.85rem 0; border-top: var(--hm-border); }
.hm-pg-route:first-child { padding-top: 0; border-top: 0; }
.hm-pg-route dt {
  margin-bottom: 0.25rem;
  color: var(--hm-muted);
  font-family: var(--hm-font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hm-pg-route dd {
  margin: 0;
  color: var(--hm-ink);
  font-size: 0.95rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.hm-pg-route__link { font-weight: 500; }

.hm-pg-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.hm-pg-copy__value {
  flex: 1 1 12ch;
  min-width: 0;
  color: var(--hm-navy);
  font-family: var(--hm-font-mono);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.hm-pg-copy .hm-btn { flex: 0 0 auto; }
.hm-pg-copy__status {
  flex: 1 1 100%;
  min-height: 1.1rem;
  margin: 0;
  color: var(--hm-muted);
  font-size: 0.76rem;
}

/* 7. 404 ------------------------------------------------------------------- */
.hm-pg-404 {
  display: grid;
  gap: clamp(1.6rem, 3vw, 3rem);
  align-items: start;
}
.hm-pg-404__head h1 { max-width: 24ch; }
.hm-pg-404__col { min-width: 0; }
.hm-pg-404__col h2 { margin-bottom: 0.9rem; font-size: var(--hm-h3); }

@media (min-width: 880px) {
  .hm-pg-404 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.hm-pg-search { margin: 0; }
.hm-pg-search__label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--hm-muted);
  font-family: var(--hm-font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hm-pg-search__row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hm-pg-search input[type="search"] {
  flex: 1 1 11rem;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--hm-line-2);
  border-radius: var(--hm-radius);
  background: #fff;
  color: var(--hm-ink);
  font-family: var(--hm-font-body);
  font-size: 0.95rem;
  line-height: 1.4;
}
.hm-pg-search input[type="search"]:focus {
  outline: 2px solid var(--hm-blue);
  outline-offset: 1px;
  border-color: var(--hm-blue);
}

.hm-pg-families {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 1.2rem;
  padding: 0;
  list-style: none;
}
.hm-pg-families li { margin: 0; }
.hm-pg-families a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.85rem;
  border: var(--hm-border);
  border-radius: var(--hm-radius);
  background: #fff;
  color: var(--hm-navy);
  font-family: var(--hm-font-display);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: border-color 0.18s var(--hm-ease), color 0.18s var(--hm-ease);
}
.hm-pg-families a::after {
  content: "\2192";
  flex: 0 0 auto;
  color: var(--hm-blue);
  font-weight: 400;
}
.hm-pg-families a:hover {
  border-color: var(--hm-blue);
  color: var(--hm-blue);
  text-decoration: none;
}

/* 8. The password form, printed by page.php, page-contact.php, single.php and index.php ---- */
.hm-pg-locked { max-width: 34rem; }
.hm-pg-locked > p:first-child { margin-bottom: 1rem; color: var(--hm-muted); }
.hm-pg-locked .post-password-form { margin: 0; }
.hm-pg-locked .post-password-form p { margin: 0 0 0.7rem; }
.hm-pg-locked .post-password-form label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--hm-muted);
  font-family: var(--hm-font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hm-pg-locked input[type="password"] {
  display: block;
  width: 100%;
  max-width: 20rem;
  margin-top: 0.35rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--hm-line-2);
  border-radius: var(--hm-radius);
  color: var(--hm-ink);
  font-family: var(--hm-font-body);
  font-size: 0.95rem;
}
.hm-pg-locked input[type="password"]:focus {
  outline: 2px solid var(--hm-blue);
  outline-offset: 1px;
  border-color: var(--hm-blue);
}
.hm-pg-locked input[type="submit"] {
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--hm-navy);
  border-radius: var(--hm-radius);
  background: var(--hm-navy);
  color: #fff;
  font-family: var(--hm-font-display);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.hm-pg-locked input[type="submit"]:hover {
  background: var(--hm-blue);
  border-color: var(--hm-blue);
}
