/**
 * Client Case Studies - Custom Section Stylesheet
 * Prefix: csx-
 * Plain HTML + CSS only
 */

/* ========================================================
   1. SECTION CONTAINER & BACKGROUND GLOWS
   ======================================================== */
.csx-section {
  position: relative;
  background-color: #ffffff;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding-top: 96px;
  padding-bottom: 96px;
  overflow: hidden;
  font-family: 'Poppins', sans-serif;
  isolation: isolate;
}

/* Faint blue radial glows in top-left and bottom-right corners */
.csx-section::before,
.csx-section::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.csx-section::before {
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle at 0% 0%, rgba(31, 95, 240, 0.08) 0%, transparent 70%);
}

.csx-section::after {
  bottom: 0;
  right: 0;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle at 100% 100%, rgba(31, 95, 240, 0.08) 0%, transparent 70%);
}

.csx-container {
  position: relative;
  z-index: 1;
  max-width: var(--container-max, 1240px);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding, 24px);
  padding-right: var(--container-padding, 24px);
  box-sizing: border-box;
}

/* ========================================================
   2. SECTION HEADER
   ======================================================== */
.csx-header {
  text-align: center;
  margin-bottom: 48px;
}

.csx-title-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.csx-line {
  display: inline-block;
  width: 72px;
  height: 3px;
  border-radius: 3px;
  background-color: #1f5ff0;
  flex-shrink: 0;
}

.csx-heading {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(2rem, 3.8vw, 3.4rem);
  font-weight: 800;
  color: #0a1a44;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.csx-heading-accent {
  color: #1f5ff0;
}

.csx-subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.35rem);
  color: #5b6579;
  font-weight: 500;
  margin: 0;
}

/* ========================================================
   3. GRID & ROWS (DESKTOP)
   ======================================================== */
.csx-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.csx-row {
  display: grid;
  gap: 18px;
  align-items: stretch;
}

.csx-row--top {
  grid-template-columns: 1.05fr 1fr 2.02fr;
}

.csx-row--bottom {
  grid-template-columns: 1.95fr 1.08fr 1.06fr;
}

/* ========================================================
   4. CARD BASE & BACKGROUND IMAGE LAYERING
   ======================================================== */
.csx-card {
  min-height: 340px;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 24px rgba(10, 26, 68, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  box-sizing: border-box;

  /* Narrow card layout: image spans FULL width and sits at bottom edge */
  background-image: var(--csx-img), var(--csx-gradient);
  background-repeat: no-repeat, no-repeat;
  background-size: 100% auto, cover;
  background-position: center bottom, center;
}

.csx-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 36px rgba(10, 26, 68, 0.16);
}

/* Wide card layout: photo on the right */
.csx-card--wide {
  background-position: right center, center;
  background-size: auto 100%, cover;
}

/* Full card link wrapper */
.csx-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  color: inherit;
  text-decoration: none;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

.csx-card-link:focus-visible {
  outline: 3px solid #1f5ff0;
  outline-offset: 3px;
}

.csx-card--wide .csx-card-link {
  flex-direction: row;
  align-items: stretch;
}

/* Card Body */
.csx-card-body {
  position: relative;
  z-index: 2;
  padding: 22px 20px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  box-sizing: border-box;
}

.csx-card--wide .csx-card-body {
  width: 48%;
  max-width: 48%;
  padding: 22px 24px 0;
}

/* ========================================================
   5. CARD THEMES & STYLES
   ======================================================== */
/* Dark Cards (Twist N Treat, ABC Garden Doctors City) */
.csx-card--dark {
  background-color: #0c2159;
  --csx-gradient: linear-gradient(160deg, #0c2159, #0a1a44);
}

.csx-card--dark .csx-card-title {
  color: #ffffff;
}

.csx-card--dark .csx-badge {
  background-color: #ffffff;
  color: #1447d4;
}

/* Royal-Blue Card (G Mark Appliances) */
.csx-card--gmark {
  background-color: #0a2a6b;
  --csx-gradient: linear-gradient(135deg, #0a2a6b, #164aa8);
}

.csx-card--gmark .csx-card-title {
  color: #ffffff;
}

.csx-card--gmark .csx-badge {
  background-color: #ffffff;
  color: #1447d4;
}

/* Light Cards (Ananda Readymade, Europe Study Centre, Aspirations Architects) */
.csx-card--light {
  background-color: #e6f2fe;
  --csx-gradient: linear-gradient(160deg, #e6f2fe, #c8e1fa);
}

.csx-card--light .csx-card-title {
  color: #0a1a44;
}

.csx-card--light .csx-badge {
  background-color: #1447d4;
  color: #ffffff;
}

/* ========================================================
   6. TYPOGRAPHY & ACCENTS
   ======================================================== */
.csx-badge {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(0.72rem, 0.85vw, 0.90rem);
  padding: 6px 14px;
  border-radius: 9999px;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(10, 26, 68, 0.08);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.csx-card-title {
  font-family: 'Poppins', sans-serif;
  line-height: 1.08;
  font-size: clamp(1.2rem, 1.85vw, 1.85rem);
  margin: 14px 0 0;
  letter-spacing: -0.01em;
}

.csx-card--wide .csx-card-title {
  font-size: clamp(1.5rem, 2.4vw, 2.5rem);
  line-height: 1.08;
}

.csx-accent-bar {
  display: block;
  width: 52px;
  height: 4px;
  border-radius: 4px;
  background-color: #1f5ff0;
  margin-top: 14px;
  flex-shrink: 0;
}

/* ========================================================
   7. CTA BUTTON
   ======================================================== */
.csx-cta-wrap {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 48px;
  gap: 12px;
}

.csx-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #1f5ff0 0%, #1243c8 100%);
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  padding: 14px 34px;
  border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(31, 95, 240, 0.32);
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: none;
}

.csx-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(31, 95, 240, 0.44);
  color: #ffffff;
}

.csx-cta-btn:focus-visible {
  outline: 3px solid #1f5ff0;
  outline-offset: 3px;
}

.csx-cta-btn svg {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.csx-cta-btn:hover svg {
  transform: translateX(4px);
}

.csx-cta-desc {
  font-family: 'Poppins', sans-serif;
  color: #5b6579;
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0;
}

/* ========================================================
   8. RESPONSIVE BREAKPOINTS
   ======================================================== */
/* Tablet (<= 1100px): 2 columns, wide cards span both */
@media (max-width: 1100px) {

  .csx-row--top,
  .csx-row--bottom {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .csx-card--wide {
    grid-column: 1 / -1;
  }
}

/* Tablet & Mobile Section Padding (<= 768px) */
@media (max-width: 768px) {
  .csx-section {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .csx-header {
    margin-bottom: 40px;
  }
}

/* Mobile (<= 680px): 1 column, all cards stack vertically */
@media (max-width: 680px) {
  .csx-grid {
    gap: 14px;
  }

  .csx-row--top,
  .csx-row--bottom {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .csx-card {
    min-height: 340px;
    border-radius: 22px;
    background-position: center bottom, center;
    background-size: 100% auto, cover;
  }

  .csx-card--wide {
    grid-column: auto;
    min-height: 400px;
    background-position: center bottom, center;
    background-size: 100% auto, cover;
  }

  .csx-card--wide .csx-card-link {
    flex-direction: column;
  }

  .csx-card-body,
  .csx-card--wide .csx-card-body {
    width: 100%;
    max-width: 100%;
    padding: 20px 20px 0;
  }

  .csx-card-title,
  .csx-card--wide .csx-card-title {
    font-size: clamp(1.3rem, 6vw, 1.8rem);
    line-height: 1.08;
  }

  .csx-badge {
    white-space: normal;
  }

  .csx-cta-btn {
    width: 100%;
    max-width: 100%;
    font-size: 1.05rem;
  }
}

/* Small Mobile (<= 480px) */
@media (max-width: 480px) {
  .csx-line {
    display: none;
  }

  .csx-title-wrap {
    display: block;
    text-align: center;
    gap: 0;
  }

  .csx-heading-accent {
    display: block;
  }
}

/* Extra Small Mobile (<= 390px) */
@media (max-width: 390px) {
  .csx-container {
    padding-left: var(--container-padding, 16px);
    padding-right: var(--container-padding, 16px);
  }
}

/* ========================================================
   9. PREFERS-REDUCED-MOTION SUPPORT
   ======================================================== */
@media (prefers-reduced-motion: reduce) {

  .csx-card,
  .csx-cta-btn,
  .csx-cta-btn svg {
    transition: none;
    transform: none;
  }

  .csx-card:hover,
  .csx-cta-btn:hover {
    transform: none;
  }

  .csx-cta-btn:hover svg {
    transform: none;
  }
}