/*==============================================================================
  theme/02-specializations.css
  SPECIALIZATIONS — Home cards + detail/procedure layouts
  Linked from templates/base.html in numbered order with the other theme modules.
==============================================================================*/

/* --------------------------------------------------------------------------
   SPECIALIZATIONS — Home page four-card specialization grid
   -------------------------------------------------------------------------- */
.specializations_section {
  background: var(--bg);
}

.specializations_header {
  text-align: left;
  margin-bottom: 28px;
  max-width: 640px;
}

.specializations_header h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #0a2540;
  margin: 0;
}

.specializations_grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.spec-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  padding: 12px;
}

/* Inset frame border — sides/top solid, fades out toward the bottom */
.spec-card::after {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  z-index: 2;
  border: none;
  background:
    linear-gradient(to bottom, rgba(10, 37, 64, 0.28), rgba(10, 37, 64, 0.12) 35%, rgba(10, 37, 64, 0) 70%) left / 1px 100% no-repeat,
    linear-gradient(to bottom, rgba(10, 37, 64, 0.28), rgba(10, 37, 64, 0.12) 35%, rgba(10, 37, 64, 0) 70%) right / 1px 100% no-repeat,
    linear-gradient(to right, rgba(10, 37, 64, 0.28), rgba(10, 37, 64, 0.28)) top / 100% 1px no-repeat;
}

.spec-card__media {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.spec-card__media img {
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  border-radius: 0;
}

.spec-card__body {
  padding: 12px 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
}

.spec-card__body h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #0a2540;
  margin: 0 0 8px;
  line-height: 1.35;
}

.spec-card__body p {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.55;
  color: var(--body);
  margin: 0 0 14px;
}

.spec-card__body a {
  margin-top: auto;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.spec-card__body a:hover {
  color: var(--primary-hover);
}

@media (max-width: 991px) {
  .specializations_grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .spec-card__body {
    padding-top: 10px;
  }
}

@media (max-width: 575px) {
  .specializations_header {
    margin-bottom: 18px;
  }

  .specializations_header h2 {
    font-size: 26px;
  }

  .specializations_grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .spec-card__media {
    aspect-ratio: unset;
    height: 180px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }

  .spec-card__media img {
    width: auto;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
  }

  .spec-card__body {
    padding-top: 8px;
  }

  .spec-card__body h3 {
    margin-bottom: 6px;
  }

  .spec-card__body p {
    margin-bottom: 10px;
  }
}

/* --------------------------------------------------------------------------
   SPECIALIZATION / PROCEDURE DETAIL — Chip bars, content grids, CTAs
   -------------------------------------------------------------------------- */
.spec-detail {
  background: var(--bg);
}

.spec-detail__bar-wrap {
  background: var(--bg);
  padding: 16px 0;
  overflow: visible;
  position: relative;
}

.spec-detail__bar-wrap::before,
.spec-detail__bar-wrap::after {
  display: none;
}

.spec-detail__bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
  z-index: 1;
}

.spec-detail__bar::-webkit-scrollbar {
  display: none;
}

.spec-detail__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: max-content;
  background: var(--primary);
  color: #fff !important;
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 0;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.55);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
  text-align: center;
  opacity: 1;
  transform: none;
  box-shadow: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.spec-detail__chip:hover {
  color: #fff !important;
  background: var(--primary-hover);
  filter: none;
  transform: none;
  box-shadow: none;
}

.spec-detail__chip:last-child {
  border-right: none;
}

.spec-detail__chip--head {
  font-weight: 600;
  flex: 0 0 auto;
}

.spec-detail__chip:active,
.spec-detail__chip.is-active {
  background: #0a2540;
  color: #fff !important;
  box-shadow: none;
  filter: none;
  transform: none;
}

.spec-detail__chip:focus {
  outline: none;
  box-shadow: none;
}

.spec-detail__chip:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.spec-detail__content {
  padding-top: 16px;
  padding-bottom: 64px;
}

.spec-detail__content h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #0a2540;
  margin: 0 0 10px;
}

.spec-detail__summary {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 32px;
  max-width: none;
  text-align: justify;
}

.spec-detail__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.spec-detail__item {
  border: 1px solid #e6ebf1;
  border-radius: 0;
  padding: 22px 20px;
  background: var(--bg);
  text-decoration: none;
  display: block;
  transition: border-color 120ms ease;
}

.spec-detail__item:hover {
  border-color: #c7d0db;
}

.spec-detail__item h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: #0a2540;
  margin: 0 0 8px;
}

.spec-detail__item p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 12px;
  text-align: justify;
}

.spec-detail__item-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
}

.spec-detail__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.procedure-detail__content {
  padding-top: 16px;
  padding-bottom: 64px;
}

.procedure-detail__content--art {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  isolation: isolate;
}

.procedure-detail__art {
  grid-area: 1 / 1;
  position: sticky;
  top: 110px;
  align-self: start;
  justify-self: end;
  width: min(46%, 460px);
  max-width: 460px;
  margin: 12px -1% 0 0;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  transition: width 420ms ease, max-width 420ms ease, transform 420ms ease;
}

.procedure-detail__art img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.26;
  mix-blend-mode: multiply;
  -webkit-user-drag: none;
  transform: scale(1);
  transform-origin: right center;
  transition: transform 420ms ease, opacity 420ms ease;
}

/* Grow a little as the art meets the footer */
.procedure-detail__art.is-near-footer {
  width: min(54%, 560px);
  max-width: 560px;
}

.procedure-detail__art.is-near-footer img {
  opacity: 0.3;
  transform: scale(1.08);
}

.procedure-detail__main {
  grid-area: 1 / 1;
  position: relative;
  z-index: 1;
}

.procedure-detail__content h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #0a2540;
  margin: 0 0 10px;
  padding: 0;
  text-align: left;
  text-indent: 0;
}

.procedure-detail__intro {
  margin: 0 0 24px !important;
  max-width: none;
  padding: 0 !important;
  text-align: justify;
  text-justify: inter-word;
  text-indent: 0 !important;
}

.procedure-detail__content h1,
.procedure-detail__intro {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

.procedure-detail__grid {
  columns: 2;
  column-gap: 36px;
  margin-bottom: 28px;
}

.procedure-detail__section {
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  max-width: none;
  padding: 0;
  break-inside: avoid;
  page-break-inside: avoid;
  vertical-align: top;
  box-sizing: border-box;
}

.procedure-detail__section h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: #0a2540;
  margin: 0 0 8px !important;
  padding: 0 !important;
  text-align: left;
  text-indent: 0 !important;
  letter-spacing: -0.02em;
}

.procedure-detail__section p {
  margin: 0 0 8px !important;
  padding: 0 !important;
  text-align: justify;
  text-justify: inter-word;
  text-indent: 0 !important;
}

.procedure-detail__section h2,
.procedure-detail__section p {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  max-width: 100%;
  box-sizing: border-box;
}

.procedure-detail__section ul {
  margin: 0 0 8px !important;
  margin-left: 0 !important;
  padding: 0 0 0 1.1em !important;
  list-style: disc outside;
}

.procedure-detail__section li {
  margin: 0 0 6px !important;
  padding: 0 !important;
  text-align: justify;
  text-justify: inter-word;
  text-indent: 0 !important;
}

.procedure-detail__section > :last-child {
  margin-bottom: 0 !important;
}

@media (max-width: 991px) {
  .procedure-detail__grid {
    columns: 1;
  }

  .procedure-detail__section {
    margin-bottom: 18px;
  }

  .spec-detail__chip {
    flex: 0 0 auto;
  }

  .procedure-detail__art {
    top: 96px;
    width: min(58%, 340px);
    max-width: 340px;
  }

  .procedure-detail__art img {
    opacity: 0.22;
  }

  .procedure-detail__art.is-near-footer {
    width: min(66%, 400px);
    max-width: 400px;
  }
}

@media (max-width: 575px) {
  .procedure-detail__art {
    top: auto;
    bottom: 0;
    width: min(78%, 260px);
    max-width: 260px;
    justify-self: center;
    margin: 0;
  }

  .procedure-detail__art img {
    opacity: 0.18;
    transform-origin: center bottom;
  }

  .procedure-detail__art.is-near-footer {
    width: min(88%, 300px);
    max-width: 300px;
  }

  .procedure-detail__art.is-near-footer img {
    transform: scale(1.1);
  }
}

@media (max-width: 767px) {
  .spec-detail__list {
    grid-template-columns: 1fr;
  }

  .spec-detail__content h1,
  .procedure-detail__content h1 {
    font-size: 26px;
  }

  .spec-detail__chip {
    font-size: 12px;
    padding: 7px 14px;
  }
}

