/* Hubs (signs hub, category hubs, section hubs) + shared tiles/cards used by the home page.
   Agent (a). Tokens only, no raw hex; flat BEM-ish classes. Loaded via `extraCss`. */

/* ---------- Section head with link ---------- */
.hub-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.hub-head h2 { margin: 0; }
.hub-intro { margin: 0 0 28px; max-width: 720px; }

/* ---------- Sign-class tiles (home + signs hub) ---------- */
.class-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.class-tile { display: flex; flex-direction: column; gap: 14px; height: 100%; min-height: 280px; padding: 20px; border: var(--bd-structural); text-decoration: none; background: var(--white); color: var(--ink); }
.class-tile:hover { color: inherit; outline: 4px solid var(--ink); outline-offset: 3px; }
.class-tile__text { display: flex; flex-direction: column; gap: 14px; }
.class-tile__name { font-family: var(--font-head); font-weight: 800; font-size: 30px; line-height: 1; text-transform: uppercase; }
.class-tile__desc { font-size: 15px; }
.class-tile__count { margin-top: auto; font-weight: 700; font-size: 15px; }
.class-tile--warning { background: var(--sign-yellow); }
.class-tile--mandatory, .class-tile--information { background: var(--sign-blue); color: var(--white); }
.class-tile--safe-condition { background: var(--sign-green); color: var(--white); }
.class-tile--fire { background: var(--sign-red); color: var(--white); }
.class-tile--mandatory:hover, .class-tile--information:hover, .class-tile--safe-condition:hover, .class-tile--fire:hover { color: var(--white); }

/* ---------- Whole-card links with real previews ---------- */
.pcard-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.pcard-grid > li { display: flex; min-width: 0; }
.pcard { display: flex; flex-direction: column; width: 100%; border: var(--bd-card); background: var(--white); text-decoration: none; color: var(--ink); min-width: 0; }
.pcard:hover { color: var(--ink); outline: 4px solid var(--ink); outline-offset: 3px; }
.pcard__media { display: flex; align-items: center; justify-content: center; height: 220px; padding: 12px; background: var(--paper); border-bottom: var(--bd-card); }
.pcard__media img { height: 100%; width: auto; max-width: 100%; object-fit: contain; background: var(--white); border: 1px solid var(--ink); }
.pcard__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.pcard__class { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.pcard__class--red { color: var(--text-red); } .pcard__class--yellow { color: var(--text-yellow); }
.pcard__class--blue { color: var(--text-blue); } .pcard__class--green { color: var(--text-green); }
.pcard__title { font-family: var(--font-head); font-weight: 700; font-size: 26px; line-height: 1.05; }
.pcard__meta { font-size: 14px; color: var(--muted); }
.pcard-grid__ad { grid-column: 1 / -1; }
.pcard-grid__ad .ad { max-width: none; width: 100%; min-height: 120px; }

/* ---------- Section hub shells (posters, templates, household) ---------- */
.link-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 24px; }
.link-list li { border-top: 2px solid var(--ink); }
.link-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; font-weight: 600; text-decoration: none; }
.link-list a:hover { text-decoration: underline; }
.link-list__meta { font-size: 14px; font-weight: 400; color: var(--muted); }
.hub-empty { background: var(--white); border: var(--bd-structural); padding: 28px; max-width: 760px; }
.hub-empty h2 { font-size: 36px; margin-bottom: 8px; }
.hub-empty .btn { margin-top: 16px; }

/* ---------- Category hub: filter + colour guide ---------- */
.hub-filter { background: var(--white); border: var(--bd-structural); padding: 20px 24px; }
.hub-filter fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.hub-filter legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.hub-filter__row { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-filter__opt { position: relative; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: var(--bd-card); font-weight: 700; cursor: pointer; }
.hub-filter__opt input { margin: 0; width: 18px; height: 18px; accent-color: var(--ink); }
.hub-filter__opt:has(input:checked) { background: var(--ink); color: var(--white); }
.hub-filter__opt:has(input:checked) input { accent-color: var(--sign-yellow); }
.hub-filter__opt:has(input:focus-visible) { outline: 3px solid var(--sign-yellow); box-shadow: 0 0 0 6px var(--ink); }
.hub-filter__opt svg { width: 22px; height: 22px; }
.hub-count { margin: 0; font-size: 15px; color: var(--muted); }
.colour-guide { background: var(--ink); color: var(--white); padding: 32px; }
.colour-guide h2 { font-size: 36px; margin-bottom: 20px; }
.colour-guide ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.colour-guide li { display: flex; gap: 16px; align-items: flex-start; }
.colour-guide svg { flex: none; width: 44px; height: 44px; }
.colour-guide strong { display: block; font-size: 18px; }
.colour-guide span { color: var(--muted-on-ink); font-size: 15px; }
.colour-guide p { margin: 24px 0 0; font-size: 15px; color: var(--muted-on-ink); }
.colour-guide a { color: var(--white); font-weight: 700; }
.related-cats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.related-cats a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 96px; padding: 18px 12px; background: var(--white); border: var(--bd-card); text-decoration: none; font-weight: 700; text-align: center; }
.related-cats a:hover { background: var(--ink); color: var(--white); }
.related-cats svg { width: 36px; height: 36px; }
.ad-row { display: flex; justify-content: center; }

@media (max-width: 599px) {
  .class-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .class-tile { min-height: 0; padding: 14px; gap: 8px; }
  .class-tile svg { width: 64px; height: 64px; }
  .class-tile__name { font-size: 24px; }
  .class-tile__text { gap: 8px; }
  .class-tile__desc { display: none; }
  .class-tiles__item--wide { grid-column: 1 / -1; }
  .pcard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pcard__media { height: 150px; padding: 8px; }
  .pcard__body { padding: 10px 12px 12px; }
  .pcard__class { font-size: 12px; }
  .pcard__title { font-size: 21px; }
  .pcard__meta { display: none; }
  .colour-guide { padding: 24px 20px; }
}

/* ---------- Search page (C-Search) ---------- */
.search-band { background: var(--white); border-bottom: var(--bd-structural); }
.search-band__inner { padding-block: 32px 0; }
.search-band h1 { font-size: clamp(44px, 5.4vw, 72px); line-height: 0.95; margin-bottom: 20px; overflow-wrap: anywhere; }
.search-form { display: flex; max-width: 820px; margin-bottom: 28px; }
.search-form input { flex: 1; min-width: 0; height: 64px; border: var(--bd-structural); border-right: 0; padding: 0 20px; font: inherit; font-size: 22px; font-weight: 600; background: var(--white); border-radius: 0; }
.search-form button { flex: none; display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 24px; border: var(--bd-structural); background: var(--ink); color: var(--white); font-family: var(--font-head); font-weight: 800; font-size: 24px; text-transform: uppercase; cursor: pointer; border-radius: 0; }
.search-form button:hover { background: var(--ink-hover); }
.search-tabs { max-width: 100%; min-width: 0; }
.search-tabs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 4px; }
.search-tabs button { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 16px; border: 0; border-bottom: 4px solid transparent; background: transparent; color: var(--ink); font-family: var(--font-head); font-weight: 700; font-size: 21px; text-transform: uppercase; letter-spacing: 0.03em; cursor: pointer; border-radius: 0; }
.search-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.search-tabs button:disabled { color: var(--ad-text); cursor: default; }
.search-tabs .tab__n { background: var(--disabled-fill); color: var(--ink); font-family: var(--font-body); font-size: 14px; padding: 0 7px; }
.search-tabs button[aria-pressed="true"] .tab__n { background: var(--white); }
.search-main { padding-block: 8px 24px; }
.search-results { gap: 20px; }
.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.res { background: var(--white); border: var(--bd-card); display: flex; }
.res__media { flex: none; width: 132px; display: flex; align-items: center; justify-content: center; background: var(--paper); border-right: var(--bd-card); padding: 12px; }
.res__media img { max-height: 120px; width: auto; max-width: 100%; border: 1px solid var(--ink); background: var(--white); }
.res__body { flex: 1; min-width: 0; padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.res__sec { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.res__sec--signs { color: var(--text-red); } .res__sec--posters { color: var(--text-yellow); } .res__sec--templates { color: var(--text-blue); } .res__sec--household { color: var(--text-green); }
.res__title { font-family: var(--font-head); font-weight: 700; font-size: 28px; line-height: 1.05; text-decoration: none; overflow-wrap: anywhere; }
.res__title:hover { text-decoration: underline; }
.res__excerpt { font-size: 15px; }
.res mark, .res__excerpt mark { background: var(--sign-yellow); color: var(--ink); padding: 0 2px; }
.res-ad { list-style: none; }
.res-ad .ad { max-width: none; width: 100%; min-height: 120px; }
.results-more { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 8px; }
.results-more[hidden], .hub-empty[hidden] { display: none; }
.btn--big { min-height: 56px; padding: 0 28px; border: var(--bd-structural); font-family: var(--font-head); font-weight: 800; font-size: 22px; text-transform: uppercase; }
.empty-tips { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.empty-tips button { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--sign-blue); text-decoration: underline; cursor: pointer; min-height: 44px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: var(--bd-card); text-decoration: none; font-weight: 700; font-size: 15px; }
.chips a:hover { background: var(--ink); color: var(--white); }
.shape-key { background: var(--ink); color: var(--white); padding: 20px; }
.shape-key__title { margin: 0 0 6px; font-family: var(--font-head); font-weight: 800; font-size: 22px; text-transform: uppercase; }
.shape-key ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.shape-key li { display: flex; align-items: center; gap: 10px; }
.shape-key svg { background: var(--white); padding: 2px; }
@media (max-width: 599px) {
  .search-band__inner { padding-block: 24px 0; }
  .search-form input { height: 56px; font-size: 18px; padding: 0 14px; }
  .search-form button { height: 56px; padding: 0 16px; font-size: 20px; }
  .search-tabs { overflow: hidden; }
  .search-tabs ul { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .search-tabs li { flex: none; }
  .search-tabs button { min-height: 48px; padding: 0 12px; font-size: 19px; white-space: nowrap; }
  .res__media { width: 84px; padding: 8px; }
  .res__media img { max-height: 90px; }
  .res__body { padding: 12px 14px; }
  .res__title { font-size: 24px; }
}
body.search-page .page-main__body { padding: 0; }
.cat-tiles { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 599px) {
  .cat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cat-tiles .cat-tile { min-height: 84px; padding: 12px; font-size: 22px; }
}

/* In-feed slots keep the size they are labelled with when a phone unit is set (300x250 on phones). */
.pcard-grid__ad .ad--300x250, .res-ad .ad--300x250 { max-width: 300px; min-height: 250px; }
.pcard-grid__ad .ad--320x100, .res-ad .ad--320x100 { max-width: 320px; min-height: 100px; }
