/* The Clever Everyday — custom mobile header */
:root {
  --tce-mobile-header-height: 64px;
  --tce-mobile-bg: #f7f5f1;
  --tce-mobile-white: #ffffff;
  --tce-mobile-text: #1b1e21;
  --tce-mobile-muted: #4f565c;
  --tce-mobile-divider: #ded8d0;
  --tce-mobile-accent: #8a6548;
  --tce-mobile-accent-hover: #6f4f38;
}

.tce-mobile-shell {
  display: none;
}

@media screen and (max-width: 767.98px) {
  body.tce-mobile-ui-ready #masthead,
  body.tce-mobile-ui-ready #search-drawer,
  body.tce-mobile-ui-ready .kadence-sticky-header,
  body.tce-mobile-ui-ready .site-header-wrap {
    display: none !important;
  }

  body.tce-mobile-ui-ready .tce-mobile-shell {
    display: block;
  }

  body.tce-mobile-ui-ready.admin-bar .tce-mobile-header {
    top: 46px;
  }

  body.tce-mobile-ui-ready.admin-bar .tce-mobile-panel {
    top: calc(46px + var(--tce-mobile-header-height));
  }

  .tce-mobile-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 999990;
    min-height: var(--tce-mobile-header-height);
    padding-top: env(safe-area-inset-top, 0px);
    box-sizing: content-box;
    background: var(--tce-mobile-white);
    border-bottom: 1px solid #e7e4df;
    transition: box-shadow 0.16s ease;
  }

  body.tce-mobile-scrolled .tce-mobile-header {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  }

  .tce-mobile-header__default {
    height: var(--tce-mobile-header-height);
    padding: 0 12px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 46px;
    align-items: center;
    box-sizing: border-box;
  }

  .tce-mobile-icon-button,
  .tce-mobile-search-close,
  .tce-mobile-search-submit {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font: inherit;
  }

  .tce-mobile-icon-button {
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tce-mobile-text);
    background: transparent;
    cursor: pointer;
  }

  .tce-mobile-icon-button:hover,
  .tce-mobile-icon-button:focus {
    color: var(--tce-mobile-text);
    background: transparent;
  }

  .tce-mobile-icon-button:focus-visible,
  .tce-mobile-search-close:focus-visible,
  .tce-mobile-search-submit:focus-visible,
  .tce-mobile-brand:focus-visible,
  .tce-mobile-menu-list a:focus-visible {
    outline: 2px solid var(--tce-mobile-accent);
    outline-offset: 2px;
  }

  .tce-mobile-icon-button svg,
  .tce-mobile-search-close svg,
  .tce-mobile-search-submit svg {
    width: 23px;
    height: 23px;
    display: block;
  }

  .tce-mobile-brand {
    min-width: 0;
    justify-self: center;
    color: #111111 !important;
    font-family: Georgia, "Times New Roman", serif !important;
    font-size: clamp(22px, 6.4vw, 26px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.025em;
    white-space: nowrap;
    text-align: center;
    text-decoration: none !important;
  }

  .tce-mobile-brand:hover,
  .tce-mobile-brand:focus {
    color: #111111 !important;
    text-decoration: none !important;
  }

  .tce-mobile-icon--close {
    display: none;
  }

  body.tce-mobile-menu-open .tce-mobile-icon--menu {
    display: none;
  }

  body.tce-mobile-menu-open .tce-mobile-icon--close {
    display: inline-flex;
  }

  body.tce-mobile-menu-open .tce-mobile-search-button {
    visibility: hidden;
    pointer-events: none;
  }

  .tce-mobile-header-spacer {
    height: calc(var(--tce-mobile-header-height) + env(safe-area-inset-top, 0px));
  }

  .tce-mobile-panel {
    position: fixed;
    top: calc(var(--tce-mobile-header-height) + env(safe-area-inset-top, 0px));
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 999980;
    background: var(--tce-mobile-bg);
    opacity: 0;
    visibility: hidden;
    transform: translate3d(-10px, 0, 0);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
  }

  body.tce-mobile-menu-open .tce-mobile-panel {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0);
    transition-delay: 0s;
  }

  .tce-mobile-panel__scroll {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 22px 24px calc(30px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
  }

  .tce-mobile-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .tce-mobile-menu-search {
    margin: 0 0 16px;
    padding: 0 0 18px;
    border-bottom: 1px solid var(--tce-mobile-divider);
  }

  .tce-mobile-menu-search__title {
    margin: 0 0 11px;
    color: var(--tce-mobile-text);
    font-family: var(--global-body-font-family, Arial, Helvetica, sans-serif);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
  }

  .tce-mobile-menu-search__form {
    width: 100%;
    height: 46px;
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: stretch;
  }

  .tce-mobile-menu-search__input {
    min-width: 0;
    width: 100%;
    height: 46px;
    margin: 0;
    padding: 0 13px;
    color: var(--tce-mobile-text);
    background: var(--tce-mobile-white);
    border: 1px solid #9ca1a5;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
    outline: 0;
    font-family: var(--global-body-font-family, Arial, Helvetica, sans-serif);
    font-size: 16px;
    line-height: 46px;
  }

  .tce-mobile-menu-search__input:focus {
    border-color: var(--tce-mobile-accent);
    box-shadow: inset 0 0 0 1px var(--tce-mobile-accent);
  }

  .tce-mobile-menu-search__input::placeholder {
    color: #777d82;
    opacity: 1;
  }

  .tce-mobile-menu-search__submit {
    -webkit-appearance: none;
    appearance: none;
    width: 48px;
    height: 46px;
    margin: 0;
    padding: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--tce-mobile-accent);
    border: 1px solid var(--tce-mobile-accent);
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
  }

  .tce-mobile-menu-search__submit:hover,
  .tce-mobile-menu-search__submit:focus {
    color: #ffffff;
    background: var(--tce-mobile-accent-hover);
    border-color: var(--tce-mobile-accent-hover);
  }

  .tce-mobile-menu-search__submit:focus-visible {
    outline: 2px solid var(--tce-mobile-accent);
    outline-offset: 2px;
  }

  .tce-mobile-menu-search__submit svg {
    width: 20px;
    height: 20px;
    display: block;
  }

  .tce-mobile-nav,
  .tce-mobile-nav ul {
    margin: 0;
    padding: 0;
  }

  .tce-mobile-menu-list,
  .tce-mobile-menu-list ul,
  .tce-mobile-nav .menu,
  .tce-mobile-nav .children {
    list-style: none;
  }

  .tce-mobile-menu-list > li,
  .tce-mobile-nav .menu > li,
  .tce-mobile-nav .children > li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--tce-mobile-divider);
  }

  .tce-mobile-menu-list a,
  .tce-mobile-nav .menu a,
  .tce-mobile-nav .children a {
    min-height: 54px;
    padding: 15px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-sizing: border-box;
    color: var(--tce-mobile-text) !important;
    font-family: var(--global-body-font-family, Arial, Helvetica, sans-serif) !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none !important;
  }

  .tce-mobile-menu-list a:hover,
  .tce-mobile-menu-list a:focus,
  .tce-mobile-menu-list .current-menu-item > a,
  .tce-mobile-menu-list .current-menu-ancestor > a,
  .tce-mobile-nav .menu a:hover,
  .tce-mobile-nav .menu a:focus,
  .tce-mobile-nav .menu .current-menu-item > a,
  .tce-mobile-nav .menu .current-menu-ancestor > a {
    color: var(--tce-mobile-accent) !important;
  }

  .tce-mobile-menu-list .menu-item-has-children > a::after,
  .tce-mobile-nav .menu .menu-item-has-children > a::after {
    content: "›";
    flex: 0 0 auto;
    color: var(--tce-mobile-muted);
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
  }

  .tce-mobile-menu-list .sub-menu,
  .tce-mobile-nav .menu .sub-menu,
  .tce-mobile-nav .children {
    margin: 0 0 0 14px;
  }

  .tce-mobile-menu-list .sub-menu a,
  .tce-mobile-nav .menu .sub-menu a,
  .tce-mobile-nav .children a {
    min-height: 48px;
    padding-left: 16px;
    font-size: 14px;
    font-weight: 500;
  }

  .tce-mobile-search-row {
    height: var(--tce-mobile-header-height);
    margin: 0;
    padding: 9px 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 48px 46px;
    align-items: stretch;
    gap: 8px;
    box-sizing: border-box;
    background: var(--tce-mobile-white);
  }

  .tce-mobile-search-label {
    align-self: center;
    color: var(--tce-mobile-text);
    font-family: var(--global-body-font-family, Arial, Helvetica, sans-serif);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
  }

  .tce-mobile-search-input {
    min-width: 0;
    width: 100%;
    height: 46px;
    margin: 0;
    padding: 0 13px;
    color: var(--tce-mobile-text);
    background: var(--tce-mobile-white);
    border: 1px solid #9ca1a5;
    border-radius: 0;
    box-shadow: none;
    outline: 0;
    font-family: var(--global-body-font-family, Arial, Helvetica, sans-serif);
    font-size: 16px;
    line-height: 46px;
  }

  .tce-mobile-search-input:focus {
    border-color: var(--tce-mobile-accent);
    box-shadow: 0 0 0 1px var(--tce-mobile-accent);
  }

  .tce-mobile-search-input::placeholder {
    color: #777d82;
    opacity: 1;
  }

  .tce-mobile-search-submit {
    width: 48px;
    height: 46px;
    margin: 0;
    padding: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--tce-mobile-accent);
    cursor: pointer;
  }

  .tce-mobile-search-submit:hover,
  .tce-mobile-search-submit:focus {
    color: #ffffff;
    background: var(--tce-mobile-accent-hover);
  }

  .tce-mobile-search-close {
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tce-mobile-muted);
    background: transparent;
    cursor: pointer;
  }

  .tce-mobile-search-close:hover,
  .tce-mobile-search-close:focus {
    color: #111111;
    background: transparent;
  }

  body.tce-mobile-search-open .tce-mobile-header__default {
    display: none;
  }

  body.tce-mobile-search-open .tce-mobile-search-row {
    display: grid;
  }

  body.tce-mobile-lock {
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  @media screen and (max-width: 410px) {
    .tce-mobile-search-row {
      grid-template-columns: minmax(0, 1fr) 48px 46px;
    }

    .tce-mobile-search-label {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .tce-mobile-header,
    .tce-mobile-panel {
      transition: none !important;
    }
  }
}
