/**
 * Copyright (c) 2025-2026 Kenneth Raymond
 * All rights reserved.
 *
 * Part of the Experts in CMT platform.
 * Do not copy, modify, or redistribute without permission.
 */

/* Front page layout */

.eic-front {
  --front-ease: var(--gl-speed, 800ms)
    var(--gl-ease, cubic-bezier(0.02, 0.9, 0.15, 1));
  --front-card-shadow: var(--gl-card-shadow, 0 8px 24px rgb(14 42 84 / 5%));
  --front-btn-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Hide the template banner */
body:has(.eic-front) .header-banner {
  display: none !important;
}

/* Close the template gap above the hero */
.wp-block-post-content > .eic-front {
  margin-top: calc(24px - 2 * var(--wp--preset--spacing--60));
}

/* ---- Sections ---- */

.eic-front > section {
  box-sizing: border-box;
  padding-block: var(--space-6) calc(var(--space-6) * 2);
  padding-inline: max(
    var(--space-4),
    calc((100% - 1160px) / 2 + var(--space-4))
  );
}
.eic-front > section > :last-child {
  margin-bottom: 0;
}
/* Gap after section headings */
.eic-front > section > h2 + * {
  margin-top: var(--space-4);
}
.eic-front > section > p {
  max-width: var(--maxw);
  margin: 0 0 var(--space-2);
}
.eic-front > section > h2 + p {
  margin-top: var(--space-2);
}
.eic-front > section > p a {
  color: var(--primary);
}

/* Section separators */
.eic-front > section:nth-child(n + 3) {
  padding-top: 0;
}
.eic-front > section:nth-child(n + 3)::before {
  content: "";
  display: block;
  width: 50%;
  margin: 0 auto calc(var(--space-6) * 2);
  border-top: 1px solid var(--border);
}

/* ---- Hero ---- */

.eic-front > .eic-front__hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-6);
  align-items: start;
  padding-block: var(--space-6);
  background: linear-gradient(
    180deg,
    var(--bg) 0%,
    color-mix(in srgb, var(--primary) 7%, var(--bg)) 100%
  );
}
.eic-front__hero h1 {
  margin: 0 0 var(--space-1);
  color: var(--primary);
}
.eic-front__hero h2 {
  font-size: var(--fs-h3);
}
.eic-front__hero p {
  margin: 0;
}
.eic-front__hero h2 + p {
  margin-top: var(--space-1);
}
.eic-front__panel > h2 {
  margin-top: 0 !important;
}
.eic-front__hero .eic-front__tagline {
  margin-bottom: var(--space-5);
  font-size: var(--fs-h3);
  font-style: italic;
  color: var(--primary);
}
.eic-front__panel {
  padding: var(--gl-card-padding, 1.75rem);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--gl-card-radius, 22px);
  box-shadow: var(--front-card-shadow);
}
.eic-front__panel p {
  margin-bottom: var(--space-1);
  color: var(--primary);
}

/* Search and totals */
.eic-front .ps-row {
  margin: var(--space-3) 0;
}
.eic-front .ps-label {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.eic-front .ps-input-group__inner {
  display: flex;
  gap: var(--space-1);
}
.eic-front .ps-input,
.eic-front .ps-btn {
  padding: var(--ctrl-pad-y) var(--ctrl-pad-x);
  font-family: var(--font-sans);
  font-size: var(--ctrl-font);
  border-radius: var(--radius-ctrl);
}
.eic-front .ps-input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--muted);
}
.eic-front .ps-btn {
  background: var(--primary);
  color: var(--bg);
  border: 1px solid var(--primary);
  font-weight: 600;
  cursor: pointer;
}
.eic-front .ps-btn:hover,
.eic-front .ps-btn:focus {
  background: var(--bg);
  color: var(--primary);
  box-shadow: var(--front-btn-shadow);
}
.eic-front .genes-totals-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-1);
  font-size: var(--fs-body);
}
.eic-front .genes-totals-inline br {
  display: none;
}
.eic-front .genes-totals-label {
  margin-bottom: 0;
}
.eic-front .genes-totals-updated {
  width: 100%;
  opacity: 1;
}

/* ---- Entry points ---- */

.eic-front .eic-entry-points__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
}
.eic-front .eic-ep-card {
  flex: 1 1 300px;
  max-width: 350px;
}

/* ---- Question list ---- */

.eic-front__qlist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.eic-front__qlist a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  color: var(--primary);
  font-size: var(--fs-body);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  box-shadow: var(--front-card-shadow);
  transition: box-shadow var(--front-ease), border-color var(--front-ease),
    transform var(--front-ease);
}
.eic-front__qlist a::after {
  content: "\2192" / "";
  flex: none;
  transition: transform var(--front-ease);
}
.eic-front__qlist a:hover,
.eic-front__qlist a:focus {
  border-color: var(--primary-light);
  box-shadow: var(--gl-card-hover-shadow, 0 14px 34px rgb(14 42 84 / 5%));
  transform: scale(1.01);
  text-decoration: none;
}
.eic-front__qlist a:hover::after,
.eic-front__qlist a:focus::after {
  transform: translateX(4px);
}

/* ---- Dorsal Root intro list ---- */

.eic-front__need {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-4);
  font-size: var(--fs-body);
}

/* ---- Buttons ---- */

.eic-front__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--ctrl-pad-y) var(--ctrl-pad-x);
  background: var(--bg);
  color: var(--primary);
  font-family: var(--font-sans);
  font-size: var(--ctrl-font);
  text-decoration: none;
  border: 1px solid var(--primary);
  border-radius: var(--radius-ctrl);
}
.eic-front__btn,
.eic-front .ps-btn {
  transition: background-color 0.15s ease, color 0.15s ease,
    box-shadow 0.25s ease;
}
.eic-front__btn:hover,
.eic-front__btn:focus {
  background: var(--primary);
  color: var(--bg);
  box-shadow: var(--front-btn-shadow);
  text-decoration: none;
}
.eic-front__btn--primary {
  background: var(--primary);
  color: var(--bg);
}

/* Sticky highlight (front-page.js) */
.eic-front .has-current .eic-front__btn {
  background: var(--bg);
  color: var(--primary);
  box-shadow: none;
}
.eic-front .has-current .eic-front__btn.is-current {
  background: var(--primary);
  color: var(--bg);
  box-shadow: var(--front-btn-shadow);
}

/* ---- Button groups ---- */

.eic-front__btnrow,
.eic-front__path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.eic-front__btnrow {
  margin-top: var(--space-5);
}
.eic-front__btnrow::before {
  content: "\2192" / "";
  order: 1;
  color: var(--primary);
}
.eic-front__btnrow > :nth-child(n + 2) {
  order: 2;
}
.eic-front__close {
  text-align: center;
}
.eic-front__path {
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.eic-front__path li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.eic-front__path li + li::before {
  content: "\2192" / "";
  color: var(--primary);
}

/* ---- Narrow screens ---- */

@media (max-width: 860px) {
  .eic-front > .eic-front__hero {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
  .eic-front__qlist {
    grid-template-columns: 1fr;
  }
  .eic-front .eic-ep-card {
    max-width: none;
  }
  .eic-front__btnrow::before {
    display: none;
  }
  .eic-front__path,
  .eic-front__path li {
    flex-direction: column;
  }
  .eic-front__path li + li::before {
    content: "\2193" / "";
  }
}

/* Phone heading sizes */
@media (max-width: 600px) {
  .eic-front__hero h1 {
    font-size: clamp(1.75rem, 7vw, 2rem) !important;
    line-height: 1.2 !important;
  }
  .eic-front__hero h2 {
    font-size: clamp(1.25rem, 4vw, 1.4rem) !important;
    line-height: 1.3 !important;
  }
  .eic-front .ps-input-group__inner {
    flex-wrap: wrap;
  }
  .eic-front .ps-input {
    flex-basis: 100%;
  }
  .eic-front .ps-btn {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .eic-front__qlist a,
  .eic-front__qlist a::after {
    transition: none;
  }
  .eic-front__qlist a:hover,
  .eic-front__qlist a:focus,
  .eic-front__qlist a:hover::after,
  .eic-front__qlist a:focus::after {
    transform: none;
  }
}
