/*
 * Copyright 2020 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

/*
 * ⚠️ FONT LICENSING / DOMAIN REQUIRED BEFORE GOING LIVE
 * jaf-facitweb and aktiv-grotesk come from Admiral's licensed Adobe Fonts kit (mcu8nnf),
 * loaded from Adobe's CDN by styles/fonts.css — never rehosted. Add the EDS preview and live
 * domains to the kit before publishing; until then the metric-matched fallback below renders.
 *
 * Admiral replica foundation: tokens, type ramp and button paint are lifted from
 * www.admiral.com (stardust/replica/tokens.json). The source's single layout breakpoint is 768px.
 */

:root {
  /* colors */
  --color-page: #f0f0eb;
  --color-text: #4f4f4f;
  --color-heading: #2350a0;
  --color-link: #0078ff;
  --color-navy: #0c3a84;
  --color-ink: #21201c;
  --color-pale-blue: #82c8ff;
  --color-tile: #7df;
  --color-tile-hover: #5ed7ff;
  --color-tile-ink: #005485;
  --color-border-pod: #b7b7cb;
  --background-color: var(--color-page);
  --text-color: var(--color-text);
  --link-color: var(--color-link);

  /* fonts */
  --body-font-family: jaf-facitweb, jaf-facitweb-fallback, 'Helvetica Neue', helvetica, arial, sans-serif;
  --nav-mobile-font-family: aktiv-grotesk, jaf-facitweb, jaf-facitweb-fallback, 'Helvetica Neue', helvetica, arial, sans-serif;

  /* layout */
  --container: 1024px;
  --container-narrow: 768px;
  --container-chrome: 1200px;

  /* nav height: mobile topbar 50px (+76px quick-action bar on theme "quick-actions" pages), desktop 118px */
  --nav-height: 50px;
}

/* metric-matched fallback for jaf-facitweb (measured: 300 weight renders 94.2% of Arial's
   width, 600 weight 85.7% of Arial Bold; normal line box 1.37em) */
@font-face {
  font-family: jaf-facitweb-fallback;
  src: local('Arial');
  font-weight: 100 450;
  size-adjust: 94.2%;
  ascent-override: 118%;
  descent-override: 27.7%;
  line-gap-override: 0%;
}

@font-face {
  font-family: jaf-facitweb-fallback;
  src: local('Arial Bold'), local('Arial-BoldMT');
  font-weight: 451 900;
  size-adjust: 85.7%;
  ascent-override: 129%;
  descent-override: 30.4%;
  line-gap-override: 0%;
}

body.quick-actions { --nav-height: 126px; }

@media (width >= 768px) {
  :root,
  body.quick-actions { --nav-height: 118px; }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  line-height: 1.15;
  text-size-adjust: 100%;
}

body {
  display: none;
  min-width: 320px;
  margin: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--body-font-family);
  font-size: 9px;
  font-weight: 300;
}

body.appear {
  display: block;
}

header {
  height: var(--nav-height);
}

header .header,
footer .footer {
  visibility: hidden;
}

header .header[data-block-status="loaded"],
footer .footer[data-block-status="loaded"] {
  visibility: visible;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
li,
blockquote,
figure {
  margin: 0;
  padding: 0;
  vertical-align: baseline;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

ul,
ol {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
textarea,
select,
button {
  font: inherit;
}

/* type ramp (source global h1/h2/h3/p rules; desktop at 768px) */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-heading);
  font-weight: 600;
}

h2 {
  padding-bottom: 32px;
  font-size: 21.6px;
  line-height: 30px;
}

h3 {
  margin-top: -10px;
  padding-bottom: 22px;
  font-size: 16.2px;
  line-height: 24px;
}

p {
  margin-top: -12px;
  padding-bottom: 30px;
  font-size: 14.4px;
  line-height: 22px;
}

p a {
  font-size: inherit;
  font-weight: 400;
  line-height: inherit;
}

@media (width >= 768px) {
  h2 {
    font-size: 37.8px;
    line-height: 48px;
  }

  h3 {
    margin-top: -4px;
    padding-bottom: 20px;
    font-size: 19.8px;
    line-height: 28px;
  }

  p {
    margin-top: -10px;
    padding-bottom: 28px;
    font-size: 18px;
    line-height: 28px;
  }
}

/* links */
a:any-link {
  color: var(--link-color);
  text-decoration: none;
  overflow-wrap: break-word;
}

/* buttons — the site's aqua "midi" CTA is the default primary paint; blocks override in context */
p.button-wrapper {
  margin-top: 0;
  padding-bottom: 0;
}

a.button:any-link,
button.button {
  display: inline-block;
  max-width: 100%;
  height: 29px;
  margin: 12px 0 10px;
  padding: 0 10px;
  border: 1px solid #0080c2;
  border-radius: 4px;
  background-image: linear-gradient(#00b8ea 0%, #0080cc 100%);
  color: #fff;
  font-size: 12.15px;
  font-weight: 400;
  line-height: 28px;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
}

@media (width >= 768px) {
  a.button:any-link,
  button.button {
    height: 30px;
    padding: 0 15px 2px;
    font-size: 13.5px;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* sections: blocks paint and contain their own sections */
main > .section {
  margin: 0;
  padding: 0;
}

main .section:empty {
  display: none;
}

main > .section > div {
  max-width: none;
}

main .section > .default-content-wrapper {
  display: flow-root;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 10px;
}

/* default-content section styles (D1) */
main .section.narrow > .default-content-wrapper {
  max-width: var(--container-narrow);
  padding: 15px 10px 40px;
}

main .section.centered-intro > .default-content-wrapper {
  max-width: var(--container-narrow);
  padding: 30px 10px 15px;
  text-align: center;
}

main .section.intro > .default-content-wrapper {
  max-width: var(--container);
  padding: 30px 10px 0;
}

main .section.intro h1 {
  font-size: 18px;
  line-height: 30px;
}

@media (width >= 768px) {
  main .section.narrow > .default-content-wrapper {
    padding: 20px 30px 60px;
  }

  main .section.centered-intro > .default-content-wrapper {
    padding: 50px 30px 20px;
  }

  main .section.intro > .default-content-wrapper {
    padding: 50px 20px 0;
  }

  main .section.intro h1 {
    line-height: 48px;
  }
}

/* About Us child pages (lifted from www.admiral.com/about-us/*) */
main .section.breaker > .default-content-wrapper {
  max-width: var(--container-narrow);
  padding: 30px 10px 0;
}

main .section.breaker p:has(picture, img) {
  margin: -7px 0 36px;
  padding: 0;
  border: 1px solid var(--color-border-pod);
  line-height: 0;
}

main .section.breaker img { width: 100%; }

main .section.article > .default-content-wrapper {
  max-width: var(--container-narrow);
  padding: 15px 10px 40px;
}

main .section:is(.article, .centered-title) h1 {
  padding-bottom: 32px;
  font-size: 21.6px;
  line-height: 30px;
}

main .section.narrow ul {
  margin-top: -12px;
  padding: 0 0 30px 20px;
  list-style: disc;
}

main .section.narrow li {
  padding-bottom: 14px;
  font-size: 14.4px;
  line-height: 22px;
}

main .section.article ul {
  margin-top: -12px;
  padding-left: 20px;
  list-style: disc;
}

main .section.article li {
  padding-bottom: 14px;
  font-size: 14.4px;
  line-height: 22px;
}

/* live: the closing list item carries the section's extra 28px */
main .section.article li:last-child { padding-bottom: 42px; }

main .section.centered-title > .default-content-wrapper {
  max-width: var(--container-narrow);
  text-align: center;
}

main .section.title-banner {
  background-color: var(--color-navy);
  text-align: center;
}

main .section.title-banner > .default-content-wrapper {
  max-width: var(--container);
  padding: 30px 10px 40px;
}

main .section.title-banner h1 {
  margin: -10px 0 20px;
  padding-bottom: 7px;
  border-bottom: 1px solid #357bb0;
  color: var(--color-pale-blue);
  font-size: 18px;
  font-weight: 400;
  line-height: 24px;
}

main .section.title-banner h2 {
  max-width: 628px;
  margin: -6px auto 0;
  padding-bottom: 0;
  color: #fff;
  font-weight: 400;
}

main .section:is(.award, .award-alt) > .default-content-wrapper {
  max-width: var(--container-narrow);
  padding: 30px 10px 40px;
  text-align: center;
}

main .section.award-alt { background-color: #fff; }

main .section:is(.award, .award-alt) p:has(picture, img) {
  margin: 0 0 19px;
  padding: 0;
  line-height: 0;
}

main .section:is(.award, .award-alt) img {
  width: auto;
  max-width: 200px;
  max-height: 73.5px;
  margin: 0 auto;
}

main .section.logos > .default-content-wrapper {
  max-width: var(--container-narrow);
  padding: 0 10px 40px;
}

/* live: .grid__cell--1/3 — stacked 160px cells on mobile, thirds of the 723px grid on desktop */
main .section.logos p:has(picture, img) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 5px 0;
  line-height: 0;
}

main .section.logos img {
  width: 150px;
  height: 150px;
}

main .section.hero-image > .default-content-wrapper {
  max-width: none;
  padding: 0;
}

main .section.hero-image p:has(picture, img) {
  height: 37vw;
  max-height: 283px;
  min-height: 118px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  line-height: 0;
}

main .section.hero-image :is(picture, img) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (width >= 768px) {
  main .section.breaker > .default-content-wrapper { padding: 50px 30px 0; }
  main .section.breaker p:has(picture, img) { margin-top: -4px; }
  main .section.article > .default-content-wrapper { padding: 20px 30px 60px; }

  main .section:is(.article, .centered-title) h1 {
    font-size: 37.8px;
    line-height: 48px;
  }

  main .section.article ul { margin-top: -8px; }

  main .section.narrow ul {
    margin-top: -8px;
    padding-bottom: 28px;
  }

  main .section.narrow li {
    padding-bottom: 16px;
    font-size: 18px;
    line-height: 28px;
  }

  main .section.article li {
    padding-bottom: 16px;
    font-size: 18px;
    line-height: 28px;
  }

  main .section.article li:last-child { padding-bottom: 44px; }

  main .section.centered-title > .default-content-wrapper { padding: 0 30px; }
  main .section.title-banner > .default-content-wrapper { padding: 40px 20px 60px; }

  main .section.title-banner h1 {
    margin: -6px 0 30px;
    padding-bottom: 12px;
    font-size: 25.2px;
    line-height: 34px;
  }

  main .section:is(.award, .award-alt) > .default-content-wrapper { padding: 50px 30px 60px; }
  main .section.logos > .default-content-wrapper { padding: 0 30px 90px; }

  main .section.logos p:has(picture, img) {
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    padding: 0;
  }

  /* live: .hero-banner--B .container { height: 39.5vw; min-height: 554px; max-height: 672px } */
  main .section.hero-image p:has(picture, img) {
    height: 39.5vw;
    max-height: 672px;
    min-height: 554px;
  }
}

/* travel landing + hub section styles — values lifted from www.admiral.com/travel-insurance and
   /travel-insurance/generic (1440 and 360): bg-ice-blue #bef, bg-sea-blue #005485, bg-sky #a7edef,
   hero-banner--C (centred copy, Alfie and Annie cut-outs in the bottom corners). */
main .section.ice-blue { background-color: #bef; }
main .section.sky { background-color: #a7edef; }
main .section.white { background-color: #fff; }
main .section.sea-blue { background-color: #005485; }

main .section.sea-blue :is(h1, h2, h3, h4, p) { color: #fff; }

main .section:is(.ice-blue, .sky, .white, .sea-blue, .centered) > .default-content-wrapper {
  max-width: var(--container-narrow);
  padding: 30px 10px 15px;
}

main .section.centered > .default-content-wrapper { text-align: center; }

/* a page title in a centred section (e.g. the travel-planning sub-folder pages) */
main .section.centered h1 {
  padding-bottom: 20px;
  font-size: 25.2px;
  line-height: 34px;
}

main .section.landing-hero {
  position: relative;
  overflow: hidden;
  background-color: #bef;
  text-align: center;
}

main .section.landing-hero > div {
  position: relative;
  z-index: 1;
}

/* live .hero-banner--C .colour-sea-blue: title, headline and caption in sea blue (#005485) */
main .section.landing-hero > :is(.default-content-wrapper, .hero-wrapper) {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px 10px 22px;
}

/* a hero block followed by default content (the pet hero's Defaqto badge) reads as one panel */
main .section.landing-hero > .hero-wrapper:has(+ .default-content-wrapper) { padding-bottom: 0; }
main .section.landing-hero > .hero-wrapper + .default-content-wrapper { padding-top: 0; }

main .section.landing-hero > .default-content-wrapper > :last-child,
main .section.landing-hero .hero.landing > :last-child { padding-bottom: 0; }

main .section.landing-hero h1 {
  margin: 0 auto 15px;
  padding-bottom: 7px;
  border-bottom: 1px solid #005485;
  color: #005485;
  font-size: 18px;
  font-weight: 400;
  line-height: 24px;
}

main .section.landing-hero h2 {
  padding-bottom: 28px;
  color: #005485;
  font-size: 21.6px;
  font-weight: 600;
  line-height: 30px;
}

main .section.landing-hero p:has(> picture, > img) {
  margin: 0;
  padding: 5px 0 13px;
  line-height: 0;
}

main .section.landing-hero p :is(picture, img) {
  display: inline-block;
  width: auto;
  max-width: 100%;
  height: 40px;
}

main .section.landing-hero p:not(.button-wrapper) {
  color: #005485;
  font-size: 12.15px;
  line-height: 16px;
}

/* mobile: full-width stacked CTAs (live .buttons__flex) */
main .section.landing-hero .button-wrapper {
  display: block;
  margin: 0 0 10px;
}

main .section.landing-hero a.button:any-link {
  display: block;
  height: 34px;
  margin: 0;
  padding: 2px 10px;
  font-size: 14.4px;
  line-height: 28px;
}

/* plain text links under the CTAs (PPC: What's covered? / Pre-existing conditions) */
main .section.landing-hero p:not(.button-wrapper):has(> a) {
  margin-top: 0;
  padding: 10px 0;
}

/* PPC landing (theme ppc, live .hero-banner--A): ink title and a regular-weight headline */
.ppc main .section.landing-hero :is(h1, h2, p:not(.button-wrapper)) { color: #2c2822; }
.ppc main .section.landing-hero h1 { border-bottom-color: #2c2822; }
.ppc main .section.landing-hero h2 { font-weight: 400; }

/* the hero's primary CTA is the live green; secondary keeps the aqua */
main .section.landing-hero a.button.primary:any-link {
  border-color: #009227;
  background-image: linear-gradient(#00c535 0%, #00a32e 100%);
}

/* background: the mobile image sits under the content (live .image-bottom-mobile) */
main .section.has-background .section-background { display: none; }
main .section.has-background-mobile .section-background { display: block; }

main .section.has-background .section-background img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 360 / 133;
  object-fit: cover;
}

/* dark grounds with white text: cornflower (the winter-sports hero, live .bg-cornflower-blue
   #115577) and dark-blue (the pet insurance hero, live .bg-sea-blue #005485) */
main .section.landing-hero.cornflower { background-color: #157; }
main .section.landing-hero.dark-blue { background-color: #005485; }
main .section.landing-hero:is(.cornflower, .dark-blue) :is(h1, h2, h3, p) { color: #fff; }
main .section.landing-hero:is(.cornflower, .dark-blue) h1 { border-bottom-color: #fff; }
:where(main .section.landing-hero:is(.cornflower, .dark-blue)) a:any-link:not(.button) { color: #fff; }

/* quick links bar ("What are you looking for?") */
main .section.sea-blue .button-wrapper {
  display: inline-block;
  margin: 0 4px;
}

main .section.sea-blue a.button:any-link {
  border-color: #fff;
  background: none;
}

/* quick links on a light ground (style quick-links, e.g. pet insurance on ice blue): inline sea-blue
   outline buttons */
main .section.quick-links .button-wrapper {
  display: inline-block;
  margin: 0 4px;
}

main .section.quick-links:not(.sea-blue) a.button:any-link {
  border-color: #005485;
  background: none;
  color: #005485;
}

/* hero block style large-buttons (live pet insurance .button--large): 44px CTAs on mobile,
   52px from tablet up, no border */
main .section.landing-hero .hero.large-buttons a.button:any-link {
  height: 44px;
  padding: 9px 10px;
  border: 0;
  font-size: 16.2px;
  line-height: 24px;
}

@media (width >= 768px) {
  main .section:is(.ice-blue, .sky, .white, .sea-blue, .centered) > .default-content-wrapper {
    padding: 50px 30px 20px;
  }

  main .section.centered h1 {
    font-size: 37.8px;
    line-height: 48px;
  }

  /* live .hero-banner--C: at least 420px, growing with the width (432px at 1440, 510px at 1920);
     the copy is centred vertically */
  main .section.landing-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: max(420px, calc(198px + 16.25vw));
  }

  main .section.landing-hero > :is(.default-content-wrapper, .hero-wrapper) {
    width: 100%;
    max-width: 708px;
    padding: 32px 24px 50px;
  }

  main .section.landing-hero h1 {
    max-width: 660px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    font-size: 25.2px;
    line-height: 34px;
  }

  main .section.landing-hero h2 {
    padding-bottom: 42px;
    font-size: 37.8px;
    line-height: 48px;
  }

  main .section.landing-hero p:has(> picture, > img) { padding: 28px 0 23px; }
  main .section.landing-hero p:not(.button-wrapper) { font-size: 12.6px; }

  /* desktop: two CTAs side by side, 244px wide (live .button--option) */
  main .section.landing-hero .button-wrapper {
    display: inline-block;
    margin: 0 6px;
  }

  main .section.landing-hero a.button:any-link {
    width: 244px;
    height: 40px;
    padding: 3px 15px;
    font-size: 16.2px;
    line-height: 32px;
  }

  main .section.landing-hero .hero.large-buttons a.button:any-link {
    height: 52px;
    padding: 10px 15px;
    font-size: 21.6px;
    line-height: 30px;
  }

  /* the large-button hero (live pet insurance): 26px above the title, 44px under the caption */
  main .section.landing-hero > .hero-wrapper:has(.hero.large-buttons) { padding-top: 26px; }

  main .section.landing-hero .hero.large-buttons h2 {
    max-width: 600px;
    margin-inline: auto;
  }
  main .section.landing-hero > .hero-wrapper:has(.hero.large-buttons) + .default-content-wrapper { padding-bottom: 44px; }

  /* the background covers the section; mobile-only images step aside */
  main .section.has-background-mobile .section-background,
  main .section.has-background .section-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    pointer-events: none;
  }

  main .section.has-background .section-background img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }
}

/* section spacing by neighbour (live community page): an article under a hero banner opens
   wider and runs straight into a following intro; a heading after a pod grid sits closer (.pt-sml) */
main .cards-container + .section.centered-intro > .default-content-wrapper { padding-top: 15px; }
main .section.hero-image + .section.article > .default-content-wrapper { padding-top: 30px; }
main .section.article:has(+ .section.centered-intro) > .default-content-wrapper { padding-bottom: 0; }

@media (width >= 768px) {
  main .cards-container + .section.centered-intro > .default-content-wrapper { padding-top: 20px; }
  main .section.hero-image + .section.article > .default-content-wrapper { padding-top: 50px; }
}

/* card-as-link inner anchor while editing (EW6) */
a .prosemirror-editor a:any-link {
  color: inherit;
  text-decoration: none;
}

/* Experience Workspace edit mode: repaint CTAs from their authored marks (EW3) */
.prosemirror-editor p > :is(strong, em) > a:any-link,
.prosemirror-editor p > a:any-link:has(> :is(strong, em):only-child) {
  display: inline-block;
  height: 30px;
  padding: 0 15px 2px;
  border: 1px solid #0080c2;
  border-radius: 4px;
  background-image: linear-gradient(#00b8ea 0%, #0080cc 100%);
  color: #fff;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 28px;
  text-transform: uppercase;
}

.prosemirror-editor p > a:any-link > :is(strong, em) {
  font-weight: inherit;
  font-style: inherit;
}

