/* CrossGen AI Newsletter - Brand CSS
   Source: sean-identity/assets/brand-config.json
   Colors: Primary Blue #012EFF, Neon Green #00FF25, Dark Slate #303841, Off White #EFF0F2
   Fonts: Noto Sans (headlines), Open Sans (body), JetBrains Mono (code)
*/

:root {
  --primary-blue: #012EFF;
  --neon-green: #00FF25;
  --dark-slate: #303841;
  --slate: #46515E;
  --off-white: #EFF0F2;
  --light-gray: #D3D6DB;
  --medium-gray: #B7BCC4;
  --white: #FFFFFF;
  --code-bg: #2d2d2d;
  --selection-highlight: #00FF2544;
  --font-headline: 'Noto Sans', Arial, sans-serif;
  --font-body: 'Open Sans', Arial, sans-serif;
  --font-code: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

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

::selection {
  background: var(--selection-highlight);
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--dark-slate);
  background: var(--white);
}

/* ============ HEADER ============ */
.site-header {
  background: var(--dark-slate);
  border-bottom: 3px solid var(--primary-blue);
  padding: 0;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.site-title {
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--white);
  letter-spacing: -0.02em;
}

.site-subtitle {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--neon-green);
  font-weight: 500;
}

.header-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.header-nav a {
  color: var(--light-gray);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: var(--neon-green);
}

.admin-link {
  color: var(--neon-green) !important;
}

/* ============ MAIN LAYOUT ============ */
.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  min-height: calc(100vh - 200px);
}

.main-content {
  max-width: 780px;
}

/* ============ NEWSLETTER CONTENT ============ */
.newsletter-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--off-white);
}

.newsletter-date {
  font-size: 0.85rem;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.newsletter-title {
  font-family: var(--font-headline);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--dark-slate);
  margin-top: 0.5rem;
  line-height: 1.2;
}

.newsletter-summary {
  color: var(--slate);
  font-size: 1.1rem;
  margin-top: 0.75rem;
  line-height: 1.6;
}

.newsletter-body h1 {
  font-family: var(--font-headline);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark-slate);
  margin: 2rem 0 1rem;
  border-bottom: 2px solid var(--primary-blue);
  padding-bottom: 0.5rem;
}

.newsletter-body h2 {
  font-family: var(--font-headline);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark-slate);
  margin: 1.75rem 0 0.75rem;
  border-left: 4px solid var(--primary-blue);
  padding-left: 0.75rem;
}

.newsletter-body h3 {
  font-family: var(--font-headline);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--slate);
  margin: 1.5rem 0 0.5rem;
}

.newsletter-body p {
  margin-bottom: 1rem;
}

.newsletter-body a {
  color: var(--primary-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.newsletter-body a:hover {
  border-bottom-color: var(--primary-blue);
}

.newsletter-body ul, .newsletter-body ol {
  margin: 0.75rem 0 1rem 1.5rem;
}

.newsletter-body li {
  margin-bottom: 0.4rem;
}

.newsletter-body blockquote {
  border-left: 4px solid var(--primary-blue);
  background: var(--off-white);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-style: italic;
  color: var(--slate);
}

.newsletter-body code {
  font-family: var(--font-code);
  font-size: 0.9em;
  background: #e8f5e9;
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.newsletter-body pre {
  background: var(--code-bg);
  border-left: 4px solid var(--primary-blue);
  padding: 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.25rem 0;
}

.newsletter-body pre code {
  background: none;
  color: #e8e8e8;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.newsletter-body img {
  max-width: 100%;
  border-radius: 4px;
  margin: 1rem 0;
}

.newsletter-body hr {
  border: none;
  border-top: 2px solid var(--off-white);
  margin: 2rem 0;
}

.newsletter-body strong {
  font-weight: 600;
  color: var(--dark-slate);
}

.newsletter-nav {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--off-white);
}

.back-link {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  color: var(--neon-green);
}

/* ============ SIDEBAR ============ */
.sidebar {
  position: sticky;
  top: 2rem;
  align-self: start;
}

.sidebar-header {
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-blue);
  margin-bottom: 1rem;
}

.sidebar-header h3 {
  font-family: var(--font-headline);
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark-slate);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

.sidebar-item {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.75rem;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-item:hover {
  background: var(--off-white);
  border-left-color: var(--neon-green);
}

.sidebar-item.active {
  background: var(--off-white);
  border-left-color: var(--primary-blue);
}

.sidebar-date {
  font-size: 0.75rem;
  color: var(--medium-gray);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sidebar-title {
  font-size: 0.85rem;
  color: var(--dark-slate);
  font-weight: 500;
  line-height: 1.3;
}

.sidebar-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--light-gray);
}

.view-all-link {
  font-size: 0.85rem;
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 500;
}

.view-all-link:hover {
  color: var(--neon-green);
}

.sidebar-empty {
  font-size: 0.85rem;
  color: var(--medium-gray);
  font-style: italic;
}

/* ============ ARCHIVE PAGE ============ */
.page-title {
  font-family: var(--font-headline);
  font-size: 2rem;
  font-weight: 800;
  color: var(--dark-slate);
  margin-bottom: 2rem;
  border-bottom: 3px solid var(--primary-blue);
  padding-bottom: 0.75rem;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.archive-item {
  padding: 1.25rem;
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: 6px;
  border-left: 4px solid var(--primary-blue);
  transition: border-left-color 0.2s, box-shadow 0.2s;
}

.archive-item:hover {
  border-left-color: var(--neon-green);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.archive-date {
  font-size: 0.8rem;
  color: var(--medium-gray);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.archive-title {
  display: block;
  font-family: var(--font-headline);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark-slate);
  text-decoration: none;
  margin-top: 0.25rem;
}

.archive-title:hover {
  color: var(--primary-blue);
}

.archive-summary {
  font-size: 0.9rem;
  color: var(--slate);
  margin-top: 0.4rem;
  line-height: 1.5;
}

/* ============ WELCOME / EMPTY STATE ============ */
.welcome-message {
  text-align: center;
  padding: 4rem 2rem;
}

.welcome-message h2 {
  font-family: var(--font-headline);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--dark-slate);
  margin-bottom: 1rem;
}

.welcome-message p {
  font-size: 1.1rem;
  color: var(--slate);
  max-width: 500px;
  margin: 0 auto 0.75rem;
}

.cta-text {
  color: var(--primary-blue) !important;
  font-weight: 600;
}

.empty-state {
  color: var(--medium-gray);
  font-style: italic;
  text-align: center;
  padding: 2rem;
}

.error-page {
  text-align: center;
  padding: 3rem;
}

.error-page h2 {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  color: var(--dark-slate);
  margin-bottom: 1rem;
}

.error-page a {
  color: var(--primary-blue);
}

/* ============ FOOTER ============ */
.site-footer {
  background: var(--dark-slate);
  border-top: 3px solid var(--primary-blue);
  margin-top: 3rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.footer-name {
  font-family: var(--font-headline);
  font-weight: 700;
  color: var(--white);
  font-size: 1rem;
}

.footer-tagline {
  color: var(--neon-green);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.footer-links a {
  color: var(--light-gray);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--neon-green);
}

.footer-copy {
  color: var(--medium-gray);
  font-size: 0.8rem;
  margin-top: 1rem;
}

/* ============ LOGIN PAGE ============ */
.login-body {
  background: var(--dark-slate);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  background: var(--white);
  padding: 2.5rem;
  border-radius: 8px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  border-top: 4px solid var(--primary-blue);
}

.login-card h1 {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  color: var(--dark-slate);
  margin-bottom: 0.25rem;
}

.login-subtitle {
  color: var(--medium-gray);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.login-error {
  background: #fef2f2;
  color: #dc2626;
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.login-card input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--light-gray);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.login-card input:focus {
  outline: none;
  border-color: var(--primary-blue);
}

.login-card button {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary-blue);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-family: var(--font-headline);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.login-card button:hover {
  box-shadow: 0 0 16px rgba(0, 255, 37, 0.3);
}

/* ============ ADMIN PANEL ============ */
.admin-body {
  background: var(--off-white);
}

.admin-header .site-subtitle {
  color: #ff6b35;
}

.admin-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.admin-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--white);
  padding: 1.25rem;
  border-radius: 6px;
  text-align: center;
  border-top: 3px solid var(--primary-blue);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.stat-value {
  display: block;
  font-family: var(--font-headline);
  font-size: 2rem;
  font-weight: 800;
  color: var(--dark-slate);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.admin-section {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.admin-section h2, .admin-section h3 {
  font-family: var(--font-headline);
  font-weight: 700;
  color: var(--dark-slate);
  margin-bottom: 1rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 2px solid var(--light-gray);
  font-family: var(--font-headline);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate);
}

.admin-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--off-white);
  font-size: 0.9rem;
}

.admin-table a {
  color: var(--primary-blue);
  text-decoration: none;
}

.admin-table a:hover {
  text-decoration: underline;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.published {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-badge.draft {
  background: #fff3e0;
  color: #e65100;
}

.btn {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

.btn-primary {
  background: var(--primary-blue);
  color: var(--white);
}

.btn-primary:hover {
  box-shadow: 0 0 12px rgba(0, 255, 37, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--primary-blue);
  border: 1px solid var(--primary-blue);
}

.btn-outline:hover {
  background: var(--off-white);
}

.logout-link {
  color: #ef4444 !important;
}

/* ============ EDITOR ============ */
.editor-container {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.editor-container h2 {
  font-family: var(--font-headline);
  font-weight: 700;
  color: var(--dark-slate);
  margin-bottom: 1rem;
}

.editor-textarea {
  width: 100%;
  font-family: var(--font-code);
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 1rem;
  border: 2px solid var(--light-gray);
  border-radius: 4px;
  resize: vertical;
  min-height: 500px;
  background: #fafafa;
}

.editor-textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
}

.editor-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  align-items: center;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar {
    position: static;
    border-top: 2px solid var(--off-white);
    padding-top: 1.5rem;
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .newsletter-title {
    font-size: 1.6rem;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .content-wrapper {
    padding: 1rem;
  }
}
