/* ============================================================
   Mahuset — application page styles
   Extends the original NHS-frontend chrome with the few
   components the public site needs that nhsuk doesn't ship:
   the citizenship form steps, the souvenir grid + basket, and
   the compendium reference layout. Everything is token-based so
   it stays in lock-step with the rest of the site.

   Load order on each page:
   nhsuk.css  ->  mahuset.css  ->  mahuset-app.css  ->  style.css
   ============================================================ */
@import url("mahuset-tokens.css");

/* ---------- Shared: page intro lede under the hero ---------- */
.app-lede { max-width: 62ch; }

/* ---------- Breadcrumbs (nhsuk-style) ---------- */
.app-breadcrumb {
  background: var(--mh-surface-2);
  border-bottom: 1px solid var(--mh-line-soft);
  padding: 12px 0;
  font-size: .95rem;
}
.app-breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.app-breadcrumb li::after { content: "›"; margin-left: 8px; color: var(--mh-ink-soft); }
.app-breadcrumb li:last-child::after { content: ""; }
.app-breadcrumb a { color: var(--mh-burgundy-500); }
.app-breadcrumb li[aria-current] { color: var(--mh-ink-soft); }

/* ============================================================
   1 · CITIZENSHIP FORM
   ============================================================ */
.app-steps {
  display: flex;
  border: 1px solid var(--mh-line-soft);
  border-radius: var(--mh-radius-s);
  overflow: hidden;
  background: #fff;
  margin-bottom: var(--mh-space-6);
}
.app-step {
  flex: 1;
  padding: 14px 16px;
  border-right: 1px solid var(--mh-line-soft);
  display: flex; align-items: center; gap: 10px;
  font-size: .95rem; color: var(--mh-ink-soft);
}
.app-step:last-child { border-right: 0; }
.app-step__num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--mh-line); color: #fff;
  display: grid; place-items: center;
  font-weight: bold; font-size: .85rem; flex-shrink: 0;
}
.app-step.is-active { color: var(--mh-ink); background: var(--mh-burgundy-50); font-weight: bold; }
.app-step.is-active .app-step__num { background: var(--mh-burgundy-500); }
.app-step.is-done .app-step__num { background: var(--mh-success); }
@media (max-width: 48.0525em) {
  .app-steps { flex-direction: column; }
  .app-step { border-right: 0; border-bottom: 1px solid var(--mh-line-soft); }
  .app-step:last-child { border-bottom: 0; }
}

/* Form controls — match nhsuk input metrics with burgundy focus */
.app-form-section { margin-bottom: var(--mh-space-6); }
.app-form-section > legend,
.app-form-section > h3 {
  font-weight: bold; font-size: 1.15rem;
  padding: 0; margin: 0 0 var(--mh-space-3);
}
.app-field { margin-bottom: var(--mh-space-4); }
.app-field > label { display: block; font-weight: bold; margin-bottom: 6px; }
.app-field .app-hint { display: block; color: var(--mh-ink-soft); font-size: .9rem; margin-bottom: 6px; }
.app-control {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px;
  border: 2px solid var(--mh-ink);
  border-radius: var(--mh-radius-s);
  font: inherit; background: #fff;
}
textarea.app-control { min-height: 120px; resize: vertical; }
.app-control:focus {
  outline: 3px solid var(--mh-focus);
  outline-offset: 0;
  box-shadow: inset 0 0 0 2px var(--mh-ink);
}
.app-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--mh-space-4); }
@media (max-width: 40.0525em) { .app-grid-2 { grid-template-columns: 1fr; } }

/* Radio cards */
.app-choice {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--mh-line-soft);
  border-radius: var(--mh-radius-s);
  cursor: pointer; margin-bottom: 8px; background: #fff;
}
.app-choice:hover { border-color: var(--mh-burgundy-500); }
.app-choice input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--mh-burgundy-500); flex-shrink: 0; }
.app-choice:has(input:checked) { border-color: var(--mh-burgundy-500); background: var(--mh-burgundy-50); }
.app-choice__label strong { display: block; }
.app-choice__label small { color: var(--mh-ink-soft); }

/* ============================================================
   2 · SOUVENIR SHOP
   ============================================================ */
.shop-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: var(--mh-space-6); }
.shop-chip {
  border: 1px solid var(--mh-line-soft); background: #fff; color: var(--mh-ink);
  padding: 7px 16px; border-radius: 999px; font: inherit; font-size: .95rem; cursor: pointer;
  transition: all var(--mh-duration-s) var(--mh-ease);
}
.shop-chip:hover { border-color: var(--mh-burgundy-500); }
.shop-chip.is-active { background: var(--mh-burgundy-500); color: #fff; border-color: var(--mh-burgundy-500); }
.shop-basket-btn {
  margin-left: auto; background: var(--mh-burgundy-500); color: #fff; border: 0;
  padding: 10px 18px; border-radius: var(--mh-radius-s); font: inherit; font-weight: bold;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
}
.shop-basket-btn:hover { background: var(--mh-burgundy-700); }
.shop-basket-btn .badge {
  background: var(--mh-warning); color: var(--mh-ink);
  border-radius: 999px; padding: 2px 9px; font-size: .85rem; min-width: 18px; text-align: center;
}

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--mh-space-5); }
.product {
  background: #fff; border: 1px solid var(--mh-line-soft); border-radius: var(--mh-radius-m);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform var(--mh-duration-s) var(--mh-ease), box-shadow var(--mh-duration-s) var(--mh-ease);
}
.product:hover { transform: translateY(-2px); box-shadow: var(--mh-shadow-card); }
.product__visual { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--mh-surface-2); position: relative; overflow: hidden; }
.product__visual--burgundy { background: var(--mh-burgundy-500); }
.product__visual--cream { background: #f4ede4; }
.product__visual--ink { background: var(--mh-night); }
.product__visual svg { max-width: 70%; max-height: 70%; }
.product__badge {
  position: absolute; top: 12px; left: 12px; background: #fff; color: var(--mh-burgundy-500);
  padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: bold;
  letter-spacing: .05em; text-transform: uppercase;
}
.product__body { padding: var(--mh-space-4) var(--mh-space-4) var(--mh-space-5); display: flex; flex-direction: column; flex: 1; }
.product__cat { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--mh-ink-soft); margin: 0 0 4px; }
.product__title { font-weight: bold; font-size: 1.1rem; margin: 0 0 6px; line-height: 1.25; }
.product__desc { font-size: .9rem; color: var(--mh-ink-soft); line-height: 1.5; margin: 0 0 var(--mh-space-4); flex: 1; }
.product__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product__price { font-size: 1.15rem; font-weight: bold; }
.product__price small { font-weight: normal; color: var(--mh-ink-soft); font-size: .75rem; display: block; }
.product__add {
  background: var(--mh-burgundy-500); color: #fff; border: 0; padding: 8px 14px;
  border-radius: var(--mh-radius-s); font: inherit; font-weight: bold; font-size: .9rem;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.product__add:hover { background: var(--mh-burgundy-700); }
.product__add .material-symbols-outlined { font-size: 18px; }

/* Basket drawer */
.basket {
  position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 95vw;
  background: #fff; border-left: 1px solid var(--mh-line-soft);
  box-shadow: -8px 0 24px rgba(0,0,0,.15);
  transform: translateX(100%); transition: transform var(--mh-duration-m) var(--mh-ease);
  z-index: 1100; display: flex; flex-direction: column;
}
.basket.is-open { transform: translateX(0); }
.basket__head { padding: var(--mh-space-5); border-bottom: 1px solid var(--mh-line-soft); display: flex; align-items: center; justify-content: space-between; }
.basket__head h2 { margin: 0; font-size: 1.4rem; }
.basket__close { background: none; border: 0; cursor: pointer; padding: 4px; color: var(--mh-ink-soft); }
.basket__items { flex: 1; overflow-y: auto; padding: var(--mh-space-4) var(--mh-space-5); }
.basket__empty { color: var(--mh-ink-soft); text-align: center; padding: var(--mh-space-7) 0; }
.basket__item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--mh-line-soft); }
.basket__item:last-child { border-bottom: 0; }
.basket__item-name { flex: 1; font-size: .92rem; }
.basket__item-name small { display: block; color: var(--mh-ink-soft); font-size: .8rem; }
.basket__item-price { font-weight: bold; font-size: .92rem; }
.basket__foot { border-top: 1px solid var(--mh-line-soft); padding: var(--mh-space-5); background: var(--mh-burgundy-50); }
.basket__total { display: flex; justify-content: space-between; font-weight: bold; margin-bottom: var(--mh-space-4); font-size: 1.1rem; }
.basket__checkout {
  background: var(--mh-burgundy-500); color: #fff; width: 100%; padding: 14px; border: 0;
  border-radius: var(--mh-radius-s); font: inherit; font-weight: bold; font-size: 1rem;
  cursor: pointer; box-shadow: 0 4px 0 var(--mh-burgundy-900);
}
.basket__checkout:hover { background: var(--mh-burgundy-700); }
.basket-scrim { position: fixed; inset: 0; background: rgba(18,25,33,.4); opacity: 0; pointer-events: none; z-index: 1099; transition: opacity var(--mh-duration-m) var(--mh-ease); }
.basket-scrim.is-open { opacity: 1; pointer-events: auto; }

/* ============================================================
   3 · COMPENDIUM
   ============================================================ */
.comp-layout { display: grid; grid-template-columns: 240px 1fr; gap: var(--mh-space-7); }
@media (max-width: 48.0525em) { .comp-layout { grid-template-columns: 1fr; } }

.comp-toc { align-self: start; position: sticky; top: 20px; border: 1px solid var(--mh-line-soft); border-radius: var(--mh-radius-m); padding: var(--mh-space-4) 0; background: #fff; }
.comp-toc h2 {
  font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mh-ink-soft);
  margin: 0 var(--mh-space-4) 12px; padding-bottom: 8px; border-bottom: 1px solid var(--mh-line-soft);
}
.comp-toc a { display: block; padding: 7px var(--mh-space-4); color: var(--mh-ink); text-decoration: none; font-size: .95rem; border-left: 3px solid transparent; }
.comp-toc a:hover { background: var(--mh-burgundy-50); }
.comp-toc a.is-current { border-left-color: var(--mh-burgundy-500); background: var(--mh-burgundy-50); color: var(--mh-burgundy-700); font-weight: bold; }

.comp-article { max-width: 760px; }
.comp-section { margin-bottom: var(--mh-space-7); scroll-margin-top: 20px; }
.comp-section > h2 { border-bottom: 2px solid var(--mh-burgundy-500); padding-bottom: 10px; }

.infobox {
  float: right; width: 250px; margin: 0 0 var(--mh-space-4) var(--mh-space-5);
  border: 1px solid var(--mh-line-soft); background: var(--mh-burgundy-50);
  border-radius: var(--mh-radius-s); overflow: hidden; font-size: .9rem;
}
@media (max-width: 40.0525em) { .infobox { float: none; width: auto; margin-left: 0; } }
.infobox__head { background: var(--mh-burgundy-500); color: #fff; padding: 10px 12px; font-weight: bold; }
.infobox__visual { aspect-ratio: 3 / 2; background: #fff; display: grid; place-items: center; border-bottom: 1px solid var(--mh-line-soft); }
.infobox__visual svg { width: 80%; }
.infobox dl { margin: 0; padding: 8px 12px; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; }
.infobox dt { color: var(--mh-ink-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.infobox dd { margin: 0; }

.symbol-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--mh-space-4); margin: var(--mh-space-4) 0; }
.symbol-pair > div { border: 1px solid var(--mh-line-soft); border-radius: var(--mh-radius-s); padding: var(--mh-space-4); text-align: center; background: #fff; }
.symbol-pair svg, .symbol-pair .sym { max-width: 100%; max-height: 120px; height: 120px; margin: 0 auto; }
.symbol-pair p { font-size: .85rem; color: var(--mh-ink-soft); margin: 8px 0 0; }

.timeline { list-style: none; padding: 0; margin: var(--mh-space-3) 0; border-left: 2px solid var(--mh-burgundy-500); }
.timeline li { padding: 6px 0 14px 18px; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 12px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--mh-burgundy-500); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--mh-burgundy-500);
}
.timeline strong { display: block; color: var(--mh-burgundy-700); font-size: 1.1rem; }
.timeline small { color: var(--mh-ink-soft); font-size: .85rem; }

.pull-quote {
  border-left: 4px solid var(--mh-burgundy-500); padding: 8px 0 8px 18px; margin: var(--mh-space-5) 0;
  font-family: var(--mh-font-display); font-style: italic; font-size: 1.3rem; line-height: 1.5;
}
.pull-quote cite { display: block; margin-top: 8px; font-family: var(--mh-font-sans); font-style: normal; font-size: .85rem; color: var(--mh-ink-soft); }
