/* ==========================================
   Ghost Clone — Public Theme (ala Ghost Casper)
   ========================================== */

:root {
  --accent: #11d8d8;
  --airo-blue: #0f3c8a;
  --airo-blue-dark: #0b2f6f;
  --airo-cyan: #14d8d8;
  --bg: #f5f8fc;
  --bg-alt: #ffffff;
  --text: #0f1c4d;
  --text-muted: #6b7280;
  --text-light: #94a3b8;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --shadow-sm: 0 6px 20px rgba(15, 28, 77, 0.08);
  --shadow: 0 10px 28px rgba(15, 28, 77, 0.12);
  --shadow-lg: 0 16px 40px rgba(15, 28, 77, 0.14);
  --radius: 10px;
  --radius-lg: 18px;
  --max-w: 1280px;
  --reading-w: 680px;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #172033;
  --text: #e6edf3;
  --text-muted: #b6c0d1;
  --text-light: #8f9bb3;
  --border: #2b3750;
  --border-strong: #3b4967;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.28);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.2s, color 0.2s;
}

a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.75; }

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

/* ===== Site Header ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
}

.site-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav a { color: var(--text-muted); }
.site-nav a:hover { color: var(--text); opacity: 1; }

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}
.btn-icon:hover { border-color: var(--text-muted); color: var(--text); }

/* ===== Search form ===== */
.search-form {
  flex: 1;
  max-width: 280px;
}
.search-form input {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.9rem;
  background: var(--bg-alt);
  color: var(--text);
  font-family: inherit;
}
.search-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
}

/* ===== Main container ===== */
.airo-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}
.sidebar {
  background: linear-gradient(180deg, var(--airo-blue) 0%, var(--airo-blue-dark) 100%);
  color: #fff;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.sidebar-logo { text-align: center; margin-bottom: 8px; }
.logo-hexagon {
  width: 62px; height: 62px; margin: 0 auto 10px;
  background: linear-gradient(145deg, #1ad6d6, #0993e0);
  clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%);
  display: grid; place-items: center;
  color: #fff; font-size: 1.9rem; font-weight: 800;
}
.logo-text { font-size: 2rem; font-weight: 800; letter-spacing: .4px; }
.sidebar-nav { display: grid; gap: 8px; }
.nav-item {
  color: #dbeafe;
  padding: 12px 14px;
  border-radius: 999px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 700;
}
.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,.12);
  color: #fff; opacity: 1;
}
.theme-toggle {
  border: 0; border-radius: 10px; padding: 8px 10px;
  background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
}
.sidebar-search input {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 12px 14px;
  background: rgba(255,255,255,.14);
  color: #fff;
}
.sidebar-search input::placeholder { color: #dbeafe; }
.sidebar-footer {
  margin-top: auto;
  color: #c7ddff;
  text-align: center;
  font-size: .9rem;
  line-height: 1.6;
}
.sidebar-admin { text-align: center; color: #fff; border-color: rgba(255,255,255,.3); }

.main-content {
  flex: 1;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 30px 28px 40px;
  background: var(--bg);
  overflow-x: hidden;
}

/* ===== Hero (featured post) ===== */
.hero {
  margin-bottom: 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-image {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-image img { width: 100%; height: 100%; object-fit: cover; }
.hero-content .eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero-content h2 {
  font-size: 2.75rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
  font-weight: 700;
}
.hero-content h2 a { color: var(--text); }
.hero-content .excerpt {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.55;
}
.post-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-light);
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero-content h2 { font-size: 2rem; }
}

/* ===== Post grid ===== */
.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 24px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 40px 32px;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.post-card.elevated:hover { transform: translateY(-2px); box-shadow: var(--shadow); transition: .2s ease; }
.post-card .thumb {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
  background: var(--bg-alt);
}
.post-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.post-card:hover .thumb img { transform: scale(1.03); }
.post-card h3 {
  font-size: 1.35rem;
  line-height: 1.25;
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.post-card h3 a { color: var(--text); }
.post-card .excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Tag list ===== */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.tag-chip {
  padding: 6px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.2s;
}
.tag-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
  opacity: 1;
}

/* ===== Pagination ===== */
.pagination {
  margin-top: 64px;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.pagination a, .pagination span {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.pagination .active { background: var(--accent); color: white; border-color: var(--accent); }
.pagination a:hover { border-color: var(--text-muted); opacity: 1; }

/* ===== Article (single post) ===== */
.article {
  max-width: var(--reading-w);
  margin: 0 auto;
}

.article-header {
  text-align: center;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.article-header .eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.article-header h1 {
  font-size: 3rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}
.article-header .lead {
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.feature-image {
  max-width: 1000px;
  margin: 0 auto 48px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.feature-image img { width: 100%; }

.article-body {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--text);
}

.article-body > * { margin-bottom: 1.4em; }

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin-top: 2em;
}
.article-body h2 { font-size: 1.75rem; }
.article-body h3 { font-size: 1.4rem; }
.article-body h4 { font-size: 1.15rem; }

.article-body p { }
.article-body a { border-bottom: 1.5px solid currentColor; }
.article-body a:hover { border-bottom-color: transparent; }

.article-body img,
.article-body figure {
  margin: 2em -40px;
  border-radius: var(--radius);
  max-width: calc(100% + 80px);
}
@media (max-width: 760px) {
  .article-body img,
  .article-body figure { margin-left: 0; margin-right: 0; max-width: 100%; }
}

.article-body figure { text-align: center; }
.article-body figcaption {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 10px;
}

.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 24px;
  margin-left: 0;
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.2rem;
}

.article-body ul, .article-body ol {
  padding-left: 1.5em;
}
.article-body li { margin-bottom: 0.5em; }

.article-body code {
  font-family: var(--font-mono);
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  border: 1px solid var(--border);
}

.article-body pre {
  background: #0f172a;
  color: #e6edf3;
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.55;
}
.article-body pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}

/* Syntax highlighting base */
.hljs { background: transparent; color: #e6edf3; }
.hljs-keyword, .hljs-selector-tag { color: #ff7b72; }
.hljs-string, .hljs-attr { color: #a5d6ff; }
.hljs-number, .hljs-literal { color: #79c0ff; }
.hljs-comment { color: #8b949e; font-style: italic; }
.hljs-function, .hljs-title { color: #d2a8ff; }
.hljs-built_in, .hljs-type { color: #ffa657; }

/* Article footer: tags + author */
.article-footer {
  max-width: var(--reading-w);
  margin: 64px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.author-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 24px;
  background: var(--bg-alt);
  border-radius: var(--radius);
}
.author-card .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.author-card .name { font-weight: 600; }
.author-card .bio { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }

/* Related posts */
.related {
  max-width: var(--max-w);
  margin: 80px auto 0;
}
.related h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-light);
  margin-bottom: 24px;
}
.related .post-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

/* ===== Home 2-col + Sidebar ===== */
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 26px;
  align-items: start;
}
.post-grid.post-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.airo-post-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.airo-card {
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 0;
  box-shadow: var(--shadow-sm);
}
.airo-card .thumb {
  margin: 0;
  border-radius: 0;
  position: relative;
  aspect-ratio: 16 / 10;
}
.card-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 0.85rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: .06em;
}
.airo-card-body { padding: 16px 16px 18px; background: #fff; }
.card-date { color: #9ca3af; font-size: 0.9rem; margin-bottom: 10px; }
.airo-card h3 { font-size: 1.9rem; line-height: 1.15; margin-bottom: 14px; }
.airo-card h3 a { color: #0f1c4d; }
.card-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.card-author { display: flex; align-items: center; gap: 9px; color: #6b7280; font-weight: 600; }
.author-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(145deg, #1ad6d6, #0993e0);
  color: #fff; font-weight: 700; display: grid; place-items: center;
}
.card-reads { color: #9ca3af; font-weight: 600; font-size: .95rem; }
.read-more-btn {
  display: inline-block;
  background: var(--airo-cyan);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: .03em;
}
.read-more-btn:hover { opacity: .9; color: #fff; }

@media (max-width: 1300px) {
  .airo-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .airo-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .airo-post-grid { grid-template-columns: 1fr; }
}
.sidebar-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.sidebar-card h3 {
  margin-bottom: 12px;
  font-size: 1.05rem;
}
.mini-list { display: grid; gap: 12px; }
.mini-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  color: var(--text);
  align-items: center;
}
.mini-item img {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.mini-title { font-size: .92rem; line-height: 1.3; font-weight: 600; margin-bottom: 3px; }
.cat-list { list-style: none; display: grid; gap: 8px; padding: 0; margin: 0; }
.cat-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: color-mix(in srgb, var(--bg-alt) 80%, #fff 20%);
}
.cat-list b {
  background: var(--accent); color: #fff; border-radius: 999px;
  min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem;
}
.tag-cloud.compact { margin-top: 0; padding-top: 0; border-top: 0; }

/* ===== Single post with sidebar ===== */
.single-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 24px;
  align-items: start;
}
.single-layout .article {
  max-width: 100%;
  min-width: 0;
}
.single-layout .article-body,
.single-layout .article-header,
.single-layout .feature-image,
.single-layout .article-footer {
  max-width: 100%;
}
.single-sidebar {
  position: sticky;
  top: 24px;
  min-width: 0;
}
.follow-us .follow-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid var(--text);
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 10px;
  background: var(--bg);
}
.follow-us .follow-item:hover {
  color: var(--accent);
  border-color: var(--accent);
  opacity: 1;
}
.follow-us .follow-item i {
  font-style: normal;
  font-weight: 700;
}
.static-page {
  max-width: 960px;
  margin: 0 auto;
}
.static-page h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}
.static-page > p {
  color: var(--text-muted);
  margin-bottom: 20px;
}
.static-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.static-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--bg-alt);
}
.static-card h3 { margin-bottom: 10px; }

@media (max-width: 1100px) {
  .single-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .single-sidebar {
    position: static;
    width: 100%;
  }
  .single-sidebar .sidebar-card {
    margin-bottom: 12px;
  }
}
@media (max-width: 780px) {
  .static-grid { grid-template-columns: 1fr; }
}

/* ===== Empty state ===== */
.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty h2 { font-size: 2rem; margin-bottom: 12px; color: var(--text); }

/* ===== Site Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 80px;
}
.site-footer a { color: var(--text-muted); margin: 0 10px; }

/* Admin shortcut in header */
.admin-link {
  font-size: 0.85rem;
  color: var(--text-light);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.admin-link:hover { color: var(--accent); border-color: var(--accent); opacity: 1; }
