/* ===================================================================
   JC Projects Blog — Custom Styles
   Design: Paradigm Shift / Mint accent / Raleway + Source Sans Pro
   =================================================================== */

:root {
  --mint: #49fcd4;
  --mint-dim: #43d9b8;
  --mint-hover: #2ee4bb;
  --mint-soft: rgba(73, 252, 212, 0.08);
  --mint-glow: rgba(73, 252, 212, 0.15);
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f0f0f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
  --radius: 0.325rem;
  --radius-lg: 0.5rem;
  --nav-bg: rgba(255,255,255,0.92);
  --nav-blur: blur(12px);
  --code-bg: #f3f4f6;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --mint: #49fcd4;
  --mint-dim: #43d9b8;
  --mint-hover: #5ffedd;
  --mint-soft: rgba(73, 252, 212, 0.06);
  --mint-glow: rgba(73, 252, 212, 0.1);
  --bg: #0f0f1a;
  --bg-alt: #141425;
  --bg-card: #1a1a2e;
  --text: #e8e8ec;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border: #2a2a40;
  --border-light: #1f1f35;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
  --nav-bg: rgba(15,15,26,0.92);
  --code-bg: #1e1e30;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-weight: 300;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

main, .page-content { flex: 1; padding-top: 60px; }


/* =========================================================
   NAVIGATION
   ========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: var(--nav-blur);
  -webkit-backdrop-filter: var(--nav-blur);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand .accent { color: var(--mint-dim); }

.nav-right { display: flex; align-items: center; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.nav-links a:hover {
  color: var(--mint-dim);
  background: var(--mint-soft);
}

.nav-links a.active { color: var(--mint-dim); }

.nav-links .external-icon {
  font-size: 0.55rem;
  margin-left: 2px;
  opacity: 0.5;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all var(--transition);
  margin-left: 0.5rem;
}

.theme-toggle:hover {
  border-color: var(--mint-dim);
  color: var(--mint-dim);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
}


/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  padding: 5rem 2rem 4rem;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    linear-gradient(135deg, var(--mint-soft) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 50%, var(--mint-glow), transparent 60%);
  pointer-events: none;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

.hero-tag {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--mint-dim);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-tag::before {
  content: '';
  width: 24px; height: 2px;
  background: var(--mint-dim);
  border-radius: 1px;
}

.hero h1 {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 2rem;
}

.connector {
  width: 2px; height: 40px;
  background: linear-gradient(to bottom, var(--mint-dim), transparent);
  margin: 0 auto;
  border-radius: 1px;
}


/* =========================================================
   POST HERO (single post)
   ========================================================= */
.post-hero {
  position: relative;
  height: 380px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.post-hero-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.35);
}

.post-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.35) 60%);
}

.post-hero-content {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

.post-hero-content .hero-tag { color: var(--mint); }
.post-hero-content .hero-tag::before { background: var(--mint); }

.post-hero-content h1 {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  color: #fff;
  line-height: 1.15;
  margin-bottom: 0.5rem;
  max-width: 700px;
}

.post-subtitle-hero {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.75);
  font-weight: 300;
}

.post-meta-hero {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

.post-meta-hero .author-name {
  color: var(--mint);
  font-weight: 600;
}


/* =========================================================
   POST LIST (home)
   ========================================================= */
.posts-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.post-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  color: inherit;
  transition: all var(--transition);
  cursor: pointer;
}

.post-row:hover { background: var(--mint-soft); }
.post-row:hover .post-title { color: var(--mint-dim); }

.post-title {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.3;
  transition: color var(--transition);
  margin-bottom: 0.25rem;
}

.post-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 300;
}

.post-meta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.post-date {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.post-arrow {
  color: var(--mint-dim);
  opacity: 0;
  transform: translateX(-8px);
  transition: all var(--transition);
}

.post-row:hover .post-arrow {
  opacity: 1;
  transform: translateX(0);
}

.post-delete {
  color: #ef4444;
  font-size: 0.85rem;
  opacity: 0.5;
  transition: opacity var(--transition);
}

.post-delete:hover { opacity: 1; }

.admin-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}


/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition);
}

.btn-primary { background: var(--mint); color: #000; }

.btn-primary:hover {
  background: var(--mint-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(73, 252, 212, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--mint-dim);
  color: var(--mint-dim);
}

.btn-danger {
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.3);
  font-size: 0.7rem;
  padding: 0.4rem 0.8rem;
}

.btn-danger:hover { background: rgba(239,68,68,0.08); }
.btn-full { width: 100%; justify-content: center; }


/* =========================================================
   ARTICLE BODY
   ========================================================= */
.article-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.edit-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-body { font-size: 1.05rem; line-height: 1.85; }
.article-body p { margin-bottom: 1.5rem; }

.article-body h2 {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.02em;
}

.article-body h3 {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem;
}

.article-body blockquote {
  border-left: 3px solid var(--mint-dim);
  padding: 0.75rem 0 0.75rem 1.5rem;
  margin: 2rem 0;
  color: var(--text-secondary);
  font-style: italic;
  font-size: 1.1rem;
}

.article-body code {
  background: var(--code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9rem;
}

.article-body pre {
  background: var(--code-bg);
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}

.article-body pre code { background: none; padding: 0; }
.article-body img { border-radius: var(--radius); margin: 1.5rem 0; }

.article-body a {
  color: var(--mint-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body a:hover { color: var(--mint-hover); }

.article-body ul, .article-body ol {
  margin: 1rem 0 1.5rem 1.5rem;
  list-style: disc;
}
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 0.5rem; }


/* =========================================================
   COMMENTS
   ========================================================= */
.comments-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.comments-heading {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comments-heading .count {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--mint-soft);
  color: var(--mint-dim);
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  letter-spacing: 0.05em;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.comment {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.comment-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bg-alt);
  border: 2px solid var(--border);
}

.comment-content { flex: 1; min-width: 0; }

.comment-author {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.comment-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.comment-text p { margin-bottom: 0.5rem; }
.comment-text p:last-child { margin-bottom: 0; }


/* =========================================================
   FORMS
   ========================================================= */
.auth-section {
  max-width: 420px;
  margin: 4rem auto;
  padding: 0 2rem;
}

.form-group { margin-bottom: 1.25rem; }

.form-group label,
.form-label {
  display: block;
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-input,
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color var(--transition);
}

.form-input:focus,
.form-control:focus {
  outline: none;
  border-color: var(--mint-dim);
  box-shadow: 0 0 0 3px var(--mint-soft);
}

textarea.form-input,
textarea.form-control {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

.comment-form { margin-bottom: 1rem; }
.comment-form .form-group { margin-bottom: 0.75rem; }
.comment-form .btn { margin-top: 0.25rem; }

.make-post-section {
  max-width: 720px;
  margin: 2rem auto 4rem;
  padding: 0 2rem;
}

.flash-msg {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.05);
  color: #ef4444;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--mint-dim);
  font-weight: 600;
}

.auth-switch a:hover { text-decoration: underline; }


/* =========================================================
   ABOUT
   ========================================================= */
.about-section {
  max-width: 720px;
  margin: 2rem auto 4rem;
  padding: 0 2rem;
}

.about-section p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 1.5rem;
}

.about-section a { color: var(--mint-dim); font-weight: 600; }
.about-section a:hover { text-decoration: underline; }


/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy { font-size: 0.8rem; color: var(--text-muted); }

.footer-socials { display: flex; gap: 0.75rem; }

.footer-socials a {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: all var(--transition);
}

.footer-socials a:hover {
  border-color: var(--mint-dim);
  color: var(--mint-dim);
}


/* =========================================================
   CKEditor 5 Overrides
   ========================================================= */
.ck-editor__editable {
  min-height: 200px;
  background: var(--bg-alt) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  font-family: 'Source Sans Pro', sans-serif !important;
  font-size: 0.95rem !important;
}

.ck-editor__editable:focus {
  border-color: var(--mint-dim) !important;
  box-shadow: 0 0 0 3px var(--mint-soft) !important;
}

.ck.ck-toolbar {
  background: var(--bg-alt) !important;
  border-color: var(--border) !important;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-right {
    position: fixed;
    top: 60px; left: 0; right: 0;
    background: var(--nav-bg);
    backdrop-filter: var(--nav-blur);
    -webkit-backdrop-filter: var(--nav-blur);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .nav-right.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-links { flex-direction: column; gap: 0; }
  .nav-links a { padding: 0.6rem 0; font-size: 0.8rem; }
  .theme-toggle { margin: 0.5rem 0 0; align-self: flex-start; }

  .hero { padding: 3.5rem 1.25rem 2.5rem; }
  .posts-section { padding: 0 1rem 3rem; }
  .post-row { grid-template-columns: 1fr; gap: 0.5rem; padding: 1.25rem; }
  .post-meta-row { margin-top: 0.25rem; }
  .post-arrow { display: none; }
  .post-hero { height: 280px; }
  .article-container { padding: 2rem 1.25rem; }
  .auth-section { padding: 0 1.25rem; }
  .make-post-section { padding: 0 1.25rem; }
  .about-section { padding: 0 1.25rem; }
  .footer-inner { flex-direction: column; gap: 1rem; }
}


/* =========================================================
   BLOG DIAGRAMS (inline SVG in article body)
   ========================================================= */
.blog-diagram { margin: 1.5rem 0; border-radius: var(--radius); border: 1px solid var(--border); padding: 1rem; }
.blog-diagram text.d-title { font-family: 'Source Sans Pro', sans-serif; font-size: 14px; font-weight: 600; }
.blog-diagram text.d-sub { font-family: 'Source Sans Pro', sans-serif; font-size: 12px; }

/* Teal — application services */
.blog-diagram .n-teal { fill: #E1F5EE; stroke: #0F6E56; }
.blog-diagram .t-teal { fill: #085041; }
.blog-diagram .ts-teal { fill: #0F6E56; }
.blog-diagram .arr-teal { stroke: #0F6E56; }

/* Blue — hosting / infrastructure */
.blog-diagram .n-blue { fill: #E6F1FB; stroke: #185FA5; }
.blog-diagram .t-blue { fill: #0C447C; }
.blog-diagram .ts-blue { fill: #185FA5; }
.blog-diagram .arr-blue { stroke: #185FA5; }

/* Gray — neutral / user-facing */
.blog-diagram .n-gray { fill: var(--bg-alt); stroke: var(--border); }
.blog-diagram .t-gray { fill: var(--text); }
.blog-diagram .ts-gray { fill: var(--text-secondary); }
.blog-diagram .arr-gray { stroke: var(--border); }
.blog-diagram .dash-gray { stroke: var(--border); fill: none; }

/* Dark mode overrides */
[data-theme="dark"] .blog-diagram .n-teal { fill: #0a2e24; stroke: #1d9e75; }
[data-theme="dark"] .blog-diagram .t-teal { fill: #5dcaa5; }
[data-theme="dark"] .blog-diagram .ts-teal { fill: #9fe1cb; }
[data-theme="dark"] .blog-diagram .arr-teal { stroke: #1d9e75; }

[data-theme="dark"] .blog-diagram .n-blue { fill: #0c1f33; stroke: #378add; }
[data-theme="dark"] .blog-diagram .t-blue { fill: #85b7eb; }
[data-theme="dark"] .blog-diagram .ts-blue { fill: #b5d4f4; }
[data-theme="dark"] .blog-diagram .arr-blue { stroke: #378add; }
