/*
 * FND Connect web interaction system
 *
 * Apple HIG principles are used here as behavioural guidance: clear purpose,
 * familiar controls, generous targets, visible state, user agency and optional
 * motion. The visual language remains FND Connect: Inter, navy structure,
 * magenta action and warm, human editorial surfaces.
 */

:root {
  /* Interaction geometry */
  --fnd-tap-min: 44px;
  --fnd-control-min: 48px;
  --fnd-control-radius: 10px;
  --fnd-surface-radius: 16px;
  --fnd-dialog-radius: 18px;

  /* Semantic colour roles */
  --fnd-action: #c9005a;
  --fnd-action-hover: #9f0047;
  --fnd-structure: #002b5f;
  --fnd-structure-hover: #001f45;
  --fnd-focus: #ffdd00;
  --fnd-surface: #ffffff;
  --fnd-surface-subtle: #f6f8fb;
  --fnd-surface-brand: #fff4f8;
  --fnd-text-strong: #061b3d;
  --fnd-text-body: #26364d;
  --fnd-text-muted: #56677d;
  --fnd-line: #d8e1ec;
  --fnd-success: #087455;
  --fnd-warning-ink: #6b3b00;
  --fnd-danger: #a30d2d;

  /* Feedback and depth */
  --fnd-focus-ring: 0 0 0 3px var(--fnd-focus);
  --fnd-shadow-soft: 0 10px 28px rgba(0, 43, 95, 0.07);
  --fnd-shadow-raised: 0 18px 42px rgba(0, 43, 95, 0.12);
  --fnd-duration-fast: 140ms;
  --fnd-duration-standard: 220ms;
}

/* One focus contract across public, product and portal surfaces. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--fnd-focus) !important;
  outline-offset: 3px !important;
}

/* Shared control primitives. Existing route classes opt in without a reskin. */
.fnd-action,
.hub-actions .button,
.tools-hero__actions .button,
.tools-help__actions .button {
  display: inline-flex;
  min-height: var(--fnd-control-min);
  align-items: center;
  justify-content: center;
  border-radius: var(--fnd-control-radius);
  line-height: 1.2;
}

.fnd-action {
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border: 2px solid var(--fnd-action);
  color: #fff;
  background: var(--fnd-action);
  font: inherit;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.fnd-action:hover {
  border-color: var(--fnd-action-hover);
  color: #fff;
  background: var(--fnd-action-hover);
}

.fnd-action--secondary {
  border-color: var(--fnd-structure);
  color: var(--fnd-structure);
  background: #fff;
}

.fnd-action--secondary:hover {
  border-color: var(--fnd-structure-hover);
  color: #fff;
  background: var(--fnd-structure-hover);
}

.fnd-action[disabled],
.fnd-action[aria-disabled="true"] {
  opacity: 0.58;
  cursor: not-allowed;
}

.fnd-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.fnd-surface {
  border: 1px solid var(--fnd-line);
  border-radius: var(--fnd-surface-radius);
  color: var(--fnd-text-body);
  background: var(--fnd-surface);
  box-shadow: var(--fnd-shadow-soft);
}

.fnd-notice {
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--fnd-structure);
  border-radius: 0 var(--fnd-control-radius) var(--fnd-control-radius) 0;
  color: var(--fnd-text-body);
  background: var(--fnd-surface-subtle);
}

.fnd-notice--support {
  border-left-color: var(--fnd-action);
  background: var(--fnd-surface-brand);
}

.fnd-field {
  display: grid;
  gap: 0.35rem;
}

.fnd-field > label,
.fnd-field__label {
  color: var(--fnd-text-strong);
  font-weight: 750;
}

.fnd-field :where(input, select, textarea) {
  width: 100%;
  min-height: var(--fnd-control-min);
  border: 1px solid #aebdce;
  border-radius: var(--fnd-control-radius);
  padding: 0.7rem 0.8rem;
  color: var(--fnd-text-strong);
  background: #fff;
  font: inherit;
}

.fnd-field :where(input, select, textarea):focus {
  border-color: var(--fnd-structure);
}

/* Core journey surfaces share geometry and feedback, not identical artwork. */
.hub-page {
  --hub-radius: var(--fnd-surface-radius);
  --hub-shadow: var(--fnd-shadow-soft);
}

.hub-card,
.hub-aside,
.hub-band,
.tool-list__item,
.clinician-panel-card,
.clinician-kpi {
  border-radius: var(--fnd-surface-radius);
}

.hub-card,
.tool-list__item {
  transition:
    border-color var(--fnd-duration-fast) ease,
    box-shadow var(--fnd-duration-fast) ease,
    transform var(--fnd-duration-fast) ease;
}

.hub-card:focus-visible,
.tool-list__item:focus-within {
  border-color: var(--pathway-accent, var(--fnd-action));
  box-shadow: var(--fnd-focus-ring), var(--fnd-shadow-raised);
}

/* Every menu destination is a full-size target, not just a line of text. */
.mega-menu-group a,
.mega-shop-door__extra,
.account-menu-link,
.footer-link-list a {
  min-height: var(--fnd-tap-min);
  align-items: center;
}

.mega-menu-group a {
  display: flex;
  padding-block: 0.62rem;
}

/* Blog directory: nine calm choices first, with explicit search and reveal. */
.blog-directory__head {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(24rem, 1.2fr);
  gap: 1.5rem 2.5rem;
  align-items: end;
  margin-bottom: 1rem;
}

.blog-directory__head h2 {
  margin-bottom: 0.45rem;
}

.blog-directory__head p,
.blog-directory__status {
  color: var(--fnd-text-muted);
}

.blog-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(11rem, 0.65fr);
  gap: 0.85rem;
  padding: 1rem;
  box-shadow: none;
}

.blog-directory__status {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.blog-card[hidden] {
  display: none !important;
}

.blog-directory__more {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  margin-top: 1.5rem;
  text-align: center;
}

.blog-directory__more p {
  max-width: 34rem;
  color: var(--fnd-text-muted);
}

/* Footer groups stay fully visible on larger screens and become predictable,
   keyboard-operable disclosures on a phone. */
.footer-disclosure {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.footer-disclosure > summary {
  display: flex;
  min-height: var(--fnd-tap-min);
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.65rem;
  padding: 0 0 0.45rem;
  border-bottom: 1px solid var(--footer-line);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.2;
  list-style: none;
  text-transform: uppercase;
  cursor: default;
}

.footer-disclosure > summary::-webkit-details-marker {
  display: none;
}

.footer-disclosure > summary::after {
  content: none;
}

.footer-disclosure__icon {
  display: none;
  width: 0.7rem;
  height: 0.7rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

@media (max-width: 900px) {
  .blog-directory__head {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .blog-controls {
    grid-template-columns: 1fr;
  }

  .footer-nav {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .footer-disclosure {
    border-bottom: 1px solid var(--footer-line);
  }

  .footer-disclosure > summary {
    margin: 0;
    padding: 0.75rem 0;
    border-bottom: 0;
    cursor: pointer;
  }

  .footer-disclosure__icon {
    display: block;
    transition: transform var(--fnd-duration-fast) ease;
  }

  .footer-disclosure[open] .footer-disclosure__icon {
    transform: rotate(225deg) translate(-2px, -2px);
  }

  .footer-disclosure .footer-link-list {
    padding: 0.1rem 0 0.8rem;
  }

  .footer-link-list a {
    width: 100%;
    padding-inline: 0.15rem;
  }
}

/* Modal-like layers get exclusive control of fixed chrome. */
body.mobile-nav-open .mobile-support-dock,
body.mobile-nav-open .emma-widget,
body.site-search-open .mobile-support-dock,
body.site-search-open .emma-widget,
html.fnd-cookie-open .mobile-support-dock,
html.fnd-cookie-open .emma-widget {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* The initial safety message remains visible. Once someone starts scrolling,
   mobile chrome yields to the task and keeps only the compact nav row. */
@media (max-width: 1120px) {
  .site-header.is-condensed .topbar,
  .site-header.is-condensed .impact-ticker {
    display: none;
  }

  .site-header.is-condensed .nav-row {
    min-height: 64px;
  }

  .site-header.is-condensed .brand {
    max-width: min(152px, 42vw);
  }

  .site-header.is-condensed .brand img {
    max-height: 54px;
  }

  body.mobile-nav-open .site-header {
    z-index: 10030;
  }

  body.mobile-nav-open .site-nav {
    overscroll-behavior: contain;
  }
}

/* User preference wins globally, including scrolling and busy indicators. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .emma-widget__typing-dot {
    animation: none !important;
    opacity: 0.72;
  }
}

@media (max-width: 620px) {
  .fnd-action-row,
  .hub-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .fnd-action-row > *,
  .hub-actions > * {
    width: 100%;
  }
}
