/*
 * MedEx Care Platform – Modern UI layer (v3.3)
 *
 * HOW TO EDIT (people and AI assistants such as GoDaddy Airo):
 *  - This file only changes appearance. It loads AFTER main.css and does not touch
 *    any PHP, menus, pages, Customizer settings or the Image Manager.
 *  - Change brand colours, button shape and radii in the variables just below.
 *  - Buttons: .button, .button-outline, .button-small, .text-link, plus WordPress
 *    block buttons (.wp-block-button__link) so buttons added in the editor match.
 *  - Delete this file's <link> (see medex_assets() in functions.php) to return to v3.2 look.
 */

:root,
.editor-styles-wrapper {
  --mx-brand: #452b52;
  --mx-brand-dark: #34203e;
  --mx-brand-light: #60436d;
  --mx-accent: #a692ad;
  --mx-ink: #1d1d1f;
  --mx-radius-btn: 999px;   /* 999px = pill buttons; use 12px for softly squared */
  --mx-radius-card: 16px;
  --mx-ease: cubic-bezier(.2, .7, .2, 1);
  --mx-shadow-btn: 0 1px 2px rgba(52, 32, 62, .18), 0 6px 16px -6px rgba(69, 43, 82, .45);
  --mx-shadow-btn-hover: 0 2px 4px rgba(52, 32, 62, .2), 0 12px 24px -8px rgba(69, 43, 82, .55);
}

/* ---------- Primary buttons ---------- */
.button,
.wp-block-button__link,
.wp-element-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 14px 18px 14px 28px;
  border: 1px solid transparent;
  border-radius: var(--mx-radius-btn);
  background: linear-gradient(135deg, var(--mx-brand-light) 0%, var(--mx-brand) 55%, var(--mx-brand-dark) 100%);
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .005em;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: var(--mx-shadow-btn);
  cursor: pointer;
  transition: transform .25s var(--mx-ease), box-shadow .25s var(--mx-ease), background-position .25s var(--mx-ease), color .2s, border-color .2s;
}
.wp-block-button__link,
.wp-element-button { padding: 14px 28px; }

.button:hover,
.wp-block-button__link:hover,
.wp-element-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--mx-shadow-btn-hover);
  background: linear-gradient(135deg, var(--mx-brand-light) 0%, var(--mx-brand-light) 40%, var(--mx-brand) 100%);
  color: #fff;
}
.button:active,
.wp-block-button__link:active,
.wp-element-button:active {
  transform: translateY(0) scale(.98);
  box-shadow: 0 1px 2px rgba(52, 32, 62, .25);
}
.button:focus-visible,
.wp-block-button__link:focus-visible,
.wp-element-button:focus-visible {
  outline: 3px solid var(--mx-accent);
  outline-offset: 3px;
}

/* The ↗ arrow inside buttons becomes a small circular chip */
.button > span[aria-hidden="true"] {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  font-size: .95rem;
  line-height: 1;
  transition: transform .25s var(--mx-ease), background .25s;
}
.button:hover > span[aria-hidden="true"] {
  background: rgba(255, 255, 255, .3);
  transform: translate(2px, -2px);
}

/* ---------- Outline / secondary buttons ---------- */
.button-outline,
.wp-block-button.is-style-outline > .wp-block-button__link {
  background: #fff;
  color: var(--mx-brand);
  border-color: rgba(69, 43, 82, .28);
  box-shadow: none;
}
.button-outline > span[aria-hidden="true"] { background: rgba(69, 43, 82, .08); }
.button-outline:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
  background: var(--mx-brand);
  color: #fff;
  border-color: var(--mx-brand);
  box-shadow: var(--mx-shadow-btn-hover);
}
.button-outline:hover > span[aria-hidden="true"] { background: rgba(255, 255, 255, .22); }

/* ---------- Small header button ---------- */
.button-small {
  min-height: 44px;
  padding: 9px 12px 9px 22px;
  font-size: .9rem;
  gap: 10px;
}
.button-small > span[aria-hidden="true"] { width: 24px; height: 24px; font-size: .85rem; }

/* Remove the legacy 20px top margin where buttons sit in flex rows / the header */
.site-nav .button,
.hero-actions .button,
.result-actions .button { margin-top: 0; }

/* ---------- Text links ("Explore Services ↗") ---------- */
.text-link {
  position: relative;
  display: inline-block;
  padding-bottom: 3px;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 2px no-repeat;
  transition: background-size .3s var(--mx-ease), color .2s;
}
.text-link:hover,
.text-link:focus-visible { background-size: 100% 2px; color: var(--mx-brand); }

/* ---------- Circular arrow on service cards ---------- */
.card-arrow {
  transition: transform .3s var(--mx-ease), background .25s, color .25s;
}
.service-card:hover .card-arrow,
.service-card:focus-visible .card-arrow {
  background: var(--mx-brand);
  color: #fff;
  transform: translate(2px, -2px);
}

/* ---------- Back-to-top button ---------- */
.medex-back-to-top {
  background: linear-gradient(135deg, var(--mx-brand-light), var(--mx-brand-dark));
  border-color: rgba(255, 255, 255, .25);
  box-shadow: var(--mx-shadow-btn);
}

/* ---------- Mobile menu toggle ---------- */
.nav-toggle {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid rgba(69, 43, 82, .25);
  border-radius: var(--mx-radius-btn);
  font-weight: 600;
  transition: background .2s, color .2s, border-color .2s;
}
.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] { background: var(--mx-brand); color: #fff; border-color: var(--mx-brand); }

/* ---------- Navigation links: soft pill hover ---------- */
.menu a {
  padding: 9px 14px;
  border-radius: var(--mx-radius-btn);
  transition: background .2s, color .2s;
}
.menu a:hover,
.menu a:focus-visible { background: rgba(69, 43, 82, .07); color: var(--mx-brand); }
.menu .sub-menu { border-radius: 14px; border: 1px solid #ece9ee; }

/* ---------- Header: frosted glass when scrolling ---------- */
.site-header {
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
}

/* ---------- Cards & photos: softer, consistent corners ---------- */
.service-card,
.nav-choice-grid a,
.path-grid article,
.locations-grid a,
.subservice-grid a,
.navigator-result {
  border-radius: var(--mx-radius-card);
}
.service-card { overflow: hidden; }
.final-image,
.hero-visual { border-radius: var(--mx-radius-card); overflow: hidden; }
.service-card:hover { box-shadow: 0 18px 40px -16px rgba(69, 43, 82, .28); }
.navigator-result select {
  border-radius: 12px;
  padding: 13px 16px;
}

/* Photos always fill their frame cleanly, whatever image is uploaded later */
.service-image img,
.final-image img,
.hero-visual img { object-fit: cover; object-position: center; }

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .button,
  .button > span,
  .text-link,
  .card-arrow { transition: none !important; }
  .button:hover,
  .button:active { transform: none; }
}

/* ---------- Small screens: comfortable full-width tap targets ---------- */
@media (max-width: 680px) {
  .hero-actions .button,
  .result-actions .button { width: 100%; justify-content: space-between; }
  .site-nav .nav-book { width: 100%; justify-content: space-between; }
}
