/* =========================================================================
   PATIENT INFO TEMPLATE (template-patient-info.php)

   Hero, an insurance-plans grid with a CDCP callout, an out-of-pocket
   payment-methods row, and a directory grid linking every service page —
   reads as a reference/directory page, same spirit as template-cdcp.php but
   its own shapes since the content is different (lists of names, not a
   timeline). Every rule here is presentation only — the words it styles
   are copied verbatim from the live Patient Info page into
   template-patient-info.php's content, not invented by this stylesheet.
   ========================================================================= */

/* -------------------------------------------------------------------------
   HERO
   ------------------------------------------------------------------------- */
.pinfo-hero.fold { padding-top: calc(var(--fold) + var(--sp-2)); padding-bottom: var(--sp-6); }

.pinfo-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.86fr);
  gap: clamp(1.75rem, 3.4vw, 3.6rem);
  align-items: center;
}
.pinfo-hero-copy { max-width: 62ch; }
.pinfo-hero-copy .eyebrow + h1 { margin-top: var(--sp-2); }
.pinfo-hero-copy .lead { margin-top: var(--sp-3); }

/* The hero heading otherwise carries .d4 (the site's largest display
   size) — on this page's shorter, eyebrow-less H1 that read as
   noticeably bigger than the H2s further down, so it's pinned to the
   same .d3 size those use instead of the class on the h1 tag. */
.pinfo-hero-copy h1 { font-size: var(--fs-d3); }

.pinfo-hero-shot {
  position: relative;
  margin: 0; border-radius: var(--r-md); overflow: hidden;
  background: var(--n-10);
  height: 538px;
  box-shadow: 0 30px 60px -34px rgba(var(--deep-rgb), 0.35);
}
.pinfo-hero-shot img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform var(--t-3) var(--ease);
}
@media (hover: hover) {
  .pinfo-hero-shot:hover img { transform: scale(1.05); }
}

.pinfo-hero-actions {
  display: flex; flex-wrap: wrap;
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
  margin-top: var(--sp-4);
}

/* -------------------------------------------------------------------------
   INSURANCE — plan grid + CDCP callout
   ------------------------------------------------------------------------- */
.pinfo-insurance.fold { padding-block: calc(var(--fold) / 2); }

.pinfo-insurance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: var(--sp-5);
}

/* A last row holding a single insurer, centred instead of left-hanging.

   There are thirteen insurers, and thirteen divides by four, three and two
   with one left over every time — so at every column count the last tile
   ends up alone under the first column, which reads like a mistake rather
   than the end of a list.

   grid-column:1/-1 gives that orphan the whole row to sit in, justify-self
   centres it there, and the width calc holds it to exactly one column so it
   still matches the tiles above rather than stretching across the row:
   subtract the gaps (one fewer than the columns), divide by the columns.

   The selector has to be re-stated per breakpoint because :nth-child()
   cannot read the column count — and, since thirteen satisfies 4n+1, 3n+1
   AND 2n+1, each narrower rule must first switch the wider one back off or
   two of them would apply at once. */
.pinfo-insurer:last-child:nth-child(4n + 1) {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc((100% - 3 * 0.85rem) / 4);
}
.pinfo-insurer {
  display: flex; align-items: center; justify-content: center;
  padding: 1.1rem 1rem;
  text-align: center;
  background: var(--white);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 var(--hair) var(--rule);
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink);
  transition: box-shadow var(--t-2) var(--ease), transform var(--t-1) var(--ease);
}
@media (hover: hover) {
  .pinfo-insurer:hover { box-shadow: inset 0 0 0 var(--hair) var(--deep); transform: translateY(-2px); }
}

.pinfo-cdcp {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap;
  margin-top: var(--sp-4);
  padding: clamp(1.25rem, 2.2vw, 1.6rem) clamp(1.5rem, 2.4vw, 2rem);
  background: var(--tint-open);
  border-radius: var(--r-md);
}
.pinfo-cdcp-icon {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--white); color: var(--leaf);
  flex: none;
}
.pinfo-cdcp-icon svg { width: 21px; height: 21px; }
.pinfo-cdcp p { font-size: var(--fs-body); font-weight: 500; color: var(--leaf); max-width: 56ch; }
.pinfo-cdcp-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-left: auto;
  font-size: var(--fs-sm); font-weight: 700; color: var(--deep);
  white-space: nowrap;
}
.pinfo-cdcp-link svg { width: 15px; height: 15px; transition: transform var(--t-2) var(--ease); }
@media (hover: hover) {
  .pinfo-cdcp-link:hover svg { transform: translateX(3px); }
}

/* -------------------------------------------------------------------------
   PAYMENT METHODS
   ------------------------------------------------------------------------- */
.pinfo-payment.fold { padding-block: calc(var(--fold) / 2); }
.pinfo-payment .lead { margin-top: var(--sp-3); }

.pinfo-payment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
  margin-top: var(--sp-5);
}
.pinfo-payment-card {
  display: block;
  padding: clamp(1.5rem, 2.4vw, 2rem);
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: 0 22px 44px -34px rgba(var(--deep-rgb), 0.3),
              inset 0 0 0 var(--hair) var(--rule-quiet);
}
.pinfo-payment-card--link {
  transition: box-shadow var(--t-2) var(--ease), transform var(--t-1) var(--ease);
}
@media (hover: hover) {
  .pinfo-payment-card--link:hover {
    box-shadow: 0 22px 44px -34px rgba(var(--deep-rgb), 0.3),
                inset 0 0 0 var(--hair) var(--deep);
    transform: translateY(-2px);
  }
}
.pinfo-payment-icon {
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--tint-open); color: var(--leaf);
}
.pinfo-payment-icon svg { width: 22px; height: 22px; }
.pinfo-payment-card h3 {
  margin-top: var(--sp-3);
  font-size: var(--fs-md); font-weight: 700;
  letter-spacing: var(--track-tight); line-height: 1.25;
}
.pinfo-payment-card p { margin-top: 0.5rem; font-size: var(--fs-body); line-height: 1.6; color: var(--ink-mid); }

/* -------------------------------------------------------------------------
   SERVICES DIRECTORY — links every service page this practice offers
   ------------------------------------------------------------------------- */
.pinfo-services.fold { padding-block: calc(var(--fold) / 2); }

.pinfo-services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: var(--sp-5);
}
.pinfo-service-card {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 1.15rem 1.3rem;
  background: var(--white);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 var(--hair) var(--rule);
  font-size: var(--fs-body); font-weight: 600; color: var(--ink);
  transition: box-shadow var(--t-2) var(--ease), transform var(--t-1) var(--ease), background var(--t-2) var(--ease);
}
.pinfo-service-card svg { width: 16px; height: 16px; flex: none; color: var(--leaf); transition: transform var(--t-2) var(--ease); }
@media (hover: hover) {
  .pinfo-service-card:hover {
    background: var(--deep); color: var(--on-deep);
    box-shadow: none;
    transform: translateY(-2px);
  }
  .pinfo-service-card:hover svg { color: var(--sage); transform: translateX(3px); }
}

/* -------------------------------------------------------------------------
   CLOSING CTA — same reasoning as .cdcp-cta in cdcp.css: the fold--quiet
   section right above it now runs at half padding, so the CTA panel needs
   its own top space back.
   ------------------------------------------------------------------------- */
.pinfo-cta { margin-top: calc(var(--sp-2) - 5px); }

/* -------------------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .pinfo-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .pinfo-hero-shot { order: -1; aspect-ratio: 16 / 9; height: auto; }
  .pinfo-insurance-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* three columns now — turn the four-column centring off before applying
     the three-column one (see the note by the base rule) */
  .pinfo-insurer:last-child:nth-child(4n + 1) {
    grid-column: auto; justify-self: stretch; width: auto;
  }
  .pinfo-insurer:last-child:nth-child(3n + 1) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - 2 * 0.85rem) / 3);
  }
  .pinfo-payment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pinfo-services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  /* Mobile-only unification: every reference page's CTA lands on the same
     top space here, though each keeps its own desktop value above. */
  .pinfo-cta { margin-top: var(--sp-5); }
  .pinfo-hero.fold { padding-bottom: var(--sp-5); }
  .pinfo-hero-shot { aspect-ratio: 4 / 3; }
  .pinfo-hero-actions .btn i { display: none; }

  .pinfo-insurance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* two columns now — same handover again */
  .pinfo-insurer:last-child:nth-child(3n + 1) {
    grid-column: auto; justify-self: stretch; width: auto;
  }
  .pinfo-insurer:last-child:nth-child(2n + 1) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - 0.85rem) / 2);
  }
  .pinfo-cdcp { flex-direction: column; align-items: flex-start; }
  .pinfo-cdcp-link { margin-left: 0; }

  .pinfo-payment-grid { grid-template-columns: minmax(0, 1fr); }
  .pinfo-services-grid { grid-template-columns: minmax(0, 1fr); }
}
