/* Rex James Stockfeed — static replacement site
   Brand palette taken from the 2018 logo style guide: black wordmark, red "REX". */

:root {
  --red: #e4032e;
  --red-dark: #b50224;
  --ink: #16181a;
  --ink-soft: #3d4347;
  --muted: #6b7378;
  --line: #e2e5e7;
  --bg: #ffffff;
  --bg-alt: #f6f7f8;
  --max: 1220px;
  --radius: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.topbar {
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  letter-spacing: .02em;
}
.topbar .wrap {
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  align-items: center; justify-content: flex-end;
  min-height: 42px; padding-top: 6px; padding-bottom: 6px;
}
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { color: #ffb3c0; }
.topbar strong { color: #fff; font-weight: 600; }

header.site { border-bottom: 1px solid var(--line); background: #fff; }
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-top: 18px; padding-bottom: 18px;
}
.logo img { display: block; width: 100%; max-width: 218px; height: auto; }

/* ---------- nav ---------- */
.navtoggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 13px; cursor: pointer;
  font-size: 15px; color: var(--ink); font-weight: 600;
}

nav.main ul { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0; padding: 0; }
nav.main li { position: relative; }
nav.main a {
  display: block; padding: 9px 11px; text-decoration: none;
  color: var(--ink); font-weight: 600; font-size: 14.5px;
  border-radius: var(--radius); white-space: nowrap;
}
nav.main a:hover, nav.main a:focus-visible { background: var(--bg-alt); color: var(--red); }
nav.main a[aria-current="page"] { color: var(--red); }
nav.main a[aria-current="page"]::after {
  content: ""; display: block; height: 2px; background: var(--red);
  margin-top: 5px; border-radius: 2px;
}

/* dropdown */
nav.main li.has-sub > ul {
  position: absolute; top: 100%; left: 0; z-index: 40;
  display: none; flex-direction: column; min-width: 210px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0,0,0,.1); padding: 6px;
}
nav.main li.has-sub:hover > ul,
nav.main li.has-sub:focus-within > ul { display: flex; }
nav.main li.has-sub > a::after { content: " \25BE"; font-size: 11px; color: var(--muted); }

/* ---------- hero ---------- */
.hero { background: var(--ink); line-height: 0; }
.hero img { width: 100%; height: clamp(170px, 26vw, 330px); object-fit: cover; display: block; }

/* ---------- page body ---------- */
main { padding: 44px 0 56px; }
.page-title {
  font-size: clamp(27px, 4vw, 38px); line-height: 1.2; color: var(--ink);
  margin: 0 0 6px; font-weight: 700; letter-spacing: -.01em;
}
.page-title + .rule { width: 62px; height: 4px; background: var(--red); border-radius: 3px; margin-bottom: 28px; }

.content h2 { font-size: 25px; color: var(--ink); margin: 34px 0 10px; font-weight: 700; line-height: 1.3; }
.content h3 { font-size: 21px; color: var(--ink); margin: 28px 0 8px; font-weight: 700; }
.content h4 {
  font-size: 15px; color: var(--red); margin: 30px 0 8px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
}
.content h5 { font-size: 17px; color: var(--ink); margin: 22px 0 6px; font-weight: 700; }

/* The recovered content nests headings inside list items in a few places.
   Inside a list they are body text, not section headings. */
.content li h2, .content li h3, .content li h4, .content li h5 {
  font-size: inherit; color: inherit; font-weight: 400;
  text-transform: none; letter-spacing: normal; margin: 0; display: inline;
}
.content p { margin: 0 0 15px; }
.content a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.content a:hover { color: var(--red-dark); }
.content ul, .content ol { margin: 0 0 16px; padding-left: 22px; }
.content li { margin-bottom: 6px; }
.content img { max-width: 100%; height: auto; border-radius: var(--radius); }
.content strong { color: var(--ink); }

.content table {
  border-collapse: collapse; width: 100% !important; height: auto !important;
  margin: 20px 0; font-size: 16px;
}
.content table td, .content table th {
  border: 1px solid var(--line); padding: 10px 12px; text-align: center;
}
.content table tr:first-child td { background: var(--bg-alt); }
.tablescroll { overflow-x: auto; }

/* PDF / document links */
.content a.doclink, .content a[href$=".pdf"] {
  display: inline-block; text-decoration: none; font-weight: 600;
  color: var(--ink); background: var(--bg-alt);
  border: 1px solid var(--line); border-left: 3px solid var(--red);
  border-radius: var(--radius); padding: 8px 14px; margin: 3px 0;
}
.content a.doclink::before, .content a[href$=".pdf"]::before { content: "\2193  "; color: var(--red); font-weight: 700; }
.content a.doclink:hover, .content a[href$=".pdf"]:hover { background: #fff; border-color: var(--red); color: var(--red); }

/* ---------- product cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin: 30px 0 10px; }
.card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; background: #fff; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.07); }
.card h3 { margin: 0 0 7px; font-size: 19px; color: var(--ink); font-weight: 700; }
.card p { margin: 0; font-size: 15.5px; color: var(--muted); line-height: 1.6; }

/* ---------- home intro ---------- */
.lede { font-size: 19px; color: var(--ink-soft); }
.pillars {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px; margin: 30px 0; padding: 0; list-style: none;
}
.pillars li {
  background: var(--bg-alt); border-left: 3px solid var(--red);
  border-radius: var(--radius); padding: 15px 17px;
  font-weight: 700; color: var(--ink); font-size: 16px; margin: 0;
}

.cta {
  display: inline-block; background: var(--red); color: #fff !important;
  text-decoration: none !important; font-weight: 700; font-size: 16px;
  padding: 13px 28px; border-radius: var(--radius); margin-top: 6px;
}
.cta:hover { background: var(--red-dark); color: #fff !important; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
.contact-grid iframe { width: 100%; height: 380px; border: 0; border-radius: var(--radius); display: block; }
.contact-list { list-style: none; margin: 0 0 22px; padding: 0; }
.contact-list li { padding: 13px 0; border-bottom: 1px solid var(--line); display: flex; gap: 14px; }
.contact-list .lbl {
  flex: 0 0 104px; font-weight: 700; color: var(--ink); font-size: 13.5px;
  text-transform: uppercase; letter-spacing: .06em; padding-top: 2px;
}
.contact-list a { color: var(--red); text-decoration: none; font-weight: 600; }
.contact-list a:hover { text-decoration: underline; }

/* ---------- footer ---------- */
.accred { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 30px 0; }
.accred .wrap { display: flex; flex-wrap: wrap; gap: 34px; align-items: center; justify-content: center; }
.accred img { height: 78px; width: auto; display: block; }

footer.site { background: var(--ink); color: #b9c0c5; padding: 40px 0 26px; font-size: 15.5px; }
footer.site .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 32px; }
footer.site h4 {
  color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .09em;
  margin: 0 0 13px; font-weight: 700;
}
footer.site a { color: #b9c0c5; text-decoration: none; }
footer.site a:hover { color: #fff; }
footer.site ul { list-style: none; margin: 0; padding: 0; }
footer.site li { margin-bottom: 7px; }
footer.site p { margin: 0 0 7px; }
.legal {
  border-top: 1px solid #2d3236; margin-top: 32px; padding-top: 18px;
  font-size: 13.5px; color: #868f95;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 1100px) {
  header.site .wrap { flex-wrap: wrap; }
  .navtoggle { display: block; }
  nav.main { flex-basis: 100%; display: none; }
  nav.main.open { display: block; }
  nav.main ul { flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 10px; }
  nav.main a { padding: 12px 10px; border-bottom: 1px solid var(--line); border-radius: 0; }
  nav.main a[aria-current="page"]::after { display: none; }
  nav.main li.has-sub > ul {
    position: static; display: flex; border: 0; box-shadow: none;
    padding: 0 0 0 16px; min-width: 0;
  }
  nav.main li.has-sub > a::after { content: ""; }
  .topbar .wrap { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .accred img { height: 58px; }
  .contact-list li { flex-direction: column; gap: 2px; }
  .contact-list .lbl { flex-basis: auto; }
}

@media print {
  .topbar, nav.main, .navtoggle, .hero, .accred { display: none; }
  body { font-size: 12pt; }
}
