/* Shelby Railroad Service, Inc. — site styles */

:root {
  --navy: #0a1d61;
  --navy-dark: #061243;
  --olive: #5b6600;       /* Wix link hover colour */
  --olive-dark: #171a00;  /* Wix button hover colour */
  --ease-wix: cubic-bezier(.65, 0, .35, 1); /* Wix "cubicInOut" */
  --ink: #111;
  --muted: #555;
  --line: #e3e3e3;
  --bg-soft: #f4f4f2;
  --white: #fff;
  --radius: 10px;
  --max: 1200px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Azeret Mono", ui-monospace, Consolas, monospace;
  --script: "Marck Script", cursive;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--navy); }

h1, h2, h3 { font-weight: 400; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1em; }

.container { width: min(100% - 48px, var(--max)); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy); color: var(--white); padding: 8px 14px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  background: var(--navy); color: var(--white);
  font-family: var(--mono); font-size: .9rem; font-weight: 700;
  letter-spacing: .02em;
  padding: .8em 1.4em; border: 0; border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
  transition: background .3s ease-in-out, color .3s ease-in-out, transform .3s ease-in-out, box-shadow .3s ease-in-out;
}
.btn::after {
  content: "\2192"; display: inline-block; width: 0; opacity: 0; overflow: hidden;
  transform: translateX(-6px);
  transition: width .3s ease-in-out, opacity .3s ease-in-out, transform .3s ease-in-out;
}
.btn:hover, .btn:focus-visible { background: var(--olive-dark); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.btn:hover::after, .btn:focus-visible::after { width: 1em; opacity: 1; transform: none; }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn[href^="tel:"]::after, button.btn::after { content: none; }
.btn-light { background: var(--white); color: var(--navy); }
.btn-light:hover, .btn-light:focus-visible { background: var(--olive-dark); color: var(--white); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 72px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font-size: 1.2rem;
}
.brand img { width: 52px; height: auto; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; }
.main-nav a {
  color: var(--ink); text-decoration: none; font-size: .98rem;
  position: relative; padding: 4px 0; transition: color .2s ease-in-out;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .35s var(--ease-wix);
}
.main-nav a:hover { color: var(--olive); }
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none; background: none; border: 0; padding: 8px; cursor: pointer;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: .2s; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; top: 72px; right: 0; bottom: 0; width: min(320px, 85vw);
    background: var(--white); border-left: 1px solid var(--line);
    box-shadow: -12px 0 30px rgba(0,0,0,.12);
    transform: translateX(100%); visibility: hidden;
    transition: transform .5s var(--ease-wix), visibility 0s linear .5s;
  }
  .main-nav.open { transform: none; visibility: visible; transition: transform .5s var(--ease-wix), visibility 0s; }
  .main-nav li { opacity: 0; transform: translateX(24px); transition: opacity .4s ease, transform .4s var(--ease-wix); }
  .main-nav.open li { opacity: 1; transform: none; }
  .main-nav.open li:nth-child(2) { transition-delay: .06s; }
  .main-nav.open li:nth-child(3) { transition-delay: .12s; }
  .main-nav.open li:nth-child(4) { transition-delay: .18s; }
  .main-nav.open li:nth-child(5) { transition-delay: .24s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .main-nav ul { flex-direction: column; gap: 0; padding: 8px 24px 16px; }
  .main-nav a { display: block; padding: 12px 0; font-size: 1.1rem; }
  .brand-name { font-size: 1rem; }
}
@media (max-width: 520px) {
  .header-actions .btn { padding: .7em .9em; font-size: .8rem; }
  .brand-name { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate;
  color: var(--white);
  min-height: 78vh;
  display: flex; align-items: flex-end;
  padding: 120px 0 80px;
}
.hero.small { min-height: 46vh; padding: 100px 0 56px; }
.hero-bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.65) 100%);
}
.hero p.lead { font-size: 1.15rem; max-width: 560px; }
.eyebrow {
  font-family: var(--mono); font-size: .85rem; letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: .6em; display: block;
}

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section.soft { background: var(--bg-soft); }
.section-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px;
  margin-bottom: 40px;
}
.section-head h2 { margin: 0; }

/* Service cards */
.cards {
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: transform .3s ease-in-out, box-shadow .3s ease-in-out;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.10); }
.card img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; transition: transform .3s ease-in-out; }
.card:hover img { transform: scale(1.05); }
.card-body { padding: 22px 24px 26px; }
.card-body h3 { margin-bottom: .35em; }
.card-body p { color: var(--muted); margin: 0; }

/* Split image band */
.band {
  position: relative; isolation: isolate; color: var(--white);
  padding: 120px 0;
}
.band .hero-bg { object-position: center 35%; }
.band::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.35) 70%, rgba(0,0,0,.1) 100%);
}
.band-text { max-width: 520px; font-size: 1.1rem; }

/* Two-column content */
.split {
  display: grid; gap: 56px; align-items: start;
  grid-template-columns: 1fr 1fr;
}
.split img { border-radius: var(--radius); width: 100%; object-fit: cover; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 32px; } }

.checklist { list-style: none; padding: 0; margin: 0 0 1em; }
.checklist li { padding: 8px 0 8px 30px; position: relative; border-bottom: 1px solid var(--line); }
.checklist li::before {
  content: ""; position: absolute; left: 4px; top: 15px;
  width: 12px; height: 7px; border-left: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
  transform: rotate(-45deg);
}

/* Service detail rows */
.service-row {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: center;
  padding: 48px 0; border-top: 1px solid var(--line);
}
.service-row:nth-child(even) .service-media { order: 2; }
.service-media { border-radius: var(--radius); overflow: hidden; }
.service-row img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; transition: transform .3s ease-in-out; }
.service-row:hover img { transform: scale(1.05); }
@media (max-width: 860px) {
  .service-row { grid-template-columns: 1fr; gap: 24px; }
  .service-row:nth-child(even) .service-media { order: 0; }
}

/* Gallery */
.gallery {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.gallery button {
  padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: var(--radius); overflow: hidden;
}
.gallery img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  transition: transform .35s ease;
}
.gallery button:hover img, .gallery button:focus-visible img { transform: scale(1.04); }

.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 92vw; max-height: 92vh;
}
.lightbox::backdrop { background: rgba(0,0,0,.88); }
.lightbox img { max-width: 92vw; max-height: 86vh; width: auto; height: auto; border-radius: 6px; }
.lightbox-close {
  position: fixed; top: 16px; right: 20px;
  background: none; border: 0; color: #fff; font-size: 2.4rem; line-height: 1; cursor: pointer;
}

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px;
  margin: 40px 0 0;
}
.stat { border-top: 2px solid var(--navy); padding-top: 14px; }
.stat strong { display: block; font-size: 2.2rem; font-weight: 400; color: var(--navy); }
.stat span { color: var(--muted); }

/* ---------- Contact ---------- */
.contact-band {
  position: relative; isolation: isolate; padding: 96px 0;
}
.contact-band .hero-bg { object-position: center; }
.contact-band::after {
  content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(0,0,0,.35);
}
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
}
.contact-intro { color: var(--white); }
.contact-intro h2 { margin-bottom: .3em; }
.contact-intro a { color: var(--white); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

.form-card {
  background: var(--white); border-radius: var(--radius); padding: 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } .form-card { padding: 22px; } }

label { display: block; font-size: .9rem; margin-bottom: 6px; }
input, textarea {
  width: 100%; font: inherit; font-size: 1rem;
  padding: 11px 14px; border: 1px solid #c9c9c9; border-radius: 8px; background: #fff;
}
input:focus, textarea:focus { outline: 2px solid var(--navy); outline-offset: 1px; border-color: var(--navy); }
textarea { min-height: 120px; resize: vertical; }
.hidden-field { position: absolute; left: -9999px; }
.form-card .btn { width: 100%; justify-content: center; margin-top: 8px; font-size: 1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-soft); padding: 40px 0 28px; font-size: .95rem; }
.tagline {
  font-family: var(--script); font-size: 1.6rem; text-align: center; margin: 0 0 32px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; align-items: start;
}
.footer-grid h4 {
  font-family: var(--mono); font-weight: 400; letter-spacing: .1em; text-transform: uppercase;
  font-size: .85rem; margin: 0 0 14px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--ink); text-decoration: none; transition: color .2s ease-in-out; }
.footer-grid a:hover { color: var(--olive); }
.footer-logo { width: 220px; }
.footer-grid a.footer-brand { display: inline-block; text-decoration: none; }
.footer-brand span { display: block; font-size: 1.45rem; line-height: 1.2; margin-top: 2px; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--line); margin-top: 36px; padding-top: 18px; color: var(--muted); font-size: .85rem;
}
.footer-bottom a { color: var(--muted); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* Prose pages */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.4em; }

/* ---------- Scroll animations (recreating the Wix effects) ----------
   The `js` class is set by a tiny inline script in <head>; main.js tags
   elements with these classes and adds `is-visible` as they scroll into view.
   motion-slide  = Wix "Slide In" (from bottom, 1.2s)
   motion-reveal = Wix "Reveal In" (wipe up from the bottom, 1.2s)            */
.js .motion-slide {
  opacity: 0; transform: translateY(60px);
  transition: opacity 1.2s var(--ease-wix), transform 1.2s var(--ease-wix);
  transition-delay: var(--delay, 0s);
}
.js .motion-reveal {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.2s var(--ease-wix);
  transition-delay: var(--delay, 0s);
}
.js .motion-slide.is-visible { opacity: 1; transform: none; }
.js .motion-reveal.is-visible { clip-path: inset(0 0 0 0); }

/* Hero background: slow settle-in zoom on page load */
.js .hero .hero-bg { transform: scale(1.08); transition: transform 2.4s var(--ease-wix); }
.js.motion-ready .hero .hero-bg { transform: scale(1); }

/* Hide page content until main.js has tagged the animated elements (avoids a flash) */
.js:not(.motion-init) main, .js:not(.motion-init) .site-footer { opacity: 0; }

/* Safety net: if main.js never runs, show everything after 2.5s */
.js.motion-fallback .motion-slide, .js.motion-fallback .motion-reveal { opacity: 1; transform: none; clip-path: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .motion-slide, .js .motion-reveal, .js .hero .hero-bg { opacity: 1; transform: none; clip-path: none; transition: none; }
  .card, .card img, .service-row img, .gallery img, .btn, .btn::after, .main-nav a::after, .main-nav, .main-nav li { transition: none; }
}
