/*
 * Titan Protect production theme tokens and navigation components.
 * Source: titan-protect-theme-tokens.json v1.0.0.
 * Load after the active WordPress/Elementor base stylesheet.
 */

:root {
  /* Surfaces */
  --tp-surface-canvas: #F8F6F0;
  --tp-surface-paper: #FFFFFF;
  --tp-surface-parchment: #F1EBDD;
  --tp-surface-subtle: #EEE9DF;
  --tp-surface-tape: #121212;

  /* Text, brand, lines and states */
  --tp-text-primary: #151515;
  --tp-text-secondary: #56524B;
  --tp-text-muted: #777168;
  --tp-text-inverse: #F8F6F0;
  --tp-text-link: #6D5420;
  --tp-line-strong: #1F1F1F;
  --tp-line-default: #CFC8BA;
  --tp-line-subtle: #E5E0D6;
  --tp-line-focus: #B08A32;
  --tp-brand-gold: #B08A32;
  --tp-brand-gold-soft: #E7DAB7;
  --tp-state-constructive: #2F6B4F;
  --tp-state-constructive-soft: #E3EEE6;
  --tp-state-defensive: #9C4540;
  --tp-state-defensive-soft: #F3E4E2;
  --tp-state-neutral: #615D55;
  --tp-state-neutral-soft: #EBE8E2;
  --tp-state-attention: #8A691C;
  --tp-state-attention-soft: #F3ECD7;
  --tp-state-information: #415E74;

  /* Typography */
  --tp-font-display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --tp-font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --tp-font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  --tp-font-display-xl: clamp(2.75rem, 5vw, 5.5rem);
  --tp-font-display-lg: clamp(2.25rem, 4vw, 4rem);
  --tp-font-display-md: clamp(1.75rem, 3vw, 2.75rem);
  --tp-font-heading-sm: 1.375rem;
  --tp-font-body-lg: 1.125rem;
  --tp-font-body: 1rem;
  --tp-font-body-sm: 0.875rem;
  --tp-font-utility: 0.6875rem;
  --tp-font-data: 0.75rem;
  --tp-leading-display: 0.98;
  --tp-leading-heading: 1.15;
  --tp-leading-body: 1.55;
  --tp-leading-utility: 1.25;
  --tp-tracking-utility: 0.14em;
  --tp-tracking-data: 0.06em;

  /* Spacing and sizing */
  --tp-space-0: 0;
  --tp-space-1: 0.25rem;
  --tp-space-2: 0.5rem;
  --tp-space-3: 0.75rem;
  --tp-space-4: 1rem;
  --tp-space-5: 1.25rem;
  --tp-space-6: 1.5rem;
  --tp-space-8: 2rem;
  --tp-space-10: 2.5rem;
  --tp-space-12: 3rem;
  --tp-space-16: 4rem;
  --tp-space-20: 5rem;
  --tp-space-24: 6rem;
  --tp-page-max: 1440px;
  --tp-content-max: 1280px;
  --tp-reading-max: 760px;
  --tp-control-min-height: 44px;
  --tp-header-desktop: 78px;
  --tp-header-mobile: 60px;
  --tp-market-tape: 28px;
  --tp-bottom-nav-mobile: 68px;
  --tp-gutter-desktop: 24px;
  --tp-gutter-tablet: 20px;
  --tp-gutter-mobile: 16px;
  --tp-radius-none: 0;
  --tp-radius-sm: 2px;
  --tp-radius-md: 4px;
  --tp-radius-lg: 6px;
  --tp-shadow-lift: 0 4px 18px rgba(21, 21, 21, 0.06);
  --tp-motion-fast: 120ms;
  --tp-motion-base: 180ms;
  --tp-ease: cubic-bezier(0.2, 0, 0, 1);
}

/* Safe component defaults; these do not reset the active theme globally. */
.tp-shell,
.tp-site-header,
.tp-mobile-drawer,
.tp-app-tabbar {
  color: var(--tp-text-primary);
  font-family: var(--tp-font-body);
}

.tp-shell {
  background: var(--tp-surface-canvas);
  color: var(--tp-text-primary);
}

.tp-shell *,
.tp-site-header *,
.tp-mobile-drawer *,
.tp-app-tabbar * {
  box-sizing: border-box;
}

.tp-visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.tp-site-header a,
.tp-mobile-drawer a,
.tp-app-tabbar a {
  color: inherit;
  text-decoration: none;
}

.tp-site-header button,
.tp-mobile-drawer button,
.tp-app-tabbar button {
  color: inherit;
  font: inherit;
}

.tp-site-header :focus-visible,
.tp-mobile-drawer :focus-visible,
.tp-app-tabbar :focus-visible {
  outline: 2px solid var(--tp-line-focus);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------
   DESKTOP / TABLET GLOBAL MASTHEAD AND MEGA MENU
   --------------------------------------------------------------- */
.tp-site-header {
  background: var(--tp-surface-canvas);
  border-bottom: 1px solid var(--tp-line-strong);
  position: relative;
  z-index: 100;
}

.tp-market-tape {
  align-items: center;
  background: var(--tp-surface-tape);
  color: var(--tp-text-inverse);
  display: flex;
  font-family: var(--tp-font-mono);
  font-size: var(--tp-font-utility);
  height: var(--tp-market-tape);
  letter-spacing: var(--tp-tracking-data);
  line-height: var(--tp-leading-utility);
  overflow: hidden;
  text-transform: uppercase;
}

.tp-market-tape__inner,
.tp-header__inner,
.tp-mega-panel__inner {
  margin: 0 auto;
  max-width: var(--tp-page-max);
  padding-left: var(--tp-gutter-desktop);
  padding-right: var(--tp-gutter-desktop);
  width: 100%;
}

.tp-market-tape__inner {
  align-items: center;
  display: flex;
  gap: var(--tp-space-5);
  justify-content: space-between;
  white-space: nowrap;
}

.tp-market-tape__item {
  opacity: 0.92;
}

.tp-market-tape__item--label {
  color: var(--tp-brand-gold-soft);
}

.tp-header {
  background: var(--tp-surface-canvas);
  min-height: var(--tp-header-desktop);
}

.tp-header__inner {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(225px, 1fr) auto minmax(225px, 1fr);
  min-height: var(--tp-header-desktop);
}

.tp-brand {
  align-items: center;
  display: inline-flex;
  font-family: var(--tp-font-display);
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.tp-global-nav {
  align-items: stretch;
  align-self: stretch;
  display: flex;
  justify-content: center;
}

.tp-global-nav__list {
  align-items: stretch;
  display: flex;
  gap: var(--tp-space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.tp-global-nav__item {
  align-items: stretch;
  display: flex;
}

.tp-menu-trigger,
.tp-action-link,
.tp-mobile-trigger,
.tp-drawer__button,
.tp-app-tabbar__link {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: var(--tp-radius-none);
  cursor: pointer;
}

.tp-menu-trigger {
  align-items: center;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  font-family: var(--tp-font-body);
  font-size: var(--tp-font-utility);
  font-weight: 600;
  justify-content: center;
  letter-spacing: var(--tp-tracking-utility);
  min-height: var(--tp-header-desktop);
  padding: 0 var(--tp-space-4);
  text-transform: uppercase;
  transition: border-color var(--tp-motion-fast) var(--tp-ease), color var(--tp-motion-fast) var(--tp-ease);
}

.tp-menu-trigger:hover,
.tp-menu-trigger[aria-expanded='true'] {
  border-bottom-color: var(--tp-brand-gold);
}

.tp-header__actions {
  align-items: center;
  display: flex;
  gap: var(--tp-space-2);
  justify-content: flex-end;
}

.tp-action-link {
  align-items: center;
  display: inline-flex;
  font-family: var(--tp-font-body);
  font-size: var(--tp-font-utility);
  font-weight: 600;
  gap: 0.45rem;
  letter-spacing: var(--tp-tracking-utility);
  min-height: var(--tp-control-min-height);
  padding: 0 var(--tp-space-3);
  text-transform: uppercase;
}

.tp-action-link--membership {
  border-left: 1px solid var(--tp-line-default);
  border-right: 1px solid var(--tp-line-default);
}

.tp-action-link--primary {
  background: var(--tp-text-primary);
  color: var(--tp-text-inverse);
  min-height: 38px;
  padding: 0 var(--tp-space-4);
}

.tp-search-icon {
  display: inline-block;
  height: 14px;
  position: relative;
  width: 14px;
}

.tp-search-icon::before {
  border: 1.5px solid currentColor;
  border-radius: 50%;
  content: '';
  height: 9px;
  left: 0;
  position: absolute;
  top: 0;
  width: 9px;
}

.tp-search-icon::after {
  background: currentColor;
  content: '';
  height: 1.5px;
  position: absolute;
  right: 0;
  top: 10px;
  transform: rotate(45deg);
  width: 6px;
}

.tp-mega-panel {
  background: var(--tp-surface-canvas);
  border-bottom: 1px solid var(--tp-line-strong);
  border-top: 1px solid var(--tp-line-default);
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 100%;
  transform: translateY(-6px);
  transition: opacity var(--tp-motion-base) var(--tp-ease), transform var(--tp-motion-base) var(--tp-ease);
  visibility: hidden;
}

.tp-mega-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.tp-mega-panel__inner {
  padding-bottom: var(--tp-space-6);
  padding-top: var(--tp-space-6);
}

.tp-mega-grid {
  background: var(--tp-surface-paper);
  border: 1px solid var(--tp-line-strong);
  box-shadow: var(--tp-shadow-lift);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, 0.85fr);
}

.tp-mega-column {
  border-right: 1px solid var(--tp-line-default);
  padding: var(--tp-space-6);
}

.tp-mega-column:last-child {
  border-right: 0;
}

.tp-mega-heading,
.tp-eyebrow {
  color: var(--tp-brand-gold);
  font-family: var(--tp-font-body);
  font-size: var(--tp-font-utility);
  font-weight: 600;
  letter-spacing: var(--tp-tracking-utility);
  line-height: var(--tp-leading-utility);
  margin: 0 0 var(--tp-space-4);
  text-transform: uppercase;
}

.tp-mega-list {
  display: grid;
  gap: var(--tp-space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

.tp-mega-link {
  align-items: flex-start;
  display: grid;
  gap: var(--tp-space-1) var(--tp-space-3);
  grid-template-columns: 1fr auto;
  padding: var(--tp-space-3);
  transition: background-color var(--tp-motion-fast) var(--tp-ease);
}

.tp-mega-link:hover,
.tp-mega-link:focus-visible {
  background: var(--tp-surface-subtle);
}

.tp-mega-link__title {
  font-family: var(--tp-font-display);
  font-size: 1.45rem;
  line-height: var(--tp-leading-heading);
}

.tp-mega-link__description {
  color: var(--tp-text-secondary);
  font-size: var(--tp-font-body-sm);
  grid-column: 1;
  line-height: 1.4;
}

.tp-mega-link__arrow {
  color: var(--tp-brand-gold);
  font-size: 1.3rem;
  grid-column: 2;
  grid-row: 1 / span 2;
  line-height: 1;
  padding-top: 0.2rem;
}

.tp-mega-feature {
  background: var(--tp-surface-parchment);
  display: flex;
  flex-direction: column;
  gap: var(--tp-space-4);
  justify-content: space-between;
  min-height: 100%;
  padding: var(--tp-space-6);
}

.tp-mega-feature__title {
  border-bottom: 1px solid var(--tp-brand-gold);
  color: var(--tp-brand-gold);
  font-family: var(--tp-font-body);
  font-size: var(--tp-font-utility);
  font-weight: 600;
  letter-spacing: var(--tp-tracking-utility);
  margin: 0;
  padding-bottom: var(--tp-space-3);
  text-transform: uppercase;
}

.tp-mega-feature__statement {
  font-family: var(--tp-font-display);
  font-size: 1.65rem;
  line-height: var(--tp-leading-heading);
  margin: 0;
}

.tp-mega-feature__meta {
  color: var(--tp-text-secondary);
  font-family: var(--tp-font-mono);
  font-size: var(--tp-font-data);
  letter-spacing: var(--tp-tracking-data);
  margin: 0;
  text-transform: uppercase;
}

.tp-button {
  align-items: center;
  background: var(--tp-text-primary);
  border: 1px solid var(--tp-line-strong);
  border-radius: var(--tp-radius-sm);
  color: var(--tp-text-inverse);
  display: inline-flex;
  font-family: var(--tp-font-body);
  font-size: var(--tp-font-utility);
  font-weight: 600;
  justify-content: center;
  letter-spacing: var(--tp-tracking-utility);
  min-height: var(--tp-control-min-height);
  padding: 0 var(--tp-space-4);
  text-transform: uppercase;
}

.tp-button:hover { background: #303030; }

.tp-mobile-trigger,
.tp-mobile-drawer { display: none; }

/* ---------------------------------------------------------------
   MOBILE WEB DRAWER
   --------------------------------------------------------------- */
@media (max-width: 899px) {
  .tp-market-tape__inner,
  .tp-header__inner,
  .tp-mega-panel__inner {
    padding-left: var(--tp-gutter-mobile);
    padding-right: var(--tp-gutter-mobile);
  }

  .tp-market-tape { height: 24px; }
  .tp-market-tape__item:nth-child(n + 4) { display: none; }
  .tp-market-tape__inner { gap: var(--tp-space-3); justify-content: flex-start; }

  .tp-header { min-height: var(--tp-header-mobile); }
  .tp-header__inner {
    display: flex;
    justify-content: space-between;
    min-height: var(--tp-header-mobile);
  }
  .tp-brand { font-size: 1.4rem; letter-spacing: 0.15em; }
  .tp-global-nav,
  .tp-header__actions { display: none; }

  .tp-mobile-trigger {
    align-items: center;
    display: inline-flex;
    font-family: var(--tp-font-body);
    font-size: var(--tp-font-utility);
    font-weight: 600;
    gap: var(--tp-space-2);
    letter-spacing: var(--tp-tracking-utility);
    min-height: var(--tp-control-min-height);
    padding: 0;
    text-transform: uppercase;
  }

  .tp-menu-glyph,
  .tp-menu-glyph::before,
  .tp-menu-glyph::after {
    background: currentColor;
    display: block;
    height: 1px;
    position: relative;
    width: 20px;
  }
  .tp-menu-glyph::before,
  .tp-menu-glyph::after { content: ''; left: 0; position: absolute; }
  .tp-menu-glyph::before { top: -6px; }
  .tp-menu-glyph::after { top: 6px; }

  .tp-mobile-drawer[hidden] { display: none; }
  .tp-mobile-drawer {
    background: var(--tp-surface-canvas);
    bottom: 0;
    display: block;
    left: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--tp-space-5) var(--tp-gutter-mobile) calc(var(--tp-space-8) + env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1000;
  }

  .tp-mobile-drawer__top {
    align-items: center;
    border-bottom: 1px solid var(--tp-line-strong);
    display: flex;
    justify-content: space-between;
    min-height: var(--tp-header-mobile);
  }

  .tp-mobile-drawer__brand {
    font-family: var(--tp-font-display);
    font-size: 1.35rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
  }

  .tp-drawer__close {
    align-items: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    font-family: var(--tp-font-body);
    font-size: var(--tp-font-utility);
    font-weight: 600;
    gap: var(--tp-space-2);
    letter-spacing: var(--tp-tracking-utility);
    min-height: var(--tp-control-min-height);
    padding: 0;
    text-transform: uppercase;
  }

  .tp-close-glyph { font-size: 1.75rem; font-weight: 300; line-height: 1; }
  .tp-drawer__nav { margin-top: var(--tp-space-5); }
  .tp-drawer__group { border-bottom: 1px solid var(--tp-line-default); }

  .tp-drawer__button {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-family: var(--tp-font-body);
    font-size: var(--tp-font-utility);
    font-weight: 600;
    justify-content: space-between;
    letter-spacing: var(--tp-tracking-utility);
    min-height: 58px;
    padding: 0;
    text-align: left;
    text-transform: uppercase;
    width: 100%;
  }

  .tp-drawer__chevron { font-size: 1.25rem; transition: transform var(--tp-motion-fast) var(--tp-ease); }
  .tp-drawer__button[aria-expanded='true'] { color: var(--tp-brand-gold); }
  .tp-drawer__button[aria-expanded='true'] .tp-drawer__chevron { transform: rotate(180deg); }
  .tp-drawer__panel[hidden] { display: none; }
  .tp-drawer__panel { padding: 0 0 var(--tp-space-4); }

  .tp-drawer__link {
    align-items: center;
    display: flex;
    font-family: var(--tp-font-display);
    font-size: 1.5rem;
    justify-content: space-between;
    min-height: 52px;
    padding: var(--tp-space-2) var(--tp-space-2) var(--tp-space-2) var(--tp-space-4);
  }
  .tp-drawer__link small { color: var(--tp-text-secondary); display: block; font-family: var(--tp-font-body); font-size: var(--tp-font-body-sm); line-height: 1.35; }
  .tp-drawer__feature { background: var(--tp-surface-parchment); margin: var(--tp-space-4) 0; padding: var(--tp-space-4); }
  .tp-drawer__actions { border-top: 1px solid var(--tp-line-strong); display: grid; gap: var(--tp-space-2); margin-top: var(--tp-space-5); padding-top: var(--tp-space-5); }
  .tp-drawer__actions .tp-action-link { border: 1px solid var(--tp-line-strong); justify-content: center; }
  .tp-drawer__actions .tp-action-link--membership { border: 1px solid var(--tp-line-strong); }

  body.tp-nav-is-open { overflow: hidden; }
}

/* ---------------------------------------------------------------
   CUSTOM APP — FIVE-TAB BAR
   --------------------------------------------------------------- */
.tp-app-tabbar {
  background: var(--tp-surface-paper);
  border-top: 1px solid var(--tp-line-default);
  color: var(--tp-text-secondary);
  min-height: calc(var(--tp-bottom-nav-mobile) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}

.tp-app-tabbar--fixed {
  bottom: 0;
  left: 0;
  position: fixed;
  right: 0;
  z-index: 50;
}

.tp-app-tabbar__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
  margin: 0 auto;
  max-width: 540px;
  min-height: var(--tp-bottom-nav-mobile);
  padding: 0;
}

.tp-app-tabbar__item { display: flex; }

.tp-app-tabbar__link {
  align-items: center;
  display: flex;
  flex: 1;
  flex-direction: column;
  font-family: var(--tp-font-body);
  font-size: 0.625rem;
  font-weight: 600;
  gap: 0.3rem;
  justify-content: center;
  letter-spacing: 0.1em;
  line-height: 1;
  min-height: var(--tp-bottom-nav-mobile);
  padding: var(--tp-space-1) 0;
  position: relative;
  text-align: center;
  text-transform: uppercase;
}

.tp-app-tabbar__link::before {
  background: transparent;
  content: '';
  height: 2px;
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 28px;
}

.tp-app-tabbar__link[aria-current='page'] {
  color: var(--tp-brand-gold);
}

.tp-app-tabbar__link[aria-current='page']::before { background: var(--tp-brand-gold); }
.tp-app-tabbar__icon { height: 21px; stroke: currentColor; stroke-width: 1.4; width: 21px; }

@media (min-width: 900px) {
  .tp-app-tabbar { max-width: 540px; }
  .tp-app-tabbar--fixed { left: 50%; right: auto; transform: translateX(-50%); width: min(100%, 540px); }
}

@media (prefers-reduced-motion: reduce) {
  .tp-site-header *,
  .tp-mobile-drawer *,
  .tp-app-tabbar * { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 1199px) and (min-width: 900px) {
  .tp-header__inner { grid-template-columns: 190px auto 190px; }
  .tp-menu-trigger { padding-left: var(--tp-space-3); padding-right: var(--tp-space-3); }
  .tp-action-link { padding-left: var(--tp-space-2); padding-right: var(--tp-space-2); }
  .tp-mega-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(240px, 0.8fr); }
}
