/*
 * Tremhost site layer v4 — header, mega menu, footer, mobile action bar and shared components.
 * Loads after tremhost-brand.css (which defines the --th-* tokens and the two typefaces).
 * Everything is namespaced .ths-* so it cannot collide with html15, ITzen or Elementor rules.
 *
 * Rules carried from the brand layer:
 *  - coral #ff6f6f is a fill with navy text (white on coral fails contrast); one coral action per screen
 *  - on white, coloured text uses coral-ink #b8343a
 */

:root {
  --ths-wrap: 1240px;
  --ths-gutter: clamp(16px, 4vw, 32px);
  --ths-header-h: 68px;
  --ths-radius-s: 6px;
  --ths-radius-m: 10px;
  --ths-radius-l: 18px;
  --ths-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
  --ths-shadow-panel: 0 18px 40px -18px rgba(11, 21, 38, .35), 0 2px 6px rgba(11, 21, 38, .06);
  --ths-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- scoped reset ---------- */
.ths, .ths * , .ths *::before, .ths *::after { box-sizing: border-box; }
.ths ul, .ths ol { list-style: none; margin: 0; padding: 0; }
.ths p { margin: 0; }
.ths a { text-decoration: none; color: inherit; }
:where(.ths) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.ths img { max-width: 100%; height: auto; display: block; }
.ths address { font-style: normal; }
.ths-ico { flex: none; display: inline-block; vertical-align: middle; }
.ths-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ths-wrap { width: 100%; max-width: var(--ths-wrap); margin: 0 auto; padding: 0 var(--ths-gutter); }
#ths-content { display: block; height: 0; outline: none; }

.ths-skip {
  position: absolute; left: 12px; top: -60px; z-index: 10001;
  background: var(--th-navy); color: #fff !important; padding: 10px 16px; border-radius: var(--ths-radius-s);
  font: 600 15px/1 var(--th-font-body); text-decoration: none;
}
.ths-skip:focus { top: 12px; }

.ths :focus-visible, .ths-skip:focus-visible {
  outline: 2px solid var(--th-coral-ink); outline-offset: 2px; border-radius: 4px;
}

/* ---------- buttons (shared by header, homepage and pages) ---------- */
.ths-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--ths-radius-s);
  font: 600 15px/1.1 var(--th-font-body); letter-spacing: 0; white-space: nowrap;
  border: 1.5px solid transparent; text-decoration: none !important; cursor: pointer;
  transition: background-color .15s var(--ths-ease), border-color .15s var(--ths-ease), color .15s var(--ths-ease);
}
.ths-btn--primary { background: var(--th-coral); color: var(--th-navy) !important; }
.ths-btn--primary:hover { background: var(--th-coral-hover); }
.ths-btn--navy { background: var(--th-navy); color: #fff !important; }
.ths-btn--navy:hover { background: #1d3355; }
.ths-btn--outline { border-color: var(--th-navy); color: var(--th-navy) !important; background: transparent; }
.ths-btn--outline:hover { background: var(--th-navy); color: #fff !important; }
.ths-btn--on-navy { border-color: rgba(255,255,255,.55); color: #fff !important; background: transparent; }
.ths-btn--on-navy:hover { background: #fff; color: var(--th-navy) !important; border-color: #fff; }

/* ---------- utility bar ---------- */
.ths-utility { background: var(--th-deep); color: var(--th-on-navy); font: 500 13px/1 var(--th-font-body); }
.ths-utility__in { display: flex; align-items: center; justify-content: space-between; min-height: 36px; gap: 16px; }
.ths-utility__links { display: flex; gap: 22px; align-items: center; }
.ths-utility a { color: var(--th-on-navy) !important; }
.ths-utility a:hover { color: #fff !important; }
.ths-utility__wa { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 1079px) { .ths.ths-utility { display: none; } } /* .ths.: beats the theme's .th-h15:not(body){display:block} */

/* ---------- header ---------- */
.ths-header {
  position: sticky; top: 0; z-index: 1000; background: #fff;
  border-bottom: 1px solid var(--th-line);
  font-family: var(--th-font-body); color: var(--th-navy);
}
.admin-bar .ths-header { top: 32px; }
.ths-header__in { display: flex; align-items: center; gap: 28px; min-height: var(--ths-header-h); }
.ths-logo { display: inline-flex; align-items: center; flex: none; }
.ths-logo img { width: 128px; height: auto; }
.ths-header__actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.ths-burger, .ths-close { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: var(--ths-radius-s); color: var(--th-navy); }
.ths-nav__top, .ths-nav__utility { display: none; }

.ths-menu { display: flex; align-items: stretch; gap: 2px; }
.ths-menu__btn {
  display: inline-flex; align-items: center; gap: 6px; height: var(--ths-header-h); padding: 0 12px;
  font: 600 15px/1 var(--th-font-body); color: var(--th-navy); position: relative; white-space: nowrap;
}
/* Small desktops: six tabs (licence pages) or five must still fit on one row. */
@media (min-width: 1080px) and (max-width: 1279px) {
  .ths-menu__btn { padding: 0 8px; gap: 4px; font-size: 14px; }
  .ths-menu__btn::after { left: 8px; right: 8px; }
  .ths-header__in { gap: 16px; }
}
.ths-menu__btn .ths-ico { transition: transform .15s var(--ths-ease); opacity: .6; }
.ths-menu__btn::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--th-coral);
  transform: scaleX(0); transform-origin: left; transition: transform .18s var(--ths-ease);
}
.ths-menu__btn:hover::after, .ths-menu__btn[aria-expanded="true"]::after { transform: scaleX(1); }
.ths-menu__btn[aria-expanded="true"] .ths-ico { transform: rotate(180deg); }

/* mega panel (desktop) */
.ths-panel {
  position: absolute; left: 0; right: 0; top: 100%;
  background: #fff; border-top: 1px solid var(--th-line); box-shadow: var(--ths-shadow-panel);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .14s var(--ths-ease), transform .14s var(--ths-ease), visibility 0s linear .14s;
}
.ths-menu__btn[aria-expanded="true"] + .ths-panel {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
.ths-panel__in {
  max-width: var(--ths-wrap); margin: 0 auto; padding: 28px var(--ths-gutter) 32px;
  display: grid; grid-template-columns: 1fr 1fr 300px; grid-template-rows: auto 1fr; column-gap: 40px; row-gap: 18px;
}
.ths-panel__intro { grid-column: 1 / 3; color: var(--th-muted); font-size: 15px; line-height: 1.5; max-width: 60ch; }
.ths-panel__cols { grid-column: 1 / 3; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.ths-panel__cols--3 { grid-template-columns: repeat(3, 1fr); gap: 28px; }
.ths-panel__h { font: 600 13px/1.2 var(--th-font-body); color: var(--th-muted); margin-bottom: 10px !important; letter-spacing: .01em; }
.ths-panel__h--blank { visibility: hidden; }
.ths-link { display: block; padding: 9px 10px; margin: 0 -10px; border-radius: var(--ths-radius-s); }
.ths-link:hover { background: var(--th-soft); }
.ths-link__t { display: block; font: 600 15px/1.3 var(--th-font-body); color: var(--th-navy); }
.ths-link__d { display: block; font: 400 13.5px/1.45 var(--th-font-body); color: var(--th-muted); margin-top: 2px; }
.ths-aside {
  grid-column: 3; grid-row: 1 / 3; align-self: start;
  background: var(--th-navy); color: #fff; border-radius: var(--ths-radius-m); padding: 22px;
  position: relative; overflow: hidden;
}
.ths-aside__h { font: 600 18px/1.25 var(--th-font-display); margin-bottom: 8px !important; position: relative; }
.ths-aside__p { font-size: 14px; line-height: 1.5; color: var(--th-on-navy); margin-bottom: 16px !important; position: relative; }
.ths-aside__a {
  position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: var(--ths-radius-s);
  border: 1.5px solid rgba(255,255,255,.55); color: #fff !important; font: 600 14px/1 var(--th-font-body);
}
.ths-aside__a:hover { background: #fff; color: var(--th-navy) !important; }
.ths-aside--alert { background: #2a1620; }
.ths-aside--alert .ths-aside__a { background: var(--th-coral); color: var(--th-navy) !important; border-color: var(--th-coral); }
.ths-aside--alert .ths-aside__a:hover { background: var(--th-coral-hover); }

/* ---------- header: tablet and phone ---------- */
@media (max-width: 1079px) {
  .ths-header__in { gap: 12px; min-height: 60px; }
  .ths-burger { display: inline-flex; order: 3; }
  .ths-header__actions { order: 2; }
  .ths-header__actions .ths-btn { min-height: 40px; padding: 0 14px; font-size: 14px; }
  .ths-nav {
    position: fixed; inset: 0; z-index: 1002; background: #fff; overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateX(100%); visibility: hidden;
    transition: transform .22s var(--ths-ease), visibility 0s linear .22s;
    padding-bottom: 32px;
  }
  .ths-nav[data-open="true"] { transform: none; visibility: visible; transition-delay: 0s; }
  .ths-nav__top { display: flex; align-items: center; justify-content: space-between; padding: 8px var(--ths-gutter); border-bottom: 1px solid var(--th-line); min-height: 60px; }
  .ths-close { display: inline-flex; }
  .ths .ths-menu { flex-direction: column; padding: 8px var(--ths-gutter); }
  .ths-menu__item { border-bottom: 1px solid var(--th-line); }
  .ths-menu__btn { width: 100%; justify-content: space-between; height: 56px; padding: 0; font-size: 17px; }
  .ths-menu__btn::after { display: none; }
  .ths-panel { position: static; box-shadow: none; border: 0; opacity: 1; visibility: visible; transform: none; display: none; transition: none; }
  .ths-menu__btn[aria-expanded="true"] + .ths-panel { display: block; }
  .ths-panel__in { display: block; padding: 0 0 18px; }
  .ths-panel__intro { display: none; }
  .ths-panel__cols { display: block; }
  .ths-panel__col + .ths-panel__col { margin-top: 12px; }
  .ths-panel__h--blank { display: none; }
  .ths-aside { margin-top: 14px; }
  .ths .ths-nav__utility { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 18px var(--ths-gutter) 0; }
  .ths-nav__utility a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--th-line); border-radius: var(--ths-radius-s); font: 600 14px/1.2 var(--th-font-body); color: var(--th-navy) !important; }
  .ths-nav__utility li:last-child { grid-column: 1 / -1; }
  html.ths-lock, html.ths-lock body { overflow: hidden; }
}
@media (max-width: 420px) {
  .ths-logo img { width: 112px; }
}

/* ---------- footer ---------- */
.ths-footer { background: var(--th-deep); color: var(--th-on-navy); font: 400 14.5px/1.55 var(--th-font-body); padding: 64px 0 28px; }
.ths-footer a { color: var(--th-on-navy) !important; }
.ths-footer a:hover { color: #fff !important; text-decoration: underline !important; text-underline-offset: 3px; }
.ths-footer__top { display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 56px; }
.ths-footer__brand img { width: 150px; height: auto; margin-bottom: 18px; }
.ths-footer__logo { filter: brightness(0) invert(1); }
.ths-footer__brand p, .ths-footer__brand address { margin-bottom: 12px !important; max-width: 34ch; }
.ths-footer__contact a { color: #fff !important; font-weight: 600; }
.ths-footer__cols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 28px; }
.ths-footer__h { font: 600 14px/1.2 var(--th-font-body); color: #fff; margin-bottom: 14px !important; }
.ths-footer__col li { margin-bottom: 9px; }
.ths-footer__more { margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); }
.ths-footer__more ul { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; }
.ths-footer__more + .ths-footer__more { margin-top: 24px; } /* licence pages: two rows stacked */
.ths-footer__pay { margin-top: 28px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.12); }
.ths-footer__pay ul { display: flex; flex-wrap: wrap; gap: 10px; }
.ths-footer__pay li { background: #fff; border-radius: var(--ths-radius-s); padding: 6px 10px; display: flex; align-items: center; height: 40px; }
.ths-footer__pay img { width: auto; max-height: 26px; max-width: 64px; }
.ths-footer__bottom { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; font-size: 13.5px; }
.ths-footer__legal, .ths-footer__social { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.ths .ths-footer__social { margin-left: auto; }
@media (max-width: 1079px) {
  .ths-footer__top { grid-template-columns: 1fr; gap: 36px; }
  .ths-footer__cols { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .ths-footer { padding-top: 48px; }
  .ths-footer__cols { grid-template-columns: 1fr 1fr; gap: 24px 20px; }
  .ths .ths-footer__social { margin-left: 0; }
}

/* ---------- mobile action bar (static pages; WordPress uses the growth plugin's .thg-bar) ---------- */
.ths.ths-mbar { display: none; }
@media (max-width: 767px) {
  .ths.ths-mbar {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 990;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97);
    border-top: 1px solid var(--th-line); box-shadow: 0 -6px 18px -12px rgba(11,21,38,.4);
  }
  .ths-mbar__btn {
    display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; border-radius: var(--ths-radius-s);
    font: 600 14px/1 var(--th-font-body); color: var(--th-navy) !important; background: var(--th-soft); text-decoration: none !important;
  }
  .ths-mbar__btn--primary { background: var(--th-coral); }
  .ths-mbar__btn--wa { background: #e7f6ec; color: #0f5132 !important; }
  body.ths-has-mbar { padding-bottom: 72px; }
}

/* ---------- pending content (only rendered when TREMHOST_SHOW_PENDING is on) ---------- */
.th-pending {
  outline: 2px dashed #c47f00; outline-offset: 4px; background: repeating-linear-gradient(-45deg, rgba(255,182,72,.08) 0 10px, transparent 10px 20px);
  position: relative;
}
.th-pending::before {
  content: attr(data-pending); display: block; font: 600 12px/1.3 var(--ths-mono); color: #8a5a00;
  background: #fff4dc; padding: 4px 8px; margin-bottom: 8px; border-radius: 4px;
}

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

/* ---------- fixes for content that overflowed phones before the rebuild (static pages) ---------- */
@media (max-width: 767px) {
  .text-xl-end > iframe { max-width: 100%; }      /* aff, affiliate: 560px video embed */
  img.logo-images { max-width: 100%; height: auto; } /* ssl: 880px brand strip */
  .gg-wrapper img.position-absolute.three.four { display: none; } /* kubernetes: decorative shape (alt="") placed past the edge */
}
