/* ═══════════════════════════════════════════════════════
   Remote Hive — Services Section
   Sea Blue & Sea Green Palette | WordPress Compatible
   Class convention: rh-services-*
   ═══════════════════════════════════════════════════════ */

.rh-services-section *,
.rh-services-section *::before,
.rh-services-section *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.rh-services-section {
  padding: 100px 40px 100px;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  font-family: 'Sora', sans-serif;
}

/* Grid lines overlay */
.rh-services-gridlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(8,145,178,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(8,145,178,0.04) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ─── SPOTLIGHT ─── */
.rh-services-spotlight-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.rh-services-spotlight-1,
.rh-services-spotlight-2,
.rh-services-spotlight-3 {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.rh-services-spotlight-1 {
  width: 600px;
  height: 600px;
  top: -10%;
  left: -5%;
  background: radial-gradient(circle, rgba(0,119,182,0.12) 0%, transparent 70%);
  filter: blur(40px);
}

.rh-services-spotlight-2 {
  width: 500px;
  height: 500px;
  top: 30%;
  right: -8%;
  background: radial-gradient(circle, rgba(26,188,156,0.10) 0%, transparent 70%);
  filter: blur(40px);
}

.rh-services-spotlight-3 {
  width: 450px;
  height: 450px;
  bottom: -10%;
  left: 30%;
  background: radial-gradient(circle, rgba(8,145,178,0.10) 0%, transparent 70%);
  filter: blur(50px);
}

/* ─── 3D CUBE BACKGROUND ─── */
.rh-services-cube-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.07;
}

.rh-services-cube-spinner {
  width: 100%;
  height: 100%;
  --clr: rgb(8, 145, 178);
  --clr-alpha: rgba(8, 145, 178, 0.08);
  animation: rh-services-cube-spin 25s infinite linear;
  transform-style: preserve-3d;
}

.rh-services-cube-spinner > div {
  background-color: var(--clr-alpha);
  height: 100%;
  position: absolute;
  width: 100%;
  border: 5px solid var(--clr);
}

.rh-services-cube-spinner div:nth-of-type(1) {
  transform: translateZ(-250px) rotateY(180deg);
}
.rh-services-cube-spinner div:nth-of-type(2) {
  transform: rotateY(-270deg) translateX(50%);
  transform-origin: top right;
}
.rh-services-cube-spinner div:nth-of-type(3) {
  transform: rotateY(270deg) translateX(-50%);
  transform-origin: center left;
}
.rh-services-cube-spinner div:nth-of-type(4) {
  transform: rotateX(90deg) translateY(-50%);
  transform-origin: top center;
}
.rh-services-cube-spinner div:nth-of-type(5) {
  transform: rotateX(-90deg) translateY(50%);
  transform-origin: bottom center;
}
.rh-services-cube-spinner div:nth-of-type(6) {
  transform: translateZ(250px);
}

@keyframes rh-services-cube-spin {
  0%   { transform: rotate(0deg) rotateX(0deg) rotateY(0deg); }
  50%  { transform: rotate(180deg) rotateX(180deg) rotateY(180deg); }
  100% { transform: rotate(360deg) rotateX(360deg) rotateY(360deg); }
}

/* ─── HEADING ─── */
.rh-services-heading {
  text-align: center;
  margin-bottom: 70px;
  position: relative;
  z-index: 2;
}

.rh-services-heading h2 {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.rh-services-heading h2 .rh-services-static-text {
  display: block;
  margin-bottom: 6px;
}

/* ─── MORPHING TEXT ─── */
.rh-services-morph-container {
  position: relative;
  display: block;
  width: 100%;
  height: 1.3em;
  overflow: hidden;
}

.rh-services-morph-text {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  font-weight: 800;
  opacity: 1;
  filter: blur(0px);
  transition: none;
  background: linear-gradient(135deg, #5cb8c4, #7ecfc0, #6fbad4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  max-width: 100%;
}

.rh-services-morph-text.rh-services-morphing-out {
  animation: rh-services-morphOut 0.35s ease-in forwards;
}
.rh-services-morph-text.rh-services-morphing-in {
  animation: rh-services-morphIn 0.35s ease-out forwards;
}

@keyframes rh-services-morphOut {
  0%   { filter: blur(0px); opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { filter: blur(10px); opacity: 0; transform: translateX(-50%) translateY(-6px) scale(0.97); }
}
@keyframes rh-services-morphIn {
  0%   { filter: blur(10px); opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.97); }
  100% { filter: blur(0px); opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.rh-services-subtitle {
  color: #64748b;
  font-size: 16px;
  margin-top: 22px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.75;
  font-weight: 400;
}

/* ─── CUSTOM GRID: 2 — 3 — 1 ─── */
.rh-services-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* Row 1 → 2 cards (span 3 each) */
.rh-services-card-wrap:nth-child(1),
.rh-services-card-wrap:nth-child(2) { grid-column: span 3; }

/* Row 2 → 3 cards (span 2 each) */
.rh-services-card-wrap:nth-child(3),
.rh-services-card-wrap:nth-child(4),
.rh-services-card-wrap:nth-child(5) { grid-column: span 2; }

/* Row 3 → 1 card (full width) */
.rh-services-card-wrap:nth-child(6) { grid-column: 1 / -1; }

/* ─── CARD WRAP ─── */
.rh-services-card-wrap {
  width: 100%;
  height: 330px;
  perspective: 1000px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Row 1 (2 cards) — taller */
.rh-services-card-wrap:nth-child(1),
.rh-services-card-wrap:nth-child(2) {
  height: 340px;
}

/* Row 2 (3 cards) — standard */
.rh-services-card-wrap:nth-child(3),
.rh-services-card-wrap:nth-child(4),
.rh-services-card-wrap:nth-child(5) {
  height: 320px;
}

/* Row 3 (1 card) — short & wide banner */
.rh-services-card-wrap:nth-child(6) {
  height: 260px;
}

.rh-services-card-wrap.rh-services-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hidden by default (row 3 / card 6) — toggled via JS */
.rh-services-card-wrap.rh-services-hidden {
  display: none;
}
.rh-services-card-wrap.rh-services-hidden.rh-services-show-all {
  display: block;
}

/* ─── CARD ─── */
.rh-services-card {
  height: 100%;
  border-radius: 36px;
  transition: all 0.5s ease-in-out;
  transform-style: preserve-3d;
  position: relative;
  z-index: 1;
  cursor: pointer;
  text-decoration: none;
  display: block;
  box-shadow: 0px 20px 40px -12px var(--shadow-base);
}

/* ═══ 6 UNIQUE SEA PALETTES ═══ */
.rh-services-card[data-theme="sea-1"] {
  background: linear-gradient(135deg, #0d9488 0%, #2dd4bf 100%);
  --shadow-base: rgba(13,148,136,0.40);
  --shadow-hover: rgba(13,148,136,0.20);
}
.rh-services-card[data-theme="sea-2"] {
  background: linear-gradient(135deg, #0369a1 0%, #22d3ee 100%);
  --shadow-base: rgba(3,105,161,0.40);
  --shadow-hover: rgba(3,105,161,0.20);
}
.rh-services-card[data-theme="sea-3"] {
  background: linear-gradient(135deg, #1e3a5f 0%, #0891b2 100%);
  --shadow-base: rgba(30,58,95,0.45);
  --shadow-hover: rgba(30,58,95,0.20);
}
.rh-services-card[data-theme="sea-4"] {
  background: linear-gradient(135deg, #065f46 0%, #34d399 100%);
  --shadow-base: rgba(6,95,70,0.40);
  --shadow-hover: rgba(6,95,70,0.20);
}
.rh-services-card[data-theme="sea-5"] {
  background: linear-gradient(135deg, #0c4a6e 0%, #06d6a0 100%);
  --shadow-base: rgba(12,74,110,0.45);
  --shadow-hover: rgba(12,74,110,0.20);
}
.rh-services-card[data-theme="sea-6"] {
  background: linear-gradient(135deg, #134e4a 0%, #5eead4 100%);
  --shadow-base: rgba(19,78,74,0.45);
  --shadow-hover: rgba(19,78,74,0.20);
}

/* ─── GLASS ─── */
.rh-services-glass {
  transform-style: preserve-3d;
  position: absolute;
  inset: 8px;
  border-radius: 42px;
  border-top-right-radius: 100%;
  background: linear-gradient(0deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.72) 100%);
  transform: translate3d(0px, 0px, 25px);
  border-left: 1px solid rgba(255,255,255,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.5);
  transition: all 0.5s ease-in-out;
}

/* ─── CONTENT ─── */
.rh-services-card-content {
  padding: 40px 45px 0px 28px;
  transform: translate3d(0, 0, 26px);
  position: relative;
  z-index: 10;
}

/* Row 3 single card — horizontal layout */
.rh-services-card-wrap:nth-child(6) .rh-services-card-content {
  padding: 45px 220px 0px 35px;
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

.rh-services-card-wrap:nth-child(6) .rh-services-card-icon {
  flex-shrink: 0;
}

.rh-services-card-wrap:nth-child(6) .rh-services-card-textwrap {
  flex: 1;
}

.rh-services-card-wrap:nth-child(6) .rh-services-card-title {
  font-size: 22px;
}

.rh-services-card-wrap:nth-child(6) .rh-services-card-text {
  font-size: 14px;
  max-width: 480px;
}

/* ── ICON ── */
.rh-services-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: rgba(255,255,255,0.30);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-bottom: 18px;
  transform: translate3d(0, 0, 55px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.14), inset 0 1px 0 rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.35);
  transition: transform 0.5s ease-in-out, box-shadow 0.5s ease-in-out;
}

.rh-services-card-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

/* icon pops forward on hover */
.rh-services-card-wrap:hover .rh-services-card-icon {
  transform: translate3d(0, 0, 90px);
  box-shadow: 0 18px 45px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.5);
}

.rh-services-card-title {
  display: block;
  color: #ffffff;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.3;
  font-family: 'Sora', sans-serif;
}

.rh-services-card-text {
  display: block;
  color: rgba(255,255,255,0.82);
  font-size: 13px;
  margin-top: 10px;
  line-height: 1.6;
  font-family: 'Sora', sans-serif;
}

/* ─── LEARN MORE ─── */
.rh-services-card-bottom {
  transform-style: preserve-3d;
  position: absolute;
  bottom: 22px;
  left: 24px;
  right: 24px;
  transform: translate3d(0, 0, 26px);
  z-index: 10;
}

.rh-services-learnmore {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 50px;
  background: rgba(255,255,255,0.92);
  color: #0f172a;
  font-weight: 700;
  font-size: 13px;
  font-family: 'Sora', sans-serif;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 18px rgba(0,0,0,0.12);
  text-decoration: none;
}

.rh-services-learnmore:hover {
  background: #ffffff;
  transform: translate3d(0, -2px, 15px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.rh-services-learnmore svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s ease;
}
.rh-services-learnmore:hover svg {
  transform: translateX(3px);
}

/* ─── BADGE (top-right circle icon) ─── */
.rh-services-badge {
  position: absolute;
  right: 0;
  top: 0;
  transform-style: preserve-3d;
  z-index: 5;
}

.rh-services-circle-icon {
  display: grid;
  place-content: center;
  position: absolute;
  width: 38px;
  height: 38px;
  aspect-ratio: 1;
  border-radius: 50%;
  top: 18px;
  right: 18px;
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.10);
  border: 1px solid rgba(255,255,255,0.25);
  transform: translate3d(0,0,40px);
  transition: all 0.5s ease-in-out;
}

.rh-services-circle-icon svg {
  width: 16px;
  height: 16px;
  fill: white;
  stroke: none;
}

/* ─── HOVER ─── */
.rh-services-card-wrap:hover .rh-services-card {
  transform: rotate3d(1, 1, 0, 30deg);
  box-shadow:
    var(--shadow-hover) 30px 50px 25px -40px,
    var(--shadow-hover) 0px 25px 30px 0px;
}

.rh-services-card-wrap:hover .rh-services-circle-icon {
  transform: translate3d(0,0,70px);
}

/* circle tinted on hover */
.rh-services-card-wrap:hover .rh-services-card[data-theme="sea-1"] .rh-services-circle-icon { background: rgba(13,148,136,0.5); }
.rh-services-card-wrap:hover .rh-services-card[data-theme="sea-2"] .rh-services-circle-icon { background: rgba(3,105,161,0.5); }
.rh-services-card-wrap:hover .rh-services-card[data-theme="sea-3"] .rh-services-circle-icon { background: rgba(30,58,95,0.55); }
.rh-services-card-wrap:hover .rh-services-card[data-theme="sea-4"] .rh-services-circle-icon { background: rgba(6,95,70,0.5); }
.rh-services-card-wrap:hover .rh-services-card[data-theme="sea-5"] .rh-services-circle-icon { background: rgba(12,74,110,0.55); }
.rh-services-card-wrap:hover .rh-services-card[data-theme="sea-6"] .rh-services-circle-icon { background: rgba(19,78,74,0.55); }

/* ─── VIEW ALL ─── */
.rh-services-viewall-wrap {
  text-align: center;
  margin-top: 60px;
  position: relative;
  z-index: 2;
}

.rh-services-viewall-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 40px;
  border-radius: 60px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.35s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.rh-services-viewall-btn:hover {
  border-color: #0891b2;
  color: #0891b2;
  background: #ffffff;
  box-shadow: 0 8px 25px rgba(8,145,178,0.1);
  transform: translateY(-2px);
}
.rh-services-viewall-btn:focus {
  outline: none;
  border-color: #0891b2;
}
.rh-services-viewall-btn:active {
  border-color: #06d6a0;
  color: #059669;
}
.rh-services-viewall-btn svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.35s ease;
}
.rh-services-viewall-btn.rh-services-expanded svg {
  transform: rotate(180deg);
}

/* ─── RESPONSIVE ─── */

/* ── Laptop: 1024px - 1279px ── */
@media (max-width: 1279px) and (min-width: 1024px) {
  .rh-services-heading h2 {
    font-size: 42px;
  }
  .rh-services-subtitle {
    font-size: 16px;
  }
  .rh-services-card-title {
    font-size: 17px;
  }
}

@media (max-width: 1024px) {
  .rh-services-grid { gap: 24px; }
  .rh-services-cube-wrap { width: 400px; height: 400px; }
  .rh-services-cube-spinner div:nth-of-type(1) { transform: translateZ(-200px) rotateY(180deg); }
  .rh-services-cube-spinner div:nth-of-type(6) { transform: translateZ(200px); }
}

@media (max-width: 900px) {
  .rh-services-grid { grid-template-columns: repeat(2, 1fr); }
  .rh-services-card-wrap:nth-child(n) { grid-column: span 1; height: 320px; }
  .rh-services-card-wrap:nth-child(6) { grid-column: span 1; height: 320px; }
  .rh-services-card-wrap:nth-child(6) .rh-services-card-content {
    padding: 40px 45px 0px 28px;
    display: block;
  }
  .rh-services-card-wrap:nth-child(6) .rh-services-card-title { font-size: 18px; }
  .rh-services-card-wrap:nth-child(6) .rh-services-card-text { font-size: 13px; }
  .rh-services-cube-wrap { width: 350px; height: 350px; }
  .rh-services-cube-spinner div:nth-of-type(1) { transform: translateZ(-175px) rotateY(180deg); }
  .rh-services-cube-spinner div:nth-of-type(6) { transform: translateZ(175px); }
}

/* ── Tablet: 768px - 1023px ── */
@media (max-width: 1023px) and (min-width: 768px) {
  .rh-services-heading h2 {
    font-size: 36px;
  }
  .rh-services-subtitle {
    font-size: 16px;
  }
  .rh-services-morph-container {
    height: 1.35em;
  }
}

@media (max-width: 768px) {
  .rh-services-section { padding: 60px 20px 70px; }
  .rh-services-heading { margin-bottom: 45px; }
  .rh-services-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .rh-services-card-wrap:nth-child(n) { grid-column: span 1; height: 310px; }
  .rh-services-card-wrap:nth-child(6) { grid-column: span 1; height: 310px; }
  .rh-services-cube-wrap { width: 300px; height: 300px; }
  .rh-services-cube-spinner div:nth-of-type(1) { transform: translateZ(-150px) rotateY(180deg); }
  .rh-services-cube-spinner div:nth-of-type(6) { transform: translateZ(150px); }
}

/* ── Mobile Large: 480px - 767px ── */
@media (max-width: 767px) and (min-width: 481px) {
  .rh-services-heading h2 {
    font-size: 30px;
  }
  .rh-services-morph-container {
    height: 1.4em;
  }
  .rh-services-morph-text {
    font-size: 0.85em;
  }
  .rh-services-subtitle {
    font-size: 17px;
  }
  .rh-services-viewall-btn {
    font-size: 15px;
  }
}

/* ── Mobile: 620px and below — single column + View All logic ── */
@media (max-width: 620px) {
  .rh-services-grid { grid-template-columns: 1fr; gap: 26px; }
  .rh-services-card-wrap:nth-child(n) { grid-column: span 1; height: 330px; }
  .rh-services-card-wrap:nth-child(6) { grid-column: span 1; height: 330px; }
  .rh-services-heading h2 { font-size: 30px; }
  .rh-services-subtitle { font-size: 14px; }

  /* ── Morph text mobile fix — scale down + allow overflow clip ── */
  .rh-services-morph-container {
    height: 1.5em;
    overflow: hidden;
  }
  .rh-services-morph-text {
    font-size: 0.78em;
  }

  /* Mobile: first 2 visible, rest hidden behind button via JS classes only.
     NO nth-child CSS hide — JS manages all visibility via classes. */
  .rh-services-card-wrap.rh-services-mobile-hidden {
    display: none;
  }
  .rh-services-card-wrap.rh-services-mobile-hidden.rh-services-show-all {
    display: block;
  }

  .rh-services-cube-wrap { width: 250px; height: 250px; }
  .rh-services-cube-spinner div:nth-of-type(1) { transform: translateZ(-125px) rotateY(180deg); }
  .rh-services-cube-spinner div:nth-of-type(6) { transform: translateZ(125px); }
}

/* ── Mobile Small: below 480px ── */
@media (max-width: 480px) {
  .rh-services-section { padding: 50px 16px 60px; }
  .rh-services-heading h2 {
    font-size: 26px;
  }
  .rh-services-morph-container {
    height: 1.6em;
  }
  .rh-services-morph-text {
    font-size: 0.72em;
  }
  .rh-services-subtitle {
    font-size: 14px;
    margin-top: 16px;
  }
  .rh-services-card-wrap:nth-child(n) { height: 310px; }
  .rh-services-grid { gap: 22px; }
  .rh-services-card-content {
    padding: 34px 35px 0px 22px;
  }
  .rh-services-card-title {
    font-size: 17px;
  }
  .rh-services-card-text {
    font-size: 12px;
  }
  .rh-services-learnmore {
    font-size: 12px;
    padding: 8px 20px;
  }
  .rh-services-viewall-btn {
    font-size: 14px;
    padding: 14px 32px;
  }
}