/* Blog styles extracted from cc-blog.js _injectStyles() */
/* cc-pill styles extracted from cc-pill.js */

cc-pill {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 99px; font-weight: 600; cursor: default;
  border: 1px solid color-mix(in srgb, var(--_pc, var(--glass-border, rgba(255,255,255,.1))) 40%, transparent);
  color: var(--_pc, var(--muted, #71717a));
  background: transparent;
  transition: all .15s;
  white-space: nowrap;
  user-select: none;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
/* Sizes by variant */
cc-pill, cc-pill[variant="pill"] { padding: 6px 16px; font-size: 12px; }
cc-pill[variant="badge"] { padding: 2px 10px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
cc-pill[variant="tag"] { padding: 2px 8px; font-size: 10px; font-weight: 500;
  background: color-mix(in srgb, var(--_pc, var(--muted, #71717a)) 14%, transparent);
  border: none;
}
/* Active state — filled */
cc-pill[active] {
  background: var(--_pc, var(--accent, #f59e0b));
  color: white; border-color: var(--_pc, transparent);
}
/* Neutral — no color */
cc-pill[neutral] { --_pc: var(--muted, #71717a); }
/* Clickable pills */
cc-pill[clickable] { cursor: pointer; }
cc-pill[clickable]:hover { border-color: var(--_pc, var(--accent, #f59e0b)); color: var(--text, #fff); }
/* Count badge */
cc-pill .cc-pill-count { opacity: 0.6; font-size: 10px; }

/* ---- cc-blog styles ---- */

cc-blog { display: block; }
cc-blog-post { display: none; }

/* Search */
.ccb-search { position: relative; margin-bottom: 1.5rem; max-width: 400px; margin-left: auto; margin-right: auto; }
.ccb-search__input {
  width: 100%; padding: 10px 14px 10px 38px; border-radius: 8px;
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  background: var(--surface, rgba(255,255,255,0.05));
  color: var(--text, #e2e8f0); font-size: 0.9rem;
  outline: none; transition: border-color 0.2s;
}
.ccb-search__input:focus { border-color: var(--accent, #f59e0b); }
.ccb-search__input::placeholder { color: var(--text-muted, rgba(255,255,255,0.4)); }
.ccb-search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: 0.4; }

/* Categories */
.ccb-categories { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 2rem; justify-content: center; }
.ccb-cat {
  padding: 6px 16px; border-radius: 20px; border: 1px solid var(--border, rgba(255,255,255,0.12));
  background: transparent; color: var(--text-muted, rgba(255,255,255,0.6));
  font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.ccb-cat:hover { border-color: var(--accent, #f59e0b); color: var(--text, #e2e8f0); }
.ccb-cat--active {
  background: var(--accent, #f59e0b); color: #000; border-color: var(--accent, #f59e0b); font-weight: 600;
}

/* Tag */
.ccb-tag {
  display: inline-block; padding: 4px 12px; border-radius: 4px; font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
  background: rgba(245,158,11,0.15); color: var(--accent, #f59e0b);
}
.ccb-tag--sm { font-size: 0.65rem; padding: 3px 8px; }

/* Meta */
.ccb-meta { display: flex; align-items: center; gap: 12px; font-size: 0.8rem; color: var(--text-muted, rgba(255,255,255,0.5)); flex-wrap: wrap; }
.ccb-meta--lg { font-size: 0.9rem; margin-bottom: 2rem; }
.ccb-meta__author { display: flex; align-items: center; gap: 6px; }
.ccb-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.ccb-avatar--lg { width: 32px; height: 32px; }
.ccb-meta__date::before, .ccb-meta__read::before { content: ''; }

/* Featured */
.ccb-featured {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border-radius: 16px; overflow: hidden; margin-bottom: 3rem;
  background: var(--surface, rgba(255,255,255,0.05));
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  text-decoration: none; color: inherit; transition: transform 0.2s, box-shadow 0.2s;
}
.ccb-featured:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.3); text-decoration: none; }
.ccb-featured__image { min-height: 300px; }
.ccb-featured__image img { width: 100%; height: 100%; object-fit: cover; }
.ccb-featured__content { padding: 2rem; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.ccb-featured__title { font-size: 1.6rem; font-weight: 700; color: var(--text, #e2e8f0); margin: 0; line-height: 1.3; }
.ccb-featured__excerpt { color: var(--text-muted, rgba(255,255,255,0.6)); line-height: 1.6; margin: 0; }

/* Grid */
.ccb-grid { display: grid; gap: 1.5rem; }
.ccb-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.ccb-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.ccb-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Card variant */
.ccb-post-card {
  display: flex; flex-direction: column; border-radius: 12px; overflow: hidden;
  background: var(--surface, rgba(255,255,255,0.05));
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  text-decoration: none; color: inherit; transition: transform 0.2s, box-shadow 0.2s;
}
.ccb-post-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.25); text-decoration: none; }
.ccb-post-card__image { height: 200px; overflow: hidden; }
.ccb-post-card__image img { width: 100%; height: 100%; object-fit: cover; }
.ccb-post-card__image--placeholder { background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(99,102,241,0.1)); }
.ccb-post-card__body { padding: 1.25rem; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ccb-post-card__title { font-size: 1.1rem; font-weight: 700; color: var(--text, #e2e8f0); margin: 0; line-height: 1.3; }
.ccb-post-card__excerpt { font-size: 0.85rem; color: var(--text-muted, rgba(255,255,255,0.55)); line-height: 1.5; margin: 0; flex: 1; }

/* Minimal variant */
.ccb-post-minimal {
  display: block; padding: 1.25rem 0; border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  text-decoration: none; color: inherit; transition: opacity 0.2s;
}
.ccb-post-minimal:hover { opacity: 0.8; text-decoration: none; }
.ccb-post-minimal__meta { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.ccb-post-minimal__title { font-size: 1.1rem; font-weight: 600; color: var(--text, #e2e8f0); margin: 0 0 4px; }
.ccb-post-minimal__excerpt { font-size: 0.85rem; color: var(--text-muted, rgba(255,255,255,0.5)); margin: 0; }

/* Magazine variant */
.ccb-post-mag {
  display: grid; grid-template-columns: 140px 1fr; gap: 1rem; align-items: start;
  text-decoration: none; color: inherit; padding: 1rem; border-radius: 12px;
  transition: background 0.2s;
}
.ccb-post-mag:hover { background: var(--surface, rgba(255,255,255,0.03)); text-decoration: none; }
.ccb-post-mag__image { border-radius: 8px; overflow: hidden; aspect-ratio: 4/3; }
.ccb-post-mag__image img { width: 100%; height: 100%; object-fit: cover; }
.ccb-post-mag__body { display: flex; flex-direction: column; gap: 6px; }
.ccb-post-mag__title { font-size: 1rem; font-weight: 600; color: var(--text, #e2e8f0); margin: 0; line-height: 1.3; }
.ccb-post-mag__excerpt { font-size: 0.8rem; color: var(--text-muted, rgba(255,255,255,0.5)); margin: 0; line-height: 1.5; }

/* Empty */
.ccb-empty { text-align: center; padding: 3rem; color: var(--text-muted, rgba(255,255,255,0.4)); font-size: 0.9rem; }

/* Article (single post) */
.ccb-article { max-width: 720px; margin: 0 auto; }
.ccb-article__back {
  display: block; margin-bottom: 1rem; color: var(--accent, #f59e0b);
  text-decoration: none; font-size: 0.85rem; font-weight: 500; transition: opacity 0.2s;
}
.ccb-article__back:hover { opacity: 0.7; }
.ccb-article > cc-pill { display: inline-block; margin-bottom: 0.75rem; }
.ccb-article__title { font-size: 2.5rem; font-weight: 800; line-height: 1.2; color: var(--text, #e2e8f0); margin: 0.75rem 0 1rem; }
.ccb-article__hero { margin-bottom: 2rem; border-radius: 12px; overflow: hidden; }
.ccb-article__hero img { width: 100%; display: block; }
.ccb-article__content { font-size: 1.05rem; line-height: 1.8; color: var(--text, rgba(255,255,255,0.85)); }
.ccb-article__content h2 {
  font-size: 1.5rem; font-weight: 700; margin: 2.5rem 0 1rem; color: var(--accent, #f59e0b);
  position: relative; padding-top: 2rem;
}
.ccb-article__content h2::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  overflow: hidden;
}
.ccb-article__content h2::after {
  content: '';
  position: absolute; top: 0; left: -60%; width: 60%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent, #f59e0b), transparent);
  animation: ccb-divider-shimmer 3s linear infinite;
}
@keyframes ccb-divider-shimmer {
  0%   { left: -60%; }
  100% { left: 100%; }
}
.ccb-article__content h3 { font-size: 1.2rem; font-weight: 600; margin: 2rem 0 0.75rem; color: var(--accent, #f59e0b); }
.ccb-article__content p { margin: 0 0 1.25rem; }
.ccb-article__content ul, .ccb-article__content ol { margin: 0 0 1.25rem; padding-left: 1.5rem; }
.ccb-article__content li { margin-bottom: 0.5rem; }
.ccb-article__content li::marker { color: var(--accent, #f59e0b); }
.ccb-article__content strong { color: var(--text, #e2e8f0); }
.ccb-article__content blockquote {
  border-left: 3px solid var(--accent, #f59e0b); margin: 1.5rem 0; padding: 1rem 1.5rem;
  background: rgba(245,158,11,0.05); border-radius: 0 8px 8px 0; font-style: italic;
}
.ccb-article__content code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.ccb-article__content pre { background: rgba(0,0,0,0.3); border-radius: 8px; padding: 1.25rem; overflow-x: auto; margin: 0 0 1.25rem; }
.ccb-article__content pre code { background: none; padding: 0; }
.ccb-article__content img { max-width: 100%; border-radius: 8px; margin: 1rem 0; }
.ccb-article__content a { color: var(--accent, #f59e0b); text-decoration: underline; }

/* Share / Copy link */
.ccb-article__share {
  display: flex; align-items: center; gap: 12px; margin-top: 3rem; padding-top: 2rem;
  border-top: 1px solid var(--border, rgba(255,255,255,0.1));
}
.ccb-copy-link-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border-radius: 8px; border: 1px solid var(--border, rgba(255,255,255,0.15));
  background: var(--surface, rgba(255,255,255,0.05)); color: var(--text-muted, rgba(255,255,255,0.6));
  font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.ccb-copy-link-btn:hover {
  border-color: var(--accent, #f59e0b); color: var(--accent, #f59e0b);
}

/* Listing wrapper */
.ccb-listing { }

/* Responsive */
@media (max-width: 768px) {
  .ccb-featured { grid-template-columns: 1fr; }
  .ccb-featured__image { min-height: 200px; }
  .ccb-grid--cols-3, .ccb-grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
  .ccb-post-mag { grid-template-columns: 100px 1fr; }
  .ccb-article__title { font-size: 1.8rem; }
}
@media (max-width: 480px) {
  .ccb-grid--cols-2, .ccb-grid--cols-3, .ccb-grid--cols-4 { grid-template-columns: 1fr; }
  .ccb-post-mag { grid-template-columns: 1fr; }
}
