/* treatments-archive.css — CPT `treatment` archive (Figma "/zabiegi/Grid-L").
   Hero + per-specialization accordion of treatment cards. */

.treatments__container {
  display: flex;
  flex-direction: column;
}

/* ---------- Hero ---------- */
.treatments__hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-5xl);
  padding-top: var(--space-m);
}

.treatments__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
  max-width: 800px;
  /* position + text alignment come from the .u-align-* utility (ACF "align" field) */
}

.treatments__title { margin: 0; }
.treatments__title em,
.treatments__title i { font-style: italic; }

.treatments__intro {
  font-size: var(--fs-body-m);
  line-height: var(--lh-body-m);
  color: var(--color-grey-900);
}

.treatments__banner {
  width: 100%;
  aspect-ratio: 3 / 1;
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--color-grey-200);
}
.treatments__banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Category list ---------- */
.treatments__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
  padding-block: var(--space-3xl) var(--space-5xl);
}

.treatments__empty {
  padding-block: var(--space-3xl) var(--space-5xl);
  color: var(--color-grey-600);
}

.tcat {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.tcat__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.tcat__title {
  margin: 0;
  max-width: 688px;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 28px;
  line-height: 40px;
  letter-spacing: -1px;
  color: var(--color-grey-900);
}
.tcat__title-link {
  color: inherit;
  text-decoration: none;
}
.tcat__title-link:hover { text-decoration: underline; }

.tcat__desc {
  font-size: var(--fs-body-m);
  line-height: var(--lh-body-m);
  color: var(--color-grey-900);
}
/* WYSIWYG content (teaser / description): space stacked blocks; links underlined. */
.tcat__desc > * + *, .treatments__intro > * + * { margin-top: var(--space-2x); }

/* Category page: sub-category titles are larger (heading-L), description constrained. */
.treatments--category .tcat__title {
  max-width: none;
  font-size: var(--fs-h-l);
  line-height: var(--lh-h-l);
  letter-spacing: var(--ls-h-l);
}
.treatments--category .tcat__desc { max-width: 688px; }
.treatments--category .tcat { gap: var(--space-l); }

/* ---------- Accordion ---------- */
.tcat__acc {
  display: flex;
  flex-direction: column;
  gap: var(--space-2x);
  /* Divider lives on the accordion container (not the collapsing panel) so the
   * open/close animation has no border stub to jump away at the end. */
  border-bottom: 1px solid var(--color-grey-200);
}

.tcat__toggle {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  width: 100%;
  padding: var(--space-s) 0;
  background: none;
  border: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body-m);
  line-height: var(--lh-body-m);
  font-weight: 500;
  color: var(--color-grey-900);
  text-align: left;
  cursor: pointer;
}
.tcat__toggle-label { flex: 1 1 auto; min-width: 0; }
.tcat__toggle-icon {
  flex: 0 0 auto;
  display: inline-flex;
  width: 24px;
  height: 24px;
}
.tcat__toggle-icon svg {
  transition: transform .2s ease;
}
/* chevron ">" → rotate to "∨" when the panel is open */
.tcat__toggle[aria-expanded="true"] .tcat__toggle-icon svg {
  transform: rotate(90deg);
}
.tcat__toggle:focus-visible {
  outline: 2px solid var(--color-grey-900);
  outline-offset: 2px;
}
.tcat__panel {
  padding-bottom: var(--space-m);
}
.tcat__panel[hidden] { display: none; }

.tcat__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-l);
  align-items: stretch;
}

/* ---------- Listing card ---------- */
.listing-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
  height: 100%;
  padding: var(--space-s);
  border: 1px solid var(--color-grey-200);
  border-radius: var(--radius-s);
  background: var(--color-white);
  color: var(--color-grey-900);
  text-decoration: none;
  transition: border-color .2s ease;
}
.listing-card:hover { border-color: var(--color-grey-400); }
.listing-card:focus-visible {
  outline: 2px solid var(--color-grey-900);
  outline-offset: 2px;
}

.listing-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--color-grey-200);
}
.listing-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-card__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2x);
  width: 100%;
  /* Sits right under the image (no bottom-pinning), so titles across a row
     start at the same height even when one wraps to two lines. */
}
.listing-card__title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--fs-body-m);
  line-height: var(--lh-body-m);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.listing-card__icon {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--color-grey-900);
  transition: transform .2s ease;
}
/* Client: arrow stays black; slides right on hover instead of turning red. */
.listing-card:hover .listing-card__icon { transform: translateX(4px); }

/* ---------- Before/After: bottom "stories" banner ---------- */
.ba-stories {
  padding-bottom: var(--space-6xl);
}
.ba-stories__banner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 448px;
  padding: var(--space-6xl);
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--color-grey-900);
}
.ba-stories__bg {
  position: absolute;
  inset: 0;
}
.ba-stories__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Dark left-to-right scrim so the text stays legible over ANY image: hold the
   dark on the left (text column), then fade to a clear image on the right. */
.ba-stories__banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, .6) 38%, rgba(0, 0, 0, 0) 78%);
}
.ba-stories__content {
  position: relative;
  z-index: 1; /* above the ::after scrim, which is painted last in DOM order */
  display: flex;
  flex-direction: column;
  gap: var(--space-3xl);
  align-items: flex-start;
  max-width: 482px;
}
.ba-stories__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}
.ba-stories__title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: var(--fs-h-l);
  line-height: var(--lh-h-l);
  letter-spacing: var(--ls-h-l);
  color: var(--color-white);
}
.ba-stories__title em,
.ba-stories__title i { font-style: italic; }
.ba-stories__desc {
  margin: 0;
  font-size: var(--fs-body-m);
  line-height: var(--lh-body-m);
  font-weight: 500;
  color: var(--color-white);
}
.ba-stories__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-xl);
  border-radius: var(--radius-s);
  background: var(--color-grey-100);
  color: var(--color-grey-900);
  font-size: var(--fs-body-s);
  line-height: var(--lh-body-s);
  font-weight: 500;
  text-decoration: none;
  transition: background-color .2s ease;
}
.ba-stories__btn:hover { background: var(--color-white); }
.ba-stories__btn:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}
.ba-stories__btn-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
}

/* ---------- Tablet: 3 columns ---------- */
@media (max-width: 1024px) {
  .tcat__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Mobile: single column, horizontal cards ---------- */
@media (max-width: 600px) {
  .treatments__hero { gap: var(--space-2xl); }
  .treatments__title { font-size: var(--fs-h-l); line-height: var(--lh-h-l); letter-spacing: var(--ls-h-l); }
  .treatments__banner { aspect-ratio: 3 / 2; }
  .treatments__list { padding-block: var(--space-2xl) var(--space-3xl); }

  .tcat__grid { grid-template-columns: 1fr; gap: var(--space-s); }

  .listing-card {
    flex-direction: row;
    align-items: center;
    gap: var(--space-s);
  }
  .listing-card__media {
    width: 72px;
    flex: 0 0 72px;
  }
  .listing-card__title { -webkit-line-clamp: 2; }

  .ba-stories { padding-bottom: var(--space-3xl); }
  .ba-stories__banner { min-height: 0; padding: var(--space-2xl) var(--space-l); }
  .ba-stories__content { gap: var(--space-2xl); max-width: none; }
  .ba-stories__title { font-size: var(--fs-h-m); line-height: var(--lh-h-m); }
}

/* ---------- Tablet: banner padding ---------- */
@media (max-width: 1024px) {
  .ba-stories__banner { padding: var(--space-3xl); }
}
