/* Community — one place for /community (Community, Classroom, Calendar). Lemonade-style theme. */

.community-page {
  --community-band: var(--band-community, oklch(85.39% 0.201 100.73)); /* uses palette token from shared.css */
  --community-band-text: oklch(var(--pc));
  --community-pill: oklch(var(--a));
  --community-pill-text: oklch(var(--ac));
  /* Cream palette overrides — keep the community page in the same warm
     hue family as the rest of the site. */
  --community-inner-bg: var(--cream-soft, #FDFAF3);
  --community-section-bg: var(--cream-warm, #F2E9D5);
}

/* Ensure prose and card content use theme foreground (readable in dark mode).
   !important overrides Tailwind typography plugin and fixed .trix-content color. */
.community-page .prose,
.community-page .prose p,
.community-page .prose li,
.community-page .prose h1,
.community-page .prose h2,
.community-page .prose h3,
.community-page .prose blockquote,
.social-post-show-page .prose,
.social-post-show-page .prose p,
.social-post-show-page .prose li,
.social-post-show-page .prose h1,
.social-post-show-page .prose h2,
.social-post-show-page .prose h3,
.social-post-show-page .prose blockquote {
  color: oklch(var(--bc)) !important;
}
.community-page .prose a,
.social-post-show-page .prose a {
  color: oklch(var(--p));
}
.community-page .community-feed-card .card-body {
  color: oklch(var(--bc));
}

/* Trix/Action Text post body: force theme foreground (actiontext.css sets #1f2937 otherwise) */
.community-page .trix-content,
.community-page .prose .trix-content,
.social-post-show-page .trix-content {
  color: oklch(var(--bc)) !important;
}
.community-page .trix-content a,
.social-post-show-page .trix-content a {
  color: oklch(var(--p));
}

/* Hero: title + search on page background */
.community-page .community-hero {
  background: transparent;
  color: inherit;
  margin-top: 1rem;
}
.community-page .community-hero__container {
  padding-top: 0.625rem;
  padding-bottom: 0.5rem;
}
.community-page .community-hero__bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.community-page .community-hero__title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: oklch(var(--bc));
  margin: 0;
  line-height: 1.15;
  text-align: center;
}
@media (min-width: 768px) {
  .community-page .community-hero__title { font-size: 1.75rem; }
}
.community-page .community-hero__search {
  flex-shrink: 0;
  min-width: 11rem;
}
.community-page .community-hero__search .form-control { width: 100%; }
.community-page .community-hero__search .input-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
}
.community-page .community-hero__search .input-group .input {
  flex: 1 1 auto;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  background: var(--community-inner-bg);
  border-color: oklch(var(--b3));
  font-size: 0.8125rem;
}
.community-page .community-hero__search .input-group .btn {
  flex-shrink: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  background: oklch(var(--p));
  color: oklch(var(--pc));
  border: none;
}
.community-page .community-hero__foot-link {
  display: block;
  font-size: 0.6875rem;
  color: oklch(var(--bc) / 0.7);
  margin-top: 0.375rem;
  text-decoration: none;
}
.community-page .community-hero__foot-link:hover { color: oklch(var(--p)); }

/* Main band + header (section title, search) */
.community-page .community-main-band {
  border-radius: 1rem;
  padding: 1rem 2rem 1rem;
  /* Softer editorial shadow — no more heavy green glow. */
  box-shadow:
    0 1px 2px rgba(42, 36, 25, 0.04),
    0 6px 20px rgba(42, 36, 25, 0.06);
}
.community-page .community-band-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.community-page .community-band-header__title {
  font-size: clamp(1.25rem, 4.5vw, 1.625rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}
.community-page .community-band-header__search {
  flex-shrink: 0;
  width: 100%;
  max-width: 12rem;
}
.community-page .community-band-header__search .form-control { width: 100%; }
.community-page .community-band-header__search .input-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
}
.community-page .community-band-header__search .input-group .input,
.community-page .community-band-header__search input.community-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-color: oklch(var(--b3));
}
.community-page .community-band-header__search input.community-search-input {
  background: oklch(var(--b1)) !important; /* override DaisyUI input */
}
.community-page .community-band-header__search .input-group .btn {
  flex-shrink: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  background: oklch(var(--p));
  color: oklch(var(--pc));
  border: none;
}
.community-page .community-main-inner {
  border-radius: 0.75rem;
  padding: 2rem 1.5rem 1.25rem;
  /* Hairline cream border instead of heavy primary-tinted border. */
  border: 1px solid #E8DFC9;
  box-shadow: 0 1px 2px rgba(42, 36, 25, 0.03);
}
@media (max-width: 767px) {
  .community-page .community-main-container { padding-left: 0.5rem; padding-right: 0.5rem; }
  .community-page .community-main-band { padding: 1.25rem 0.5rem 0.75rem; }
  .community-page .community-band-header { margin-bottom: 0.75rem; }
  .community-page .community-main-inner { padding: 1.25rem 0.5rem 0.75rem; }
}

/* Post form: match section background */
.community-page #post-form-container .card { background: var(--community-section-bg); }
.community-page #post-form-container .card .social-feed-input,
.community-page #post-form-container .card .social-feed-input trix-editor {
  background: oklch(var(--b1)) !important;
}
.community-page #post-form-container .social-feed-input {
  border-radius: 0.5rem !important;
  overflow: hidden !important;
}

/* Tabs (Community / Classroom / Calendar) */
.community-page .community-tabs {
  margin-bottom: 1.25rem;
  display: flex;
  width: auto;
  max-width: 28rem;
  margin-right: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.community-page .community-tabs .tab {
  color: oklch(var(--bc) / 0.85);
  font-weight: 600;
  font-size: 0.8125rem;
  border-radius: 0.5rem;
  padding: 0.5rem 0.35rem;
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  text-align: center;
}
.community-page .community-tabs .tab span { white-space: nowrap; }
@media (min-width: 768px) {
  .community-page .community-tabs .tab { font-size: inherit; padding: 0.5rem 1rem; gap: 0.5rem; }
}
.community-page .community-tabs .tab:hover {
  color: oklch(var(--p));
  background: oklch(var(--p) / 0.12);
  border-color: oklch(var(--p) / 0.25);
}
.community-page .community-tabs .tab.tab-active {
  background: oklch(var(--a));
  color: oklch(var(--ac));
  border-color: transparent;
}

/* Cards — cream fill, hairline cream border, no heavy accent */
.community-page .community-card {
  background: var(--community-inner-bg);
  border: none;
  border-radius: 0.75rem;
  box-shadow:
    inset 0 0 0 1px var(--cream-border, #E8DFC9),
    0 1px 2px rgba(0, 0, 0, 0.12);
}
/* The "accent" variant (About / Community Rules) gets a thinner
   cream-warm top stripe instead of a full primary green stripe. */
.community-page .community-card-accent {
  border-top: 1px solid var(--cream-border, #E8DFC9);
}
.community-page .community-link-muted { color: rgba(255, 255, 255, 0.85); }
.community-page .community-link-muted:hover { color: var(--community-pill); }

/* Feed filter pills */
.community-feed-filters__pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.community-feed-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  /* Inactive pills: transparent with cream-ink text, hairline cream border.
     Blend into the bg instead of shouting with a primary-tinted outline. */
  color: var(--cream-muted, rgba(42, 36, 25, 0.75));
  background: transparent;
  border: 1px solid var(--cream-border, #E8DFC9);
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.community-feed-pill:hover {
  background: var(--cream-warm, rgba(242, 233, 213, 0.6));
  border-color: var(--cream-border, rgba(42, 36, 25, 0.2));
  color: var(--cream-ink, #2A2419);
}
.community-feed-pill--active,
.community-feed-pill[aria-pressed="true"] {
  background: oklch(var(--p) / 0.15);
  color: oklch(var(--p));
  border-color: oklch(var(--p) / 0.4);
  font-weight: 600;
}
.community-feed-pill--active:hover,
.community-feed-pill[aria-pressed="true"]:hover {
  background: oklch(var(--p) / 0.2);
  border-color: oklch(var(--p) / 0.5);
  color: oklch(var(--p));
}
.community-feed-pill__icon { font-style: normal; line-height: 1; }
.community-feed-pill--icon-only { padding: 0.5rem; }

/* Topic links (Classroom sidebar) */
.community-topic-link {
  display: block;
  font-size: 0.8125rem;
  color: oklch(var(--bc) / 0.85);
  text-decoration: none;
  transition: color 0.15s;
}
.community-topic-link:hover { color: oklch(var(--p)); }
.community-page .community-card-accent .community-topic-link:hover { color: oklch(var(--p)); }

/* Feed well + post cards */
.community-feed-well {
  background: rgba(253, 250, 243, 0.6);
  border-radius: 0.75rem;
  padding: 1rem;
  border: 1px solid #E8DFC9;
}
.community-page .community-feed-posts .community-feed-post-item .community-feed-card,
.community-page .community-feed-card {
  background: var(--cream-soft, #FDFAF3);
  border: 1px solid var(--cream-border, rgba(42, 36, 25, 0.08)) !important;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.community-page .community-feed-posts .community-feed-post-item .community-feed-card:hover {
  border-color: var(--cream-border, rgba(42, 36, 25, 0.16)) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Classroom tab */
.community-classroom__heading {
  font-size: 1rem;
  font-weight: 700;
  color: oklch(var(--bc) / 0.9);
  margin: 0 0 0.75rem 0;
  letter-spacing: -0.01em;
}
.community-classroom__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  background: oklch(var(--b2));
  border: 1px solid oklch(var(--b3));
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: oklch(var(--bc));
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.community-classroom__pill:hover {
  background: oklch(var(--b3) / 0.8);
  border-color: oklch(var(--p) / 0.3);
  color: oklch(var(--p));
}

/* Calendar tab — empty state */
.community-page .community-calendar-empty {
  background: oklch(var(--b2) / 0.5);
  border-radius: 0.75rem;
  border: 1px dashed oklch(var(--b3));
}

/* Feed list view */
.community-feed-list-wrap {
  background: oklch(var(--b2) / 0.4);
  border: 1px solid oklch(var(--b3) / 0.6);
}
.community-feed-list { list-style: none; margin: 0; padding: 0; }
.community-feed-list__row {
  display: flex;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  text-decoration: none;
  color: inherit;
  background: var(--community-inner-bg, oklch(var(--b1)));
  border-bottom: 1px solid oklch(var(--b3) / 0.4);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.community-feed-list__row:last-child { border-bottom: none; }
.community-feed-list__row:hover {
  background: oklch(var(--b1) / 0.98);
  box-shadow: 0 1px 3px oklch(var(--bc) / 0.06);
}
.community-feed-list__avatar { flex-shrink: 0; }
.community-feed-list__body { min-width: 0; }

/* Blank slate */
.community-blank-slate {
  background: var(--community-inner-bg, oklch(var(--b1)));
  border-radius: 0.5rem;
  border: 2px dashed oklch(var(--b3));
  color: oklch(var(--bc) / 0.8);
  font-weight: 500;
  padding: 2rem 1.5rem;
  text-align: center;
}

/* ——— Calendar (month + list) ——— */
.community-calendar { width: 100%; min-height: 0; }
.community-calendar__card {
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 1rem 1.25rem;
  border: 1px solid oklch(var(--b3) / 0.5);
}
.community-calendar__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.community-calendar__today-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: oklch(var(--b2));
  color: oklch(var(--bc));
  border: 1px solid oklch(var(--b3));
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.community-calendar__today-btn:hover {
  background: oklch(var(--b3));
  border-color: oklch(var(--b3));
}
.community-calendar__header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.community-calendar__month-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 12rem;
}
.community-calendar__month-row .community-calendar__month-year {
  flex: 1;
  text-align: center;
}
.community-calendar__month-year {
  font-size: 1.25rem;
  font-weight: 600;
  color: oklch(var(--bc));
}
.community-calendar__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.community-calendar__nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  color: oklch(var(--bc) / 0.8);
  border-radius: 0.375rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.community-calendar__nav-btn:hover {
  background: oklch(var(--b3));
  color: oklch(var(--bc));
}
.community-calendar__timezone {
  font-size: 0.75rem;
  color: oklch(var(--bc) / 0.6);
  margin: 0;
}
.community-calendar__view-toggles {
  display: flex;
  gap: 0.125rem;
  padding: 0.25rem;
  background: oklch(var(--b2));
  border-radius: 0.5rem;
  border: 1px solid oklch(var(--b3));
}
.community-calendar__view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  color: oklch(var(--bc) / 0.7);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.community-calendar__view-btn:hover {
  background: oklch(var(--b3));
  color: oklch(var(--bc));
}
.community-calendar__view-btn--active {
  background: oklch(var(--b3));
  color: oklch(var(--p));
}

/* Calendar list view */
.community-calendar-list { margin-top: 0.5rem; }
.community-calendar-list__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.community-calendar-list__item { margin: 0; }
.community-calendar-list__card {
  display: flex;
  align-items: stretch;
  gap: 0;
  text-decoration: none;
  color: inherit;
  background: oklch(var(--b2) / 0.5);
  border: 1px solid oklch(var(--b3));
  border-radius: 0.75rem;
  overflow: hidden;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  min-height: 5rem;
}
.community-calendar-list__card:hover {
  background: oklch(var(--b3) / 0.5);
  border-color: oklch(var(--p) / 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.community-calendar-list__thumb {
  width: 6rem;
  min-width: 6rem;
  background: oklch(var(--b3) / 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem 0 0 0.75rem;
}
.community-calendar-list__thumb-icon { font-size: 1.75rem; opacity: 0.8; }
.community-calendar-list__body {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.125rem;
}
.community-calendar-list__when {
  font-size: 0.75rem;
  color: oklch(var(--bc) / 0.65);
  margin: 0;
}
.community-calendar-list__title {
  font-size: 1rem;
  font-weight: 600;
  color: oklch(var(--bc));
  margin: 0;
  line-height: 1.3;
}
.community-calendar-list__meta {
  font-size: 0.6875rem;
  color: oklch(var(--bc) / 0.55);
  margin: 0;
}
.community-calendar-list__count {
  font-size: 0.75rem;
  color: oklch(var(--bc) / 0.6);
  margin: 0.75rem 0 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid oklch(var(--b3));
}
.community-calendar-list__empty {
  font-size: 0.875rem;
  color: oklch(var(--bc) / 0.6);
  margin: 0;
  padding: 1.5rem 0;
  text-align: center;
}

/* Month grid */
.community-calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.125rem;
  margin-bottom: 0.375rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid oklch(var(--b3));
}
.community-calendar__weekday {
  font-size: 0.75rem;
  font-weight: 600;
  color: oklch(var(--bc) / 0.7);
  text-align: center;
}
.community-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.125rem;
}
.community-calendar__cell {
  min-height: 4.5rem;
  min-width: 0;
  padding: 0.25rem;
  border-radius: 0.25rem;
}
@media (max-width: 767px) {
  .community-page .community-calendar__card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .community-calendar__weekdays { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .community-calendar__grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .community-calendar__cell { min-height: 3.5rem; }
}
.community-calendar__cell--other-month .community-calendar__date-num {
  color: oklch(var(--bc) / 0.4);
}
.community-calendar__cell-inner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  height: 100%;
  min-width: 0;
}
.community-calendar__date-num {
  font-size: 0.875rem;
  font-weight: 500;
  color: oklch(var(--bc) / 0.8);
  flex-shrink: 0;
}
.community-calendar__date-num--today {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-weight: 600;
}
.community-calendar__event {
  font-size: 0.75rem;
  color: oklch(var(--p));
  text-decoration: none;
  display: block;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.125rem 0;
  border-radius: 0.25rem;
  transition: background 0.15s, color 0.15s;
}
.community-calendar__event:hover {
  color: oklch(var(--p));
  background: oklch(var(--p) / 0.08);
  text-decoration: underline;
}
.community-calendar__event-time { font-weight: 500; }

/* Event modal */
.community-event-modal__box {
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Scrollable body so day content can scroll when taller than viewport */
.community-event-modal__scroll {
  min-height: 0; /* allow flex child to shrink below content size */
  -webkit-overflow-scrolling: touch;
}
.community-event-modal__box [data-slot="day-modal-content"] {
  padding: 1rem 1.5rem;
}

/* ——— Academy feed / social post form & layout (merged from social_posts.css) ——— */

/* Social feed rich text input with unlimited height growth */
.social-feed-input {
  min-height: 2rem !important;
  max-height: none !important;
  resize: none !important;
  overflow: visible !important;
  display: flex;
  align-items: flex-start;
  transition: all 0.3s ease !important;
}

.social-feed-input trix-editor {
  min-height: 2.25rem !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 0.5rem !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  transition: all 0.3s ease !important;
  line-height: 1.4 !important;
}

.social-feed-input trix-toolbar {
  border: none !important;
  box-shadow: none !important;
}

.social-feed-input trix-editor:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.social-feed-input trix-editor,
.social-feed-input trix-editor[contenteditable] {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent !important;
}

.social-feed-input:not(:focus-within) {
  box-shadow: none !important;
}

.social-feed-input {
  border: 1px solid var(--cream-border) !important;
  background: var(--cream) !important;
  box-shadow: none !important;
  outline: none !important;
}
.social-feed-input trix-editor {
  background: var(--cream) !important;
}

.social-feed-input:focus-within {
  border: 1px solid var(--cream-ink) !important;
  box-shadow: none !important;
  outline: none !important;
}

.social-feed-input trix-editor:focus,
.social-feed-input trix-editor:focus-visible,
.social-feed-input trix-editor:focus-within {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.social-feed-input:after,
.social-feed-input:before,
.social-feed-input trix-editor:before,
.social-feed-input trix-editor:after {
  border: none !important;
  box-shadow: none !important;
}

.flex.items-start.gap-3,
.flex.items-start.gap-3 *,
.flex.items-start.gap-3 .social-feed-input { border: none !important; box-shadow: none !important; outline: none !important; }
.flex.items-start.gap-3 .social-feed-input { border: 1px solid #d1d5db !important; }
.flex.items-start.gap-3 .social-feed-input:focus-within { border: 1px solid #3b82f6 !important; }

.flex-1.relative.min-w-0.flex.items-center.gap-2.mb-2 {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.image-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0;
}

.image-preview-container .relative { position: relative; }
.image-preview-container img {
  width: 5rem;
  height: 5rem;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
}
.image-preview-container button {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  background-color: #ef4444;
  color: white;
  border-radius: 50%;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}
.image-preview-container button:hover { background-color: #dc2626; }

.social-feed-input.expanded,
.social-feed-input.expanded trix-editor {
  min-height: 2rem !important;
  max-height: none !important;
}
.social-feed-input.expanded trix-editor { min-height: 2.25rem !important; }

.expanded-card {
  height: auto !important;
  max-height: none !important;
  min-height: auto !important;
  overflow: visible !important;
  transition: all 0.3s ease-in-out !important;
}

.expanded-card .card-body {
  height: auto !important;
  max-height: none !important;
  min-height: auto !important;
  overflow: visible !important;
  padding-bottom: 1rem !important;
}

.card, .card .card-body {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
}
.card .card-body { flex: 1 !important; }

[data-image-preview-target="inputField"] {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.expanded-card [data-image-preview-target="previewContainer"],
.expanded-card [data-image-preview-target="previewGrid"] {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
.expanded-card [data-image-preview-target="previewGrid"] { display: flex !important; }

.image-preview-expanded {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

body.social-posts-page,
body.social-posts-page .flex-1,
body.social-posts-page #main_content_area,
.w-full.flex-1.flex.justify-center.items-stretch,
.container.mx-auto.max-w-lg {
  height: auto !important;
  min-height: 100vh !important;
  max-height: none !important;
  overflow: visible !important;
}
body.social-posts-page .flex-1 { min-height: 0; }
.w-full.flex-1.flex.justify-center.items-stretch { align-items: flex-start !important; }

.social-posts-page {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  align-items: flex-start !important;
}

.social-posts-page .container,
.social-posts-page #post-form-container,
.social-posts-page #social-posts { height: auto !important; max-height: none !important; overflow: visible !important; }

@media (max-width: 480px) {
  .social-posts-page {
    padding: 0 !important;
    padding-top: 1rem !important;
  }
  .social-posts-page .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
  }
  .social-posts-page #social-posts { padding: 0 !important; margin: 0 !important; }
  .social-posts-page #post-form-container { margin-top: 1rem !important; margin-bottom: 1rem !important; }
  .social-posts-page .card {
    border-radius: 0 !important;
    margin-bottom: 0.5rem !important;
    border-left: none !important;
    border-right: none !important;
    border-top: 1px solid #d1d5db !important;
    border-bottom: 1px solid #d1d5db !important;
  }
  .social-posts-page .card:first-child { border-top: 1px solid #d1d5db !important; }
  .social-posts-page .card:last-child { border-bottom: 1px solid #d1d5db !important; }
  .social-posts-page .card .card-body { padding-left: 1rem !important; padding-right: 1rem !important; }
  .social-posts-page .card img,
  .social-posts-page .card video,
  .social-posts-page .card .rounded-lg,
  .social-posts-page .card .max-h-96,
  .social-posts-page .card .aspect-video,
  .social-posts-page .card .aspect-square {
    border-radius: 0.5rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
  }
}

@media (max-width: 576px) {
  .social-posts-page {
    padding: 0 !important;
    padding-top: 1rem !important;
  }
  .social-posts-page .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
  }
  .social-posts-page #social-posts { padding: 0 !important; margin: 0 !important; }
  .social-posts-page #post-form-container { margin-top: 1rem !important; margin-bottom: 1rem !important; }
  .social-posts-page .card {
    border-radius: 0 !important;
    margin-bottom: 0.5rem !important;
    border-left: none !important;
    border-right: none !important;
    border-top: 1px solid #d1d5db !important;
    border-bottom: 1px solid #d1d5db !important;
  }
  .social-posts-page .card:first-child { border-top: 1px solid #d1d5db !important; }
  .social-posts-page .card:last-child { border-bottom: 1px solid #d1d5db !important; }
  .social-posts-page .card .card-body { padding-left: 1rem !important; padding-right: 1rem !important; }
  .social-posts-page .card img,
  .social-posts-page .card video,
  .social-posts-page .card .rounded-lg,
  .social-posts-page .card .max-h-96,
  .social-posts-page .card .aspect-video,
  .social-posts-page .card .aspect-square {
    border-radius: 0.5rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  .social-post-show-page {
    padding: 0 !important;
    padding-top: 1rem !important;
  }
  .social-post-show-page .max-w-2xl {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
  }
  .social-post-show-page .card {
    border-radius: 0 !important;
    margin: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: 1px solid #d1d5db !important;
    border-bottom: 1px solid #d1d5db !important;
  }
  .social-post-show-page .card .card-body { padding-left: 1rem !important; padding-right: 1rem !important; }
  .social-post-show-page .card img,
  .social-post-show-page .card video,
  .social-post-show-page .card .rounded-lg { border-radius: 0 !important; }
  .social-post-show-page .card .aspect-video,
  .social-post-show-page .card .aspect-square,
  .social-post-show-page .card .rounded-lg,
  .social-post-show-page .card img {
    margin-left: -1rem !important;
    margin-right: -1rem !important;
    width: calc(100% + 2rem) !important;
    padding: 0 !important;
    display: block !important;
  }
  .social-post-show-page .card .mb-4:has(img),
  .social-post-show-page .card .mb-4:has(video),
  .social-post-show-page .card div[class*="mb-4"]:has(img),
  .social-post-show-page .card div[class*="mb-4"]:has(video) {
    margin-left: -1rem !important;
    margin-right: -1rem !important;
    width: calc(100% + 2rem) !important;
    padding: 0 !important;
  }
  .social-post-show-page .card-body { overflow-x: hidden !important; }
}

@media (max-width: 576px) {
  .social-post-show-page {
    padding: 0 !important;
    padding-top: 1rem !important;
  }
  .social-post-show-page .max-w-2xl {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
  }
  .social-post-show-page .card {
    border-radius: 0 !important;
    margin: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: 1px solid #d1d5db !important;
    border-bottom: 1px solid #d1d5db !important;
  }
  .social-post-show-page .card .card-body { padding-left: 1rem !important; padding-right: 1rem !important; }
  .social-post-show-page .card img,
  .social-post-show-page .card video,
  .social-post-show-page .card .rounded-lg { border-radius: 0 !important; }
  .social-post-show-page .card .aspect-video,
  .social-post-show-page .card .aspect-square,
  .social-post-show-page .card .rounded-lg,
  .social-post-show-page .card img {
    margin-left: -1rem !important;
    margin-right: -1rem !important;
    width: calc(100% + 2rem) !important;
    padding: 0 !important;
    display: block !important;
  }
  .social-post-show-page .card .mb-4:has(img),
  .social-post-show-page .card .mb-4:has(video),
  .social-post-show-page .card div[class*="mb-4"]:has(img),
  .social-post-show-page .card div[class*="mb-4"]:has(video) {
    margin-left: -1rem !important;
    margin-right: -1rem !important;
    width: calc(100% + 2rem) !important;
    padding: 0 !important;
  }
  .social-post-show-page .card-body { overflow-x: hidden !important; }
}

.social-feed-card.expanded-card {
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  transition: none !important;
}

.social-feed-card.expanded-card .card-body {
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  padding-bottom: 0 !important;
}

.social-feed-card.expanded-card .px-3 {
  flex-shrink: 0 !important;
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
  min-height: auto !important;
}

.social-feed-card.expanded-card .flex-1 {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  height: 100% !important;
  max-height: 100% !important;
}

.social-feed-card.expanded-card [data-image-preview-target="previewContainer"] {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.social-feed-card.expanded-card [data-image-preview-target="previewGrid"] {
  display: flex !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.dashboard-content .social-feed-card.expanded-card,
.dashboard-content .social-feed-card.expanded-card .card-body {
  height: 100% !important;
  max-height: 100% !important;
  overflow: visible !important;
}

.social-feed-input-no-border,
.social-feed-input-no-border:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

#message_form .social-feed-input.border-primary {
  border: 1px solid var(--fallback-p, oklch(var(--p) / 1)) !important;
}

.dashboard-grid .social-feed-card:has([data-image-preview-target="previewContainer"]:not(.hidden)),
.social-feed-card:has([data-image-preview-target="previewContainer"]:not(.hidden)) {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.dashboard-grid .social-feed-card:has([data-image-preview-target="previewContainer"]:not(.hidden)) .card-body,
.social-feed-card:has([data-image-preview-target="previewContainer"]:not(.hidden)) .card-body {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

@media (max-width: 1024px) {
  .social-feed-card:has([data-image-preview-target="previewContainer"]:not(.hidden)) {
    height: 100% !important;
    min-height: 400px !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .social-feed-card:has([data-image-preview-target="previewContainer"]:not(.hidden)) .card-body {
    height: 100% !important;
    min-height: 350px !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

@media (max-width: 1023px) {
  .social-feed-card:has([data-image-preview-target="previewContainer"]:not(.hidden)) {
    height: 100% !important;
    min-height: 400px !important;
  }
  .social-feed-card:has([data-image-preview-target="previewContainer"]:not(.hidden)) .card-body {
    height: 100% !important;
    min-height: 350px !important;
  }
  .dashboard-content .social-feed-card,
  .dashboard-content .social-feed-card .card-body {
    height: 100% !important;
    min-height: 400px !important;
  }
  .dashboard-content .social-feed-card .card-body { min-height: 350px !important; }
}

@media (max-width: 1024px) {
  .dashboard-content .social-feed-card {
    height: 100% !important;
    min-height: 400px !important;
  }
  .dashboard-content .social-feed-card .card-body {
    height: 100% !important;
    min-height: 350px !important;
  }
  .dashboard-content .social-feed-card:has([data-image-preview-target="previewContainer"]),
  .dashboard-content .social-feed-card:has([data-image-preview-target="previewContainer"]) .card-body {
    height: 100% !important;
    min-height: 350px !important;
  }
  .dashboard-content .social-feed-card:has([data-image-preview-target="previewContainer"]) .card-body { min-height: 350px !important; }
}

.dashboard-content .social-feed-card .flex.items-start.gap-3 { align-items: flex-start !important; }

.dashboard-content .social-feed-card [data-image-preview-target="inputField"],
.dashboard-content .social-feed-card .social-feed-input,
.dashboard-content .social-feed-card .social-feed-input:focus,
.dashboard-content .social-feed-card form,
.dashboard-content .social-feed-card form div,
.dashboard-content .social-feed-card form textarea,
.dashboard-content .social-feed-card form button,
.dashboard-content .social-feed-card form label {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.social-feed-card .card-body > div:first-child {
  border-bottom: 1px solid #e5e7eb !important;
}

#social_feed {
  max-height: 100%;
  overflow: hidden;
}

.social-feed-card .border-b {
  max-height: none;
  overflow: visible;
}

.social-feed-card .image-preview-container {
  max-height: 200px;
  overflow-y: auto;
}

.social-feed-card .image-preview-container img {
  max-width: 100px;
  max-height: 100px;
  object-fit: cover;
}

.messages .image-preview-container {
  max-height: 150px;
  overflow-y: auto;
}

.messages .image-preview-container img {
  max-width: 80px;
  max-height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.dashboard-content .expanded-card,
.dashboard-content .expanded-card .card-body {
  max-height: none !important;
  overflow: visible !important;
}

.dashboard-content .prose {
  margin: 0 !important;
  padding: 0 !important;
}

.dashboard-content .prose p { margin: 0 !important; padding: 0 !important; }
.dashboard-content .prose > * + * { margin-top: 0 !important; }

/* ── Dark mode overrides (gold primary bleeds into borders — neutralize) ── */
/* Dark mode: neutralize the old gold-bleed border color. Bands keep
   their bg/border/shadow so the editorial card structure stays
   intact — same layout as light mode, just with the dark palette. */
[data-theme="dark"] .community-page .community-main-inner {
  border-color: var(--cream-border);
}

/* Calendar day phase pills: Tailwind *-100 bgs are bright cream in
   light mode but glare as near-white squares in dark mode. Dim them
   to ~15% tinted fills with light text in dark mode only. */
[data-theme="dark"] .community-calendar__cell .bg-emerald-100,
[data-theme="dark"] .community-calendar__cell .bg-amber-100,
[data-theme="dark"] .community-calendar__cell .bg-violet-100,
[data-theme="dark"] .community-calendar__cell .bg-sky-100 {
  background-color: rgba(255, 255, 255, 0.04) !important;
}
[data-theme="dark"] .community-calendar__cell .text-emerald-700 { color: rgb(110, 231, 183) !important; }
[data-theme="dark"] .community-calendar__cell .text-amber-700   { color: rgb(252, 211, 77) !important; }
[data-theme="dark"] .community-calendar__cell .text-violet-700  { color: rgb(196, 181, 253) !important; }
[data-theme="dark"] .community-calendar__cell .text-sky-700     { color: rgb(125, 211, 252) !important; }
[data-theme="dark"] .community-page .community-feed-posts .community-feed-post-item .community-feed-card:hover {
  border-color: var(--cream-border);
}
[data-theme="dark"] .community-page .community-card-accent {
  border-top: 1px solid var(--cream-border);
}
[data-theme="dark"] .community-page .community-main-band.bg-accent {
  background: oklch(30% 0.03 250) !important;
}
[data-theme="dark"] .community-page .community-main-band {
  box-shadow: none;
}
[data-theme="dark"] .community-page .community-band-header__title {
  color: oklch(var(--bc));
}
