/* EHA Clinic — calm healthcare UI (from design-system/eha-clinic/MASTER.md) */

:root {
  /* Softened from logo forest green #1B5E20 for calm clinical UI */
  --color-primary: #2f6b3a;
  --color-on-primary: #ffffff;
  --color-secondary: #7a9e7e;
  --color-on-secondary: #14301a;
  --color-accent: #3d8b4f;
  --color-on-accent: #ffffff;
  --color-background: #f5f8f4;
  --color-foreground: #1a2e1d;
  --color-card: #ffffff;
  --color-card-foreground: #1a2e1d;
  --color-muted: #e7efe6;
  --color-muted-foreground: #4b5d4f;
  --color-border: #c9dbc9;
  --color-ring: #2f6b3a;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --radius: 16px;
  --shadow-soft: 6px 6px 16px rgba(22, 78, 99, 0.08), -4px -4px 12px rgba(255, 255, 255, 0.9);
  --shadow-press: inset 3px 3px 8px rgba(22, 78, 99, 0.08);
  --font-display: "Vazirmatn", "Figtree", system-ui, sans-serif;
  --font-body: "Vazirmatn", "Noto Sans", system-ui, sans-serif;
  --touch: 48px;
  --header-h: 64px;
  --dock-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-foreground);
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(122, 158, 126, 0.22), transparent 55%),
    radial-gradient(900px 400px at -10% 20%, rgba(47, 107, 58, 0.12), transparent 50%),
    var(--color-background);
  line-height: 1.65;
  padding-bottom: calc(var(--dock-h) + var(--space-md));
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-md);
  top: -100px;
  background: var(--color-card);
  padding: var(--space-sm) var(--space-md);
  border-radius: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: var(--space-sm);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(243, 251, 253, 0.92);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  min-height: var(--header-h);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand__name,
.custom-logo-link {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-foreground);
}

.custom-logo {
  max-height: 44px;
  width: auto;
}

.site-nav {
  margin-inline-start: auto;
}

.nav-toggle {
  min-height: var(--touch);
  min-width: var(--touch);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-card);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 10px;
  color: var(--color-foreground);
}

.nav-toggle__bar {
  width: 18px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 -6px 0 currentColor;
}

.nav-toggle__label {
  font-size: 0.7rem;
  font-weight: 600;
}

.site-nav__panel {
  position: absolute;
  inset-inline: var(--space-md);
  top: calc(var(--header-h) + 4px);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: var(--space-md);
}

.site-nav__panel[hidden] {
  display: none;
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-sm);
}

.site-nav__list a {
  display: flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 var(--space-md);
  border-radius: 12px;
  color: var(--color-foreground);
  font-weight: 600;
  background: var(--color-muted);
}

.site-nav__list a:hover {
  background: #dce8db;
}

.header-call {
  display: none;
}

.site-main {
  max-width: 1100px;
  margin: 0 auto;
}

.site-main--pad {
  padding: var(--space-xl) var(--space-md);
}

.hero {
  padding: var(--space-xl) var(--space-md) var(--space-lg);
}

.hero__content {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  padding: var(--space-xl) var(--space-lg);
}

.hero__brand {
  margin: 0 0 var(--space-sm);
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--color-primary);
}

.hero__title {
  margin: 0 0 var(--space-sm);
  font-size: clamp(1.1rem, 3.5vw, 1.45rem);
  font-weight: 600;
  line-height: 1.45;
}

.hero__lead {
  margin: 0 0 var(--space-lg);
  color: var(--color-muted-foreground);
  font-size: 1rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 0 1.15rem;
  border-radius: 14px;
  border: 1px solid transparent;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.btn:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-press);
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.btn--primary:hover {
  background: #255830;
}

.btn--accent {
  background: var(--color-accent);
  color: #fff;
}

.btn--ghost {
  background: var(--color-card);
  color: var(--color-foreground);
  border-color: var(--color-border);
  box-shadow: var(--shadow-soft);
}

.btn--call {
  background: var(--color-accent);
  color: #fff;
}

.btn--small {
  min-height: 40px;
  font-size: 0.9rem;
}

.section {
  padding: var(--space-lg) var(--space-md);
}

.section__head {
  margin-bottom: var(--space-md);
}

.section__title {
  margin: 0 0 var(--space-xs);
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.section__lead {
  margin: 0;
  color: var(--color-muted-foreground);
}

.section__subtitle {
  margin: var(--space-lg) 0 var(--space-md);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
}

.dept-card__hours {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted-foreground);
}

.dept-card--service {
  border-color: #b7cbb7;
}

.doctor-list,
.dept-grid,
.hours-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.doctor-list {
  display: grid;
  gap: var(--space-md);
}

.doctor-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: var(--space-md);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: var(--space-md);
}

.doctor-card__media {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--color-muted);
}

.doctor-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doctor-card__media--placeholder {
  background:
    linear-gradient(145deg, #e6f0e5, #d0e0cf);
}

.doctor-card__name {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.doctor-card__specialty,
.doctor-card__hours {
  margin: 0;
  color: var(--color-muted-foreground);
  font-size: 0.92rem;
}

.doctor-card__hours {
  margin-top: 6px;
  font-weight: 600;
  color: var(--color-foreground);
}

.dept-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.dept-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 132px;
  padding: var(--space-md);
  text-align: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  color: var(--color-foreground);
  transition: transform 150ms ease;
}

.dept-card:hover {
  transform: translateY(-2px);
}

.dept-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #e8f2e7, #d7e8d6);
  overflow: hidden;
}

.dept-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dept-card__glyph {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary);
  opacity: 0.75;
}

.dept-card__name {
  font-weight: 700;
  font-size: 0.98rem;
}

.hours-stack {
  display: grid;
  gap: var(--space-sm);
}

.hours-group {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 0 var(--space-md);
}

.hours-group__summary {
  list-style: none;
  cursor: pointer;
  min-height: var(--touch);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  font-weight: 700;
}

.hours-group__summary::-webkit-details-marker {
  display: none;
}

.hours-group__count {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--color-muted);
  font-size: 0.85rem;
}

.hours-list {
  padding-bottom: var(--space-md);
  display: grid;
  gap: var(--space-sm);
}

.hours-list__item {
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--color-muted);
}

.hours-list__spec {
  display: block;
  color: var(--color-muted-foreground);
  font-weight: 500;
  font-size: 0.9rem;
}

.hours-list__time {
  margin: 6px 0 0;
  font-weight: 600;
}

.contact-panel {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: var(--space-lg);
  display: grid;
  gap: var(--space-md);
}

.contact-row {
  display: grid;
  gap: 4px;
}

.contact-row--phone {
  min-height: var(--touch);
  align-content: center;
  padding: var(--space-md);
  border-radius: 14px;
  background: linear-gradient(135deg, #eef6ee, #e3ebe2);
  color: var(--color-foreground);
}

.contact-row__label {
  font-size: 0.85rem;
  color: var(--color-muted-foreground);
  font-weight: 600;
}

.contact-row__value {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.empty-hint {
  margin: 0;
  padding: var(--space-md);
  border-radius: 12px;
  background: var(--color-muted);
  color: var(--color-muted-foreground);
}

.site-footer {
  margin-top: var(--space-xl);
  padding: var(--space-xl) var(--space-md) var(--space-2xl);
  text-align: center;
  color: var(--color-muted-foreground);
}

.site-footer__brand {
  margin: 0 0 var(--space-xs);
  font-weight: 700;
  color: var(--color-foreground);
}

.site-footer__note {
  margin: var(--space-sm) 0 0;
  font-size: 0.9rem;
}

.mobile-dock {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.mobile-dock__btn {
  min-height: 56px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 12px;
  color: var(--color-foreground);
  background: var(--color-muted);
  padding: 4px;
}

.mobile-dock__btn--call {
  background: var(--color-accent);
  color: #fff;
}

.mobile-dock__btn--book {
  background: var(--color-primary);
  color: #fff;
}

.mobile-dock__btn--soon {
  opacity: 0.55;
  cursor: not-allowed;
}

.content-card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow-soft);
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }

  .mobile-dock {
    display: none;
  }

  .header-call {
    display: inline-flex;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav__panel,
  .site-nav__panel[hidden] {
    display: block;
    position: static;
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
  }

  .site-nav__list {
    display: flex;
    gap: var(--space-sm);
  }

  .site-nav__list a {
    background: transparent;
    min-height: 40px;
  }

  .doctor-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dept-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero {
    padding-top: var(--space-2xl);
  }
}

@media (min-width: 1024px) {
  .doctor-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
