/*
 * 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.
 */

/* Metric-adjusted fallback @font-face — must live here (not fonts.css) so the
   fallback families are registered at first paint on mobile, where fonts.css is
   deferred to the lazy phase. src: local() has zero network cost. */
@font-face {
  font-family: bebas-neue-fallback;
  size-adjust: 48%;
  ascent-override: 140%;
  descent-override: 0%;
  line-gap-override: 0%;
  src: local('Arial Narrow'), local('Arial');
}

@font-face {
  font-family: open-sans-fallback;
  size-adjust: 105%;
  ascent-override: 106%;
  descent-override: 27%;
  line-gap-override: 0%;
  src: local('Arial');
}

:root {
  /* colors */
  --background-color: #000;
  --surface-color: #111;
  --color-white: #fff;
  --light-color: #f8f8f8;
  --dark-color: #505050;
  --text-color: #131313;
  --link-color: #3b63fb;
  --link-hover-color: var(--accent);
  --overlay-background-color:lightgrey;
  --accent: #e7b09b;
  --color-announcement-bg: rgb(30 100 210);

  /* fonts */
  --body-font-family: open-sans, open-sans-fallback, system-ui, sans-serif;
  --heading-font-family: bebas-neue, bebas-neue-fallback, sans-serif;

  /* body weights */
  --body-font-weight: 400;
  --body-font-weight-light: 300;
  --body-font-weight-bold: 700;

  /* body sizes (mobile first) */
  --body-font-size-m: 17px;
  --body-font-size-s: 15px;
  --body-font-size-xs: 13px;
  --body-font-size-xxs: 10px;

  /* body line-heights */
  --body-line-height: 1.6;
  --body-line-height-relaxed: 1.8;

  /* heading sizes (mobile first) */
  --heading-font-size-xxl: 44px;
  --heading-font-size-xl: 38px;
  --heading-font-size-l: 28px;
  --heading-font-size-m: 24px;
  --heading-font-size-s: 22px;
  --heading-font-size-xs: 18px;

  /* heading rhythm */
  --heading-line-height: 0.95;
  --heading-letter-spacing: 0.01em;

  /* card border radius */
  --radius: 4px;

  /* nav heights */
  --nav-height: 92px;
  --breadcrumbs-height: 34px;
  --header-height: var(--nav-height);
}

@media (width >= 900px) {
  :root {
    /* body sizes */
    --body-font-size-m: 18px;
    --body-font-size-s: 16px;
    --body-font-size-xs: 14px;

    /* heading sizes */
    --heading-font-size-xxl: 72px;
    --heading-font-size-xl: 48px;
    --heading-font-size-l: 32px;
    --heading-font-size-m: 26px;
    --heading-font-size-s: 24px;
    --heading-font-size-xs: 20px;
  }
}

@media (width <= 680px) {
  body:has(.hero.dark) {
    --nav-height: 75px;
  }
}

html {
  background-color: var(--background-color);
}

body {
  display: none;
  margin: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--body-font-family);
  font-size: var(--body-font-size-m);
  font-weight: var(--body-font-weight);
  line-height: var(--body-line-height);
}

body.appear {
  display: block;
}

/*
 * Authoring helper theme for standalone content-only pages (e.g. the
 * /cookie-consent/default fragment). The site default is a dark background with
 * near-black text, which makes plain authored copy unreadable in the editor.
 * Add `theme: authoring-light` to the page metadata to flip it to a readable
 * light surface. This only affects the standalone page in the editor — blocks
 * that fetch the fragment strip the section/theme, so delivery is unaffected.
 */
body.authoring-light {
  --background-color: #fff;
  --text-color: #131313;
}

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

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

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

@media (width >= 900px) {
  body[data-breadcrumbs] {
    --header-height: calc(var(--nav-height) + var(--breadcrumbs-height));
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0.8em;
  margin-bottom: 0.25em;
  font-family: var(--heading-font-family);
  font-weight: 400;
  line-height: var(--heading-line-height);
  letter-spacing: var(--heading-letter-spacing);
  scroll-margin: 40px;
}

h1 { font-size: var(--heading-font-size-xxl); }
h2 { font-size: var(--heading-font-size-xl); }
h3 { font-size: var(--heading-font-size-l); }
h4 { font-size: var(--heading-font-size-m); }
h5 { font-size: var(--heading-font-size-s); }
h6 { font-size: var(--heading-font-size-xs); }

p,
dl,
ol,
ul,
pre,
blockquote {
  margin-top: 0.8em;
  margin-bottom: 0.25em;
}

code,
pre {
  font-size: var(--body-font-size-s);
}

pre {
  padding: 16px;
  border-radius: 8px;
  background-color: var(--light-color);
  overflow-x: auto;
  white-space: pre;
}

main {
  position: relative;
  z-index: 2;
}

main > div {
  margin: 40px 16px;
}

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

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

a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

/* buttons */
a.button:any-link,
button {
  box-sizing: border-box;
  display: inline-block;
  max-width: 100%;
  margin: 12px 0;
  border: 2px solid transparent;
  border-radius: 2.4em;
  padding: 0.5em 1.2em;
  font-family: var(--body-font-family);
  font-style: normal;
  font-weight: var(--body-font-weight-bold);
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  background-color: var(--link-color);
  color: var(--background-color);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.button:hover,
a.button:focus,
button:hover,
button:focus {
  background-color: var(--link-hover-color);
  cursor: pointer;
}

button:disabled,
button:disabled:hover {
  background-color: var(--light-color);
  cursor: unset;
}

a.button.secondary,
button.secondary {
  background-color: unset;
  border: 2px solid currentcolor;
  color: var(--text-color);
}

/* common CTA button for dark backgrounds */
a.button.outline,
button.outline {
  background: rgb(255 255 255 / 85%);
  color: #000;
  border: none;
  border-radius: 15px;
  font-family: var(--body-font-family);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 14px;
  margin: 0;
  max-width: none;
  white-space: nowrap;
  transition: background 0.2s;
}

a.button.outline:hover,
a.button.outline:focus,
button.outline:hover,
button.outline:focus {
  background: #e0e0e0;
  color: #000;
}

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

.icon {
  display: inline-block;
  height: 24px;
  width: 24px;
}

.icon img {
  height: 100%;
  width: 100%;
}

/* sections */
main > .section {
  margin: 40px 0;
}

main > .section > div {
  max-width: 1200px;
  margin: auto;
  padding: 0 24px;
}

main > .section:first-of-type {
  margin-top: 0;
}

@media (width >= 900px) {
  main > .section > div {
    padding: 0 32px;
  }
}

/* section metadata */
main .section.light,
main .section.highlight {
  background-color: var(--light-color);
  margin: 0;
  padding: 40px 0;
}

/* dark full-bleed sections — remove gaps, apply black background */
main .section:has(.featured-programmes),
main .section:has(.more-to-explore),
main .section:has(.all-programmes) {
  position: relative;
  z-index: 1;
  width: 100vw;
  margin: 0 0 0 calc(50% - 50vw);
  background-color: #000;
}

/* all-programmes sticky bar must paint above adjacent sections */
main .section:has(.all-programmes) {
  z-index: 2;
}

main .section:has(.hero.dark),
main .section:has(.hero.dark-home) {
  position: relative;
  width: 100vw;
  margin: calc(-1 * var(--nav-height)) 0 0 calc(50% - 50vw);
  background-color: #000;
}

main .section:has(.featured-programmes) > div,
main .section:has(.more-to-explore) > div,
main .section:has(.all-programmes) > div,
main .section:has(.hero.dark) > div,
main .section:has(.hero.dark-home) > div {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0;
}

/* tablet: reduce horizontal padding on card blocks */
@media (width > 680px) and (width <= 900px) {
  main .section:has(.featured-programmes) .featured-programmes,
  main .section:has(.more-to-explore) .more-to-explore,
  main .section:has(.all-programmes) .all-programmes {
    padding: 20px 30px;
  }

  main .section:has(.all-programmes) .all-programmes-sticky {
    margin-left: -30px;
    margin-right: -30px;
    padding-left: 30px;
    padding-right: 30px;
  }

}

/* image-only dark-home hero: full-bleed at ≤1440px */
@media (width <= 1440px) {
  main .section:has(.hero.dark-home:not(:has(h1, h2, h3, p))) > div {
    max-width: unset;
  }
}


main .section:has(.columns.aside-prose) {
  margin: 0;
  background-color: #000;
}

main .section.accordion-dark-section {
  margin: 0;
  padding: 48px 0;
  background-color: #000;
}

main .section.director-section {
  margin: 0;
  padding: 0 0 48px;
  background-color: #000;
}


@media (width <= 680px) {
  .all-programmes-row li,
  .featured-programmes-row li,
  .more-to-explore li {
    min-height: 260px;
    padding: 15px;
  }

  .section.director-section + .section > div {
    padding-left: 0;
    padding-right: 0;
  }
}

/* Universal Editor — white backgrounds for authoring legibility.
   Excludes the footer and nav authoring pages (their icons/logos are white
   and need to stay on a dark background). */
html:has(body[data-aue-resource]:not([data-aue-resource*="/footer"], [data-aue-resource*="/nav"])),
body[data-aue-resource]:not([data-aue-resource*="/footer"], [data-aue-resource*="/nav"]),
body[data-aue-resource]:not([data-aue-resource*="/footer"], [data-aue-resource*="/nav"]) main .section:has(.all-programmes),
body[data-aue-resource]:not([data-aue-resource*="/footer"], [data-aue-resource*="/nav"]) main .section.accordion-dark-section,
body[data-aue-resource]:not([data-aue-resource*="/footer"], [data-aue-resource*="/nav"]) main .section.director-section,
body[data-aue-resource]:not([data-aue-resource*="/footer"], [data-aue-resource*="/nav"]) .featured-programmes,
body[data-aue-resource]:not([data-aue-resource*="/footer"], [data-aue-resource*="/nav"]) .more-to-explore,
body[data-aue-resource]:not([data-aue-resource*="/footer"], [data-aue-resource*="/nav"]) .all-programmes,
body[data-aue-resource]:not([data-aue-resource*="/footer"], [data-aue-resource*="/nav"]) .all-programmes-sticky,
body[data-aue-resource]:not([data-aue-resource*="/footer"], [data-aue-resource*="/nav"]) .accordion {
  background-color: #fff !important;
  background-image: none !important;
}

