/* Der Sicherheitssalamander — Ghost theme styles */

:root[data-theme="light"] {
  --bg: #faf9f6;
  --bg-alt: #f2f0ea;
  --text: #1c211f;
  --text-muted: #535d5a;
  --text-faint: #8a938f;
  --border: #e3e0d7;
  --accent: #3568c9;
  --accent2: #c8791f;
  --accent-soft: rgba(53,104,201,0.08);
  --accent2-soft: rgba(200,121,31,0.1);
  --image-bg: #eeece4;
  --image-stripe: #e0ddd2;
  --image-label: #96988f;
  --chip-bg: rgba(28,33,31,0.04);
}

:root[data-theme="dark"] {
  --bg: #12161a;
  --bg-alt: #171c21;
  --text: #eef1f0;
  --text-muted: #b6bfc0;
  --text-faint: #7c8688;
  --border: #262c31;
  --accent: #3568c9;
  --accent2: #c8791f;
  --accent-soft: rgba(255,255,255,0.06);
  --accent2-soft: rgba(255,255,255,0.08);
  --image-bg: #1b2126;
  --image-stripe: #242b31;
  --image-label: #5c666a;
  --chip-bg: rgba(255,255,255,0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

body {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
}

a { text-decoration: none; }

::selection { background: rgba(53,104,201,0.2); }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand img.logo-image {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  object-fit: cover;
  flex-shrink: 0;
}
.logo-badge {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.brand-text .title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text .tagline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-nav {
  display: flex;
  align-items: center;
}
.site-nav ul {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav li { margin: 0; }
.site-nav a {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  position: relative;
  padding-bottom: 3px;
  transition: color 0.15s ease;
}
.site-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: right 0.2s ease;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a:hover::after { right: 0; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.mode-toggle {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.mode-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }
.signup-btn {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
}
.signup-btn:hover { opacity: 0.92; }

/* Hero / featured post */
.hero {
  padding: 88px 0 56px;
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}
.kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 18px 0 18px;
}
.hero h1 a { color: inherit; }
.hero p.excerpt {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 22px;
  max-width: 52ch;
}
.byline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  object-fit: cover;
}
.byline-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.byline-meta .name {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
}
.byline-meta .date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--text-faint);
}
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent2);
  background: var(--accent2-soft);
  padding: 5px 11px;
  border-radius: 100px;
  display: inline-block;
}

.media-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.35);
  background:
    repeating-linear-gradient(45deg, var(--image-bg) 0 7px, var(--image-stripe) 7px 14px);
}
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-frame .placeholder-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--image-label);
  text-align: center;
  padding: 0 20px;
}

/* Post grid */
.post-grid-section { padding: 64px 0 88px; }
.post-grid-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
}
.post-grid-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.post-grid-header a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--accent);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  align-items: start;
}
.post-card {
  border-radius: 16px;
  transition: transform 0.2s ease;
}
.post-card:hover { transform: translateY(-4px); }
.card-image {
  display: block;
  aspect-ratio: 16 / 9.2;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: repeating-linear-gradient(45deg, var(--image-bg) 0 5px, var(--image-stripe) 5px 10px);
  box-shadow: 0 12px 30px -16px rgba(0,0,0,0.3);
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.post-card:hover .card-image img { transform: scale(1.05); }
.card-body { padding: 20px 4px 4px; }
.card-body h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 12px 0 8px;
  transition: color 0.15s ease;
}
.post-card:hover h3 { color: var(--accent); }
.card-body h3 a { color: inherit; }
.card-body p {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.card-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-faint);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 0 0 64px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
}
.pagination a { color: var(--accent); }

/* Single post */
.post-header { padding: 56px 0 32px; border-bottom: 1px solid var(--border); }
.post-header .kicker { margin-bottom: 14px; }
.post-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0 0 24px;
  max-width: 22ch;
}
.post-feature-image {
  aspect-ratio: 16/8;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 36px 0 0;
  box-shadow: 0 24px 60px -24px rgba(0,0,0,0.35);
  background: repeating-linear-gradient(45deg, var(--image-bg) 0 7px, var(--image-stripe) 7px 14px);
}
.post-feature-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.post-content {
  max-width: 72ch;
  margin: 0 auto;
  padding: 48px 0 80px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
}
.post-content h2, .post-content h3 {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text);
  line-height: 1.3;
}
.post-content a {
  color: var(--accent);
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
.post-content a:hover { color: var(--accent2); }
.post-content img { max-width: 100%; height: auto; border-radius: 10px; }
.page-content img { max-width: 100%; height: auto; border-radius: 10px; }
.post-content pre, .post-content code {
  font-family: 'IBM Plex Mono', monospace;
  background: var(--bg-alt);
  border-radius: 6px;
}
.post-content pre { padding: 18px; overflow-x: auto; border: 1px solid var(--border); }
.post-content code { padding: 2px 6px; font-size: 0.85em; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
}

/* Ghost editor Koenig card width classes */
.kg-width-wide {
  width: 100vw;
  max-width: 1120px;
  margin-left: 50%;
  transform: translateX(-50%);
}
.kg-width-full {
  width: 100vw;
  max-width: 1600px;
  margin-left: 50%;
  transform: translateX(-50%);
}
.kg-width-wide img,
.kg-width-full img {
  width: 100%;
  display: block;
  border-radius: 10px;
}

/* Static page */
.page-content {
  max-width: 72ch;
  margin: 0 auto;
  padding: 56px 0 80px;
}
.page-content h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 36px;
  color: var(--text);
  margin: 0 0 28px;
}
.page-content .post-content { padding: 0; margin: 0; max-width: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); }
.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  flex-wrap: wrap;
  gap: 8px;
}
.site-footer .copyright {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  color: var(--text-faint);
}
.site-footer .powered {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--text-faint);
}
.site-footer .powered a { color: var(--text-faint); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .hero h1 { font-size: 30px; }
  .post-header h1 { font-size: 30px; }
}
