/* Shared by Jekyll static pages and Flask subscriber app (one canonical file). */
:root {
  color-scheme: light dark;
  --fg: #1a1a1a;
  --fg-muted: #4a4a4a;
  --bg: #f7f7f2;
  --panel: #ffffff;
  --border: #d8d6cf;
  --accent: #0078d4;
  --accent-hover: #106ebe;
  --err-bg: #fdeaea;
  --err-fg: #6b1010;
  --err-border: #e4b4b4;
  --webfeed-accent: #9aa5b5;
  --announcement-bg: #e9edf3;
  --announcement-border: #bcc3cd;
  --announcement-fg: #1a1a1a;
  --announcement-fg-muted: #3d4450;
  --disabled-fg: #999;
  --btn-fg: #fff;
  --preview-banner-bg: #fffbeb;
  --preview-banner-border: #f59e0b;
  --preview-banner-fg: #92400e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e8e6e3;
    --fg-muted: #a8a5a0;
    --bg: #1a1a18;
    --panel: #242422;
    --border: #3d3d3a;
    --accent: #479ef5;
    --accent-hover: #62abf5;
    --err-bg: #3d2020;
    --err-fg: #f0a8a8;
    --err-border: #6b3030;
    --webfeed-accent: #6a7585;
    --announcement-bg: #2a2e35;
    --announcement-border: #454a54;
    --announcement-fg: #e8e6e3;
    --announcement-fg-muted: #b0adb8;
    --disabled-fg: #666;
    --preview-banner-bg: #3d2f0a;
    --preview-banner-border: #d97706;
    --preview-banner-fg: #fcd34d;
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
}

.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.site-brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.site-title {
  font-size: 2.25rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}

.site-tagline {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.3;
  font-weight: 400;
  color: var(--fg-muted);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--accent);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--accent-hover);
  text-decoration: underline;
}

main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}

p,
ul {
  color: var(--fg-muted);
  margin: 0 0 1rem;
}

ul {
  padding-left: 1.2rem;
}

a {
  color: var(--accent);
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
  margin: 0 0 1rem;
}

.muted {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

/* Digest issue pages (/YYYY/MM/DD/…) */
.digest {
  margin: 0;
}

.digest-header {
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* Issue date: larger than digest-body h2 source lines (~1.1rem).
   Mirrors _layouts/digest.html <style>; keep both aligned. */
article.digest > header.digest-header > p.digest-meta,
article.digest > header.digest-header > p.muted.digest-meta {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 1.65rem !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  color: var(--fg) !important;
}

.digest-body {
  margin: 0;
}

/* Webfeed source group: accent bar on posts only (email uses inline border-left on items). */
.digest-body .digest-webfeed-section {
  margin: 1.25rem 0;
}

.digest-body .digest-webfeed-section > h2 {
  margin: 0 0 0.65rem;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1.25;
  font-weight: normal;
  font-style: italic;
  color: var(--fg);
}

/* Candidates under a webfeed heading (email uses inline styles; Jekyll uses this class). */
.digest-body .digest-webfeed-items {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.digest-body .digest-webfeed-section .digest-webfeed-items {
  margin: 0 0 0 1.25rem;
  padding-left: 0.75rem;
  border-left: 4px solid var(--webfeed-accent);
}

/* Display-group accent tokens (see src/wn/publish/accent_tokens.py). */
.digest-body .digest-webfeed-items.digest-accent--m365 {
  --webfeed-accent: #7eb0d4;
}

.digest-body .digest-webfeed-items.digest-accent--copilot {
  --webfeed-accent: #6eb8bc;
}

.digest-body .digest-webfeed-items.digest-accent--entra {
  --webfeed-accent: #a898c8;
}

.digest-body .digest-webfeed-items.digest-accent--dev {
  --webfeed-accent: #85b896;
}

.digest-body .digest-webfeed-items.digest-accent--powerplatform {
  --webfeed-accent: #b888c8;
}

@media (prefers-color-scheme: dark) {
  .digest-body .digest-webfeed-items.digest-accent--m365 {
    --webfeed-accent: #5a8fb8;
  }

  .digest-body .digest-webfeed-items.digest-accent--copilot {
    --webfeed-accent: #4f9599;
  }

  .digest-body .digest-webfeed-items.digest-accent--entra {
    --webfeed-accent: #8878a8;
  }

  .digest-body .digest-webfeed-items.digest-accent--dev {
    --webfeed-accent: #6a9a78;
  }

  .digest-body .digest-webfeed-items.digest-accent--powerplatform {
    --webfeed-accent: #9670a8;
  }
}

/* Per-post stack (Markdown ``digest-candidate`` wrapper): tight title → excerpt → Read More → date */
.digest-body .digest-candidate {
  margin: 0 0 1.4rem;
}

.digest-body .digest-candidate h3 {
  margin: 0 0 0.25rem;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1.28;
  font-weight: 700;
  color: var(--fg);
}

.digest-body .digest-webfeed-section .digest-candidate h3 a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
}

.digest-body .digest-webfeed-section .digest-candidate h3 a:hover,
.digest-body .digest-webfeed-section .digest-candidate h3 a:focus {
  color: var(--fg);
  text-decoration: none;
}

.digest-body .digest-candidate p {
  margin: 0 0 0.25rem;
  line-height: 1.35;
  font-size: 0.95rem;
}

.digest-body .digest-candidate p:last-child {
  margin-bottom: 0;
}

.digest-body .digest-webfeed-items > .digest-candidate:last-child {
  margin-bottom: 0;
}

/* Operator blog / announcement block: neutral panel (light values match email digest). */
.digest-announcement {
  background: var(--announcement-bg);
  border: 1px solid var(--announcement-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.digest-announcement h3 {
  margin: 0 0 0.65rem;
  font-size: 1.1rem;
  line-height: 1.25;
  color: var(--announcement-fg);
}

.digest-announcement ul {
  margin: 0 0 0.5rem;
  padding-left: 1.2rem;
  color: var(--announcement-fg-muted);
}

.digest-announcement p {
  margin: 0 0 0.35rem;
  color: var(--announcement-fg-muted);
  font-size: 0.95rem;
}

.digest-announcement li {
  margin: 0.25rem 0;
}

/* Kramdown may emit two ``<br />`` before a markdown link inside a list item; collapse the duplicate */
.digest-announcement li br + br {
  display: none;
}

.digest-announcement a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.digest-announcement a:hover,
.digest-announcement a:focus {
  color: var(--accent-hover);
  text-decoration: underline;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.9rem;
}

.subscribe-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 0.75rem;
  width: 100%;
  max-width: 100%;
  margin: 0 0 0.9rem;
}

.turnstile-block {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
  max-width: 100%;
}

.turnstile-block .cf-turnstile {
  max-width: 100%;
}

.turnstile-disclosure {
  margin: 0;
}

.link-small-caps {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  text-decoration: none;
}

.link-small-caps:hover,
.link-small-caps:focus {
  color: var(--accent);
  text-decoration: underline;
}

/* Honeypot decoy field: no layout footprint; still in DOM for naive bots (Phase 2). */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.hp-field input {
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 0;
  line-height: 0;
}

label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--fg);
}

input[type="email"] {
  max-width: 24rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
  color: var(--fg);
  background: var(--panel);
}

button,
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  color: var(--btn-fg);
  background: var(--accent);
  border: none;
  border-radius: 4px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
button:focus,
.btn:hover,
.btn:focus {
  background: var(--accent-hover);
}

.error-box {
  background: var(--err-bg);
  color: var(--err-fg);
  border: 1px solid var(--err-border);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

/* Paginated digest archive (/archive/) */
.archive-item--blog .archive-item__title {
  margin-bottom: 0.25rem;
}

.archive-item__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.blog-index-post__date {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.blog-index-post__date time {
  font-variant-numeric: tabular-nums;
}

.blog-index__feed {
  margin: 0 0 1rem;
}

.blog-index__feed-url {
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
  padding: 0.1rem 0.35rem;
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  color: var(--fg-muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.archive-item__title a {
  text-decoration: none;
  color: var(--fg);
}

.archive-item__title a:hover,
.archive-item__title a:focus {
  text-decoration: underline;
  color: var(--accent);
}

.archive-item__excerpt {
  font-size: 0.95rem;
  color: var(--fg-muted);
}

.archive-item__excerpt ul {
  margin: 0.5rem 0 0;
}

.archive-item__more {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 1.5rem 0 0;
  padding: 0.9rem 0 0;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.pagination__link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.pagination__link:hover,
.pagination__link:focus {
  text-decoration: underline;
  color: var(--accent-hover);
}

.pagination__text--disabled {
  color: var(--disabled-fg);
}

.preview-banner {
  margin: 0 0 1.25rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--preview-banner-border);
  background: var(--preview-banner-bg);
  color: var(--preview-banner-fg);
  border-radius: 6px;
  font-weight: 600;
}

.pagination__status {
  color: var(--fg-muted);
}

.site-footer {
  max-width: 48rem;
  margin: 2rem auto 0;
  padding: 0 1.25rem 1.5rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
}
