/*
Theme Name: ESLS public copy
Theme URI: https://esls.waiternow.ru/
Author: ESLS
Description: Local WordPress theme for the public ESLS site copy.
Version: 1.0.0
Text Domain: esls
*/

:root { color-scheme: light; }
html { scroll-behavior: smooth; }
body.esls-wordpress-page { margin: 0; color: #1b2733; font-family: Arial, sans-serif; }
.esls-wordpress-page .site-shell { width: min(960px, calc(100% - 2rem)); margin: 4rem auto; }
.esls-wordpress-page a { color: #0080be; }
.esls-wordpress-page header, .esls-wordpress-page footer { background: #f2f8ff; padding: 1rem; }
.esls-wordpress-page nav ul { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; padding: 0; list-style: none; }

body.esls-static-copy a:focus-visible,
body.esls-static-copy button:focus-visible,
body.esls-static-copy [role="button"]:focus-visible,
body.esls-static-copy [tabindex]:focus-visible {
  outline: 3px solid #0369a1;
  outline-offset: 3px;
}

/* WordPress reserves the admin-bar height through its html bump stylesheet.
 * Keep the fixed ESLS header below that bar for authenticated visitors. */
body.admin-bar.esls-static-copy .layout__header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar.esls-static-copy .layout__header {
    top: 46px;
  }
}

body.esls-static-copy .header__burger {
  min-width: 44px;
  min-height: 44px;
}

body.esls-static-copy .accordion__header {
  cursor: pointer;
}

body.esls-static-copy .tabs__main .tabs__item:not(.tabs__item_active) {
  display: none;
}

/*
 * Trim the margins WordPress gives to core blocks at the edges of a group, but
 * leave the upstream layout alone: elements that kept their BEM class carry
 * spacing from the public stylesheet (`.model__layout` has a 3rem top margin),
 * and zeroing it collapsed the block by 48px.
 */
body.esls-static-copy .wp-block-group > :first-child:not([class*="__"]),
body.esls-static-copy .wp-block-buttons > :first-child:not([class*="__"]) {
  margin-top: 0;
}

body.esls-static-copy .wp-block-group > :last-child:not([class*="__"]),
body.esls-static-copy .wp-block-buttons > :last-child:not([class*="__"]) {
  margin-bottom: 0;
}

body.esls-static-copy .wp-block-heading {
  margin-top: 0;
}

body.esls-static-copy .wp-block-image {
  margin: 0;
}

/*
 * Upstream keeps its artwork inside `<picture>`, where the image stays inline
 * and leaves the usual descender gap below the baseline. Forcing `display:block`
 * removed it, so every figure came out ~7px shorter than the public copy.
 */
body.esls-static-copy .wp-block-image img {
  display: inline;
  height: auto;
  max-width: 100%;
}

body.esls-static-copy .wp-block-buttons {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

body.esls-static-copy .base-slider__slide-body picture,
body.esls-static-copy .base-slider__thumb-body picture {
  display: block;
  height: 100%;
  max-width: 100%;
  width: 100%;
}

body.esls-static-copy .base-slider__slide-body img,
body.esls-static-copy .base-slider__thumb-body img {
  display: block;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

body.esls-static-copy .esls-lightbox[hidden] {
  display: none;
}

body.esls-static-copy .esls-lightbox {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 120;
}

body.esls-static-copy .esls-lightbox__backdrop {
  background: rgba(10, 25, 40, .82);
  inset: 0;
  position: absolute;
}

body.esls-static-copy .esls-lightbox__panel {
  align-items: center;
  background: #fff;
  border-radius: .75rem;
  display: flex;
  justify-content: center;
  max-height: 92vh;
  max-width: min(92vw, 72rem);
  padding: 1rem;
  position: relative;
  z-index: 1;
}

body.esls-static-copy .esls-lightbox__image {
  display: block;
  max-height: calc(92vh - 2rem);
  max-width: calc(92vw - 2rem);
  object-fit: contain;
}

body.esls-static-copy .esls-lightbox__close {
  align-items: center;
  background: #005779;
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 1.75rem;
  height: 2.5rem;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: -.75rem;
  top: -.75rem;
  width: 2.5rem;
  z-index: 2;
}

body.esls-static-copy .esls-lightbox__close:hover,
body.esls-static-copy .esls-lightbox__close:focus-visible {
  opacity: .82;
  outline: 2px solid #04a8f0;
  outline-offset: 2px;
}

body.esls-static-copy .esls-contact-modal[hidden] {
  display: none;
}

body.esls-static-copy .esls-contact-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 121;
}

body.esls-static-copy .esls-contact-modal__backdrop {
  background: rgba(10, 25, 40, .72);
  inset: 0;
  position: absolute;
}

body.esls-static-copy .esls-contact-modal__panel {
  background: #fff;
  border-radius: 1rem;
  box-sizing: border-box;
  max-height: 92vh;
  max-width: 38rem;
  overflow: auto;
  padding: 2rem;
  position: relative;
  width: min(92vw, 38rem);
  z-index: 1;
}

body.esls-static-copy .esls-contact-modal__panel h2 {
  color: #005779;
  margin: 0 2rem 1rem 0;
}

body.esls-static-copy .esls-contact-modal__panel p {
  color: #5d6374;
  margin: 0 0 1.25rem;
}

body.esls-static-copy .esls-contact-modal__form {
  display: grid;
  gap: 1rem;
}

body.esls-static-copy .esls-contact-modal__form label {
  color: #353a48;
  display: grid;
  font-size: .875rem;
  gap: .35rem;
}

body.esls-static-copy .esls-contact-modal__form input:not([type="checkbox"]),
body.esls-static-copy .esls-contact-modal__form textarea {
  border: 1px solid #cbd3e5;
  border-radius: .35rem;
  box-sizing: border-box;
  font: inherit;
  padding: .7rem .8rem;
  width: 100%;
}

body.esls-static-copy .esls-contact-modal__consent {
  align-items: start;
  display: flex !important;
  grid-template-columns: auto 1fr;
}

body.esls-static-copy .esls-contact-modal__consent input {
  margin-top: .2rem;
}

body.esls-static-copy .esls-contact-modal__close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #005779;
  cursor: pointer;
  display: flex;
  font-size: 2rem;
  height: 2.5rem;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: .75rem;
  top: .5rem;
  width: 2.5rem;
}

body.esls-static-copy .esls-contact-modal__close:hover,
body.esls-static-copy .esls-contact-modal__close:focus-visible {
  opacity: .82;
  outline: 2px solid #04a8f0;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html,
  body.esls-static-copy,
  body.esls-static-copy *,
  body.esls-static-copy *::before,
  body.esls-static-copy *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}

/*
 * WordPress ships `.wp-block-image img { height: auto }`, which overrides the
 * `height: 100%` the public copy relies on for full-bleed backgrounds: the
 * accessories hero image rendered 375px tall inside a 500px block and left a
 * grey band under it. Restore the original contract for images that the
 * upstream styles position absolutely.
 */
body .accessories-hero__bg .wp-block-image,
body .accessories-hero__bg .wp-block-image img,
body.esls-static-copy .accessories-hero__bg .wp-block-image img {
  height: 100%;
  width: 100%;
  margin: 0;
}
