/* Hmm Love Walking — mobile-first portal mockup
   Soft lifestyle hiking portal · max-width app shell */

:root {
  --bg-top: #fff5eb;
  --bg-bottom: #fde8d8;
  --surface: #ffffff;
  --text: #3d3028;
  --text-muted: #8a7568;
  --accent: #e07a3a;
  --accent-dark: #c8612a;
  --hero-start: #ffb347;
  --hero-mid: #ff7e5f;
  --hero-end: #d45d79;
  --shadow: 0 8px 24px rgba(120, 70, 40, 0.12);
  --shadow-sm: 0 4px 12px rgba(120, 70, 40, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --max-width: 430px;
  --nav-height: 70px;
  --easy: #4caf7d;
  --medium: #f0a030;
  --hard: #e05555;
  --open: #4caf7d;
  --full: #9e9e9e;
  --cancelled: #e05555;
  --completed: #6b8fbd;
}

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

html {
  scroll-behavior: smooth;
}

html:has(body[data-page="home"]) {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body[data-page="calendar"],
body[data-page="event"],
body[data-page="home"] {
  overflow: hidden;
}

body[data-page="home"] {
  height: 100%;
  height: 100dvh;
}

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

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

/* App shell — centered mobile container on desktop */
.app-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  padding: 1rem 1rem calc(var(--nav-height) + 1.75rem);
}

.page-header {
  margin-bottom: 1.25rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Hero card */
.hero {
  background: linear-gradient(135deg, var(--hero-start), var(--hero-mid), var(--hero-end));
  border-radius: var(--radius);
  padding: 1.5rem;
  color: #fff;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.hero__weather {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.hero__title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero__subtitle {
  font-size: 0.9rem;
  opacity: 0.92;
  margin-top: 0.35rem;
}

/* Home — fixed hero + scrollable event stack */
.app-shell--home {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0.65rem 1rem 0;
  overflow: hidden;
}

.home-fixed-top {
  flex-shrink: 0;
  z-index: 40;
  padding-bottom: 0.65rem;
  background: linear-gradient(
    180deg,
    var(--bg-top) 0%,
    var(--bg-top) 82%,
    rgba(255, 245, 235, 0.98) 100%
  );
  box-shadow: 0 6px 16px rgba(120, 70, 40, 0.06);
}

.hero--home {
  margin-bottom: 0;
  padding: 1.1rem 1.2rem 1.1rem;
  position: relative;
}

/* Language switch — shared across portal pages */
.language-switch {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.hero--home .language-switch {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
}

.banner-countdown {
  position: absolute;
  right: 26px;
  top: 48px;
  width: 96px;
  padding: 0;
  background: transparent;
  border: none;
  text-align: center;
  color: #fff;
  line-height: 1.12;
  overflow: visible;
  box-sizing: border-box;
  z-index: 6;
}

.banner-countdown .count-main {
  display: block;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.banner-countdown .count-main::before {
  content: "✦ ";
  color: #ffe66d;
  font-size: 9px;
}

.banner-countdown .count-days {
  display: block;
  margin-top: 3px;
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
  letter-spacing: -0.5px;
  color: #fff;
  transform-origin: center center;
  animation: countdownBreath 2.2s ease-in-out infinite;
}

@keyframes countdownBreath {
  0%, 100% {
    transform: scale(1);
    opacity: 0.88;
    text-shadow:
      0 1px 3px rgba(0, 0, 0, 0.28),
      0 0 5px rgba(255, 255, 255, 0.25),
      0 0 8px rgba(255, 230, 109, 0.20);
  }

  50% {
    transform: scale(1.12);
    opacity: 1;
    text-shadow:
      0 1px 4px rgba(0, 0, 0, 0.35),
      0 0 10px rgba(255, 255, 255, 0.55),
      0 0 18px rgba(255, 230, 109, 0.55);
  }
}

.hero--home .hero__title {
  font-size: 1.45rem;
  padding-right: 6.5rem;
}

.hero--home .hero__subtitle {
  padding-right: 5.5rem;
}

@media (max-width: 380px) {
  .banner-countdown {
    right: 22px;
    top: 50px;
    width: 90px;
  }

  .banner-countdown .count-main {
    font-size: 9px;
  }

  .banner-countdown .count-days {
    font-size: 18px;
  }

  .hero--home .hero__title {
    padding-right: 5.75rem;
  }

  .hero--home .hero__subtitle {
    padding-right: 5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .banner-countdown .count-days {
    animation: none;
  }
}

.lang-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: none;
  background: #111;
  color: #fff;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  min-width: 28px;
  min-height: 24px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.lang-chip.is-active {
  background: #e66b24;
}

.lang-chip:active {
  opacity: 0.85;
}

.lang-chip:focus {
  outline: 2px solid rgba(230, 107, 36, 0.45);
  outline-offset: 2px;
}

.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 10px;
}

.page-topbar-end {
  justify-content: flex-end;
}

.page-topbar .detail-back {
  margin-bottom: 0;
  flex-shrink: 0;
}

.hero--home .hero__weather {
  margin-bottom: 0.55rem;
  font-size: 0.75rem;
  padding: 0.28rem 0.65rem;
}

.home-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(var(--nav-height) + 1.5rem);
  scroll-padding-bottom: calc(var(--nav-height) + 0.5rem);
}

.home-scroll-area .section-heading {
  margin-top: 0.25rem;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1rem;
}

.card--padded {
  padding: 1.1rem 1.15rem;
}

.card__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.card__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.card__text {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Home — physical event card deck */
.event-stack-section {
  margin-bottom: 0.5rem;
}

.event-deck {
  --deck-overlap: 20px;
  --deck-strip-height: 64px;
  position: relative;
  width: 100%;
  padding-bottom: 0.5rem;
  overflow: visible;
}

.event-deck--animating .deck-card:not(.is-picking) {
  transition: margin-top 0.32s ease, box-shadow 0.32s ease, opacity 0.32s ease, transform 0.32s ease;
}

.deck-card.is-picking {
  z-index: 60 !important;
  pointer-events: none;
  animation: pickCardToFront 480ms cubic-bezier(0.22, 0.78, 0.24, 1) both;
  box-shadow:
    0 18px 36px rgba(80, 40, 20, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

@keyframes pickCardToFront {
  0% {
    transform: translateY(calc(var(--deck-overlap) * var(--deck-pos, 1) + 6px))
      scale(calc(1 - var(--deck-pos, 1) * 0.025));
    opacity: 0.96;
  }
  40% {
    transform: translateY(72px) scale(0.97);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.deck-card {
  position: relative;
  width: 100%;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(120, 80, 50, 0.18);
  box-shadow:
    0 10px 24px rgba(80, 40, 20, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  overflow: hidden;
  transition: margin-top 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.deck-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 6%;
  right: 6%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  z-index: 2;
  pointer-events: none;
}

.deck-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

/* Top full card */
.deck-card--top {
  z-index: 58;
  margin-top: 0;
  cursor: default;
}

.deck-card--top .deck-card__inner {
  height: auto;
}

/* Compact strip cards underneath */
.deck-card--compact {
  z-index: calc(57 - var(--deck-pos, 1));
  margin-top: calc(-1 * var(--deck-overlap));
  min-height: var(--deck-strip-height);
  cursor: pointer;
  transform: translateY(calc(var(--deck-pos, 1) * 2px)) scale(calc(1 - var(--deck-pos, 1) * 0.012));
  box-shadow:
    0 10px 22px rgba(80, 40, 20, 0.09),
    0 -3px 0 rgba(120, 80, 50, 0.07) inset,
    0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

.deck-card--compact:active {
  opacity: 0.94;
  transform: scale(0.995);
}

.deck-card--compact:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.deck-card__cover.event-card__cover {
  height: 108px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.deck-card__cover.active-card-image {
  position: relative;
}

.image-action-button {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  padding: 0.5rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  min-height: 36px;
  width: auto;
  flex: none;
  border-radius: 999px;
  white-space: nowrap;
}

.deck-card__body {
  padding: 0.75rem 1rem 0.85rem;
}

.active-card-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: end;
}

.active-card-main {
  min-width: 0;
}

.active-card-side-actions {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  padding-bottom: 0.1rem;
}

.view-detail-small {
  white-space: nowrap;
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  min-height: 40px;
  flex: none;
  width: auto;
}

.event-main-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  margin-bottom: 0.35rem;
}

.event-title-time-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.event-title {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.event-date-time {
  white-space: nowrap;
  text-align: right;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.deck-card__title.event-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.deck-card__meeting {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  line-height: 1.35;
}

.deck-card__desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0;
}

.badge--deck-diff {
  min-width: 48px;
  width: 48px;
  padding: 0.28rem 0.2rem;
  text-align: center;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* Visible strip for compact cards */
.deck-card__strip {
  min-height: var(--deck-strip-height);
  padding: 0.55rem 0.85rem;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.98);
}

.deck-card--compact .deck-card__strip {
  border-top: 1px solid rgba(120, 80, 50, 0.14);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    0 -2px 8px rgba(80, 40, 20, 0.05);
}

.deck-card__strip-title.event-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.deck-card__strip-meta.event-date-time {
  font-size: 0.74rem;
}

/* No-JS: vertical list fallback */
.no-js .event-deck {
  min-height: 0;
}

.no-js .deck-card--compact {
  margin-top: 0 !important;
  margin-bottom: 0.75rem !important;
  min-height: 0 !important;
  cursor: default;
}

.no-js .deck-card--compact .deck-card__strip {
  display: none !important;
}

/* Event cards */
.event-card__cover {
  height: 140px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.event-card__cover--gradient-1 {
  background-image: linear-gradient(135deg, #ffb347 0%, #ffcc80 40%, #87ceeb 100%);
}

.event-card__cover--gradient-2 {
  background-image: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.event-card__cover--gradient-3 {
  background-image: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

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

.event-card__body {
  padding: 1rem 1.1rem 1.1rem;
}

.event-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.event-card__date {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.event-card__location {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
}

.event-card__actions {
  display: flex;
  gap: 0.5rem;
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  color: #fff;
}

.badge--easy { background: var(--easy); }
.badge--medium { background: var(--medium); }
.badge--hard { background: var(--hard); }
.badge--open { background: var(--open); }
.badge--full { background: var(--full); }
.badge--cancelled { background: var(--cancelled); }
.badge--completed { background: var(--completed); }
.badge--neutral { background: #aaa; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  text-align: center;
  flex: 1;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(224, 122, 58, 0.35);
}

.btn--secondary {
  background: #f5ebe3;
  color: var(--text);
}

.btn--outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.btn--block {
  width: 100%;
  flex: none;
}

.btn--sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  flex: none;
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Section headings */
.section-heading {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.25rem 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-heading__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Event detail — sticky top + scrollable body */
.app-shell--detail {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-height));
  height: calc(100dvh - var(--nav-height));
  max-height: calc(100dvh - var(--nav-height));
  padding-bottom: 0;
  overflow: hidden;
}

.detail-sticky {
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-top) 85%, transparent 100%);
  z-index: 30;
  padding-bottom: 0.5rem;
}

.detail-back {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0));
}

.detail-hero {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0;
  box-shadow: var(--shadow);
}

.detail-hero__cover {
  height: 150px;
  background-size: cover;
  background-position: center;
}

.detail-hero__body {
  background: var(--surface);
  padding: 0.9rem 1rem;
}

.event-hero-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.event-hero-main {
  min-width: 0;
}

.detail-hero__title {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.3rem;
}

.detail-hero__datetime {
  margin-bottom: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.event-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  flex-shrink: 0;
  min-width: 76px;
  max-width: 88px;
}

.event-hero-actions .event-action-small {
  font-size: 11px;
  line-height: 1.1;
  padding: 7px 9px;
  min-height: 36px;
  width: 100%;
  flex: none;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
  box-shadow: none;
}

.event-hero-actions .btn--primary.event-action-small {
  box-shadow: 0 2px 8px rgba(224, 122, 58, 0.28);
}

.event-hero-actions .btn--secondary.event-action-small {
  background: #f5ebe3;
}

.event-hero-actions .btn.is-disabled {
  opacity: 0.55;
  background: #ebe4dc;
  color: var(--text-muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.detail-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.detail-item__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.detail-item__value {
  font-size: 0.9rem;
  font-weight: 600;
}

.detail-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.detail-section h3 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.detail-section p,
.detail-section li {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.detail-section ul {
  padding-left: 1.1rem;
}

.detail-section li {
  margin-bottom: 0.25rem;
}

.detail-section--safety {
  border-left: 3px solid var(--accent);
}

.detail-map-link {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.detail-map-image {
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
  cursor: zoom-in;
}

.event-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.event-photo-grid__item {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: #f5ebe3;
}

/* Not found */
.not-found {
  text-align: center;
  padding: 3rem 1rem;
}

.not-found__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.not-found__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.not-found__text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Calendar — fixed grid + scrollable list */
.app-shell--calendar {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-height));
  height: calc(100dvh - var(--nav-height));
  padding-bottom: 0;
  overflow: hidden;
}

.calendar-layout__fixed {
  flex-shrink: 0;
}

.calendar-layout__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--nav-height) * 0.25 + 0.5rem);
}

.page-header--compact {
  margin-bottom: 0.75rem;
}

.page-header--compact .page-title {
  font-size: 1.25rem;
}

.section-heading--compact {
  margin: 0.5rem 0 0.65rem;
  font-size: 0.9rem;
}

.calendar-event-card,
.calendar-event-row {
  display: block;
  padding: 0.75rem 0.9rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.5rem;
  transition: transform 260ms ease, opacity 260ms ease, box-shadow 260ms ease;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.calendar-event-card.calendar-event-opening {
  transform: scale(1.08);
  opacity: 0.92;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  z-index: 20;
}

.calendar-event-row .event-main-row {
  margin-bottom: 0;
}

.calendar-title-time-row .event-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.calendar-title-time-row .event-date-time {
  font-size: 11px;
}

.calendar-grid {
  margin-bottom: 0.5rem;
}

/* Calendar */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.calendar-header__title {
  font-size: 1.1rem;
  font-weight: 700;
}

.calendar-header__nav {
  display: flex;
  gap: 0.35rem;
}

.calendar-header__btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.85rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.calendar-grid__day-name {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0.25rem 0;
}

.calendar-grid__cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 10px;
  cursor: default;
  position: relative;
  min-height: 38px;
}

.calendar-grid__cell.is-other-month {
  color: #ccc;
}

.calendar-grid__cell.is-today {
  background: rgba(224, 122, 58, 0.15);
  color: var(--accent-dark);
  font-weight: 700;
}

.calendar-grid__cell.has-event {
  cursor: pointer;
}

.calendar-grid__cell.has-event:hover {
  background: rgba(224, 122, 58, 0.1);
}

.calendar-grid__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 2px;
}

.calendar-grid__cell.is-selected {
  background: var(--accent);
  color: #fff;
}

.calendar-grid__cell.is-selected .calendar-grid__dot {
  background: #fff;
}

/* Album — per-event cover + photo grid */
.album-event-block {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.album-event-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: #f5ebe3;
}

.album-event-title {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.9rem 1rem 0.25rem;
}

.album-event-datetime {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0 1rem 0.35rem;
}

.album-event-status {
  display: inline-block;
  margin: 0 1rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #f5ebe3;
  color: var(--text-muted);
}

.album-event-status--upcoming {
  background: #e8f5e9;
  color: #2e6b3a;
}

.album-event-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0 1rem 1rem;
  margin: 0;
  line-height: 1.45;
}

.album-event-cover-link {
  display: block;
}

.album-event-block--cover-only .album-event-cover {
  cursor: pointer;
}

.album-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  padding: 0 0.85rem 1rem;
}

.album-photo-tile {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #f5ebe3;
}

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

/* Image lightbox */
.image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 8, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.image-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.image-lightbox__img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.image-lightbox__close {
  position: absolute;
  top: calc(0.75rem + env(safe-area-inset-top, 0));
  right: 0.75rem;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

/* Admin (V1 hardcoded login) */
.join-event-summary,
.join-form-card {
  margin-bottom: 1rem;
}

.join-form-note,
.join-disabled-note {
  color: var(--text-muted);
}

.admin-login-card {
  max-width: 360px;
  margin: 0 auto;
}

.admin-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-filter-tab {
  padding: 8px 14px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.admin-filter-tab--active {
  background: #B80F18;
  color: #fff;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.admin-form__label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.admin-form__input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(120, 80, 50, 0.22);
  border-radius: 12px;
  font-size: 0.95rem;
  background: #fff;
}

.admin-form__submit {
  margin-top: 0.35rem;
}

.admin-login-note {
  margin-top: 1rem;
  text-align: center;
}

.admin-alert {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
}

.admin-alert--error {
  background: #fde8e8;
  color: #8b2e2e;
  border: 1px solid #f0b4b4;
}

.admin-alert--success {
  background: #e8f5e9;
  color: #2e6b3a;
  border: 1px solid #b4e0bc;
  margin-bottom: 1rem;
}

.form-optional {
  font-weight: 400;
  color: var(--text-muted);
}

.admin-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.admin-subnav__link {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.admin-subnav__link.is-active {
  background: #e66b24;
  color: #fff;
}

.admin-inline-form {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}

.admin-section-label {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0.85rem 0 0.4rem;
}

.admin-file-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
}

.admin-file-list li {
  padding: 0.2rem 0;
}

.admin-file-list--obsolete {
  color: var(--text-muted);
}

.admin-event-block {
  margin-bottom: 1rem;
}

.admin-event-block__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.admin-event-block__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.admin-event-block__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.admin-stat-pill {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(224, 122, 58, 0.14);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-stat-pill--muted {
  background: #f0ebe6;
  color: var(--text-muted);
}

.admin-empty {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.admin-table th,
.admin-table td {
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid rgba(120, 80, 50, 0.12);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.admin-footer-link {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
}

/* Login placeholder */
.login-placeholder {
  text-align: center;
}

.login-placeholder__icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* Safety page (legacy file, not in nav) */
.safety-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.safety-card__icon {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.safety-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.safety-card p,
.safety-card li {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.safety-card ul {
  padding-left: 1.1rem;
}

.safety-card li {
  margin-bottom: 0.2rem;
}

.safety-levels {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.safety-level {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.safety-level .badge {
  min-width: 62px;
  text-align: center;
}

/* Bottom navigation — outline SVG icons, no item boxes */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  background: rgba(255, 239, 224, 0.88);
  box-shadow: none;
  border-top: none;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0));
  z-index: 1000;
}

.bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
}

.bottom-nav-inner.mr-hmm-nav-inner {
  grid-template-columns: 1fr 1fr auto 1fr 1fr;
  align-items: end;
}

.bottom-nav.mr-hmm-nav-elevated {
  z-index: 10000;
}

.nav-item {
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  color: #111;
  min-height: 48px;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}

.nav-svg {
  width: 24px;
  height: 24px;
  color: inherit;
}

.nav-svg path,
.nav-svg rect,
.nav-svg circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  font-size: 11px;
  line-height: 1;
  color: inherit;
}

.nav-item.active {
  color: #e66b24;
  font-weight: 700;
}

.nav-item:hover,
.nav-item:focus,
.nav-item:focus-visible {
  background: transparent;
  color: #111;
  outline: none;
}

.nav-item.active:hover,
.nav-item.active:focus {
  color: #e66b24;
}

body.has-bottom-nav {
  padding-top: max(16px, env(safe-area-inset-top, 0px));
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0));
}

body.has-bottom-nav .app-shell {
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
}

body.has-bottom-nav[data-page="member"] .app-shell--admin {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0));
}

body.has-bottom-nav[data-page="home"] {
  padding-top: 0;
}

body.has-bottom-nav[data-page="home"] .home-fixed-top {
  padding-top: max(16px, env(safe-area-inset-top, 0px));
}

body.has-bottom-nav[data-page="home"] .app-shell--home {
  padding-top: 0;
}

@media (min-width: 480px) {
  body.has-bottom-nav:not([data-page="home"]) {
    padding-top: max(12px, env(safe-area-inset-top, 0px));
  }

  body.has-bottom-nav[data-page="home"] .home-fixed-top {
    padding-top: max(12px, env(safe-area-inset-top, 0px));
  }
}

html.quick-home body,
body.quick-home {
  overflow: hidden;
}

/* Loading state for JS-rendered sections */
.loading-placeholder {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Desktop: keep mobile feel, centered */
@media (min-width: 480px) {
  .app-shell:not(.app-shell--home) {
    padding-top: 0.75rem;
  }

  body {
    background: linear-gradient(180deg, #f0e4d8 0%, var(--bg-bottom) 30%, var(--bg-bottom) 100%);
  }

  .app-shell {
    background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    box-shadow: 0 0 60px rgba(120, 70, 40, 0.08);
    min-height: 100vh;
  }

  .app-shell--home {
    height: 100dvh;
    max-height: 100dvh;
  }
}
