/**
 * Legacy RichText Block Responsive Styles
 *
 * This CSS provides mobile-first responsive styling for legacy HTML content
 * imported into CMS RichText blocks. These classes were used in static HTML
 * imports and need responsive behavior for the modern site.
 *
 * Approach: Mobile-first - base styles are for mobile, media queries add desktop
 */

/* ==========================================================================
   Base Layout Components
   ========================================================================== */

/**
 * Container - Common wrapper for content sections
 */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/**
 * Page Header - Used at top of pages
 */
.page-header {
  padding: 2rem 1rem;
  text-align: center;
  background: linear-gradient(135deg, var(--theme-primary-dark, #512D6D) 0%, var(--theme-primary-deep, #3A1B50) 100%);
  color: white;
}

@media (min-width: 640px) {
  .page-header {
    padding: 3rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .page-header {
    padding: 4rem 2rem;
  }
}

.page-header h1 {
  font-size: var(--typo-page-title-size);
  font-weight: var(--typo-page-title-weight);
  margin-bottom: 0.75rem;
  color: white;
}

@media (min-width: 640px) {
  .page-header h1 {
    font-size: var(--typo-page-title-size);
    margin-bottom: 1rem;
  }
}

@media (min-width: 1024px) {
  .page-header h1 {
    font-size: var(--typo-page-title-size);
  }
}

.page-header p {
  font-size: var(--typo-body-text-size);
  opacity: 0.9;
  max-width: 42rem;
  margin: 0 auto;
  line-height: var(--typo-body-text-lh);
}

@media (min-width: 640px) {
  .page-header p {
    font-size: var(--typo-body-text-size);
  }
}

/**
 * Content Section - Generic content wrapper
 */
.content-section {
  padding: 2rem 1rem;
}

@media (min-width: 640px) {
  .content-section {
    padding: 3rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .content-section {
    padding: 4rem 2rem;
  }
}

/**
 * Lead Text - Intro/summary text
 */
.lead-text {
  font-size: var(--typo-body-text-size);
  color: var(--theme-text-muted, #4a5568);
  line-height: var(--typo-body-text-lh);
  max-width: 48rem;
  margin: 0 auto 2rem;
  text-align: center;
}

@media (min-width: 640px) {
  .lead-text {
    font-size: var(--typo-body-text-size);
    margin-bottom: 2.5rem;
  }
}

/* ==========================================================================
   Grid Layouts - All use mobile-first single column
   ========================================================================== */

/**
 * Capabilities Grid
 */
.capabilities-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .capabilities-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .capabilities-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/**
 * Services Grid
 */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/**
 * Tech Grid
 */
.tech-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .tech-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/**
 * Locations Grid
 */
.locations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .locations-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .locations-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/**
 * Quality Features Grid
 */
.quality-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .quality-features {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* ==========================================================================
   Card Components
   ========================================================================== */

/**
 * Base Card Styles
 */
.capability-card,
.service-card,
.tech-card,
.location-card,
.quality-card {
  background: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--theme-text) 10%, transparent);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

@media (min-width: 640px) {
  .capability-card,
  .service-card,
  .tech-card,
  .location-card,
  .quality-card {
    padding: 2rem;
  }
}

.capability-card:hover,
.service-card:hover,
.tech-card:hover,
.location-card:hover,
.quality-card:hover {
  box-shadow: 0 10px 25px color-mix(in srgb, var(--theme-primary) 15%, transparent);
  transform: translateY(-2px);
}

/**
 * Card Headings
 */
.capability-card h3,
.service-card h3,
.tech-card h3,
.location-card h3,
.quality-card h3 {
  font-size: var(--typo-card-title-size);
  font-weight: var(--typo-card-title-weight);
  color: var(--theme-primary-dark, #512D6D);
  margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
  .capability-card h3,
  .service-card h3,
  .tech-card h3,
  .location-card h3,
  .quality-card h3 {
    font-size: var(--typo-card-title-size);
    margin-bottom: 1rem;
  }
}

/**
 * Card Text
 */
.capability-card p,
.service-card p,
.tech-card p,
.location-card p,
.quality-card p {
  font-size: var(--typo-card-body-size);
  color: var(--theme-text-muted, #4a5568);
  line-height: var(--typo-card-body-lh);
}

/* ==========================================================================
   CTA Section
   ========================================================================== */

.cta-section {
  padding: 2.5rem 1rem;
  text-align: center;
  background: linear-gradient(135deg, var(--theme-primary-dark, #512D6D) 0%, var(--theme-accent, #1F607C) 100%);
  color: white;
}

@media (min-width: 640px) {
  .cta-section {
    padding: 3.5rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .cta-section {
    padding: 4rem 2rem;
  }
}

.cta-section h2 {
  font-size: var(--typo-section-title-size);
  font-weight: var(--typo-section-title-weight);
  margin-bottom: 0.75rem;
  color: white;
}

@media (min-width: 640px) {
  .cta-section h2 {
    font-size: var(--typo-section-title-size);
    margin-bottom: 1rem;
  }
}

.cta-section p {
  font-size: var(--typo-body-text-size);
  opacity: 0.9;
  margin-bottom: 1.5rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 640px) {
  .cta-section p {
    font-size: var(--typo-body-text-size);
    margin-bottom: 2rem;
  }
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: white;
  color: var(--theme-primary-dark, #512D6D);
  font-weight: var(--typo-button-text-weight);
  border-radius: 0.5rem;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
  font-size: var(--typo-button-text-size);
}

@media (min-width: 640px) {
  .cta-button {
    padding: 0.875rem 2rem;
    font-size: var(--typo-button-text-size);
  }
}

.cta-button:hover {
  background: var(--theme-surface-3, #EEECEA);
  transform: translateY(-1px);
}

/* ==========================================================================
   Contact Page Components
   ========================================================================== */

/**
 * Contact Layout - Two column on desktop
 */
.contact-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .contact-layout {
    flex-direction: row;
    gap: 3rem;
  }
}

/**
 * Contact Info Section
 */
.contact-info-section {
  flex: 1;
}

.contact-info-card {
  background: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--theme-text) 10%, transparent);
}

@media (min-width: 640px) {
  .contact-info-card {
    padding: 2rem;
    margin-bottom: 1.5rem;
  }
}

.info-block {
  padding: 1rem 0;
  border-bottom: 1px solid var(--theme-surface-1, #e2e8f0);
}

.info-block:last-child {
  border-bottom: none;
}

.info-block h4 {
  font-size: var(--typo-list-item-title-size);
  font-weight: var(--typo-list-item-title-weight);
  color: var(--theme-primary-dark, #512D6D);
  margin-bottom: 0.5rem;
}

.info-block p {
  font-size: var(--typo-list-item-body-size);
  color: var(--theme-text-muted, #4a5568);
  line-height: var(--typo-list-item-body-lh);
}

/**
 * Contact Form Section
 */
.contact-form-section {
  flex: 1.5;
}

.contact-form {
  background: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--theme-text) 10%, transparent);
}

@media (min-width: 640px) {
  .contact-form {
    padding: 2rem;
  }
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .form-row {
    flex-direction: row;
    gap: 1.5rem;
  }
}

.form-group {
  flex: 1;
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: var(--typo-label-size);
  font-weight: var(--typo-label-weight);
  color: var(--theme-text, #2B2A27);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--theme-surface-1, #E3DDD4);
  border-radius: 0.375rem;
  font-size: var(--typo-body-small-size);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--theme-primary-dark, #512D6D);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary) 10%, transparent);
}

.form-group textarea {
  min-height: 8rem;
  resize: vertical;
}

.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--theme-primary-dark, #512D6D);
  color: white;
  font-weight: var(--typo-button-text-weight);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: var(--typo-button-text-size);
}

@media (min-width: 640px) {
  .submit-button {
    width: auto;
    padding: 0.875rem 2rem;
  }
}

.submit-button:hover {
  background: var(--theme-primary-light, #5a2677);
}

/* ==========================================================================
   Additional Generic Classes
   ========================================================================== */

/**
 * Feature Grid (generic)
 */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/**
 * Feature Card (generic)
 */
.feature-card {
  background: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--theme-text) 10%, transparent);
  transition: box-shadow 0.2s ease;
}

@media (min-width: 640px) {
  .feature-card {
    padding: 2rem;
  }
}

.feature-card:hover {
  box-shadow: 0 10px 25px color-mix(in srgb, var(--theme-primary) 15%, transparent);
}

/**
 * Stats Grid
 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  text-align: center;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

.stat-item {
  padding: 1rem;
}

.stat-item .number {
  font-size: var(--typo-stat-value-size);
  font-weight: var(--typo-stat-value-weight);
  color: var(--theme-primary-dark, #512D6D);
  display: block;
}

@media (min-width: 640px) {
  .stat-item .number {
    font-size: var(--typo-stat-value-size);
  }
}

.stat-item .label {
  font-size: var(--typo-stat-label-size);
  color: var(--theme-text-muted, #4a5568);
}

/**
 * Timeline
 */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}

@media (min-width: 640px) {
  .timeline {
    padding-left: 2rem;
  }
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--theme-primary-dark, #512D6D);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.25rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--theme-primary-dark, #512D6D);
}

@media (min-width: 640px) {
  .timeline-item::before {
    left: -2rem;
    width: 1rem;
    height: 1rem;
    top: 0.125rem;
  }
}

.timeline-item h4 {
  font-size: var(--typo-list-item-title-size);
  font-weight: var(--typo-list-item-title-weight);
  color: var(--theme-text, #2B2A27);
  margin-bottom: 0.25rem;
}

.timeline-item p {
  font-size: var(--typo-list-item-body-size);
  color: var(--theme-text-muted, #4a5568);
}

/**
 * Values Grid
 */
.values-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .values-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.value-card {
  text-align: center;
  padding: 1.5rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--theme-text) 10%, transparent);
}

@media (min-width: 640px) {
  .value-card {
    padding: 2rem;
  }
}

.value-card h4 {
  font-size: var(--typo-card-title-size);
  font-weight: var(--typo-card-title-weight);
  color: var(--theme-primary-dark, #512D6D);
  margin-bottom: 0.5rem;
}

.value-card p {
  font-size: var(--typo-card-body-size);
  color: var(--theme-text-muted, #4a5568);
}

/* ==========================================================================
   Image Handling
   ========================================================================== */

/**
 * Ensure all images in RichText are responsive
 */
.prose img,
section img,
.container img,
.content-section img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

/**
 * Image Grids
 */
.image-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .image-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   Table Handling
   ========================================================================== */

/**
 * Responsive tables
 */
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--typo-body-small-size);
}

@media (min-width: 640px) {
  table {
    font-size: var(--typo-body-small-size);
  }
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--theme-surface-1, #e2e8f0);
}

th {
  background: var(--theme-surface-3, #EEECEA);
  font-weight: var(--typo-spec-label-weight);
  color: var(--theme-text, #2B2A27);
}

/* ==========================================================================
   Link Styles
   ========================================================================== */

.content-section a:not(.typo-button-text, .typo-button-text-large),
.container a:not(.typo-button-text, .typo-button-text-large) {
  color: var(--theme-primary-dark, #512D6D);
  text-decoration: none;
  transition: color 0.2s ease;
}

/* Do not override explicit text-color utilities (e.g. text-white on buttons) */
.content-section a[class*="text-white"],
.container a[class*="text-white"] {
  color: white;
}

.content-section a:not(.typo-button-text, .typo-button-text-large):hover,
.container a:not(.typo-button-text, .typo-button-text-large):hover {
  color: var(--theme-accent, #1F607C);
  text-decoration: underline;
}

/* Do not override hover color on styled buttons */
.content-section a[class*="text-white"]:hover,
.container a[class*="text-white"]:hover {
  color: white;
  text-decoration: none;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.hidden {
  display: none;
}

@media (min-width: 640px) {
  .sm\:block {
    display: block;
  }
  .sm\:hidden {
    display: none;
  }
}

@media (min-width: 1024px) {
  .lg\:block {
    display: block;
  }
  .lg\:hidden {
    display: none;
  }
}
