/* =====================================================================
   Treatments & Services pages — AKG Hospital
   Loaded only on /treatments, /treatments/*, /services and service pages.
   Uses the design tokens defined in styles.css (:root).
   ===================================================================== */

/* ---------- Listing toolbar ---------- */
.tx-toolbar {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 20px;
}
@media (min-width: 768px) {
  .tx-toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
}
.tx-search {
  position: relative; display: flex; align-items: center;
  width: 100%; max-width: 520px;
}
.tx-search svg { position: absolute; left: 16px; color: var(--gray-400); pointer-events: none; }
.tx-search__input {
  width: 100%; min-height: 52px; padding: 12px 16px 12px 48px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius);
  background: var(--white); font: inherit; font-size: 1rem; color: var(--gray-800);
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.tx-search__input:focus {
  outline: none; border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(42, 90, 138, .15);
}
.tx-count { font-size: .875rem; color: var(--gray-500); }
.tx-count span { font-weight: 700; color: var(--primary); }

/* department jump chips (scroll horizontally on phones) */
.tx-chips {
  display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto;
  padding-bottom: 8px; margin-bottom: 8px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
@media (min-width: 1024px) { .tx-chips { flex-wrap: wrap; overflow: visible; } }
.tx-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center;
  min-height: 40px; padding: 8px 16px;
  border-radius: 999px; border: 1px solid var(--gray-200);
  background: var(--white); color: var(--primary);
  font-size: .875rem; font-weight: 600; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.tx-chip:hover, .tx-chip:focus-visible { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ---------- Groups ---------- */
.tx-group { margin-top: 40px; scroll-margin-top: 96px; }
.tx-group[hidden] { display: none; }
.tx-group__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-200);
}
.tx-group__icon { width: 40px; height: 40px; object-fit: contain; }
.tx-group__title { font-size: 1.375rem; font-weight: 800; color: var(--primary); line-height: 1.3; margin: 0; }
.tx-group__link { margin-left: auto; font-size: .875rem; font-weight: 600; color: var(--accent); }
.tx-group__link:hover { color: var(--accent-hover); }

/* ---------- Cards ---------- */
.tx-card { display: flex; flex-direction: column; }
.tx-card[hidden] { display: none; }
.tx-card h3 { font-size: 1.0625rem; font-weight: 700; color: var(--primary); line-height: 1.35; }
.tx-card h3 a { color: inherit; }
.tx-card h3 a:hover { color: var(--accent); }
.tx-card p { margin-top: 8px; font-size: .9rem; color: var(--gray-600); line-height: 1.6; flex: 1; }
.tx-card__more { display: inline-block; margin-top: 16px; font-size: .875rem; font-weight: 700; color: var(--accent); }
.tx-card__more:hover { color: var(--accent-hover); }
.tx-badge {
  align-self: flex-start; display: inline-block; margin-bottom: 12px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  background: var(--surface-band-soft); color: var(--primary);
}
.tx-badge--surgery { background: rgba(212, 32, 39, .08); color: var(--accent-hover); }
.tx-badge--diagnostic { background: #E8F4EF; color: #17633F; }
.tx-timing { font-size: .8125rem !important; font-weight: 600; color: var(--primary) !important; flex: 0 !important; }
.tx-empty { margin-top: 32px; text-align: center; color: var(--gray-600); }
.tx-empty a { color: var(--accent); font-weight: 600; }

/* ---------- Detail layout ---------- */
.tx-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 1024px) {
  .tx-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; }
}
.tx-article { max-width: 100%; min-width: 0; }
.tx-article p, .tx-article li { max-width: 72ch; }
.tx-section { scroll-margin-top: 96px; }
.tx-section + .tx-section { margin-top: 8px; padding-top: 8px; }
.tx-article h2 { font-size: 1.375rem; }
@media (min-width: 768px) { .tx-article h2 { font-size: 1.5rem; } }
.tx-article h3 { font-size: 1.0625rem; }
.tx-aka { font-size: .875rem !important; color: var(--gray-500) !important; }
.tx-figure { margin: 0 0 28px; border-radius: var(--radius-card); overflow: hidden; }
.tx-figure img { width: 100%; height: auto; display: block; }

/* check lists */
.prose ul.tx-check, ul.tx-check { list-style: none; padding-left: 0; }
.prose ul.tx-check li, ul.tx-check li {
  list-style: none; position: relative; padding-left: 30px;
}
ul.tx-check li::before {
  content: ''; position: absolute; left: 0; top: .32em;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface-band-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A3C5E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 11px no-repeat;
}
ul.tx-check--accent li::before {
  background-color: rgba(212, 32, 39, .08);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D42027' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
}
ul.tx-check--compact li { font-size: .875rem; margin-bottom: 6px; color: var(--gray-700); line-height: 1.5; }

/* numbered steps */
.prose ol.treatment-steps { list-style: none; padding-left: 0; counter-reset: txstep; }
.prose ol.treatment-steps li {
  list-style: none; counter-increment: txstep; position: relative;
  padding: 14px 16px 14px 60px; margin-bottom: 12px;
  background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.prose ol.treatment-steps li::before {
  content: counter(txstep); position: absolute; left: 16px; top: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: var(--white);
  font-weight: 700; font-size: .875rem;
  display: flex; align-items: center; justify-content: center;
}
.prose ol.treatment-steps li strong { display: block; color: var(--primary); margin-bottom: 2px; }

/* FAQ */
.tx-faq { display: grid; gap: 12px; }
.tx-faq__item {
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.tx-faq__item summary {
  cursor: pointer; list-style: none; padding: 16px 48px 16px 18px; position: relative;
  min-height: 48px;
}
.tx-faq__item summary::-webkit-details-marker { display: none; }
.tx-faq__item summary::after {
  content: '+'; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 400; color: var(--accent); line-height: 1;
}
.tx-faq__item[open] summary::after { content: '−'; }
.prose .tx-faq__q, .tx-faq__q { margin: 0; font-size: 1rem; font-weight: 700; color: var(--primary); line-height: 1.45; display: inline; }
.tx-faq__a { padding: 0 18px 4px; }
.tx-faq__item summary:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; border-radius: var(--radius); }

.tx-disclaimer {
  margin-top: 32px !important; padding: 16px 18px;
  background: var(--surface-band-soft); border-radius: var(--radius);
  font-size: .8125rem !important; color: var(--gray-600) !important;
}

/* ---------- Aside ---------- */
.tx-aside { display: grid; gap: 20px; min-width: 0; }
@media (min-width: 1024px) { .tx-aside { position: sticky; top: 96px; } }
.tx-facts, .tx-toc {
  background: var(--white); border-radius: var(--radius-card);
  padding: 24px; box-shadow: 0 2px 12px rgba(0,0,0,.06); border: 1px solid var(--gray-100);
}
.tx-facts__title, .tx-toc__title {
  font-size: 1rem; font-weight: 800; color: var(--primary); margin-bottom: 14px;
}
.tx-facts dl { margin: 0 0 18px; display: grid; gap: 10px; }
.tx-facts dl > div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--gray-200); }
.tx-facts dt { font-size: .8125rem; color: var(--gray-500); flex-shrink: 0; }
.tx-facts dd { margin: 0; font-size: .875rem; font-weight: 600; color: var(--gray-800); text-align: right; }
.tx-facts dd a { color: var(--accent); }
.tx-facts dd small { display: block; font-weight: 400; color: var(--gray-500); }
.tx-facts .btn { width: 100%; justify-content: center; margin-top: 10px; min-height: 48px; }
.tx-facts__note { margin-top: 14px; font-size: .8125rem; color: var(--gray-600); }
.tx-facts__note a { color: var(--accent); font-weight: 600; }
.tx-toc ol, .tx-toc ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.tx-toc li a {
  display: block; padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: .875rem; color: var(--gray-700); font-weight: 500;
}
.tx-toc li a:hover { background: var(--gray-50); color: var(--accent); }
/* hide the in-page TOC on phones (content already follows) */
@media (max-width: 1023px) { .tx-toc[aria-label="On this page"] { display: none; } }

.tx-all { margin-top: 32px; text-align: center; }

/* home page treatments strip: department label instead of a number */
.home-treatments .dept-card__num { text-transform: uppercase; letter-spacing: .04em; font-size: .75rem; }
