/* ============================================================
   tayo-custom.css  — TAYO community site overrides
   All layout, mobile, and feature CSS lives here.
   index.html just needs: <link rel="stylesheet" href="tayo-custom.css">
   ============================================================ */

/* ── Layout ─────────────────────────────────────────────── */
.page-layout {
  max-width: 100%;
  margin: 0;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
}

/* ── Feed grid (CSS Grid instead of columns for consistent rendering) ─────────────────────────── */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 100%;
}

/* ── Feed card — improved density ─────────────────────── */
.feed-card {
  break-inside: avoid;
  background: var(--panel);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
  padding-bottom: 6px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
  display: block;
}

/* ── Card caption — larger, more breathable ───────────── */
.fc-caption {
  font-size: 14px !important;
  color: var(--ink);
  line-height: 1.6 !important;
  padding: 10px 14px 8px !important;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 3 !important;
}

/* ── Card footer — more breathing room ───────────────── */
.fc-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 10px;
}

/* ── Username in feed card — slightly larger ─────────── */
.fc-username {
  font-size: 13px !important;
  font-weight: 700;
  color: var(--navy);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ── Post composer bar — more inviting ─────────────── */
.post-bar-input {
  flex: 1;
  background: linear-gradient(135deg, #fff8f0, #fff0e8) !important;
  border-radius: 999px;
  padding: 12px 18px !important;
  border: 2px solid #f7a632 !important;
  font-size: 14px;
  color: #c2700a !important;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.post-bar-input:hover {
  background: linear-gradient(135deg, #fff3e0, #ffe0c0) !important;
  border-color: #ff7a1a !important;
  box-shadow: 0 0 0 3px rgba(247,166,50,.2);
}
.post-bar-input::placeholder {
  color: #c2700a !important;
  opacity: .75;
}
.post-bar-input:focus {
  outline: none;
  background: #fff !important;
  border-color: var(--blue) !important;
  color: var(--ink) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

/* ── Language filter ─────────────────────────────────── */
.lang-filter {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  flex-shrink: 0;
}
.lang-filter-btn {
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.lang-filter-btn:hover,
.lang-filter-btn.active {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
}

/* ── Card image — natural height (RedNote style) ─────────── */
.fc-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Card footer — avatar + username + heart ─────────────── */
.fc-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px 8px;
}
.ml-auto { margin-left: auto; }

/* ── Hide floating join banner ───────────────────────────── */
#joinBanner { display: none; }

/* ── My Posts button ─────────────────────────────────────── */
.btn-myposts-top {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--light);
  color: var(--navy);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.btn-myposts-top:hover { background: #e2e4e8; }

/* ── Profile icon (replaces Sign In when logged in) ──────── */
.btn-profile-icon {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  border-radius: 50%;
}
.btn-profile-icon:hover { background: var(--light); }

/* ── Profile drawer ──────────────────────────────────────── */
#profileDrawer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 995;
  align-items: flex-start;
  justify-content: flex-end;
}
#profileDrawer.open { display: flex; }
.profile-drawer-inner {
  background: #fff;
  width: min(480px, 100vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.profile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}
.profile-drawer-header button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
}
.profile-grid {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: start;
  -webkit-overflow-scrolling: touch;
}
.profile-card {
  border-radius: 10px;
  overflow: hidden;
  background: var(--light);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .15s;
}
.profile-card:hover { transform: translateY(-2px); }
.pcard-img img {
  width: 100%;
  height: auto;
  display: block;
}
.pcard-emoji {
  font-size: 40px;
  padding: 24px;
  text-align: center;
  background: #f3f4f6;
}
.pcard-caption {
  font-size: 11px;
  color: var(--ink);
  padding: 5px 8px 3px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  line-height: 1.4;
}
.pcard-foot {
  font-size: 10px;
  color: var(--muted);
  padding: 2px 8px 7px;
}
.profile-loading, .profile-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  font-size: 13px;
}
.profile-drawer-footer {
  flex-shrink: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.btn-logout {
  width: 100%;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 9px;
  font-size: 13px;
  font-weight: 700;
  color: #e53e3e;
  cursor: pointer;
  font-family: inherit;
}
.btn-logout:hover { background: #fff5f5; }

/* ── Reseller Hub button (kept for reference, removed from topbar) ── */
.btn-reseller-top {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.btn-reseller-top:hover { opacity: 0.88; }

/* ── Reseller Hub as cat-bar tab ─────────────────────────── */
a.cat-tab-link {
  text-decoration: none;
  color: inherit;
}

/* ── Responsive — tablet ─────────────────────────────────── */
@media (max-width: 800px) {
  .page-layout {
    max-width: 100%;
    padding: 8px;
    grid-template-columns: 1fr;
  }
  .sidebar { display: none; }
  .feed-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-nav { display: block; }
  .search-bar { display: none; }
  .btn-post-top { display: none; }
  /* compact topbar on tablet/phone */
  .btn-signin-top { padding: 7px 12px; font-size: 12px; }
  .top-actions { gap: 6px; }
}

/* ── Responsive — phone ──────────────────────────────────── */
@media (max-width: 480px) {
  .page-layout { max-width: 100%; padding: 0; }
  .feed-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
    padding: 3px 3px 60px;
  }
  .feed-card {
    padding: 0;
    border-radius: 8px;
  }
  .fc-img-wrap img { width: 100%; height: auto; display: block; }
  .fc-caption { padding: 3px 6px 2px; font-size: 10px; }
  .fc-footer { padding: 3px 6px 6px; }
  .fc-like-btn { font-size: 10px; }
  /* keep topbar single-line */
  .tayo-wordmark { font-size: 16px; }
  .btn-signin-top { padding: 6px 10px; font-size: 11px; }
  .btn-profile-icon { font-size: 18px; }
}
