/* Timberroot mega menu
   All classes are prefixed tr- so they will not collide with theme styles. */

.tr-masthead {
  --tr-page: #fbf8f1;
  --tr-bar: #302825;
  --tr-panel: #f5efe3;
  --tr-line: #dccfb8;
  --tr-ink: #473029;
  --tr-ink-soft: #5e4a41;
  --tr-muted: #85726a;
  --tr-sage: #8a9a7b;
  position: sticky;
  top: -32px; /* sage bar scrolls away, dark header stays pinned */
  z-index: 1000;
  font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
  color: var(--tr-ink);
}
.tr-masthead *, .tr-masthead *::before, .tr-masthead *::after { box-sizing: border-box; }
.tr-masthead ul { margin: 0; padding: 0; }

/* Keep the header clear of the WordPress admin bar when logged in */
@media (min-width: 783px) { .admin-bar .tr-masthead { top: 0; } }
@media (min-width: 601px) and (max-width: 782px) { .admin-bar .tr-masthead { top: 14px; } }

/* ---------- Sister brand bar ---------- */
.tr-util { background: #68745c; color: var(--tr-page); }
.tr-util-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 24px;
  min-height: 32px;
  display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  gap: 2px 12px;
  font-size: 0.8rem; letter-spacing: 0.02em;
}
.tr-util a { color: var(--tr-page); text-decoration: none; padding: 6px 0; }
.tr-util a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tr-util a:focus-visible { outline: 2px solid var(--tr-page); outline-offset: 2px; }
.tr-util-sep { opacity: .55; }

/* ---------- Header bar ---------- */
.tr-header {
  position: relative;
  background: var(--tr-bar);
  color: var(--tr-page);
}
.tr-bar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.tr-logo {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--tr-page);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.tr-logo img { display: block; height: 35px; width: auto; }
.tr-right { display: flex; align-items: center; gap: 18px; }

.tr-cta {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 22px;
  background: #d8b44a; color: #fff;
  border-radius: 3px;
  font: 700 0.95rem/1 "Lato", Arial, sans-serif;
  text-transform: uppercase; letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap;
  transition: filter .15s;
}
.tr-cta:hover { filter: brightness(1.07); }

.tr-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  background: none; color: var(--tr-page);
  border: 1px solid var(--tr-page); border-radius: 3px;
  cursor: pointer; text-decoration: none;
  transition: border-color .15s, color .15s, background-color .15s;
}
.tr-icon:hover { border-color: var(--tr-sage); color: var(--tr-sage); }
.tr-icon svg { width: 16px; height: 16px; fill: currentColor; }

.tr-cta:focus-visible,
.tr-icon:focus-visible,
.tr-logo:focus-visible,
.tr-menu a:focus-visible,
.tr-col-head:focus-visible { outline: 2px solid var(--tr-sage); outline-offset: 3px; }

.tr-burger { position: relative; width: 16px; height: 12px; }
.tr-burger span {
  position: absolute; left: 0; width: 100%; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease, top .25s ease;
}
.tr-burger span:nth-child(1) { top: 0; }
.tr-burger span:nth-child(2) { top: 5px; }
.tr-burger span:nth-child(3) { top: 10px; }
.tr-toggle[aria-expanded="true"] .tr-burger span:nth-child(1) { top: 5px; transform: rotate(45deg); }
.tr-toggle[aria-expanded="true"] .tr-burger span:nth-child(2) { opacity: 0; }
.tr-toggle[aria-expanded="true"] .tr-burger span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

/* ---------- Mega panel ---------- */
.tr-menu {
  position: absolute;
  left: 0; right: 0; top: 100%;
  background: var(--tr-panel);
  border-bottom: 1px solid var(--tr-line);
  box-shadow: 0 20px 36px -24px rgba(71,48,41,.35);
  max-height: calc(100vh - 104px - env(safe-area-inset-top, 0px));
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
.tr-menu.is-open {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity .22s ease, transform .22s ease, visibility 0s;
}
.tr-grid {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 28px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 32px;
}
.tr-col-head {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: 0; padding: 0 0 12px; margin: 0 0 14px;
  border-bottom: 1px solid var(--tr-sage);
  color: var(--tr-ink);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.15rem; font-weight: 500; text-align: left;
  cursor: default;
}
.tr-col-title { display: block; }
.tr-eyebrow {
  display: block;
  margin-bottom: 4px;
  font-family: "Lato", Arial, sans-serif;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.03em;
  color: #68745c;
}
.tr-eyebrow-spacer { visibility: hidden; }
.tr-chev { display: none; }

/* Chattanooga flyout */
.tr-has-sub { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tr-sub-toggle {
  width: 22px; height: 22px; padding: 0; border: 0; background: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--tr-ink-soft); cursor: pointer; border-radius: 3px;
}
.tr-sub-toggle span {
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px,-1px); transition: transform .2s ease;
}
.tr-sub-toggle:focus-visible { outline: 2px solid var(--tr-sage); outline-offset: 2px; }
.tr-sub {
  position: absolute; left: -16px; top: 100%; z-index: 5;
  padding-top: 8px; min-width: 230px;
  visibility: hidden; opacity: 0; transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.tr-has-sub:hover .tr-sub,
.tr-has-sub:focus-within .tr-sub,
.tr-has-sub.sub-open .tr-sub {
  visibility: visible; opacity: 1; transform: none;
  transition: opacity .18s ease, transform .18s ease, visibility 0s;
}
.tr-has-sub:hover .tr-sub-toggle span,
.tr-has-sub:focus-within .tr-sub-toggle span,
.tr-has-sub.sub-open .tr-sub-toggle span { transform: rotate(-135deg) translate(-1px,-1px); }
.tr-col .tr-sub ul {
  background: var(--tr-page);
  border: 1px solid var(--tr-line);
  border-top: 2px solid var(--tr-sage);
  border-radius: 4px;
  box-shadow: 0 14px 28px -16px rgba(71,48,41,.4);
  padding: 8px 0;
}
.tr-col .tr-sub li + li { margin-top: 0; }
.tr-col .tr-sub a {
  display: block; padding: 8px 16px;
  background-image: none; color: var(--tr-ink-soft);
}
.tr-col .tr-sub a:hover { background-color: var(--tr-panel); color: var(--tr-ink); }
.tr-col ul { list-style: none; margin: 0; padding: 0; }
.tr-col li + li { margin-top: 10px; }
.tr-col a {
  color: var(--tr-ink-soft);
  text-decoration: none;
  font-size: 0.98rem;
  line-height: 1.4;
  background-image: linear-gradient(var(--tr-sage), var(--tr-sage));
  background-size: 0 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: color .15s, background-size .2s;
}
.tr-col a:hover { color: var(--tr-ink); background-size: 100% 2px; }

.tr-foot {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 24px 26px;
  border-top: 1px solid var(--tr-line);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  color: var(--tr-muted);
  font-size: 0.9rem;
}
.tr-tagline { font-family: "Playfair Display", Georgia, serif; font-style: italic; color: var(--tr-ink); font-size: 1.05rem; }
.tr-foot a { color: var(--tr-ink); text-decoration: underline; text-decoration-color: var(--tr-sage); text-decoration-thickness: 2px; text-underline-offset: 4px; font-weight: 700; }
.tr-foot a:hover { text-decoration-color: var(--tr-ink); }

.tr-foot .tr-cta { display: none; }
.tr-foot a.tr-cta { color: #fff; text-decoration: none; }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .tr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 36px; }
}

/* ---------- Mobile: accordion ---------- */
@media (max-width: 680px) {
  .tr-bar { height: 64px; padding: 0 16px; gap: 10px; }
  .tr-right { gap: 10px; }
  .tr-right .tr-cta, .tr-right .tr-hide-sm { display: none; }
  .tr-logo { font-size: 1.35rem; }
  .tr-logo img { height: 30px; }
  .tr-foot .tr-cta { display: inline-flex; width: 100%; height: 44px; }
  .tr-menu { max-height: calc(100vh - 96px - env(safe-area-inset-top, 0px)); }
  .tr-util-inner { justify-content: center; flex-wrap: nowrap; padding: 0 10px; gap: 14px; font-size: 0.72rem; letter-spacing: 0; white-space: nowrap; }
  .tr-util-sep { display: none; }
  .tr-grid { grid-template-columns: 1fr; gap: 0; padding: 8px 18px 8px; }
  .tr-col { border-bottom: 1px solid var(--tr-line); }
  .tr-col-head { border: 0; margin: 0; padding: 18px 0; cursor: pointer; }
  .tr-chev {
    display: block; width: 10px; height: 10px;
    border-right: 2px solid var(--tr-ink); border-bottom: 2px solid var(--tr-ink);
    transform: rotate(45deg); transition: transform .2s ease; margin-right: 4px;
  }
  .tr-col-head[aria-expanded="true"] .tr-chev { transform: rotate(-135deg); }
  .tr-col ul { display: none; padding: 0 0 18px 2px; }
  .tr-col.is-open ul { display: block; }
  .tr-col li + li { margin-top: 14px; }
  .tr-eyebrow-spacer { display: none; }
  .tr-sub-toggle { width: 32px; height: 32px; margin-left: auto; }
  .tr-has-sub:hover .tr-sub, .tr-has-sub:focus-within .tr-sub { visibility: hidden; }
  .tr-has-sub:hover .tr-sub-toggle span, .tr-has-sub:focus-within .tr-sub-toggle span { transform: rotate(45deg) translate(-1px,-1px); }
  .tr-sub { position: static; flex-basis: 100%; min-width: 0; padding: 0; display: none; transform: none; }
  .tr-has-sub.sub-open .tr-sub { display: block; visibility: visible; }
  .tr-has-sub.sub-open .tr-sub-toggle span { transform: rotate(-135deg) translate(-1px,-1px); }
  .tr-col .tr-sub ul { background: none; border: 0; border-left: 2px solid var(--tr-sage); border-radius: 0; box-shadow: none; padding: 4px 0 4px 14px; margin: 6px 0 2px; }
  .tr-col .tr-sub a { padding: 7px 0; }
  .tr-col .tr-sub a:hover { background-color: transparent; }
  .tr-foot { padding: 20px 18px 28px; flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .tr-masthead *, .tr-masthead *::before, .tr-masthead *::after { transition: none !important; }
}

/* ---------- Theme overrides ----------
   Timber Root/Astra style nav links and buttons globally (uppercase,
   letter-spacing, button backgrounds). Reset them inside the menu only.
   The id selector gives these rules enough weight to win. */
#masthead.tr-masthead a,
#masthead.tr-masthead button,
#masthead.tr-masthead .tr-col-head,
#masthead.tr-masthead .tr-col-title,
#masthead.tr-masthead .tr-eyebrow,
#masthead.tr-masthead .tr-tagline {
  text-transform: none;
  letter-spacing: normal;
}
#masthead.tr-masthead button {
  box-shadow: none;
  text-shadow: none;
}
#masthead.tr-masthead .tr-col-head,
#masthead.tr-masthead .tr-sub-toggle,
#masthead.tr-masthead .tr-col-head:hover,
#masthead.tr-masthead .tr-col-head:focus,
#masthead.tr-masthead .tr-sub-toggle:hover,
#masthead.tr-masthead .tr-sub-toggle:focus {
  background: none;
  border-radius: 0;
}
#masthead.tr-masthead .tr-eyebrow { letter-spacing: 0.03em; }
#masthead.tr-masthead .tr-util-inner { letter-spacing: 0.02em; }
#masthead.tr-masthead .tr-cta {
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

/* Column headings: no hover or click effect from theme button styles */
#masthead.tr-masthead .tr-col-head,
#masthead.tr-masthead .tr-col-head:hover,
#masthead.tr-masthead .tr-col-head:focus,
#masthead.tr-masthead .tr-col-head:active {
  color: var(--tr-ink);
  background: none;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 1px solid var(--tr-sage);
  box-shadow: none;
  opacity: 1;
  transform: none;
  text-decoration: none;
  filter: none;
  transition: none;
}
#masthead.tr-masthead .tr-col-head .tr-eyebrow { color: #68745c; }
@media (max-width: 680px) {
  #masthead.tr-masthead .tr-col-head,
  #masthead.tr-masthead .tr-col-head:hover,
  #masthead.tr-masthead .tr-col-head:focus,
  #masthead.tr-masthead .tr-col-head:active { border-bottom: 0; }
}

/* The panel receives focus when opened; no outline on the panel itself */
#masthead.tr-masthead .tr-menu:focus { outline: none; }

/* ---------- Footer strip: tagline flip + social icons ---------- */
.tr-foot-left { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; }
.tr-foot .tr-tagline { margin: 0; }
.tr-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.tr-flip {
  display: inline-block;
  white-space: nowrap;
  vertical-align: bottom;
  perspective: 400px;
  transition: width .35s ease;
}
.tr-flip-word { display: inline-block; transform-origin: 50% 60%; }
.tr-flip-word.is-out { animation: trFlipOut .28s ease-in forwards; }
.tr-flip-word.is-in { animation: trFlipIn .34s ease-out; }
@keyframes trFlipOut { to { transform: rotateX(90deg); opacity: 0; } }
@keyframes trFlipIn { from { transform: rotateX(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }

.tr-social { list-style: none; display: flex; align-items: center; gap: 14px; }
#masthead.tr-masthead .tr-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  color: var(--tr-ink-soft);
  font-size: 16px; line-height: 1;
  text-decoration: none; background: none;
  transition: color .15s;
}
#masthead.tr-masthead .tr-social a:hover { color: #68745c; background: none; }
#masthead.tr-masthead .tr-social a:focus-visible { outline: 2px solid var(--tr-sage); outline-offset: 3px; }

/* Contact us: sage underline only, no theme hover box */
#masthead.tr-masthead .tr-foot a:not(.tr-cta),
#masthead.tr-masthead .tr-foot a:not(.tr-cta):hover,
#masthead.tr-masthead .tr-foot a:not(.tr-cta):focus {
  background: none;
  box-shadow: none;
}
#masthead.tr-masthead .tr-foot > a:not(.tr-cta),
#masthead.tr-masthead .tr-foot > a:not(.tr-cta):hover,
#masthead.tr-masthead .tr-foot > a:not(.tr-cta):focus { color: var(--tr-ink); }

/* Rotating tagline word in sage */
#masthead.tr-masthead .tr-flip-word { color: #68745c; }

/* ---------- Social icons: own copy of Font Awesome 6 brand icons ----------
   The theme's Font Awesome is older than 5.13 and has no TikTok icon.
   This loads current brand icons for the menu only; the rest of the
   site keeps using the theme's icons. */
@font-face {
  font-family: "TR Brands";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/webfonts/fa-brands-400.woff2") format("woff2");
}
#masthead.tr-masthead .tr-social i {
  font-family: "TR Brands" !important;
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 1;
  display: inline-block;
  -webkit-font-smoothing: antialiased;
}
#masthead.tr-masthead .tr-social i::before { font-family: "TR Brands" !important; font-weight: 400; }
#masthead.tr-masthead .tr-social .fa-instagram::before   { content: "\f16d"; }
#masthead.tr-masthead .tr-social .fa-facebook-f::before  { content: "\f39e"; }
#masthead.tr-masthead .tr-social .fa-tiktok::before      { content: "\e07b"; }
#masthead.tr-masthead .tr-social .fa-pinterest-p::before { content: "\f231"; }

/* ---------- Footer strip layout ----------
   Desktop: tagline left, social icons pushed right next to Shop our merch.
   Mobile: social icons sit under the tagline. */
.tr-foot { gap: 16px 28px; }
.tr-foot-left { flex: 1 1 auto; justify-content: space-between; }

/* Icon buttons: no theme hover/focus fill, and no sticky hover on touch */
#masthead.tr-masthead .tr-icon,
#masthead.tr-masthead .tr-icon:hover,
#masthead.tr-masthead .tr-icon:focus,
#masthead.tr-masthead .tr-icon:active { background: none; box-shadow: none; }
@media (hover: none) {
  #masthead.tr-masthead .tr-icon:hover { border-color: var(--tr-page); color: var(--tr-page); }
}

@media (max-width: 680px) {
  /* Full-height menu panel on phones */
  #masthead.tr-masthead .tr-menu {
    position: fixed;
    top: var(--tr-menu-top, 64px);
    bottom: 0;
    left: 0;
    right: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  #masthead.tr-masthead .tr-grid,
  #masthead.tr-masthead .tr-foot { width: 100%; }
  #masthead.tr-masthead .tr-grid { flex: 0 0 auto; }
  #masthead.tr-masthead .tr-foot { margin-top: auto; padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
  html.tr-menu-open, html.tr-menu-open body { overflow: hidden; }

  /* No rule under the last column; the footer divider handles it */
  #masthead.tr-masthead .tr-col:last-child { border-bottom: 0; }

  .tr-foot-left { flex-direction: column; align-items: flex-start; gap: 14px; flex: 0 0 auto; }
}

/* Logo image: keep theme image rules from resizing it */
#masthead.tr-masthead .tr-logo { display: inline-flex; align-items: center; line-height: 0; }
#masthead.tr-masthead .tr-logo img {
  display: block;
  height: 35px;
  width: auto;
  max-width: 220px;
  max-height: none;
  object-fit: contain;
}
@media (max-width: 680px) {
  #masthead.tr-masthead .tr-logo img { height: 30px; max-width: 170px; }
}

/* ---------- Bar layout ----------
   Desktop: hamburger, logo, then buttons pushed right.
   Phones: logo left, hamburger joins the icons on the right. */
#masthead.tr-masthead .tr-bar { display: flex; justify-content: flex-start; gap: 20px; }
#masthead.tr-masthead .tr-right { margin-left: auto; }
@media (max-width: 680px) {
  #masthead.tr-masthead .tr-bar { gap: 10px; }
  #masthead.tr-masthead .tr-logo { order: 0; margin-right: auto; }
  #masthead.tr-masthead .tr-toggle { order: 1; }
  #masthead.tr-masthead .tr-right { order: 2; margin-left: 0; }
}

/* ---------- Sticky header (script-driven) ----------
   CSS sticky breaks when a theme wrapper hides overflow, so the
   script pins the dark bar once the sage strip scrolls past, and the
   masthead keeps the bar's space so the page doesn't jump. */
#masthead.tr-masthead { position: relative; top: auto; }
#masthead.tr-masthead.is-stuck { padding-bottom: var(--tr-bar-h, 72px); }
#masthead.tr-masthead.is-stuck .tr-header {
  position: fixed;
  top: var(--tr-stick-top, 0px);
  left: 0;
  right: 0;
  z-index: 1000;
}

/* ---------- Phone footer section ----------
   Blog keeps its bottom rule, no divider above the footer,
   View all units first, then everything centered. */
@media (max-width: 680px) {
  #masthead.tr-masthead .tr-col:last-child { border-bottom: 1px solid var(--tr-line); }
  #masthead.tr-masthead .tr-foot {
    border-top: 0;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
  }
  #masthead.tr-masthead .tr-foot .tr-cta { order: -1; }
  #masthead.tr-masthead .tr-foot-left { align-items: center; width: 100%; }
  #masthead.tr-masthead .tr-social { justify-content: center; }
}

/* Sister brands bar: desktop only */
@media (max-width: 680px) {
  #masthead.tr-masthead .tr-util { display: none; }
}
