/* Content pages: blog, articles, legal. Loaded after site.css. */

/* ---------- Prose (articles, legal) ---------- */
.prose-wrap { max-width: 800px; }
.prose { font-size: 17px; line-height: 1.8; color: var(--body); }
.prose h2 { font-size: clamp(24px, 2.6vw, 32px); margin: 2.2em 0 .6em; }
.prose h3 { font-size: 21px; margin: 1.8em 0 .5em; }
.prose h4 { font-size: 17px; margin: 1.5em 0 .4em; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.2em; }
.prose a { color: var(--red-deep); text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.4em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--red-deep); }
.prose blockquote { margin: 1.8em 0; padding: 18px 24px; border-left: 4px solid var(--red); background: var(--soft); border-radius: 0 var(--r-card) var(--r-card) 0; color: var(--ink); font-size: 1.05em; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img, .prose figure { margin: 2em 0; border-radius: var(--r-card); }
.prose figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.8em 0; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--ink); font-weight: 600; background: var(--soft); }
.prose code { font-size: .9em; background: var(--soft); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: var(--ink); color: var(--on-dark); padding: 18px; border-radius: 14px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
/* legacy blocks used in the legal pages */
.prose .data-category, .prose .contact-box { background: var(--soft); border-radius: var(--r-card); padding: 18px 22px; margin: 0 0 16px; }
.prose .data-category p { margin: 6px 0 0; }
.prose .highlight-box { background: var(--red-soft); border-radius: var(--r-card); padding: 18px 22px; margin: 1.6em 0; }
.prose .highlight-box p, .prose .contact-box p { margin: 0; }

/* ---------- Blog listing ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.blog-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); transition: transform .2s, box-shadow .2s; }
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.blog-card a { display: flex; flex-direction: column; height: 100%; padding: 28px; text-decoration: none; color: inherit; }
.blog-card .cat { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red-deep); margin-bottom: 10px; }
.blog-card .date { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.blog-card h2, .blog-card h3 { font-size: 21px; line-height: 1.3; margin-bottom: 12px; }
.blog-card p { font-size: 15.5px; flex: 1; margin-bottom: 20px; }
.blog-card .foot { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
.blog-card .go { color: var(--red-deep); font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- Article ---------- */
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 15px; color: var(--on-dark-muted); margin-top: 22px; }
.article-back { display: inline-block; color: var(--on-dark-muted); text-decoration: none; font-size: 15px; margin-bottom: 24px; }
.article-back:hover { color: #fff; }
.article-hero h1 { max-width: 860px; }
.article-footer { max-width: 800px; margin: 56px auto 0; }
.author-bio { background: var(--soft); border-radius: var(--r-card); padding: 26px 28px; }
.author-bio h3 { font-size: 18px; margin-bottom: 6px; }
.author-bio p { font-size: 15.5px; }

/* ---------- AI summary (light theme) ---------- */
.ai-summary-container { max-width: 800px; margin: 0 auto 40px; }
.ai-summary-trigger { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 16px 24px; background: var(--red-soft); border: 1px solid #f6c3cf; border-radius: var(--r-card); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s, transform .15s; }
.ai-summary-trigger:hover { background: #ffd3de; transform: translateY(-1px); }
.ai-icon, .ai-icon-small { color: var(--red-deep); }
.ai-badge { padding: 3px 10px; background: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red-deep); }
.ai-summary-panel { margin-top: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; box-shadow: var(--shadow); }
.ai-summary-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ai-summary-title { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.ai-close { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; width: 34px; height: 34px; border-radius: 8px; }
.ai-close:hover { background: var(--soft); color: var(--ink); }
.ai-loading { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.ai-spinner { width: 20px; height: 20px; border: 3px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-summary-result h3 { font-size: 17px; margin-bottom: 12px; }
.ai-summary-result ol { margin: 0; padding-left: 1.3em; }
.ai-summary-result li { margin-bottom: 10px; }
.ai-summary-result li::marker { color: var(--red-deep); font-weight: 700; }
.ai-error { color: #8a1230; }

@media (max-width: 1024px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .blog-grid { grid-template-columns: 1fr; } .prose { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .ai-spinner { animation-duration: 3s; } }

/* Legal templates: draft notice, highlighted placeholders, tables */
.draft-note { background: #fff7d6; border: 1px solid #f0d977; border-radius: var(--r-card); padding: 16px 20px; margin-bottom: 32px; font-size: 15px; line-height: 1.6; color: #5b4a00; }
.draft-note code { background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
mark.ph { background: #fff3a3; color: #19151a; padding: 1px 4px; border-radius: 4px; }
.prose table { display: table; font-size: 14.5px; }
.prose table thead th { white-space: nowrap; }
@media (max-width: 640px) { .prose table { display: block; overflow-x: auto; } }
