/* =========================================================
   TECHROCK — SECTION 4: BLOGS — START
   Section-specific styles only. Global brand variables,
   typography and container rules are reused from variables.css,
   typography.css and utilities.css.
   ========================================================= */

.section-4-blogs {
  width: 100%;
  padding-block: clamp(80px, 8vw, 128px);
  background: var(--color-white);
  overflow: hidden;
}

.section-4-container {
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--page-padding-desktop);
}

.section-4-header {
  max-width: 900px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.section-4-eyebrow {
  margin: 0 0 18px;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: var(--font-semibold);
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-secondary-text);
}

.section-4-title {
  margin: 0;
  font-family: var(--font-primary);
  font-size: clamp(44px, 4.2vw, 64px);
  font-weight: var(--font-bold);
  line-height: 1.05;
  letter-spacing: -0.045em;
  color: var(--color-primary-text);
}

.section-4-title span {
  color: var(--color-primary-purple);
}

.section-4-description {
  max-width: 800px;
  margin: 20px 0 0;
  font-family: var(--font-primary);
  font-size: clamp(16px, 1.3vw, 18px);
  font-weight: var(--font-regular);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--color-secondary-text);
}

.section-4-blog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.section-4-blog-card {
  min-width: 0;
  height: 450px;
  overflow: hidden;
  border-radius: var(--radius-small);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.section-4-blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.section-4-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.section-4-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  background: var(--color-light-gray);
}

.section-4-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: none;
  transition: transform var(--transition-slow);
}

.section-4-blog-card:hover .section-4-card-image img {
  transform: scale(1.035);
}

.section-4-card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  height: auto;
  padding: 20px 24px 20px;
}

.section-4-card-light .section-4-card-content {
  background: var(--color-light-gray);
  color: var(--color-primary-text);
}

.section-4-card-dark .section-4-card-content {
  background: var(--color-black);
  color: var(--color-white);
}

.section-4-card-category {
  flex-shrink: 0;
  margin: 0 0 11px;
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: var(--font-semibold);
  line-height: 1.3;
  letter-spacing: 0.20em;
  text-transform: uppercase;
}

.section-4-card-category::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin-bottom: 9px;
  background: var(--color-primary-purple);
}

.section-4-card-title {
  flex-shrink: 0;
  margin: 0;
  font-family: var(--font-primary);
  font-size: clamp(21px, 1.55vw, 25px);
  font-weight: var(--font-bold);
  line-height: 1.12;
  letter-spacing: -0.035em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.section-4-card-description {
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 8px 0 0;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: var(--font-regular);
  line-height: 1.38;
  letter-spacing: -0.01em;
}

.section-4-card-light .section-4-card-description {
  color: var(--color-secondary-text);
}

.section-4-card-dark .section-4-card-description {
  color: var(--color-light-gray);
}

.section-4-read-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
  padding-top: 14px;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: var(--font-semibold);
  line-height: 1.2;
}

.section-4-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 21px;
  font-weight: var(--font-regular);
  line-height: 1;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.section-4-blog-card:hover .section-4-arrow {
  transform: translateX(4px);
}

@media (max-width: 1100px) {
  .section-4-container {
    padding-inline: var(--page-padding-tablet);
  }

  .section-4-blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .section-4-blogs {
    padding-block: 70px;
  }

  .section-4-container {
    padding-inline: var(--page-padding-mobile);
  }

  .section-4-header {
    margin-bottom: 38px;
  }

  .section-4-title {
    font-size: clamp(36px, 11vw, 52px);
  }

  .section-4-description {
    font-size: 16px;
  }

  .section-4-blog-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    margin-inline: calc(var(--page-padding-mobile) * -1);
    padding-inline: var(--page-padding-mobile);
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--page-padding-mobile);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(94, 23, 235, 0.45) transparent;
  }

  .section-4-blog-grid::-webkit-scrollbar {
    height: 4px;
  }

  .section-4-blog-grid::-webkit-scrollbar-thumb {
    background: rgba(94, 23, 235, 0.45);
    border-radius: 999px;
  }

  .section-4-blog-card {
    height: auto;
    flex: 0 0 min(86vw, 360px);
    width: min(86vw, 360px);
    scroll-snap-align: start;
  }

  .section-4-card-content {
    height: 270px;
    min-height: 0;
    padding: 20px 22px 20px;
  }

  /* Slightly stronger mobile front-card typography so the content
     fills the card more naturally without changing the card frame. */
  .section-4-card-category {
    font-size: clamp(12px, 3.5vw, 14px);
    margin-bottom: 12px;
    letter-spacing: 0.19em;
  }

  .section-4-card-title {
    font-size: clamp(23px, 6.3vw, 27px);
    line-height: 1.1;
  }

  .section-4-card-description {
    margin-top: 9px;
    font-size: clamp(16.5px, 4.5vw, 18px);
    line-height: 1.4;
  }

  .section-4-read-more {
    font-size: clamp(16px, 4.4vw, 18px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .section-4-blog-card,
  .section-4-card-image img,
  .section-4-arrow {
    transition: none;
  }

  .section-4-blog-card:hover {
    transform: none;
  }

  .section-4-blog-card:hover .section-4-card-image img {
    transform: none;
  }
}

/* =========================================================
   TECHROCK — SECTION 4: BLOGS — END
   ========================================================= */

/* =========================================================
   SECTION 4 — HOVER REVEAL
   Preserves the existing card design; the hover layer replaces
   the card visually with the editorial text-only treatment.
   ========================================================= */

.section-4-card-stage {
  position: relative;
  min-width: 0;
  height: 450px;
  overflow: hidden;
  border-radius: var(--radius-small);
}

.section-4-card-stage .section-4-blog-card {
  position: relative;
  z-index: 2;
  height: 100%;
  transition: transform 560ms cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity 560ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.section-4-card-stage:hover .section-4-blog-card {
  transform: translateX(-105%);
  opacity: 0;
  box-shadow: none;
}

.section-4-hover-card {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  border-radius: var(--radius-small);
  transform: translateX(105%);
  transition: transform 560ms cubic-bezier(0.22, 0.61, 0.36, 1);
  pointer-events: none;
}

.section-4-card-stage:hover .section-4-hover-card {
  transform: translateX(0);
  pointer-events: auto;
}

.section-4-card-light + .section-4-hover-card {
  background: var(--color-light-gray);
  color: var(--color-primary-text);
}

.section-4-card-dark + .section-4-hover-card {
  background: var(--color-black);
  color: var(--color-white);
}

.section-4-hover-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: clamp(28px, 3vw, 52px);
  color: inherit;
  text-decoration: none;
}

.section-4-hover-category {
  position: relative;
  margin: 0;
  padding-top: 22px;
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: var(--font-semibold);
  line-height: 1.3;
  letter-spacing: 0.20em;
  text-transform: uppercase;
}

.section-4-hover-category::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 2px;
  background: var(--color-primary-purple);
}

.section-4-hover-description {
  max-width: 100%;
  margin: clamp(42px, 4vw, 58px) 0 0;
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: var(--font-regular);
  line-height: 1.5;
  letter-spacing: -0.012em;
  color: inherit;
}

.section-4-hover-read-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
  padding-top: 24px;
  font-family: var(--font-primary);
  font-size: 18px;
  font-weight: var(--font-semibold);
  line-height: 1.2;
}

.section-4-hover-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  font-size: 32px;
  font-weight: var(--font-regular);
  line-height: 1;
}

.section-4-arrow {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  font-size: 24px;
}

@media (max-width: 640px) {
  .section-4-card-stage {
    /* Give every mobile card one shared vertical frame so the front
       and transition states can never have different heights. */
    height: 540px;
    min-height: 540px;
    flex: 0 0 min(86vw, 360px);
    width: min(86vw, 360px);
    max-width: min(86vw, 360px);
    min-width: 0;
    align-self: flex-start;
    box-sizing: border-box;
    scroll-snap-align: start;
  }

  /* Keep the front card and the revealed card locked to the exact
     same mobile stage dimensions. */
  .section-4-card-stage .section-4-blog-card,
  .section-4-card-stage .section-4-hover-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .section-4-card-stage .section-4-blog-card {
    height: 100%;
    min-height: 0;
  }

  .section-4-hover-card {
    right: 0;
    left: 0;
    height: 100%;
  }

  .section-4-hover-link {
    width: 100%;
    max-width: 100%;
    height: 100%;
    box-sizing: border-box;
  }

  .section-4-card-content {
    height: auto;
    min-height: 0;
    flex: 1 1 auto;
  }

  .section-4-hover-link {
    padding: 28px 24px;
  }

  .section-4-hover-description {
    margin-top: 34px;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -0.01em;
  }

  .section-4-hover-read-more {
    font-size: 16px;
  }

  .section-4-hover-arrow {
    font-size: 29px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .section-4-card-stage .section-4-blog-card,
  .section-4-hover-card {
    transition: none;
  }
}

/* =========================================================
   SECTION 4 — CLICK/TAP REVEAL
   Mirrors the hover transition for touch devices and keeps the
   existing front-card design unchanged.
   ========================================================= */
.section-4-card-stage.is-active .section-4-blog-card {
  transform: translateX(-105%);
  opacity: 0;
  box-shadow: none;
}

.section-4-card-stage.is-active .section-4-hover-card {
  transform: translateX(0);
  pointer-events: auto;
}

.section-4-card-stage.is-active .section-4-blog-card .section-4-card-link {
  pointer-events: none;
}

@media (max-width: 640px) {
  .section-4-card-stage.is-active .section-4-blog-card {
    transform: translateX(-105%);
  }
}

/* =========================================================
   SECTION 4 — RESPONSIVE EDITORIAL CONTENT BALANCE
   Gives the transition cards enough editorial copy to feel
   intentionally filled while scaling typography with the card
   width so text remains inside the shared mobile frame.
   ========================================================= */
.section-4-hover-description {
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.48;
}

@media (max-width: 1100px) {
  .section-4-hover-description {
    font-size: clamp(15px, 1.55vw, 17px);
  }
}

@media (max-width: 640px) {
  .section-4-hover-link {
    padding: 28px 24px 26px;
  }

  .section-4-hover-category {
    font-size: clamp(10px, 3.2vw, 12px);
    letter-spacing: 0.18em;
    padding-top: 20px;
  }

  .section-4-hover-description {
    margin-top: clamp(28px, 8vw, 36px);
    font-size: clamp(14px, 4.2vw, 16px);
    line-height: 1.48;
    letter-spacing: -0.012em;
    max-width: 100%;
  }

  .section-4-hover-read-more {
    font-size: clamp(14px, 4.2vw, 16px);
    padding-top: 22px;
  }

  .section-4-hover-arrow {
    font-size: clamp(26px, 7vw, 30px);
  }
}

/* =========================================================
   SECTION 4 — DESKTOP / TABLET EDITORIAL SCALE
   Mobile sizing above is intentionally preserved. Larger screens
   use a tighter editorial scale so the longer transition copy
   remains comfortably inside the 450px card frame.
   ========================================================= */
@media (min-width: 641px) {
  .section-4-hover-link {
    --hover-card-pad: clamp(26px, 2.45vw, 40px);
    position: relative;
    padding: var(--hover-card-pad);
  }

  .section-4-hover-category {
    font-size: clamp(8.5px, 0.60vw, 10.5px);
    padding-top: 18px;
    letter-spacing: 0.19em;
  }

  .section-4-hover-description {
    margin-top: clamp(30px, 2.5vw, 39px);
    font-size: clamp(11.5px, 0.70vw, 13.5px);
    line-height: 1.5;
    letter-spacing: -0.008em;
  }

  /* Keep Read More at one identical vertical position on every
     desktop/laptop transition card, regardless of copy length. */
  .section-4-hover-read-more {
    position: absolute;
    left: var(--hover-card-pad);
    right: var(--hover-card-pad);
    bottom: var(--hover-card-pad);
    width: auto;
    margin: 0;
    padding-top: 0;
    flex-shrink: 0;
    font-size: clamp(13px, 0.82vw, 15px);
  }

  .section-4-hover-arrow {
    font-size: clamp(24px, 1.45vw, 27px);
  }
}

@media (min-width: 641px) and (max-width: 1100px) {
  .section-4-hover-description {
    font-size: clamp(11.5px, 1.08vw, 13.5px);
  }
}

@media (max-width: 640px) {
  /* Mobile keeps the v51 typography/content treatment, but the CTA
     is also locked to one shared bottom position across all cards. */
  .section-4-hover-link {
    position: relative;
    --hover-card-pad-x: 24px;
    --hover-card-pad-bottom: 26px;
  }

  .section-4-hover-read-more {
    position: absolute;
    left: var(--hover-card-pad-x);
    right: var(--hover-card-pad-x);
    bottom: var(--hover-card-pad-bottom);
    width: auto;
    margin: 0;
    padding-top: 0;
    flex-shrink: 0;
  }
}
