/* ============================================
   krey.io Ghost Theme — Style Sheet
   ============================================ */

/* --- Fonts --- */
@font-face {
  font-family: "Geist Sans";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Geist Sans", sans-serif;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.5;
  color: #18181b;
  background-color: #fafafa;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

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

/* --- Layout --- */
.container {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 768px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* --- Site Header --- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
}

@media (min-width: 768px) {
  .site-header {
    padding-top: 4rem;
  }
}

.site-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
}

.subscribe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.75rem;
  font-family: "Geist Sans", sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #e4e4e7;
  border-radius: 0.375rem;
  background: transparent;
  color: #18181b;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background-color 150ms;
}

.subscribe-btn:hover {
  background-color: #f4f4f5;
}

/* --- Social Links --- */
.social-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.375rem;
  transition: background-color 150ms;
}

.social-link:hover {
  background-color: #f4f4f5;
}

.social-link svg {
  width: 1rem;
  height: 1rem;
  fill: #18181b;
}

/* --- Bio --- */
.bio {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .bio {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}

/* --- Section --- */
.section {
  padding-top: 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.section-spacing {
  padding-top: 1.5rem;
}

/* --- Post List --- */
.post-list {
  padding-top: 0.5rem;
}

.post-list > li + li {
  border-top: 1px solid #e4e4e7;
}

/* --- Post Card --- */
.post-card {
  padding: 0.75rem 0;
  cursor: pointer;
  transition: color 150ms;
}

.post-card > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-card-date {
  font-size: 0.75rem;
  font-weight: 300;
  color: #71717a;
  transition: color 150ms;
}

.post-card-reading-time {
  font-size: 0.75rem;
  font-weight: 300;
  color: #71717a;
  transition: color 150ms;
}

.post-card-reading-time::before {
  content: "·";
  margin-right: 0.5rem;
}

.post-card h2 {
  font-size: 1rem;
  font-weight: 600;
  padding-bottom: 0.25rem;
  transition: color 150ms;
}

.post-card .summary {
  font-size: 0.875rem;
  font-weight: 300;
  color: #71717a;
  transition: color 150ms;
}

.post-card .arrow {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  color: #d4d4d8;
  transition: color 150ms;
}

.post-card .arrow svg {
  width: 1rem;
  height: 1rem;
}

.post-card:hover .post-card-date,
.post-card:hover .post-card-reading-time,
.post-card:hover .summary {
  color: #3f3f46;
}

.post-card:hover h2 {
  color: #000;
}

.post-card:hover .arrow {
  color: #52525b;
}

/* --- OSS Project Card --- */
.oss-card {
  padding: 0.75rem 0;
  transition: color 150ms;
}

.oss-card > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.oss-card h2 {
  font-size: 1rem;
  font-weight: 600;
  padding-bottom: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 150ms;
}

.oss-prefix {
  font-size: 1rem;
  font-weight: 400;
  color: #a1a1aa;
}

.oss-card:hover .oss-prefix {
  color: #71717a;
}

.oss-card:hover h2 {
  color: #000;
}

.oss-card .summary {
  font-size: 0.875rem;
  font-weight: 300;
  color: #71717a;
  transition: color 150ms;
}

.oss-card:hover .summary {
  color: #3f3f46;
}

.oss-stars {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #d4d4d8;
  transition: color 150ms;
  flex-shrink: 0;
}

.oss-card:hover .oss-stars {
  color: #52525b;
}

.oss-stars svg {
  width: 0.75rem;
  height: 0.75rem;
}

.oss-stars small {
  font-size: 0.75rem;
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 300;
  border-radius: 0.375rem;
  background-color: #f4f4f5;
  color: #18181b;
  margin-left: 0.5rem;
}

/* --- View All Button --- */
.view-all {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  display: flex;
  justify-content: flex-end;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-family: "Geist Sans", sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #e4e4e7;
  border-radius: 0.375rem;
  background: transparent;
  color: #18181b;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background-color 150ms;
}

.btn-outline:hover {
  background-color: #f4f4f5;
}

/* --- Separator --- */

/* --- Footer --- */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-top: 1px solid #e4e4e7;
}

@media (min-width: 768px) {
  .site-footer {
    padding: 2rem 0;
  }
}

.site-footer p {
  font-size: 0.875rem;
  color: #71717a;
}

.site-footer .social-links {
  margin-left: auto;
}

/* --- Post Page --- */
.post-page {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .post-page {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}

.post-title {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 2.25rem;
  max-width: 650px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  max-width: 650px;
  font-size: 0.875rem;
  color: #525252;
}

.post-meta .reading-time::before {
  content: "·";
  margin-right: 0.5rem;
}

/* --- Prose / Post Content --- */
.post-content {
  color: #404040;
  max-width: 65ch;
  line-height: 1.75;
}

.post-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 0.5em;
  color: #18181b;
  line-height: 1.3;
}

.post-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.6em;
  margin-bottom: 0.4em;
  color: #18181b;
  line-height: 1.4;
}

.post-content h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.4em;
  color: #18181b;
}

.post-content p {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.post-content a {
  color: #18181b;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content a:hover {
  color: #000;
}

.post-content strong {
  color: #18181b;
  font-weight: 600;
}

.post-content blockquote {
  border-left: 3px solid #e4e4e7;
  padding-left: 1em;
  font-style: normal;
  color: #71717a;
}

/* prose-quoteless */
.post-content blockquote p::before,
.post-content blockquote p::after {
  content: none;
}

.post-content ul {
  list-style-type: disc;
  padding-left: 1.5em;
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.post-content ol {
  list-style-type: decimal;
  padding-left: 1.5em;
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.post-content li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.post-content li > ul,
.post-content li > ol {
  margin-top: 0.25em;
  margin-bottom: 0.25em;
}

.post-content code {
  font-family: "Geist Mono", monospace;
  font-size: 0.875em;
  background: #f4f4f5;
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
}

.post-content pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  font-size: 0.875rem;
  line-height: 1.7;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
}

.post-content img {
  border-radius: 0.5rem;
  margin-top: 2em;
  margin-bottom: 2em;
}

.post-content hr {
  border: none;
  border-top: 1px solid #e4e4e7;
  margin-top: 2em;
  margin-bottom: 2em;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  font-size: 0.875rem;
}

.post-content th {
  font-weight: 600;
  text-align: left;
  padding: 0.5em 0.75em;
  border-bottom: 2px solid #e4e4e7;
}

.post-content td {
  padding: 0.5em 0.75em;
  border-bottom: 1px solid #e4e4e7;
}

/* Ghost width classes */
.kg-width-wide {
  max-width: 56rem;
  margin-left: calc(50% - 28rem);
  margin-right: calc(50% - 28rem);
}

.kg-width-full {
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

@media (max-width: 56rem) {
  .kg-width-wide {
    margin-left: -1rem;
    margin-right: -1rem;
  }
}

/* Ghost card overrides */
.post-content .kg-image-card img,
.post-content .kg-gallery-image img {
  border-radius: 0.5rem;
}

.post-content .kg-bookmark-card {
  border: 1px solid #e4e4e7;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}

.post-content .kg-bookmark-card a {
  text-decoration: none;
}

.post-content figcaption {
  text-align: center;
  font-size: 0.8rem;
  color: #71717a;
  margin-top: 0.75em;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 0 1rem;
}

/* --- Prism.js Overrides --- */
pre[class*="language-"] {
  background: #1e1e1e;
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  font-family: "Geist Mono", monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}

code[class*="language-"] {
  font-family: "Geist Mono", monospace;
}

/* --- Ghost Custom Fonts Support --- */
:root {
  --gh-font-heading: "Geist Sans", sans-serif;
  --gh-font-body: "Geist Sans", sans-serif;
}

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
