/* ==========================================================================
   Block: Service Cards
   File:   css/blocks/service-cards.css
   Markup: includes/blocks/service-cards.php

   Figure and ground are flipped from the old treatment: solid navy cards
   standing on the cream page, each capped with a gold rule. Gold carries the
   card titles because they sit on navy, where it clears AA at 5.6:1.
   ========================================================================== */

.service-cards {
  --sc-columns: 4;
  --sc-max-width: var(--vir-measure);
  --sc-gap: 24px;
  --sc-title-size: 22px;
  --sc-text-size: 15px;

  width: 100%;
  margin: var(--vir-section-gap) 0 0;
  padding: 0 var(--vir-gutter);
  box-sizing: border-box;
}

.service-cards__panel {
  position: relative;
  width: 100%;
  max-width: var(--sc-max-width);
  margin: 0 auto;
}

/* The background photo is not used in the redesigned section. */
.service-cards__media {
  display: none;
}

/* --- Grid ---------------------------------------------------------------- */

.service-cards__grid {
  display: grid;
  grid-template-columns: repeat(var(--sc-columns), minmax(0, 1fr));
  gap: var(--sc-gap);
  width: 100%;
}

.service-cards__card {
  display: flex;
  flex-direction: column;
  padding: 34px 28px 36px;
  border: 0;
  border-top: 6px solid var(--vir-gold);
  border-radius: 0;
  background-color: var(--vir-surface);
  box-shadow: none;
  transition: transform 0.4s ease-in-out, background-color 0.4s ease;
  box-sizing: border-box;
}

.service-cards__card:hover {
  position: relative;
  z-index: 1;
  transform: translateY(-6px);
  background-color: #12408a;
}

@media (prefers-reduced-motion: reduce) {
  .service-cards__card,
  .service-cards__card:hover {
    transition: none;
    transform: none;
  }
}

.service-cards__index {
  display: block;
  margin: 0 0 18px;
  color: var(--vir-gold);
  font-family: var(--vir-font-display);
  font-size: 34px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.service-cards__icon {
  display: block;
  width: 76px;
  height: 70px;
  margin: 0 0 22px;
  object-fit: contain;
  object-position: left center;
  /* The icon sets differ - the home page artwork is white, the clinical
     services artwork is black. brightness(0) flattens any opaque pixel to
     black while keeping alpha, then invert(1) lifts it to white, so either
     set (or any future upload) renders white on the navy card. */
  filter: brightness(0) invert(1);
}

.service-cards .service-cards__title {
  margin: 0 0 16px;
  padding: 0 0 16px;
  border-bottom: 2px solid rgba(201, 162, 39, 0.5);
  color: var(--vir-gold);
  font-family: var(--vir-font-display);
  font-size: var(--sc-title-size);
  line-height: 1.15em;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.service-cards .service-cards__text {
  flex: 1 1 auto;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-family: var(--vir-font-body);
  font-size: var(--sc-text-size);
  line-height: 1.8em;
  font-weight: 400;
  letter-spacing: 0.04em;
}

/* --- Card button --------------------------------------------------------- */

.service-cards .service-cards__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 42px;
  margin: 26px 0 0;
  padding: 10px 24px;
  text-align: center;
  border: 1px solid var(--vir-gold);
  border-radius: 50px;
  background-color: transparent;
  color: var(--vir-gold);
  font-family: var(--vir-font-body);
  font-size: 14px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-decoration: none;
  box-sizing: border-box;
  transition: background-color 0.4s, color 0.4s;
}

.service-cards .service-cards__button:hover {
  background-color: var(--vir-gold);
  color: var(--vir-navy);
  text-decoration: none;
}

/* --- Plain variant: same cards, just no wrapper treatment ---------------- */

.service-cards--plain .service-cards__panel {
  padding: 0;
  background-color: transparent;
}

/* --- Outline off --------------------------------------------------------- */

.service-cards--no-outline .service-cards__card {
  border-top-color: transparent;
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 1249px) {
  .service-cards {
    --sc-title-size: 20px;
    --sc-gap: 18px;
  }

  .service-cards__card {
    padding: 30px 22px 32px;
  }
}

@media (max-width: 991px) {
  .service-cards .service-cards__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-cards {
    --sc-gap: 22px;
  }
}

@media (max-width: 575px) {
  .service-cards .service-cards__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .service-cards {
    --sc-title-size: 19px;
  }

  .service-cards__card {
    padding: 28px 22px 30px;
  }
}

/* --- Section head --------------------------------------------------------- */

.service-cards__head {
  max-width: 760px;
  margin: 0 0 48px;
}

.service-cards .service-cards__heading {
  margin: 0;
  color: var(--vir-heading);
  font-family: var(--vir-font-display);
  font-size: 38px;
  line-height: 1.12em;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

.service-cards .service-cards__heading::before {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin: 0 0 26px;
  background-color: var(--vir-gold);
}

.service-cards .service-cards__intro p {
  margin: 20px 0 0;
  color: var(--vir-body);
  font-family: var(--vir-font-body);
  font-size: 16px;
  line-height: 1.8em;
  letter-spacing: 0.04em;
}

.service-cards .service-cards__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin: 44px 0 0;
  padding: 12px 32px;
  text-align: center;
  border: 1px solid var(--vir-gold);
  border-radius: 50px;
  background-color: var(--vir-gold);
  color: var(--vir-navy);
  font-family: var(--vir-font-body);
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.4s, color 0.4s, border-color 0.4s;
  box-sizing: border-box;
}

.service-cards .service-cards__cta:hover {
  border-color: var(--vir-white);
  background-color: transparent;
  color: var(--vir-white);
  text-decoration: none;
}

/* --- Stacked list style (virq.com.au) -------------------------------------
   Each category becomes a full-width row: the name on the left, its
   procedures listed on the right, separated by gold hairlines. */

.service-cards--list .service-cards__panel {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background-color: transparent;
  overflow: visible;
  max-width: var(--vir-measure);
  margin: 0 auto;
}

.service-cards--list .service-cards__media {
  display: none;
}

.service-cards--list .service-cards__grid {
  display: block;
  border-top: 1px solid rgba(201, 162, 39, 0.35);
}

.service-cards--list .service-cards__card {
  display: grid;
  grid-template-columns: 64px minmax(0, 300px) minmax(0, 1fr);
  align-items: start;
  gap: 32px;
  padding: 34px 0;
  border: 0;
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
  background-color: transparent;
  transform: none;
  transition: background-color 0.4s ease;
}

.service-cards--list .service-cards__card:hover {
  transform: none;
  background-color: rgba(255, 255, 255, 0.03);
}

.service-cards--list .service-cards__index {
  margin: 0;
  font-size: 22px;
}

.service-cards--list .service-cards__iconwrap {
  display: none;
}

.service-cards--list .service-cards__title {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 24px;
}

.service-cards--list .service-cards__text,
.service-cards--list .service-cards__list {
  margin: 0;
}

.service-cards--list .service-cards__button {
  grid-column: 2 / -1;
  margin-top: 18px;
}

@media (max-width: 991px) {
  .service-cards .service-cards__heading {
    font-size: 30px;
  }

  .service-cards--list .service-cards__card {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 20px;
  }

  .service-cards--list .service-cards__text,
  .service-cards--list .service-cards__list {
    grid-column: 2;
    margin-top: 12px;
  }

  .service-cards--list .service-cards__button {
    grid-column: 2;
  }
}

@media (max-width: 575px) {
  .service-cards .service-cards__heading {
    font-size: 23px;
  }

  .service-cards--list .service-cards__card {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .service-cards--list .service-cards__text,
  .service-cards--list .service-cards__list,
  .service-cards--list .service-cards__button {
    grid-column: 1;
  }

  .service-cards .service-cards__cta {
    width: 100%;
  }
}

/* --- Wrappers ------------------------------------------------------------
   The card's aside/main pair is inert in every style but "feature", which
   needs them as two real columns. */

.service-cards__aside,
.service-cards__main {
  display: contents;
}

/* --- Procedure list -------------------------------------------------------
   The hyphenated lines are rendered as a real list; the marker is a short
   gold dash rather than a typed hyphen. */

.service-cards .service-cards__list {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  list-style: none;
  columns: var(--sc-list-columns, 1);
  column-gap: 40px;
}

.service-cards .service-cards__list li {
  position: relative;
  margin: 0 0 10px;
  padding: 0 0 0 22px;
  color: rgba(255, 255, 255, 0.84);
  font-family: var(--vir-font-body);
  font-size: var(--sc-text-size);
  line-height: 1.7em;
  font-weight: 400;
  letter-spacing: 0.04em;
  break-inside: avoid;
}

.service-cards .service-cards__list li:last-child {
  margin-bottom: 0;
}

.service-cards .service-cards__list li::before {
  content: "";
  position: absolute;
  top: 0.82em;
  left: 0;
  width: 10px;
  height: 2px;
  background-color: var(--vir-gold);
}

/* The stacked list style ran the plain text in two columns; the real list
   inherits that. */
.service-cards--list {
  --sc-list-columns: 2;
}

/* --- Feature rows ---------------------------------------------------------
   Used where the categories are the page rather than a summary of it. Each
   one is a full-width row: the numeral, a ringed icon and the name held in a
   narrow column, the procedures opposite in two columns. Rows alternate
   sides so the page reads as a sequence rather than a table.
   ========================================================================== */

.service-cards--feature {
  --sc-list-columns: 2;
  --sc-text-size: 16px;
}

.service-cards--feature .service-cards__panel {
  max-width: var(--vir-measure);
  min-height: 0;
  padding: 0;
  background-color: transparent;
}

.service-cards--feature .service-cards__media {
  display: none;
}

.service-cards--feature .service-cards__grid {
  display: block;
}

/* Each category is a panel in its own right - the navy surface and gold cap
   the cards carry everywhere else on the site, opened out to full width so
   the procedures can run beside the name rather than under it. */
.service-cards--feature .service-cards__card {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  align-items: stretch;
  gap: 56px;
  margin: 0 0 24px;
  padding: 44px 48px;
  border: 0;
  border-top: 6px solid var(--vir-gold);
  border-radius: 0;
  background-color: var(--vir-surface);
  transform: none;
  transition: background-color 0.4s ease;
}

.service-cards--feature .service-cards__card:last-child {
  margin-bottom: 0;
}

.service-cards--feature .service-cards__card:hover {
  transform: none;
  background-color: #12408a;
}

/* Alternate: the narrow column moves to the right and sets against it. */
.service-cards--feature .service-cards__card:nth-child(even) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
}

.service-cards--feature .service-cards__card:nth-child(even) .service-cards__aside {
  order: 2;
  text-align: right;
}

.service-cards--feature .service-cards__card:nth-child(even) .service-cards__iconwrap {
  margin-left: auto;
  margin-right: 0;
}

.service-cards--feature .service-cards__card:nth-child(even) .service-cards__title::after {
  margin-left: auto;
  margin-right: 0;
}

/* --- Feature: narrow column ---------------------------------------------- */

.service-cards--feature .service-cards__aside {
  display: block;
}

.service-cards--feature .service-cards__index {
  display: block;
  margin: 0 0 20px;
  font-size: 15px;
  letter-spacing: 0.24em;
}

/* The ring lives on the wrapper so the filter that whitens the artwork
   cannot reach the border with it. */
.service-cards--feature .service-cards__iconwrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 104px;
  margin: 0 0 26px;
  border: 1px solid rgba(201, 162, 39, 0.6);
  border-radius: 50%;
  background-color: rgba(201, 162, 39, 0.09);
  box-sizing: border-box;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.service-cards--feature .service-cards__card:hover .service-cards__iconwrap {
  border-color: var(--vir-gold);
  background-color: rgba(201, 162, 39, 0.18);
}

.service-cards--feature .service-cards__icon {
  width: 52px;
  height: 48px;
  margin: 0;
  object-position: center;
}

.service-cards--feature .service-cards__title {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 27px;
  line-height: 1.18em;
}

.service-cards--feature .service-cards__title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin: 20px 0 0;
  background-color: var(--vir-gold);
}

/* --- Feature: procedures ------------------------------------------------- */

/* The procedures column is shorter than the ringed icon beside it, so it
   sits centred against it rather than ragging off the top. */
.service-cards--feature .service-cards__main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 620px;
  padding-top: 6px;
}

/* On the reversed rows the name sits on the right, so the procedures are
   held to that side too rather than stranded across an empty middle. */
.service-cards--feature .service-cards__card:nth-child(even) .service-cards__main {
  margin-left: auto;
}

.service-cards--feature .service-cards__list li {
  margin-bottom: 0;
  padding-top: 11px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.service-cards--feature .service-cards__list li::before {
  top: 1.5em;
}

.service-cards--feature .service-cards__button {
  margin-top: 30px;
}

@media (max-width: 1249px) {
  .service-cards--feature .service-cards__card {
    grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
    gap: 40px;
    padding: 38px 36px;
  }

  .service-cards--feature .service-cards__card:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 250px);
  }

  .service-cards--feature .service-cards__title {
    font-size: 24px;
  }
}

@media (max-width: 1249px) {
  .service-cards--list {
    --sc-list-columns: 1;
  }
}

@media (max-width: 991px) {
  .service-cards--feature,
  .service-cards--list {
    --sc-list-columns: 1;
  }

  .service-cards--feature .service-cards__card,
  .service-cards--feature .service-cards__card:nth-child(even) {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 34px 28px;
  }

  .service-cards--feature .service-cards__card:nth-child(even) .service-cards__aside {
    order: 0;
    text-align: left;
  }

  .service-cards--feature .service-cards__card:nth-child(even) .service-cards__iconwrap,
  .service-cards--feature .service-cards__card:nth-child(even) .service-cards__title::after {
    margin-left: 0;
    margin-right: auto;
  }
}

@media (max-width: 575px) {
  .service-cards--feature .service-cards__title {
    font-size: 21px;
  }

  .service-cards--feature .service-cards__iconwrap {
    width: 84px;
    height: 84px;
  }

  .service-cards--feature .service-cards__icon {
    width: 42px;
    height: 40px;
  }

  .service-cards--feature .service-cards__button {
    width: 100%;
  }
}

/* --- Stacked list: icons in place of numerals -----------------------------
   The categories are named things, not steps, so the original icon artwork
   leads each row instead of a counter. */

.service-cards--list .service-cards__index {
  display: none;
}

.service-cards--list .service-cards__iconwrap {
  display: block;
  width: 100%;
}

.service-cards--list .service-cards__icon {
  display: block;
  width: 54px;
  height: 50px;
  margin: 0;
  object-fit: contain;
  object-position: left center;
}

.service-cards--list .service-cards__card {
  grid-template-columns: 80px minmax(0, 300px) minmax(0, 1fr);
  align-items: center;
}

@media (max-width: 991px) {
  .service-cards--list .service-cards__card {
    grid-template-columns: 62px minmax(0, 1fr);
    align-items: start;
  }

  .service-cards--list .service-cards__icon {
    width: 46px;
    height: 42px;
  }
}

@media (max-width: 575px) {
  .service-cards--list .service-cards__card {
    grid-template-columns: minmax(0, 1fr);
  }

  .service-cards--list .service-cards__iconwrap {
    margin-bottom: 6px;
  }
}

/* --- Procedure links ------------------------------------------------------
   A procedure with its own page links to it. Linked lines have to look
   clickable without hovering - a small arrow alone was too easy to miss - so
   they are set in white with a standing gold underline and a clear arrow.
   Lines without a page stay in the list's quieter colour. */

.service-cards .service-cards__procedure {
  color: var(--vir-white);
  text-decoration: none;
  background-image: linear-gradient(rgba(201, 162, 39, 0.6), rgba(201, 162, 39, 0.6));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  padding-bottom: 2px;
  transition: color 0.3s ease, background-size 0.3s ease;
}

.service-cards .service-cards__procedure:hover,
.service-cards .service-cards__procedure:focus-visible {
  color: var(--vir-gold);
  background-image: linear-gradient(var(--vir-gold), var(--vir-gold));
  background-size: 100% 2px;
  text-decoration: none;
}

.service-cards .service-cards__procedure:focus-visible {
  outline: 2px solid var(--vir-gold);
  outline-offset: 3px;
}

.service-cards .service-cards__procedure::after {
  content: "\2192";
  display: inline-block;
  margin-left: 8px;
  color: var(--vir-gold);
  font-size: 1.05em;
  font-weight: 600;
  transition: transform 0.3s ease;
}

.service-cards .service-cards__procedure:hover::after {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
  .service-cards .service-cards__procedure,
  .service-cards .service-cards__procedure::after {
    transition: none;
  }
}

/* --- White background -----------------------------------------------------
   Everything in this block was drawn for a navy ground, so on white each
   light element is swapped for a dark one. Gold stays where it is
   decoration (rules, dashes, hairlines, the button fill); where it carries
   meaning on its own - the link arrow and hover state - a deeper gold is
   used, because the brand gold on white is only 2.2:1. */

.service-cards.service-cards--bg-white {
  --vir-heading: var(--vir-navy);
  --vir-body: #33415a;
  --sc-gold-on-white: #8a6d12;

  background-color: var(--vir-white);
}

.service-cards--bg-white .service-cards__title {
  color: var(--vir-navy);
}

.service-cards--bg-white .service-cards__list li,
.service-cards--bg-white .service-cards__text,
.service-cards--bg-white .service-cards__intro p {
  color: #33415a;
}

/* Icon artwork is flattened to navy rather than white. */
.service-cards--bg-white .service-cards__icon {
  filter: brightness(0) invert(13%) sepia(52%) saturate(2400%) hue-rotate(205deg) brightness(92%);
}

.service-cards--bg-white.service-cards--list .service-cards__card:hover {
  background-color: rgba(11, 44, 95, 0.035);
}

.service-cards--bg-white .service-cards__procedure {
  color: var(--vir-navy);
}

.service-cards--bg-white .service-cards__procedure:hover,
.service-cards--bg-white .service-cards__procedure:focus-visible {
  color: var(--sc-gold-on-white);
  background-image: linear-gradient(var(--sc-gold-on-white), var(--sc-gold-on-white));
}

.service-cards--bg-white .service-cards__procedure::after {
  color: var(--sc-gold-on-white);
}

.service-cards--bg-white .service-cards__procedure:focus-visible {
  outline-color: var(--vir-navy);
}

/* The section button's hover went white-on-transparent, which vanishes on
   white; it fills navy instead. */
.service-cards--bg-white .service-cards__cta:hover {
  border-color: var(--vir-navy);
  background-color: var(--vir-navy);
  color: var(--vir-white);
}

.service-cards--bg-white .service-cards__button {
  border-color: var(--sc-gold-on-white);
  color: var(--sc-gold-on-white);
}

.service-cards--bg-white .service-cards__button:hover {
  border-color: var(--vir-navy);
  background-color: var(--vir-navy);
  color: var(--vir-white);
}
