/* ═══════════════════════════════════════════
   PORTAL.CSS — Member portal UI
   Design tokens inherited from theme.css
   ═══════════════════════════════════════════ */

/* ═══ AUTH PAGES ═══ */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 60% 50% at 50% 20%, rgba(58, 232, 160, 0.05) 0%, transparent 60%),
    var(--bg-primary);
  padding: 40px 20px;
}

.auth-wrap {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.auth-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--fg-primary);
  text-decoration: none;
  letter-spacing: 0.03em;
}

.auth-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--fg-primary);
  margin-bottom: 8px;
}

.auth-sub {
  font-size: 0.95rem;
  color: var(--fg-secondary);
  margin-bottom: 28px;
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  font-size: 0.88rem;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-secondary);
  letter-spacing: 0.02em;
}

.field-group input {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--fg-primary);
  outline: none;
  transition: border-color 0.2s;
}

.field-group input:focus {
  border-color: rgba(58, 232, 160, 0.4);
}

.field-group input::placeholder {
  color: var(--fg-muted);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #0a0f14;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 13px 28px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
}

.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:active { opacity: 1; transform: translateY(0); }

.btn-full { width: 100%; margin-top: 4px; }

.auth-switch {
  text-align: center;
  font-size: 0.88rem;
  color: var(--fg-muted);
  margin-top: 20px;
}

.auth-switch a { color: var(--accent); text-decoration: none; }
.auth-switch a:hover { opacity: 0.8; }

.auth-back {
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.auth-back:hover { color: var(--fg-secondary); }


/* ═══ PORTAL NAV ═══ */
.portal-body { min-height: 100vh; display: flex; flex-direction: column; }

.portal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 15, 20, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.portal-nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--fg-primary);
  text-decoration: none;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--fg-primary);
  background: rgba(255,255,255,0.05);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.nav-user {
  font-size: 0.85rem;
  color: var(--fg-secondary);
}

.btn-ghost-sm {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-secondary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-ghost-sm:hover { border-color: rgba(138,155,168,0.4); color: var(--fg-primary); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-secondary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-ghost:hover { border-color: rgba(138,155,168,0.4); color: var(--fg-primary); }

/* Mobile nav toggle */
.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg-secondary);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-mobile-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-mobile-toggle.active span:nth-child(2) { opacity: 0; }
.nav-mobile-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile-menu {
  display: none;
  flex-direction: column;
  padding: 8px 24px 16px;
  border-top: 1px solid var(--border);
}
.nav-mobile-menu.open { display: flex; }

.nav-mobile-link {
  font-size: 0.95rem;
  color: var(--fg-secondary);
  text-decoration: none;
  padding: 10px 0;
  border-bottom: 1px solid rgba(138,155,168,0.06);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.nav-mobile-link:last-child { border-bottom: none; }
.nav-mobile-link:hover { color: var(--fg-primary); }
.nav-mobile-logout { color: var(--fg-muted); font-size: 0.85rem; }


/* ═══ PORTAL LAYOUT ═══ */
.portal-main {
  flex: 1;
  padding: 48px 32px 80px;
}

.portal-container {
  max-width: 1160px;
  margin: 0 auto;
}

.content-container {
  max-width: 840px;
}


/* ═══ DASHBOARD ═══ */
.dashboard-header {
  margin-bottom: 48px;
}

.dashboard-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(58, 232, 160, 0.25);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.dashboard-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--fg-primary);
  margin-bottom: 10px;
}

.dashboard-sub {
  font-size: 1rem;
  color: var(--fg-secondary);
}


/* ═══ LATEST ROW ═══ */
.latest-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 56px;
}

.latest-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, background 0.2s;
}
.latest-card:hover {
  border-color: rgba(58, 232, 160, 0.3);
  background: rgba(22, 30, 39, 0.9);
}

.latest-card h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg-primary);
  line-height: 1.35;
}

.latest-card p {
  font-size: 0.85rem;
  color: var(--fg-secondary);
  line-height: 1.6;
  flex: 1;
}

.latest-date {
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-top: 4px;
}

.latest-type-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  display: inline-block;
  width: fit-content;
}


/* ═══ TYPE BADGES ═══ */
.type-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  display: inline-block;
}

.type-memo { background: rgba(58, 232, 160, 0.12); color: var(--accent); }
.type-deep-dive { background: rgba(99, 179, 237, 0.12); color: #63b3ed; }
.type-teardown { background: rgba(252, 165, 165, 0.12); color: #fca5a5; }
.type-store-tour { background: rgba(196, 181, 253, 0.12); color: #c4b5fd; }


/* ═══ FEED GRID ═══ */
.feed-section { margin-bottom: 64px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fg-primary);
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, background 0.2s;
}
.feed-card:hover {
  border-color: rgba(58, 232, 160, 0.25);
  background: rgba(22, 30, 39, 0.9);
}

.feed-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feed-date {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.feed-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg-primary);
  line-height: 1.35;
}

.feed-card-summary {
  font-size: 0.88rem;
  color: var(--fg-secondary);
  line-height: 1.65;
  flex: 1;
}

.feed-read-more {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 4px;
}

.feed-empty {
  grid-column: 1 / -1;
  padding: 60px 0;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.95rem;
}


/* ═══ SECTION NAV CARDS ═══ */
.section-nav { margin-top: 16px; }

.section-nav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.section-nav-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}
.section-nav-card:hover { border-color: rgba(58, 232, 160, 0.25); }

.snc-icon {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.section-nav-card h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg-primary);
}

.section-nav-card p {
  font-size: 0.82rem;
  color: var(--fg-secondary);
  line-height: 1.6;
  flex: 1;
}

.snc-cta {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 4px;
}


/* ═══ ARCHIVE PAGE ═══ */
.archive-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.archive-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(58, 232, 160, 0.25);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.archive-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fg-primary);
  margin-bottom: 8px;
}

.archive-sub {
  font-size: 0.95rem;
  color: var(--fg-secondary);
}

.archive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.archive-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, background 0.2s;
}
.archive-card:hover {
  border-color: rgba(58, 232, 160, 0.25);
  background: rgba(22, 30, 39, 0.9);
}

.archive-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.archive-card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fg-primary);
  line-height: 1.3;
}

.archive-card-summary {
  font-size: 0.92rem;
  color: var(--fg-secondary);
  line-height: 1.7;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 48px;
}

.pag-btn {
  font-size: 0.88rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid rgba(58, 232, 160, 0.25);
  border-radius: 6px;
  transition: background 0.2s;
}
.pag-btn:hover { background: rgba(58, 232, 160, 0.08); }

.pag-info {
  font-size: 0.85rem;
  color: var(--fg-muted);
}


/* ═══ CONTENT PAGE ═══ */
.content-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.content-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.content-date {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.content-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--fg-primary);
  line-height: 1.1;
  margin-bottom: 16px;
}

.content-lede {
  font-size: 1.1rem;
  color: var(--fg-secondary);
  line-height: 1.75;
  font-style: italic;
}

.content-cover {
  margin-bottom: 40px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.content-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.content-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--fg-secondary);
}

.content-body p { margin-bottom: 1.5em; }
.content-body p:last-child { margin-bottom: 0; }
.content-body strong { color: var(--fg-primary); font-weight: 600; }
.content-body em { color: var(--accent); font-style: italic; }
.content-body h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg-primary);
  margin: 2.5em 0 1em;
  letter-spacing: -0.01em;
}
.content-body h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg-primary);
  margin: 2em 0 0.75em;
}
.content-body ul, .content-body ol {
  padding-left: 1.6em;
  margin-bottom: 1.5em;
}
.content-body li { margin-bottom: 0.5em; }
.content-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  color: var(--fg-primary);
  font-size: 1.1rem;
  font-style: italic;
  margin: 2em 0;
}

.content-nav-row {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}


/* ═══ ERROR PAGE ═══ */
.error-page {
  text-align: center;
  padding: 80px 0;
}
.error-code {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--fg-muted);
  margin-bottom: 16px;
}
.error-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg-secondary);
  margin-bottom: 32px;
}


/* ═══ PORTAL FOOTER ═══ */
.portal-footer {
  padding: 28px 32px;
  border-top: 1px solid var(--border);
}

.portal-footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.portal-footer-inner .footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--fg-primary);
  font-size: 0.82rem;
}

.footer-sep { color: var(--border); }


/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .latest-row { grid-template-columns: 1fr; }
  .section-nav-grid { grid-template-columns: repeat(2, 1fr); }
  .feed-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .portal-main { padding: 32px 20px 60px; }
  .portal-nav-inner { padding: 0 20px; }
  .nav-links, .nav-right { display: none; }
  .nav-mobile-toggle { display: flex; }
  .section-nav-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 24px; }
  .portal-footer { padding: 24px 20px; }
  .content-title { font-size: 1.7rem; }
  .archive-card-title { font-size: 1rem; }
}
