/*
  ZEM Abogadas — Homepage styles (V3)
  Shared components (header, hero primitives, methodology track, instagram
  scroller, consult CTA, area navigator, avatar frames) live in base.css.
  This file holds homepage-specific layout: the unified intro/hero
  (Quiénes somos + Equipo fundador + Cómo trabajamos), the services grid,
  the compact homepage football-field widget, and the Derecho Deportivo
  launch section.
*/

/* ---------- Intro / hero (V4: one continuous dark banner — eyebrow, founder cards,
   Cómo trabajamos heading, firm statement + CTAs, methodology steps) ---------- */
.intro-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--zem-navy) 0%, var(--zem-teal-dark) 65%, var(--zem-teal) 100%);
  padding-block: calc(var(--space-9) + 1rem) var(--space-9);
}

.intro-hero__mark {
  left: 50%;
  top: 30%;
  transform: translate(-50%, -50%);
  width: 46rem;
  max-width: 80vw;
  opacity: 0.1;
}

.intro-hero__eyebrow-row {
  position: relative;
  z-index: 1;
  margin-bottom: var(--space-4);
}

.intro-hero__eyebrow-row .section-eyebrow {
  margin-bottom: 0;
}

.intro-hero__block {
  position: relative;
  z-index: 1;
}

.intro-hero__block + .intro-hero__block {
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.section-heading--on-dark {
  margin-bottom: var(--space-6);
}

.section-heading--on-dark h2 {
  color: var(--zem-white);
}

.section-heading--on-dark p {
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- Firm statement + CTAs (appears after the methodology steps) ---------- */
.intro-hero__statement {
  max-width: 40rem;
  margin-top: var(--space-8);
}

.intro-hero__statement p {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--fs-md);
  margin-bottom: var(--space-5);
}

/* ---------- Team (Equipo fundador) ---------- */
.team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

@media (max-width: 700px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}

.team-card {
  background: var(--zem-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.team-card__body {
  padding: var(--space-6);
}

.team-card__role {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--zem-teal);
  margin-bottom: var(--space-3);
}

.team-card__link {
  display: inline-block;
  margin-top: var(--space-2);
  font-weight: 700;
  color: var(--zem-navy);
  border-bottom: 2px solid var(--zem-logo-ice);
}

/* ---------- Team card on-dark variant (founder cards now sit directly on the
   dark banner, not inside a white panel) ---------- */
.team-card--on-dark {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.team-card--on-dark:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.team-card--on-dark .team-card__body h3 {
  color: var(--zem-white);
}

.team-card--on-dark .team-card__role {
  color: var(--zem-logo-ice);
}

.team-card--on-dark .team-card__body p {
  color: rgba(255, 255, 255, 0.85);
}

.team-card--on-dark .team-card__link {
  color: var(--zem-white);
  border-bottom-color: var(--zem-logo-ice);
}

/* Desktop only: restore each founder card to a solid white card (glass-on-dark
   made the bio area blend into the green background). Mobile is untouched —
   the rgba/backdrop-filter rules above still apply below 769px. */
@media (min-width: 769px) {
  .team-card--on-dark {
    background: var(--zem-white);
    border-color: rgba(15, 23, 42, 0.08);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .team-card--on-dark:hover {
    box-shadow: var(--shadow-md);
  }

  .team-card--on-dark .team-card__body h3 {
    color: var(--zem-ink);
  }

  .team-card--on-dark .team-card__role {
    color: var(--zem-teal);
  }

  .team-card--on-dark .team-card__body p {
    color: var(--zem-text);
  }

  .team-card--on-dark .team-card__link {
    color: var(--zem-navy);
    border-bottom-color: var(--zem-logo-ice);
  }
}

/* ---------- Team avatar frames with real photos ---------- */
.avatar-frame--photo {
  background: var(--zem-navy);
  overflow: hidden;
}

.avatar-frame--photo::before {
  display: none;
}

.avatar-frame--photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  transform: none;
  object-fit: cover;
  opacity: 1;
}

@media (max-width: 760px) {
  .avatar-frame--photo {
    aspect-ratio: 4 / 3.4;
  }
}

/* ---------- Methodology on-dark variant (mirrors the Elizabeth-page
   .metodologia-dark pattern, scoped here so the shared base.css component
   and the Elizabeth page's own usage are untouched) ---------- */
.methodology-list--on-dark li {
  border-top-color: rgba(255, 255, 255, 0.18);
}

.methodology-list--on-dark li.is-active {
  border-top-color: var(--zem-logo-ice);
}

@media (max-width: 560px) {
  .methodology-list--on-dark li {
    border-top: none;
    border-left-color: rgba(255, 255, 255, 0.18);
  }

  .methodology-list--on-dark li.is-active {
    border-left-color: var(--zem-logo-ice);
  }
}

.methodology-list--on-dark h3 {
  color: var(--zem-white);
}

.methodology-list--on-dark p {
  color: rgba(255, 255, 255, 0.82);
}

.methodology-list--on-dark .methodology-list__num {
  color: var(--zem-logo-ice);
}

.methodology-list--on-dark li.is-active .methodology-list__num {
  color: var(--zem-white);
}

.intro-hero .methodology-track__line {
  background: rgba(255, 255, 255, 0.16);
}

/* Desktop only: the whole "Cómo trabajamos" block (heading, timeline, firm
   statement, CTAs) sits on one solid white card over the green banner.
   Mobile is untouched — every on-dark rule above still applies below 769px. */
@media (min-width: 769px) {
  #metodologia {
    background: var(--zem-white);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-8);
  }

  #metodologia .section-eyebrow {
    color: var(--zem-teal);
  }

  #metodologia .section-heading--on-dark h2 {
    color: var(--zem-ink);
  }

  #metodologia .methodology-track__line {
    background: rgba(15, 23, 42, 0.1);
  }

  #metodologia .methodology-list--on-dark li {
    border-top-color: rgba(15, 23, 42, 0.1);
  }

  #metodologia .methodology-list--on-dark li.is-active {
    border-top-color: var(--zem-teal);
  }

  #metodologia .methodology-list--on-dark h3 {
    color: var(--zem-ink);
  }

  #metodologia .methodology-list--on-dark p {
    color: var(--zem-teal-soft);
  }

  #metodologia .methodology-list--on-dark .methodology-list__num {
    color: var(--zem-teal-soft);
  }

  #metodologia .methodology-list--on-dark li.is-active .methodology-list__num {
    color: var(--zem-navy);
  }

  #metodologia .intro-hero__statement p {
    color: var(--zem-text);
  }

  #metodologia .btn-ghost-on-dark {
    color: var(--zem-navy);
    border-color: rgba(15, 23, 42, 0.25);
  }

  #metodologia .btn-ghost-on-dark:hover {
    background: rgba(15, 23, 42, 0.06);
    border-color: var(--zem-navy);
  }
}

@media (min-width: 760px) {
  .home-scroll-pad {
    padding-top: var(--space-9);
  }
}

/* ---------- Services grid (V3: hover/focus/tap reveal tiles) ---------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

@media (max-width: 980px) {
  .service-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .service-grid {
    grid-template-columns: 1fr;
  }
}

.service-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 12rem;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--zem-white);
  border: 1px solid rgba(15, 23, 42, 0.1);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.service-tile:hover,
.service-tile:focus-visible,
.service-tile.is-active {
  border-color: var(--zem-teal);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.service-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, var(--zem-lavender-light), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.service-tile:hover::after,
.service-tile:focus-visible::after,
.service-tile.is-active::after {
  opacity: 1;
}

.service-tile__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--zem-lavender-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
  transition: background var(--transition-base), transform var(--transition-base);
  position: relative;
  z-index: 1;
}

.service-tile:hover .service-tile__icon,
.service-tile:focus-visible .service-tile__icon,
.service-tile.is-active .service-tile__icon {
  background: var(--zem-teal);
  transform: scale(1.08);
}

.service-tile__icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--zem-teal-dark);
  fill: none;
  transition: stroke var(--transition-base);
}

.service-tile:hover .service-tile__icon svg,
.service-tile:focus-visible .service-tile__icon svg,
.service-tile.is-active .service-tile__icon svg {
  stroke: var(--zem-white);
}

.service-tile__index {
  position: absolute;
  top: var(--space-5);
  right: var(--space-6);
  font-family: var(--font-serif);
  font-size: var(--fs-sm);
  color: rgba(15, 23, 42, 0.16);
  z-index: 1;
}

.service-tile__title {
  position: relative;
  z-index: 1;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--zem-ink);
  margin-bottom: 0;
}

.service-tile__desc {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows var(--transition-slow), opacity var(--transition-base), margin-top var(--transition-slow);
}

.service-tile__desc p {
  overflow: hidden;
  font-size: var(--fs-sm);
  color: var(--zem-teal-soft);
  margin: 0;
}

.service-tile:hover .service-tile__desc,
.service-tile:focus-visible .service-tile__desc,
.service-tile.is-active .service-tile__desc {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: var(--space-3);
}

.service-tile__arrow {
  position: relative;
  z-index: 1;
  margin-top: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--zem-teal-dark);
}

.service-tile__arrow svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  transition: transform var(--transition-base);
}

.service-tile:hover .service-tile__arrow svg,
.service-tile:focus-visible .service-tile__arrow svg,
.service-tile.is-active .service-tile__arrow svg {
  transform: translateX(3px);
}

/* Distinctive Derecho Deportivo tile — dark, spans full width on desktop */
/* Wide, horizontal shape only — colors/background/shadow/typography all
   inherit the same white-card treatment as the other service tiles. */
.service-tile--sport {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

@media (max-width: 700px) {
  .service-tile--sport {
    flex-direction: column;
    align-items: flex-start;
  }
}

.service-tile--sport .service-tile__icon {
  flex-shrink: 0;
}

.service-tile--sport .service-tile__arrow {
  flex-shrink: 0;
}

.service-tile--sport .service-tile__badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--zem-teal-dark);
  background: var(--zem-lavender-light);
  border: 1px solid rgba(76, 103, 112, 0.25);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  margin-bottom: var(--space-3);
}

/* ---------- Derecho Deportivo homepage launch ---------- */
.deportivo-launch {
  overflow: hidden;
  background: radial-gradient(120% 140% at 15% 0%, var(--zem-teal-dark) 0%, var(--zem-navy) 45%, #081020 100%);
  padding-block: var(--space-10);
}

.deportivo-launch__fade {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8rem;
  background: linear-gradient(180deg, var(--zem-lavender-light), transparent);
  z-index: 0;
  opacity: 0.5;
}

.deportivo-launch__inner {
  position: relative;
  z-index: 1;
  max-width: 46rem;
}

.deportivo-launch__title {
  margin-bottom: var(--space-5);
}

.deportivo-launch__title .reveal-line > span {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--fs-3xl);
  line-height: 1;
  color: var(--zem-white);
}

.deportivo-launch__body {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--fs-md);
  margin-bottom: var(--space-7);
  max-width: 36rem;
}

/* ---------- Homepage football-field widget (independent of the Elizabeth-page tactical board) ---------- */
.home-field {
  position: relative;
  z-index: 1;
  margin-bottom: var(--space-7);
}

.home-field__input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.home-field__layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.home-field__stage {
  position: relative;
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
}

.home-field__stage svg {
  width: 100%;
  height: auto;
  display: block;
}

.hf-outline {
  fill: none;
  stroke: rgba(211, 230, 237, 0.32);
  stroke-width: 1.4;
}

.hf-goal {
  stroke-width: 2;
}

.hf-node {
  cursor: pointer;
}

.hf-node__dot {
  fill: rgba(211, 230, 237, 0.5);
  stroke: rgba(255, 255, 255, 0.3);
  stroke-width: 1;
  transition: fill 260ms var(--ease-out-expo), opacity 260ms var(--ease-out-expo);
}

.hf-node__ball {
  opacity: 0;
  transform-origin: center;
  transform-box: fill-box;
  transform: scale(0.4);
  transition: opacity 260ms var(--ease-out-expo), transform 260ms var(--ease-out-expo);
  filter: drop-shadow(0 0 6px rgba(211, 230, 237, 0.6));
}

.hf-node__label {
  fill: rgba(255, 255, 255, 0.65);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: fill 260ms ease;
}

.hf-node.is-active .hf-node__dot {
  opacity: 0;
}

.hf-node.is-active .hf-node__ball {
  opacity: 1;
  transform: scale(1);
}

.hf-node.is-active .hf-node__label {
  fill: var(--zem-white);
}

@media (prefers-reduced-motion: reduce) {
  .hf-node__ball,
  .hf-node__dot {
    transition: none;
  }
}

.home-field__panels {
  min-width: 0;
}

.home-field__panel {
  display: none;
}

.home-field__panel h3 {
  color: var(--zem-white);
  font-size: var(--fs-lg);
  margin-bottom: var(--space-2);
}

.home-field__panel p {
  color: rgba(255, 255, 255, 0.75);
  font-size: var(--fs-sm);
  margin-bottom: 0;
}

#hf-deportistas:checked ~ .home-field__layout #hf-panel-deportistas,
#hf-clubes:checked ~ .home-field__layout #hf-panel-clubes,
#hf-entrenadores:checked ~ .home-field__layout #hf-panel-entrenadores,
#hf-agentes:checked ~ .home-field__layout #hf-panel-agentes,
#hf-academias:checked ~ .home-field__layout #hf-panel-academias,
#hf-organizaciones:checked ~ .home-field__layout #hf-panel-organizaciones {
  display: block;
}

.home-field__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.home-field__tab {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

/* The <label> tabs are not adjacent siblings of their <input> in the DOM
   (the pitch stage sits between them), so a sibling-combinator selector
   can never match here. home-field.js toggles .is-focused/.is-active on
   the label directly instead. */
.home-field__tab.is-focused {
  outline: 3px solid var(--zem-logo-ice);
  outline-offset: 2px;
}

.home-field__tab.is-active {
  color: var(--zem-navy);
  background: var(--zem-logo-ice);
  border-color: var(--zem-logo-ice);
}

/* ---------- Desktop-only: let the pitch become the section's dominant
   visual element instead of a small centered panel. Mobile/tablet below
   769px are completely untouched — every rule above still applies as-is. ---------- */
@media (min-width: 769px) {
  .deportivo-launch__inner {
    max-width: var(--container-width);
  }

  .home-field__stage {
    max-width: 100%;
  }

  .home-field__layout {
    padding: var(--space-7) var(--space-8) var(--space-8);
  }
}

/* ---------- Abogados para extranjeros (pathway cards) ---------- */
.pathways {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-7);
}

@media (max-width: 760px) {
  .pathways {
    grid-template-columns: 1fr;
  }
}

.pathway-card {
  background: var(--zem-white);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-5);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.pathway-card:hover,
.pathway-card[open] {
  border-color: var(--zem-teal);
}

.pathway-card:hover {
  box-shadow: var(--shadow-sm);
}

.pathway-card__summary {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-block: var(--space-4);
  cursor: pointer;
  list-style: none;
}

.pathway-card__summary::-webkit-details-marker {
  display: none;
}

.pathway-card__summary::marker {
  content: "";
}

.pathway-card__index {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--fs-lg);
  color: var(--zem-teal-soft);
  flex-shrink: 0;
  width: 2.25rem;
}

.pathway-card__heading {
  flex: 1;
  min-width: 0;
}

.pathway-card__title {
  display: block;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--zem-ink);
}

.pathway-card__subtitle {
  display: block;
  font-size: var(--fs-xs);
  color: var(--zem-teal-soft);
  margin-top: 0.15rem;
}

.pathway-card__chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: var(--zem-teal-soft);
  transition: transform var(--transition-base);
}

.pathway-card[open] .pathway-card__chevron {
  transform: rotate(180deg);
}

.pathway-card__list {
  list-style: none;
  margin: 0;
  padding: 0 0 var(--space-5) calc(2.25rem + var(--space-4));
  display: grid;
  gap: var(--space-2);
}

.pathway-card__list li {
  position: relative;
  padding-left: var(--space-4);
  font-size: var(--fs-sm);
  color: var(--zem-teal-soft);
}

.pathway-card__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--zem-teal);
}

@media (max-width: 480px) {
  .pathway-card__list {
    padding-left: var(--space-4);
  }
}

.pathways-footer {
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  padding-top: var(--space-6);
}

.pathways-footer__disclaimer {
  font-size: var(--fs-xs);
  color: var(--zem-teal-soft);
  max-width: 46rem;
  margin-bottom: var(--space-5);
}

.pathways-footer__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
}

.pathways-footer__future {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--zem-teal-soft);
}

.pathways-footer__future span {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--zem-teal-dark);
  background: var(--zem-lavender-light);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}
