/**
 * Theme Name:  Base
 * Description: Custom WordPress Theme by Designery
 * Author:      The Designery
 * Author URI:  https://designery.io/
 * Version:     1.1
 * Text Domain: base
 */

/* ___________________________________________________________________________  
    
    This CSS is for non-editor parts of the theme:
    - header
    - menus
    - archives
    - pagination
    - footer
 ______________________________________________________________________________ */

/* ___________________________________________________________________________  
   
   1. LAYOUT
______________________________________________________________________________ */

/**
 * Layout
 * --------------------------------------------------------------------------- */
 
body {
  --header-height: 8rem;
  --site-padding: var(--wp--preset--spacing--56);
}

.wrapper {
  width: var(--wp--style--global--content-size);
  margin: 0 auto;
  padding: 0;
  max-width: 100%;
}

@media screen and (max-width: 1280px) {
  body {
    --site-padding: var(--wp--preset--spacing--32);
  }
  .wrapper {
    padding: 0 var(--site-padding, var(--wp--preset--spacing--32));
  }
  #main {
    max-width: 100vw;
    overflow-x: hidden;   /* disable side scrolling on mobile */
    overflow-y: hidden;   /* gsap scroll stuck fix */
  }
}



/* ___________________________________________________________________________  
   
   2. HEADER
______________________________________________________________________________ */

/**
 * Header
 * --------------------------------------------------------------------------- */

#header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  position: fixed;
  width: 100vw;
  left: 0;
  top: calc(0px + var(--wp-admin--admin-bar--height,0px));
  background: transparent;
  z-index: 300;
  transition: all var(--wp--custom--animation-speed) ease-in;
  box-shadow: none;
}

#header.hidden {           /* header hider while scrolling down  */
  top: -20rem;
} 

#header.scrolled {                        /* header shows while scrolling up */
  --header-height: 6rem;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(3px);
  
  @media screen and (max-width: 600px) { 
    --wp-admin--admin-bar--height: 0px;
  }
}

#header > .wrapper {
  display: flex;
}

#header + * {                             /* container after header has to be offset by headers height */
  margin-top: var(--header-height);
}

.header-logo {
  margin-right: auto;
  display: flex;
  align-items: center;
}

.header-logo svg {
  width: auto;
  max-width: unset;
  height: auto;
  display: block;
}

/**
 * Menus
 * --------------------------------------------------------------------------- */

/* ====== Menu General ====== */

.menu, .menu > ul {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: var(--wp--style--block-gap);
  padding-left: 0;
  list-style: none;
}

.menu li {
  padding: 0;
  list-style: none;
}

.menu li.current-menu-item > a,
.menu li.current_page_parent > a {
  
}

.menu li a {
  font-weight: var(--wp--custom--font-weight--default);
  display: block;
}
.menu li a:hover,
.menu li a:focus {
  color: var(--wp--preset--color--primary);
}

/* ====== Aftar Main Menu ====== */

#extras {
  display: flex;
  align-items: center;
  gap: var(--wp--style--block-gap);
  margin: 0 0 0 var(--wp--style--block-gap);
}

#header-menu-icons {
  display: flex;
  align-items: center;
  gap: var(--wp--style--block-gap);
}

#header-menu-icons > a {
  color: var(--wp--preset--color--black);
  position: relative;
}

.cart-number {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: var(--wp--custom--font-weight--bold);
  line-height: 1;
  color: inherit;
  margin-left: 0.15rem;
  margin-top: 0.5rem;
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  width: 1rem;
  text-align: center;
}

/* ====== Main Menu ====== */

.menu-main ul {
  gap: 0;
  padding-left: 0;
}
.menu-main li a {
  color: inherit;
  padding: var(--wp--preset--spacing--8) var(--wp--style--block-gap);
}
@media screen and (max-width: 1280px) {       /* hide main menu on tablet and mobile */
  #header-menu.menu-main {
    display: none;
  }
}

/* ====== Dropdown in Main Menu ====== */

.menu-main li a[href='#']{
  cursor: default;
}
.menu li.menu-item-has-children {
  position: relative;
}
.menu li.menu-item-has-children > a::after {    /* arrow down */
  content: '⌄';
  display: inline-block;
  margin-left: var(--wp--preset--spacing--8);
  font-weight: var(--wp--custom--font-weight--default);
  transform: none;
  transform-origin: center center;
  font-size: inherit;
  position: relative;
  bottom: 0.2em;
}
.sub-menu {                 /* functionality of dropdown */
  display: none;
  padding: 0;
  margin: 0;
  min-width: 100%;
  width: auto;
  transform: translateY(calc(0px - var(--wp--preset--spacing--12)));
  animation: hideMenu 0.1s cubic-bezier(0.7, 0, 0.3, 1) forwards;
}
#header-menu .sub-menu {    /* styling of dropdown */
  padding: var(--wp--preset--spacing--12) 0;
  border-radius: var(--wp--custom--radius--default);
  background-color: var(--wp--preset--color--white);
  border: 2px solid var(--wp--preset--color--light-grey);
  position: absolute;
}
#hamburger .sub-menu {      /* different styling of dropdown inside hamburger menu */
  
}
@keyframes hideMenu {       /* animate dropdown */
  100% {
    display: none;
    opacity: 0;
    transform: translateY(calc(0px - var(--wp--preset--spacing--12)));
  }
}
@keyframes showMenu {
  0% {
    display: block;
    opacity: 0;
    transform: translateY(calc(0px - var(--wp--preset--spacing--12)));
  }
  100% {
    display: block;
    opacity: 1;
    transform: translateY(0);
  }
}
.menu-main li.menu-item-has-children:focus-within > ul,       /* on focus (click) */
.menu-main li.menu-item-has-children.active > ul,             /* progressive enhancement with JavaScript */
#header-menu.menu-main li.menu-item-has-children:hover > ul   /* on hover - only on desktop */
 {
  display: block;
  animation: showMenu var(--wp--custom--animation-speed) cubic-bezier(0.7, 0, 0.3, 1) forwards;
}
.menu-main ul.sub-menu a {
  white-space: nowrap;
}

/* ====== Hamburger Menu ====== */

.menu-toggle {
  display: flex;
  width: 2rem;
  padding: 0;
  cursor: pointer;
  z-index: 400;
  position: relative;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  flex-shrink: 0;
}
input#menutoggle:checked ~ .menu,
input#menutoggle:focus   ~ .menu {
  transform: translateX(0);
  display: flex;
}
.menu-toggle span {
  width: 100%;
  height: 2px;
  background: var(--wp--preset--color--black);
  margin: 0.15rem 0;
  position: relative;
  transition: all var(--wp--custom--animation-speed);
}
label#menutogglebutton {
  display: flex;
  align-items: flex-end;
  margin: 0 0 0 var(--wp--style--block-gap);
}
#hamburger {
  position: fixed;
  background: var(--wp--preset--color--black);
  width: max(50vw, 24rem);               /* either 50vw on desktops or 24rem on smaller screens */
  max-width: 100%;                       /* on mobile, max 100% */
  height: 100vh;
  overflow-y: auto;
  margin: 0;
  right: 0;
  top: 0;
  padding: calc(var(--wp--preset--spacing--56) + var(--wp-admin--admin-bar--height,0px)) var(--wp--preset--spacing--56) var(--wp--preset--spacing--160);
  flex-direction: column;
  align-items: flex-end;
  transform: translateX(100vw);
  z-index: 100;
  transition: transform 0.2s ease-in-out;
  overscroll-behavior: contain;
  color: white;
  display: none;
}
#hamburger.menu-main ul {
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}
#hamburger.menu-main li a {
  padding: var(--wp--preset--spacing--12) 0;
}
#hamburger.menu-main li.menu-item-has-children:focus-within > a::after,       /* opened dropdown */
#hamburger.menu-main li.menu-item-has-children.active > a::after {
  transform: rotate(180deg);
  bottom: -0.25em;
}
input#menutoggle {
  visibility: hidden;
  width: 0;
  margin: 0;
  position: absolute;
}
input#menutoggle:checked ~ label span {
  background: white;
  transform: rotate(45deg);
  top: 0;
}
input#menutoggle:checked ~ label span:nth-child(2) {
  transform: rotate(-45deg);
  top: -6px;
}
input#menutoggle:checked ~ label span:nth-child(3) {
  display: none;
}

.background-overlay {
  position: fixed;
  top: 0;
  right: -100vw;
  height: 100vh;
  width: 100vw;
  bottom: 0;
  z-index: 90;
  opacity: 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(3px);
  transition: right 0s, opacity .2s;
}
body.menu-shown .background-overlay {
  right: 0;
  opacity: 1;
}

body.menu-shown #header.scrolled {              /* keep the header visible at all times when menu is opened */
  top: 0 !important;
}
body.admin-bar.menu-shown #header.scrolled {    /* adjust positions for visible admin bar */
  top: var(--wp-admin--admin-bar--height) !important;
}
body.admin-bar.menu-shown #header.scrolled #hamburger {
  --wp-admin--admin-bar--height: 0px;
}


/* ====== Search ====== */

#searchbar {
  display: none;
  width: 100vw;
  height: auto;
  position: absolute;
  padding: 0 0 var(--wp--preset--spacing--24) 0;
  top: var(--header-height);
  left: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(3px);
  z-index: 2;
}
#header.scrolled #searchbar {
  top: var(--header-height);
}
body.searchbar-shown #searchbar, #main #searchbar {
  display: flex;
}
#main #searchbar { 
  position: static;
  width: 100%;
}


/* ___________________________________________________________________________  
   
   3. CONTENT
______________________________________________________________________________ */

/**
 * Content
 * --------------------------------------------------------------------------- */

/* === Featured image === */

.entry-image {
  margin-top: var(--wp--custom--padding);
  margin-bottom: 0;
}

.entry-image img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

/* ====== POSTS ====== */

.posts {
  display: flex;
  list-style: none;
  padding: 0;
  gap: var(--wp--custom--gap);
  flex-wrap: wrap;
  align-content: space-between;
  margin-top: var(--wp--preset--spacing--56);
  flex-direction: row;
  justify-content: space-between;
}
.posts > li {
  width: calc(50% - var(--wp--custom--gap)/2);
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: var(--wp--preset--spacing--24);
}
.posts > li section {
  margin-bottom: var(--wp--preset--spacing--24);
}

@media screen and (max-width: 781px) {
  .posts > li {
    width: 100%;
  }
}
.posts > li:hover svg {
  transform: translateX(0.25rem);
}

button#load-more, button#back-to-top {
  margin: var(--wp--preset--spacing--56) auto var(--wp--preset--spacing--80);
}
button#back-to-top {
  position: sticky;
  bottom: var(--wp--custom--gap);
}
button#back-to-top.invisible {
  opacity: 0;
}
button#load-more:hover, 
button#load-more:focus {
  border-color: var(--wp--preset--color--primary);
}
button#load-more::after {
  content: '↓';
}
button#back-to-top::after {
  content: '↑';
}
.loading button#load-more::after {
  content: '↻';
  animation: rotate 1s infinite linear;
}
@keyframes rotate{
    from{ transform: rotate(0deg); }
    to{ transform: rotate(360deg); }
}


/* ====== Back to top ====== */

#back-to-top-button {
  position: sticky;
  z-index: 900;
  float: right;
  bottom: 1.75rem;
  opacity: 0;
  width: 3.5rem;
  overflow: visible;
}
#back-to-top-button.visible {
  opacity: 1;
}
#back-to-top-button a {
  display: flex;
  align-items: center;
  height: 3.5rem;             /* since the sizes are same for all devices, we cannot use variables */
  padding: 0 1.6rem;
  gap: 0;
  border-radius: 3rem;
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--white);
  width: 100%;
  margin-top: -1.75rem;
  position: relative;
  right: 4.25vw;
  float: right;
}
#back-to-top-button a:active {
  background: var(--wp--preset--color--dark-grey);
}
#back-to-top-button a span {
  width: 0px;
  font-weight: var(--wp--custom--font-weight--bold);
  font-size: var(--wp--preset--font-size--normal);
  overflow: hidden;
  white-space: nowrap;
  transition: all .2s;
}
#back-to-top-button a i {
  font-size: 1.5rem;
  margin: 0 -0.33rem;
  font-style: normal;
}
@media screen and (min-width: 781px) {
  #back-to-top-button a:hover {
    width: 10rem;
  }
  #back-to-top-button a:hover span {
    width: 6.5em;
  }
}

/* === Post content and excerpts === */

.entry-content {
  max-width: 50rem;
  margin-left: auto;
  margin-right: auto;
}

.entry-header {
  background: var(--wp--preset--color--light-grey);
  color: inherit;
  padding-top: var(--wp--preset--spacing--56);
  padding-bottom: var(--wp--preset--spacing--56);
  margin-bottom: 0;
  position: relative;
}
body.single-format-standard .entry-header {
  margin-bottom: var(--wp--preset--spacing--56);
}

.entry-title {                
  text-overflow: ellipsis;                /* limit to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-summary {
  max-width: 80ch;
  margin-top: var(--wp--preset--spacing--16);
}

.entry-summary p {
  font-size: var(--wp--preset--font-size--x-large);
  line-height: var(--wp--custom--line-height--heading);

  text-overflow: ellipsis;               /* limit to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media screen and (max-width: 480px) {
  .entry-summary br {                    /* remove breaks on mobile */
    display: none;
  }
}

/* === Breadcrumbs === */
.entry-breadcrumbs,
.woocommerce-breadcrumb {
  font-size: var(--wp--preset--font-size--normal);
  display: flex;
  align-items: baseline;
}
.entry-breadcrumbs {
  border-top: 1px solid var(--wp--preset--color--grey);
  padding-top: var(--wp--preset--spacing--56);
  margin-top: var(--wp--preset--spacing--56);
}

.entry-breadcrumbs a,
.woocommerce-breadcrumb a {
  margin-right: var(--wp--preset--spacing--8);
}
.entry-breadcrumbs a::after,
.woocommerce-breadcrumb a::after {
  content: '→';
  font-family: "icons";
  font-size: inherit;
  padding-left: var(--wp--preset--spacing--8);
  color: var(--wp--preset--color--dark-grey);
}

.entry-breadcrumbs > span {
  max-width: 40ch;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: inline-block;
}

/* === Meta === */
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: var(--wp--custom--gap);
  row-gap: var(--wp--custom--gap);
}

/* === Categories, Tags === */
.cat-item > span {
  font-size: var(--wp--preset--font-size--normal);
  padding-right: var(--wp--style--block-gap);
}
.cat-item > a {
  border-radius: var(--wp--custom--radius--default);
  color: inherit;
  background: var(--wp--preset--color--light-grey);
  padding: var(--wp--preset--spacing--8) var(--wp--preset--spacing--16);
  font-size: initial;
  border: 2px solid transparent;
  white-space: nowrap;
  display: inline-block;
}
.cat-item > a:hover {
  border-color: var(--wp--preset--color--primary);
}
.cat-item.current-cat a {
  color: white;
  background: var(--wp--preset--color--primary);
}
.categories-nav {
  margin: var(--wp--preset--spacing--56) auto;
}
.categories-nav ul {
  display: flex;
  gap: var(--wp--style--block-gap);
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
}
@media screen and (max-width: 781px) {
  .categories-nav {
    overflow-x: auto;
    width: 100vw;
    margin-left: calc(0px - (var(--wp--preset--spacing--56)));
    padding-bottom: 1em;
  }
  .categories-nav ul {
    flex-wrap: nowrap;
    padding: 0 var(--wp--preset--spacing--56);
    justify-content: flex-start;
  }
}

/* === Search results === */

body.search-results .posts {    /* posts in search - list style */
  max-width: 90ch;
  margin-left: auto;
  margin-right: auto;
}
body.search-results .posts > li {
  width: 100%;
  padding: var(--wp--preset--spacing--24);
  border: 1px solid var(--wp--preset--color--grey);
}
body.search-results .posts > li > a {
  display: flex;
  flex-direction: row;
  gap: var(--wp--preset--spacing--24);
}
body.search-results .posts > li figure {
  width: 15rem;
  height: 15rem;
  flex-shrink: 0;
  
  @media screen and (max-width: 781px) {
    display: none; 
  }
}
.filter-type {
  text-transform: uppercase;
  font-size: var(--wp--preset--font-size--small);
}
body.search-results .posts > li section {
  display: flex;
  flex-direction: column;
}
body.search-results .posts > li .wp-element-button {
  margin-top: auto;
}

/* ====== 404 ====== */

.is-404.wp-block-group {
  padding: var(--wp--preset--spacing--56) 0;
  flex-direction: column;
}


/* ====== PAGINATION ====== */

/* === Single post navigation (between different posts) === */

.loop-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--wp--custom--gap);
  border-top: 1px solid var(--wp--preset--color--black);
  padding-top: var(--wp--preset--spacing--56);
}
.loop-nav > div {
  flex: 0 1 50%;
}
.loop-nav-prev a::after {
  order: -1;
  transform: scale(-1, -1);
}
.loop-nav-next {
  text-align: right;
  margin-left: auto;
}
.loop-nav a {
  display: inline-flex;
}
.loop-nav .arrow {
  color: var(--wp--preset--color--black);
}

/* === Pagination === */
.nav-links, .wp-block-query-pagination-numbers, ul.page-numbers {
  padding: var(--wp--preset--spacing--56) 0;
  display: flex;
  justify-content: center;
  gap: var(--wp--preset--spacing--16);
  list-style: none;
}
.nav-links span, .nav-links a,
.wp-block-query-pagination-numbers span, .wp-block-query-pagination-numbers a,
.page-numbers span, a.page-numbers {
  background: var(--wp--preset--color--light-grey);
  width: var(--wp--preset--spacing--40);
  height: var(--wp--preset--spacing--40);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.nav-links a:hover, .wp-block-query-pagination-numbers a:hover, a.page-numbers:hover {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--white);
}

/* Accessibility */
/* Text meant only for screen readers. */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

#main[tabindex='-1']:focus {                  /* Do not show the outline on the skip link target. */
  outline: 0;
}

/* ___________________________________________________________________________  
   
   4. FOOTER
______________________________________________________________________________ */

/* ====== CTA ====== */

#cta {
  background: var(--wp--preset--color--light-grey);
  padding: var(--wp--preset--spacing--80) 0;
}
#cta .wrapper {
  width: 68ch;
}

/* ====== Posts ====== */

#footer-posts {
  padding: var(--wp--preset--spacing--80) 0;
}


/* ====== Footer ====== */

#footer {
  background: var(--wp--preset--color--black);
  background-size: cover;
  color: var(--wp--preset--color--white);
  padding: var(--wp--preset--spacing--80) 0;
}
#footer .footer-columns {
  display: grid;
  grid-template-rows: 1fr;
  grid-template-columns: 40% auto;
  row-gap: var(--wp--custom--gap);
  padding: var(--wp--preset--spacing--56) 0;
}
#footer .footer-menus {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--wp--custom--gap);
  row-gap: var(--wp--custom--gap);
  justify-content: space-between;
}
#footer .footer-menus > div > :first-child {
  margin-top: 0;
}
#footer li a {
  color: inherit;
  line-height: var(--wp--custom--line-height--button);
  display: inline-block;
  padding: var(--wp--preset--spacing--8) 0;
}
#footer li a:hover,
#footer li a:focus {
  color: var(--wp--preset--color--primary);
}
.footer-logo {
  max-width: 25ch;
  flex-basis: auto !important;
}
#footer .copyright {
  border-top: 1px solid var(--wp--preset--color--dark-grey);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  width: 100%;
  justify-content: space-between;
  padding: var(--wp--preset--spacing--56) 0;
  gap: var(--wp--custom--gap);
}
#footer .footer-menus ul {
  padding-top: var(--wp--preset--spacing--16);
}
#footer .copyright ul {
  padding-bottom: var(--wp--preset--spacing--16);
}

@media screen and (max-width: 1280px) {
}

@media screen and (max-width: 1080px) { 
}

@media screen and (max-width: 782px) {
  #footer .footer-columns {
    grid-template-columns: 1fr;
  }
  #footer .copyright {
    flex-direction: column-reverse;
  }
}


/* === Basic Search Bar === */

.search-form,
.post-password-form p,
button svg {
  display: flex;
  align-items: center;
}

form#searchbar button,                                /* Position button above search input */
.wp-block-search__input + button.has-icon {
  margin-top: 0;
  background: none;
  border: none;
  padding-left: 0;
  padding-right: 0;
  width: 4em;
  margin-left: -4em;
  position: relative;
  z-index: 2;
  color: initial;
  background-color: transparent !important;
}
.wp-block-search__input + button {
  margin-left: var(--wp--preset--spacing--8);
}
.wp-block-search__input {
  margin: 0;
}

input[type="search"]::-webkit-search-decoration,        /* Hide browser's buttons on search input */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration { display: none; }




/* ___________________________________________________________________________  
   
   5. SPECIALS
______________________________________________________________________________ */

/* === Loading indicator === */

#loader {
  position: relative;
}
#loader svg {
  width: 8em;
  height: 8em;
  animation: 2s rotate infinite linear;
}
#loader-back-circle {
  stroke: var(--wp--preset--color--primary);
}
#loader-front-circle {
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}
@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

/* === Recaptcha badge === */

.grecaptcha-badge {
  visibility: hidden;
}


