/* ============================================================
   alexrodba theme — screen.css
   ============================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --color-bg:       #ffffff;
  --color-text:     #111111;
  --color-accent:   var(--ghost-accent-color, #c0392b);
  --color-muted:    #888888;
  --color-border:   #eeeeee;
  --color-hover-bg: #fdf2f0;
  --color-tag-bg:   #f9f9f9;

  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max-content: 680px;
  --max-wide:    800px;
  --max-site:    1160px;

  --header-height: 60px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

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

/* ── Utilities ──────────────────────────────────────────────── */
.u-container {
  width: 100%;
  max-width: var(--max-site);
  margin: 0 auto;
  padding: 0 24px;
}

.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ── Site header ────────────────────────────────────────────── */
.site-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header__inner .site-nav {
  flex: 1;
}

.site-header__logo {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
  white-space: nowrap;
  transition: opacity .15s ease;
}

.site-header__logo:hover {
  opacity: .7;
}

/* Primary nav — Ghost outputs <ul class="nav"> inside .site-nav */
.site-nav .nav,
.site-nav--mobile .nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav .nav li a,
.site-nav--mobile .nav li a {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-muted);
  padding: 6px 10px;
  border-radius: 5px;
  transition: color .15s ease, background .15s ease;
}

.site-nav .nav li a:hover,
.site-nav .nav li.nav-current a {
  color: var(--color-text);
  background: var(--color-tag-bg);
}

/* Mobile menu button */
.site-header__menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-text);
}

.site-header__menu-btn svg {
  display: block;
}

/* Mobile nav */
.site-nav--mobile {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--color-border);
}

.site-nav--mobile.is-open {
  display: flex;
}

.site-nav--mobile .nav {
  flex-direction: column;
  padding: 8px 0 16px;
}

.site-nav--mobile .nav li a {
  padding: 10px 24px;
  border-radius: 0;
  font-size: 15px;
}

.site-nav--mobile .nav li.nav-current a {
  color: var(--color-text);
  background: none;
}

/* ── Site footer ────────────────────────────────────────────── */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  padding: 32px 0;
  font-size: 13px;
  color: var(--color-muted);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex-wrap: wrap;
}

.site-footer__nav a {
  color: var(--color-muted);
  padding: 4px 8px;
  border-radius: 4px;
  transition: color .15s ease;
}

.site-footer__nav a:hover {
  color: var(--color-text);
}

.site-footer__sep {
  color: var(--color-border);
}

.site-footer__subscribe {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent);
  border: 1px solid currentColor;
  padding: 6px 14px;
  border-radius: 5px;
  transition: background .15s ease, color .15s ease;
  cursor: pointer;
  background: none;
  font-family: var(--font);
}

.site-footer__subscribe:hover {
  background: var(--color-accent);
  color: #fff;
}

.site-footer__credit {
  font-size: 12px;
  color: #cccccc;
}

/* ── Homepage / post feed ───────────────────────────────────── */
.feed {
  padding: 48px 0 80px;
}

.feed__inner {
  max-width: var(--max-site);
  margin: 0 auto;
  padding: 0 24px;
}

/* Featured (first) post */
.feed__featured {
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--color-border);
}

.feed__featured-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 14px;
}

.feed__featured-title {
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  max-width: 700px;
}

.feed__featured-title a {
  transition: color .15s ease;
}

.feed__featured-title a:hover {
  color: var(--color-accent);
}

.feed__featured-excerpt {
  font-size: 16px;
  color: var(--color-muted);
  line-height: 1.65;
  max-width: 580px;
  margin-bottom: 16px;
}

.feed__featured-meta {
  font-size: 12px;
  color: #bbbbbb;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Post list */
.feed__list {
  display: flex;
  flex-direction: column;
}

/* ── Post card (list row) ───────────────────────────────────── */
.post-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.post-card__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  transition: color .15s ease;
}

.post-card:hover .post-card__title {
  color: var(--color-accent);
}

.post-card__right {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}

.post-card__tags {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.post-card__tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: .6;
  transition: opacity .15s ease;
}

.post-card:hover .post-card__tag {
  opacity: 1;
}

.post-card__meta {
  font-size: 12px;
  color: #cccccc;
  white-space: nowrap;
}

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 0 0;
  font-size: 13px;
  font-weight: 500;
}

.pagination__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  padding: 8px 16px;
  border-radius: 5px;
  transition: color .15s ease, border-color .15s ease;
}

.pagination__link:hover {
  color: var(--color-text);
  border-color: #cccccc;
}

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

/* ── Single post ────────────────────────────────────────────── */
.post {
  padding: 48px 0 80px;
}

.post__inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 24px;
}

.post__header {
  margin-bottom: 40px;
}

.post__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.post__tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  padding: 3px 9px;
  border-radius: 4px;
  opacity: .7;
  transition: opacity .15s ease;
}

.post__tag:hover {
  opacity: 1;
}

.post__title {
  font-size: clamp(30px, 4.5vw, 52px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}

.post__byline {
  font-size: 13px;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.post__byline-sep {
  color: var(--color-border);
}

/* Feature image */
.post__feature-image {
  margin-bottom: 48px;
}

.post__feature-image img {
  width: 100%;
  border-radius: 6px;
}

/* For wide feature image (bleeds past content width) */
.post--has-image .post__header {
  max-width: var(--max-content);
  margin: 0 auto 0;
  padding: 0 24px;
}

.post--has-image .post__feature-image {
  max-width: var(--max-wide);
  margin: 32px auto 48px;
  padding: 0 24px;
}

/* Post body */
.post__content {
  font-size: clamp(16px, 1.1vw, 17.5px);
  line-height: 1.8;
  color: #1a1a1a;
}

.post__content > * + * {
  margin-top: 1.5em;
}

.post__content h2 {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  margin-top: 2.5em;
  margin-bottom: .6em;
}

.post__content h3 {
  font-size: clamp(17px, 1.5vw, 21px);
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: .5em;
}

.post__content h4, .post__content h5, .post__content h6 {
  font-size: 16px;
  font-weight: 700;
  margin-top: 1.8em;
  margin-bottom: .4em;
}

.post__content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-accent) 40%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color .15s ease;
}

.post__content a:hover {
  text-decoration-color: var(--color-accent);
}

.post__content strong {
  font-weight: 700;
}

.post__content em {
  font-style: italic;
}

.post__content blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 20px;
  color: #444;
  font-style: italic;
}

.post__content code {
  font-family: 'JetBrains Mono', 'Menlo', 'Consolas', monospace;
  font-size: .87em;
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
}

.post__content pre {
  background: #f5f5f5;
  padding: 20px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 14px;
}

.post__content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.post__content ul, .post__content ol {
  padding-left: 1.5em;
}

.post__content li + li {
  margin-top: .4em;
}

.post__content hr {
  border: none;
  border-top: 2px solid var(--color-accent);
  width: 40px;
  margin: 2.5em 0;
  opacity: .4;
}

.post__content img {
  border-radius: 5px;
  margin: 0 auto;
}

.post__content figure {
  margin: 0;
}

.post__content figcaption {
  font-size: 13px;
  color: var(--color-muted);
  text-align: center;
  margin-top: 8px;
}

/* Post footer */
.post__footer {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.post__footer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 40px;
}

/* Post nav (prev / next) */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  font-size: 13px;
}

.post-nav__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  transition: border-color .15s ease, background .15s ease;
}

.post-nav__item:hover {
  border-color: #cccccc;
  background: #fafafa;
}

.post-nav__item--next {
  text-align: right;
  margin-left: auto;
}

.post-nav__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.post-nav__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

/* ── Static page ────────────────────────────────────────────── */
.page {
  padding: 48px 0 80px;
}

.page__inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 24px;
}

.page__header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
}

.page__title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.page__content {
  font-size: clamp(15px, 1vw, 16.5px);
  line-height: 1.8;
  color: #1a1a1a;
}

/* Inherit same content styles from post */
.page__content > * + * { margin-top: 1.4em; }
.page__content h2 { font-size: clamp(19px, 1.8vw, 24px); font-weight: 700; margin-top: 2.5em; }
.page__content h3 { font-size: clamp(16px, 1.4vw, 20px); font-weight: 700; margin-top: 2em; }
.page__content a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }
.page__content strong { font-weight: 700; }
.page__content blockquote { border-left: 3px solid var(--color-accent); padding-left: 20px; color: #444; font-style: italic; }
.page__content code { font-family: 'JetBrains Mono', monospace; font-size: .87em; background: #f5f5f5; padding: 2px 6px; border-radius: 3px; }
.page__content ul, .page__content ol { padding-left: 1.5em; }
.page__content li + li { margin-top: .4em; }
.page__content hr { border: none; border-top: 2px solid var(--color-accent); width: 40px; margin: 2.5em 0; opacity: .4; }
.page__content img { border-radius: 5px; }
.page__content figcaption { font-size: 13px; color: var(--color-muted); text-align: center; margin-top: 8px; }

/* ── Tag archive ────────────────────────────────────────────── */
.tag-archive {
  padding: 48px 0 80px;
}

.tag-archive__inner {
  max-width: var(--max-site);
  margin: 0 auto;
  padding: 0 24px;
}

.tag-archive__header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
}

.tag-archive__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 10px;
}

.tag-archive__title {
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.tag-archive__description {
  font-size: 15px;
  color: var(--color-muted);
  max-width: 520px;
  line-height: 1.65;
}

.tag-archive__count {
  margin-top: 8px;
  font-size: 12px;
  color: #cccccc;
}

/* ── Author archive ─────────────────────────────────────────── */
.author-archive {
  padding: 48px 0 80px;
}

.author-archive__inner {
  max-width: var(--max-site);
  margin: 0 auto;
  padding: 0 24px;
}

.author-archive__header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 20px;
}

.author-archive__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-archive__name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.author-archive__bio {
  font-size: 14px;
  color: var(--color-muted);
  line-height: 1.5;
}

/* ── Error page ─────────────────────────────────────────────── */
.error-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}

.error-page__code {
  font-size: 80px;
  font-weight: 800;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: 16px;
}

.error-page__title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.error-page__message {
  font-size: 15px;
  color: var(--color-muted);
  margin-bottom: 32px;
}

.error-page__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  padding: 10px 20px;
  border-radius: 5px;
  transition: background .15s ease, color .15s ease;
}

.error-page__link:hover {
  background: var(--color-accent);
  color: #fff;
}

/* ── Ghost portal overrides ────────────────────────────────── */

/* Hide Ghost's floating portal trigger iframe — we use the footer button only */
iframe[title="portal-trigger"] {
  display: none !important;
}

/* Hide footer nav links */
.site-footer__nav {
  display: none !important;
}

/* Green availability dot on the Hire nav item */
.nav-hire a::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  margin-left: 5px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* ── Ghost card overrides ───────────────────────────────────── */
.kg-width-wide {
  max-width: var(--max-wide);
  margin-left: auto;
  margin-right: auto;
}

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

.kg-image-card img {
  border-radius: 5px;
}

.kg-bookmark-card {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}

.kg-callout-card {
  border-radius: 6px;
  padding: 16px 20px;
}

.kg-toggle-card {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 14px 18px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .site-nav {
    display: none;
  }

  .site-header__menu-btn {
    display: flex;
  }

  .feed__featured-title {
    font-size: 26px;
  }

  .post-card {
    flex-direction: column;
    gap: 4px;
  }

  .post-card__left {
    flex-wrap: wrap;
  }

  .post-card__meta {
    font-size: 11px;
    color: #cccccc;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .tag-archive__description {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .post__title {
    font-size: 28px;
  }

  .pagination {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
