/*
Theme Name: Titan TRT
Theme URI: https://titantrt.ca
Description: Standalone theme for Titan TRT & Personal Training. Shares the architecture of the injectionX theme — native templates, design tokens, size-specific tracking, translucent chrome, press-state feedback, full prefers-* handling — with Titan's own amber-on-slate brand and Marcellus display face.
Author: Titan TRT
Version: 1.1.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: titantrt
Tags: custom-colors, custom-menu, featured-images, translation-ready
*/

/* ===========================================================
   1. TOKENS — Titan's own palette, read off the live site
   =========================================================== */
:root {
  --tt-ground: #0f172a;
  --tt-ground-deep: #0a0f1d;
  --tt-surface: #172033;
  --tt-surface-2: #1e293b;
  --tt-ink: #f8fafc;
  --tt-ink-soft: #cbd5e1;
  --tt-ink-muted: #94a3b8;
  --tt-accent: #e98c00;
  --tt-accent-hi: #ffa92b;
  --tt-cream: #fef9e1;
  --tt-line: rgba(248, 250, 252, 0.12);
  --tt-line-strong: rgba(248, 250, 252, 0.3);

  --tt-display: Marcellus, Georgia, serif;
  --tt-body: Inter, system-ui, -apple-system, sans-serif;

  --tt-gutter: clamp(1.25rem, 4vw, 3rem);
  --tt-max: 1240px;

  /* Response values from the motion system: critically damped, 0.3–0.4s */
  --tt-press: 110ms;
  --tt-settle: 380ms;
  --tt-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===========================================================
   2. RESET + BASE
   =========================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--tt-ground);
  color: var(--tt-ink);
  font-family: var(--tt-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--tt-accent);
  text-decoration: none;
}
a:hover {
  color: var(--tt-accent-hi);
}
p {
  margin: 0 0 1rem;
  color: var(--tt-ink-soft);
}
ul,
ol {
  color: var(--tt-ink-soft);
}
strong,
b {
  color: var(--tt-ink);
  font-weight: 600;
}
::selection {
  background: var(--tt-accent);
  color: var(--tt-ground);
}
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--tt-accent);
  outline-offset: 2px;
}
.tt-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--tt-accent);
  color: var(--tt-ground);
  padding: 1rem 1.5rem;
  font-weight: 700;
}
.tt-skip:focus {
  left: 0;
}
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* ===========================================================
   3. TYPE — tracking and leading are size-specific
   Marcellus is a single-weight serif, so hierarchy comes from
   size and leading, with Inter carrying weight where needed.
   =========================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--tt-display);
  color: var(--tt-ink);
  font-weight: 400;
  margin: 0 0 0.5em;
}
h1 {
  font-size: clamp(2.5rem, 6vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
h2 {
  font-size: clamp(1.875rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}
h3 {
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h4 {
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
h5,
h6 {
  font-family: var(--tt-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0;
}

.tt-eyebrow {
  font-family: var(--tt-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tt-accent);
  margin: 0 0 1.25rem;
}
.tt-eyebrow--muted {
  color: var(--tt-ink-muted);
}
.tt-lede {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--tt-ink-soft);
  max-width: 54ch;
}

/* ===========================================================
   4. LAYOUT
   =========================================================== */
.tt-wrap {
  width: 100%;
  max-width: var(--tt-max);
  margin: 0 auto;
  padding-inline: var(--tt-gutter);
}
.tt-section {
  padding-block: clamp(3.5rem, 7vw, 6rem);
}
.tt-section__head {
  margin-bottom: 2.5rem;
  max-width: 62ch;
}
.tt-section__head h2 {
  margin: 0;
}

/* ===========================================================
   5. CHROME — translucent, content scrolls under
   =========================================================== */
.tt-chrome {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.68);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border-bottom: 1px solid transparent;
  transition: border-color 220ms ease-out;
}

/* Scroll edge, not a permanent divider: the chrome separates itself from
   content only where content actually passes beneath it. */
.tt-chrome.is-over-content {
  border-bottom-color: var(--tt-line);
}
.tt-chrome.is-over-content::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -24px;
  height: 24px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0));
}
.tt-chrome__inner {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding-block: 0.875rem;
  max-width: var(--tt-max);
  margin: 0 auto;
  padding-inline: var(--tt-gutter);
}
.tt-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--tt-display);
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--tt-ink);
}
.tt-logo:hover {
  color: var(--tt-ink);
}
.tt-logo img {
  max-height: 44px;
  width: auto;
}
.tt-nav {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tt-nav a {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tt-ink-soft);
}
.tt-nav a:hover,
.tt-nav .current-menu-item > a {
  color: var(--tt-accent);
}
.tt-chrome__spacer {
  flex: 1 1 auto;
}
.tt-burger {
  display: none;
  width: 44px;
  height: 44px;
  flex: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--tt-line-strong);
  border-radius: 999px;
  color: var(--tt-ink);
  cursor: pointer;
  padding: 0;
}
/* The global `svg { height: auto }` lets an icon collapse to 0 inside a flex
   button, so chrome icons get explicit dimensions and no shrink. */
.tt-burger svg {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ===========================================================
   6. CONTROLS — feedback on the press, 44px targets
   =========================================================== */
.tt-btn,
button,
input[type="submit"],
input[type="button"],
.wp-block-button__link,
.elementor-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--tt-body);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  background: var(--tt-accent);
  color: var(--tt-ground);
  border: none;
  border-radius: 999px;
  padding: 1rem 1.875rem;
  min-height: 44px;
  line-height: 1.1;
  cursor: pointer;
  transition:
    transform var(--tt-press) ease-out,
    background-color var(--tt-press) ease-out;
}
.tt-btn:hover,
button:hover,
.wp-block-button__link:hover,
.elementor-button:hover {
  background: var(--tt-accent-hi);
  color: var(--tt-ground);
}
.tt-btn:active,
button:active,
input[type="submit"]:active,
.wp-block-button__link:active,
.elementor-button:active {
  transform: scale(0.97);
}
.tt-btn--ghost {
  background: transparent;
  color: var(--tt-ink);
  border: 1px solid var(--tt-line-strong);
}
.tt-btn--ghost:hover {
  background: transparent;
  color: var(--tt-accent);
  border-color: var(--tt-accent);
}
.tt-btn--call {
  font-variant-numeric: tabular-nums;
}
button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===========================================================
   7. FORMS
   =========================================================== */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="search"],
textarea,
select {
  width: 100%;
  background: var(--tt-surface);
  border: 1px solid var(--tt-line);
  color: var(--tt-ink);
  border-radius: 10px;
  padding: 0.8125rem 1rem;
  min-height: 44px;
  font-family: var(--tt-body);
  font-size: 1rem;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--tt-accent);
}
::placeholder {
  color: var(--tt-ink-muted);
  opacity: 1;
}
label {
  color: var(--tt-ink-soft);
  font-size: 0.875rem;
  display: inline-block;
  margin-bottom: 0.375rem;
}

/* ===========================================================
   8. HOME
   =========================================================== */
.tt-hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  padding-block: clamp(4rem, 10vw, 8rem) clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}
.tt-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.tt-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Scrim carries legibility without flattening the photograph. */
.tt-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to top, rgba(15, 23, 42, 0.97) 12%, rgba(15, 23, 42, 0.55) 55%, rgba(15, 23, 42, 0.35) 100%),
    linear-gradient(to right, rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.1));
}
.tt-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
}
.tt-hero h1 {
  max-width: 16ch;
}
.tt-hero__claim {
  font-family: var(--tt-body);
  font-size: clamp(0.875rem, 1.6vw, 1.0625rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tt-accent);
  max-width: 44ch;
  line-height: 1.6;
  margin: 1.5rem 0 0;
}
.tt-hero__actions {
  display: flex;
  gap: 0.875rem;
  margin-top: 2.25rem;
  flex-wrap: wrap;
}

.tt-stance {
  background: var(--tt-surface);
  border-top: 1px solid var(--tt-line);
  border-bottom: 1px solid var(--tt-line);
}
.tt-stance__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
  align-items: start;
}
.tt-stance p {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.tt-services {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.tt-service {
  background: var(--tt-surface);
  border: 1px solid var(--tt-line);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition:
    border-color var(--tt-settle) var(--tt-ease),
    transform var(--tt-press) ease-out;
}
.tt-service:hover {
  border-color: rgba(233, 140, 0, 0.55);
}
.tt-service:active {
  transform: scale(0.99);
}
.tt-service__n {
  font-family: var(--tt-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--tt-accent);
  margin-bottom: 1.25rem;
}
.tt-service h3 {
  margin: 0 0 0.75rem;
}
.tt-service p {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.7;
}
.tt-service__price {
  margin-top: auto;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tt-ink-muted);
}

.tt-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}
.tt-panel__item {
  border: 1px solid var(--tt-line);
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tt-ink-soft);
}

/* The one warm surface: cream, where the brand speaks plainly. */
.tt-band {
  background: var(--tt-cream);
  color: var(--tt-ground);
}
.tt-band h2,
.tt-band h3 {
  color: var(--tt-ground);
}
.tt-band p {
  color: #3b3524;
  font-size: 1.0625rem;
}
.tt-band .tt-eyebrow {
  color: #8a5a00;
}
.tt-band .tt-btn {
  background: var(--tt-ground);
  color: var(--tt-cream);
}
.tt-band .tt-btn:hover {
  background: #1e293b;
  color: var(--tt-cream);
}
.tt-nos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}
.tt-nos li {
  font-family: var(--tt-display);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  letter-spacing: -0.02em;
  color: var(--tt-ground);
}

/* ===========================================================
   9. CONTENT PAGES + BLOG
   =========================================================== */
.tt-page {
  padding-block: clamp(2.5rem, 5vw, 4rem) clamp(3.5rem, 7vw, 5.5rem);
}
.tt-page__title {
  margin: 0 0 2.5rem;
}
.tt-prose {
  max-width: 68ch;
}
.tt-prose h2,
.tt-prose h3 {
  margin-top: 2.5rem;
}
.tt-prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tt-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.tt-post {
  background: var(--tt-surface);
  border: 1px solid var(--tt-line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--tt-settle) var(--tt-ease);
}
.tt-post:hover {
  border-color: rgba(233, 140, 0, 0.55);
}
.tt-post__media {
  aspect-ratio: 16 / 9;
  background: var(--tt-surface-2);
}
.tt-post__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tt-post__body {
  padding: 1.5rem;
}
.tt-post__body h2 {
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0 0 0.625rem;
}
.tt-pagination {
  display: flex;
  gap: 0.5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.tt-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.75rem;
  border: 1px solid var(--tt-line);
  border-radius: 999px;
  color: var(--tt-ink-soft);
  font-weight: 600;
}
.tt-pagination .page-numbers.current,
.tt-pagination .page-numbers:hover {
  background: var(--tt-accent);
  color: var(--tt-ground);
  border-color: var(--tt-accent);
}

/* ===========================================================
   10. ELEMENTOR SAFETY
   Elementor's own explicit colours still win on specificity; this
   only catches text that relied on the old light theme.
   =========================================================== */
.elementor-widget-text-editor,
.elementor-widget-text-editor p {
  color: var(--tt-ink-soft);
}
.elementor-widget-heading .elementor-heading-title,
.elementor-icon-box-title,
.elementor-icon-box-title a,
.elementor-image-box-title,
.elementor-image-box-title a {
  color: var(--tt-ink) !important;
}
.elementor-icon-box-description,
.elementor-image-box-description {
  color: var(--tt-ink-soft) !important;
}
.elementor-icon-box-title a:hover,
.elementor-image-box-title a:hover {
  color: var(--tt-accent) !important;
}

/*
 * Elementor's nested tabs ship a mid-grey (#7A7A7A) with white text — 4.29:1,
 * under the AA floor. Verified on the Services page.
 */
.e-n-tabs .e-n-tab-title {
  background-color: var(--tt-surface-2) !important;
  color: var(--tt-ink) !important;
  border: 1px solid var(--tt-line) !important;
  border-radius: 999px !important;
}
.e-n-tabs .e-n-tab-title[aria-selected="true"] {
  background-color: var(--tt-accent) !important;
  color: var(--tt-ground) !important;
  border-color: var(--tt-accent) !important;
}
.e-n-tabs .e-n-tab-title-text {
  color: inherit !important;
}

/* ===========================================================
   11. FOOTER
   =========================================================== */
.tt-footer {
  border-top: 1px solid var(--tt-line);
  background: var(--tt-ground-deep);
  padding-block: clamp(3rem, 5vw, 4.5rem) 3rem;
}
.tt-footer__cols {
  display: flex;
  gap: clamp(2rem, 4vw, 3.5rem);
  flex-wrap: wrap;
}
.tt-footer__brand {
  flex: 1 1 320px;
}
.tt-footer__col {
  flex: 0 1 180px;
}
.tt-footer__h {
  margin: 0 0 1rem;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tt-ink-muted);
  font-weight: 700;
}
.tt-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tt-footer__col li {
  margin-bottom: 0.625rem;
}
.tt-footer__col a {
  color: var(--tt-ink-soft);
  font-size: 0.9375rem;
}
.tt-footer__col a:hover {
  color: var(--tt-accent);
}
.tt-footer__legal {
  margin: 3rem 0 0;
  font-size: 0.8125rem;
  color: var(--tt-ink-muted);
  max-width: 70ch;
}

/* ===========================================================
   12. SMALL SCREENS
   =========================================================== */
@media (max-width: 880px) {
  .tt-burger {
    display: inline-flex;
  }
  /* A sheet, not a dropdown: it is dragged, so it needs its own layer, the
     pointer events to itself, and a visible place to grab. */
  .tt-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(15, 23, 42, 0.94);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    border-bottom: 1px solid var(--tt-line);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    padding: 1.5rem var(--tt-gutter) 1.25rem;
    touch-action: none;
    cursor: grab;
  }
  .tt-nav.is-open {
    display: flex;
  }
  .tt-nav:active {
    cursor: grabbing;
  }

  /* Grab handle — says "this is draggable" without a label. */
  .tt-nav::before {
    content: "";
    position: absolute;
    top: 0.5rem;
    left: 50%;
    width: 42px;
    height: 4px;
    margin-left: -21px;
    border-radius: 2px;
    background: var(--tt-line-strong);
  }
  .tt-nav li {
    border-bottom: 1px solid var(--tt-line);
  }
  .tt-nav a {
    display: block;
    padding: 0.875rem 0;
    min-height: 44px;
  }
  .tt-chrome {
    position: relative;
  }
  .tt-hero {
    min-height: 68vh;
  }
}

/* ===========================================================
   13. PREFERENCES
   =========================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .tt-btn:active,
  button:active,
  .tt-service:active,
  .elementor-button:active {
    transform: none !important;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .tt-chrome {
    background: var(--tt-ground);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (prefers-contrast: more) {
  :root {
    --tt-line: #f8fafc;
    --tt-line-strong: #f8fafc;
    --tt-ink-muted: #e2e8f0;
    --tt-ink-soft: #f8fafc;
  }
  .tt-chrome {
    background: #000;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
