/* ═══════════════════════════════════════
   STORIED FLAVOURS — Dashboard & App Layout
   ═══════════════════════════════════════ */

/* ── Home background image ── */
.dashboard-page {
  position: relative;
  min-height: 100vh;
  margin: calc(-1 * var(--space-8));
  padding: var(--space-8);
}

.dashboard-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../assets/brooklyn-bridge-home.png') center / cover no-repeat;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.dashboard-page > * {
  position: relative;
  z-index: 1;
}

/* ── App Layout ── */
.app-authenticated {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-content {
  flex: 1;
  padding: var(--space-8);
  overflow-y: auto;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
}


.sidebar-logo {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--border-light);
  box-sizing: border-box;
  flex-shrink: 0;
}

.sidebar-logo a {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-logo-icon {
  height: 35px;
  width: auto;
}

.sidebar-logo-wordmark {
  height: 40px;
  width: auto;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  overflow-y: auto;
  min-height: 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-vintage-grape);
  transition: all var(--duration-fast);
}
button.sidebar-nav-item {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-vintage-grape);
}

.sidebar-nav-item.active {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-amber);
  font-weight: 600;
}

.sidebar-nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: var(--space-4) var(--space-3);
  border-top: 1px solid var(--border-light);
}

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-8);
  border-bottom: 1px solid var(--border-light);
  background: var(--color-vintage-grape);
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-height);
}

.topbar-menu-btn {
  display: none;
}

.topbar-search {
  flex: 0 0 auto;
  width: 320px;
  margin-left: auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.topbar-notif {
  position: relative;
  font-size: 20px;
  padding: var(--space-2);
  cursor: pointer;
}

.topbar-notif-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--color-red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Dashboard ── */
.dashboard-page {
  margin-bottom: var(--space-8);
}

.dashboard-page h1 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-1);
}

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

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.quick-action {
  position: relative;
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
  cursor: pointer;
  transition: all var(--duration-normal);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.quick-action > * {
  position: relative;
  z-index: 2;
}

.quick-action--recipe::before,
.quick-action--story::before,
.quick-action--audio::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.75;
  pointer-events: none;
  z-index: 0;
}

.quick-action--recipe::after,
.quick-action--story::after,
.quick-action--audio::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 248, 240, 0.65);
  border-radius: 16px;
  pointer-events: none;
  z-index: 1;
}

.quick-action--recipe::before { background-image: url('../assets/recipe-placeholder.png'); }
.quick-action--story::before  { background-image: url('../assets/story-placeholder.png'); }
.quick-action--audio::before  { background-image: url('../assets/audio-card-bg.png'); }

.quick-action:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-amber);
}

.quick-action-icon {
  font-size: 20px;
  margin-bottom: var(--space-1);
}

.quick-action h3 {
  font-size: var(--font-size-base);
  margin-bottom: 2px;
  color: var(--text-primary);
}

.quick-action p {
  font-size: var(--font-size-sm);
  color: var(--color-vintage-grape);
}

.dashboard-section {
  margin-bottom: var(--space-10);
}

.dashboard-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.dashboard-section-header h2 {
  font-size: var(--font-size-xl);
}

.dashboard-section-header a {
  font-size: var(--font-size-sm);
  color: var(--color-amber-dark);
  font-weight: 500;
}

.dashboard-section-header a:hover {
  text-decoration: underline;
}

.dashboard-card-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}

/* Featured member */
.featured-member {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  gap: var(--space-5);
  align-items: center;
}

.featured-member-info h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-1);
}

.featured-member-info .relation {
  font-size: var(--font-size-sm);
  color: var(--color-terracotta);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.featured-member-info p {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

/* This day in history */
.history-banner {
  background: linear-gradient(135deg, var(--color-amber-light), var(--color-terracotta-light));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.history-banner h3 {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.history-banner p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Microcopy */
.microcopy {
  text-align: center;
  padding: var(--space-6);
  font-style: italic;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

/* ── Profile Photo ── */
.profile-avatar-container {
  position: relative;
  display: inline-block;
}

.profile-photo-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-amber);
  color: white;
  border: 3px solid var(--surface-page);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast);
  box-shadow: var(--shadow-md);
}

.profile-photo-btn:hover {
  background: var(--color-amber-dark);
  transform: scale(1.1);
}

.profile-photo-btn:active {
  transform: scale(0.95);
}

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

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }
  .sidebar {
    position: fixed;
    left: -100%;
    width: 260px; /* Fixed width on mobile when open */
    z-index: 200;
    transition: left var(--duration-normal) var(--ease-out);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open {
    left: 0;
  }
  .topbar-menu-btn {
    display: flex;
  }
  .topbar { padding: var(--space-3) var(--space-5); }
  .app-content { padding: var(--space-5); }
  .quick-actions { grid-template-columns: 1fr; }
}

/* ── Welcome section ── */
.dashboard-welcome {
  margin-bottom: var(--space-8);
}

/* ── Living Surface Card ── */
.living-surface-card {
  background: linear-gradient(135deg, var(--color-amber-light), var(--color-terracotta-light));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-8);
}

.living-surface-eyebrow {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-terracotta);
  margin-bottom: var(--space-2);
}

.living-surface-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.living-surface-sub {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Daily Prompt Card ── */
.daily-prompt-card {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--color-amber);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
}

.daily-prompt-eyebrow {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-amber-dark);
  margin-bottom: var(--space-3);
}

.daily-prompt-text {
  font-size: var(--font-size-lg);
  line-height: 1.65;
  color: var(--text-primary);
  font-style: italic;
  margin-bottom: var(--space-4);
}

.daily-prompt-cta {
  display: inline-block;
}

/* ── Conversation Feed ── */
.conversation-feed {
  display: flex;
  flex-direction: column;
}

.conversation-item {
  padding: var(--space-4) var(--space-5);
  border-bottom: none;
  background: rgba(255, 255, 255, 0.88);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
}

.conversation-item:last-child {
  margin-bottom: 0;
}

.conversation-item-header {
  font-size: var(--font-size-sm);
  line-height: 1.5;
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

.conversation-actor {
  font-weight: 600;
  color: var(--text-primary);
}

.conversation-action {
  color: var(--text-muted);
}

.conversation-item-link {
  font-weight: 500;
  color: var(--color-amber-dark);
}

.conversation-item-link:hover {
  text-decoration: underline;
}

.conversation-preview {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.conversation-item-footer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-xs);
  flex-wrap: wrap;
}

.conversation-reactions {
  color: var(--text-muted);
}

.conversation-time {
  color: var(--text-muted);
  flex: 1;
}

.conversation-actions {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}

.conversation-btn {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--color-amber-dark);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  cursor: pointer;
  transition: all var(--duration-fast);
  text-decoration: none;
}

.conversation-btn:hover {
  background: var(--color-amber-light);
  border-color: var(--color-amber);
}

/* ── Show more / less button ── */
.show-more-btn {
  background: none;
  border: none;
  font-size: var(--font-size-sm);
  color: var(--color-amber-dark);
  font-weight: 500;
  cursor: pointer;
  padding: var(--space-4) 0 0;
  display: block;
}

.show-more-btn:hover {
  text-decoration: underline;
}

/* ── Recently Joined Members ── */
.joined-member-list {
  display: flex;
  flex-direction: column;
}

.joined-member-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  border-bottom: none;
  background: rgba(255, 255, 255, 0.88);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  text-decoration: none;
  color: inherit;
  transition: opacity var(--duration-fast);
}

.joined-member-item:last-child {
  margin-bottom: 0;
}

.joined-member-item:hover {
  opacity: 0.8;
}

.joined-member-info {
  flex: 1;
}

.joined-member-name {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.joined-member-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.joined-member-arrow {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.joined-pending-section {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-light);
}

.joined-pending-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.joined-pending-header h3 {
  margin: 0;
  font-size: var(--font-size-sm);
}

.joined-pending-header a {
  font-size: var(--font-size-xs);
  color: var(--color-amber-dark);
  text-decoration: none;
}

.joined-pending-list {
  display: flex;
  flex-direction: column;
}

.joined-pending-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: none;
  background: rgba(255, 255, 255, 0.88);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  color: inherit;
  text-decoration: none;
}

.joined-pending-item:last-child {
  margin-bottom: 0;
}

.joined-pending-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-card);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.joined-pending-info {
  flex: 1;
  min-width: 0;
}

.joined-pending-contact {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.joined-pending-meta {
  margin-top: 2px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.joined-pending-more {
  margin: var(--space-3) 0 0;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ── Shared dashboard utility ── */
.dashboard-empty-state {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

/* -- Look Who's Talking -- */
.look-who-section {
  margin-bottom: var(--space-8);
}

.look-who-header {
  margin-bottom: var(--space-4);
}

.look-who-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.look-who-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(117, 91, 112, 0.08);
  box-shadow: 0 10px 24px rgba(65, 49, 63, 0.04);
  transition:
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}

.look-who-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 30px rgba(65, 49, 63, 0.08);
}

.look-who-avatar-stack {
  display: flex;
  align-items: center;
  padding-left: 10px;
  flex-shrink: 0;
}

.look-who-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-terracotta-light);
  color: var(--color-terracotta);
  font-size: var(--font-size-xs);
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.96);
  flex-shrink: 0;
}

.look-who-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.look-who-avatar--stacked {
  margin-left: -10px;
  box-shadow: 0 4px 12px rgba(65, 49, 63, 0.08);
}

.look-who-avatar--stacked:first-child {
  margin-left: 0;
}

.look-who-copy {
  min-width: 0;
  flex: 1;
}

.look-who-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-1);
}

.look-who-name {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
}

.look-who-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.look-who-snippet {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.look-who-cta {
  display: inline-block;
  margin-top: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--color-amber-dark);
  font-weight: 500;
}

.look-who-cta:hover {
  text-decoration: underline;
}

.look-who-empty {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.52);
}

@media (max-width: 768px) {
  .look-who-item {
    padding: var(--space-4);
  }

  .look-who-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}
