/* --------------- CUSTOM OVERRIDES THAT THEME.JSON CANNOT ACHIEVE ---------------- */
/* -------------------------------------------------------------------------------- */

/* ---------------------------------------- */
/* ---------------- VARS ------------------ */

/* Default: no Admin-Bar */
:root {
  --wp-admin-bar-height: 0px;
  /* Initial approx. header height Fallback -> Exactly calculated per JS later on */
  /* @todo: Consider fixed height or calculation in wp-head */
  --site-header-height: 112.5px;
  --site-default-radius: 5px;
}

/* Desktop Admin-Bar */
body.admin-bar {
  --wp-admin-bar-height: 32px;
}

/* Mobile Admin-Bar */
@media (max-width: 782px) {
  body.admin-bar {
    --wp-admin-bar-height: 46px;
  }
}

/* ---------------------------------------- */
/* --------------- GENERAL ---------------- */

/* Header + Footer + Main = always min-height: 100dvh  */
html,
body {
  min-height: 100dvh;
}

.wp-site-blocks {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.wp-site-blocks > main {
  flex: 1 0 auto;
}

/* Gap for all Navigation Blocks */
.wp-block-navigation__container {
  gap: var(--wp--preset--spacing--large);
}

.side-nav {
  position: fixed;
  max-width: 18vw; /* contentSize = 60vw -> 20vw left and right of main (-2px) */
  top: 50%;
  left: var(--wp--preset--spacing--small);
  transform: translateY(-50%);
  z-index: 10;
}

.side-nav a {
  position: relative;
  text-decoration: none;
}

.side-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.side-nav a.is-active::after {
  transform: scaleX(1);
}

/* Noscript */
.noscript-info {
  position: sticky;
  top: var(--wp-admin-bar-height, 0px);
  z-index: 9999;

  min-height: var(--no-script-bar-height);
  padding: 0.75rem 1.25rem;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;

  font-size: var(--wp--preset--font-size--x-small);
  text-align: center;

  background-color: #fff3cd;
  color: #664d03;
  border-bottom: 1px solid #ffe69c;
}

/* Reset browser defaults */
.noscript-info p {
  margin: 0;
}

.noscript-info strong {
  font-weight: 600;
}

/* Custom language switcher post / theme–specific styles happen here for consistency */
.ezim-lang-switcher {
  font-family: var(--wp--preset--font-family--ui);
}

/* ---------------------------------------- */
/* --------------- HEADER ----------------- */

.site-header {
  position: sticky;
  top: calc(
    var(--wp-admin-bar-height, 0px) + var(--no-script-bar-height, 0px)
  ); /* For better admin ux -> depends on admin bar height + --no-script-bar-height */
  width: 100%;
  z-index: 20;
}

.header-row {
  /* @todo discuss with lead */
  /* align-items: start; */
}

.header-title {
  /* @todo discuss with lead */
  /* position: relative !important; */
  /* top: 23px !important; */
  /* font-weight: var(--wp--preset--font--weight--regular); */
}

.header-title a {
  text-decoration: none;
}

.header-title a:hover {
  text-decoration: underline;
}

/* Menu seperator workaround 
  - To avoid creating multiple navigation across the application we include the sperator as non interactive element
*/
.menu-seperator {
  pointer-events: none;
  cursor: default;
}

.menu-seperator:hover {
  text-decoration: none;
}

/* ---------------------------------------- */
/* --------------- FOOTER ----------------- */

.site-footer {
  scroll-snap-align: end;
  scroll-snap-stop: always;
}

/* ---------------------------------------- */
/* ---------------- HOME ------------------ */

/* scroll-snap-type only on home page */
html:has(body.home) {
  scroll-snap-type: y mandatory;
}

.home-layout {
  padding: 0; /* remove ollie theme presets */
}

.home-jewel-scroll {
  margin: 0; /* remove ollie theme presets */
  max-width: none; /* remove ollie theme presets */
}

.home-jewel-section {
  height: calc(
    100dvh - var(--site-header-height, 0px) - var(--wp-admin-bar-height, 0px)
  );
  width: 100%;
  max-width: none; /* remove ollie theme presets */

  scroll-snap-align: end;
  scroll-snap-stop: always;
}

.home-jewel-section img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

/* ---------------------------------------- */
/* ----------- JEWELRY GALLERY ------------ */

.jewelry-collection-hero img {
  border-radius: var(--site-default-radius);
}

.jewelry-gallery .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--wp--preset--spacing--medium);
}

/* @todo: optimize responsiveness */
@media (max-width: 900px) {
  .jewelry-gallery .wp-block-post-template {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .jewelry-gallery .wp-block-post-template {
    grid-template-columns: 1fr;
  }
}

/* Hover UX */
.jewelry-gallery-image img {
  transition: transform 0.3s ease;
  border-radius: var(--site-default-radius);
}

.jewelry-gallery-image:hover img {
  transform: scale(1.05);
  cursor: pointer;
}

.jewelry-gallery-item .jewelry-gallery-meta {
  display: none;
}

/* ---------------------------------------- */
/* ----------- LIGHTBOX OVERLAY ----------- */

.jewelry-lightbox {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(var(--site-header-height, 0px) + var(--wp-admin-bar-height, 0px));
  bottom: 0;

  z-index: 10;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);

  display: none;
  align-items: center;
  justify-content: center;
}

.jewelry-lightbox.is-open {
  display: flex;
}

.jewelry-lightbox-content {
  width: 40vw;
  max-width: 900px;
  height: 80vh;

  overflow: hidden;
}

.jewelry-lightbox-content button {
  position: absolute;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 2rem;
}

.jewelry-lightbox-content > button {
  font-size: 5rem;
}

.lightbox-prev {
  left: 15%;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 15%;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-body {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
}

.lightbox-body img {
  width: 100%;
  height: auto;

  display: block;
  object-fit: fill;

  border-radius: var(--site-default-radius) var(--site-default-radius) 0 0;
}

.lightbox-body .jewelry-gallery-meta {
  width: 100%;
  height: 100%;

  box-sizing: border-box;
  overflow-y: auto;

  background-color: #fff;
  border-radius: 0 0 var(--site-default-radius) var(--site-default-radius);
  padding: 1.5rem 2rem;
}

.jewelry-item-details {
  margin-top: var(--wp--preset--spacing--small);
}

.jewelry-item-details summary {
  font-weight: normal;
}

.jewelry-item-acf-infos {
  margin-top: var(--wp--preset--spacing--small);
}

.jewelry-item-acf-infos p {
  margin: 0px;
}

/* ---------------------------------------- */
/* --------------- CONTACT ---------------- */
.contact-row {
  align-items: start;
}

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