/* ============================================================
   Subhi Fareed — minimal portfolio
   Styled after joshwilliams.io: narrow centered column,
   plain headings, light theme, lots of whitespace.
   ============================================================ */

:root {
  --container: 800px;
  --bg: #0d1117;
  --card: #161b22;
  --text: #e6edf3;
  --muted: #8b949e;
  --link: #58a6ff;
  --border: #30363d;
  --code-bg: rgba(110, 118, 129, 0.25);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--link);
}

/* Keyboard focus indicator (links strip their underline, so make focus clear) */
a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Visually hidden but available to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 22px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 28px;
}

.brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.menu {
  display: flex;
  gap: 28px;
}

.menu a {
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
}

.menu a:hover {
  text-decoration: underline;
}

.menu a[aria-current="page"],
.menu a[aria-current="true"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Content ---------- */
.content {
  padding-top: 64px;
  padding-bottom: 64px;
}

.content section {
  margin-bottom: 80px;
}

.content h1,
.content > section h2 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.content p {
  color: var(--muted);
  margin-bottom: 18px;
  max-width: 640px;
}

/* ---------- Certification badges ---------- */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.badges .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 96px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  background: var(--card);
}

/* ---------- Links ---------- */
.link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-list a {
  font-size: 1.15rem;
}
.link-list .muted-note {
  color: var(--muted);
  font-size: 0.95rem;
  list-style: none;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
}

.site-footer p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  .content h1,
  .content > section h2 {
    font-size: 2rem;
  }
  .badges .badge {
    min-width: 84px;
    height: 84px;
  }
}

/* ============================================================
   Blog index (blog.html)
   ============================================================ */
.blog-intro {
  color: var(--muted);
  margin-bottom: 28px;
}

/* Search + tag filter */
.blog-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 44px;
}
.search-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: var(--card);
  color: var(--text);
}
.search-input:focus {
  outline: 2px solid var(--link);
  outline-offset: 1px;
  border-color: var(--link);
}
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-chip {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--muted);
}
.tag-chip:hover {
  border-color: var(--link);
  color: var(--link);
}
.tag-chip.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.tag-count {
  opacity: 0.6;
  font-size: 0.8em;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.post-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  text-decoration: none;
}

.post-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.post-link:hover .post-title {
  text-decoration: underline;
}

.post-date {
  color: var(--muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

.post-summary {
  color: var(--muted);
  margin-top: 8px;
  max-width: 640px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag {
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
}

.notice {
  color: var(--muted);
}

/* ============================================================
   Single post (post.html)
   ============================================================ */
.back-link {
  display: inline-block;
  margin-bottom: 28px;
  text-decoration: none;
  font-size: 0.95rem;
}
.back-link:hover {
  text-decoration: underline;
}

#post h1 {
  margin-bottom: 10px;
}

.post-meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 40px;
}

/* Rendered Markdown */
.post-body {
  font-size: 1.05rem;
}
.post-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 40px 0 14px;
  letter-spacing: -0.01em;
}
.post-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 30px 0 10px;
}
.post-body p {
  color: var(--muted);
  margin-bottom: 18px;
}
.post-body ul,
.post-body ol {
  color: var(--muted);
  margin: 0 0 18px 1.4em;
}
.post-body li {
  margin-bottom: 6px;
}
.post-body strong {
  color: var(--text);
}
.post-body blockquote {
  border-left: 3px solid var(--border);
  padding-left: 16px;
  margin: 0 0 18px;
  color: var(--muted);
}
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Inline code */
.post-body :not(pre) > code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text);
}

/* Code blocks (highlight.js fills the inner <code>) */
.post-body pre {
  margin: 0 0 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
