/* Solutions page overrides layered on top of roadmap + shared UI */

/* Keep roadmap styles, but neutralize roadmap full-screen blocks section inside Hero */
body.solutions-page #solutions-hero-blocks.roadmap-section--blocks {
  min-height: auto;
  padding-top: 0;
  padding-bottom: 0;
}

/* Make Hero actually hold Title + Subtitle + Blocks without overlap */
body.solutions-page .w3s-hero {
  min-height: 100vh;
}

body.solutions-page .w3s-hero__panel {
  max-height: none;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Hero content: fill space below navbar, center title + blocks in that area */
body.solutions-page .w3s-hero__content {
  flex: 1;
  min-height: 0;
  padding-top: var(--navbar-height);
  padding-bottom: clamp(72px, 10vh, 120px);
  gap: 16px;
  justify-content: center;
  align-items: center;
}

body.solutions-page .w3s-hero__head {
  padding-top: 0;
  margin-top: clamp(2rem, 5vw, 3.5rem); /* half of default navbar→title gap */
}

body.solutions-page #solutions-hero-blocks .w3s-blocks-container {
  margin-top: 1rem;
  width: calc(100% - 160px);
  max-width: 1400px;
  margin-inline: auto;
}

body.solutions-page #solutions-hero-blocks .w3s-blocks__row {
  justify-content: center;
}

@media (max-width: 960px) {
  body.solutions-page #solutions-hero-blocks .w3s-blocks-container {
    width: calc(100% - 48px);
  }
}

@media (max-width: 600px) {
  body.solutions-page #solutions-hero-blocks .w3s-blocks-container {
    width: 100%;
    max-width: 100%;
  }

  body.solutions-page #solutions-hero-blocks .w3s-blocks__row {
    flex-direction: column;
    align-items: center;
    max-width: clamp(280px, 88vw, 380px);
    margin-inline: auto;
  }
}

/* Add a clear gap between hero and Section 2 so content doesn't sit under blur band */
body.solutions-page #solutions-individuals {
  margin-top: clamp(3rem, 8vh, 5rem);
}

/* Gap between Section 2 and 3 so when centering one section, the other doesn't peek */
body.solutions-page #solutions-institutions {
  margin-top: clamp(4rem, 10vh, 6rem);
}

/* Ensure sections 2 and 3 render above hero blur band */
body.solutions-page #solutions-individuals,
body.solutions-page #solutions-institutions {
  position: relative;
  z-index: 30;
}

/* Section visuals (between title and blocks) */
body.solutions-page .solutions-section-visual {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

body.solutions-page .solutions-section-visual__img {
  display: block;
  width: 200px;
  height: 200px;
  object-fit: contain;
}

@media (max-width: 1024px) {
  body.solutions-page .solutions-section-visual__img {
    width: 150px;
    height: 150px;
  }
}

@media (max-width: 600px) {
  body.solutions-page .solutions-section-visual__img {
    width: 70vw;
    height: auto;
  }
}

/* Tighten vertical rhythm: similar spacing title→blocks and blocks→back-to-top */
body.solutions-page #solutions-individuals .w3s-blocks-container,
body.solutions-page #solutions-institutions .w3s-blocks-container {
  margin-bottom: clamp(1.5rem, 3vh, 2.5rem);
}

/* Integrate back-to-top into section content container, centered under blocks */
body.solutions-page #solutions-individuals .roadmap-back-to-top-gap,
body.solutions-page #solutions-institutions .roadmap-back-to-top-gap {
  display: flex;
  justify-content: center;
}

/* Hero spacer text: remove from layout so content can center */
body.solutions-page #solutions-hero-blocks .w3s-blocks__text--spacer {
  display: none;
}

/* Slightly smaller, tighter PixelCaps titles on Solutions blocks only */
body.solutions-page .w3s-section--ecosystem .w3s-blocks__tip {
  font-size: var(--fs-h3);
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-align: center;
}

/* Sections 2 & 3 only: split gradient per line */
body.solutions-page #solutions-individuals .w3s-blocks__tip,
body.solutions-page #solutions-institutions .w3s-blocks__tip {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  font-size: clamp(0.62rem, 1.4vw, var(--fs-h3));
}

body.solutions-page #solutions-individuals .w3s-blocks__tip-line,
body.solutions-page #solutions-institutions .w3s-blocks__tip-line {
  display: block;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap; /* keep each <br> line as exactly one line */
}

/* Disable the parent tip gradient so it doesn't span across both lines */
body.solutions-page #solutions-individuals .w3s-blocks__card--solution-1 .w3s-blocks__tip,
body.solutions-page #solutions-institutions .w3s-blocks__card--solution-1 .w3s-blocks__tip,
body.solutions-page #solutions-individuals .w3s-blocks__card--solution-2 .w3s-blocks__tip,
body.solutions-page #solutions-institutions .w3s-blocks__card--solution-2 .w3s-blocks__tip,
body.solutions-page #solutions-individuals .w3s-blocks__card--solution-3 .w3s-blocks__tip,
body.solutions-page #solutions-institutions .w3s-blocks__card--solution-3 .w3s-blocks__tip {
  background-image: none !important;
}

/* Re-apply gradients per line */
body.solutions-page #solutions-individuals .w3s-blocks__card--solution-1 .w3s-blocks__tip-line,
body.solutions-page #solutions-institutions .w3s-blocks__card--solution-1 .w3s-blocks__tip-line {
  background-image: linear-gradient(to bottom, #ffffff 0%, #39d091 100%);
}

body.solutions-page #solutions-individuals .w3s-blocks__card--solution-2 .w3s-blocks__tip-line,
body.solutions-page #solutions-institutions .w3s-blocks__card--solution-2 .w3s-blocks__tip-line {
  background-image: linear-gradient(to bottom, #e0e0e0 0%, #d1b838 100%);
}

body.solutions-page #solutions-individuals .w3s-blocks__card--solution-3 .w3s-blocks__tip-line,
body.solutions-page #solutions-institutions .w3s-blocks__card--solution-3 .w3s-blocks__tip-line {
  background-image: linear-gradient(to bottom, #ffffff 0%, #3b82f6 100%);
}

/*
 * Institutions (section 3): optional 3-line split vs legacy 2-line (mobile + portrait tablet).
 * Wide layout: desktop + horizontal tablet — matches rest of page (mobile ≤600px; portrait tablet 768–1024).
 */
body.solutions-page #solutions-institutions .w3s-blocks__tip-line--s3i-wide {
  display: none;
}

@media (min-width: 601px) and (orientation: landscape),
  (min-width: 1025px) {
  body.solutions-page #solutions-institutions .w3s-blocks__tip-line--s3i-compact {
    display: none;
  }

  body.solutions-page #solutions-institutions .w3s-blocks__tip-line--s3i-wide {
    display: block;
  }
}

/* Portrait tablets 601–1024px: keep 2-line copy (same as mobile treatment for this section) */
@media (min-width: 601px) and (max-width: 1024px) and (orientation: portrait) {
  body.solutions-page #solutions-institutions .w3s-blocks__tip-line--s3i-compact {
    display: block;
  }

  body.solutions-page #solutions-institutions .w3s-blocks__tip-line--s3i-wide {
    display: none;
  }
}

/* Sections 2 & 3: blocks width 70vw */
body.solutions-page #solutions-individuals .w3s-blocks__row--three,
body.solutions-page #solutions-institutions .w3s-blocks__row--three {
  width: 70vw;
  min-width: 260px;
  max-width: 100%;
  margin-inline: auto;
}

/* Let Solution cards grow to their content instead of fixed 100px */
@media (min-width: 601px) {
  body.solutions-page #solutions-individuals .w3s-blocks__card,
  body.solutions-page #solutions-institutions .w3s-blocks__card {
    height: auto;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    /* Allow cards to shrink inside the deterministic grid */
    min-width: 0;
  }
}

/* Remove any text decoration inside solution cards; full card is the click target */
body.solutions-page .w3s-blocks__card,
body.solutions-page .w3s-blocks__card * {
  text-decoration: none;
}

/* --------- Solutions block modal (popover) --------- */
.w3s-solutions-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  padding: 1rem;
  box-sizing: border-box;
}

.w3s-solutions-modal.active {
  display: flex;
}

.w3s-solutions-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

.w3s-solutions-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(90vw, 560px);
  max-height: 85vh;
  overflow-y: auto;
  background: linear-gradient(to bottom, #3c3c3c 0%, #000000 100%);
  border: 5px solid rgba(57, 208, 145, 0.4);
  box-shadow: inset 0 0 0 1px #ffffff, 0 0 40px rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  padding: 1.25rem 1.25rem 1.25rem;
  color: rgba(226, 232, 240, 0.95);
}

@media (min-width: 601px) {
  .w3s-solutions-modal__dialog {
    padding: 2.5rem 2.5rem 2rem;
  }
}

@media (min-width: 768px) {
  .w3s-solutions-modal__dialog {
    padding: 3rem 3rem 2.5rem;
  }
}

.w3s-solutions-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  color: rgba(226, 232, 240, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  line-height: 1;
  padding: 0;
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.w3s-solutions-modal__close:hover {
  color: #39d091;
  border-color: rgba(57, 208, 145, 0.5);
}

.w3s-solutions-modal__title {
  margin: 0 0 1.25rem;
  font-family: "PixelCaps", system-ui, sans-serif;
  font-size: var(--fs-h3);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  background-image: linear-gradient(to bottom, #ffffff 0%, #39d091 100%); /* default solution-1 */
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.w3s-solutions-modal__dialog--solution-1 .w3s-solutions-modal__title {
  background-image: linear-gradient(to bottom, #ffffff 0%, #39d091 100%);
}

.w3s-solutions-modal__dialog--solution-2 .w3s-solutions-modal__title {
  background-image: linear-gradient(to bottom, #e0e0e0 0%, #d1b838 100%);
}

.w3s-solutions-modal__dialog--solution-3 .w3s-solutions-modal__title {
  background-image: linear-gradient(to bottom, #ffffff 0%, #3b82f6 100%);
}

.w3s-solutions-modal__body {
  font-size: var(--fs-body);
  line-height: 1.55;
}

.w3s-solutions-modal__body p {
  margin: 0 0 0.875rem;
}

.w3s-solutions-modal__body strong {
  color: #39d091;
}

.w3s-solutions-modal__body ul {
  margin: 0 0 0.875rem 1.25rem;
  padding: 0;
}

.w3s-solutions-modal__body li {
  margin-bottom: 0.35rem;
}

.w3s-solutions-modal__body .w3s-solutions-modal__powered-by {
  text-align: center;
  margin-bottom: 0;
}

.w3s-solutions-modal__cta {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.w3s-solutions-modal__cta .w3s-button {
  text-decoration: none;
}

.w3s-solutions-modal__cta .w3s-button__text {
  color: #ffffff;
  justify-content: center;
  min-width: 0;
}

.w3s-solutions-modal__cta .w3s-button:hover .w3s-button__text,
.w3s-solutions-modal__cta .w3s-button:focus .w3s-button__text,
.w3s-solutions-modal__cta .w3s-button:active .w3s-button__text {
  color: #39d091;
}

/* --------- Solutions sections 2 & 3: vertical-tablet masonry (portrait only) --------- */

/* Desktop + horizontal tablet: default flex row from w3s-blocks__row */
/* Vertical tablet: wrap into 2 on first line + 1 centered below */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  body.solutions-page #solutions-individuals .w3s-blocks__row--three,
  body.solutions-page #solutions-institutions .w3s-blocks__row--three {
    flex-wrap: wrap;
    justify-content: center;
    gap: 48px;
  }

  body.solutions-page #solutions-individuals .w3s-blocks__row--three .w3s-blocks__card,
  body.solutions-page #solutions-institutions .w3s-blocks__row--three .w3s-blocks__card {
    flex: 0 1 45%;
    min-width: 0;
  }
}

/* --------- Solutions page: mobile (smartphones, narrow devices) --------- */
@media (max-width: 600px) {
  /* Hero: prevent overflow, tighter padding */
  body.solutions-page .w3s-hero__content {
    padding-inline: clamp(0.75rem, 4vw, 1.25rem);
  }

  body.solutions-page .w3s-hero__title {
    font-size: clamp(1.5rem, 6vw, 2.25rem);
    line-height: 1.15;
  }

  body.solutions-page .w3s-hero__subtitle {
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    padding-inline: 0.5rem;
    line-height: 1.5;
  }

  body.solutions-page #solutions-hero-blocks .w3s-blocks-container {
    padding-inline: 0;
  }

  /* Section inner: horizontal padding so content doesn't touch edges */
  body.solutions-page #solutions-individuals .w3s-section__inner,
  body.solutions-page #solutions-institutions .w3s-section__inner {
    padding-inline: clamp(1rem, 5vw, 1.5rem);
  }

  /* Section titles: smaller on mobile */
  body.solutions-page #solutions-individuals .section-title,
  body.solutions-page #solutions-institutions .section-title {
    font-size: clamp(1.1rem, 5vw, 1.5rem);
    margin-bottom: 1rem;
    padding-inline: 0.25rem;
  }

  /* Section visuals: cap width, avoid edge touch */
  body.solutions-page .solutions-section-visual__img {
    width: min(70vw, 220px);
    height: auto;
  }

  /* Cards in sections 2 & 3: floor font size so tip text stays readable */
  body.solutions-page #solutions-individuals .w3s-blocks__tip,
  body.solutions-page #solutions-institutions .w3s-blocks__tip {
    font-size: clamp(0.75rem, 2.8vw, var(--fs-h3));
  }

  body.solutions-page #solutions-individuals .w3s-blocks-container,
  body.solutions-page #solutions-institutions .w3s-blocks-container {
    padding-inline: 0;
    margin-inline: auto;
  }

  body.solutions-page #solutions-individuals .w3s-blocks__row--three,
  body.solutions-page #solutions-institutions .w3s-blocks__row--three {
    gap: clamp(1rem, 4vw, 1.5rem);
    max-width: 100%;
  }

  body.solutions-page #solutions-individuals .w3s-blocks__card,
  body.solutions-page #solutions-institutions .w3s-blocks__card {
    min-height: 60px;
    padding: clamp(1rem, 4vw, 1.35rem);
  }

  /* Back-to-top: reduce gap on mobile */
  body.solutions-page #solutions-individuals .roadmap-back-to-top-gap,
  body.solutions-page #solutions-institutions .roadmap-back-to-top-gap {
    padding: 2rem 0;
  }

  /* Scroll target offset for fixed navbar (80px on mobile) */
  body.solutions-page #solutions-individuals,
  body.solutions-page #solutions-institutions {
    scroll-margin-top: 5rem;
  }
}

/* Very narrow devices (e.g. 320px–400px) */
@media (max-width: 430px) {
  body.solutions-page .w3s-hero__title {
    font-size: clamp(1.25rem, 8vw, 1.75rem);
  }

  body.solutions-page .w3s-hero__subtitle {
    font-size: 0.85rem;
  }

  body.solutions-page #solutions-individuals .w3s-blocks__tip,
  body.solutions-page #solutions-institutions .w3s-blocks__tip {
    font-size: clamp(0.7rem, 3.5vw, 0.9rem);
  }

  body.solutions-page #solutions-individuals .section-title,
  body.solutions-page #solutions-institutions .section-title {
    font-size: clamp(1rem, 6vw, 1.25rem);
  }

  body.solutions-page .solutions-section-visual__img {
    width: min(65vw, 180px);
  }
}

/* Modal: mobile adjustments */
@media (max-width: 600px) {
  .w3s-solutions-modal {
    padding: 0.75rem;
    align-items: flex-end;
  }

  .w3s-solutions-modal__dialog {
    width: 100%;
    max-width: none;
    min-height: 70vh;
    max-height: 90vh;
    border-radius: 12px 12px 0 0;
    padding: 1.25rem 1rem 1.5rem;
    padding-top: 2.5rem; /* room for close button */
  }

  .w3s-solutions-modal__title {
    font-size: clamp(1rem, 4.5vw, 1.25rem);
    margin-bottom: 1rem;
  }

  .w3s-solutions-modal__body {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
  }

  .w3s-solutions-modal__body ul {
    margin-inline: 0.5rem;
  }
}

