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

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

/* Override with Catppuccin Mocha surface color */
.bg-primary-600 {
  background-color: #313244 !important; /* surface0 */
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

/* Navigation title styling - matches original behavior but synchronized */
.nav-title-logo-effect {
  color: #cdd6f4; /* text */
  background-color: #313244; /* surface0 */
  outline: none;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.nav-title {
  margin-top: 0;
  margin-left: 1.25rem;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
  color: #cdd6f4; /* text */
  display: flex;
  align-items: center;
  /* transition: color 1000ms ease-in-out; */
}

/* Navigation logo styling - matches original behavior */
.nav-logo {
  height: 2.25rem;
  width: 2.25rem;
  display: block;
  /* transition: opacity 1000ms ease-in-out; */
  /* Removed filter: invert(1) since network icon is already in brand color */
}

.nav-menu-item:hover,
.nav-menu-item:focus {
  color: #cdd6f4; /* text */
  background-color: #313244; /* surface0 */
  outline: none;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Navigation menu item styling - restores original behavior */
.nav-menu-item {
  padding: 0.5rem 1rem;
  margin-top: 0;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.5rem;
  color: #cdd6f4; /* text */
  display: flex;
  align-items: center;
}

.nav-menu-item:hover,
.nav-menu-item:focus {
  color: #cdd6f4; /* text */
  background-color: #313244; /* surface0 */
  outline: none;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Dropdown button styling - restores original behavior */
.nav-dropdown-button {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  padding: 0.5rem 1rem;
  margin-top: 0;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  background-color: transparent;
  border-radius: 0.5rem;
  color: #cdd6f4; /* text */
}

.nav-dropdown-button:hover,
.nav-dropdown-button:focus {
  color: #cdd6f4; /* text */
  background-color: #313244; /* surface0 */
  outline: none;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Mobile responsive adjustments */
@media (min-width: 768px) {
  .nav-menu-item,
  .nav-dropdown-button {
    width: auto;
    display: inline-flex;
    align-items: center;
    margin-top: 0;
    margin-left: 1rem;
  }
}

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

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

.hero-gradient-overlay {
  background: linear-gradient(
    135deg,
    rgba(203, 166, 247, 0.8) 0%,    /* mauve - #cba6f7 */
    rgba(180, 190, 254, 0.2) 20%,     /* lavender - #b4befe */
    rgba(0, 0, 0, 0.4) 50%,            /* dark base layer */
    rgba(245, 194, 231, 0.5) 100%,     /* pink - #f5c2e7 */
  );
}

.hero-title {
  margin-bottom: 0.5rem;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
  color: #cdd6f4;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.8));
}

.hero-subtitle {
  padding-bottom: 0.5rem;
  font-size: 1.875rem;
  font-weight: 400;
  color: #cdd6f4;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.8));
}

.hero-description {
  max-width: 48rem;
  margin: 0 auto 1.5rem;
  font-weight: 500;
  color: #cdd6f4;
  font-size: 2.5rem;
  /* text-shadow: 0 3px 8px rgba(0, 0, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.9); */
  text-wrap: balance;
}

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

/* Desktop defaults */
.section-container {
  max-width: 80rem;
  padding: 0 4rem; /* Ensure minimal margins on wide screens */
  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: #cdd6f4;
  text-wrap-style: balance;
  /* margin-bottom: 1.5rem; */
}

/* Standalone section headings (Services, About Me, etc.) */
.standalone-section-heading {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.05em;
  color: #cdd6f4;
  text-align: left;
  /* margin-bottom: 3rem; */
  text-wrap: balance;
}

.standalone-section-content {
  max-width: 4xl;
  margin: 0 auto;
  text-align: center;
}

.standalone-section-paragraph {
  font-size: 1.25rem;
  line-height: 1.75;
  color: #e5e7eb;
  margin-bottom: 2rem;
  text-wrap: balance;
}

.standalone-section-paragraph:last-child {
  margin-bottom: 0;
}

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

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

/* Paragraph styles */
.section-paragraph {
  font-size: 1.125rem;
  line-height: 1.75;
  color: #cdd6f4;
  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: #cdd6f4;
  padding: 0.5rem;
}

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

/* Images within section frames - ONLY for triplet sections, not partners/tools */
.section-image-frame:not(:has(.partners-logos-grid)):not(:has(.tools-logos-grid)) img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: block;
}

.section-image-frame:not(:has(.partners-logos-grid)):not(:has(.tools-logos-grid)):hover img {
  transform: scale(1.02);
}

.section-image-frame:not(:has(.partners-logos-grid)):not(:has(.tools-logos-grid)):hover {
  box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   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%;
  height: 100%;
  /* min-height: 10rem; */
  /* aspect-ratio: 1.5; */
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.tools-logo-item:hover {
  background: rgb(65, 74, 96);
  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 {
  transition: transform 0.3s ease;
}

.tools-logo-item:hover .tools-logo-image {
  transform: scale(1.02);
}

.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: background-color 0.3s ease, box-shadow 0.3s ease;
}

.partners-logo-item:hover {
  background-color: rgb(65, 74, 96);
  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 {
  transition: transform 0.3s ease;
}

.partners-logo-item:hover .partners-logo-image {
  transform: scale(1.02);
}

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

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

.work-section-wrapper {
  all: unset; /* Reset all styles */
  background-color: #1e1e2e; /* Explicitly redefine background color */
  width: 100vw; /* Explicitly redefine width */
  margin: 0; /* Explicitly redefine margin */
  padding: 0; /* Explicitly redefine padding */
  box-sizing: border-box; /* Explicitly redefine box-sizing */
  position: relative; /* Explicitly redefine position */
}

.work-section {
  position: relative;
  /* max-width: 80rem; Constrain content width */
  margin: 0 auto; /* Center content */
  /* padding: 6rem 2rem; Add spacing */
  /* background-color: transparent; */
}

.work-background {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  /* max-width: none; */
}

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

.work-container {
  position: relative;
}

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

.work-heading {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.05em;
  color: #8b5cf6;
  text-align: center;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

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

.work-content {
  /* margin: 0 auto; */
  color: #1e1e2e;
  /* max-width: 80rem; */
}

.work-cards-container {
  /* padding: 0 1rem; */
  color: #181825;
}

/* Posts template specific width constraint */
.posts-template .work-cards-container {
  max-width: 624px;
  margin: 0 auto;
}

.work-cards-grid {
  display: grid;
  gap: 1rem;
  margin: 3rem auto;
  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: #181825;
  transition: box-shadow 0.3s ease;
}

.work-card:hover {
  box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.25), 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.work-card-image {
  transition: transform 0.3s ease;
}

.work-card:hover .work-card-image {
  transform: scale(1.02);
}

.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: white;
  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: white;
}

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

.work-card-tags-label {
  font-weight: 900;
  flex-shrink: 0;
}

.work-card-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.5rem; /* vertical and horizontal gap */
  align-items: flex-start;
}

.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: #1e1e2e;
  transition-property: background-color, color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  text-decoration: none;
  white-space: nowrap;
}

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

.work-card-meta {
  display: flex;
  color: white;
  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: white;
}

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

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

/* Work card image container with consistent height */
.work-card-image-container {
  height: 16rem; /* 256px - increased height for better proportions */
  width: 100%;
  overflow: hidden;
  border-radius: 0.5rem 0.5rem 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #cdd6f4;
  aspect-ratio: 1.2;
}

.work-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

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

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

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

  .hero-title {
    font-size: 3.75rem;
  }

  .hero-subtitle {
    font-size: 3rem;
  }

  .hero-description {
    font-size: 1.125rem;
  }
}

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

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

  /* Work page specific 2-column layout */
  .posts-template .work-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .hero-title {
    font-size: 4.5rem;
  }

  .hero-description {
    font-size: 1.25rem;
  }
}

/* ==========================================================================
   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;
  }

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

  .standalone-section-paragraph {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
  }

  .hero-title {
    font-size: 3rem;
  }

  .hero-subtitle {
    font-size: 2.25rem;
  }

  .hero-description {
    font-size: 1.125rem;
  }

  .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;
  }

  .section-image-frame img {
    border-radius: 0.5rem;
  }

  /* 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;
  }
}

/* ==========================================================================
   GRID LAYOUTS
   ========================================================================== */

/* Simple direct image grid for Oxfam */
.oxfam-simple-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
  text-align: left;
  font-size: small;
}

@media (min-width: 768px) {
  .oxfam-simple-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

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

.oxfam-simple-grid img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  display: block;
  margin: 0;
  padding: 0;
  /* transition: transform 0.3s ease; */
}

.oxfam-simple-grid img:hover {
  transform: scale(1.02);
}

/* Reports grid styling for darkweb post */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
  text-align: center;
}

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

.reports-grid .report-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reports-grid img {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 0.75rem;
  box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.08);
  display: block;
  margin: 0 auto 1rem auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.reports-grid img:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -5px rgba(0, 0, 0, 0.15);
}

.reports-grid .report-caption {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #cdd6f4);
  margin-top: 0.5rem;
  text-align: center;
  line-height: 1.4;
}

.reports-grid a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.reports-grid a:hover .report-caption {
  color: var(--accent-primary, #8b5cf6);
  transition: color 0.3s ease;
}

/* Generic grid styling for image grids */
.grid img {
  width: 100%;
  height: auto;
  /* max-height: 4rem; */
  object-fit: fill;
  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);
  /* transition: all 0.3s ease; */
}

.grid img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.08);
}

.grid .rounded-lg {
  overflow: hidden;
  border-radius: 0.5rem;
}


/* ==========================================================================
   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;
}

/* Post content images styling */
.prose img,
.markdown-content img {
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  margin: 1.5rem 0;
}

/* Post content code blocks styling */
.prose pre,
.prose code,
.markdown-content pre,
.markdown-content code {
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.prose pre {
  margin: 1.5rem 0;
}

/* Custom syntax highlighting to match site theme */
/* Higher specificity to override Tailwind/other CSS */
.prose pre[class*="language-"],
.prose pre,
.markdown-content pre[class*="language-"],
.markdown-content pre {
  background-color: #1e1e2e !important; /* darker than main bg */
  color: #cdd6f4 !important;
  border: 1px solid #313244 !important;
}

.prose :not(pre) > code[class*="language-"],
.prose :not(pre) > code,
.markdown-content :not(pre) > code[class*="language-"],
.markdown-content :not(pre) > code {
  background-color: #313244 !important;
  color: #cdd6f4 !important;
  padding: 0.125rem 0.375rem !important;
  border-radius: 0.25rem !important;
  font-size: 0.875em !important;
}

.prose pre code,
.prose pre[class*="language-"] code[class*="language-"],
.markdown-content pre code,
.markdown-content pre[class*="language-"] code[class*="language-"] {
  background-color: transparent !important;
  color: inherit !important;
  padding: 0 !important;
}

/* More generic syntax highlighting for when Chroma classes aren't available */
.prose pre .token.keyword,
.prose pre .token.important,
.prose pre .token.function-name,
.markdown-content pre .token.keyword,
.markdown-content pre .token.important,
.markdown-content pre .token.function-name {
  color: #8b5cf6 !important; /* violet-500 */
  font-weight: 600 !important;
}

.prose pre .token.string,
.prose pre .token.template-string,
.markdown-content pre .token.string,
.markdown-content pre .token.template-string {
  color: #10b981 !important; /* emerald-500 */
}

.prose pre .token.number,
.markdown-content pre .token.number {
  color: #f59e0b !important; /* amber-500 */
}

.prose pre .token.comment,
.prose pre .token.prolog,
.prose pre .token.doctype,
.prose pre .token.cdata,
.markdown-content pre .token.comment,
.markdown-content pre .token.prolog,
.markdown-content pre .token.doctype,
.markdown-content pre .token.cdata {
  color: #9ca3af !important; /* gray-400 */
  font-style: italic !important;
}

.prose pre .token.function,
.markdown-content pre .token.function {
  color: #06b6d4 !important; /* cyan-500 */
}

.prose pre .token.class-name,
.markdown-content pre .token.class-name {
  color: #7c3aed !important; /* violet-600 */
  font-weight: 600 !important;
}

.prose pre .token.operator,
.prose pre .token.punctuation,
.markdown-content pre .token.operator,
.markdown-content pre .token.punctuation {
  color: #d1d5db !important; /* gray-300 */
}

/* Python-specific highlighting */
.prose pre .token.builtin,
.prose pre .token.boolean,
.markdown-content pre .token.builtin,
.markdown-content pre .token.boolean {
  color: #ec4899 !important; /* pink-500 */
}

/* Fallback for plain text in code blocks */
.prose pre,
.prose pre code,
.markdown-content pre,
.markdown-content pre code {
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
}

/* ==========================================================================
   FEATURED IMAGE CAPTION
   ========================================================================== */

.featured-image-caption {
  margin-top: 0.5rem;
  text-align: left;
}

.featured-image-caption p {
  font-size: 0.875rem;
  color: #6c7086;
  font-style: italic;
  margin: 0;
  line-height: 1.4;
}

.dark .featured-image-caption p {
  color: #9ca3af;
}

/* ==========================================================================
   POST AUTHOR SECTION
   ========================================================================== */

.post-author-container {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1rem;
  padding-top: 1.5rem;
}

.post-author-card {
  display: flex;
  align-items: center;
  padding: 1rem 0.5rem;
  /* background-color: #f9fafb; */
  border-radius: 0.5rem;
  /* color: #1e1e2e; */
}

.dark .post-author-card {
  /* background-color: #1e1e2e; */
  /* color: #1e1e2e; */
}

.post-author-avatar {
  flex-shrink: 0;
}

.post-author-avatar img {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

.post-author-info {
  margin-left: 1rem;
  flex: 1;
  text-align: right;
}

.post-author-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e1e2e;
  margin: 0;
}

.dark .post-author-name {
  color: #ffffff;
}

.post-author-meta {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: #6c7086;
  margin-top: 0.25rem;
}

.dark .post-author-meta {
  color: #9ca3af;
}

/* ==========================================================================
   RELATED ARTICLES SECTION
   ========================================================================== */

.related-articles-container {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.dark .related-articles-container {
  border-top-color: #313244;
}

.related-articles-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e1e2e;
  margin-bottom: 1.5rem;
}

.dark .related-articles-heading {
  color: #ffffff;
}

.related-articles-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.related-article-item {
  display: flex;
  gap: 1rem;
}

.related-article-image {
  flex-shrink: 0;
}

.related-article-image img {
  /* width: 5rem; */
  height: 6rem;
  object-fit: cover;
  border-radius: 0.5rem;
}

.related-article-content {
  flex: 1;
  min-width: 0;
}

.related-article-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: #1e1e2e;
  margin: 0 0 0.25rem 0;
}

.dark .related-article-title {
  color: #ffffff;
}

.related-article-title a {
  text-decoration: none;
  color: inherit;
}

.related-article-title a:hover {
  color: #7c3aed;
}

.dark .related-article-title a:hover {
  color: #a855f7;
}

.related-article-summary {
  font-size: 0.875rem;
  color: #6c7086;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dark .related-article-summary {
  color: #9ca3af;
}

.related-article-meta {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #6c7086;
}

.dark .related-article-meta {
  color: #9ca3af;
}

/* ==========================================================================
   RESPONSIVE IFRAME CONTAINERS
   ========================================================================== */

/* Responsive iframe wrapper and container for charts and embedded content */
.responsive-iframe-wrapper {
  margin: 1.5rem 0;
  border-radius: 0.5rem;
  overflow: hidden; /* This ensures content respects rounded corners */
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  /* Force hardware acceleration for better clipping */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  position: relative;
}

.responsive-iframe-container {
  position: relative;
  width: 100%;
  height: 0;
  border-radius: 0.5rem; /* Apply border radius here too */
  overflow: hidden; /* Double-ensure clipping happens */
  /* padding-bottom is set inline via the shortcode for aspect ratio */
}

.responsive-iframe-container iframe {
  position: absolute;
  top: -1%;
  left: -1%;
  width: 102%;
  height: 102%;
  border: 0;
  display: block; /* Ensure it's a block element */
  /* Scale up to eliminate margins and fill rounded corners */
  transform: scale(1.03);
  transform-origin: center center;
}

/* Dark mode adjustments for iframe containers */
.dark .responsive-iframe-wrapper {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Mobile responsive adjustments for iframe containers */
@media (max-width: 640px) {
  .responsive-iframe-wrapper {
    margin: 1rem -1rem; /* Extend to screen edges on mobile */
    border-radius: 0;
  }
  
  .responsive-iframe-wrapper .responsive-iframe-container {
    border-radius: 0; /* Remove border radius on mobile when extending to edges */
  }
  
  .responsive-iframe-wrapper .responsive-iframe-container iframe {
    transform: scale(1.03); /* Less aggressive scaling on mobile */
    top: -1%;
    left: -1%;
    width: 102%;
    height: 102%;
  }
}

/* ==========================================================================
   RESPONSIVE CHART VISIBILITY
   ========================================================================== */

/* Show desktop charts on larger screens, hide mobile charts */
.responsive-chart-desktop {
  display: block;
}

.responsive-chart-mobile {
  display: none;
}

/* On mobile/tablet, hide desktop charts and show mobile charts */
@media (max-width: 768px) {
  .responsive-chart-desktop {
    display: none;
  }
  
  .responsive-chart-mobile {
    display: block;
  }
}

/* ==========================================================================
   KEY FINDINGS CALLOUT
   ========================================================================== */

.key-findings {
  background-color: rgba(139, 92, 246, 0.08);
  border-left: 4px solid rgba(139, 92, 246, 0.4);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  border-radius: 0.5rem;
}

.dark .key-findings {
  background-color: rgba(139, 92, 246, 0.12);
  border-left-color: rgba(139, 92, 246, 0.6);
}

/* Mobile adjustments for key findings */
@media (max-width: 640px) {
  .key-findings {
    padding: 1rem 1.25rem;
    margin: 1.5rem -1rem;
    border-radius: 0;
  }
}

/* ==========================================================================
   BLOCKQUOTE CUSTOMIZATION
   ========================================================================== */

/* Remove quotation marks from blockquotes */
.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *))::before {
  content: "" !important;
}

.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *))::after {
  content: "" !important;
}

/* ==========================================================================
   HEADING SPACING
   ========================================================================== */

/* Adjust heading spacing to have more space before than after */
.prose h1 {
  margin-top: 1em !important;
  margin-bottom: 0.5em !important;
}

.prose h2 {
  margin-top: 1em !important;
  margin-bottom: 0.75em !important;
}

.prose h3 {
  margin-top: 1em !important;
  margin-bottom: 0.5em !important;
}

.prose h4 {
  margin-top: 1em !important;
  margin-bottom: 0.5em !important;
}
