/* ============================================================
   The Red Door -- shared design tokens & base styles
   Portal palette: charcoal/deep grey background, white text,
   #7c251a deep red accents.
   Display: Fraunces | Body: Work Sans | Utility: JetBrains Mono
   ============================================================ */

:root {
  /* Portal-specific palette */
  --portal-bg: #1e1e1e;
  --portal-bg-deep: #111111;
  --portal-heading: #7c251a;
  --portal-heading-light: #b03a2c;
  --portal-text: #f0f0f0;
  --portal-text-muted: rgba(240, 240, 240, 0.65);
  --portal-border: rgba(124, 37, 26, 0.35);
  --portal-gold: #e8b873;
  --portal-card-bg: rgba(255, 255, 255, 0.05);

  /* Shared tokens */
  --field-cream-soft: #f0f0f0;
  --gold-light: #e8b873;
  --line: rgba(240, 240, 240, 0.12);
  --shadow: rgba(0, 0, 0, 0.4);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: linear-gradient(180deg, #2a2a2a 0%, var(--portal-bg-deep) 100%);
  background-attachment: fixed;
  color: var(--portal-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

a { color: var(--portal-heading-light); text-decoration-thickness: 1.5px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
  color: var(--portal-heading);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); line-height: 1.05; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; max-width: 38em; color: var(--portal-text); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--portal-gold);
  display: inline-block;
  margin-bottom: 0.6em;
}

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

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(17, 17, 17, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(124, 37, 26, 0.4);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--portal-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wordmark .door-mark { width: 18px; height: 26px; }

.site-nav {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  font-size: 0.92rem;
}

.site-nav a {
  color: var(--portal-text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover { color: var(--portal-text); border-bottom-color: var(--portal-heading); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.8em 1.5em;
  border-radius: 3px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:focus-visible { outline: 3px solid var(--portal-gold); outline-offset: 2px; }

.btn-primary {
  background: var(--portal-heading);
  color: #f0f0f0;
  box-shadow: 0 2px 0 #4d1610;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,37,26,0.5); }

.btn-secondary {
  background: transparent;
  border-color: var(--portal-heading-light);
  color: var(--portal-text);
}

.btn-secondary:hover { background: var(--portal-heading); border-color: var(--portal-heading); }

/* ---------- sections ---------- */

section { padding: 3.5rem 0; }
.section-tight { padding: 2rem 0; }

.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ---------- portal gate (login screen) ---------- */

.portal-gate {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: radial-gradient(ellipse at 30% 30%, #2a2a2a 0%, #111111 70%);
}

.portal-gate-card {
  max-width: 380px;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(124, 37, 26, 0.5);
  border-radius: 6px;
  padding: 2.4rem;
  text-align: center;
}

.portal-gate-card h1 { color: var(--portal-heading); font-size: 2rem; }
.portal-gate-card p { color: var(--portal-text-muted); margin: 0 auto 1.4rem; }
.portal-gate-card .eyebrow { color: var(--portal-gold); }

.portal-gate-card input[type="password"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75em 0.9em;
  border: 1.5px solid rgba(124, 37, 26, 0.5);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--portal-text);
  margin-bottom: 1rem;
}

.portal-gate-card input[type="password"]:focus-visible {
  outline: 3px solid var(--portal-gold);
  border-color: var(--portal-heading-light);
}

/* ---------- portal content ---------- */

.portal-content { display: none; }
.portal-content.is-visible { display: block; }

.portal-content section { border-bottom: 1px solid var(--line); }

.portal-content p,
.portal-content li,
.portal-content strong,
.portal-content label,
.portal-content legend { color: var(--portal-text); }

.portal-content .hint { color: var(--portal-text-muted); font-size: 0.85rem; margin-bottom: 0.5em; }
.portal-content a:not(.btn) { color: var(--portal-gold); }
.portal-content h1,
.portal-content h2,
.portal-content h3 { color: var(--portal-heading); }
.portal-content .eyebrow { color: var(--portal-gold); }

/* ---------- shared tab pattern ---------- */
/* Used on both index.html (guest portal) and productionportal.html.
   Reuse .portal-tabs / .tab-btn / .portal-tab-panel for any future
   multi-section page. */

.portal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.4rem 0 2rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.8rem;
}

.tab-btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(124, 37, 26, 0.35);
  color: var(--portal-text-muted);
  padding: 0.6em 1.1em;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tab-btn:hover { border-color: var(--portal-heading-light); color: var(--portal-text); }

.tab-btn.is-active {
  background: var(--portal-heading);
  border-color: var(--portal-heading);
  color: #f0f0f0;
}

.tab-btn:focus-visible { outline: 3px solid var(--portal-gold); outline-offset: 2px; }

.portal-tab-panel { display: none; }
.portal-tab-panel.is-active { display: block; }

/* ---------- schedule (multi-location grid format) ---------- */

/* Day header -- bold full-width banner */
.schedule-day-header {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--portal-heading);
  background: rgba(124, 37, 26, 0.12);
  border-left: 3px solid var(--portal-heading);
  padding: 0.6rem 1rem;
  margin: 2rem 0 0.5rem;
  border-radius: 0 4px 4px 0;
}

/* Full-row event -- spans everything, distinct from a time slot */
.schedule-full-row {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--portal-gold);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.02em;
}

/* Time slot row */
.schedule-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

@media (max-width: 680px) {
  .schedule-row { grid-template-columns: 1fr; gap: 0.3rem; }
}

.schedule-time {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--portal-gold);
  padding-top: 0.15rem;
  line-height: 1.4;
}

/* Activities column -- one card per location */
.schedule-activities {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.schedule-activity {
  background: var(--portal-card-bg);
  border: 1px solid rgba(124, 37, 26, 0.2);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.schedule-location {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--portal-heading-light);
}

.schedule-activity-text {
  font-size: 0.92rem;
  color: var(--portal-text);
  line-height: 1.45;
  white-space: pre-line;
}

/* Legacy: simple Day/Time/Title/Note fallback format */
.schedule-day { margin-bottom: 2rem; }

/* ---------- cards (site map, vendor, team) ---------- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.team-card {
  background: var(--portal-card-bg);
  border: 1px solid rgba(124, 37, 26, 0.3);
  border-radius: 6px;
  padding: 1.2rem;
}

.team-card .role {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--portal-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.team-card h3 { color: var(--portal-heading); }
.team-card p { color: var(--portal-text); font-size: 0.95rem; margin-bottom: 0.3em; }
.team-card .hint { color: var(--portal-text-muted); font-size: 0.82rem; }

/* ---------- site map image placeholder ---------- */

.site-map-image {
  border: 1px dashed rgba(124, 37, 26, 0.4);
  border-radius: 6px;
  margin-bottom: 1.6rem;
  overflow: hidden;
}

.site-map-image img { width: 100%; display: block; }

.site-map-image .placeholder-note {
  padding: 2.4rem 1.2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--portal-text-muted);
}

/* ---------- community feed ---------- */

.feed-upload {
  background: var(--portal-card-bg);
  border: 1px solid rgba(124, 37, 26, 0.3);
  border-radius: 8px;
  padding: 1.6rem;
  margin-bottom: 2rem;
}

.feed-upload input[type="text"],
.feed-upload textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.7em 0.8em;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--portal-text);
  margin-bottom: 1rem;
}

.feed-upload input[type="file"] {
  width: 100%;
  color: var(--portal-text);
  margin-bottom: 1.2rem;
  font-family: var(--font-body);
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}

.feed-card {
  background: var(--portal-card-bg);
  border: 1px solid rgba(124, 37, 26, 0.3);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.feed-card .feed-media-wrap {
  aspect-ratio: 4 / 3;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.feed-card img, .feed-card video { width: 100%; height: 100%; object-fit: cover; }

.feed-card .feed-meta { padding: 0.8rem 1rem; font-size: 0.88rem; color: var(--portal-text); }
.feed-card .feed-by {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--portal-gold);
  display: block;
  margin-bottom: 0.3em;
}

.feed-card .feed-delete {
  background: none;
  border: none;
  color: var(--portal-text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0 1rem 0.8rem;
  text-align: left;
  font-family: var(--font-mono);
  transition: color 0.15s ease;
}

.feed-card .feed-delete:hover { color: var(--portal-heading-light); }

.feed-empty {
  color: var(--portal-text-muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* ---------- form elements ---------- */

.form-status {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.9em 1em;
  border-radius: 4px;
  margin-top: 1.2rem;
  display: none;
}

.form-status.is-visible { display: block; }

.form-status.success {
  background: rgba(124, 37, 26, 0.15);
  color: #d4a0a0;
  border: 1px solid rgba(124, 37, 26, 0.4);
}

.form-status.error {
  background: rgba(180, 30, 30, 0.12);
  color: #e08080;
  border: 1px solid rgba(180, 30, 30, 0.35);
}

label, legend {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4em;
  color: var(--portal-text);
}

.hint {
  font-size: 0.85rem;
  color: var(--portal-text-muted);
  margin-top: -0.2em;
  margin-bottom: 0.5em;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.7em 0.8em;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  color: var(--portal-text);
  margin-bottom: 1.2rem;
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--portal-gold);
  border-color: var(--portal-heading-light);
}

textarea { min-height: 7em; resize: vertical; }

.submit-row { display: flex; align-items: center; gap: 1rem; margin-top: 0.5rem; }

/* ---------- dashboard ---------- */

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--portal-card-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.dashboard-table th,
.dashboard-table td {
  text-align: left;
  padding: 0.9em 1em;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--portal-text);
}

.dashboard-table th {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--portal-gold);
  background: rgba(255,255,255,0.04);
}

.count-pill {
  font-family: var(--font-mono);
  background: var(--portal-heading);
  color: #f0f0f0;
  border-radius: 999px;
  padding: 0.15em 0.7em;
  font-size: 0.85rem;
}

/* ---------- footer ---------- */

footer {
  background: #0a0a0a;
  color: var(--portal-text-muted);
  padding: 2rem 0;
  font-size: 0.9rem;
  border-top: 1px solid rgba(124, 37, 26, 0.3);
}

footer a { color: var(--portal-gold); }
