/* ==========================================================================
   Text Inspector header ("Option B": navy utility bar + cream main row)
   All classes are prefixed "ti-" to avoid clashes with the rest of the theme.
   Rules for on-cream text: navy only; gold is a fill or underline, never text.
   ========================================================================== */

:root {
  --ti-navy: #2A3654;
  --ti-navy-deep: #1D2640;
  --ti-gold: #F5C43D;
  --ti-gold-hover: #E8B420;
  --ti-gold-link-hover: #FFD666;
  --ti-cream: #FFF8F1;
  --ti-surface: #F3F3F5;
  --ti-border: #73767D;
  --ti-text-on-navy: #FFFBF7;
  --ti-text-muted-on-navy: #C3C8D6;
  --ti-text-muted: #5B5E73;
  --ti-divider: rgba(42, 54, 84, 0.12);
  --ti-font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ti-container: 1280px;
}

.ti-container { max-width: var(--ti-container); margin: 0 auto; padding: 0 24px; box-sizing: border-box; }

.ti-skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 12px 16px; border-radius: 8px; background: var(--ti-gold); color: var(--ti-navy);
  font-weight: 600; text-decoration: none;
}
.ti-skip:focus { top: 8px; }

/* Shared focus styles */
.ti-header a:focus-visible,
.ti-header button:focus-visible { outline: 3px solid var(--ti-navy); outline-offset: 2px; border-radius: 4px; }
.ti-utility a:focus-visible { outline-color: var(--ti-gold); }

.ti-header { position: sticky; top: 0; z-index: 50; background: var(--ti-cream); font-family: var(--ti-font); color: var(--ti-navy); }
.ti-header ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Utility bar (navy) ---------- */
.ti-utility { background: var(--ti-navy); color: var(--ti-text-on-navy); font-size: 14px; }
.ti-utility__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.ti-news { display: flex; align-items: center; gap: 10px; margin: 0; }
.ti-tag {
  padding: 2px 8px; border-radius: 4px; background: var(--ti-gold); color: var(--ti-navy);
  font-size: 12px; font-weight: 600; text-transform: uppercase; line-height: 18px;
}
.ti-news a { color: var(--ti-gold); text-decoration: underline; text-underline-offset: 3px; }
.ti-news a:hover { color: var(--ti-gold-link-hover); }
.ti-utility__list { display: flex; align-items: center; gap: 24px; }
.ti-utility__list a {
  display: flex; align-items: center; min-height: 40px; text-decoration: none; color: var(--ti-text-muted-on-navy);
}
.ti-utility__list .ti-account > a { color: var(--ti-text-on-navy); font-weight: 500; }
.ti-utility__list a:hover { color: var(--ti-gold); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Main row (cream) ---------- */
.ti-main-row { border-bottom: 1px solid var(--ti-divider); }
.ti-main-row__inner { display: flex; align-items: center; gap: 48px; min-height: 84px; }
.ti-logo { display: flex; align-items: center; flex-shrink: 0; }
.ti-logo img { display: block; width: 256px; height: auto; }

.ti-nav { flex: 1 1 auto; }
.ti-nav__list { display: flex; align-items: center; gap: 8px; }
.ti-nav__item { position: relative; }
.ti-nav__link,
.ti-nav__toggle {
  display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  background: transparent; border: 0; color: var(--ti-navy);
  font: 500 17px/24px var(--ti-font); text-decoration: none; cursor: pointer;
}
.ti-nav__link:hover,
.ti-nav__toggle:hover,
.ti-nav__toggle[aria-expanded="true"] {
  text-decoration: underline; text-decoration-color: var(--ti-gold);
  text-decoration-thickness: 3px; text-underline-offset: 8px;
}
.ti-nav__link[aria-current="page"] {
  font-weight: 700; text-decoration: underline; text-decoration-color: var(--ti-gold);
  text-decoration-thickness: 3px; text-underline-offset: 8px;
}
.ti-chevron { transition: transform 0.15s ease; }
.ti-nav__toggle[aria-expanded="true"] .ti-chevron { transform: rotate(180deg); }

/* Dropdown panels */
.ti-menu {
  position: absolute; top: calc(100% + 12px); left: 0; z-index: 60; min-width: 320px;
  padding: 8px; box-sizing: border-box;
  background: var(--ti-surface); border: 1px solid var(--ti-border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(42, 54, 84, 0.18);
}
.ti-menu[hidden] { display: none; }
.ti-menu a {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 8px;
  color: var(--ti-navy); text-decoration: none;
}
.ti-menu a:hover { background: var(--ti-cream); }
/* Long menus (7+ items) switch to two columns; on short screens the panel scrolls. */
.ti-menu { max-height: calc(100vh - 160px); overflow-y: auto; }
.ti-menu:has(> li:nth-child(7)) {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; width: 680px;
}
.ti-menu:has(> li:nth-child(7))[hidden] { display: none; }
/* Add the CSS class "ti-menu__all" to a menu item to make it a full-width footer link. */
.ti-menu > .ti-menu__all { grid-column: 1 / -1; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--ti-divider); }
.ti-menu > .ti-menu__all .ti-menu__title { font-weight: 700; }
.ti-menu__title { font-size: 16px; font-weight: 600; }
.ti-menu__desc { font-size: 14px; color: var(--ti-text-muted); }

/* Primary CTA */
.ti-cta {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 30px; flex-shrink: 0;
  border-radius: 9999px; background: var(--ti-gold); color: var(--ti-navy);
  font-size: 16px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.ti-cta:hover { background: var(--ti-gold-hover); color: var(--ti-navy); }

/* Compact CTA and menu button (mobile only) */
.ti-cta--compact { display: none; }
.ti-burger {
  display: none; align-items: center; justify-content: center; width: 44px; height: 44px;
  margin: 0 -10px 0 0; padding: 0; background: transparent; border: 0; color: var(--ti-navy); cursor: pointer;
}

/* ---------- Full-screen mobile menu ---------- */
.ti-panel {
  position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column;
  background: var(--ti-cream); color: var(--ti-navy); font-family: var(--ti-font);
  overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: ti-panel-in 0.2s ease-out;
}
.ti-panel[hidden] { display: none; }
@keyframes ti-panel-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.ti-panel ul { margin: 0; padding: 0; list-style: none; }
.ti-panel__bar {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; padding: 0 20px; background: var(--ti-cream); border-bottom: 1px solid var(--ti-divider);
}
.ti-panel__bar img { display: block; width: 180px; height: auto; }
.ti-panel__close {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  margin-right: -10px; padding: 0; background: transparent; border: 0; color: var(--ti-navy); cursor: pointer;
}

.ti-panel__body { flex: 1 0 auto; padding: 8px 20px 24px; }
.ti-panel__list > li { border-bottom: 1px solid var(--ti-divider); }
.ti-panel__link,
.ti-panel__toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 60px; padding: 0;
  background: transparent; border: 0; color: var(--ti-navy); text-align: left;
  font: 600 20px/28px var(--ti-font); text-decoration: none; cursor: pointer;
}
.ti-panel__link[aria-current="page"] {
  text-decoration: underline; text-decoration-color: var(--ti-gold); text-decoration-thickness: 3px; text-underline-offset: 8px;
}
.ti-panel__toggle[aria-expanded="true"] .ti-chevron { transform: rotate(180deg); }
.ti-panel__sub { padding: 0 0 16px; }
.ti-panel__sub[hidden] { display: none; }
.ti-panel__sub a {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 0 10px 16px;
  border-left: 2px solid var(--ti-gold); color: var(--ti-navy); text-decoration: none;
}
.ti-panel__sub li + li a { margin-top: 4px; }
.ti-panel__sub .ti-menu__all .ti-menu__title { font-weight: 700; }

.ti-panel__secondary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; margin: 24px 0 0; }
.ti-panel__secondary a {
  display: flex; align-items: center; min-height: 44px; color: var(--ti-navy); font-size: 16px; font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--ti-gold); text-decoration-thickness: 2px; text-underline-offset: 4px;
}

.ti-panel__news {
  display: flex; align-items: center; gap: 10px; margin: 24px 0 0; padding: 14px 16px;
  border-radius: 12px; background: var(--ti-navy); color: var(--ti-text-on-navy); font-size: 15px;
}
.ti-panel__news a { color: var(--ti-gold); text-underline-offset: 3px; }

.ti-panel__footer {
  position: sticky; bottom: 0; padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--ti-cream); border-top: 1px solid var(--ti-divider);
}
.ti-panel__footer .ti-cta { display: flex; width: 100%; justify-content: center; box-sizing: border-box; }
.ti-panel__hint { margin: 8px 0 0; text-align: center; font-size: 14px; color: var(--ti-text-muted); }

body.ti-menu-open { overflow: hidden; }
.ti-panel a:focus-visible, .ti-panel button:focus-visible { outline: 3px solid var(--ti-navy); outline-offset: 2px; border-radius: 4px; }
.ti-panel__news a:focus-visible { outline-color: var(--ti-gold); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .ti-main-row__inner { gap: 24px; }
  .ti-logo img { width: 210px; }
  .ti-nav__link, .ti-nav__toggle { padding: 0 10px; font-size: 16px; }
}

@media (max-width: 1023px) {
  .ti-utility__list { display: none; }
  .ti-utility__inner { justify-content: center; min-height: 36px; }
  .ti-nav, .ti-cta--full { display: none; }
  .ti-main-row__inner { gap: 12px; min-height: 64px; }
  .ti-logo { margin-right: auto; }
  .ti-logo img { width: 180px; }
  .ti-cta--compact { display: inline-flex; height: 40px; padding: 0 18px; font-size: 15px; }
  .ti-burger { display: inline-flex; }
}

@media (max-width: 359px) {
  .ti-cta--compact { display: none; }   /* very small phones: the CTA stays inside the menu */
  .ti-logo img { width: 160px; }
}

@media (min-width: 1024px) {
  .ti-panel { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .ti-chevron { transition: none; }
  .ti-panel { animation: none; }
}
