/*
 * Trust Northwest Law Firm
 * Tailwind is loaded from the Play CDN and handles layout, spacing and colour.
 * This file carries only what the CDN cannot express as utility classes:
 * the preloader, reveal transitions, focus treatment, accordion behaviour and
 * the typographic rhythm of long form legal text.
 */

:root {
  --brand-700: #7a1420;
  --brand-600: #96202d;
  --brand-500: #b32b3a;
  --ink-900: #0b0b0c;
  --ink-800: #141416;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

/* Nothing on the page may push the viewport sideways. */
img,
svg,
video {
  max-width: 100%;
}

img,
video {
  height: auto;
}

/* ---------------------------------------------------------------- Focus -- */

.focus-ring:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink-900);
  color: #fff;
  padding: 0.9rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ------------------------------------------------------------ Preloader -- */

.site-loader {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-900);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.site-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-loader__inner {
  text-align: center;
  padding: 0 1.5rem;
}

.site-loader__mark {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  display: block;
}

.site-loader__name {
  margin-top: 1.5rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #f5f5f4;
}

.site-loader__tag {
  margin-top: 0.4rem;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7c7c86;
}

.site-loader__bar {
  position: relative;
  width: 190px;
  height: 2px;
  margin: 2rem auto 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.site-loader__bar span {
  position: absolute;
  inset: 0;
  display: block;
  background: var(--brand-500);
  transform: translateX(-100%);
  animation: loader-sweep 1.15s ease-in-out infinite;
}

@keyframes loader-sweep {
  0% {
    transform: translateX(-100%);
  }
  60% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ----------------------------------------------------------- Navigation -- */

/* Thin rule that grows under the active and hovered top level links. */
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--brand-700);
  transition: width 0.25s ease;
}

.nav-link:hover::after,
.nav-link.is-active::after {
  width: 100%;
}

#nav-bar.is-stuck {
  box-shadow: 0 10px 30px -12px rgba(11, 11, 12, 0.28);
}

/* ---------------------------------------------------------- Video hero -- */

/*
 * The fallback image sits beneath the video. When main.js cannot play the
 * source it marks the wrapper, which hides the video and leaves the image.
 */
.hero-media video {
  transition: opacity 0.6s ease;
}

.hero-media.video-failed video {
  opacity: 0;
  visibility: hidden;
}

/* ------------------------------------------------------------ Accordion -- */

.faq-panel[hidden] {
  display: none;
}

.faq-item.is-open .faq-icon {
  transform: rotate(45deg);
}

.faq-panel:not([hidden]) {
  animation: faq-open 0.32s ease;
}

@keyframes faq-open {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -------------------------------------------------------- Scroll reveal -- */

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------- Long form legal text -- */

/*
 * Applied to sections of continuous prose. Wider line height and a measured
 * column keep dense statutory explanation readable.
 */
.legal-copy {
  max-width: 68ch;
}

.legal-copy p {
  margin-top: 1.35em;
  line-height: 1.9;
  color: #4b5563;
}

.legal-copy p:first-child {
  margin-top: 0;
}

.legal-copy h3 {
  margin-top: 2.4em;
  margin-bottom: 0.6em;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink-900);
}

.legal-copy ul {
  margin-top: 1.3em;
  padding-left: 0;
  list-style: none;
}

.legal-copy ul li {
  position: relative;
  padding-left: 1.6rem;
  margin-top: 0.7em;
  line-height: 1.8;
  color: #4b5563;
}

.legal-copy ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 7px;
  background: var(--brand-700);
}

.legal-copy strong {
  color: var(--ink-900);
  font-weight: 600;
}

/* An opening paragraph set larger than the body that follows it. */
.lede {
  font-size: 1.16rem;
  line-height: 1.75;
  color: #374151;
}

/* -------------------------------------------------------------- Details -- */

/* Decorative rule used above section headings. */
.eyebrow-rule::before {
  content: '';
  display: block;
  width: 44px;
  height: 3px;
  margin-bottom: 1.1rem;
  background: var(--brand-700);
}

#back-to-top.is-visible {
  display: flex;
}

/* Form validation state applied by main.js. */
.field-error {
  border-color: var(--brand-600) !important;
}

/* Wide content must scroll inside its own container, never the page. */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ------------------------------------------------------- Motion opt out -- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* -------------------------------------------------------------- Printing -- */

@media print {
  #site-header,
  #mobile-drawer,
  #back-to-top,
  .site-loader,
  footer {
    display: none !important;
  }

  body {
    color: #000;
  }
}
