/* Specialties page (v2/specialities.blade.php). Loaded after style-v2.css. */

/* ============================================================= */
/* Hero — Figma node 10004:8130 (1440 x 398)                      */
/* Decorations are placed from the page centre (Figma x - 720px)  */
/* so they keep their spots on wider screens.                     */
/* ============================================================= */
.spec-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 398px;
  overflow: hidden;
  background: linear-gradient(to bottom, #edf2fb 0%, #ffffff 66.958%);
}

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

input:focus {
    outline: none;
}

.spec-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  max-width: 584px;
  margin: 0 auto;
  text-align: center;
}

.spec-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);
  white-space: nowrap;
  background: rgba(39, 55, 117, 0.1);
  border-radius: 9.069px;
}

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

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

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

/* Stethoscope: 449 x 385 window at Figma x 991, 50% opacity, cropped as in Figma. */
.spec-hero-photo {
  position: absolute;
  top: 0;
  left: calc(50% + 271px);
  z-index: 0;
  width: 449px;
  height: 385px;
  overflow: hidden;
  opacity: 0.5;
  pointer-events: none;
}

.spec-hero-photo img {
  position: absolute;
  top: -35.13%;
  left: -78.29%;
  width: 178.22%;
  max-width: none;
  height: 148.51%;
}

/* Claim card: 227.16 x 148.75 box at Figma (1032, 49), card rotated 13.99deg. */
.spec-hero-claim {
  position: absolute;
  top: 49px;
  left: calc(50% + 312px);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 227.161px;
  height: 148.751px;
  pointer-events: none;
}

.spec-hero-claim-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7.596px;
  width: 208.878px;
  padding: 13.292px 15.191px;
  box-sizing: border-box;
  background: #fff;
  border: 0.949px solid rgba(39, 55, 117, 0.12);
  border-radius: 13.292px;
  box-shadow: 0 20.888px 37.978px -22.787px rgba(39, 55, 117, 0.75);
  opacity: 0.8;
  transform: rotate(13.99deg);
  font-family: var(--font-primary);
}

.spec-hero-claim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.spec-hero-claim-row--meta {
  align-items: flex-start;
}

.spec-hero-claim-id {
  font-weight: 600;
  font-size: 9.969px;
  line-height: normal;
  letter-spacing: 1.1963px;
  color: #5a6da8;
  white-space: nowrap;
}

.spec-hero-claim-status {
  padding: 2.848px 7.596px 3.798px;
  font-weight: 600;
  font-size: 9.494px;
  line-height: normal;
  color: #1b7f55;
  white-space: nowrap;
  background: #e8f6ef;
  border-radius: 948.496px;
}

.spec-hero-claim-title {
  padding-bottom: 0.949px;
  font-weight: 600;
  font-size: 13.292px;
  line-height: normal;
  color: var(--c-blue);
}

.spec-hero-claim-code,
.spec-hero-claim-amount {
  font-size: 10.919px;
  line-height: normal;
  white-space: nowrap;
}

.spec-hero-claim-code {
  font-weight: 400;
  color: #3d3d3d;
}

.spec-hero-claim-amount {
  font-weight: 600;
  color: var(--c-blue);
}

/* Chip: 243.37 x 118.01 box at Figma x 185, 36.99px from the bottom, rotated -14.81deg. */
.spec-hero-chip {
  position: absolute;
  bottom: 36.99px;
  left: calc(50% - 535px);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 243.373px;
  height: 118.011px;
  pointer-events: none;
}

.spec-hero-chip-card {
  display: flex;
  gap: 11.393px;
  align-items: center;
  padding: 11.393px 15.191px;
  background: var(--c-blue);
  border-radius: 13.292px;
  opacity: 0.6;
  transform: rotate(-14.81deg);
  font-family: var(--font-primary);
  color: #fff;
}

.spec-hero-chip-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 34.18px;
  height: 34.18px;
  background: var(--c-orange);
  border-radius: 9.494px;
}

.spec-hero-chip-icon img {
  display: block;
}

.spec-hero-chip-text {
  display: flex;
  flex-direction: column;
}

.spec-hero-chip-text b {
  padding-bottom: 0.949px;
  font-weight: 600;
  font-size: 12.818px;
  line-height: normal;
  white-space: nowrap;
}

.spec-hero-chip-text small {
  padding-bottom: 0.949px;
  font-weight: 300;
  font-size: 10.444px;
  line-height: normal;
  white-space: nowrap;
}

/* The tilted cards need ~540px either side of centre; hide them before they
   run into the heading. */
@media (max-width: 1100px) {
  .spec-hero-claim,
  .spec-hero-chip {
    display: none;
  }

  .spec-hero-photo {
    left: auto;
    right: -120px;
  }
}

@media (max-width: 768px) {
  .specialities-v2 {
    --page-gutter: 20px;
  }

  .spec-hero {
    min-height: 0;
    padding: 56px 0;
  }

  .spec-hero-photo {
    right: -200px;
    opacity: 0.25;
  }

  .spec-hero-heading {
    font-size: 30px;
    line-height: 38px;
  }

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

@media (max-width: 400px) {
  .spec-hero-heading {
    font-size: 26px;
    line-height: 34px;
  }
}

/* ============================================================= */
/* Hero animation                                                 */
/* Copy rises in, the stethoscope slides in from the right, and   */
/* the two claim cards drop in then keep a slow float. Animations */
/* sit on the wrappers so the cards' Figma rotations stay intact. */
/* ============================================================= */
@keyframes spec-rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

@keyframes spec-photo-in {
  from { opacity: 0; transform: translateX(60px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

@keyframes spec-card-in {
  from { opacity: 0; transform: translateY(-28px) scale(0.9); }
  to   { opacity: 1; transform: none; }
}

@keyframes spec-float {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -10px; }
}

@keyframes spec-float-alt {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 8px; }
}

.spec-hero-inner > * {
  animation: spec-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

.spec-hero-pill                         { animation-delay: 0.05s; }
.spec-hero-heading                      { animation-delay: 0.15s; }
.spec-hero-lead                         { animation-delay: 0.3s; }

.spec-hero-heading .accent {
  display: inline-block;
  animation: spec-rise 0.8s 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

.spec-hero-photo {
  animation: spec-photo-in 1.1s 0.1s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

/* Entrance (transform) and float (translate) are separate properties, so they combine. */
.spec-hero-claim {
  animation:
    spec-card-in 0.9s 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) backwards,
    spec-float 6s 1.4s ease-in-out infinite;
}

.spec-hero-chip {
  animation:
    spec-card-in 0.9s 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) backwards,
    spec-float-alt 7s 1.5s ease-in-out infinite;
}

/* Status pill gives a single "approved" pulse once the card lands. */
@keyframes spec-paid {
  0%   { box-shadow: 0 0 0 0 rgba(27, 127, 85, 0.45); }
  100% { box-shadow: 0 0 0 10px rgba(27, 127, 85, 0); }
}

.spec-hero-claim-status {
  animation: spec-paid 1.2s 1.35s ease-out 2;
}

@media (prefers-reduced-motion: reduce) {
  .spec-hero-inner > *,
  .spec-hero-heading .accent,
  .spec-hero-photo,
  .spec-hero-claim,
  .spec-hero-chip,
  .spec-hero-claim-status {
    animation: none;
  }
}

/* ============================================================= */
/* Specialties directory — Figma node 10004:11580                 */
/* 680px search pill, then 280px cards: 4 per row, 20px / 40px    */
/* gaps, the last row centred.                                    */
/* ============================================================= */
.spec-directory {
  padding: 60px 0;
  background: #fff;
}

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

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

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

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

.spec-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;
}

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

.spec-search-btn {
  flex-shrink: 0;
  padding: 16px 38px;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 15px;
  line-height: normal;
  color: #fff;
  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;
}

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

.spec-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 20px;
  justify-content: center;
  width: 100%;
  max-width: 1180px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.spec-grid-item {
  display: flex;
  width: 280px;
  margin: 0;
}

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

.spec-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  padding: 20px;
  overflow: hidden;
  text-decoration: none;
  background: #fff;
  border: 1.6px solid #efefef;
  border-radius: 5px;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.3s ease, box-shadow 0.35s ease;
}

.spec-card-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  box-sizing: border-box;
  padding: 14.286px;
  background: #fff;
  border: 1.429px solid var(--c-orange);
  border-radius: 61.429px;
  filter: drop-shadow(0 0 3.571px rgba(0, 0, 0, 0.25));
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), background-color 0.3s ease;
}

/* Keep each SVG at its Figma frame size (Urgent Care is 70px wide and overhangs the padding). */
.spec-card-icon img {
  display: block;
  flex-shrink: 0;
  max-width: none;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.spec-card-name {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 20px;
  line-height: 28px;
  color: #1f2937;
  text-align: center;
  white-space: nowrap;
  transition: color 0.3s ease;
}

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

/* ---------- Hover / focus ---------- */
.spec-card:hover,
.spec-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(252, 93, 97, 0.45);
  box-shadow: 0 18px 32px -18px rgba(39, 55, 117, 0.45);
}

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

.spec-card:hover .spec-card-icon,
.spec-card:focus-visible .spec-card-icon {
  transform: scale(1.06);
  background: #fff5f5;
}

.spec-card:hover .spec-card-icon img,
.spec-card:focus-visible .spec-card-icon img {
  transform: scale(1.1) rotate(-4deg);
}

.spec-card:hover .spec-card-name,
.spec-card:focus-visible .spec-card-name {
  color: var(--c-blue);
}

/* ---------- Animation ---------- */
/* Scroll reveal (script-v2.js tags [data-anim]); rows sweep in by column. */
.specialities-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;
}

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

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

.specialities-v2 .spec-grid-item[data-anim] {
  transition-delay: calc(var(--col, 0) * 0.08s);
}

/* Search results pop back in (--n: position among the matches, set by the script). */
@keyframes spec-pop {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: none; }
}

.spec-grid-item.is-filtered-in {
  animation: spec-pop 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  animation-delay: calc(min(var(--n, 0), 12) * 0.03s);
}

@media (prefers-reduced-motion: reduce) {
  .spec-card,
  .spec-card-icon,
  .spec-card-icon img {
    transition: none;
  }

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

  .spec-grid-item.is-filtered-in {
    animation: none;
  }

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

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .spec-grid-item {
    width: calc((100% - 40px) / 3);
  }
}

@media (max-width: 900px) {
  .spec-grid-item {
    width: calc((100% - 20px) / 2);
  }

  .spec-card-name {
    white-space: normal;
  }
}

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

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

  .spec-grid {
    gap: 16px 12px;
  }

  .spec-grid-item {
    width: calc((100% - 12px) / 2);
  }

  .spec-card {
    gap: 12px;
    padding: 16px 10px;
  }

  .spec-card-icon {
    width: 80px;
    height: 80px;
    padding: 11px;
  }

  .spec-card-icon img {
    transform: scale(0.8);
  }

  .spec-card:hover .spec-card-icon img,
  .spec-card:focus-visible .spec-card-icon img {
    transform: scale(0.88) rotate(-4deg);
  }

  .spec-card-name {
    font-size: 15px;
    line-height: 21px;
  }

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

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