/* =========================================================================
   APEX FRONTIER GROUP · SITE STRUCTURE
   -------------------------------------------------------------------------
   Cross-page foundations that every page on apexanesthesiatx.com depends on:
   resets, layout container, section primitives, buttons, site header,
   site footer, modal, and toast.

   Page-specific styles live in homepage.css / about.css / etc.
   Assumes colors_and_type.css is loaded FIRST.
   ========================================================================= */

/* ---- Reset --------------------------------------------------------- */
* { box-sizing: border-box; }
body { margin: 0; }

/* ---- Page surface (subtle top vignette) --------------------------- */
body {
  background:
    radial-gradient(ellipse 90% 600px at 50% -100px, rgba(0,152,193,0.06), transparent 60%),
    var(--paper-2);
}

/* ---- Container ---------------------------------------------------- */
.apex-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Section primitives ------------------------------------------ */
.apex-section { padding: var(--space-12) 0; }
.apex-section__head {
  text-align: center;
  margin: 0 auto var(--space-9);
  max-width: 720px;
}

.apex-eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--sky-700);
  margin-bottom: var(--space-3);
}
.apex-eyebrow--dark { color: var(--sky-400); }

.apex-h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  color: var(--ink-900);
  margin: 0 0 var(--space-5);
  text-wrap: balance;
}
.apex-h2 em { color: var(--sky-500); font-style: italic; }
.apex-h2--ondark { color: #fff; }
.apex-h2--ondark em { color: var(--sky-400); }
.apex-h2--centered { text-align: center; }

.apex-body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-loose);
  color: var(--ink-700);
  margin: 0 0 var(--space-5);
  max-width: 60ch;
}
.apex-body--ondark { color: rgba(255,255,255,0.8); }

/* ---- Icon base --------------------------------------------------- */
.apex-icon {
  fill: var(--navy-800);
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.apex-btn .apex-icon { fill: currentColor; }

/* =========================================================================
   BUTTONS
   ========================================================================= */
.apex-btn {
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-button);
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--dur-base) var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
  /* Default sizing — applied unless a size modifier overrides */
  font-size: 12px;
  padding: 14px 24px;
}
.apex-btn--sm { font-size: 11px; padding: 11px 18px; }
.apex-btn--md { font-size: 12px; padding: 14px 24px; }
.apex-btn--lg { font-size: 13px; padding: 18px 30px; }
.apex-btn:active { transform: scale(0.98); }
a.apex-btn { text-decoration: none; border: none; }

/* Primary — sky gradient, WHITE text always */
.apex-btn--primary {
  background: linear-gradient(180deg, #0098C1 0%, #006B89 100%);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.35) inset,
    0 -1px 0 rgba(0,77,99,0.30) inset,
    var(--shadow-2);
}
.apex-btn--primary:hover {
  background: linear-gradient(180deg, #4DB6D3 0%, #0098C1 100%);
  color: #fff;
}
.apex-btn--primary:active {
  background: linear-gradient(180deg, #006B89 0%, #004D63 100%);
  color: #fff;
}

/* Dark — navy gradient, white text */
.apex-btn--dark {
  background: linear-gradient(180deg, #133A6B 0%, #061D3D 100%);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.10) inset,
    var(--shadow-2);
}
.apex-btn--dark:hover {
  background: linear-gradient(180deg, #1E4E8C 0%, #133A6B 100%);
  color: #fff;
}
.apex-btn--dark:active { color: #fff; }

/* Outline — navy text on light, navy fill + white text on hover */
.apex-btn--outline {
  background: transparent;
  color: var(--navy-900);
  box-shadow: inset 0 0 0 1.5px var(--navy-900);
}
.apex-btn--outline:hover {
  background: var(--navy-900);
  color: #fff;
}

/* Outline-white — for dark backgrounds. Text stays white. */
.apex-btn--outline-white {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.7);
}
.apex-btn--outline-white:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* =========================================================================
   SITE HEADER (used across all pages)
   The Joomla theme will render this; styles included so previews work
   and so the design stays consistent if pasted into a custom module.
   ========================================================================= */
.apex-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(229,234,240,0.7);
  box-shadow: 0 1px 0 rgba(10,37,71,0.02), 0 4px 16px -8px rgba(10,37,71,0.08);
}
.apex-site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.apex-site-header__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  border: none;
}
.apex-site-header__logo img {
  height: 44px;
  width: auto;
  display: block;
}
.apex-site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.apex-site-nav a {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  color: var(--ink-900);
  text-decoration: none;
  border: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.apex-site-nav a:not(.apex-btn):hover { color: var(--sky-700); }
.apex-site-header__menu {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 4px;
}
.apex-site-header__menu span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy-900);
  border-radius: 1px;
}

/* =========================================================================
   SITE FOOTER (used across all pages — Joomla module)
   ========================================================================= */
.apex-footer {
  position: relative;
  color: rgba(255,255,255,0.85);
  padding: var(--space-12) 0 0;
  background:
    radial-gradient(40% 50% at 50% 0%, rgba(0,152,193,0.10) 0%, transparent 60%),
    linear-gradient(180deg, #04122A 0%, #020A18 100%);
}
.apex-footer::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(0,152,193,0.40) 50%, transparent 100%);
}
.apex-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-10);
}
.apex-footer__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  border: none;
  margin-bottom: var(--space-5);
}
.apex-footer__mark {
  height: 58px;
  width: auto;
  max-width: 100%;
  display: block;
}
.apex-footer__blurb {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,0.85);
  margin: 0 0 var(--space-5);
  max-width: 380px;
}
.apex-footer__actions {
  display: flex;
  gap: 10px;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.apex-footer__social {
  display: flex;
  gap: 10px;
}
.apex-footer__social a {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: rgba(255,255,255,0.06);
  border: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 0 0 1px rgba(255,255,255,0.08);
  transition: all var(--dur-base) var(--ease-out);
}
.apex-footer__social a:hover {
  background: var(--sky-500);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    0 0 0 1px rgba(0,152,193,0.40),
    0 8px 20px -4px rgba(0,152,193,0.40);
}
.apex-footer__heading {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sky-400);
  margin-bottom: var(--space-4);
}
.apex-footer__addr {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255,255,255,0.88);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}
.apex-footer__addr div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.apex-footer__addr svg { color: var(--sky-400); }
.apex-footer .apex-icon { fill: var(--sky-400); }

.apex-footer__table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 13px;
}
.apex-footer__table th,
.apex-footer__table td {
  text-align: left;
  padding: 4px 0;
  font-weight: 400;
  color: rgba(255,255,255,0.88);
}
.apex-footer__table th {
  color: rgba(255,255,255,0.65);
  width: 100px;
}

/* Bottom legal bar */
.apex-footer__legal {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: var(--space-10);
  padding: var(--space-5) 0;
}
.apex-footer__legal-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-5);
  font-family: var(--font-body);
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  flex-wrap: wrap;
}
.apex-footer__legal a {
  color: rgba(255,255,255,0.85);
  border: none;
  text-decoration: none;
}
.apex-footer__legal a:hover { color: #fff; }
.apex-footer__credit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.apex-footer__credit-link {
  display: inline-flex;
  align-items: center;
  border: none;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity var(--dur-base) var(--ease-out);
}
.apex-footer__credit-link:hover { opacity: 1; }
.apex-footer__credit-mark {
  height: 16px;
  width: 90px;
  display: block;
  object-fit: contain;
}

/* =========================================================================
   MODAL (booking form scrim)
   ========================================================================= */
.apex-modal-scrim {
  position: fixed; inset: 0;
  background: rgba(6,29,61,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: apex-fade var(--dur-base) var(--ease-out);
}
@keyframes apex-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.apex-modal {
  background: #fff;
  border-radius: var(--r-lg);
  max-width: 520px;
  width: 100%;
  padding: var(--space-9) var(--space-8) var(--space-8);
  box-shadow: var(--shadow-3);
  position: relative;
}
.apex-modal__close {
  position: absolute; top: 18px; right: 18px;
  background: none; border: none; cursor: pointer;
  color: var(--ink-500);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  transition: background var(--dur-fast);
}
.apex-modal__close:hover { background: var(--paper-3); }
.apex-modal label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
  display: block;
  margin-bottom: 6px;
}
.apex-modal input,
.apex-modal select,
.apex-modal textarea {
  font-family: var(--font-body);
  font-size: 14px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  color: var(--ink-900);
  box-sizing: border-box;
  transition: border-color var(--dur-fast);
}
.apex-modal input:focus,
.apex-modal select:focus,
.apex-modal textarea:focus {
  outline: none;
  border-color: var(--sky-500);
  box-shadow: 0 0 0 3px rgba(109,181,206,0.18);
}
.apex-modal__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.apex-modal__field { margin-bottom: var(--space-4); }
.apex-modal__actions { margin-top: var(--space-5); display: flex; justify-content: flex-end; gap: 10px; }
.apex-modal__success { text-align: center; padding: var(--space-7) 0; }
.apex-modal__success-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--sky-200);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-5);
}

/* =========================================================================
   TOAST
   ========================================================================= */
.apex-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy-900); color: #fff;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 13px;
  z-index: 200;
  box-shadow: var(--shadow-3);
  animation: apex-toast-in 320ms var(--ease-out);
  display: flex; align-items: center; gap: 10px;
}
.apex-toast svg { color: var(--sky-400); }
@keyframes apex-toast-in {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}

/* =========================================================================
   RESPONSIVE — global elements only
   ========================================================================= */
@media (max-width: 900px) {
  .apex-site-nav { display: none; }
  .apex-site-header__menu { display: flex; }
  .apex-nav-open .apex-site-nav {
    display: flex; flex-direction: column;
    position: absolute; top: 84px; right: 0; left: 0;
    background: #fff; padding: 24px;
    box-shadow: var(--shadow-2);
    align-items: stretch;
    gap: 18px;
  }

  /* Footer collapses, centers, and the brand logo gets larger again on mobile */
  .apex-footer__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .apex-footer__brand,
  .apex-footer__contact,
  .apex-footer__hours {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .apex-footer__logo { justify-content: center; }
  .apex-footer__mark { height: 64px; }
  .apex-footer__blurb { max-width: 460px; }
  .apex-footer__actions { justify-content: center; }
  .apex-footer__social { justify-content: center; }
  .apex-footer__addr { text-align: left; }
  .apex-footer__table { max-width: 240px; }

  .apex-footer__legal-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-3);
  }
  .apex-footer__credit { justify-content: center; flex-wrap: wrap; }
}

@media (max-width: 540px) {
  .apex-footer__mark { height: 56px; }
  .apex-footer__actions .apex-btn { flex: 1 1 auto; justify-content: center; }
}
