/*
 * Open as App deployment (theme.customCssUrl in config.json): the help center in the style of openasapp.com –
 * black pages, white text, pink #f43f83 accents, Roboto 500 headings, pill buttons in capitals with the rocket,
 * white cards with the pink offset block, the light-streak picture behind the search.
 * theme.colors in config.json keeps the light palette for the content admin (/admin has no site header); the dark
 * palette below applies to the public pages only. Header, hero, page, card and footer colors are in config.json.
 * Selectors carry one class more than the component styles, so they win whatever order the stylesheets load in.
 */

/* Dark palette of the website for the public pages */
oaa-root:has(> oaa-header) {
  --oaa-color-background: #000000;
  --oaa-color-text: #ffffff;
  --oaa-color-caption: #ffffff;
  --oaa-color-text-light: #b4b4be;
  --oaa-color-link: #f43f83;
  --oaa-color-separator: #2b2b33;
  --oaa-color-border: #44444f;
  --oaa-color-grey-light: #16161b;
  --oaa-color-grey-medium-light: #24242b;
  --oaa-color-grey-medium: #33333c;
  --oaa-color-grey-dark: #8e8e9c;
  --oaa-color-grey-darker: #b4b4be;
  --oaa-color-shadow: rgba(0, 0, 0, 0.6);
  --oaa-color-secondary-light: rgba(244, 63, 131, 0.2);
  --oaa-color-hint: rgba(244, 63, 131, 0.1);
  --oaa-color-success: rgba(34, 204, 46, 0.14);
  --oaa-color-warning: rgba(242, 169, 0, 0.16);
  --oaa-color-error-light: rgba(217, 48, 37, 0.2);
  --oaa-color-callout-note-background: rgba(244, 63, 131, 0.1);
  --oaa-color-callout-tip-background: rgba(34, 204, 46, 0.12);
  --oaa-color-callout-warning-background: rgba(242, 169, 0, 0.14);
  --oaa-color-callout-caution-background: rgba(217, 48, 37, 0.18);
  color-scheme: dark;
  background: var(--oaa-color-background);
  color: var(--oaa-color-text);
}

body:has(> oaa-root > oaa-header) {
  background: #000000;
}

/* light islands: the search field (with its suggestions) and the category cards stay white like on the website */
oaa-search-box .search .search__bar,
.home .tiles .tile__link {
  --oaa-color-text: #282936;
  --oaa-color-caption: #282936;
  --oaa-color-text-light: #5c5d6b;
  --oaa-color-grey-light: #f5f5f7;
  --oaa-color-card-background: #ffffff;
  color-scheme: light;
}

/* dark form fields and buttons where the components draw white surfaces */
oaa-root:has(> oaa-header) .main .field__input {
  background: var(--oaa-color-grey-light);
}

oaa-root:has(> oaa-header) .main .feedback__button {
  background: transparent;
}

oaa-root:has(> oaa-header) .main .field__error {
  color: #ff7a70;
}

oaa-root:has(> oaa-header) .main .button--secondary {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
  color: var(--oaa-color-white);
}

.site-header .header-language .switcher__menu,
.site-header .main-bar .submenu {
  border: 1px solid var(--oaa-color-separator);
}

/* Buttons: pills in capitals like "START FREE TRIAL" – public pages only, the admin keeps its own buttons */
oaa-root:has(> oaa-header) .button {
  border-radius: 50px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* the website's call-to-action buttons end with the rocket */
.site-header .main-bar .header-cta::after,
.support .support__actions .support__button:not(.button--outline)::after {
  width: 1.05em;
  height: 1.05em;
  background: currentColor;
  content: '';
  -webkit-mask: url('rocket.svg') center / contain no-repeat;
  mask: url('rocket.svg') center / contain no-repeat;
}

/* Header: navigation in Roboto 500, pink with an underline on hover like the website */
.site-header .main-bar .menu__link {
  font-weight: 500;
}

.site-header .main-bar .menu__link:not(.is-text):hover,
.site-header .main-bar .menu__link:not(.is-text):focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.5em;
}

.site-header .main-bar .header-language {
  font-weight: 500;
  text-transform: uppercase;
}

/* Search banner: website hero title, pill shaped search field */
.hero .hero__inner .search__label {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 3rem);
  font-weight: 500;
  line-height: 1.15;
}

.hero .hero__inner .search__description {
  font-size: 1.125rem;
  opacity: 0.9;
}

.hero .search .search__input {
  padding: 0.85rem 1.25rem;
  border-radius: 50px 0 0 50px;
}

.hero .search .search__button {
  width: 3.5rem;
  border-radius: 0 50px 50px 0;
}

.hero .search .search__suggestions {
  right: 3.5rem;
}

.hero .hero__chips .hero__chip:hover,
.hero .hero__chips .hero__chip:focus-visible {
  border-color: var(--oaa-color-primary-orange);
  background-color: var(--oaa-color-primary-orange);
}

/* the slim search bar on inner pages shows a strip of the same picture */
.hero.hero--compact {
  background-image: url('hero.webp');
  background-position: center 70%;
}

/* Home page: pink section headings like on the website */
.home .home-section .home-section__title,
.home .popular .popular__title {
  color: var(--oaa-color-primary-orange);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 500;
}

.home .guides .guide__title {
  font-weight: 500;
}

.home .guides .guide:hover,
.home .guides .guide:focus-visible {
  border-color: var(--oaa-color-primary-orange);
}

/* Category tiles: the website's cards – title with a pink bar, pink block behind the lower right corner */
.home .tiles .tile {
  position: relative;
  z-index: 0;
}

.home .tiles .tile::before {
  position: absolute;
  z-index: -1;
  left: 28%;
  right: -15px;
  bottom: -15px;
  height: 46%;
  border-radius: 13px;
  background: var(--oaa-color-primary-orange);
  content: '';
}

.home .tiles .tile__title {
  font-weight: 500;
  text-transform: none;
}

@media (min-width: 561px) {
  .home .tiles .tile__title {
    font-size: 1.5rem;
  }

  .home .tiles .tile__title::after {
    display: block;
    width: 5rem;
    height: 4px;
    margin: 0.85rem auto 0;
    background: var(--oaa-color-primary-orange);
    content: '';
  }
}

@media (max-width: 560px) {
  .home .tiles .tile::before {
    right: -8px;
    bottom: -8px;
  }

  .home ul.tiles {
    gap: 1rem;
  }
}

/* Article, category and search pages: Roboto 500 titles */
.page .page__content .article__title,
.page .page__content .category__title,
.page .page__content .search-results__title {
  font-weight: 500;
}

/* "Still need help?" – centered like "Are you ready to try?" on the website */
.support .support__inner {
  flex-direction: column;
  justify-content: center;
  padding-block: 3.5rem;
  text-align: center;
}

.support .support__inner .support__text {
  max-width: none;
}

.support .support__inner .support__title {
  margin-bottom: 0.5rem;
  color: var(--oaa-color-primary-orange);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 500;
}

.support .support__inner .support__lead {
  font-size: 1.125rem;
  opacity: 1;
}

/* Footer: pink social icons like on the website */
.site-footer .social .social__link:hover,
.site-footer .social .social__link:focus-visible {
  background: var(--oaa-color-white);
  color: var(--oaa-color-primary-orange);
}
