/* =====================================================================
   Aastha layout balance layer
   Keeps repeated cards, panels and calls-to-action visually aligned even
   when headings, descriptions or link counts vary between items.
   ===================================================================== */

.release-v24 .hub-category,
.release-v24 .about-story-card,
.release-v24 .clinic-location-card,
.release-v24 .value-card,
.release-v24 .process-step,
.release-v24 .hours-card,
.release-v24 .clinic-choice-grid > article,
.release-v24 .contact-action-card,
.release-v24 .journal-card,
.release-v24 .concern-card,
.release-v24 .treatment-card,
.release-v24 .why-card,
.release-v24 .location-pro-card,
.release-v24 .patient-guide-card,
.release-v24 .cms-card {
  box-sizing: border-box;
  min-width: 0;
  height: 100%;
}

/* Directory panels: fill equal-height rows and centre incomplete final rows. */
.release-v24 .hub-category {
  display: flex;
  flex-direction: column;
}

.release-v24 .hub-category .hub-link-grid {
  flex: 1;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: minmax(92px, 1fr);
  align-content: stretch;
}

.release-v24 .hub-category .hub-link-grid > .hub-link {
  grid-column: span 3;
  height: 100%;
  justify-content: flex-start;
}

.release-v24 .hub-category--wide .hub-link-grid > .hub-link {
  grid-column: span 2;
}

.release-v24 .hub-link::after {
  margin-top: auto;
  padding-top: 8px;
}

/* One card left in a two-column row. */
.release-v24 .hub-category:not(.hub-category--wide)
  .hub-link-grid > .hub-link:last-child:nth-child(2n + 1) {
  grid-column: 2 / span 3;
}

/* One card left in a three-column row. */
.release-v24 .hub-category--wide
  .hub-link-grid > .hub-link:last-child:nth-child(3n + 1) {
  grid-column: 3 / span 2;
}

/* Two cards left in a three-column row. */
.release-v24 .hub-category--wide
  .hub-link-grid > .hub-link:nth-last-child(2):nth-child(3n + 1) {
  grid-column: 2 / span 2;
}

.release-v24 .hub-category--wide
  .hub-link-grid > .hub-link:last-child:nth-child(3n + 2) {
  grid-column: 4 / span 2;
}

/* Repeated grids should stretch every item to the row height. */
.release-v24 .journal-grid,
.release-v24 .clinic-choice-grid,
.release-v24 .contact-action-grid,
.release-v24 .value-grid,
.release-v24 .process-grid,
.release-v24 .hours-grid,
.release-v24 .concern-grid,
.release-v24 .treatment-grid,
.release-v24 .why-grid,
.release-v24 .location-pro-grid,
.release-v24 .premium-summary-grid,
.release-v24 .about-story-grid,
.release-v24 .clinic-location-grid,
.release-v24 .guide-grid,
.release-v24 .cms-card-grid {
  align-items: stretch;
}

/* Keep variable-length copy from moving the final action up or down. */
.release-v24 .journal-card > div,
.release-v24 .patient-guide-body,
.release-v24 .location-pro-card .location-copy,
.release-v24 .cms-card > div {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.release-v24 .journal-card > div > strong:last-child,
.release-v24 .patient-guide-body .guide-link,
.release-v24 .location-pro-card .location-actions {
  margin-top: auto;
  padding-top: 14px;
}

.release-v24 .clinic-choice-grid > article {
  display: flex;
  flex-direction: column;
}

.release-v24 .clinic-choice-grid > article .inline-actions {
  margin-top: auto;
  padding-top: 8px;
}

.release-v24 .premium-summary-item,
.release-v24 .trust-item,
.release-v24 .clean-list--three > li {
  box-sizing: border-box;
  height: 100%;
}

/* =====================================================================
   Dark-mode readability
   Older design layers used light-theme muted colours inside dark surfaces.
   These final overrides keep secondary copy comfortably readable while
   preserving the burgundy, blush and gold visual identity.
   ===================================================================== */

html[data-theme="dark"] .release-v24 {
  --dark-readable-heading: #fff7fa;
  --dark-readable-body: #eadde3;
  --dark-readable-muted: #d3c1ca;
  --dark-readable-link: #f3a8c3;
  --dark-readable-accent: #ef84ac;
  --dark-readable-border: #62404f;
  --dark-readable-surface: #1b1217;
  --dark-readable-soft: #24171e;
}

html[data-theme="dark"] .release-v24 .trust-ribbon {
  background: var(--dark-readable-surface);
  border-color: var(--dark-readable-border);
}

html[data-theme="dark"] .release-v24 .trust-item {
  border-color: var(--dark-readable-border);
}

html[data-theme="dark"] .release-v24 .trust-item strong {
  color: var(--dark-readable-accent) !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .release-v24 .trust-item span:not(.trust-icon) {
  color: var(--dark-readable-muted) !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .release-v24 .trust-icon {
  color: #74183d !important;
  background: #fff2f6 !important;
  border: 1px solid #f0ccd9;
}

html[data-theme="dark"] .release-v24 .faq-pro-list details,
html[data-theme="dark"] .release-v24 .faq-clean-list details,
html[data-theme="dark"] .release-v24 .faq-item {
  color: var(--dark-readable-body) !important;
  background: var(--dark-readable-surface) !important;
  border-color: var(--dark-readable-border) !important;
}

html[data-theme="dark"] .release-v24 .faq-pro-list summary,
html[data-theme="dark"] .release-v24 .faq-clean-list summary,
html[data-theme="dark"] .release-v24 .faq-item button {
  color: var(--dark-readable-heading) !important;
  background: var(--dark-readable-surface) !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .release-v24 .faq-answer,
html[data-theme="dark"] .release-v24 .faq-answer p,
html[data-theme="dark"] .release-v24 .faq-answer li,
html[data-theme="dark"] .release-v24 .faq-answer span,
html[data-theme="dark"] .release-v24 .faq-answer strong {
  color: var(--dark-readable-body) !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .release-v24 .faq-answer a {
  color: var(--dark-readable-link) !important;
}

html[data-theme="dark"] .release-v24 :where(
  .premium-summary-item,
  .hub-category,
  .hub-link,
  .about-story-card,
  .clinic-location-card,
  .value-card,
  .process-step,
  .hours-card,
  .clinic-choice-grid > article,
  .contact-action-card,
  .journal-card,
  .concern-card,
  .treatment-card,
  .why-card,
  .location-pro-card,
  .patient-guide-card,
  .cms-card,
  .appointment-fact-card,
  .care-sidebar-card
) {
  border-color: var(--dark-readable-border) !important;
}

html[data-theme="dark"] .release-v24 :where(
  .premium-summary-item,
  .hub-category,
  .hub-link,
  .about-story-card,
  .clinic-location-card,
  .value-card,
  .process-step,
  .hours-card,
  .clinic-choice-grid > article,
  .contact-action-card,
  .journal-card,
  .concern-card,
  .treatment-card,
  .why-card,
  .location-pro-card,
  .patient-guide-card,
  .cms-card,
  .appointment-fact-card,
  .care-sidebar-card
) :where(p, address, li, small) {
  color: var(--dark-readable-muted) !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .release-v24 :where(
  .premium-summary-item,
  .hub-category,
  .hub-link,
  .about-story-card,
  .clinic-location-card,
  .value-card,
  .process-step,
  .hours-card,
  .clinic-choice-grid > article,
  .contact-action-card,
  .journal-card,
  .concern-card,
  .treatment-card,
  .why-card,
  .location-pro-card,
  .patient-guide-card,
  .cms-card,
  .appointment-fact-card,
  .care-sidebar-card
) :where(h2, h3, h4, strong) {
  color: var(--dark-readable-heading) !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .release-v24 :where(
  .hub-link,
  .journal-card,
  .patient-guide-card,
  .location-pro-card,
  .clinic-choice-grid > article,
  .contact-action-card,
  .care-sidebar-card
) a:not(.button) {
  color: var(--dark-readable-link) !important;
}

html[data-theme="dark"] .release-v24 .medical-disclaimer,
html[data-theme="dark"] .release-v24 .contact-note,
html[data-theme="dark"] .release-v24 .hub-notice,
html[data-theme="dark"] .release-v24 .emergency-card {
  color: #f3e5ae !important;
  background: #2b2515 !important;
  border-color: #75652d !important;
}

html[data-theme="dark"] .release-v24 .medical-disclaimer strong,
html[data-theme="dark"] .release-v24 .contact-note strong,
html[data-theme="dark"] .release-v24 .hub-notice strong,
html[data-theme="dark"] .release-v24 .emergency-card strong {
  color: #fff2b8 !important;
}

/* Tablet: wide directory panels become balanced two-column grids. */
@media (max-width: 960px) {
  .release-v24 .hub-category--wide .hub-link-grid > .hub-link,
  .release-v24 .hub-category--wide
    .hub-link-grid > .hub-link:nth-last-child(2):nth-child(3n + 1),
  .release-v24 .hub-category--wide
    .hub-link-grid > .hub-link:last-child:nth-child(3n + 1),
  .release-v24 .hub-category--wide
    .hub-link-grid > .hub-link:last-child:nth-child(3n + 2) {
    grid-column: span 3;
  }

  .release-v24 .hub-category--wide
    .hub-link-grid > .hub-link:last-child:nth-child(2n + 1) {
    grid-column: 2 / span 3;
  }
}

/* Mobile: one card per row; content height should remain natural. */
@media (max-width: 720px) {
  .release-v24 .hub-category .hub-link-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .release-v24 .hub-category .hub-link-grid > .hub-link,
  .release-v24 .hub-category--wide .hub-link-grid > .hub-link,
  .release-v24 .hub-category--wide
    .hub-link-grid > .hub-link:nth-last-child(2):nth-child(3n + 1),
  .release-v24 .hub-category--wide
    .hub-link-grid > .hub-link:last-child:nth-child(3n + 1),
  .release-v24 .hub-category--wide
    .hub-link-grid > .hub-link:last-child:nth-child(3n + 2) {
    grid-column: 1 / -1;
    width: 100%;
    justify-self: stretch;
  }
}