/* Paths Art Deco Styles */

:root {
  /* Topic colors - can be overridden per-topic */
  --topic-dominant: #5B9AA0;
  --topic-secondary: #7A8A5C;
  --topic-accent: #8B6B4A;
  --topic-neutral: #C4A882;
  --topic-sky: #A8C4C8;

  /* Text colors */
  --text-dark: #2a2d2e;
  --text-muted: #666;
  --text-light: #888;

  /* Background */
  --bg-warm: #f5f2eb;

  /* Header dimensions for sticky positioning */
  /* Mobile values - must match actual rendered heights (see TestCSSVariableSync) */
  --header-height: 45px;
  --header-padding: 12px;
  --nav-bar-height: 39px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: clip;
}

body {
  font-family: 'Bitter', serif;
  background: var(--bg-warm);
  color: var(--text-dark);
  line-height: 1.5;
  touch-action: pan-y;  /* Restricts touch to vertical only - prevents horizontal swipe on mobile */
}

/* Per-community color palettes (from brand-visual.md) */
/* Applied to placeholder teacher image and Learn More button */

.community-enneagram {
  --topic-dominant: #7BA3A8; /* Soft teal sky */
  --topic-accent: #8B6B4A;   /* Warm brown */
}

.community-nonviolent-communication {
  --topic-dominant: #C8A0A0; /* Dusty rose/mauve */
  --topic-accent: #8A6A4A;   /* Warm brown */
}

.community-integral {
  --topic-dominant: #D4912E; /* Warm amber */
  --topic-accent: #4A6A3E;   /* Forest green */
}

.community-internal-family-systems {
  --topic-dominant: #6A7A6E; /* Cool gray-green */
  --topic-accent: #C4A052;   /* Warm gold */
}

a {
  color: inherit;
  text-decoration: none;
}

/* Container - mobile first */
.container {
  max-width: 400px;
  margin: 0 auto;
  background: var(--bg-warm);
  min-height: 100vh;
}

/* Top Header - sticky at very top */
.header-top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--text-dark);
  padding: var(--header-padding) 16px;
  text-align: center;
}

/* Banner - normal flow, scrolls away naturally */
.banner {
  width: 100%;
  overflow: hidden;
}

.banner img {
  width: 100%;
  height: 33.33vw;
  max-height: 133px;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Bottom Header - sticky below top header with margin collapse */
/* Overlaps header-top by 1.25x padding so gap = 0.75x padding */
.header-bottom {
  position: sticky;
  top: calc(var(--header-height) - var(--header-padding) * 1.25);
  z-index: 10;
  background: var(--text-dark);
  padding: var(--header-padding) 16px;
  text-align: center;
  border-bottom: 1px solid var(--topic-neutral);
}

.logo {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #fff;
}

/* Navigation Bar - sticky below headers, always visible */
.nav-bar {
  position: sticky;
  top: calc(var(--header-height) * 2 - var(--header-padding) * 1.25);
  z-index: 8;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  padding: 0 16px 0 0;
  background: var(--bg-warm);
  border-left: 1px solid var(--topic-neutral);
  border-right: 1px solid var(--topic-neutral);
  border-bottom: 1px solid var(--topic-neutral);
}

.nav-links-left {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.nav-link.nav-link-active {
  background: var(--topic-dominant);
  color: white;
}

.nav-link.nav-link-active:hover {
  color: white;
}

.nav-menu-button {
  display: flex;
  align-items: center;
  gap: 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 4px 0;
  line-height: 1;
}

.nav-menu-button:hover {
  color: var(--text-dark);
}

.nav-menu-button:hover .hamburger line {
  stroke: var(--text-dark);
}

.hamburger {
  width: 20px;
  height: 14px;
  margin-top: -3px;
}

.hamburger line {
  stroke: var(--text-muted);
  stroke-width: 1.5;
  stroke-linecap: square;
  transition: transform 0.3s, opacity 0.3s;
  transform-origin: center;
}

/* Hamburger Menu (CSS-only) */
.menu-toggle {
  display: none; /* Hidden checkbox */
}

.menu-button {
  cursor: pointer;
  padding: 4px 0;
  display: flex;
  align-items: center;
}

.menu-button .hamburger {
  width: 20px;
  height: 14px;
  stroke: var(--text-muted);
  stroke-width: 2;
}

.menu-button:hover .hamburger line {
  stroke: var(--text-dark);
}

/* Hamburger → X animation */
.menu-toggle:checked + .menu-button .hamburger line:nth-child(1) {
  transform: rotate(45deg) translate(3px, 3px);
}

.menu-toggle:checked + .menu-button .hamburger line:nth-child(2) {
  opacity: 0;
}

.menu-toggle:checked + .menu-button .hamburger line:nth-child(3) {
  transform: rotate(-45deg) translate(3px, -3px);
}

/* Menu overlay - dropdown from hamburger */
.menu-overlay {
  position: absolute;
  top: 100%;
  right: 0;
  width: 200px;
  background: var(--bg-warm);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  z-index: 100;
  border: 1px solid var(--topic-neutral);
  border-top: none;
}

.menu-toggle:checked ~ .menu-overlay {
  max-height: 400px;
}

/* Backdrop for click-outside-to-close */
.menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
}

.menu-toggle:checked ~ .menu-backdrop {
  display: block;
}

/* Menu content */
.menu-section {
  padding: 1rem 16px;
  border-bottom: 1px solid var(--topic-neutral);
}

.menu-section:last-child {
  border-bottom: none;
}

.menu-heading {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.menu-link {
  display: block;
  padding: 0.5rem 0;
  font-size: 14px;
  color: var(--text-dark);
  text-decoration: none;
  transition: color 0.2s;
}

.menu-link:hover {
  color: var(--topic-dominant);
}

.menu-link-active {
  background: var(--topic-dominant);
  color: white;
  font-weight: 600;
  padding: 0.5rem 16px;
  margin: 0 -16px;
}

.menu-link-active:hover {
  color: white;
}

.menu-link-all {
  font-weight: 700;
}

.menu-section-header {
  padding: 0.5rem 16px;
}

/* Event Section - wrapper for section header + event list */
.event-section {
  position: relative;
  border-left: 1px solid var(--topic-neutral);
  border-right: 1px solid var(--topic-neutral);
}

/* Close off the last event section with bottom border */
.event-section:last-child {
  border-bottom: 1px solid var(--topic-neutral);
}

/* Section Header - sticky below nav-bar */
/* All section headers stick at the same position, later ones overlap earlier */
.section-header {
  position: sticky;
  top: calc(var(--header-height) * 2 - var(--header-padding) * 1.25 + var(--nav-bar-height));
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 12px 12px;
  background: var(--bg-warm);
  border-bottom: 1px solid var(--topic-neutral);
}

/* Later section header - higher z-index to overlap earlier section header when stuck */
/* Natural stacking: when "Later Events" becomes sticky, it overlaps "Events This Week" */
/* Both have nav links at the same position - seamless takeover */
.section-header-later {
  z-index: 6;
}

.section-title {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dark);
  line-height: 1;
  /* Offset for uppercase text visual centering (no descenders) */
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
  display: flex;
  align-items: center;
  /* Consistent size for all links - prevents layout shift on selection */
  /* Vertical padding = section-header padding + 1px to account for section-title margin-top: 2px */
  padding: 13px 12px;
}

.nav-link:hover {
  color: var(--text-dark);
}

/* Event List */
.event-list {
  background: white;
  border-bottom: 1px solid var(--topic-neutral);
}

/* Event Card */
.event-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid var(--topic-neutral);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.event-card:hover {
  background: var(--bg-warm);
}

.event-card:last-child {
  border-bottom: none;
}

.event-img {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  background: var(--topic-dominant);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.event-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-img svg {
  width: 32px;
  height: 32px;
  opacity: 0.6;
}

.event-content {
  flex: 1;
  min-width: 0;
}

.event-row-top {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.event-row-top .location {
  flex: 1;
  text-align: center;
}

.event-title {
  font-size: 14px;
  font-weight: 600;
  margin: 5px 0;
  color: var(--text-dark);
}

.event-row-meta {
  font-size: 11px;
  color: var(--text-light);
}

/* Empty state */
.no-events {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  font-style: italic;
}

/* Content section (placeholder pages) */
.content-section {
  background: white;
  padding: 24px 16px;
  border-left: 1px solid var(--topic-neutral);
  border-right: 1px solid var(--topic-neutral);
  border-bottom: 1px solid var(--topic-neutral);
}

.content-section h2 {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.content-section p {
  color: var(--text-muted);
  line-height: 1.7;
}

/* Event detail page content - gold border framing */
.container > .event-card {
  border-left: 1px solid var(--topic-neutral);
  border-right: 1px solid var(--topic-neutral);
}

/* Description box (event detail page) */
.description-box {
  background: white;
  padding: 16px;
  line-height: 1.7;
  border-left: 1px solid var(--topic-neutral);
  border-right: 1px solid var(--topic-neutral);
  border-bottom: 1px solid var(--topic-neutral);
}

.description-box p {
  margin-bottom: 1em;
}

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

/* Register Now Button - inline, bottom right of description box */
.description-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5em;
}

.register-button {
  display: inline-block;
  padding: 10px 18px;
  background: var(--topic-dominant);
  color: white;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.register-button:hover {
  background: #4a8389;
}

/* Community card image - contains logo instead of teacher photo */
.community-img {
  background: var(--bg-warm);
}

.community-img img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

/* Landing page - single header means different sticky positioning */
.landing-page .nav-bar {
  top: var(--header-height);
}

.landing-page .section-header {
  top: calc(var(--header-height) + var(--nav-bar-height));
}

/* Desktop styles (768px+) */
@media (min-width: 768px) {
  :root {
    --header-height: 56px;
    --header-padding: 16px;
    --nav-bar-height: 43px; /* Must match actual rendered height for sticky stacking */
  }

  .container {
    max-width: 960px;
  }

  .header-top,
  .header-bottom {
    padding: var(--header-padding) 24px;
  }

  .logo {
    font-size: 16px;
    letter-spacing: 0.2em;
  }

  .banner img {
    height: min(33.33vw, 320px);
    max-height: 320px;
  }

  .section-header {
    padding: 13px 24px 13px 16px;
  }

  .section-title {
    font-size: 14px;
  }

  .nav-bar {
    padding: 0 24px 0 0;
  }

  .nav-links-left {
    gap: 0;
  }

  .nav-link {
    font-size: 14px;
    padding: 14px 16px;
  }

  .nav-menu-button {
    font-size: 12px;
  }

  /* 2-column flexbox on desktop - centers odd last card */
  .event-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--bg-warm); /* Cream background shows on sides of centered card */
  }

  /* 2-column card layout - only inside event-list, not standalone cards */
  .event-list .event-card {
    width: 50%;
    padding: 16px 20px;
    gap: 16px;
    border-right: 1px solid var(--topic-neutral);
  }

  /* Remove right border on right column (even cards) */
  .event-list .event-card:nth-child(2n) {
    border-right: none;
  }

  /* Remove bottom border on last two cards (full last row) */
  .event-list .event-card:nth-last-child(-n+2) {
    border-bottom: none;
  }

  /* Centered odd last card: add left/right borders, no bottom border */
  .event-list .event-card:nth-child(odd):last-child {
    border-left: 1px solid var(--topic-neutral);
    border-right: 1px solid var(--topic-neutral);
    border-bottom: none;
  }

  /* Card above-right of centered card needs bottom border */
  /* This is the second-to-last card when total is odd (even-indexed) */
  .event-list .event-card:nth-child(even):nth-last-child(2) {
    border-bottom: 1px solid var(--topic-neutral);
  }

  /* Standalone card on detail pages - full width with bottom border */
  .container > .event-card {
    padding: 16px 20px;
    gap: 16px;
  }

  .event-img {
    width: 64px;
    height: 64px;
  }

  .event-img svg {
    width: 36px;
    height: 36px;
  }

  .event-row-top {
    font-size: 12px;
    gap: 12px;
  }

  .event-title {
    font-size: 15px;
    margin: 6px 0;
  }

  .event-row-meta {
    font-size: 12px;
  }

  .description-box {
    padding: 24px;
    font-size: 15px;
  }

  .register-button {
    padding: 12px 24px;
    font-size: 13px;
  }
}
