/* States We Serve page (v2/states.blade.php). Loaded after style-v2.css. */

/* ============================================================= */
/* Hero — Figma node 9909:2877 (1440 x 423)                       */
/* ============================================================= */
.states-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 423px;
  padding: 70px 0;
  overflow: hidden;
  background: #eff2ff;
}

input:focus {
  outline: none !important;
}

.states-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Figma tint over the photo */
.states-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(239, 242, 255, 0.88);
}

.states-hero .container-page {
  position: relative;
  z-index: 2;
  width: 100%;
}

.states-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  text-align: center;
}

.states-hero-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 12px;
  line-height: 9.976px;
  color: var(--c-blue);
  text-transform: capitalize;
  white-space: nowrap;
  background: rgba(39, 55, 117, 0.1);
  border-radius: 9.069px;
}

.states-hero-heading {
  max-width: 1034px;
  margin: 0;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 32px;
  line-height: 50.4px;
  color: var(--c-blue);
  /* style-v2.css capitalizes every word of an h1; the design keeps "for" lowercase. */
  text-transform: none;
}

.states-hero-heading .accent {
  color: var(--c-orange);
}

.states-hero-lead {
  max-width: 1036px;
  margin: 0;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 16px;
  line-height: 28.8px;
  color: #3d3d3d;
}

@media (max-width: 768px) {
  .states-hero {
    min-height: 0;
    padding: 56px 0;
  }

  .states-hero-pill {
    white-space: normal;
    line-height: 16px;
  }

  .states-hero-heading {
    font-size: 26px;
    line-height: 38px;
  }

  .states-hero-lead {
    font-size: 15px;
    line-height: 26px;
  }
}

@media (max-width: 520px) {
  .states-hero {
    padding: 44px 0;
  }

  .states-hero-heading {
    font-size: 22px;
    line-height: 32px;
  }
}

/* ============================================================= */
/* States directory — Figma node 10059:7657                       */
/* Search pill (680px) + 5 x 232px card grid, 20px gaps.          */
/* ============================================================= */
.states-directory {
  padding: 60px 0;
  background: var(--c-white);
}

.states-directory .container-page {
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: center;
}

.states-search {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  max-width: 680px;
  padding: 8px 8px 8px 24px;
  box-sizing: border-box;
  background: var(--c-white);
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.states-search:focus-within {
  border-color: var(--c-blue);
  box-shadow: 0 10px 30px -12px rgba(39, 55, 117, 0.35);
}

.states-search-icon {
  display: block;
  flex-shrink: 0;
}

.states-search-input {
  flex: 1 0 0;
  min-width: 0;
  padding: 13px 0;
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 15px;
  line-height: normal;
  color: #3d3d3d;
  background: transparent;
  border: 0;
  outline: 0;
}

.states-search-input::placeholder {
  color: #9a9a9f;
  opacity: 1;
}

.states-search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.states-search-btn {
  flex-shrink: 0;
  padding: 16px 38px;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 15px;
  line-height: normal;
  color: var(--c-white);
  background: var(--c-orange);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.states-search-btn:hover,
.states-search-btn:focus-visible {
  background: #f14a4e;
  box-shadow: 0 10px 22px -10px rgba(252, 93, 97, 0.9);
  transform: translateY(-1px);
}

.states-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.states-grid-item {
  display: flex;
  margin: 0;
}

.states-grid-item[hidden] {
  display: none;
}

.state-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  padding: 20px 16px;
  overflow: hidden;
  text-align: center;
  text-decoration: none;
  background: #eff2ff;
  border-radius: 16px;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease;
}

/* Figma's highlighted (Alabama) card: gradient fades in on hover/focus. */
.state-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to right, var(--c-blue) 29.808%, var(--c-orange));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.state-card-flag {
  display: block;
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  overflow: hidden;
  border-radius: 50%;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease;
}

.state-card-flag img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.state-card-name {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 16px;
  line-height: 22.4px;
  color: var(--c-blue);
  text-transform: capitalize;
  transition: color 0.35s ease;
}

.state-card-nickname {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 16px;
  line-height: 28.8px;
  color: #3d3d3d;
  /* One line as in Figma; the longest ("The Mount Rushmore State") runs a few
     px into the card padding at 232px. Wraps again below 1200px. */
  white-space: nowrap;
  transition: color 0.35s ease;
}

@media (max-width: 1200px) {
  .state-card-nickname {
    white-space: normal;
  }
}

.state-card:hover,
.state-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 18px 34px -16px rgba(39, 55, 117, 0.55);
}

.state-card:focus-visible {
  outline: 2px solid var(--c-orange);
  outline-offset: 3px;
}

.state-card:hover::before,
.state-card:focus-visible::before {
  opacity: 1;
}

.state-card:hover .state-card-flag,
.state-card:focus-visible .state-card-flag {
  transform: scale(1.06);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.35);
}

.state-card:hover .state-card-flag img,
.state-card:focus-visible .state-card-flag img {
  transform: scale(1.08);
}

.state-card:hover .state-card-name,
.state-card:hover .state-card-nickname,
.state-card:focus-visible .state-card-name,
.state-card:focus-visible .state-card-nickname {
  color: var(--c-white);
}

.states-empty {
  margin: 0;
  font-family: var(--font-primary);
  font-size: 16px;
  color: #3d3d3d;
}

/* ---------- Animation ---------- */
@keyframes states-rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

@keyframes states-pop {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: none; }
}

/* On load: the search pill and the first two rows (on screen below the hero)
   rise in; later rows are revealed on scroll by script-v2.js ([data-anim]). */
.states-search {
  animation: states-rise 0.7s 0.1s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

/* --col / --row come from the view (desktop 5-column position). */
.states-grid-item:nth-child(-n+10) {
  animation: states-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  animation-delay: calc(0.2s + var(--row, 0) * 0.25s + var(--col, 0) * 0.06s);
}

/* Scroll-revealed rows sweep in left to right. */
.states-v2 .states-grid-item[data-anim] {
  transition-delay: calc(var(--col, 0) * 0.07s);
}

/* Search results pop back in (--n: position among the matches, set by the script). */
.states-grid-item.is-filtered-in {
  animation: states-pop 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  animation-delay: calc(min(var(--n, 0), 10) * 0.03s);
}

/* Scroll reveal states (script-v2.js). */
.states-v2 [data-anim] {
  opacity: 0;
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    translate 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    scale 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--anim-delay, 0s);
  will-change: opacity, translate;
}

.states-v2 [data-anim="up"]   { translate: 0 32px; }
.states-v2 [data-anim="zoom"] { scale: 0.92; }

.states-v2 [data-anim].is-in {
  opacity: 1;
  translate: 0 0;
  scale: 1;
}

@media (prefers-reduced-motion: reduce) {
  .states-search,
  .states-grid-item,
  .states-grid-item.is-filtered-in {
    animation: none;
  }

  .state-card,
  .state-card::before,
  .state-card-flag,
  .state-card-flag img {
    transition: none;
  }

  .state-card:hover,
  .state-card:focus-visible {
    transform: none;
  }

  .states-v2 [data-anim] {
    opacity: 1;
    translate: none;
    scale: none;
    transition: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .states-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .states-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .states-directory {
    padding: 48px 0;
  }

  .states-directory .container-page {
    gap: 28px;
  }
}

@media (max-width: 600px) {
  .states-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .state-card {
    gap: 8px;
    padding: 16px 10px;
  }

  .state-card-flag {
    width: 96px;
    height: 96px;
  }

  .state-card-name {
    font-size: 15px;
  }

  .state-card-nickname {
    font-size: 13px;
    line-height: 20px;
  }

  .states-search {
    gap: 10px;
    padding-left: 16px;
  }

  .states-search-btn {
    padding: 14px 22px;
  }
}

/* ============================================================= */
/* Phones — match the About page (about-v2.css)                   */
/* ============================================================= */
/* style-v2.css keeps a 40px page gutter at <=768px unless a page opts into 20px;
   at 40px the testimonial card is only ~295px wide on an iPhone and its
   absolutely placed name/quote/photo get clipped. */
@media (max-width: 768px) {
  .states-v2 {
    --page-gutter: 20px;
  }

  /* The section is copied from the Contact page with an inline 100px padding;
     use the About page's 40px on phones. */
  .states-v2 .calc6-section {
    padding: 40px 0 !important;
  }
}

/* style-v2.css (360px-wide, <=800px-tall phones) shrinks the testimonial card to
   230px tall but sets its border image to width/height:auto, so the 363x284 SVG
   draws ~20px taller than the card and the photo cut-out / bottom edge get
   clipped. Keep the border filling the card instead. */
@media screen and (max-width: 360px) and (max-height: 800px),
       screen and (max-width: 375px) and (max-height: 667px) {
  .states-v2 .calc6-card-border {
    width: 100%;
    height: 100%;
  }
}
