/* ============================================================
   PRACTICE.CSS — Practice Areas page styles
   Ongwacho Cherop Associates & Advocates
============================================================ */

/* ── PAGE HERO (practice) ──────────────────────────────────── */
/* The shared hero lives in global.css. Practice's image is a dark full-bleed photo with no
   white panel, so its scrim fades out earlier than the shared gradient. */
.page-hero::after {
  background: linear-gradient(
    to right,
    var(--color-primary-dk)    0%,
    var(--color-primary-dk)   22%,
    rgba(92,10,34,0.88)       34%,
    rgba(92,10,34,0.40)       46%,
    rgba(92,10,34,0.08)       58%,
    transparent               68%
  );
}

/* ── CLUSTERS LAYOUT ───────────────────────────────────────── */
.clusters-layout {
  display: block;
  background: var(--color-cream);
}

/* ── CLUSTER TABS NAV — mobile base (horizontal scroll bar) ── */
.clusters-nav {
  background: var(--color-ink);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid rgba(201,169,97,0.1);
  position: sticky;
  top: var(--nav-height); /* sits below the fixed navbar, not under it */
  z-index: 50;
}
.clusters-nav::-webkit-scrollbar { display: none; }

/* Header + progress hidden on mobile */
.clusters-nav__header,
.clusters-nav__progress { display: none; }

/* Mobile tab */
.cluster-tab {
  flex: 0 0 auto;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.2rem 1rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  position: relative;
  transition: background var(--ease-med), border-color var(--ease-med);
  white-space: nowrap;
}
.cluster-tab::after {
  content: '';
  position: absolute;
  right: 0; top: 20%; bottom: 20%;
  width: 1px;
  background: rgba(201,169,97,0.1);
}
.cluster-tab:last-child::after { display: none; }
.cluster-tab:hover             { background: rgba(201,169,97,0.05); }
.cluster-tab--active           { border-bottom-color: var(--color-accent); background: rgba(201,169,97,0.07); }

.cluster-tab__num {
  font-family: var(--ff-display);
  font-size: 1rem;
  font-weight: 600;
  color: rgba(201,169,97,0.35);
  line-height: 1;
  transition: color var(--ease-med);
}
.cluster-tab--active .cluster-tab__num,
.cluster-tab:hover   .cluster-tab__num { color: var(--color-accent); }

.cluster-tab__label {
  font-family: var(--ff-body);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  text-align: center;
  line-height: 1.4;
  transition: color var(--ease-med);
}
.cluster-tab--active .cluster-tab__label,
.cluster-tab:hover   .cluster-tab__label { color: rgba(255,255,255,0.85); }

/* ── CLUSTER PANELS ────────────────────────────────────────── */
.clusters-main {
  background: var(--color-cream);
  min-height: 60vh;
}

.cluster-panel {
  display: none;
}
.cluster-panel--active {
  display: block;
  animation: panelFadeIn 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cluster-panel__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-gutter);
}

/* Panel header */
.cluster-panel__header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: start;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-divider);
}
.cluster-panel__num {
  font-family: var(--ff-display);
  font-size: clamp(5rem, 10vw, 8rem);
  font-weight: 700;
  color: rgba(122,14,46,0.07);
  line-height: 0.85;
  flex-shrink: 0;
  align-self: center;
}
.cluster-panel__title {
  font-family: var(--ff-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 400;
  color: var(--color-ink);
  line-height: 1.15;
  margin-top: 0.6rem;
  margin-bottom: 1rem;
}
.cluster-panel__lead {
  font-family: var(--ff-display);
  font-size: 1.15rem;
  font-weight: 300;
  font-style: italic;
  color: var(--color-ink-soft);
  line-height: 1.7;
  max-width: 640px;
}

/* Services grid */
.cluster-services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5px;
  background: var(--color-divider);
}

.service-card {
  background: var(--color-cream);
  padding: 2.2rem 2rem;
  position: relative;
  overflow: hidden;
  transition: background var(--ease-med);
}
.service-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ease-slow);
}
.service-card:hover { background: var(--color-cream-warm); }
.service-card:hover::before { transform: scaleX(1); }
.service-card__title {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 0.6rem;
  line-height: 1.3;
}
.service-card__desc {
  display: none;
}

/* CTA row */
.cluster-panel__cta {
  margin-top: var(--space-lg);
  display: flex;
  justify-content: flex-start;
}

/* ── PRACTICE CTA SECTION ──────────────────────────────────── */
.practice-cta {
  background: var(--color-cream-warm);
  padding: var(--space-xl) var(--space-gutter);
  border-top: 1px solid var(--color-divider);
}
.practice-cta__inner {
  max-width: 780px;
  margin: 0 auto;
}
.practice-cta .corner-box {
  text-align: center;
  padding: 4rem 3rem;
}
.practice-cta__title {
  font-family: var(--ff-display);
  font-size: var(--fs-2xl);
  font-weight: 400;
  color: var(--color-ink);
  line-height: 1.2;
  margin: 1.2rem 0 1rem;
}
.practice-cta__text {
  font-size: var(--fs-base);
  line-height: 1.8;
  color: var(--color-ink-soft);
  max-width: 500px;
  margin: 0 auto 2.2rem;
}
.practice-cta__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
/* Placed after every base rule above so the overrides win the cascade. Shared set: 1100 / 900 / 720 / 560. */
@media (max-width: 1099px) {
  .cluster-services { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 899px) {
  .cluster-services { grid-template-columns: repeat(2, 1fr); }
}
/* Tabs: all five share the row from 720px up (labels wrap); below that the strip scrolls and snaps. */
@media (min-width: 720px) {
  .cluster-tab { flex: 1 1 0; min-width: 0; white-space: normal; }
}
@media (max-width: 719px) {
  .cluster-panel__header { grid-template-columns: 1fr; gap: 1rem; }
  .clusters-nav { scroll-snap-type: x proximity; }
  .cluster-tab  { white-space: normal; max-width: 11rem; scroll-snap-align: start; }
}
@media (max-width: 559px) {
  .cluster-services { grid-template-columns: 1fr; }
  .practice-cta .corner-box { padding: 2.5rem 1.5rem; }
}
/* ≤900px: the photo shows behind a scrim. practice.css loads after global.css at equal specificity, so its base
   ::after gradient above would win; this block restates the scrim here. 0.90 (not the shared 0.86) because the white
   tea tags carry dark lettering that otherwise ghosts through. Change the 90% to 86 or 92 to tune it. */
@media (max-width: 900px) {
  .page-hero::after {
    background: var(--hero-scrim);
    background: color-mix(in srgb, var(--color-primary-dk) 90%, transparent);
  }
  .page-hero__image { object-position: 70% center; }
}
