/* ==========================================================================
   Eon Echelon: the frame every page shares.

   Contents
   1. Base
   2. Header (a ruled box: logo on the left, six menu cells on the right)
   3. Buttons
   4. Tea cards (homepage, shop and "related teas" all use them)
   5. Page frame, titles, text pages and notices
   6. Footer
   ========================================================================== */


/* 1. Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  font-family: var(--ee-sans);
  font-size: var(--ee-text-base);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ee-ink);
  background: var(--ee-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* WooCommerce's own stylesheet takes its colours and shapes from these
   variables. Set on body so they win whichever stylesheet loads first.
   ("highligh" is WooCommerce's spelling.) */
body {
  --woocommerce: var(--ee-ink);
  --wc-primary: var(--ee-ink);
  --wc-primary-text: var(--ee-paper);
  --wc-secondary: var(--ee-card);
  --wc-secondary-text: var(--ee-ink);
  --wc-highlight: var(--ee-ink);
  --wc-highligh-text: var(--ee-paper);
  --wc-green: var(--ee-green);
  --wc-subtext: var(--ee-soft);
  --wc-form-border-color: var(--ee-ink);
  --wc-form-border-radius: 0;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ee-ink);
  outline-offset: 3px;
}

.ee-visually-hidden,
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.ee-skip-link {
  position: absolute;
  top: 0;
  left: var(--ee-edge);
  z-index: 10;
  padding: 0.5rem 1rem;
  font-weight: 600;
  color: var(--ee-paper);
  text-decoration: none;
  background: var(--ee-ink);
  transform: translateY(-110%);
}

.ee-skip-link:focus {
  transform: none;
}

/* The page's content column: as wide as --ee-width, never touching the
   screen edge. The header box, the tea grid and the footer all sit on it. */
.ee-frame {
  width: min(100% - 2 * var(--ee-edge), var(--ee-width));
  margin-inline: auto;
}


/* 2. Header
   Phone: the logo in a row of its own, the six menu cells beneath it.
   Wide screens: logo box, an empty stretch, then the cells in the right half.
   ========================================================================== */

.ee-announcement {
  margin: 0;
  padding: 0.5rem var(--ee-edge);
  font-size: var(--ee-text-small);
  font-weight: 500;
  line-height: 1.25rem;
  text-align: center;
  color: var(--ee-paper);
  background: var(--ee-ink);
}

.ee-header__box {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: var(--ee-gap);
  border: 1px solid var(--ee-line);
}

.ee-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(var(--ee-cell-height) * 1.4);
  padding: 0.5rem var(--ee-pad);
}

.ee-logo img {
  display: block;
  width: auto;
  height: 1.75rem;
}

/* The cells' rules are each cell's own top and left border. The list is
   pulled 1px up and left and the nav clips it, so the outermost rules do not
   double up with the box's border. */
.ee-nav {
  overflow: hidden;
  border-top: 1px solid var(--ee-line);
}

.ee-nav__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: -1px 0 0 -1px;
  padding: 0;
  list-style: none;
}

.ee-nav__list > li {
  display: flex;
  border-top: 1px solid var(--ee-line);
  border-left: 1px solid var(--ee-line);
}

/* The cart always takes the top right cell; the menu's links fill the rest. */
.ee-nav__list > .ee-nav__cart {
  grid-row: 1;
  grid-column: 3;
}

.ee-nav__list a {
  display: flex;
  flex: 1;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: var(--ee-cell-height);
  padding: 0 0.625rem;
  font-size: clamp(0.6875rem, 3vw, var(--ee-text-label));   /* 11px on small phones, so "Accessories" fits its cell */
  font-weight: 500;
  letter-spacing: var(--ee-label-tracking);
  text-decoration: none;
  text-transform: uppercase;
}

.ee-nav__list a:hover,
.ee-nav__list .current-menu-item > a {
  color: var(--ee-paper);
  background: var(--ee-ink);
}

.ee-nav__list a:focus-visible {
  outline-offset: -4px;
}

.ee-nav__list a:hover:focus-visible,
.ee-nav__list .current-menu-item > a:focus-visible {
  outline-color: var(--ee-paper);
}

/* After "+ Add", WooCommerce swaps in a fresh count, which flashes once. */
.ee-cart-count.is-fresh {
  animation: ee-count-flash 900ms ease-out;
}

@keyframes ee-count-flash {
  from {
    color: var(--ee-paper);
    background: var(--ee-ink);
    box-shadow: 0 0 0 0.375rem var(--ee-ink);
  }
}

@media (min-width: 50em) {
  .ee-header__box {
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 50%);
  }

  .ee-logo {
    min-height: calc(var(--ee-cell-height) * 2 + 1px);
    padding-inline: clamp(1.25rem, 2.4vw, 2rem);
    border-right: 1px solid var(--ee-line);
  }

  .ee-logo img {
    height: 2.125rem;
  }

  .ee-nav {
    grid-column: 3;
    border-top: 0;
    border-left: 1px solid var(--ee-line);
  }

  .ee-nav__list a {
    padding-inline: var(--ee-pad);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ee-cart-count.is-fresh {
    animation: none;
  }
}


/* 3. Buttons
   ========================================================================== */

.ee-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--ee-control-height);
  padding: 0 1.75rem;
  font-size: var(--ee-text-small);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: var(--ee-label-tracking);
  color: var(--ee-paper);
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  background: var(--ee-ink);
  border: 1px solid var(--ee-ink);
  border-radius: 0;
  transition: color var(--ee-duration-quick) ease-out, background-color var(--ee-duration-quick) ease-out;
}

.ee-button:hover {
  color: var(--ee-ink);
  background: transparent;
}

@media (prefers-reduced-motion: reduce) {
  .ee-button {
    transition: none;
  }
}


/* 4. Tea cards
   Name and price top left, the add button top right, the tea itself below.
   The photographs have a pure white background, and "multiply" lets the
   card's colour show through it, so the leaves sit straight on the card.
   ========================================================================== */

.ee-card {
  position: relative;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  background: var(--ee-card);
}

.ee-card__head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--ee-pad) var(--ee-pad) 0;
}

.ee-card__text {
  min-width: 0;
}

.ee-card__name {
  margin: 0;
  font-size: var(--ee-text-base);
  font-weight: 500;
  line-height: 1.3;
}

/* The link covers the whole card, so the picture is clickable too. */
.ee-card__name a {
  text-decoration: none;
}

.ee-card__name a::after {
  position: absolute;
  inset: 0;
  content: "";
}

.ee-card__name a:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
}

.ee-card__name a:focus-visible {
  outline: 0;
}

.ee-card__name a:focus-visible::after {
  outline: 2px solid var(--ee-ink);
  outline-offset: -2px;
}

.ee-card__offer {
  margin: 0.125rem 0 0;
  font-size: var(--ee-text-small);
  color: var(--ee-soft);
}

/* The button and WooCommerce's "View cart" link sit above the card link. */
.ee-card__action {
  position: relative;
  z-index: 1;
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 0.375rem;
  align-items: flex-end;
}

.ee-card__add {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  font-size: var(--ee-text-label);
  font-weight: 500;
  letter-spacing: var(--ee-label-tracking);
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid var(--ee-ink);
  transition: color var(--ee-duration-quick) ease-out, background-color var(--ee-duration-quick) ease-out;
}

.ee-card__add:hover {
  color: var(--ee-paper);
  background: var(--ee-ink);
}

.ee-card__add.loading {
  pointer-events: none;
  opacity: 0.5;
}

.ee-card__action .added_to_cart {
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  padding: 0;
  font-size: var(--ee-text-small);
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
  white-space: nowrap;
}

.ee-card__picture {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* What the tea is made of, along the card's bottom edge. */
.ee-card__about {
  margin: auto 0 0;
  padding: 0 var(--ee-pad) var(--ee-pad);
  font-size: var(--ee-text-small);
  color: var(--ee-soft);
}

/* A product with no photograph yet shows the sprig, faintly. */
.ee-card__picture--none {
  padding: 30%;
  mix-blend-mode: normal;
  opacity: 0.28;
}

/* Narrow cards (two to a row on a phone): the button drops under the name. */
@container (max-width: 15.5rem) {
  .ee-card__head {
    flex-direction: column;
  }

  /* Room for two lines of name, so the buttons and pictures in a row line up. */
  .ee-card__name {
    min-height: 2.6em;
  }

  .ee-card__action {
    flex-direction: row;
    gap: 0.75rem;
    align-items: center;
  }

  .ee-card__action .added_to_cart {
    position: static;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ee-card__add {
    transition: none;
  }
}


/* 5. Page frame, titles, text pages and notices
   ========================================================================== */

.ee-main {
  flex: 1 0 auto;
}

.ee-wrap {
  padding-block: clamp(2rem, 5vw, 4rem) var(--ee-section-space);
}

.ee-page__title {
  margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
  font-family: var(--ee-serif);
  font-size: var(--ee-text-title);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.ee-page__title a {
  text-decoration: none;
}

/* Text pages: a readable column, about 70 characters to the line. */
.ee-prose {
  max-width: 40rem;
  font-size: var(--ee-text-lead);
  line-height: 1.6;
}

.ee-prose > * + * {
  margin-top: 1em;
}

.ee-prose h2,
.ee-prose h3 {
  margin-top: 2em;
  font-family: var(--ee-serif);
  font-weight: 400;
  line-height: 1.25;
}

.ee-prose a {
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
}

/* WooCommerce notices can appear on any page. */
.ee-notices {
  padding-top: var(--ee-gap);
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  color: var(--ee-ink);
  background: var(--ee-blush);
  border-radius: 0;
}

.woocommerce-message,
.woocommerce-info {
  border-top-color: var(--ee-green);
}

.woocommerce-error {
  border-top-color: var(--ee-copper);
}

.woocommerce-message::before,
.woocommerce-info::before {
  color: var(--ee-green);
}

.woocommerce-error::before {
  color: var(--ee-copper);
}

/* WooCommerce moves focus to a new notice so screen readers announce it.
   The notice is not a control, so it needs no focus ring. */
.woocommerce-message:focus-visible,
.woocommerce-info:focus-visible,
.woocommerce-error:focus-visible {
  outline: 0;
}

.ee-notices .woocommerce-message {
  margin-bottom: 0;
}


/* 6. Footer
   A band split down the middle of the page (about the shop on the left, the
   email sign-up on the right), then the link columns.
   ========================================================================== */

.ee-footer__about,
.ee-signup {
  padding: clamp(2rem, 5vw, 3.5rem) var(--ee-edge);
}

.ee-footer__about {
  background: var(--ee-mist);
}

.ee-signup {
  background: var(--ee-card);
}

.ee-footer__name {
  margin: 0;
  font-weight: 500;
}

.ee-footer__blurb {
  max-width: 28rem;
  margin: 0.25rem 0 0;
}

.ee-signup__label {
  display: block;
}

.ee-signup__row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  margin-top: 0.75rem;
}

.ee-signup__field {
  flex: 1;
  min-width: 0;
  min-height: var(--ee-control-height);
  padding: 0;
  font-size: var(--ee-text-subtitle);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ee-ink);
  border-radius: 0;
}

.ee-signup__field::placeholder {
  color: var(--ee-soft);
  opacity: 1;
}

.ee-signup__field:focus-visible {
  outline: 0;
  border-bottom-width: 3px;
}

/* A field left for robots to fill in; people never see it. */
.ee-signup__trap {
  position: absolute;
  left: -200vw;
}

.ee-signup__status {
  margin: 0;
  font-family: var(--ee-serif);
  font-size: var(--ee-text-subtitle);
  line-height: 1.3;
}

.ee-signup__status + .ee-signup__form {
  margin-top: 1.25rem;
}

.ee-footer__links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: 2rem;
  padding-block: clamp(2.5rem, 6vw, 4rem) 2rem;
}

.ee-footer__heading {
  margin: 0 0 0.75rem;
  padding-bottom: 0.75rem;
  font-size: var(--ee-text-label);
  font-weight: 500;
  letter-spacing: var(--ee-label-tracking);
  text-transform: uppercase;
  border-bottom: 1px solid var(--ee-line);
}

.ee-footer__list {
  margin: 0;
  padding: 0 var(--ee-gap) 0 0;
  list-style: none;
}

.ee-footer__list a {
  display: inline-block;
  padding-block: 0.25rem;
  text-decoration: none;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
}

.ee-footer__list a:hover {
  text-decoration-line: underline;
}

.ee-footer__legal {
  grid-column: 1 / -1;
  margin: 0;
  font-size: var(--ee-text-small);
  color: var(--ee-soft);
}

@media (min-width: 50em) {
  /* One band, painted half and half; the two blocks sit on the content
     column, so the split falls exactly on the page's centre line. */
  .ee-footer__band {
    background: linear-gradient(to right, var(--ee-mist) 50%, var(--ee-card) 50%);
  }

  .ee-footer__band-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100% - 2 * var(--ee-edge), var(--ee-width));
    margin-inline: auto;
  }

  .ee-footer__about,
  .ee-signup {
    background: none;
  }

  .ee-footer__about {
    padding-inline: 0 clamp(2rem, 5vw, 4rem);
  }

  .ee-signup {
    padding-inline: clamp(2rem, 5vw, 4rem) 0;
  }

  .ee-footer__links {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
