/* ==========================================================================
   Molecular Diagnostics and Therapy — design system (audit brief P4, Nov 2026)
   One primary colour, one dark text colour, one grey, one light grey, white.
   One font family, four sizes, two weights, 8px spacing grid.
   Every page should use these variables; do not invent new shades.
   ========================================================================== */
:root {
  /* Colour tokens (P4 #19) */
  --c-primary: #d9232d;        /* brand red: buttons, links, accents */
  --c-primary-ink: #b81c25;    /* primary on hover (same hue, darker) */
  --c-text: #0b1f3a;           /* dark text, footer background */
  --c-muted: #5b677a;          /* secondary text */
  --c-surface: #f4f6f9;        /* light grey background */
  --c-white: #ffffff;
  --c-line: rgba(11, 31, 58, 0.12); /* hairlines: dark text at 12% */

  /* Type (P4 #20) */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --fs-page-title: clamp(2rem, 1.4rem + 2.2vw, 2.75rem);
  --fs-section: clamp(1.5rem, 1.2rem + 1.1vw, 2rem);
  --fs-card-title: 1.125rem;
  --fs-body: 1rem;
  --fw-regular: 400;
  --fw-semibold: 600;

  /* Spacing (P4 #21): multiples of 8px */
  --s-1: 8px; --s-2: 16px; --s-3: 24px; --s-4: 32px; --s-5: 40px; --s-6: 48px; --s-8: 64px; --s-10: 80px;
  --section-gap: 80px;
  --card-gap: 24px;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(11, 31, 58, 0.08);
  --container: 1200px;
}
@media (max-width: 767.98px) {
  :root { --section-gap: 48px; }
}

/* ---------- Base ---------- */
.mdt-container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s-2); }
@media (min-width: 768px) { .mdt-container { padding: 0 var(--s-3); } }
.mdt-section { padding: var(--section-gap) 0; }
.mdt-section--soft { background: var(--c-surface); }
.mdt-section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-2); margin-bottom: var(--s-4); flex-wrap: wrap; }
.mdt-section__title { font-size: var(--fs-section); font-weight: var(--fw-semibold); color: var(--c-text); margin: 0; line-height: 1.25; }
.mdt-section__sub { color: var(--c-muted); margin: var(--s-1) 0 0; font-size: var(--fs-body); }
.mdt-link { color: var(--c-primary); font-weight: var(--fw-semibold); text-decoration: none; }
.mdt-link:hover { color: var(--c-primary-ink); text-decoration: underline; }

/* ---------- Buttons: primary colour only ---------- */
.mdt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-1);
  min-height: 48px; padding: 0 var(--s-3); border-radius: 999px; border: 2px solid var(--c-primary);
  background: var(--c-primary); color: var(--c-white); font-weight: var(--fw-semibold); font-size: var(--fs-body);
  text-decoration: none; cursor: pointer; line-height: 1; white-space: nowrap;
}
.mdt-btn:hover, .mdt-btn:focus-visible { background: var(--c-primary-ink); border-color: var(--c-primary-ink); color: var(--c-white); }
.mdt-btn--outline { background: transparent; color: var(--c-primary); }
.mdt-btn--outline:hover, .mdt-btn--outline:focus-visible { background: var(--c-primary); color: var(--c-white); }
.mdt-btn--sm { min-height: 40px; padding: 0 var(--s-2); font-size: 0.9375rem; }
:focus-visible { outline: 3px solid rgba(217, 35, 45, 0.35); outline-offset: 2px; }


/* ---------- Utility bar + header (P1 #5, #7, #9) ---------- */
.mdt-utility { background: var(--c-text); color: var(--c-white); font-size: 0.875rem; }
.mdt-utility .mdt-container { display: flex; justify-content: flex-end; align-items: center; min-height: 32px; }
.mdt-utility .translate-wrapper { position: relative; }
.mdt-lang-btn { background: none; border: 0; color: var(--c-white); display: inline-flex; gap: var(--s-1); align-items: center; padding: 4px 0; cursor: pointer; font: inherit; }
.mdt-utility .translate-dropdown { right: 0; left: auto; top: 100%; }

.mdt-header { position: sticky; top: 0; z-index: 1030; background: var(--c-white); border-bottom: 1px solid var(--c-line); }
.mdt-header__bar { display: flex; align-items: center; gap: var(--s-3); min-height: 72px; }
.mdt-logo { flex-shrink: 0; display: inline-flex; }
.mdt-logo img { height: 48px; width: auto; display: block; }
.mdt-nav-toggle {
  margin-left: auto; display: none; align-items: center; justify-content: center; width: 48px; height: 48px;
  border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-white); color: var(--c-text); font-size: 1.25rem; cursor: pointer;
}
.mdt-nav { flex: 1; display: flex; align-items: center; gap: var(--s-3); }
.mdt-nav__list { display: flex; align-items: center; justify-content: center; gap: var(--s-1); list-style: none; margin: 0 auto; padding: 0; }
.mdt-nav__link {
  display: block; padding: var(--s-1) 12px; border-radius: 8px; color: var(--c-text); font-weight: var(--fw-semibold);
  font-size: 0.9375rem; text-decoration: none; white-space: nowrap;
}
.mdt-nav__link:hover { color: var(--c-primary); }
.mdt-nav__link[aria-current="page"] { color: var(--c-primary); box-shadow: inset 0 -2px 0 var(--c-primary); border-radius: 0; }
.mdt-nav__actions { display: flex; align-items: center; gap: var(--s-2); flex-shrink: 0; }
.mdt-phone { color: var(--c-text); font-weight: var(--fw-semibold); text-decoration: none; white-space: nowrap; display: inline-flex; gap: var(--s-1); align-items: center; }
.mdt-phone:hover { color: var(--c-primary); }

/* Login: one entry point, five options one click deeper */
.mdt-login { position: relative; }
.mdt-login > summary { list-style: none; }
.mdt-login > summary::-webkit-details-marker { display: none; }
.mdt-login__menu {
  position: absolute; right: 0; top: calc(100% + var(--s-1)); min-width: 232px; background: var(--c-white);
  border: 1px solid var(--c-line); border-radius: 12px; box-shadow: var(--shadow); padding: var(--s-1); z-index: 1040;
}
.mdt-login__menu a { display: block; padding: 12px var(--s-2); border-radius: 8px; color: var(--c-text); text-decoration: none; font-weight: var(--fw-regular); }
.mdt-login__menu a:hover { background: var(--c-surface); color: var(--c-primary); }
.mdt-login__menu hr { margin: var(--s-1) 0; border: 0; border-top: 1px solid var(--c-line); }

@media (max-width: 1199.98px) {
  .mdt-header__bar { gap: var(--s-2); }
  .mdt-nav { gap: var(--s-2); }
  .mdt-nav__list { gap: 0; }
  .mdt-nav__link { padding: var(--s-1); }
  .mdt-nav__actions { gap: var(--s-1); }
  .mdt-phone span { display: none; }
}
@media (max-width: 991.98px) {
  .mdt-header__bar { min-height: 64px; gap: var(--s-2); }
  .mdt-logo img { height: 40px; }
  .mdt-nav-toggle { display: inline-flex; }
  .mdt-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch;
    background: var(--c-white); border-bottom: 1px solid var(--c-line); box-shadow: var(--shadow); padding: var(--s-2);
    max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .mdt-nav.is-open, .no-js .mdt-nav { display: flex; }
  .no-js .mdt-nav { position: static; box-shadow: none; }
  .mdt-nav__list { flex-direction: column; align-items: stretch; gap: 0; margin: 0; }
  .mdt-nav__link { padding: 12px var(--s-1); font-size: var(--fs-body); }
  .mdt-nav__link[aria-current="page"] { box-shadow: inset 3px 0 0 var(--c-primary); padding-left: var(--s-2); }
  .mdt-nav__actions { flex-direction: column; align-items: stretch; gap: var(--s-1); border-top: 1px solid var(--c-line); padding-top: var(--s-2); }
  .mdt-phone span { display: inline; }
  .mdt-phone { min-height: 48px; justify-content: center; }
  .mdt-login__menu { position: static; box-shadow: none; margin-top: var(--s-1); }
  .mdt-login > summary { width: 100%; }
}

/* ---------- Card template (P2 #12): every card on the site ---------- */
.mdt-grid { display: grid; gap: var(--card-gap); grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.mdt-grid--4 { --cols: 4; }
.mdt-grid--3 { --cols: 3; }
.mdt-grid--2 { --cols: 2; }
@media (max-width: 575.98px) { .mdt-grid--2 { --cols: 1; } }
@media (max-width: 1199.98px) { .mdt-grid--4 { --cols: 2; } }
@media (max-width: 991.98px) { .mdt-grid--3 { --cols: 2; } }
@media (max-width: 575.98px) { .mdt-grid--4, .mdt-grid--3 { --cols: 1; } }

.mdt-card {
  display: flex; flex-direction: column; background: var(--c-white); border: 1px solid var(--c-line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; height: 100%;
}
.mdt-card__media { aspect-ratio: 16 / 9; background: var(--c-surface); overflow: hidden; }
.mdt-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mdt-card__icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--c-surface); color: var(--c-primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; margin: var(--s-3) var(--s-3) 0;
}
.mdt-card__icon svg { width: 28px; height: 28px; }
.mdt-card__body { display: flex; flex-direction: column; flex: 1; padding: var(--s-3); gap: var(--s-1); }
.mdt-card__title { font-size: var(--fs-card-title); font-weight: var(--fw-semibold); color: var(--c-text); margin: 0; line-height: 1.35; }
.mdt-card__desc {
  color: var(--c-muted); margin: 0; font-size: 0.9375rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mdt-card__data { margin-top: auto; padding-top: var(--s-2); color: var(--c-text); font-weight: var(--fw-semibold); font-size: 0.9375rem; }
.mdt-card__data s { color: var(--c-muted); font-weight: var(--fw-regular); margin-left: var(--s-1); }
.mdt-card__action { padding: 0 var(--s-3) var(--s-3); }
.mdt-card__action .mdt-btn { width: 100%; }

/* ---------- Footer (P1 #6, P3 #16) ---------- */
.mdt-footer { background: var(--c-text); color: rgba(255, 255, 255, 0.78); padding: var(--s-8) 0 var(--s-4); font-size: 0.9375rem; }
.mdt-footer__brand { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; padding-bottom: var(--s-4); margin-bottom: var(--s-4); border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.mdt-footer__brand img { height: 48px; width: auto; }
.mdt-footer__contact { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); font-style: normal; }
.mdt-footer a { color: rgba(255, 255, 255, 0.78); text-decoration: none; }
.mdt-footer a:hover { color: var(--c-white); text-decoration: underline; }
.mdt-footer__cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
@media (max-width: 991.98px) { .mdt-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .mdt-footer__cols { grid-template-columns: 1fr; } }
.mdt-footer h2 { color: var(--c-white); font-size: var(--fs-body); font-weight: var(--fw-semibold); margin: 0 0 var(--s-2); }
.mdt-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.mdt-footer__bottom { margin-top: var(--s-6); padding-top: var(--s-3); border-top: 1px solid rgba(255, 255, 255, 0.12); display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: space-between; align-items: center; font-size: 0.875rem; }
.mdt-footer__legal { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); }
.mdt-social { display: flex; gap: var(--s-1); }
.mdt-social a { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.24); display: inline-flex; align-items: center; justify-content: center; }
.mdt-social a:hover { background: var(--c-primary); border-color: var(--c-primary); text-decoration: none; }
.mdt-social img { width: 18px; height: 18px; }

/* Screen-reader only */
.mdt-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
