/* CTF Writeups — styling mirrored from portfolio-website/index.css
 * so this reads as part of pymite6941.is-a.dev.
 *
 * Values below are copied from that stylesheet, not approximated. If the
 * portfolio's palette or card treatment changes, update this to match.
 * Note 'Google Sans' is not actually loaded there either — it falls back to
 * the system sans-serif. Kept identical so both sites render the same. */

:root {
  --bg-color: #0d1117;
  --text-color: #e6edf3;
  --text-muted: #8b949e;
  --link-color: #61afef;
  --card-bg: #161b22;
  --card-bg-hover: #1c2128;
  --button-color: #8957e5;
  --border-color: #30363d;
  --code-bg: #21252b;
  --code-color: #abb2bf;
  --pill-bg: #282c34;

  --accent-green: #3fb950;
  --accent-yellow: #d29922;
  --accent-red: #f85149;

  --font-sans: "Google Sans", sans-serif;
  --font-mono: "Consolas", "Courier New", monospace;

  color-scheme: dark;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  overflow-x: hidden;
}

body {
  color: var(--text-color);
  font-family: var(--font-sans);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------- nav (mirrors .nav in the portfolio) ---------- */

.nav {
  top: 0;
  z-index: 100;
  width: 100%;
  padding: 0 16px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(30, 33, 39, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(62, 68, 81, 0.6);
  position: sticky;
}

.nav-link {
  text-decoration: none;
  color: var(--link-color);
  padding: 8px 4px;
}

.nav-btn {
  background-color: var(--button-color);
  color: #fff;
  border-radius: 12px;
  display: inline-block;
  font-weight: bold;
  padding: 5px 10px;
  text-decoration: none;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ---------- header ---------- */

.site-head {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
}

.site-head h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  color: var(--text-color);
  letter-spacing: -0.02em;
}

.site-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.text-link,
.back-link {
  color: var(--link-color);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}

.text-link:hover,
.text-link:focus,
.back-link:hover,
.back-link:focus {
  text-decoration-thickness: 2px;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

/* ---------- listing ---------- */

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 2rem;
}

.stat {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 18px 24px;
  flex: 1 1 140px;
}

.stat .num {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--link-color);
  line-height: 1.2;
}

.stat .label {
  color: #c9d1d9;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.75px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.filter-btn {
  padding: 4px 12px;
  background: var(--pill-bg);
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--code-color);
  font-family: inherit;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.filter-btn:hover {
  background: var(--card-bg-hover);
  color: var(--text-color);
}

.filter-btn.active {
  background-color: var(--button-color);
  color: #fff;
  font-weight: bold;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
}

/* Card treatment copied from .card-container — lift + blue glow on hover,
   no border (the portfolio uses background contrast instead). */
.post-item {
  background-color: var(--card-bg);
  border-radius: 12px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.post-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(88, 166, 255, 0.2);
  background-color: var(--card-bg-hover);
}

.post-item a {
  display: block;
  padding: 24px;
  text-decoration: none;
  color: var(--link-color);
}

.post-item h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: var(--text-color);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Mirrors .boxes — the portfolio's tech-stack pills. */
.pill {
  padding: 4px 8px;
  display: inline-block;
  background: var(--pill-bg);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--code-color);
  white-space: nowrap;
}

.pill.diff-Intro,
.pill.diff-Easy {
  color: var(--accent-green);
}

.pill.diff-Medium {
  color: var(--accent-yellow);
}

.pill.diff-Hard {
  color: var(--accent-red);
}

.empty {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
}

/* ---------- article ---------- */

.post-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
}

.post-header h1 {
  margin: 0 0 12px;
  font-size: 1.9rem;
  color: var(--text-color);
  letter-spacing: -0.02em;
}

.article {
  line-height: 1.6;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.article h2,
.article h3,
.article h4 {
  color: var(--text-color);
}

.article h2 {
  margin-top: 2.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 1.4rem;
}

.article h3 {
  margin-top: 1.75rem;
  font-size: 1.15rem;
}

.article strong {
  color: var(--text-color);
}

.article a {
  color: var(--link-color);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}

.article img {
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.article blockquote {
  margin: 1.25rem 0;
  padding: 12px 20px;
  border-left: 3px solid var(--button-color);
  background-color: var(--card-bg);
  border-radius: 0 8px 8px 0;
}

.article blockquote p {
  margin: 0.35rem 0;
}

/* Mirrors .code-segment. */
.article code {
  background-color: var(--code-bg);
  color: var(--code-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.12em 0.4em;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.article pre {
  padding: 15px;
  background-color: var(--code-bg);
  color: var(--code-color);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.article pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.table-scroll {
  overflow-x: auto;
  margin: 1.25rem 0;
}

.article table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

.article th,
.article td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
}

.article th {
  background-color: var(--card-bg);
  color: var(--text-color);
  font-weight: 600;
}

.article hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}

/* ---------- footer (mirrors .foot) ---------- */

.site-foot {
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
  padding: 32px 0 24px;
}

.site-foot p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-foot a {
  color: var(--link-color);
}

/* ---------- responsive ---------- */

@media (max-width: 600px) {
  .wrap {
    padding: 1.5rem 1rem 3rem;
  }
  .site-head h1 {
    font-size: 1.6rem;
  }
  .post-header h1 {
    font-size: 1.45rem;
  }
  .article {
    font-size: 1rem;
  }
  .stat {
    flex: 1 1 100%;
  }
  .post-item a {
    padding: 18px;
  }
}
