/* ==========================================================================
   Temporary Text-Focused About Section Layout (.about-us--text-only)
   Can be enabled/disabled by toggling `isTextOnlyAbout` in src/pages/index.astro
   or toggling `.about-us--text-only` class on <section class="about-us">.
   ========================================================================== */

.about-us.about-us--text-only {
  padding-bottom: 60px;

  /* Non-destructively hide illustration */
  .about-grid {
    display: none;
  }

  /* Hide the actual checkbox */
  .read-more-state {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .about-container {
    width: 85%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 70px 60px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%);
    border: 1px solid rgba(0, 68, 148, 0.08);
    border-radius: 32px;
    box-shadow: 0 20px 40px -15px rgba(24, 30, 75, 0.05);
    position: relative;
    overflow: hidden;
  }

  /* Decorative top accent bar */
  .about-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: linear-gradient(90deg, #ff0090 0%, #b317a9 100%);
    border-radius: 0 0 4px 4px;
  }

  .about-text {
    flex: none;
    width: 100%;
    max-width: 740px;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: center;

    h2 {
      color: #181e4b;
      font-size: 2.75rem;
      font-weight: 800;
      margin-bottom: 32px;
      letter-spacing: -0.01em;
      text-align: center;
    }

    p {
      color: #4b5563;
      font-size: 1.08rem;
      line-height: 1.8;
      margin-bottom: 24px;
      width: 100%;
      text-align: justify;
    }

    .read-more-target {
      width: 100%;
      max-height: 0;
      opacity: 0;
      overflow: hidden;
      transition: all 0.5s ease;
      transition-delay: 0ms;

      p {
        color: #4b5563;
        font-size: 1.08rem;
        line-height: 1.8;
        margin-bottom: 24px;
        text-align: justify;
      }
    }

    .read-more-trigger {
      margin-top: 12px;
      align-self: center;

      .label-more {
        display: inline;
      }
      .label-less {
        display: none;
      }
    }
  }

  .read-more-state:focus-visible ~ .about-text .read-more-trigger {
    outline: 3px solid var(--color-button-focus);
    outline-offset: 3px;
  }

  /* Checked state spacing */
  .read-more-state:checked ~ .about-text {
    .read-more-target {
      max-height: 3500px;
      opacity: 1;
      margin-bottom: 12px;
      transition-delay: 0ms;
    }

    .read-more-trigger .label-more {
      display: none;
    }
    .read-more-trigger .label-less {
      display: inline;
    }
  }

  /* Slight delay before collapsing so scripts can scroll first */
  .read-more-state:not(:checked) ~ .about-text .read-more-target {
    transition-delay: 75ms;
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .about-us.about-us--text-only {
    padding-bottom: 60px;
    .about-container {
      width: 90%;
      padding: 45px 24px;
      border-radius: 24px;
    }

    .read-more-state:not(:checked) ~ .about-text .read-more-target {
      transition-duration: 0.8s;
    }

    .about-text {
      h2 {
        font-size: 2rem;
        margin-bottom: 20px;
      }

      p,
      .read-more-target p {
        font-size: 1rem;
        line-height: 1.7;
        margin-bottom: 20px;
      }
    }
  }
}
