/*
 * Global Styles for Trains Are Cool Sign‑Off Site
 *
 * The site uses a clean teal colour palette with subtle shadows to
 * separate cards from the background. A fixed navigation drawer on
 * larger screens provides quick access to each page. On smaller
 * viewports the navigation slides in from the left and can be
 * toggled with a menu button.
 */

/* Colour and typographic variables */
:root {
  --primary-color: #009688;       /* Teal accent used for buttons and links */
  --primary-color-dark: #00796b;  /* Darker shade for hover states */
  --nav-bg: #2c2f3a;             /* Dark background for side navigation */
  --nav-text: #ffffff;           /* Light text colour inside navigation */
  --bg-color: #eef5f5;           /* Light page background */
  --card-bg: #ffffff;            /* Card backgrounds */
  --text-color: #222222;         /* Main text colour */
  --muted-text: #666666;         /* Secondary text colour */
  --shadow: rgba(0, 0, 0, 0.08);  /* Card shadow */
  font-family: Arial, Helvetica, sans-serif;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 16px;
}

/* Reset lists */
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Navigation drawer */
nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 250px;
  padding: 1.5rem 1rem;
  background: var(--nav-bg);
  color: var(--nav-text);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transform: translateX(0);
  transition: transform 0.3s ease;
}

/* Container used throughout pages to center content and limit line length */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Logo area inside the navigation
 * Combines a small train icon with the site title. The icon inherits the
 * navigation text colour via a filter invert. */
.logo-wrapper {
  display: flex;
  align-items: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: 0.5px;
}

.logo-wrapper img {
  width: 32px;
  height: 32px;
  margin-right: 0.6rem;
  filter: invert(100%);
}

/* Train animation added to the home page hero. The small train icon
 * glides from left to right across the viewport. Use filter invert
 * so the dark icon appears light against the gradient. */
.train-animation {
  position: absolute;
  bottom: 0.5rem;
  left: -100px;
  width: 120px;
  height: 80px;
  background-image: url('train-logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  animation: moveTrain 12s linear infinite;
  opacity: 0.85;
  filter: invert(100%);
  z-index: 2;
  pointer-events: none;
}

@keyframes moveTrain {
  0%   { transform: translateX(-120vw); }
  100% { transform: translateX(120vw); }
}

nav .logo {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: 0.5px;
}

nav ul li {
  margin-bottom: 1rem;
}

nav a {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 1rem;
  padding: 0.3rem 0.5rem;
  display: block;
  border-left: 4px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

nav a:hover,
nav a:focus {
  color: var(--primary-color);
  border-color: var(--primary-color);
  outline: none;
}

nav a.active {
  color: var(--primary-color);
  border-color: var(--primary-color);
  font-weight: 600;
}

/* Main content area */
main {
  margin-left: 250px;
  /* Provide generous horizontal padding so text doesn't hug the edges */
  padding: 2rem 2rem 3rem;
}

/* Menu toggle button for mobile */
#navToggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 150;
}

/* Hero section */
.hero {
  position: relative;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  overflow: hidden;
  color: #ffffff;
  margin-bottom: 2rem;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
}

.hero .hero-content {
  position: relative;
  z-index: 1;
  max-width: 90%;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1.1rem;
  line-height: 1.4;
  margin: 0 auto;
  max-width: 600px;
  color: #eaeaea;
}

/* Cards used on home page */
.card-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .card-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--card-bg);
  padding: 1rem 1rem;
  border-radius: 10px;
  box-shadow: 0 4px 8px var(--shadow);
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.card img.icon,
.card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  font-size: 1.8rem;
  line-height: 1;
}

.card-content h3 {
  margin: 0 0 0.3rem;
  font-size: 1.2rem;
  color: var(--primary-color);
}

.card-content p {
  margin: 0;
  color: var(--text-color);
  font-size: 0.95rem;
}

/* Section cards for sign‑off pages */
.controls {
  text-align: center;
  margin-bottom: 1.5rem;
}

.controls button {
  margin: 0.3rem;
  padding: 0.5rem 1.2rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid var(--primary-color);
  background-color: #e6f4f3;
  color: var(--primary-color);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-weight: 600;
}

.controls button:hover,
.controls button:focus {
  background-color: var(--primary-color);
  color: #fff;
  outline: none;
}

/* Individual collapsible sections */
.section {
  background: var(--card-bg);
  border: 1px solid #ddd;
  border-radius: 10px;
  margin-bottom: 1.2rem;
  box-shadow: 0 4px 8px var(--shadow);
  transition: box-shadow 0.3s ease;
}

.section:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  text-align: left;
  user-select: none;
}

.toggle-btn:hover,
.toggle-btn:focus {
  color: var(--primary-color-dark);
  outline: none;
}

.arrow {
  margin-left: 0.5rem;
  transition: transform 0.35s ease;
}

.section.expanded .arrow {
  transform: rotate(90deg);
}

.content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
  padding: 0 1rem;
}

.section.expanded .content {
  max-height: 1000px;
  padding-bottom: 1rem;
}

.route-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  margin-top: 0;
  color: var(--primary-color-dark);
}

.route-subtitle {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 0.5rem;
  margin-bottom: 0.7rem;
  color: var(--primary-color);
}

.route-text {
  margin-left: 1.2rem;
  margin-top: 0;
  margin-bottom: 0.8rem;
  color: var(--text-color);
  font-size: 1rem;
}

.route-text li {
  margin-bottom: 0.4rem;
  list-style-type: disc;
}

/* Hidden answer styling */
.hidden {
  color: transparent;
  background-color: #e6f4f3;
  cursor: pointer;
  border-bottom: 1px dashed #7acfc2;
  border-radius: 3px;
  padding: 0 3px;
  user-select: none;
  transition: color 0.3s ease, background-color 0.3s ease;
}

.hidden:hover {
  background-color: #eff9f7;
}

.hidden.revealed {
  color: var(--text-color) !important;
  background-color: transparent !important;
  border-bottom: none;
  user-select: text;
}

/* Responsive rules */
@media (max-width: 768px) {
  nav {
    transform: translateX(-100%);
    width: 220px;
  }
  nav.open {
    transform: translateX(0);
  }
  #navToggle {
    display: block;
  }
  main {
    margin-left: 0;
    /* extra top padding to avoid overlap with the mobile menu button */
    padding: 4rem 1.5rem 2rem;
  }
}