/* Deep Principle blog — OpenAI-inspired light theme. */

@font-face {
  font-family: Aldrich;
  src: url('../fonts/Aldrich-Regular.ttf') format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-subtle: #f7f7f8;
  --bg-code: #f4f4f5;
  --text: #0d0d0d;
  --text-muted: #6e6e80;
  --text-soft: #353740;
  --border: #e5e5e7;
  --link-accent: #1f4ee8;
  --content-width: 960px;
  --wide-width: 1120px;
  --shell-width: 1280px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Söhne", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

a { color: inherit; }

/* ---------- Header (mirrors official navbar dimensions/typography) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(13, 13, 13, 0.08);
  font-family: Aldrich, -apple-system, BlinkMacSystemFont, sans-serif;
  text-transform: uppercase;
}
.site-header__inner {
  max-width: var(--shell-width);
  margin: 0 auto;
  height: 5.5rem;
  min-height: 4.5rem;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
}
.site-logo {
  display: flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  border-right: 1px solid rgba(13, 13, 13, 0.1);
  text-decoration: none;
  flex: none;
}
.site-logo__icon,
.site-logo__text {
  height: 2.5rem;
  width: auto;
  display: block;
}
.site-logo__text { margin-left: 0.5rem; }
.site-nav {
  display: flex;
  align-items: stretch;
  height: 100%;
}
.site-nav a {
  display: flex;
  align-items: center;
  padding: 0.5rem 2rem;
  font-size: 0.875rem;
  line-height: 1;
  letter-spacing: 0.02em;
  color: rgba(13, 13, 13, 0.5);
  text-decoration: none;
  transition: color .2s, box-shadow .2s;
}
.site-nav a:hover {
  color: var(--text);
  box-shadow: inset 0 0 20px rgba(13, 13, 13, 0.08);
}
.site-nav a.is-current { color: var(--text); }
@media (max-width: 760px) {
  .site-header__inner { height: 3.5rem; min-height: 3.5rem; }
  .site-logo { padding: 0.35rem 0.75rem; border-right: none; }
  .site-logo__icon,
  .site-logo__text { height: 1.6rem; }
  .site-logo__text { display: none; }
  .site-nav a { padding: 0.5rem 1rem; font-size: 0.75rem; }
}

/* ---------- Layout containers ---------- */
.container { max-width: var(--content-width); margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: var(--wide-width); margin: 0 auto; padding: 0 24px; }

.site-main { padding: 32px 0 96px; }

/* ---------- Index page ---------- */
.index-hero { padding: 56px 0 32px; text-align: center; }
.index-hero__title {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.index-hero__description {
  font-size: 18px;
  color: var(--text-muted);
  margin: 0 auto;
  max-width: 640px;
}

.post-list {
  padding: 24px 0 32px;
}
.post-list__item {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.post-list__item:last-child { border-bottom: none; }
.post-list__link {
  display: contents;
  color: inherit;
  text-decoration: none;
}
.post-list__text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.post-list__eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.post-list__title {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}
.post-list__excerpt {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.post-list__meta { font-size: 13px; color: var(--text-muted); margin: 0; margin-top: auto; }
.post-list__image-wrap {
  align-self: center;
}
.post-list__image {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg-subtle);
  display: block;
}
.post-list__link:hover .post-list__title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.post-list__empty {
  text-align: center;
  color: var(--text-muted);
  padding: 80px 0;
}

/* ---------- Single post / page ---------- */
.post-hero {
  padding: 48px 0 24px;
  text-align: center;     /* global: title/subtitle/meta all centered */
}
.post-hero__eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.post-hero__eyebrow a { text-decoration: none; color: inherit; }
.post-hero__eyebrow a:hover { color: var(--text); }
.post-hero__title {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--text);
}
.post-hero__excerpt {
  font-size: 20px;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0 auto 24px;
  max-width: 760px;
}
.post-hero__meta {
  font-size: 14px;
  color: var(--text-muted);
}
.post-hero__meta > span + span::before {
  content: "·";
  margin: 0 8px;
  color: var(--border);
}

/* Per-post action row (e.g. Product / Release CTA pills).
   Convention: a post's body may start with
       <div class="post-actions"><a ...>X</a><a ...>Y</a></div>
   A small inline script in default.hbs hoists that block into the hero,
   just below .post-hero__meta, on first paint. Without JS it still renders
   correctly — just inline at the top of the body. */
.post-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
}
.post-actions a {
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  background: var(--bg);
  transition: background .15s, border-color .15s, color .15s;
}
.post-actions a:hover {
  background: var(--bg-subtle);
  border-color: var(--text-soft);
}
.post-hero .post-actions {
  /* When hoisted into the hero, give a little more breathing room. */
  margin-top: 24px;
  margin-bottom: 4px;
}
.post-feature-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  margin: 32px 0 40px;
}

.post-content {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
}
.post-content > * + * { margin-top: 1.25em; }
.post-content > :first-child { margin-top: 0; }
.post-content h1 { font-size: 32px; font-weight: 700; line-height: 1.2; margin-top: 2em; letter-spacing: -0.01em; }
.post-content h2 { font-size: 26px; font-weight: 700; line-height: 1.25; margin-top: 2em; letter-spacing: -0.01em; }
.post-content h3 { font-size: 20px; font-weight: 600; line-height: 1.35; margin-top: 1.8em; }
.post-content h4 { font-size: 17px; font-weight: 600; margin-top: 1.6em; }
.post-content p, .post-content ul, .post-content ol { margin: 0 0 1.1em; }
.post-content a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.post-content a:hover { color: var(--link-accent); }
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1.5em auto;   /* center any standalone img */
  display: block;
}
.post-content figure {
  margin: 1.5em auto;   /* center the figure block as a whole */
  text-align: center;   /* centers img + figcaption inside */
}
.post-content figure img { margin: 0 auto; }
.post-content figcaption {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.7em;
}
.post-content blockquote {
  border-left: 3px solid var(--border);
  padding: 4px 0 4px 20px;
  margin: 1.5em 0;
  color: var(--text-soft);
}
.post-content blockquote p { margin-bottom: 0.6em; }
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  background: var(--bg-code);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.post-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.65;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
.post-content pre code {
  background: transparent;
  padding: 0;
  border: none;
  font-size: inherit;
}
.post-content ul, .post-content ol { padding-left: 1.5em; }
.post-content li { margin-bottom: 0.4em; }
.post-content li > ul, .post-content li > ol { margin-top: 0.4em; }
.post-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}
.post-content strong { font-weight: 600; }
.post-content em { font-style: italic; }
.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 1.5em 0;
}
.post-content table th,
.post-content table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.post-content table th { background: var(--bg-subtle); font-weight: 600; }
.post-content .kg-card { margin: 1.5em 0; }
.post-content .kg-bookmark-card,
.post-content .kg-callout-card { border: 1px solid var(--border); border-radius: 10px; padding: 16px; }

/* ---------- Tags / pagination ---------- */
.post-tags {
  margin-top: 3em;
  padding-top: 1.5em;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}
.post-tags a {
  color: var(--text-muted);
  text-decoration: none;
  margin-right: 14px;
}
.post-tags a:hover { color: var(--text); }

.pagination {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 24px 0;
  font-size: 14px;
}
.pagination a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: background .15s;
}
.pagination a:hover { background: var(--bg-subtle); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  font-size: 14px;
  color: var(--text-muted);
}
.site-footer__inner {
  max-width: var(--shell-width);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.site-footer__left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.site-footer__brand { display: inline-flex; align-items: center; }
.site-footer__logo-icon,
.site-footer__logo-text { height: 1.25rem; width: auto; display: block; }
.site-footer__logo-text { margin-left: 0.3rem; }
.site-footer__center { text-align: center; }
.site-footer__center a { color: var(--text-muted); text-decoration: none; }
.site-footer__center a:hover { color: var(--text); }
.site-footer__right { display: flex; justify-content: flex-end; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
@media (max-width: 760px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 14px;
    padding: 0 20px;
  }
  .site-footer__left { justify-content: center; }
  .site-footer__right { justify-content: center; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .site-header__inner { padding: 12px 20px; }
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 13px; }
  .index-hero { padding: 36px 0 20px; }
  .index-hero__title { font-size: 30px; }
  .post-hero { padding: 32px 0 16px; }
  .post-hero__title { font-size: 30px; }
  .post-hero__excerpt { font-size: 17px; }
  .post-list__item { grid-template-columns: 1fr; gap: 14px; padding: 22px 0; }
  .post-list__image { aspect-ratio: 16 / 9; }
  .post-content { font-size: 16px; }
  .post-content h2 { font-size: 22px; }
  .post-content h3 { font-size: 18px; }
  .site-footer__inner { padding: 0 20px; }
}

/* Hide Ghost portal trigger if Members is enabled */
[data-portal] iframe { display: none !important; }
