/* ── Ghost CMS-Inspired Blog & Publication Experience ────────────────────────── */

/* 1. Publication Masthead */
.ghost-blog-masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.25rem 1.5rem 2.5rem 1.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--card-bg) 0%, transparent 100%);
  border: 1px solid var(--card-border);
}

.ghost-masthead-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 auto 1rem auto;
}

.ghost-masthead-title {
  font-family: var(--font-title);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  margin: 0 auto 1rem auto;
  background: var(--hero-title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  width: 100%;
}

.ghost-masthead-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 720px;
  text-align: center;
  margin: 0 auto 1.5rem auto;
}

.ghost-masthead-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 auto;
}

.ghost-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1;
}

.ghost-meta-dot {
  opacity: 0.4;
  color: var(--text-muted);
  user-select: none;
  font-size: 0.75rem;
}

/* 2. Featured Lead Story Hero Card */
.ghost-hero-section {
  margin-bottom: 3rem;
}

.ghost-hero-card {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  transition: var(--transition-smooth), var(--transition-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.ghost-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  opacity: 0.8;
}

.ghost-hero-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.15);
}

.ghost-hero-card:hover .ghost-hero-title {
  color: var(--accent-primary);
}

.ghost-hero-card:focus-visible,
.ghost-story-card:focus-visible,
.ghost-essential-card:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

.ghost-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.ghost-featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ghost-hero-title {
  font-family: var(--font-title);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin: 0.5rem 0 0.85rem 0;
  transition: var(--transition-color);
}

.ghost-hero-excerpt {
  color: var(--text-secondary);
  font-size: 1.025rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.ghost-hero-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--card-border);
  padding-top: 1.25rem;
  margin-top: auto;
}

.ghost-author-byline {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ghost-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.ghost-author-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ghost-author-info {
  display: flex;
  flex-direction: column;
}

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

.ghost-author-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ghost-read-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-primary);
  transition: var(--transition-color);
}

.ghost-hero-card:hover .ghost-read-cta svg,
.ghost-story-card:hover .ghost-read-cta svg,
.ghost-essential-card:hover .ghost-read-cta svg {
  transform: translateX(4px);
}

/* 3. Essential Reads Spotlight (3 Columns) */
.ghost-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ghost-section-title {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ghost-essential-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.ghost-essential-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-decoration: none;
  transition: var(--transition-smooth), var(--transition-color);
  position: relative;
}

.ghost-essential-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-secondary);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.12);
}

.ghost-essential-card:hover .ghost-essential-card-title {
  color: var(--accent-primary);
}

.ghost-essential-card-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0.6rem 0 0.5rem 0;
  transition: var(--transition-color);
}

.ghost-essential-card-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* 4. Topic Filter Bar & Search */
.ghost-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.ghost-topic-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ghost-topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-color);
}

.ghost-topic-pill:hover:not(.active) {
  background: var(--card-bg-hover);
  color: var(--text-primary);
  border-color: var(--card-border-hover);
}

.ghost-topic-pill.active {
  background: var(--accent-primary);
  color: var(--on-accent-text);
  border-color: var(--accent-primary);
  font-weight: 700;
}

.ghost-pill-count {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--pill-count-bg);
}

.ghost-topic-pill.active .ghost-pill-count {
  background: rgba(0, 0, 0, 0.2);
}

.ghost-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 340px;
}

.ghost-search-input {
  width: 100%;
  padding: 0.55rem 2.2rem 0.55rem 2.3rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-full);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition-color);
}

.ghost-search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.ghost-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.ghost-search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  display: none;
}

.ghost-search-clear.visible {
  display: block;
}

.ghost-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 5. Editorial 3-Column Story Grid */
.ghost-story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.ghost-story-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-decoration: none;
  transition: var(--transition-smooth), var(--transition-color);
  content-visibility: auto;
  contain-intrinsic-size: auto 280px;
}

.ghost-story-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-secondary);
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.15);
}

.ghost-story-card:hover .ghost-story-title {
  color: var(--accent-primary);
}

.ghost-story-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ghost-tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ghost-tag-pricing {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border: 1px solid var(--status-warning-border);
}

.ghost-tag-materials {
  background: var(--status-info-bg);
  color: var(--status-info-text);
  border: 1px solid var(--status-info-border);
}

.ghost-tag-hardware {
  background: var(--status-purple-bg);
  color: var(--status-purple-text);
  border: 1px solid var(--status-purple-border);
}

.ghost-tag-business {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
}

.ghost-story-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0 0 0.65rem 0;
  transition: var(--transition-color);
}

.ghost-story-desc {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.ghost-story-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--card-border);
  padding-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* 6. Estimator Digest / CTA Card */
.ghost-digest-card {
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--input-bg) 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
}

.ghost-digest-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

@media (max-width: 768px) {
  .ghost-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .ghost-search-wrapper {
    max-width: 100%;
  }
}