/*
Theme Name:        Amigo Friendship Theme
Theme URI:         https://webmasterllc.com/amigo-theme
Author:            WebMaster LLC
Author URI:        https://webmasterllc.com
Description:       Companion theme for the Amigo Friendship Platform plugin. Card-based, mobile-first social UI built for BuddyPress and bbPress.
Version:           1.0.0
Requires at least: 6.3
Tested up to:      6.6
Requires PHP:      8.0
License:           GNU General Public License v2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       amigo-theme
Tags:              buddypress, social, community, card-layout, mobile-first
*/

/* ============================================================
   AMIGO THEME — BASE STYLES
   ============================================================ */

/* ── Design tokens ───────────────────────────────────────── */
:root {
  --at-primary:     #FF6B35;
  --at-primary-dk:  #e05520;
  --at-secondary:   #2E86AB;
  --at-accent:      #F7C59F;
  --at-bg:          #f4f5f7;
  --at-surface:     #ffffff;
  --at-border:      #e1e4e8;
  --at-text:        #1a1a1a;
  --at-muted:       #6b7280;
  --at-success:     #27ae60;
  --at-radius:      10px;
  --at-radius-sm:   6px;
  --at-shadow:      0 2px 8px rgba(0,0,0,.07);
  --at-shadow-md:   0 6px 20px rgba(0,0,0,.11);
  --at-font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --at-nav-h:       60px;
  --at-sidebar-w:   280px;
  --at-content-max: 900px;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { font-size: 16px; scroll-behavior: smooth; }
body  {
  font-family:     var(--at-font);
  background:      var(--at-bg);
  color:           var(--at-text);
  line-height:     1.6;
  min-height:      100vh;
}
a { color: var(--at-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ── Layout ──────────────────────────────────────────────── */
.site-wrapper {
  display:  flex;
  flex-direction: column;
  min-height: 100vh;
}
.site-content-area {
  display:       flex;
  gap:           1.5rem;
  max-width:     1200px;
  margin:        calc(var(--at-nav-h) + 1.5rem) auto 2rem;
  padding:       0 1rem;
  width:         100%;
}
.site-main     { flex: 1; min-width: 0; }
.site-sidebar  { width: var(--at-sidebar-w); flex-shrink: 0; }

/* ── Header / Nav ────────────────────────────────────────── */
#site-header {
  position:   fixed;
  top:        0; left: 0; right: 0;
  height:     var(--at-nav-h);
  background: var(--at-surface);
  border-bottom: 1px solid var(--at-border);
  box-shadow: var(--at-shadow);
  z-index:    1000;
  display:    flex;
  align-items: center;
}
.nav-inner {
  display:         flex;
  align-items:     center;
  gap:             1rem;
  width:           100%;
  max-width:       1200px;
  margin:          0 auto;
  padding:         0 1.25rem;
}
.site-branding {
  display:     flex;
  align-items: center;
  gap:         .5rem;
  font-size:   1.2rem;
  font-weight: 800;
  color:       var(--at-text);
  text-decoration: none;
  flex-shrink: 0;
}
.site-branding .logo-icon { color: var(--at-primary); font-size: 1.5em; }
.site-branding:hover      { text-decoration: none; }

/* Main nav */
.primary-nav { flex: 1; }
.primary-nav ul {
  display:     flex;
  list-style:  none;
  gap:         .2rem;
  align-items: center;
}
.primary-nav a {
  display:       block;
  padding:       .4rem .85rem;
  border-radius: var(--at-radius-sm);
  font-size:     .9rem;
  font-weight:   600;
  color:         var(--at-text);
  transition:    background 150ms, color 150ms;
}
.primary-nav a:hover,
.primary-nav .current-menu-item a {
  background: #fff3ed;
  color:      var(--at-primary);
  text-decoration: none;
}

/* Nav auth area */
.nav-auth { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.nav-auth .amigo-btn { padding: .35rem .9rem; font-size: .85rem; }

/* Hamburger (mobile) */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: .4rem; }
.nav-toggle span {
  display:    block;
  width:      22px; height: 2px;
  background: var(--at-text);
  margin:     4px 0;
  transition: transform 200ms, opacity 200ms;
}

/* ── Page card wrapper ───────────────────────────────────── */
.amigo-page-card {
  background:    var(--at-surface);
  border:        1px solid var(--at-border);
  border-radius: var(--at-radius);
  box-shadow:    var(--at-shadow);
  padding:       1.75rem 2rem;
  margin-bottom: 1.5rem;
}
.amigo-page-card__title {
  font-size:     1.35rem;
  font-weight:   800;
  margin-bottom: 1rem;
  color:         var(--at-text);
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--at-accent);
}

/* ── Sidebar cards ───────────────────────────────────────── */
.widget {
  background:    var(--at-surface);
  border:        1px solid var(--at-border);
  border-radius: var(--at-radius);
  box-shadow:    var(--at-shadow);
  padding:       1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  overflow:      hidden;
}
.widget-title {
  font-size:     .9rem;
  font-weight:   700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color:         var(--at-muted);
  margin-bottom: .75rem;
}

/* ── Footer ──────────────────────────────────────────────── */
#site-footer {
  background:  var(--at-surface);
  border-top:  1px solid var(--at-border);
  padding:     1.5rem 1.25rem;
  text-align:  center;
  color:       var(--at-muted);
  font-size:   .82rem;
  margin-top:  auto;
}
#site-footer a { color: var(--at-muted); }
#site-footer a:hover { color: var(--at-primary); }

/* ── BuddyPress overrides ────────────────────────────────── */
#buddypress { max-width: none; }
#buddypress .bp-widget, #buddypress .bp-list {
  background:    none;
  border:        none;
  box-shadow:    none;
}
#buddypress #item-header {
  background:    var(--at-surface);
  border-radius: var(--at-radius);
  border:        1px solid var(--at-border);
  box-shadow:    var(--at-shadow);
  padding:       1.5rem;
  margin-bottom: 1.25rem;
}
#buddypress div.item-list-tabs ul {
  display:    flex;
  flex-wrap:  wrap;
  gap:        .3rem;
  background: none;
  padding:    0;
  margin-bottom: 1rem;
}
#buddypress div.item-list-tabs ul li a {
  padding:       .4rem .85rem;
  border-radius: var(--at-radius-sm);
  font-size:     .875rem;
  font-weight:   600;
  background:    var(--at-surface);
  border:        1px solid var(--at-border);
  color:         var(--at-text);
}
#buddypress div.item-list-tabs ul li.current a,
#buddypress div.item-list-tabs ul li a:hover {
  background: var(--at-primary);
  color:      #fff;
  border-color: var(--at-primary);
}

/* Member directory grid */
#buddypress ul.item-list li {
  background:    var(--at-surface);
  border:        1px solid var(--at-border);
  border-radius: var(--at-radius);
  box-shadow:    var(--at-shadow);
  margin-bottom: 1rem;
  transition:    transform 150ms, box-shadow 150ms;
}
#buddypress ul.item-list li:hover {
  transform:  translateY(-2px);
  box-shadow: var(--at-shadow-md);
}

/* bbPress */
#bbpress-forums .bbp-forum-header,
#bbpress-forums .bbp-topic-header {
  background: var(--at-surface);
  border: 1px solid var(--at-border);
  border-radius: var(--at-radius);
  box-shadow: var(--at-shadow);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-sidebar { display: none; }
  .site-content-area { margin-top: calc(var(--at-nav-h) + 1rem); gap: 0; }

  .nav-toggle { display: block; }
  .primary-nav { display: none; position: absolute; top: var(--at-nav-h); left: 0; right: 0; background: var(--at-surface); border-bottom: 1px solid var(--at-border); box-shadow: var(--at-shadow-md); padding: .75rem 1rem; }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; gap: .15rem; }
  .primary-nav a { padding: .6rem .75rem; }

  .amigo-page-card { padding: 1.1rem; }
  .amigo-page-card__title { font-size: 1.1rem; }
}

/* ── Floating notice ─────────────────────────────────────── */
.amigo-notice--floating {
  position:      fixed;
  bottom:        1.25rem;
  left:          50%;
  transform:     translateX(-50%) translateY(10px);
  opacity:       0;
  transition:    opacity 250ms, transform 250ms;
  background:    var(--at-text);
  color:         #fff;
  padding:       .65rem 1.25rem;
  border-radius: var(--at-radius-sm);
  font-size:     .9rem;
  box-shadow:    var(--at-shadow-md);
  z-index:       9999;
  pointer-events: none;
  white-space:   nowrap;
}
.amigo-notice--floating.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.amigo-notice--success.amigo-notice--floating { background: var(--at-success); }
.amigo-notice--error.amigo-notice--floating   { background: #e74c3c; }
