/* Vehicle / class entity pages (v1) — scoped, minimal, theme-safe.
   Layout mirrors the station pages hero: facts left, gallery right. */

.lwveh-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  box-sizing: border-box;
}

.lwveh-section {
  margin-bottom: 1.5rem;
}

.lwveh-card,
.lwveh-page .lw-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-sizing: border-box;
  border: 1px solid var(--border);
}

.lwveh-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

/* Hero: facts left + gallery right */
.lwveh-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.lwveh-hero .lwveh-card,
.lwveh-hero .lw-card {
  margin-bottom: 0;
}
.lwveh-hero--info-only {
  grid-template-columns: 1fr;
}

/* Class pages: full-width rotating community gallery below the hero */
.lwveh-class-gallery {
  margin-top: 1.5rem;
}
.lwveh-class-gallery .lwenth-gallery-viewport {
  height: min(62vh, 540px);
}
.lwveh-class-gallery .lwenth-gallery-caption {
  font-size: 0.85rem;
}
.lwveh-class-gallery .lwenth-gallery-nav {
  padding-top: 0.25rem;
}
@media (max-width: 640px) {
  .lwveh-class-gallery .lwenth-gallery-viewport {
    height: min(48vh, 360px);
  }
}

.lwveh-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.lwveh-name {
  margin: 0;
  font-size: 2rem;
  line-height: 1.15;
}

.lwveh-id-badge {
  background: var(--accent-2);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
}

.lwveh-status-badge {
  background: var(--muted);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
}
.lwveh-status-badge--active    { background: var(--ok); }
.lwveh-status-badge--preserved { background: var(--info); }
.lwveh-status-badge--withdrawn { background: var(--warn); }
.lwveh-status-badge--scrapped  { background: var(--danger); }
.lwveh-status-badge--unknown   { background: var(--border); color: var(--muted); }
.lwveh-status-badge--neutral   { background: var(--muted); }

.lwveh-hero-sub {
  color: var(--muted);
  margin: 0 0 1rem;
}

.lwveh-facts-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.5rem;
  margin: 0;
}
.lwveh-facts-list dt {
  font-weight: 600;
  color: var(--muted);
}
.lwveh-facts-list dd {
  margin: 0;
  color: var(--fg);
}

.lwveh-attribution-line {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.lwveh-class-link {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

/* Photo grid fallback (when the enthusiast gallery is not available) */
.lwveh-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.lwveh-photo-item {
  margin: 0;
}
.lwveh-photo-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: var(--surface-2);
}
.lwveh-photo-caption {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.lwveh-photo-caption a {
  color: inherit;
}

/* Specification table */
.lwveh-spec-table {
  width: 100%;
  border-collapse: collapse;
}
.lwveh-spec-table th,
.lwveh-spec-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.lwveh-spec-table tr:last-child th,
.lwveh-spec-table tr:last-child td {
  border-bottom: 0;
}
.lwveh-spec-table th {
  width: 1%;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 600;
}

/* Roster grid (class pages) */
.lwveh-roster-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.lwveh-roster-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
.lwveh-roster-item:hover {
  border-color: var(--accent-2);
}
.lwveh-roster-label {
  font-weight: 700;
}
.lwveh-roster-sub {
  font-size: 0.8rem;
  color: var(--muted);
}
.lwveh-roster-loc {
  font-size: 0.78rem;
  color: var(--muted);
}
.lwveh-roster-status {
  font-size: 0.75rem;
  color: var(--muted);
}
.lwveh-roster-intro {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.lwveh-roster-empty {
  margin: 0;
  color: var(--muted);
}
.lwveh-count {
  font-weight: 400;
  color: var(--muted);
}

/* Community header card (matches station pages) */
.lwveh-community-header {
  text-align: center;
  background: var(--grad);
  border: 0;
  color: var(--on-accent);
}
.lwveh-community-header .lwveh-section-title {
  display: inline-block;
  border-bottom: 0;
  margin: 0;
  padding: 0;
  color: var(--on-accent);
}
.lwveh-community-header p {
  margin: 0.5rem 0 0;
  color: var(--on-accent);
}

.lwveh-empty {
  color: var(--muted);
}

/* Mobile collapse */
@media (max-width: 768px) {
  .lwveh-hero {
    grid-template-columns: 1fr;
  }
  .lwveh-page {
    padding: 1rem;
    overflow-x: hidden;
  }
  .lwveh-card,
  .lwveh-page .lw-card {
    padding: 1rem;
  }
  .lwveh-facts-list {
    grid-template-columns: 1fr;
  }
  .lwveh-roster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lwveh-name {
    font-size: 1.5rem;
  }
}
@media (max-width: 480px) {
  .lwveh-page {
    padding: 0.75rem;
  }
  .lwveh-roster-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------ carriages & stock types */

.lwveh-carriages-intro {
  color: var(--muted);
  margin: 0 0 1rem;
}

.lwveh-carriage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.lwveh-carriage-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  text-decoration: none;
  color: inherit;
}

.lwveh-carriage-item:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.lwveh-carriage-name {
  font-weight: 600;
  color: var(--accent-2);
  line-height: 1.3;
}

.lwveh-carriage-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.lwveh-stock-plan .lwveh-subhead {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
}

.lwveh-vehicle-classes,
.lwveh-spec-table {
  width: 100%;
  border-collapse: collapse;
}

.lwveh-vehicle-classes th,
.lwveh-vehicle-classes td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.lwveh-seat-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.3rem 1rem;
}

.lwveh-seat-features li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.lwveh-seat-feature-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.lwveh-stock-template {
  margin: 1rem 0 0;
}
