/* ==========================================================================
   IRIS Radiology, LP - site stylesheet
   Rebuild of the 2024 PHP-generated layout.php as static CSS.
   Design tokens follow IRIS_BRAND.md exactly.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts
   Commissioner and Josefin Sans are open-licensed and were already shipping
   on the old site. The brand book specifies Gill Sans / Rotis / Sabon, which
   are licensed desktop faces that cannot legally be served as webfonts.
   Commissioner is the closest humanist sans we can actually distribute; the
   Gill Sans stack is kept as the fallback chain for anyone who has it.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: Commissioner;
  src: url('../fonts/Commissioner-Variable.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: JosefinSans;
  src: url('../fonts/JosefinSans-Variable.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Primary brand */
  --iris-blue: #0073CF;
  --iris-teal: #009B74;

  /* Blue scale */
  --blue-10: #E6F3FB;
  --blue-40: #B3D9F5;
  --blue-70: #4DA8E6;
  --blue-dark: #00508F;

  /* Teal scale */
  --teal-10: #E0F4EF;
  --teal-40: #80CDB9;
  --teal-70: #00C49A;
  --teal-dark: #006E52;

  /* Neutral */
  --black: #000000;
  --gray-light: #F5F5F5;
  --gray-mid: #888888;
  --gray-dark: #333333;
  --white: #FFFFFF;

  /* Surfaces */
  --panel: rgba(255, 255, 255, 0.94);
  --panel-solid: #FFFFFF;
  --rule: rgba(0, 155, 116, 0.28);

  /* Type */
  --font-body: Commissioner, 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', system-ui, sans-serif;
  --font-display: JosefinSans, Commissioner, 'Gill Sans MT', system-ui, sans-serif;

  /* Fluid type scale */
  --fs-body: clamp(1rem, 0.96rem + 0.20vw, 1.125rem);
  --fs-lead: clamp(1.06rem, 1.00rem + 0.30vw, 1.25rem);
  --fs-h1: clamp(1.75rem, 1.25rem + 2.20vw, 3.00rem);
  --fs-h2: clamp(1.30rem, 1.15rem + 0.70vw, 1.75rem);
  --fs-h3: clamp(1.06rem, 1.00rem + 0.30vw, 1.25rem);
  --fs-small: 0.875rem;

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;

  /* Layout */
  --shell: min(1120px, 92vw);
  --radius: 4px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   3. Reset and base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 350;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: var(--gray-dark);
  background-color: #05080d;
  background-image:
    linear-gradient(rgba(0, 12, 30, 0.55), rgba(0, 12, 30, 0.62)),
    url('../img/bg.webp');
  background-size: 1600px auto;
  background-repeat: repeat;
  background-attachment: fixed;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--teal-dark);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  color: var(--iris-teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--iris-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.25;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 var(--sp-4);
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

/* Skip link for keyboard and screen-reader users. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: var(--sp-3) var(--sp-5);
  background: var(--iris-blue);
  color: var(--white);
  font-weight: 600;
}

.skip-link:focus {
  left: var(--sp-4);
  top: var(--sp-4);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   4. Shell
   Every band shares one centred column width, which is how the original
   site read. The old build hardcoded `width: 50%`, which left enormous
   dead margins on wide screens and cramped everything under 1556px.
   -------------------------------------------------------------------------- */

.shell {
  width: var(--shell);
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   5. Header
   -------------------------------------------------------------------------- */

.header {
  background: var(--panel);
  backdrop-filter: blur(6px);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.header__logo img {
  width: clamp(190px, 22vw, 250px);
  height: auto;
}

.header__contact {
  text-align: right;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--gray-dark);
}

.header__contact a {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--blue-dark);
  letter-spacing: 0.02em;
}

.header__contact span {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--gray-mid);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   6. Navigation
   -------------------------------------------------------------------------- */

.nav {
  background-image: linear-gradient(var(--panel), var(--teal-40));
  position: relative;
}

.nav__toggle {
  display: none;
  width: 100%;
  padding: var(--sp-3) var(--sp-5);
  background: none;
  border: 0;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-dark);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
}

.nav__toggle-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}

.nav__toggle-bars i {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--teal-dark);
}

.nav__list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__list a {
  display: block;
  padding: var(--sp-3) var(--sp-5);
  margin-inline: clamp(0px, 1.5vw, 20px);
  color: var(--teal-dark);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 4px solid transparent;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.nav__list a:hover {
  color: var(--teal-dark);
  border-bottom-color: var(--iris-teal);
  text-decoration: none;
}

.nav__list a[aria-current='page'] {
  border-bottom-color: var(--teal-dark);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   7. Banner
   -------------------------------------------------------------------------- */

.banner {
  background-color: var(--iris-blue);
  background-image:
    linear-gradient(120deg, rgba(0, 80, 143, 0.95), rgba(0, 115, 207, 0.80)),
    url('../img/bg.webp');
  background-size: auto, 900px auto;
  background-position: center;
  display: grid;
  place-items: center;
  text-align: center;
  padding: clamp(var(--sp-6), 5vw, var(--sp-8)) var(--sp-5);
}

.banner h1 {
  color: var(--white);
  font-size: var(--fs-h1);
  font-weight: 300;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
  max-width: 22ch;
}

.banner h1 strong {
  font-weight: 700;
}

.banner__sub {
  margin: var(--sp-4) 0 0;
  color: var(--blue-10);
  font-size: var(--fs-lead);
  font-weight: 300;
  max-width: 62ch;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}

/* --------------------------------------------------------------------------
   8. Content panels
   -------------------------------------------------------------------------- */

.panel {
  background: var(--panel);
  backdrop-filter: blur(6px);
  padding: clamp(var(--sp-5), 4vw, var(--sp-7)) clamp(var(--sp-5), 5vw, var(--sp-8));
}

.section + .section {
  margin-top: var(--sp-7);
  padding-top: var(--sp-7);
  border-top: 3px solid var(--rule);
}

.section h2 {
  color: var(--iris-blue);
  font-size: var(--fs-h2);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}

.section h3 {
  color: var(--teal-dark);
  font-size: var(--fs-h3);
  letter-spacing: 0.08em;
  margin: var(--sp-5) 0 var(--sp-2);
}

.section ul {
  margin: 0 0 var(--sp-4);
  padding-left: 1.25em;
}

.section li {
  margin-bottom: var(--sp-2);
}

.lead {
  font-size: var(--fs-lead);
  color: var(--gray-dark);
}

.prose {
  max-width: 68ch;
}

/* Two-up feature grid, used on the home page. */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-5);
}

.card {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius);
  background: var(--blue-10);
  border-left: 4px solid var(--iris-blue);
}

.card--teal {
  background: var(--teal-10);
  border-left-color: var(--iris-teal);
}

.card h3 {
  margin: 0 0 var(--sp-2);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-dark);
}

.card--teal h3 {
  color: var(--teal-dark);
}

.card p {
  margin: 0;
  font-size: var(--fs-small);
  line-height: 1.6;
}

/* Subspecialty badges. */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: var(--sp-4) 0 0;
  padding: 0;
  list-style: none;
}

.badges li {
  margin: 0;
  padding: 4px 12px;
  border-radius: 3px;
  background: var(--iris-blue);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badges li:nth-child(even) {
  background: var(--iris-teal);
}

/* --------------------------------------------------------------------------
   9. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 12px 28px;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  background: var(--iris-blue);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:hover {
  background: var(--blue-dark);
  color: var(--white);
  text-decoration: none;
}

.btn--teal {
  background: var(--iris-teal);
}

.btn--teal:hover {
  background: var(--teal-dark);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   10. Contact details and form
   -------------------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(var(--sp-5), 4vw, var(--sp-7));
  align-items: start;
}

.contact-details dl {
  margin: 0;
}

.contact-details dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin-top: var(--sp-4);
}

.contact-details dt:first-child {
  margin-top: 0;
}

.contact-details dd {
  margin: 2px 0 0;
  font-size: var(--fs-lead);
}

.contact-details dd em {
  display: block;
  font-style: normal;
  font-size: var(--fs-small);
  color: var(--gray-mid);
}

.form {
  display: grid;
  gap: var(--sp-4);
}

.form__note {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--gray-mid);
}

.form__req {
  color: #B3261E;
  font-weight: 700;
}

.field {
  display: grid;
  gap: var(--sp-1);
}

.field label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-dark);
}

.field input,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--gray-dark);
  background: var(--panel-solid);
  border: 1px solid #C4CDD5;
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.field textarea {
  resize: vertical;
  min-height: 130px;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--iris-blue);
  box-shadow: 0 0 0 3px rgba(0, 115, 207, 0.18);
  outline: none;
}

.field input:user-invalid,
.field textarea:user-invalid {
  border-color: #B3261E;
}

/* Honeypot. Real users never see it; bots that autofill every input do.
   Kept out of the tab order and hidden from assistive tech. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-3);
  align-items: start;
  padding: var(--sp-4);
  border-radius: var(--radius);
  background: var(--teal-10);
  border-left: 4px solid var(--iris-teal);
}

.consent input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--iris-teal);
}

.consent label {
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--gray-dark);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

/* Inline status region for the async submit. */
.form__status {
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  font-size: var(--fs-small);
  font-weight: 600;
}

.form__status:empty {
  display: none;
}

.form__status[data-state='error'] {
  background: #FDECEA;
  border-left: 4px solid #B3261E;
  color: #8C1D18;
}

.form__status[data-state='ok'] {
  background: var(--teal-10);
  border-left: 4px solid var(--iris-teal);
  color: var(--teal-dark);
}

/* --------------------------------------------------------------------------
   11. Gallery strip
   -------------------------------------------------------------------------- */

.gallery {
  display: flex;
  align-items: flex-end;
  border-top: 5px solid var(--rule);
  background: var(--panel);
  overflow: hidden;
}

.gallery img {
  flex: 1 1 0;
  min-width: 0;
  height: clamp(72px, 11vh, 130px);
  object-fit: cover;
  object-position: center 35%;
}

/* Fade the strip in once on first arrival; see site.js. */
.gallery--fade img {
  opacity: 0;
  animation: fade-in 0.9s var(--ease) forwards;
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */

.footer {
  margin-top: auto;
  background: var(--teal-40);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  font-size: var(--fs-small);
  color: var(--teal-dark);
}

.footer p {
  margin: 0;
}

.footer nav {
  display: flex;
  gap: var(--sp-5);
}

.footer a {
  color: var(--blue-dark);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   13. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
  :root {
    --shell: 94vw;
  }

  body {
    background-attachment: scroll;
    background-size: 900px auto;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header {
    flex-direction: column;
    text-align: center;
  }

  .header__contact {
    text-align: center;
  }

  /* Collapse the nav behind a toggle rather than letting four uppercase
     links wrap into an unreadable stack. */
  .nav__toggle {
    display: flex;
  }

  .nav__list {
    display: none;
    flex-direction: column;
    padding-bottom: var(--sp-3);
  }

  .nav[data-open='true'] .nav__list {
    display: flex;
  }

  .nav__list a {
    margin-inline: 0;
    padding: var(--sp-3) var(--sp-5);
    text-align: center;
    border-bottom: 0;
    border-left: 4px solid transparent;
  }

  .nav__list a:hover,
  .nav__list a[aria-current='page'] {
    border-bottom: 0;
    border-left-color: var(--teal-dark);
    background: rgba(255, 255, 255, 0.35);
  }

  .gallery img:nth-child(n + 5) {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   14. Motion and print
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .gallery--fade img {
    opacity: 1;
  }
}

@media print {
  body {
    background: none;
    color: #000;
  }

  .nav,
  .gallery,
  .banner {
    display: none;
  }

  .panel {
    background: none;
    padding: 0;
  }
}
