/* ============================================================
   CanMyCat Ghost Theme — screen.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --purple: #5B2D8E;
  --purple-light: #7C3FBF;
  --purple-mist: #F0EBFA;
  --purple-border: rgba(91,45,142,0.12);
  --lavender: #C49EF5;
  --white: #ffffff;
  --ink: #1a1025;
  --muted: #7a6a90;
  --safe: #1A6B4A;
  --safe-bg: #e6f4ee;
  --danger: #C0392B;
  --danger-bg: #fdecea;
  --caution: #E6A817;
  --caution-bg: #fef3e2;
  --border: rgba(91,45,142,0.1);
  --card-bg: #ffffff;
  --body-bg: #fafafa;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--body-bg);
}

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-light); }

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

/* ── HEADER ─────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo-mark {
  width: 36px;
  height: 36px;
  background: var(--purple);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.site-logo-mark svg { width: 23px; height: 23px; }
.site-logo-wordmark {
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}
.site-logo-wordmark .w-can { color: var(--muted); }
.site-logo-wordmark .w-my  { color: var(--muted); opacity: 0.6; }
.site-logo-wordmark .w-cat { color: var(--purple); }
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.site-nav a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--purple-mist); color: var(--purple); }
.site-nav a.nav-cta {
  background: var(--purple);
  color: white;
  margin-left: 0.25rem;
}
.site-nav a.nav-cta:hover { background: var(--purple-light); }

/* ── HERO (homepage) ─────────────────────────────────────── */
.site-hero {
  background: linear-gradient(135deg, var(--purple-mist) 0%, #e8dff5 100%);
  border-bottom: 1px solid var(--purple-border);
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
}
.site-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.75rem;
}
.site-hero h1 span { color: var(--purple); }
.site-hero p {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}
.hero-btn {
  display: inline-block;
  background: var(--purple);
  color: white;
  padding: 0.7rem 1.6rem;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s;
}
.hero-btn:hover { background: var(--purple-light); color: white; }

/* ── POST GRID ───────────────────────────────────────────── */
.post-feed {
  max-width: 1080px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}
.post-feed-title {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.post-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(91,45,142,0.1);
}
.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--purple-mist);
}
.post-card-image-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--purple-mist), #e0d5f5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.post-card-body {
  padding: 1.25rem 1.25rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.post-card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.post-card-tag {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--purple);
  background: var(--purple-mist);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}
.post-card-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--purple); }
.post-card-excerpt {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.post-card-meta time { color: var(--muted); }

/* ── SINGLE POST ─────────────────────────────────────────── */
.post-header {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  text-align: center;
}
.post-tags {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.post-tag {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--purple);
  background: var(--purple-mist);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}
.post-title {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 1rem;
}
.post-meta {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.post-meta-divider { opacity: 0.4; }
.post-feature-image {
  max-width: 1080px;
  margin: 0 auto 2.5rem;
  padding: 0 1.5rem;
}
.post-feature-image img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 16px;
}
.post-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* Post content typography */
.post-content h2 {
  font-size: 1.55rem;
  font-weight: 500;
  color: var(--ink);
  margin: 2.5rem 0 0.75rem;
  letter-spacing: -0.01em;
}
.post-content h3 {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--ink);
  margin: 2rem 0 0.6rem;
}
.post-content p {
  margin-bottom: 1.25rem;
  color: var(--ink);
  line-height: 1.75;
}
.post-content ul, .post-content ol {
  margin: 0 0 1.25rem 1.5rem;
}
.post-content li {
  margin-bottom: 0.4rem;
  line-height: 1.65;
}
.post-content strong { font-weight: 500; }
.post-content a { color: var(--purple); border-bottom: 1px solid var(--purple-border); }
.post-content a:hover { color: var(--purple-light); border-color: var(--purple-light); }
.post-content blockquote {
  border-left: 3px solid var(--purple);
  padding: 0.75rem 0 0.75rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-style: italic;
}
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}
.post-content img {
  border-radius: 12px;
  margin: 1.5rem 0;
}
.post-content pre {
  background: var(--ink);
  color: var(--lavender);
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}
.post-content code {
  font-size: 0.88rem;
  background: var(--purple-mist);
  color: var(--purple);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}
.post-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}
/* KG Cards */
.kg-callout-card {
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--purple-mist);
  border-left: 3px solid var(--purple);
}
.kg-callout-emoji { font-size: 1.2rem; flex-shrink: 0; }
.kg-callout-text { font-size: 0.92rem; line-height: 1.6; }
.kg-image-card img { border-radius: 12px; margin: 1.5rem 0; }
.kg-width-wide { margin-left: -4rem; margin-right: -4rem; }
.kg-width-full { margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); }

/* ── CTA STRIP ───────────────────────────────────────────── */
.post-cta {
  background: var(--purple-mist);
  border: 1px solid var(--purple-border);
  border-radius: 16px;
  padding: 1.75rem 2rem;
  margin: 2.5rem 0;
  text-align: center;
}
.post-cta h3 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.post-cta p {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.post-cta a {
  display: inline-block;
  background: var(--purple);
  color: white;
  padding: 0.6rem 1.4rem;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.9rem;
  border: none;
  transition: background 0.15s;
}
.post-cta a:hover { background: var(--purple-light); }

/* ── PAGINATION ──────────────────────────────────────────── */
.pagination {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}
.pagination a, .pagination span {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  background: white;
  transition: all 0.15s;
}
.pagination a:hover { border-color: var(--purple); color: var(--purple); }
.pagination .page-number { color: var(--ink); font-weight: 500; border-color: var(--purple); }

/* ── FOOTER ──────────────────────────────────────────────── */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.5);
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.82rem;
}
.site-footer a { color: rgba(255,255,255,0.65); }
.site-footer a:hover { color: var(--lavender); }
.site-footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 1rem;
}
.site-footer-logo-mark {
  width: 28px; height: 28px;
  background: var(--purple);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.site-footer-logo-mark svg { width: 18px; height: 18px; }
.site-footer-wordmark {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.site-footer-wordmark .w-can { color: rgba(255,255,255,0.45); }
.site-footer-wordmark .w-my  { color: rgba(255,255,255,0.25); }
.site-footer-wordmark .w-cat { color: var(--lavender); }
.site-footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 0.75rem 0;
  flex-wrap: wrap;
}
.site-footer p { margin-top: 0.75rem; opacity: 0.5; font-size: 0.75rem; }

/* ── TAG PAGE ────────────────────────────────────────────── */
.tag-header {
  background: var(--purple-mist);
  border-bottom: 1px solid var(--purple-border);
  padding: 2.5rem 1.5rem;
  text-align: center;
}
.tag-header h1 {
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}
.tag-header p { font-size: 0.95rem; color: var(--muted); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header-inner { height: 56px; }
  .site-logo-wordmark { font-size: 1.15rem; }
  .site-nav a { padding: 0.3rem 0.6rem; font-size: 0.78rem; }
  .post-grid { grid-template-columns: 1fr; }
  .post-header { padding: 2rem 1.25rem 1.5rem; }
  .post-content { padding: 0 1.25rem 3rem; }
  .kg-width-wide { margin-left: 0; margin-right: 0; }
  .site-hero { padding: 2.5rem 1.25rem 2rem; }
}

/* Nav current page indicator */
.site-nav a.nav-current { color: var(--purple); background: var(--purple-mist); }
