/* Custom CSS - Safe from Tailwind rebuilds - ULTRA OPTIMIZED */

/* ==========================================================================
   OVERRIDES
   ========================================================================== */

/* Override vibrant blue header with cooler, darker color */
.bg-primary-600 {
  background-color: #374151 !important;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero-section {
  padding-bottom: 3rem;
}

.hero-gradient-overlay {
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.6) 30%,
    rgba(0, 0, 0, 0.5) 60%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

/* ==========================================================================
   LAYOUT SYSTEM - DESKTOP FIRST
   ========================================================================== */

/* Desktop defaults */
.section-container {
  max-width: 80rem;
  /* padding: 0 2rem; */
  margin: 0 auto;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4rem;
  align-items: flex-start;
}

.section-spacing {
  margin: 4rem 0;
}

.section-spacing-large {
  padding: 6rem 0;
}

/* ==========================================================================
   CONTENT SECTIONS - DESKTOP FIRST
   ========================================================================== */

.section-wrapper {
  position: relative;
  height: auto;
}

.section-content {
  position: relative;
  z-index: 2;
  height: auto;
  display: flex;
  flex-direction: column;
}

.section-text {
  position: relative;
  z-index: 3;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Heading styles - desktop default */
.section-heading {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: #ffffff;
  text-wrap-style: balance;
  /* margin-bottom: 1.5rem; */
}

/* Content wrapper styles */
.section-content-wrapper,
.section-content-inner {
  color: #ffffff;
  position: relative;
  z-index: 3;
}

.section-content-inner > * + * {
  margin-top: 1.5rem;
}

/* Paragraph styles */
.section-paragraph {
  font-size: 1.125rem;
  line-height: 1.75;
  color: #ffffff;
  text-wrap: balance;
}

/* ==========================================================================
   IMAGE COMPONENTS - DESKTOP FIRST
   ========================================================================== */

.section-image-container {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 100%;
  z-index: 1;
}

.section-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0 auto;
}

.section-image-frame {
  border-radius: 1rem;
  overflow: hidden;
  border-color: white;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  padding: 0.5rem;
}

.section-caption p {
  font-size: 0.875rem;
  text-align: center;
  margin: 0;
}

/* ==========================================================================
   TOOLS SECTION (Grid & Logo Specific)
   ========================================================================== */
.tools-logos-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  width: 100%;
  height: 100%;
  align-content: center;
}

.tools-logo-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.tools-logo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: rgb(51, 60, 82);
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  width: 100%;
  aspect-ratio: 1;
  min-height: 4rem;
  transition: all 0.3s ease;
}

.tools-logo-item:hover {
  background: rgb(65, 74, 96);
  transform: scale(1.05);
  box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.08);
}

.tools-logo-image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 3.5rem;
  width: 100%;
}

.tools-logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: 2.5rem;
  max-height: 2.5rem;
}

.tools-logo-name {
  margin-top: 0.25rem;
  font-size: 0.625rem;
  font-weight: 500;
  text-align: center;
  color: #e5e7eb;
  line-height: 1.1;
  width: 100%;
}
/* ==========================================================================
   PARTNERS SECTION (Grid & Logo Specific)
   ========================================================================== */

.partners-logos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 100%;
  height: 100%;
  align-content: stretch;
}

.partners-logo-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.partners-logo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: rgb(51, 60, 82);
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  width: 100%;
  height: 100%;
  /* min-height: 10rem; */
  /* aspect-ratio: 1.5; */
  transition: all 0.3s ease;
}

.partners-logo-item:hover {
  background-color: rgb(65, 74, 96);
  transform: scale(1.05);
  box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.08);
}

.partners-logo-image {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 3rem;
}

/* ==========================================================================
   WORK SECTION
   ========================================================================== */

.work-section {
  position: relative;
  background-color: transparent;
}

.work-background {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.work-background-shape {
  background-color: #111827;
  height: 33.333333%;
}

.work-container {
  position: relative;
}

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

.work-heading {
  font-size: 1.875rem;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: #8b5cf6;
}

.work-description {
  max-width: 42rem;
  margin: 0.75rem auto 0;
  font-size: 1.25rem;
  color: #6b7280;
}

.work-content {
  margin: 0 auto;
  color: #111827;
  max-width: 80rem;
}

.work-cards-container {
  padding: 0 1rem;
  color: #111827;
}

.work-cards-grid {
  display: grid;
  gap: 1rem;
  margin: 3rem auto 1rem;
  max-width: none;
}

.work-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  background-color: #f9fafb;
}

.work-card-content {
  padding: 1.5rem;
}

.work-card-main {
  flex: 1 1 0%;
}

.work-card-title {
  display: block;
  margin-top: 0.5rem;
  font-size: 1.5rem;
  font-weight: 900;
  color: #111827;
  transition-property: color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.work-card-title:hover {
  color: #7c3aed;
  text-decoration: underline;
}

.work-card-summary {
  margin-top: 0.75rem;
  font-size: 1rem;
  color: #111827;
}

.work-card-tags {
  display: flex;
  padding-top: 1.5rem;
  font-weight: 500;
  color: #7c3aed;
  font-size: 1rem;
}

.work-card-tags-label {
  padding-right: 0.5rem;
  font-weight: 900;
}

.work-card-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 0.375rem;
  background-color: #d1d5db;
  padding: 0.125rem 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  transition-property: background-color, color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.work-card-tag:hover {
  background-color: #ddd6fe;
  color: #000000;
}

.work-card-meta {
  display: flex;
  align-items: center;
  margin-top: 1.5rem;
}

.work-card-avatar {
  flex-shrink: 0;
}

.work-card-avatar-image {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
}

.work-card-author-info {
  padding-top: 0.25rem;
  margin-left: 0.75rem;
}

.work-card-author {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
}

.work-card-date-info {
  display: flex;
  column-gap: 0.25rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.work-card-separator {
  user-select: none;
}

/* Work responsive */
@media (min-width: 640px) {
  .work-background-shape {
    height: 66.666667%;
  }

  .work-heading {
    font-size: 2.25rem;
  }

  .work-description {
    margin-top: 1rem;
  }
}

@media (min-width: 768px) {
  .work-content {
    padding: 0 0.375rem;
  }

  .work-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .work-cards-grid {
    max-width: none;
  }
}

/* ==========================================================================
   MOBILE/TABLET RESPONSIVE (Single Breakpoint)
   ========================================================================== */

@media (max-width: 1023px) {
  /* Layout changes */
  .section-container {
    max-width: 48rem;
    padding: 0 1rem;
  }

  .section-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .section-spacing-large {
    padding: 4rem 0;
  }

  /* Content changes */
  .section-content {
    order: 1;
    height: auto;
    display: block;
  }

  .section-text {
    flex: none;
    display: block;
    justify-content: initial;
  }

  .section-heading {
    font-size: 1.875rem;
    margin-bottom: 2rem;
  }

  .section-content-wrapper {
    order: 3;
    margin-top: 2rem;
  }

  /* Image changes */
  .section-image-container {
    order: 2;
    height: auto;
    width: 100%;
  }

  .section-image-wrapper {
    /* padding: 0 1rem; */
    height: auto;
  }

  .section-image-frame {
    border-radius: 0.5rem;
    min-height: 200px;
  }

  /* Grid changes */
  .tools-logos-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.2rem;
    padding: 0.5rem;
    height: auto;
    align-content: initial;
  }

  .tools-logo-item {
    padding: 0.125rem; /* Reduced from 0.2rem */
    min-height: 2.5rem; /* Smaller minimum height */
    aspect-ratio: 1; /* Maintain square ratio */
  }

  .tools-logo-image-container {
    height: 100%; /* Fill the container */
    width: 100%;
  }

  .tools-logo-image {
    max-width: 2rem; /* Reduced from 2.5rem */
    max-height: 2rem; /* Reduced from 2.5rem */
    width: 90%; /* Allow scaling within bounds */
    height: 90%; /* Allow scaling within bounds */
  }
  .tools-logo-name {
    display: none;
  }

  .partners-logos-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    padding: 0.5rem;
    height: auto;
    align-content: initial;
  }

  .partners-logo-item {
    padding: 1rem;
  }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

/* Fix markdown list overflow */
.markdown-content {
  max-width: 100%;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.markdown-content ul,
.markdown-content ol {
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding-right: 1rem;
}

.markdown-content li {
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  overflow: hidden;
}

.markdown-content p {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
}

.prose :where(h1):not(:where([class~="not-prose"] *)) {
  color: white !important;
}
