/*
Theme Name: Social Network Theme
Description: Organic social network theme — warm earth tones, 3-column layout, left/right sidebars.
Version: 2.0.0
Requires PHP: 8.3
Text Domain: sn-theme
*/

/* ── TOKENS ── */
:root {
  --bg: #F7F6F1;
  --surface: #FFFFFF;
  --green: oklch(38% 0.13 148);
  --green-mid: oklch(52% 0.14 148);
  --green-light: oklch(92% 0.06 148);
  --orange: oklch(65% 0.17 46);
  --gold: oklch(74% 0.14 78);
  --rose: oklch(65% 0.14 12);
  --text: #1C1C18;
  --text-mid: #5A5A52;
  --text-soft: #9A9A90;
  --border: rgba(0,0,0,0.07);
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --radius: 18px;
  --radius-sm: 10px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
}

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

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

/* ── TOPBAR ── */
.sn-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247,246,241,0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 28px;
  height: 60px;
}

.sn-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.sn-topbar-search {
  flex: 1;
  max-width: 360px;
  margin: 0 auto;
  position: relative;
}
.sn-topbar-search input {
  width: 100%;
  background: rgba(0,0,0,0.05);
  border: 1.5px solid transparent;
  border-radius: 50px;
  padding: 8px 18px 8px 40px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.sn-topbar-search input::placeholder { color: var(--text-soft); }
.sn-topbar-search input:focus { background: #fff; border-color: var(--green-mid); }
.sn-topbar-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.4;
  pointer-events: none;
}

.sn-topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.sn-icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
  position: relative;
  transition: background 0.15s;
  text-decoration: none;
}
.sn-icon-btn:hover { background: rgba(0,0,0,0.06); }
.sn-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--orange);
  border: 2px solid var(--bg);
}
.sn-avatar-top {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--green-mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--green-mid);
  flex-shrink: 0;
  overflow: hidden;
}
.sn-avatar-top img { width: 100%; height: 100%; object-fit: cover; }

/* ── NOTIFICATIONS PANEL ── */
.sn-notif-panel {
  display: none;
  position: fixed;
  top: 68px;
  right: 24px;
  width: 320px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 200;
  overflow: hidden;
}
.sn-notif-panel.open { display: block; }
.sn-notif-header {
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.sn-notif-header h3 { font-size: 15px; font-weight: 600; }
.sn-notif-header span { font-size: 12px; color: var(--green-mid); cursor: pointer; }
.sn-notif-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  transition: background 0.15s;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.sn-notif-item:last-child { border-bottom: none; }
.sn-notif-item:hover { background: var(--bg); }
.sn-notif-item.unread { background: var(--green-light); }
.sn-notif-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
}
.sn-notif-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sn-notif-text { font-size: 12.5px; line-height: 1.5; color: var(--text-mid); flex: 1; }
.sn-notif-text b { color: var(--text); font-weight: 600; }
.sn-notif-time { font-size: 11px; color: var(--text-soft); white-space: nowrap; }

/* ── 3-COLUMN LAYOUT ── */
.sn-layout {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 80px;
  align-items: start;
}

/* ── LEFT SIDEBAR ── */
.sn-left-sidebar {
  position: sticky;
  top: 82px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sn-nav-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}

.sn-user-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.sn-user-avatar-wrap { position: relative; width: 64px; height: 64px; }
.sn-user-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--green-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2.5px var(--green-mid);
  overflow: hidden;
}
.sn-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sn-online-dot {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #4CAF50;
  border: 2.5px solid #fff;
}
.sn-user-name { font-size: 15px; font-weight: 600; color: var(--text); text-align: center; }
.sn-user-handle { font-size: 12px; color: var(--text-soft); text-align: center; }

.sn-user-stats {
  display: flex;
  width: 100%;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.sn-stat { flex: 1; text-align: center; padding: 10px 0; }
.sn-stat:not(:last-child) { border-right: 1px solid var(--border); }
.sn-stat-num { font-size: 15px; font-weight: 700; color: var(--text); }
.sn-stat-lbl { font-size: 10px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.5px; }

.sn-nav-links { padding: 8px 0; }
.sn-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  font-size: 14px;
  color: var(--text-mid);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-weight: 500;
  position: relative;
  text-decoration: none;
}
.sn-nav-link:hover { background: var(--bg); color: var(--text); }
.sn-nav-link.active { color: var(--green); background: var(--green-light); }
.sn-nav-link.active svg { opacity: 1; color: var(--green); }
.sn-nav-link svg { opacity: 0.6; flex-shrink: 0; }
.sn-nav-pill {
  margin-left: auto;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

/* Suggested people card */
.sn-card-title {
  padding: 14px 18px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sn-card-title a { color: var(--green-mid); font-weight: 500; text-transform: none; letter-spacing: 0; cursor: pointer; font-size: 12px; }

.sn-suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.15s;
}
.sn-suggest-item:hover { background: var(--bg); }
.sn-suggest-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--green-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.sn-suggest-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sn-suggest-info { flex: 1; min-width: 0; }
.sn-suggest-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-suggest-meta { font-size: 11px; color: var(--text-soft); }
.sn-follow-btn {
  background: var(--green-light);
  color: var(--green);
  border: 1.5px solid var(--green-mid);
  font-family: 'DM Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.sn-follow-btn:hover { background: var(--green-mid); color: #fff; }
.sn-follow-btn.following { background: var(--bg); color: var(--text-soft); border-color: var(--border); }

/* ── CENTER FEED override via plugin vars ── */
.sn-feed, .sn-networks, .sn-messages {
  --sn-primary: var(--green);
  --sn-primary-text: #fff;
  --sn-bg: var(--bg);
  --sn-bg-card: var(--surface);
  --sn-surface: var(--bg);
  --sn-border: var(--border);
  --sn-text: var(--text);
  --sn-text-muted: var(--text-mid);
  --sn-unread: var(--orange);
  --sn-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  max-width: none;
}

/* ── RIGHT SIDEBAR ── */
.sn-right-sidebar {
  position: sticky;
  top: 82px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sn-sidebar-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Reels grid */
.sn-reels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 14px 14px;
}
.sn-reel-thumb {
  aspect-ratio: 9/14;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.sn-reel-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sn-reel-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
}
.sn-reel-views {
  position: absolute;
  bottom: 7px;
  left: 7px;
  z-index: 1;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 3px;
}
.sn-reel-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s;
}
.sn-reel-thumb:hover .sn-reel-play { opacity: 1; }

/* Trending */
.sn-trend-item {
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.sn-trend-item:last-child { border-bottom: none; }
.sn-trend-item:hover { background: var(--bg); }
.sn-trend-tag { font-size: 13.5px; font-weight: 600; color: var(--green); }
.sn-trend-sub { font-size: 11.5px; color: var(--text-soft); margin-top: 1px; }
.sn-trend-num { font-size: 10.5px; font-weight: 700; color: var(--orange); margin-top: 2px; }

/* Promo ad card */
.sn-promo-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.sn-promo-img { width: 100%; height: 110px; overflow: hidden; }
.sn-promo-img img { width: 100%; height: 100%; object-fit: cover; }
.sn-promo-body { background: var(--surface); padding: 14px; }
.sn-promo-sponsor { font-size: 10px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
.sn-promo-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}
.sn-promo-desc { font-size: 12px; color: var(--text-mid); line-height: 1.5; }
.sn-promo-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--orange);
  color: #fff;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 8px;
}
.sn-promo-cta:hover { opacity: 0.88; }

/* ── FOOTER ── */
.sn-site-footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-soft);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ── AUTH PAGES ── */
.sn-auth-wrap {
  display: flex;
  justify-content: center;
  padding: 48px 20px 80px;
  min-height: calc(100vh - 60px);
  align-items: center;
}
.sn-auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
}
.sn-auth-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sn-auth-title { font-size: 22px; font-weight: 700; margin: 0 0 6px; font-family: 'Playfair Display', Georgia, serif; }
.sn-auth-subtitle { font-size: 14px; color: var(--text-mid); margin: 0 0 24px; }
.sn-auth-error {
  background: #fbeaf0;
  color: #72243e;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  margin: 0 0 18px;
}
.sn-auth-form { display: flex; flex-direction: column; gap: 16px; }
.sn-auth-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.sn-auth-label input {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(0,0,0,0.1);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg);
}
.sn-auth-label input:focus { border-color: var(--green-mid); background: #fff; }
.sn-auth-checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-mid); }
.sn-auth-submit {
  width: 100%;
  background: var(--green);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
  margin-top: 4px;
}
.sn-auth-submit:hover { background: var(--green-mid); transform: translateY(-1px); }
.sn-auth-divider { text-align: center; font-size: 12px; color: var(--text-soft); margin: 6px 0; }
.sn-auth-foot { text-align: center; font-size: 13px; color: var(--text-mid); margin: 20px 0 0; }
.sn-auth-foot a { color: var(--green-mid); font-weight: 600; }

/* ── LANDING PAGE ── */
.sn-hero {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 60px 0 80px;
  max-width: 900px;
  margin: 0 auto;
}
.sn-hero-copy { flex: 1.2; }
.sn-hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 42px;
  line-height: 1.12;
  margin: 0 0 18px;
  color: var(--text);
}
.sn-hero-sub { font-size: 16px; color: var(--text-mid); max-width: 480px; margin: 0 0 32px; line-height: 1.65; }
.sn-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.sn-hero-art { flex: 1; max-width: 300px; }

.sn-features {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}
.sn-feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.sn-feature-icon { font-size: 24px; margin-bottom: 10px; }
.sn-feature-card h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.sn-feature-card p { font-size: 12.5px; color: var(--text-mid); margin: 0; line-height: 1.5; }

.sn-cta-band {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  background: var(--green);
  border-radius: var(--radius);
  margin-bottom: 40px;
}
.sn-cta-band h2 {
  font-family: 'Playfair Display', Georgia, serif;
  color: #fff;
  font-size: 28px;
  margin: 0 0 20px;
}

/* ── SHARED BUTTONS ── */
.sn-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--green);
  color: #fff;
  border: none;
  padding: 11px 26px;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
  text-decoration: none;
}
.sn-btn-primary:hover { background: var(--green-mid); transform: translateY(-1px); }
.sn-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid rgba(0,0,0,0.12);
  padding: 11px 26px;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.sn-btn-secondary:hover { background: var(--bg); }
.sn-btn-white {
  background: #fff;
  color: var(--green);
  border: none;
  padding: 12px 28px;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.15s;
}
.sn-btn-white:hover { opacity: 0.9; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 10px; }

/* ── RESPONSIVE ── */
@media (max-width: 1060px) {
  .sn-layout { grid-template-columns: 220px 1fr; }
  .sn-right-sidebar { display: none; }
}
@media (max-width: 740px) {
  .sn-layout { grid-template-columns: 1fr; }
  .sn-left-sidebar { display: none; }
  .sn-topbar { padding: 0 16px; }
  .sn-topbar-search { max-width: 200px; }
  .sn-hero { flex-direction: column; text-align: center; padding: 40px 0 60px; }
  .sn-hero-art { display: none; }
  .sn-features { grid-template-columns: repeat(2, 1fr); }
}

/* ── Custom logo image in topbar ── */
.sn-custom-logo {
  max-height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* ── Hide WP admin bar gap for non-admins (belt + suspenders) ── */
html { margin-top: 0 !important; }
