/* Skilled Nursing: the signature section, "What a nurse does at home".

   Four arched doors, one for each clinical area, the way a nurse comes to the door. Each door has a
   narrow front (the "spine": its animated icon and its name) and a visit behind it (the text and the
   "Who comes" badge, a cream card like the badge a nurse wears).

   The still version comes first and is the finished one: four open panels in two columns. That is
   what a visitor without scripts gets. pages/nursing.js adds .nv--live to .nv__stage, turns each name
   into a button and keeps one door open at a time:
     - from 1180px: the four doors stand side by side. The open door is wide, the others are slim
       arches. Opening another one slides the doors along (transform) and widens or narrows them
       (clip-path), so nothing reflows while it moves. Each door is always laid out at the open
       width; the clip shows only its front while it is closed.
     - below 1180px: the doors are a stack. A closed door shows its front, the open one its visit.
   With reduced motion the doors change at once, and only the visit fades in.

   After the doors: "side by side", nursing care and everyday home care, two columns whose three
   rows line up across (subgrid). */

/* ---------- the four doors, still version ---------- */
.nv__stage { position: relative; }
.nv__doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.5rem); }
.nv__item { position: relative; }
.nv__door { position: relative; display: flex; flex-direction: column; height: 100%; border-radius: 3rem 3rem 1.25rem 1.25rem; background: radial-gradient(120% 80% at 24% 0%, #57225F 0%, var(--aub-2) 52%, #2E0D35 100%); box-shadow: inset 0 0 0 1px rgba(232, 181, 82, .5), 0 34px 50px -34px rgba(18, 5, 22, .9); color: var(--on-dark); isolation: isolate; }
.nv__fill { display: none; }
.nv__spine { position: relative; z-index: 1; display: flex; align-items: center; gap: 1.1rem; padding: 1.9rem 2rem 0; border-radius: 3rem 3rem 0 0; }
.nv__icon { flex: none; width: 4.5rem; height: 4.5rem; }
.no-js .nv__icon { display: none; }
.nv__title { font-size: clamp(1.5rem, 2vw, 1.875rem); line-height: 1.12; color: var(--cream); }
.nv__body { position: relative; z-index: 1; display: flex; flex-direction: column; flex: 1 1 auto; gap: 1.6rem; padding: 1.1rem 2rem 2rem; }
.nv__body > p:first-child { max-width: 38rem; font-size: clamp(1.1875rem, .3vw + 1.12rem, 1.3125rem); line-height: 1.62; }

/* "Who comes": a cream badge with the iris, like the one a nurse wears */
.nv__who { display: flex; align-items: center; gap: 1rem; width: fit-content; max-width: 31rem; margin-top: auto; padding: .85rem 1.4rem .85rem .9rem; border-radius: 1.15rem; background: #FFFBF4; box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 22px 30px -20px rgba(18, 5, 22, .95); font-size: 1.0625rem; line-height: 1.42; color: var(--ink); }
.nv__who img { flex: none; width: 2.9rem; height: auto; filter: drop-shadow(0 6px 6px rgba(43, 16, 48, .25)); }
.nv__who strong { display: block; margin-bottom: .1rem; font-size: .9375rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--purple); }

/* the name as a button (added by the script) */
.nv__btn { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; font: inherit; line-height: inherit; letter-spacing: inherit; color: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.nv__btn::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.nv__btn:focus-visible { outline: none; }
.nv__btn:focus-visible::after { box-shadow: inset 0 0 0 3px var(--gold-light); }
/* the small round mark under a closed door's name: a plus, gold when the pointer is on the door */
.nv__mark { position: relative; display: block; width: 2.75rem; height: 2.75rem; margin-top: .9rem; border: 1px solid rgba(232, 181, 82, .7); border-radius: 50%; transition: opacity 200ms ease, transform 160ms var(--ease-out), background-color 200ms ease, border-color 200ms ease; }
.nv__mark::before, .nv__mark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1rem; height: 2px; margin: -1px 0 0 -.5rem; border-radius: 2px; background: var(--gold-light); transition: background-color 200ms ease; }
.nv__mark::after { transform: rotate(90deg); }
.nv__btn:active .nv__mark { transform: scale(.92); }
.is-open .nv__mark { opacity: 0; transform: scale(.8); }

/* ---------- live: the doors stand in a row (wide screens) ---------- */
@media (min-width: 1180px) {
  .nv--live .nv__doors { --c: clamp(9.5rem, 12.5vw, 11.25rem); --g: 1rem; --o: calc(100cqw - 3 * var(--c) - 3 * var(--g)); --r: 6rem; --h: clamp(31rem, calc(100vh - var(--header-h) - 7rem), 35rem); container-type: inline-size; position: relative; display: block; height: var(--h); }
  /* the threshold the doors stand on */
  .nv--live .nv__doors::after { content: ""; position: absolute; left: -1.5rem; right: -1.5rem; bottom: 0; height: 1px; background: linear-gradient(90deg, rgba(232, 181, 82, 0), rgba(232, 181, 82, .7) 8%, rgba(232, 181, 82, .7) 92%, rgba(232, 181, 82, 0)); }
  /* the items are only frames for the doors: the clipped door is what takes a tap */
  .nv--live .nv__item { --w: var(--c); --x: calc(var(--i) * (var(--c) + var(--g))); position: absolute; left: 0; top: 0; width: var(--o); height: 100%; pointer-events: none; }
  .nv--live .nv__door { pointer-events: auto; }
  .nv--live .nv__item.is-after { --x: calc(var(--i) * (var(--c) + var(--g)) + var(--o) - var(--c)); }
  .nv--live .nv__item.is-open { --w: var(--o); z-index: 1; }

  /* the door: its gold background is the hairline that shows round the fill */
  .nv--live .nv__door { position: absolute; inset: 0; display: grid; grid-template-columns: var(--c) minmax(0, 1fr); height: auto; border-radius: 0; background: rgba(232, 181, 82, .62); box-shadow: none; transform: translateX(var(--x)); clip-path: inset(0 calc(var(--o) - var(--w)) 0 0 round var(--r) var(--r) 0 0); transition: transform 600ms var(--ease-in-out), clip-path 600ms var(--ease-in-out); }
  .nv--live .nv__fill { display: block; position: absolute; inset: 0; z-index: 0; overflow: hidden; background: linear-gradient(180deg, #3D1345 0%, var(--aub-2) 46%, #2B0B31 100%); clip-path: inset(1px calc(var(--o) - var(--w) + 1px) 0 1px round calc(var(--r) - 1px) calc(var(--r) - 1px) 0 0); transition: clip-path 600ms var(--ease-in-out); }
  /* the open door is lit from inside */
  .nv--live .nv__fill::after { content: ""; position: absolute; inset: 0; background: radial-gradient(64% 72% at 26% 18%, #6E3079 0%, #4E1A58 46%, var(--aub-2) 100%); opacity: 0; transition: opacity 420ms ease; }
  .nv--live .is-open .nv__fill::after { opacity: 1; }

  /* the front of the door: icon at the top of the arch, the name at the foot, a stem of gold between */
  .nv--live .nv__spine { flex-direction: column; align-items: stretch; justify-content: space-between; gap: 1rem; height: 100%; padding: clamp(2.1rem, 3vw, 2.6rem) clamp(1rem, 1.3vw, 1.35rem) 1.6rem; border-radius: 999px 999px 0 0; background: linear-gradient(rgba(232, 181, 82, .4), rgba(232, 181, 82, .4)) 50% 34% / 1px 22% no-repeat; }
  .nv--live .nv__spine::before { content: ""; position: absolute; inset: .6rem .6rem 0; border: 1px solid rgba(232, 181, 82, .3); border-bottom: 0; border-radius: 999px 999px 0 0; pointer-events: none; }
  .nv--live .nv__icon { align-self: center; width: clamp(4.25rem, 5.2vw, 5rem); height: clamp(4.25rem, 5.2vw, 5rem); }
  .nv--live .nv__title { font-size: clamp(1.25rem, 1.6vw, 1.5rem); line-height: 1.16; }
  .nv--live .nv__btn::after { inset: .6rem .6rem 0; border-radius: 999px 999px 0 0; }

  /* the visit behind the door */
  .nv--live .nv__body { padding: clamp(2.4rem, 3.4vw, 3.1rem) clamp(2rem, 3.2vw, 3.25rem) 1.6rem clamp(.6rem, 1vw, 1.1rem); opacity: 0; transform: translateX(-1.5rem); transition: opacity 160ms ease, transform 200ms ease; }
  .nv--live .is-open .nv__body { opacity: 1; transform: none; transition: opacity 460ms ease 220ms, transform 760ms var(--ease-out) 170ms; }
  /* the visit is told in the display face, like the first paragraph of "What it is" */
  .nv--live .nv__body > p:first-child { max-width: 33rem; font-family: var(--serif); font-size: clamp(1.375rem, 1.75vw, 1.75rem); line-height: 1.4; letter-spacing: -.004em; color: var(--cream); }
}
@media (min-width: 1180px) and (hover: hover) and (pointer: fine) {
  .nv--live .nv__item:not(.is-open):hover .nv__fill::after { opacity: .42; }
  .nv--live .nv__item:not(.is-open):hover .nv__mark { border-color: var(--gold-light); background: var(--gold-light); }
  .nv--live .nv__item:not(.is-open):hover .nv__mark::before, .nv--live .nv__item:not(.is-open):hover .nv__mark::after { background: #1D0A21; }
}

/* ---------- live: the doors as a stack (tablets and phones) ---------- */
@media (max-width: 1179px) {
  .nv--live .nv__doors { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
  .nv--live .nv__door { border-radius: 2.25rem 2.25rem 1.25rem 1.25rem; }
  .nv--live .nv__item:not(.is-open) .nv__door { background: linear-gradient(180deg, #3D1345 0%, var(--aub-2) 100%); }
  .nv--live .nv__spine { min-height: 6rem; padding: 1.1rem 1.4rem 1.1rem 1.25rem; border-radius: 2.25rem 2.25rem 1.25rem 1.25rem; }
  .nv--live .is-open .nv__spine { padding-bottom: .25rem; }
  .nv--live .nv__title { flex: 1 1 auto; }
  .nv--live .nv__btn { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
  .nv--live .nv__mark { flex: none; margin-top: 0; }
  .nv--live .is-open .nv__mark { display: none; }
  .nv--live .nv__item:not(.is-open) .nv__body { display: none; }
  .nv--live .is-open .nv__body { animation: nv-open 460ms var(--ease-out) both; }
}
@media (max-width: 1179px) and (hover: hover) and (pointer: fine) {
  .nv--live .nv__item:not(.is-open):hover .nv__mark { border-color: var(--gold-light); background: var(--gold-light); }
  .nv--live .nv__item:not(.is-open):hover .nv__mark::before, .nv--live .nv__item:not(.is-open):hover .nv__mark::after { background: #1D0A21; }
}
@keyframes nv-open { from { opacity: 0; transform: translateY(.75rem); } }

/* ---------- live: the doors' own entrance (the script adds .is-in when the row is in view) ---------- */
.nv--live:not(.is-in) .nv__item { opacity: 0; transform: translateY(2.75rem); }
.nv--live.is-in .nv__item { transition: opacity 700ms var(--rv-ease) calc(var(--i) * 90ms), transform 1050ms var(--rv-ease) calc(var(--i) * 90ms); }

/* ---------- side by side ---------- */
.nvs { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(2rem, 5vw, 5.5rem); align-items: start; margin-top: clamp(4.5rem, 8vw, 7rem); padding-top: clamp(3rem, 5vw, 4.5rem); border-top: 1px solid var(--line-gold); }
.nvs__head h3 { color: var(--cream); }
.nvs__head p { margin-top: 1.4rem; max-width: 30rem; font-size: var(--fs-lead); line-height: 1.55; }
.nvs__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto repeat(3, auto); }
.nvs__col { display: grid; grid-row: 1 / span 4; grid-template-rows: subgrid; padding: 0 0 0 clamp(1.5rem, 3vw, 3rem); }
.nvs__col:first-child { padding: 0 clamp(1.5rem, 3vw, 3rem) 0 0; }
.nvs__col + .nvs__col { border-left: 1px solid var(--line-gold); }
.nvs__name { display: flex; align-items: center; gap: .9rem; padding-bottom: 1.5rem; font-family: var(--serif); font-weight: 400; font-size: clamp(1.75rem, 2.3vw, 2.125rem); line-height: 1.08; color: var(--gold-light); }
.nvs__name img { flex: none; width: 3.4rem; height: auto; filter: drop-shadow(0 10px 10px rgba(18, 5, 22, .45)); }
.nvs__list { display: grid; grid-row: 2 / span 3; grid-template-rows: subgrid; }
.nvs__list li { padding: 1.4rem 0 1.6rem; border-top: 1px solid var(--line-gold); }
.nvs__list .sv-t { font-size: clamp(1.375rem, 1.7vw, 1.625rem); }
.nvs__list span { display: block; margin-top: .5rem; max-width: 26rem; }

@media (max-width: 1023px) {
  .nvs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .nv__doors { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
  .nv__door, .nv--live .nv__door { border-radius: 2rem 2rem 1.1rem 1.1rem; }
  .nv__spine, .nv--live .nv__spine { gap: .9rem; padding-left: 1.1rem; border-radius: 2rem 2rem 1.1rem 1.1rem; }
  .nv__spine { padding: 1.4rem 1.25rem 0 1.1rem; }
  .nv__icon { width: 3.75rem; height: 3.75rem; }
  .nv__title { font-size: 1.5rem; }
  .nv__body { gap: 1.25rem; padding: .9rem 1.25rem 1.4rem; }
  .nv__who { width: auto; padding-right: 1.1rem; }
  .nvs__grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .nvs__col, .nvs__col:first-child { display: block; grid-row: auto; justify-self: stretch; padding: 0; }
  .nvs__col + .nvs__col { margin-top: 2.75rem; border-left: 0; }
  .nvs__list { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .nv--live .nv__door, .nv--live .nv__fill, .nv--live .nv__fill::after, .nv__mark { transition: none; }
  .nv--live .nv__body, .nv--live .is-open .nv__body { transform: none; transition: opacity 200ms ease; }
  .nv--live .is-open .nv__body { animation: none; }
}

/* ---------- "Who it helps" and "How care starts" are both cream here: a gold hairline marks the turn ---------- */
.sv-who.cream + .how.cream::before { content: ""; position: absolute; left: 50%; top: 0; width: min(100% - 2 * var(--gutter), var(--wrap)); height: 1px; transform: translateX(-50%); background: linear-gradient(90deg, rgba(200, 144, 48, 0), rgba(200, 144, 48, .6) 12%, rgba(200, 144, 48, .6) 88%, rgba(200, 144, 48, 0)); }

/* ---------- shared-component fix: service.css sets six reasons to three columns at every width, which
   wins over the one-column rule of styles.css on phones. Put them back in one column here. ---------- */
@media (max-width: 899px) {
  .why__item:first-child:nth-last-child(6), .why__item:first-child:nth-last-child(6) ~ .why__item { grid-column: span 6; }
}

/* ---------- this page's photographs ---------- */
/* "What it is": the wide arch keeps the nurse and the people listening to her */
#what-it-is .arch > img { object-position: 38% 50%; }
