/* ==========================================================================
   TRI HoldCo, Inc. — shared site styles
   Brand palette: teal #00566A, green #A2C570, orange #F8991D, blue #004187
   ========================================================================== */

:root {
  --teal: #00566a;
  --teal-dark: #003c4a;
  --green: #a2c570;
  --orange: #f8991d;
  --blue: #004187;
  --blue-light: #80a0d3;
  --ink: #1a2b30;
  --muted: #5a6b70;
  --bg: #ffffff;
  --bg-alt: #f4f7f4;
  --border: #e2e8e6;
  --maxw: 1100px;
  --radius: 10px;
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Respect users who prefer reduced motion (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 300;
  color: var(--teal);
  background: var(--bg);
  line-height: 1.6;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Links use the primary teal (8.27:1 on white) and are underlined so they
   are not distinguished by color alone (WCAG 1.4.1). */
a {
  color: var(--teal);
  text-decoration: underline;
}

a:hover,
a:focus {
  color: var(--teal-dark);
  text-decoration: underline;
}

h1,
h2,
h3 {
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

/* Accessible focus outline for keyboard users */
/* Focus ring uses secondary brand dark blue (9.97:1 on white). */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Skip link for screen readers / keyboard nav */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--teal);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 1000;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 4rem 0;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
}

.logo img {
  width: 140px;
  height: auto;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2rem;
}

.main-nav a {
  color: var(--teal);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 0.5rem 0;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a:focus {
  color: var(--teal-dark);
  text-decoration: underline;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--teal);
}
.nav-toggle svg {
  width: 28px;
  height: 28px;
}

/* ---------- Hero ---------- */
/* Green + white type on the teal brand color, mirroring the logo.
   Green on teal = 4.24:1 (passes WCAG AA for large text). */
.hero {
  background: var(--teal);
  padding: 5rem 0;
}

.hero h1 {
  color: var(--green);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  max-width: none;
}

.hero h1 .accent {
  color: #ffffff;
  font-weight: 600;
}

/* ---------- Content sections ---------- */
.section-alt {
  background: var(--bg-alt);
}

/* About section with office background photo */
.section-about {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.4) 45%, rgba(255, 255, 255, 0) 70%),
    url("../images/officebackground.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  min-height: 340px;
  display: flex;
  align-items: center;
}

.section-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.section-grid h2 {
  color: var(--teal);
  font-size: 2rem;
  font-weight: 500;
}

.section-grid .lead {
  color: var(--teal);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 300;
  margin: 0 0 1rem;
}

.lead a {
  color: var(--teal);
  font-weight: 600;
}

/* ---------- Legal / long-form pages ---------- */
.page-body {
  padding: 3.5rem 0;
}

.page-body h1 {
  color: var(--teal);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
}

.page-body h2 {
  color: var(--teal);
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 2.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.page-body p {
  margin: 0 0 1.1rem;
}

.page-body ol,
.page-body ul {
  margin: 0 0 1.4rem;
  padding-left: 1.4rem;
}

.page-body li {
  margin-bottom: 0.6rem;
}

.page-body .updated {
  color: var(--muted);
  font-style: italic;
}

.back-to-top {
  display: inline-block;
  margin-top: 1.5rem;
  font-weight: 500;
}

/* ---------- Careers ---------- */
.benefit {
  margin-bottom: 1.75rem;
}
.benefit h3 {
  color: var(--blue);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.benefit p {
  margin: 0;
}

.job-listings {
  margin-top: 2rem;
}

.job-opening {
  display: block;
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  background: var(--bg-alt);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-left-color 0.15s ease;
}

.job-opening:hover,
.job-opening:focus {
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 60, 74, 0.15);
  border-left-color: var(--orange);
  transform: translateY(-2px);
}

.job-opening h3 {
  color: var(--teal);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.job-opening .job-meta {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0;
}

.no-openings {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--teal-dark);
  color: #dfe8ea;
  padding: 2rem 0;
  font-size: 0.95rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.site-footer a {
  color: #fff;
}
.site-footer a:hover,
.site-footer a:focus {
  color: var(--green);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  justify-content: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: none;
  }

  .main-nav.open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
  }

  .main-nav a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .section-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Tighter vertical rhythm on small screens */
  section {
    padding: 2.5rem 0;
  }

  .hero {
    padding: 3rem 0;
  }

  .page-body {
    padding: 2rem 0;
  }

  /* On mobile the About text spans full width, so the readability
     overlay must cover the whole width, not just the left column. */
  .section-about {
    background-image:
      linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)),
      url("../images/officebackground.jpg");
    min-height: 0;
  }

  /* Prevent any long unbroken strings (URLs, emails) from forcing
     horizontal scroll on narrow screens. */
  body {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  /* Larger, easier-to-tap footer links on mobile.
     Stack them and drop the "|" separators for clear tap targets. */
  .site-footer nav {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .site-footer nav > span {
    display: none; /* hide the "|" separators */
  }

  .site-footer nav a {
    display: block;
    padding: 0.85rem 1rem;
    min-height: 44px;
  }
}
