/* GEOFlow Ghost Casper Theme CSS
   Inspired by Ghost 6.x default Casper theme (demo.ghost.io)
   Tailored for GEOFlow AI-native publication and enterprise retail knowledge base
*/

:root {
  --ghost-accent-color: #ff0095;
  --color-primary-text: #15171a;
  --color-secondary-text: #62737f;
  --color-border: #e6ebef;
  --color-bg: #ffffff;
  --color-surface: #f8f9fa;
  --color-card-bg: #ffffff;
  --color-dark-bg: #15171a;
  --color-dark-surface: #1e2126;
  --color-dark-text: #ffffff;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-serif: Georgia, Cambria, "Times New Roman", Times, "Songti SC", serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.09);
  --container-width: 1200px;
  --article-width: 780px;
}

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

body {
  font-family: var(--font-sans);
  color: var(--color-primary-text);
  background-color: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Reading Progress Bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--ghost-accent-color);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* Layout Shells */
.viewport {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.outer {
  padding: 0 4vw;
}

.inner {
  max-width: var(--container-width);
  margin: 0 auto;
  width: 100%;
}

/* Header (Ghost gh-head) */
.gh-head {
  height: 80px;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  backdrop-filter: blur(12px);
  background-color: rgba(255, 255, 255, 0.94);
}

.gh-head-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}

.gh-head-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gh-head-logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--color-primary-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.gh-head-logo .brand-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--ghost-accent-color);
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gh-head-menu {
  display: flex;
  align-items: center;
}

.gh-head-menu .nav {
  display: flex;
  list-style: none;
  gap: 24px;
}

.gh-head-menu .nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-secondary-text);
  transition: color 0.15s ease;
}

.gh-head-menu .nav a:hover,
.gh-head-menu .nav .nav-current a {
  color: var(--color-primary-text);
  font-weight: 600;
}

.gh-head-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gh-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-secondary-text);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.gh-icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-primary-text);
}

.gh-head-members {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gh-head-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-secondary-text);
  padding: 8px 12px;
}

.gh-head-link:hover {
  color: var(--color-primary-text);
}

.gh-head-button {
  background: var(--color-primary-text);
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--color-primary-text);
}

.gh-head-button:hover {
  background: var(--ghost-accent-color);
  border-color: var(--ghost-accent-color);
  transform: translateY(-1px);
}

.gh-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

/* Site Hero Header (Ghost Casper site-header-content) */
.site-header-content {
  position: relative;
  background: linear-gradient(135deg, #181b20 0%, #0d0f12 100%);
  color: #ffffff;
  padding: 80px 4vw 70px;
  text-align: center;
  overflow: hidden;
}

.site-header-content::before {
  content: "";
  position: absolute;
  top: -50%;
  left: 20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 0, 149, 0.18) 0%, rgba(67, 97, 238, 0.12) 40%, rgba(0, 0, 0, 0) 70%);
  filter: blur(80px);
  pointer-events: none;
}

.site-header-inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
}

.site-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #f1f3f5;
  margin-bottom: 24px;
}

.site-header-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ghost-accent-color);
  box-shadow: 0 0 10px var(--ghost-accent-color);
}

.site-title {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.15;
  margin-bottom: 18px;
  color: #ffffff;
}

.site-description {
  font-size: 19px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
  margin-bottom: 36px;
}

/* Ghost Casper Subscribe Form */
.gh-subscribe-form {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 4px;
  backdrop-filter: blur(12px);
  transition: all 0.25s;
}

.gh-subscribe-form:focus-within {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(255, 0, 149, 0.25);
}

.gh-subscribe-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 20px;
  color: #ffffff;
  font-size: 15px;
  outline: none;
}

.gh-subscribe-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.gh-subscribe-btn {
  background: var(--ghost-accent-color);
  color: #ffffff;
  border: none;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.gh-subscribe-btn:hover {
  opacity: 0.92;
  transform: scale(1.02);
}

.site-header-stats {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 36px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}

.site-header-stats strong {
  color: #fff;
  font-size: 16px;
  margin-right: 4px;
}

/* Category Filter Bar */
.category-filter-bar {
  padding: 24px 0 10px;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
}

.filter-pills {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  font-size: 14px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-secondary-text);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.filter-pill:hover {
  background: #edf2f7;
  color: var(--color-primary-text);
}

.filter-pill.active {
  background: var(--color-primary-text);
  color: #ffffff;
}

/* Main Post Feed */
.site-main {
  padding: 48px 0 80px;
  background-color: #fafbfc;
}

.post-feed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

/* Large Featured Post Card (post-card-large) */
.post-card-large {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  border: 1px solid var(--color-border);
  transition: all 0.25s ease;
}

.post-card-large:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 0, 149, 0.3);
}

.post-card-large .post-card-image-link {
  min-height: 380px;
  position: relative;
  overflow: hidden;
  background: #2a2e35;
}

.post-card-large .post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card-large:hover .post-card-image {
  transform: scale(1.03);
}

.post-card-large .post-card-content {
  padding: 44px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Standard Post Card */
.post-card {
  background: var(--color-card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(0, 0, 0, 0.12);
}

.post-card-image-link {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: #f1f3f5;
  display: block;
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.post-card:hover .post-card-image {
  transform: scale(1.04);
}

.post-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.post-card-primary-tag {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ghost-accent-color);
}

.post-card-featured {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #e67700;
  background: #fff9db;
  padding: 2px 7px;
  border-radius: 4px;
}

.post-card-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.3px;
  margin-bottom: 10px;
  color: var(--color-primary-text);
  transition: color 0.15s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-large .post-card-title {
  font-size: 30px;
  letter-spacing: -0.6px;
  line-height: 1.25;
  margin-bottom: 16px;
}

.post-card:hover .post-card-title,
.post-card-large:hover .post-card-title {
  color: var(--ghost-accent-color);
}

.post-card-excerpt {
  font-size: 14.5px;
  color: var(--color-secondary-text);
  line-height: 1.55;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.post-card-large .post-card-excerpt {
  font-size: 16px;
  line-height: 1.6;
  -webkit-line-clamp: 4;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #8899a6;
  border-top: 1px solid #f1f3f5;
  padding-top: 14px;
  margin-top: auto;
}

.author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #e1e8ed;
}

.author-name {
  font-weight: 600;
  color: var(--color-primary-text);
}

.meta-dot {
  opacity: 0.5;
}

/* Article Detail Page */
.article-page {
  padding: 50px 0 90px;
  background: #ffffff;
}

.article-shell {
  max-width: var(--article-width);
  margin: 0 auto;
}

.article-header {
  margin-bottom: 40px;
  text-align: center;
}

.article-header-tag {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ghost-accent-color);
  margin-bottom: 16px;
  display: inline-block;
}

.article-title {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.8px;
  margin-bottom: 20px;
  color: var(--color-primary-text);
}

.article-excerpt-lead {
  font-size: 20px;
  line-height: 1.55;
  color: var(--color-secondary-text);
  margin-bottom: 28px;
  font-weight: 400;
}

.article-byline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 14px;
  color: var(--color-secondary-text);
}

.article-cover-wrap {
  margin: 40px -4vw 50px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-hover);
}

.article-cover-img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

/* Callout Summary Box */
.article-summary-card {
  background: linear-gradient(135deg, #fdf8fb 0%, #f4f6fc 100%);
  border: 1px solid rgba(255, 0, 149, 0.18);
  border-left: 4px solid var(--ghost-accent-color);
  padding: 24px 28px;
  border-radius: var(--radius-sm);
  margin-bottom: 40px;
}

.article-summary-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ghost-accent-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-summary-card ul {
  padding-left: 20px;
}

.article-summary-card li {
  margin-bottom: 8px;
  font-size: 15px;
  color: #333;
}

/* Article Prose Typography */
.gh-content {
  font-size: 18px;
  line-height: 1.8;
  color: #24292f;
}

.gh-content h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 48px 0 20px;
  letter-spacing: -0.4px;
  line-height: 1.35;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 10px;
}

.gh-content h3 {
  font-size: 21px;
  font-weight: 700;
  margin: 36px 0 16px;
  letter-spacing: -0.2px;
}

.gh-content p {
  margin-bottom: 24px;
}

.gh-content ul, .gh-content ol {
  margin: 0 0 24px 26px;
}

.gh-content li {
  margin-bottom: 10px;
}

.gh-content blockquote {
  border-left: 3px solid var(--ghost-accent-color);
  padding: 12px 24px;
  margin: 30px 0;
  background: var(--color-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: #495057;
}

.gh-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-size: 15px;
}

.gh-content th, .gh-content td {
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  text-align: left;
}

.gh-content th {
  background: var(--color-surface);
  font-weight: 700;
}

.gh-content code {
  background: #f1f3f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: Menlo, Monaco, Consolas, monospace;
}

/* Next / Prev Article Nav */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 60px 0 40px;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
}

.nav-card {
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.nav-card:hover {
  border-color: var(--ghost-accent-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-subtle);
}

.nav-card-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-secondary-text);
  margin-bottom: 6px;
}

.nav-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary-text);
  line-height: 1.4;
}

/* Ghost Search Modal */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.search-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.search-modal {
  background: #ffffff;
  width: 100%;
  max-width: 640px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.search-modal-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
}

.search-modal-input {
  flex: 1;
  border: none;
  font-size: 18px;
  outline: none;
  font-family: inherit;
  color: var(--color-primary-text);
}

.search-modal-close {
  background: #f1f3f5;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #666;
}

.search-results-list {
  overflow-y: auto;
  padding: 12px;
  list-style: none;
}

.search-result-item {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.search-result-item:hover, .search-result-item.selected {
  background: var(--color-surface);
}

.search-result-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary-text);
  margin-bottom: 4px;
}

.search-result-excerpt {
  font-size: 13px;
  color: var(--color-secondary-text);
  line-height: 1.4;
}

/* Footer (Ghost Casper site-footer) */
.site-footer {
  background: #111317;
  color: #ffffff;
  padding: 60px 4vw 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 40px;
  margin-bottom: 30px;
}

.site-footer-brand h4 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.4px;
}

.site-footer-brand p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  max-width: 460px;
}

.site-footer-nav {
  display: flex;
  list-style: none;
  gap: 24px;
}

.site-footer-nav a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.15s;
}

.site-footer-nav a:hover {
  color: #ffffff;
}

.site-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

.site-footer-social {
  display: flex;
  gap: 16px;
}

.site-footer-social a {
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.2s;
}

.site-footer-social a:hover {
  color: var(--ghost-accent-color);
}

.powered-by {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

/* Toast Message */
.ghost-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--color-primary-text);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10001;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.25s ease;
  pointer-events: none;
}

.ghost-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .post-feed {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .gh-head-inner {
    grid-template-columns: 1fr auto;
  }
  .gh-head-menu {
    display: none;
  }
  .gh-burger {
    display: block;
  }
  .site-title {
    font-size: 34px;
  }
  .site-description {
    font-size: 16px;
  }
  .post-feed {
    grid-template-columns: 1fr;
  }
  .post-card-large {
    grid-template-columns: 1fr;
  }
  .post-card-large .post-card-image-link {
    min-height: 240px;
  }
  .post-card-large .post-card-content {
    padding: 24px;
  }
  .article-title {
    font-size: 28px;
  }
  .article-cover-wrap {
    margin: 24px 0 32px;
  }
  .site-footer-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .site-footer-bottom {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}
