/* --------- 404 --------- */

.not-found-section {
  padding-top: var(--wp--preset--spacing--70);
  padding-bottom: var(--wp--preset--spacing--70);
  margin-top: auto;
  margin-bottom: auto;
  text-align: center;
}

.not-found-code {
  font-size: var(--wp--preset--font-size--huge);
  line-height: 1;
  color: var(--wp--preset--color--outline);
  margin: 0;
}

.not-found-text {
  margin-top: 0;
  margin-bottom: var(--wp--preset--spacing--40);
  color: var(--wp--preset--color--contrast);
}

/* --------- Text and image, a band on mobile (patterns/text-image-band.php) --------- */

/* Once Media & Text stacks, the section turns into a yellow band of text,
   its illustration dropped and its button navy, as the mobile mockup draws
   it. A class on the section's Group: nothing in the block settings can say
   "only below this width". */
@media (max-width: 781px) {
  .mobile-band {
    background-color: var(--wp--preset--color--secondary);
  }

  .mobile-band .wp-block-media-text__media {
    display: none;
  }

  .mobile-band .wp-block-media-text.is-stacked-on-mobile > .wp-block-media-text__content {
    padding: 0;
  }

  .mobile-band .wp-block-media-text__content > p {
    color: var(--wp--preset--color--primary);
  }

  .mobile-band .wp-block-button:not(.is-style-outline-dark, .is-style-outline-light) > .wp-block-button__link {
    border-color: var(--wp--preset--color--primary);
    background-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--base);
  }
}

/* --------- A picture left out on a phone (patterns/cards-stack-image.php, image-text-panel.php) --------- */

@media (max-width: 781px) {
  .wp-block-column.hide-on-phone {
    display: none;
  }
}

/* --------- A cut-out photo on a coloured panel (patterns/cards-image-panel.php, faq-image.php) --------- */

/* The Group's own colour and radius are the panel; the photo, on a flat
   ground of that same colour, fills its width and sits on its lower edge. The
   panel runs the full height of its column. */
.wp-block-group.photo-panel {
  box-sizing: border-box;
  height: 100%;
  overflow: hidden;
}

.photo-panel > .wp-block-image {
  margin: 0;
}

.photo-panel > .wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* --------- Yellow band with an icon (patterns/figure-image-band.php) --------- */

/* On a phone the band's padding and its icon shrink: nothing in the block
   settings can say "only below this width". The padding is an inline style,
   hence !important. */
@media (max-width: 781px) {
  .wp-block-group.icon-band {
    padding: var(--wp--preset--spacing--50) !important;
  }

  .icon-band .wp-block-image img {
    width: 56px;
  }
}

/* --------- Call to action with photo (patterns/cta-photo.php) --------- */

.cta-photo .wp-block-media-text__content > h2 {
  max-width: 36rem;
}

.cta-photo .wp-block-media-text__content > p {
  max-width: 30rem;
}

/* With the photo on the right the text keeps off the container's edge too,
   as the home page mockup draws it. */
.cta-photo.has-media-on-the-right > .wp-block-media-text__content {
  padding-left: 6.5%;
}

/* One column, as the mobile mockup draws it: text first, then the photo
   edge to edge, square-cornered, down on the footer. The section's bottom
   padding is an inline style, hence !important. */
@media (max-width: 781px) {
  .wp-block-group:has(> .cta-photo) {
    padding-bottom: 0 !important;
  }

  .wp-block-media-text.cta-photo > .wp-block-media-text__content {
    grid-row: 1;
    padding: 0 0 var(--wp--preset--spacing--80);
  }

  .wp-block-media-text.cta-photo > .wp-block-media-text__media {
    grid-row: 2;
    margin-left: calc(-1 * var(--wp--style--root--padding-left));
    margin-right: calc(-1 * var(--wp--style--root--padding-right));
  }

  .cta-photo .wp-block-media-text__media img {
    aspect-ratio: 16 / 15;
    object-fit: cover;
    border-radius: 0;
  }
}

/* --------- Text with key points (patterns/text-points.php) --------- */

.text-points .wp-block-column > p {
  max-width: 34rem;
}

/* --------- Contact boxes (patterns/contact-boxes.php) --------- */

/* Boxes in a row match in height. */
.contact-box {
  box-sizing: border-box;
  height: 100%;
}

/* Numbers and addresses read as text, not as yellow links. */
.contact-box a:where(:not(.wp-element-button)) {
  color: inherit;
  text-decoration: none;
}

.contact-box a:where(:not(.wp-element-button)):hover {
  text-decoration: underline;
}

/* A phone number breaks at its hyphens otherwise. */
.contact-box a[href^="tel:"] {
  white-space: nowrap;
}

/* A label over a number in its paragraph (Visa:) is smaller than it. */
.contact-box mark {
  font-size: var(--wp--preset--font-size--large);
}

/* --------- Contact details (patterns/contact-enquiry.php) --------- */

.contact-details a {
  color: inherit;
  text-decoration: none;
}

.contact-details a:hover {
  text-decoration: underline;
}

.contact-details a[href^="tel:"] {
  white-space: nowrap;
}

/* The form goes under the address already on a tablet, where core still
   keeps columns side by side. The address column's top padding lines its
   heading up with the panel's; stacked, there is nothing to line up with.
   The block settings are inline styles, hence !important. */
@media (max-width: 1024px) {
  .wp-block-columns.contact-enquiry {
    flex-wrap: wrap !important;
  }

  .contact-enquiry > .wp-block-column {
    flex-basis: 100% !important;
  }

  .contact-enquiry > .wp-block-column:first-child {
    padding-top: 0 !important;
  }
}

/* Phones: less padding in the form's panel than its sidebar sets. */
@media (max-width: 599px) {
  .wp-block-group.contact-panel {
    padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50) !important;
    border-radius: 32px !important;
  }
}

/* --------- Document boxes (patterns/document-boxes.php) --------- */

/* Boxes in a row match in height, and the block above the buttons takes the
   spare room, so the buttons line up at the bottom whatever the titles. Their
   own top margin stays the least space above them. */
.document-box {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: 100%;
}

.document-box > :has(+ .wp-block-buttons) {
  flex-grow: 1;
}

/* --------- Insights --------- */

.insight-featured {
  padding-top: var(--wp--preset--spacing--70);
  padding-bottom: var(--wp--preset--spacing--70);
  background-color: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--base);
}

.insight-featured-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
  align-items: center;
  gap: var(--wp--preset--spacing--70);
}

.insight-featured--no-image .insight-featured-inner {
  grid-template-columns: minmax(0, 1fr);
}

.insight-featured-image img {
  display: block;
  width: 100%;
  aspect-ratio: 558 / 430;
  object-fit: cover;
  border-radius: 24px;
}

.insight-featured-body {
  max-width: 560px;
}

.insight-featured-title {
  margin: 0;
  font-size: var(--wp--preset--font-size--xxxl);
  font-weight: 300;
  line-height: 1;
  color: inherit;
  text-wrap: balance;
}

/* The title's link covers the whole block, image included. */
.insight-featured-title a {
  color: inherit;
  text-decoration: none;
}

.insight-featured-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.insight-featured-excerpt {
  margin: var(--wp--preset--spacing--40) 0 0;
  font-size: var(--wp--preset--font-size--small);
}

/* Above the stretched title link, so it gets its own hover. */
.insight-featured .btn {
  position: relative;
  z-index: 1;
  min-width: 220px;
  margin-top: var(--wp--preset--spacing--50);
}

.insights-section {
  padding-top: var(--wp--preset--spacing--70);
  padding-bottom: var(--wp--preset--spacing--80);
}

.insights-heading {
  margin: 0 0 var(--wp--preset--spacing--50);
  font-size: var(--wp--preset--font-size--xxxl);
  line-height: 1.1;
}

.insights-filters ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 var(--wp--preset--spacing--70);
  padding: 0;
  list-style: none;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* The title's link is stretched over the card; the label link sits above it. */
.insight-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 36px 40px;
  border: 1px solid var(--wp--preset--color--secondary);
  border-radius: 40px;
  color: var(--wp--preset--color--primary);
  transition: border-color 0.2s ease;
}

.insight-card:hover {
  border-color: var(--wp--preset--color--outline);
}

.insight-card:has(.insight-card-title a:focus-visible) {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 2px;
}

.insight-label {
  margin: 0;
  font-size: var(--wp--preset--font-size--small);
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--wp--preset--color--accent);
}

.insight-label a {
  position: relative;
  z-index: 1;
  color: inherit;
  text-decoration: none;
}

.insight-label a:hover {
  text-decoration: underline;
}

.insight-card-title {
  margin: var(--wp--preset--spacing--40) 0 var(--wp--preset--spacing--30);
  font-size: var(--wp--preset--font-size--xl);
  font-weight: 500;
  line-height: 1.25;
  color: inherit;
}

.insight-card-title a {
  color: inherit;
  text-decoration: none;
}

.insight-card-title a:focus-visible {
  outline: none;
}

.insight-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.insight-card-excerpt {
  margin: 0;
  font-size: var(--wp--preset--font-size--small);
}

/* Pinned to the bottom, so the buttons of a row line up. */
/* Above the stretched title link, so it gets its own hover. */
.insight-card-more {
  position: relative;
  z-index: 1;
  min-width: 220px;
  margin-top: auto;
}

/* ...and kept off whatever comes before it. */
.insight-card > :nth-last-child(2) {
  margin-bottom: var(--wp--preset--spacing--50);
}

/* Cards added by Load more. */
.insight-card.is-new {
  animation: insight-card-in 0.4s ease both;
}

@keyframes insight-card-in {
  from {
    opacity: 0;
    translate: 0 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .insight-card.is-new {
    animation: none;
  }
}

.insights-more {
  margin-top: var(--wp--preset--spacing--60);
  text-align: center;
}

/* Down, not the button's usual down-right. */
.insights-more-link::after {
  rotate: 45deg;
}

.insights-more-link[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

/* Visually hidden while it only announces loaded cards; shown for an error. */
.insights-more-status.is-error {
  margin: var(--wp--preset--spacing--30) 0 0;
  color: var(--color-error);
}

.insights-empty {
  margin: 0;
  color: var(--wp--preset--color--contrast);
}

/* Below 1200 the text beside the image gets too narrow for a long title:
   one centred column instead. */
@media (max-width: 1199px) {
  .insight-featured-inner {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: var(--wp--preset--spacing--50);
    text-align: center;
  }

  .insight-featured-image,
  .insight-featured-body {
    width: 100%;
    max-width: 640px;
  }
}

@media (max-width: 767px) {
  .insights-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .insight-card {
    padding: 28px 24px;
    border-radius: 28px;
  }
}

/* Phones stretch buttons, as the full menu's eBanking button does. */
@media (max-width: 599px) {
  .insight-featured .btn,
  .insight-card-more {
    width: 100%;
  }
}

/* --------- Single Insight --------- */

.single-insight {
  padding-top: var(--wp--preset--spacing--60);
  padding-bottom: var(--wp--preset--spacing--80);
}

.single-insight-header {
  margin-bottom: var(--wp--preset--spacing--40);
}

.single-insight-title {
  margin: var(--wp--preset--spacing--30) 0 var(--wp--preset--spacing--40);
  font-size: var(--wp--preset--font-size--xxxl);
  line-height: 1.1;
  color: var(--wp--custom--color--article-title);
}

.single-insight-date {
  margin: 0;
  font-size: var(--wp--preset--font-size--small);
  color: var(--wp--preset--color--primary);
}

.single-insight-image {
  margin: 0 0 var(--wp--preset--spacing--70);
}

.single-insight-image img {
  display: block;
  width: 100%;
  height: min(460px, 56vw);
  object-fit: cover;
  border-radius: 24px;
}

/* --------- Heading with a button beside it (patterns/cards-steps.php) --------- */

/* The heading takes the room the button leaves and wraps its own lines; the
   button drops below it only once that room is under 20rem. */
.heading-with-button > .wp-block-heading {
  flex: 1 1 20rem;
}

/* --------- Rates in tabs (patterns/rates-tabs.php) --------- */

/* On a phone the footnotes under a table start at the text's edge, not
   indented to the table's. !important: the indent is the paragraph's own
   padding, written into its style attribute. */
@media (max-width: 599px) {
  .wp-block-tab-panel p.is-style-footnote {
    padding-left: 0 !important;
  }
}
