/* Southbound Diesel — Gritty Industrial Rock Theme */
@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@600;700&family=Inter:wght@400;500;700&display=swap');

:root {
  --bg-dark: #0a0b0e;
  --bg-surface: #111318;
  --bg-card: #14161b;
  --bg-elevated: #1a1d24;
  --accent-rust: #e85a2b;
  --accent-rust-dark: #b8401a;
  --accent-amber: #f2a93b;
  --accent-amber-soft: rgba(242, 169, 59, 0.15);
  --steel: #7d8a94;
  --text-main: #e2e8f0;
  --text-muted: #9aa5b1;
  --border-color: #252a33;
  --border-highlight: #3a404d;
  --glow-rust: rgba(232, 90, 43, 0.35);
  --glow-amber: rgba(242, 169, 59, 0.25);
  --shadow-deep: rgba(0, 0, 0, 0.6);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Grit / noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4, .site-logo {
  font-family: 'Chakra Petch', sans-serif;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: #ffffff;
  margin-top: 0;
}

h1 {
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.1;
}

h3 {
  font-size: 1.15rem;
  letter-spacing: 2px;
  color: var(--accent-amber);
}

p {
  color: var(--text-muted);
}

a {
  color: var(--accent-rust);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #ff7a4a;
}

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

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Nav */
.site-header {
  background: rgba(10, 11, 14, 0.82);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.site-header.scrolled {
  background: rgba(10, 11, 14, 0.96);
  border-bottom-color: rgba(232, 90, 43, 0.45);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 84px;
}

.site-logo {
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2.5px;
  position: relative;
  display: inline-block;
}

.site-logo::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-rust), var(--accent-amber));
  opacity: 0.85;
}

.site-nav {
  display: flex;
  gap: 34px;
  align-items: center;
}

.site-nav a,
.nav-logout-button {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  position: relative;
}

.nav-logout-form {
  margin: 0;
  display: flex;
  align-items: center;
}

.nav-logout-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: inherit;
}

.nav-logout-button::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--accent-rust);
  transition: width 0.25s ease;
}

.nav-logout-button:hover {
  color: var(--accent-rust);
}

.nav-logout-button:hover::after {
  width: 100%;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--accent-rust);
  transition: width 0.25s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent-rust);
}

.site-nav a:hover::after,
.site-nav a.active::after {
  width: 100%;
}

.nav-cta {
  background: linear-gradient(135deg, var(--accent-rust) 0%, var(--accent-rust-dark) 100%);
  color: #fff !important;
  padding: 11px 22px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 1.5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 18px var(--glow-rust);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-cta::after {
  display: none !important;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--glow-rust);
  color: #fff !important;
}

/* Mobile hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 1002;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-toggle:hover {
  border-color: var(--accent-rust);
  box-shadow: 0 0 14px var(--glow-rust);
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-main);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.25s ease, background 0.2s ease;
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
  background-color: var(--bg-dark);
}

/* Locomotive image layer */
.hero-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
}

/* Darkening gradient overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 11, 14, 0.35) 0%, rgba(10, 11, 14, 0.55) 60%, rgba(10, 11, 14, 0.88) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Scan-line texture */
.hero-texture {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 3px,
    transparent 4px
  );
  z-index: 2;
  pointer-events: none;
}

/* Orange glow behind headline */
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(232, 90, 43, 0.18) 0%, transparent 45%),
    radial-gradient(ellipse at center, transparent 0%, rgba(10, 11, 14, 0.35) 70%);
  z-index: 3;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 4;
  max-width: 900px;
}

.sub-tag {
  display: inline-block;
  background: rgba(232, 90, 43, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(242, 169, 59, 0.35);
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 24px;
  border-radius: 2px;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 22px 0;
  text-shadow: 0 0 40px rgba(232, 90, 43, 0.35), 0 4px 24px rgba(0, 0, 0, 0.7);
}

.hero p {
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  color: var(--text-muted);
  margin: 0 auto 38px;
  max-width: 620px;
}

.cta-group {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-weight: 700;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  cursor: pointer;
  text-align: center;
  border: none;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.85rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-rust) 0%, var(--accent-rust-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 20px var(--glow-rust);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--glow-rust);
  filter: brightness(1.08);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.btn-outline:hover {
  border-color: var(--accent-rust);
  color: var(--accent-rust);
  box-shadow: 0 0 18px var(--glow-rust) inset;
}

.btn-danger {
  background: transparent;
  color: #ff6b6b;
  border: 2px solid rgba(255, 107, 107, 0.5);
}

.btn-danger:hover {
  background: rgba(255, 107, 107, 0.12);
  border-color: #ff6b6b;
  color: #ff8787;
  box-shadow: 0 0 18px rgba(255, 107, 107, 0.25) inset;
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.78rem;
}

/* Async button spinner */
.btn-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.6em;
  vertical-align: middle;
  animation: btn-spin 1s linear infinite;
  flex-shrink: 0;
}

.btn-spinner circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

button[data-loading],
button[data-loading]:hover,
button[data-loading]:focus,
.htmx-request button[type="submit"],
.htmx-request button[type="submit"]:hover,
.htmx-request button[type="submit"]:focus {
  cursor: wait;
  opacity: 0.85;
}

/* Utilities & Layout */
.section-padding {
  padding: 90px 0;
}

/* Forms */
.form-card {
  max-width: 520px;
  margin: 0 auto;
  padding: 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.portal-card {
  width: 100%;
  max-width: 100%;
  margin: 0 0 48px 0;
  padding: 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.field input,
.field textarea,
.field select {
  padding: 14px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent-rust);
  box-shadow: 0 0 0 3px rgba(232, 90, 43, 0.15);
}

.field .errorlist {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--accent-rust);
  font-size: 0.85rem;
}

.stack-form button[type="submit"] {
  align-self: flex-start;
}


.section-dark {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

@media(max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .site-logo {
    font-size: 1.15rem;
  }
  .nav-container {
    height: 72px;
  }
  .nav-toggle {
    display: flex;
  }
  .site-nav {
    position: fixed;
    inset: 72px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px 24px 28px;
    background: rgba(10, 11, 14, 0.96);
    border-bottom: 1px solid rgba(232, 90, 43, 0.45);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(14px);
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
  }
  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .site-nav a,
  .nav-logout-form,
  .nav-logout-button {
    display: block;
    width: 100%;
    text-align: left;
  }
  .site-nav a {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
  }
  .site-nav a:last-of-type {
    border-bottom: 1px solid var(--border-color);
  }
  .nav-logout-form {
    padding: 16px 0;
    justify-content: flex-start;
  }
  .nav-cta {
    padding: 16px 0;
    background: none;
    border: none;
    box-shadow: none;
    color: var(--text-main) !important;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    text-align: left;
  }
  .nav-cta:hover {
    transform: none;
    box-shadow: none;
    color: var(--accent-rust) !important;
  }
  .nav-cta::after {
    display: block !important;
  }
  .site-nav a::after,
  .nav-logout-button::after {
    bottom: 12px;
  }
  .site-nav a:hover,
  .site-nav a.active {
    color: var(--accent-rust);
  }
}

/* Cards */
.card {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-rust);
  border-radius: 4px;
  padding: 34px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px var(--shadow-deep);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-highlight), transparent);
}

.card h3 {
  margin-bottom: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  align-items: start;
}

@media(max-width: 900px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.dark-card {
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
}

/* Grit line divider */
.grit-line {
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent-rust), var(--accent-amber), var(--accent-rust), transparent);
  border: none;
  margin: 0;
  opacity: 0.75;
}

/* Page Header */
.page-header {
  position: relative;
  padding: 110px 0 80px;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  background-color: var(--bg-dark);
  overflow: hidden;
}

.page-header-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 11, 14, 0.45) 0%, rgba(10, 11, 14, 0.7) 70%, var(--bg-dark) 100%);
  z-index: 1;
  pointer-events: none;
}

.page-header .container {
  position: relative;
  z-index: 2;
}

.page-header h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 12px;
  text-shadow: 0 0 30px rgba(232, 90, 43, 0.35), 0 2px 12px rgba(0, 0, 0, 0.6);
}

.page-header p {
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto;
}

.page-header .welcome {
  margin-top: 8px;
  font-size: 1rem;
  color: var(--text-muted);
}

/* Profile editor layout */
.profile-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.profile-editor-grid .form-card {
  max-width: none;
  width: 100%;
}

.profile-editor-card h2 {
  margin-bottom: 8px;
}

.profile-editor-card .field-help {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -4px;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Avatar preview */
.avatar-field .drop-zone {
  max-width: 240px;
}

.avatar-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.avatar-preview img {
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-surface);
}

/* Drop zones */
.drop-zone {
  position: relative;
  padding: 24px;
  text-align: center;
  background: var(--bg-surface);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent-rust);
  background: rgba(232, 90, 43, 0.08);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  pointer-events: none;
}

.drop-zone-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Checkbox field */
.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-rust);
  cursor: pointer;
}

.checkbox-field label {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  cursor: pointer;
}

/* Local thumbnail previews inside drop zones and upload forms */
.local-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.local-preview {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: var(--bg-dark);
}

/* Upload progress indicator */
.upload-progress {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.upload-progress.active {
  display: flex;
}

.upload-progress .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-rust);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Form save spinner */
.save-profile-spinner {
  display: none;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.save-profile-spinner.active {
  display: inline-flex;
}

.save-profile-spinner .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-rust);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Invitations section */
.invitations-section {
  margin-bottom: 48px;
}

.invitations-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.invitations-header h2 {
  margin: 0 0 8px 0;
}

.invitations-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.invitation-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-rust);
  border-radius: 4px;
}

.invitation-history {
  border-left-color: var(--text-muted);
  opacity: 0.9;
}

.invitation-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.invitation-primary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.invitation-meta-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.invitation-email {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main);
}

.invitation-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.invitation-meta + .invitation-meta::before {
  content: "·";
  margin-right: 18px;
  color: var(--border-color);
}

.invitation-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.inline-form {
  display: inline;
  margin: 0;
}

.invitation-empty {
  color: var(--text-muted);
  margin: 0;
}

.invitations-history {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.invitations-history summary {
  cursor: pointer;
  user-select: none;
  padding: 8px 0;
}

@media (max-width: 640px) {
  .invitation-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .invitation-actions {
    justify-content: flex-start;
  }
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-pending {
  background: rgba(232, 90, 43, 0.15);
  color: var(--accent-rust);
  border: 1px solid rgba(232, 90, 43, 0.35);
}

.badge-accepted {
  background: rgba(46, 204, 113, 0.12);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.35);
}

.badge-expired {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.members-section {
  margin-top: 16px;
}

.members-section h2 {
  margin: 0 0 24px 0;
}

/* Profile image gallery */
.profile-image-gallery {
  margin-bottom: 32px;
}

.profile-image-empty {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.profile-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.profile-image-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: border-color 0.2s ease;
}

.profile-image-card.primary {
  border-color: var(--accent-rust);
  box-shadow: 0 0 0 1px var(--accent-rust);
}

.profile-image-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-dark);
}

.profile-image-card .badge-primary {
  position: absolute;
  top: 14px;
  left: 14px;
}

.profile-image-caption {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-image-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.profile-image-actions .btn-sm {
  padding: 7px 12px;
  font-size: 0.7rem;
}

/* EasyMDE dark theme overrides */
.EasyMDEContainer .editor-toolbar {
  background: var(--bg-surface);
  border-color: var(--border-color);
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

.EasyMDEContainer .editor-toolbar button {
  color: var(--text-main);
}

.EasyMDEContainer .editor-toolbar button:hover,
.EasyMDEContainer .editor-toolbar button.active {
  background: rgba(232, 90, 43, 0.2);
  border-color: var(--accent-rust);
}

.EasyMDEContainer .CodeMirror {
  background: var(--bg-surface);
  color: #fff;
  border-color: var(--border-color);
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

.EasyMDEContainer .CodeMirror-cursor {
  border-left-color: #fff;
}

.EasyMDEContainer .editor-preview-side,
.EasyMDEContainer .editor-preview {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.editor-markdown-preview {
  padding: 16px;
}

@media (max-width: 768px) {
  .profile-editor-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* Read more link */
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 0.88rem;
  margin-top: 10px;
}

/* Next show box */
.next-show-box {
  text-align: center;
}

.show-date {
  font-family: 'Chakra Petch', sans-serif;
  color: var(--accent-amber);
  font-size: 1.25rem;
  letter-spacing: 1.5px;
  margin: 0 0 12px;
}

.next-show-box h4 {
  font-size: 1.5rem;
  margin: 0 0 6px;
}

.show-loc {
  color: var(--text-muted);
  margin: 0 0 22px;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.show-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.show-table th,
.show-table td {
  padding: 20px 22px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.show-table th {
  background: var(--bg-elevated);
  font-family: 'Chakra Petch', sans-serif;
  letter-spacing: 1.5px;
  color: var(--accent-amber);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.show-table tbody tr {
  transition: background 0.2s ease;
}

.show-table tbody tr:hover {
  background: rgba(232, 90, 43, 0.06);
}

.show-table tbody tr:last-child td {
  border-bottom: none;
}

/* Past shows list */
.past-shows-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}

.past-shows-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.past-shows-list span {
  color: var(--accent-amber);
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 600;
  min-width: 110px;
  letter-spacing: 1px;
}

.past-shows-list strong {
  color: var(--text-main);
}

/* Fact list */
.fact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fact-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.fact-list li:last-child {
  border-bottom: none;
}

.fact-list strong {
  color: var(--text-main);
}

/* Stage plot */
.stage-plot-section ul {
  padding-left: 22px;
  color: var(--text-muted);
}

.stage-plot-section li {
  margin-bottom: 10px;
}

/* Band member cards on EPK page */
.band-members-section {
  margin: 48px 0 64px 0;
}

.band-members-section h2 {
  margin: 0 0 32px 0;
}

.member-card {
  display: flex;
  flex-direction: column;
  padding: 0 0 28px 0;
  overflow: hidden;
}

.member-card h3 {
  margin: 20px 24px 6px 24px;
  font-size: 1.35rem;
}

.member-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-dark);
}

.member-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.member-avatar {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-card);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  background: var(--bg-surface);
}

.member-role {
  margin: 0 24px 14px 24px;
  color: var(--accent-rust);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.member-bio-wrap {
  margin: 0 24px 8px 24px;
}

.member-bio {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.member-bio p:last-child {
  margin-bottom: 0;
}

.member-bio-expandable .member-bio {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.member-bio-checkbox:checked ~ .member-bio {
  -webkit-line-clamp: unset;
  display: block;
}

.member-bio-toggle {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent-rust);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.member-bio-toggle:hover {
  color: #ff9a7a;
}

.member-bio-toggle::before {
  content: "Read more";
}

.member-bio-checkbox:checked ~ .member-bio-toggle::before {
  content: "Read less";
}

/* Embeds & media */
.embed-placeholder {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-surface) 100%);
  border: 2px dashed var(--border-color);
  border-radius: 4px;
  padding: 50px 30px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.player-container h3 {
  margin-top: 0;
}

/* Contact */
.contact-form {
  margin-top: 18px;
}

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-control {
  width: 100%;
  padding: 14px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-rust);
  box-shadow: 0 0 0 3px rgba(232, 90, 43, 0.15);
}

.contact-highlight {
  font-size: 1.15rem;
}

.contact-highlight a {
  font-weight: 700;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
}

.social-links a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s ease;
}

.social-links a:hover {
  color: var(--accent-rust);
}

.social-icon {
  width: 24px;
  height: 24px;
  display: block;
}

/* Utility classes */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 24px;
}

.mt-5 {
  margin-top: 40px;
}

.mb-5 {
  margin-bottom: 40px;
}

/* Music page: audio list and video cards */
.audio-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.audio-row {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 45%);
  align-items: center;
  gap: 28px;
  padding: 24px;
}

.audio-info h3 {
  margin: 0 0 8px 0;
}

.audio-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 8px 0;
}

.audio-description p:last-child {
  margin-bottom: 0;
}

.audio-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.audio-player {
  width: 100%;
  border-radius: 4px;
}

.video-card h3 {
  margin-top: 0;
}

.video-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.video-description p:last-child {
  margin-bottom: 0;
}

.empty-state {
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 768px) {
  .audio-row {
    grid-template-columns: 1fr;
  }
}

/* Portal media list actions */
.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.media-actions form {
  margin: 0;
}

/* Image gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.gallery-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gallery-thumb-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-card:hover .gallery-thumb {
  transform: scale(1.05);
}

.gallery-caption {
  padding: 16px;
}

.gallery-caption h3 {
  margin: 0 0 6px 0;
  font-size: 1rem;
}

.gallery-description {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 8px 0;
}

.gallery-description p:last-child {
  margin-bottom: 0;
}

.gallery-meta {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 50px 0 40px;
  text-align: center;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-rust), var(--accent-amber), var(--accent-rust), transparent);
}

.site-footer p {
  margin: 8px 0;
  font-size: 0.9rem;
}

.footer-tag {
  color: var(--accent-rust);
  font-family: 'Chakra Petch', sans-serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 0.85rem;
}
