/* Beyond Identity dark theme for Cobalt blog */

:root {
  --bg: #1a1a1a;
  --bg-elevated: #222222;
  --bg-nav: rgba(30, 30, 30, 0.85);
  --text: #dbe4f0;
  --text-muted: #8b9dc3;
  --border: #333333;
  --accent: #dbe4f0;
  --font-serif: 'Instrument Serif', 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', Menlo, monospace;
  --content-width: 720px;
  --wide-width: 1200px;
}

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

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

a:hover { opacity: 0.8; }

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

/* ---- Floating pill nav ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 1.25rem 2rem;
  pointer-events: none;
}

.site-nav-pill {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.6rem 1.25rem;
  pointer-events: auto;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.site-logo svg { flex-shrink: 0; }

.site-logo-img {
  height: 28px;
  width: auto;
  flex-shrink: 0;
}

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

.nav-link {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.nav-link:hover { color: var(--text); opacity: 1; }

.nav-button {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text);
  border: 1px solid var(--text-muted);
  border-radius: 100px;
  padding: 0.35rem 1rem;
}

.nav-button:hover {
  background: var(--text);
  color: var(--bg);
  opacity: 1;
}

/* ---- Container ---- */
.container {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 4rem;
}

/* ---- Featured post (hero) ---- */
.featured-post {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 8rem 0 4rem;
  text-decoration: none;
  color: inherit;
}

.featured-post:hover { opacity: 1; }
.featured-post:hover .featured-title { opacity: 0.85; }

.featured-image {
  border-radius: 12px;
  overflow: hidden;
}

.featured-image-placeholder {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #1e2a4a 0%, #152040 50%, #0d1530 100%);
  border-radius: 12px;
}

.featured-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.featured-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 1rem;
  color: var(--accent);
}

.featured-excerpt {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.featured-meta, .post-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.meta-author {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.meta-date {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ---- Section divider ---- */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 3rem;
}

/* ---- Post cards grid ---- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
  padding-bottom: 6rem;
}

.post-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.post-card:hover { opacity: 1; }
.post-card:hover .post-card-title { opacity: 0.85; }

.post-card-image {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.post-card-image-placeholder {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1e2a4a 0%, #152040 50%, #0d1530 100%);
  border-radius: 12px;
}

.post-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.post-card-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  color: var(--accent);
  transition: opacity 0.15s ease;
}

.post-card-excerpt {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Post hero image ---- */
.post-hero {
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  margin-top: 5rem;
}

.post-hero-img {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

/* ---- Single post ---- */
.post-header {
  padding: 3rem 0 2rem;
}

.post-hero + .container .post-header {
  padding-top: 3rem;
}

.post-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
  color: var(--accent);
  max-width: 900px;
}

.post-byline {
  display: flex;
  gap: 3rem;
  padding: 1.5rem 0 3rem;
}

.byline-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.byline-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.byline-value {
  font-size: 0.9375rem;
  color: var(--text);
}

/* ---- Post content ---- */
.post-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 0 4rem;
}

.post-content h2 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.15;
  margin: 3rem 0 1rem;
  color: var(--accent);
}

.post-content h3 {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}

.post-content p {
  margin: 0 0 1.25rem;
  color: var(--text);
}

.post-content ul, .post-content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.post-content li { margin-bottom: 0.4rem; }

.post-content strong {
  font-weight: 600;
  color: var(--text);
}

.post-content blockquote {
  border-left: 2px solid var(--text-muted);
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  color: var(--text-muted);
}

.post-content blockquote p:last-child { margin-bottom: 0; }

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-elevated);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent);
}

.post-content pre {
  background: #111111;
  color: #dbe4f0;
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.5;
  border: 1px solid var(--border);
}

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

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.post-content th {
  background: var(--bg-elevated);
  font-weight: 600;
  text-align: left;
  padding: 0.625rem 1rem;
  border: 1px solid var(--border);
  color: var(--text);
}

.post-content td {
  padding: 0.625rem 1rem;
  border: 1px solid var(--border);
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.post-content em:last-child {
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-top: 1rem;
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content a:hover {
  opacity: 0.8;
}

/* ---- Post footer nav ---- */
.post-footer-nav {
  padding: 0 0 4rem;
  max-width: var(--content-width);
  margin: 0 auto;
}

.back-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.back-link:hover { color: var(--text); opacity: 1; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

.footer-inner {
  text-align: center;
}

.footer-inner p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-inner a {
  color: var(--text-muted);
  font-weight: 500;
}

.footer-inner a:hover { color: var(--text); opacity: 1; }

.footer-tagline {
  margin-top: 0.25rem !important;
  font-size: 0.75rem !important;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .container { padding: 0 1.5rem; }

  .featured-post {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 6rem 0 2rem;
  }

  .featured-title { font-size: 2.5rem; }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .post-header { padding: 6rem 0 1.5rem; }
  .post-title { font-size: 2.5rem; }
  .post-content h2 { font-size: 1.75rem; }

  .post-byline { gap: 1.5rem; }

  .site-nav-pill { gap: 1rem; padding: 0.5rem 1rem; }
}
