/**
 * Primarily color, font, & layout changes to
 * elements common to *most* of our themes. #4
 */

/* ================================
[ Common ]
================================ */

/* ---------- [ Table of Contents ] ---------- */

/**
 * Notes
 * - TOC (you are here)
 *
 * Containers
 *
 * Sections (for structure, not ACF content)
 * - Before Header
 * - Header
 * - Site Footer
 *
 * Navigation
 * - Nav: Footer
 * - Nav: Header
 * - Nav: Primary
 *
 * Content
 * - Breadcrumbs
 * - Titles
 * - Descriptions
 * - Entries
 */

/* ================================
[ Containers ]
================================ */

body {
  margin-top: 72px; /* height of sticky header plus desired margin */
}

@media (min-width: 768px) {
  body {
    margin-top: 80px;
  }
}

@media (min-width: 1024px) {
  body {
    margin-top: 0;
  }
}

/* ================================
[ Sections ]
================================ */

/* ---------- [ Before Header ] ---------- */

@media (min-width: 1024px) {
  .before-header {
    display: block;
    background: #e6c3b8;
    position: sticky;
    z-index: 99999;
    top: 0;
  }

  #wpadminbar {
    z-index: 999999;
  }

  .admin-bar .before-header {
    top: 32px;
  }

  .before-header .wrap {
    display: flex;
  }
}

/* ---------- [ Header ] ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #fff;
  height: 60px; /* helps with JS consistency */
  z-index: 9999;
  border-bottom: 2px solid #f4f4f4;
}

@media (min-width: 1024px) {
  .site-header {
    position: relative;
    height: auto !important; /* to overwrite inline styles added by js, if the user resizes their browser */
    background: transparent;
    overflow: visible;
    z-index: auto;
    border-bottom: 0;
    flex-basis: 320px;
    margin: 40px 0;
  }
}

.admin-bar .site-header {
  top: 46px; /* height of admin bar */
}

@media (min-width: 783px) {
  .admin-bar .site-header {
    top: 32px; /* height of admin bar */
  }
}

@media (min-width: 1024px) {
  .admin-bar .site-header {
    top: auto;
  }
}

.site-header > .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%; /* used for inheritence */
}

@media (min-width: 1024px) {
  .site-header > .wrap {
    position: relative; /* for desktop search */
  }
}

/* [ Toggles ] */

.site-header .generic-toggle {
  width: 48px; /* keep max width/height for tap UX */
  height: 100%;
  font-size: 32px;
}

.site-header .menu-toggle {
  order: 1;
  margin-right: -10px;
  color: #e6c3b8;
}

.site-header .search-toggle {
  color: inherit;
  font-size: 24px;
  position: relative;
  top: 1px;
}

@media (min-width: 1024px) {
  .site-header .search-toggle {
    display: block;
    order: 1;
    z-index: 9;
    color: #c69a9a;
    font-size: 40px;
    top: 0;
  }
}

@media (hover: hover) {
  .site-header .search-toggle:hover {
    color: #404041;
  }
}

@media (min-width: 1024px) {
  .site-header .search-toggle .icon-search::before {
    content: '\e93a';
  }
}

/* [ Logo ] */

.title-area {
  flex: 1;
  height: 100%;
}

@media (min-width: 1024px) {
  .title-area {
    width: 320px;
    max-width: 320px;
    margin-right: auto;
  }
}

.title-area .site-title a {
  display: block;
  margin: 8px auto 0;
  height: 48px; /* height minus border minus margin-top minus whatever bottom space */
  background: url(/wp-content/themes/once-coupled-a-cozy-kitchen/assets/images/logo.svg) no-repeat left center / contain;
  text-indent: -9999px;
  transition: opacity 400ms;
}

@media (min-width: 1024px) {
  .title-area .site-title a {
    width: 100%;
    height: 108px;
    margin: 0;
    position: relative;
    z-index: 9;
    background-position: center;
  }
}

/* [ Search ] */

#header-search {
  position: absolute;
  top: 58px;
  left: 0;
  width: 100vw;
  height: 68px;
  background: #f4f4f4;
  padding: 12px 28px;
}

#header-search .search-form {
  background-color: #fff;
}

@media (min-width: 1024px) {
  #header-search {
    z-index: 9;
    width: 320px;
    height: 82px;
    padding: 16px 20px;
    border: 2px solid #c69a9a;
    top: unset;
    left: unset;
    right: 0;
    bottom: -60px;
  }
}

#header-search .search-submit-icon {
  color: #c69a9a;
}

.site-header .search-container {
  /* 	margin-top: -1px;
	order: initial; */
}

/* [ Social ] */

.site-header .social-container {
  position: relative;
  z-index: 9;
  min-width: 254px;
  margin-right: 20px;
}

/* ---------- [ Site Footer ] ---------- */

/* ================================
[ Navigation ]
================================ */

/* ---------- [ Nav: Footer ] ---------- */

.nav-footer-about .menu,
.nav-footer-browse .menu {
  display: flex;
  flex-direction: column;
}

.nav-footer-about .menu-item,
.nav-footer-about .menu-item a,
.nav-footer-browse .menu-item,
.nav-footer-browse .menu-item a {
  display: inline-block;
  text-align: center;
  color: #666;
  font-size: 16px;
  position: relative;
}

@media (min-width: 1024px) {
  .nav-footer-about .menu-item a,
  .nav-footer-browse .menu-item a {
    padding: 6px 12px;
  }
}

@media (hover: hover) {
  .nav-footer-about .menu-item a:hover,
  .nav-footer-browse .menu-item a:hover {
    color: #9f6565;
    text-decoration: underline;
  }

  .nav-footer-about .menu-item a:hover::after,
  .nav-footer-browse .menu-item a:hover::after {
    content: '\e919';
    font-family: 'Icons' !important;
    speak: never;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 60%;
    position: absolute;
    top: 12px;
    right: 0;
  }
}

@media (min-width: 1024px) and (hover: hover) {
  .nav-footer-about .menu-item a:hover::after,
  .nav-footer-browse .menu-item a:hover::after {
    font-size: 80%;
    top: 8px;
    right: -4px;
  }
}

/* ---------- [ Nav: Header ] ---------- */

@media (min-width: 1024px) {
  .nav-header .menu > .menu-item > a {
    padding: 16px;
    position: relative;
  }
}

@media (min-width: 1024px) and (hover: hover) {
  .nav-header .menu > .menu-item > a:hover {
    color: #fff;
    text-decoration: underline;
  }

  .nav-header .menu > .menu-item > a:hover::after {
    content: '\e919';
    font-family: 'Icons' !important;
    speak: never;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 64%;
    margin-left: 4px;
    position: absolute;
    top: 20px;
    right: 0;
  }
}

@media (min-width: 1024px) {
  .nav-header .menu > .menu-item:first-of-type a {
    padding-left: 0;
  }

  .nav-header .sub-menu .sub-menu,
  .nav-header .menu > .menu-item > .sub-menu {
    width: 188px;
    margin-left: 188px;
  }

  .nav-header .menu > .menu-item > .sub-menu {
    top: 50px;
    left: 0;
    margin-left: 0;
  }

  .nav-header .sub-menu .menu-item {
    border-top: 2px solid #c69a9a;
  }

  .nav-header .sub-menu .menu-item:first-of-type {
    border-top: 0;
  }

  .nav-header .menu > .menu-item > .sub-menu .menu-item:first-of-type > a {
    padding-top: 8px;
  }

  .nav-header .menu > .menu-item > .sub-menu .menu-item:last-of-type > a {
    padding-bottom: 8px;
  }

  .nav-header .sub-menu a {
    text-align: left;
  }
}

@media (hover: hover) {
  .nav-header .sub-menu a:hover,
  .nav-header .sub-menu .sub-menu a:hover {
    color: #fff;
    background-color: #404041;
  }
}

/* ---------- [ Nav: Primary ] ---------- */

.nav-primary {
  position: fixed;
  z-index: 9999;
  top: 58px; /* height of sticky header */
  left: 0;
  width: 100%;
  display: none;
  overflow-y: scroll;
  background: #f4f4f4;
  max-height: calc(100vh - 58px); /* height of sticky header */
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

@media (min-width: 1024px) {
  .nav-primary {
    position: relative;
    z-index: auto;
    top: unset !important;
    width: auto;
    display: block;
    overflow: visible;
    background: transparent;
    max-height: unset !important;
    margin-top: -116px;
    min-height: 116px; /* match to positive of margin-top for Safari */
  }
}

.nav-primary::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

.admin-bar .nav-primary {
  /* height of admin bar (46px) + sticky header */
  top: 104px;
  max-height: calc(100vh - 104px);
}

@media (min-width: 783px) {
  .admin-bar .nav-primary {
    /* height of admin bar (32px) + sticky header */
    top: 90px;
    max-height: calc(100vh - 90px);
  }
}

@media (min-width: 1024px) {
  .admin-bar .nav-primary {
    top: 0;
    max-height: unset;
  }
}

.nav-primary .wrap {
  width: 100%;
}

@media (min-width: 1024px) {
  .nav-primary .wrap {
    width: 1000px;
    padding: 0 300px 0 360px;
  }
}

@media (min-width: 1080px) {
  .nav-primary .wrap {
    width: 1020px;
  }
}

@media (min-width: 1200px) {
  .nav-primary .wrap {
    width: 1120px;
    padding-left: 400px;
  }
}

@media (min-width: 1240px) {
  .nav-primary .wrap {
    width: 1150px;
  }
}

.nav-primary .menu {
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .nav-primary .menu {
    flex-direction: row;
    align-items: center;
  }
}

/* [ Primary Nav - Menu Items ] */

.nav-primary .menu-item {
  position: relative;
  margin: 0;
  border-top: 2px solid #c69a9a;
  display: flex;
  flex-wrap: wrap;
}

@media (min-width: 1024px) {
  .nav-primary .menu-item {
    border: 0;
    flex: 1 1 auto;
    font-size: 20px;
  }
}

.nav-primary .menu > .menu-item:last-of-type {
  border-bottom: 2px solid #c69a9a;
}

.nav-primary .menu-item a {
  min-height: 48px;
  flex: 1;
  display: flex;
  align-items: center;
  color: #666;
  font-size: 20px;
}

@media (min-width: 1024px) {
  .nav-primary .menu-item a {
    flex: 0 1 auto;
    padding: 12px;
    min-height: auto;
  }

  .nav-primary .menu > .menu-item > a {
    /* for hover */
    margin-right: 8px;
    padding-left: 0;
    padding-right: 16px;
    border-top: 2px solid transparent;
  }
}

@media (min-width: 1024px) and (hover: hover) {
  .nav-primary .menu > .menu-item > a:hover {
    color: #9f6565;
    border-color: currentColor;
  }

  .nav-primary .menu > .menu-item > a:hover::after {
    content: '\e919';
    font-family: 'Icons' !important;
    speak: never;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 76%;
    margin-left: 4px;
    position: absolute;
    top: 16px;
    right: 0;
  }
}

/* [ Primary Nav - Sub-menu ] */

.nav-primary .sub-menu-toggle {
  display: block;
  width: 48px;
  color: #666;
  background: transparent;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.nav-primary .sub-menu-toggle .icon-font::before {
  margin-top: 0.2em;
}

.nav-primary .sub-menu-toggle.activated .icon-font::before {
  margin-left: 0.2em;
}

@media (min-width: 1024px) {
  .nav-primary .sub-menu-toggle {
    display: none;
  }
}

@media (max-width: 1023px) {
  .nav-primary .sub-menu {
    display: none;
    min-width: 100%;
  }
}

@media (min-width: 1024px) {
  .nav-primary .menu > .menu-item > .sub-menu {
    left: 0;
    margin-left: 0;
  }

  .nav-primary .sub-menu .menu-item {
    border-top: 2px solid #c69a9a;
  }

  .nav-primary .sub-menu .menu-item:first-of-type {
    border-top: 0;
  }
}
@media (min-width: 1024px) {
  .nav-primary .menu .sub-menu .menu-item a {
    padding: 8px;
    font-size: 14px;
    color: ;
  }

  .nav-primary .menu > .menu-item > .sub-menu .menu-item:first-of-type > a {
    padding-top: 8px;
  }

  .nav-primary .menu > .menu-item > .sub-menu .menu-item:last-of-type > a {
    padding-bottom: 8px;
  }
}

.nav-primary .sub-menu .menu-item a {
  font-size: 15px;
}

@media (min-width: 1024px) and (hover: hover) {
  .nav-primary .sub-menu a:hover,
  .nav-primary .sub-menu .sub-menu a:hover {
    color: #fff;
    background-color: #404041;
  }
}

/* [ Containers ] */

.nav-primary .mobile-nav-container {
  flex-direction: column;
}

@media (min-width: 1024px) {
  .nav-primary .mobile-nav-container {
    display: none;
  }
}

.nav-primary .mobile-nav-container > .menu-item:first-of-type {
  border-top: 0;
}

@media (min-width: 1024px) {
  .nav-primary .mobile-nav-cta {
    display: none;
  }
}

/* ================================
[ Content ]
================================ */

/* ---------- [ Breadcrumbs ] ---------- */

.breadcrumb {
  font-size: 15px;
  margin-bottom: 8px;
}

.breadcrumb a {
  font-weight: 500;
  color: #9f6565;
}

.breadcrumb-separator {
  position: relative;
  top: 1px;
  margin: 0 2px;
}

/* ---------- [ Titles ] ---------- */

.archive-title,
.entry-title,
.section-title {
  margin: 0 0 8px;
  line-height: 1;
  text-transform: uppercase;
  font-size: 32px;
}

@media (min-width: 1024px) {
  .archive-title,
  .entry-title,
  .section-title {
    font-size: 36px;
  }

  .archive-title {
    margin-bottom: 20px;
  }
}

.section-title {
  font-size: 26px;
}

@media (min-width: 1024px) {
  .section-title {
    font-size: 32px;
  }
}

.post-listing .content .entry-title {
  font-size: 20px;
  text-transform: lowercase;
  padding: 8px;
  color: #666;
}

/* ---------- [ Entries ] ---------- */

.post-listing .content .entry {
  text-align: center;
  background: #fff;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.16);
  margin-bottom: 16px;
}

@media (min-width: 1024px) {
  .post-listing .content .entry {
    margin-bottom: 40px;
  }
}
