/* ===================================================
   Publication CMS — Stylesheet
   Palette: ink (#1a1a2e), parchment (#f5f5f0),
            warm cream (#fffdf7), gold (#e8d5b7),
            muted red accent (#c0392b)
   Body: Lora (serif)   UI: Inter (sans)
=================================================== */

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

:root {
  --ink:       #1a1a2e;
  --parchment: #f5f5f0;
  --cream:     #fffdf7;
  --gold:      #e8d5b7;
  --accent:    #c0392b;
  --muted:     #777;
  --border:    #e2ddd6;
  --max-w:     720px;
  --max-wide:  1100px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--parchment);
  color: var(--ink);
  font-family: 'Lora', Georgia, serif;
  font-size: 18px;
  line-height: 1.75;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */
.site-header {
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid #2e2e50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}
.site-logo {
  font-family: 'Lora', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .5px;
  text-decoration: none;
}
.site-logo:hover { text-decoration: none; opacity: .85; }
.site-nav { display: flex; gap: 28px; align-items: center; }
.site-nav a {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #b0aec8;
  text-decoration: none;
  transition: color .2s;
}
.site-nav a:hover { color: var(--gold); text-decoration: none; }
.site-nav .nav-subscribe {
  background: var(--accent);
  color: #fff;
  padding: 8px 18px;
  border-radius: 3px;
  font-weight: 500;
}
.site-nav .nav-subscribe:hover { background: #a93226; color: #fff; }

/* ── Hero ── */
.hero {
  background: var(--ink);
  color: var(--gold);
  padding: 72px 24px;
  text-align: center;
  border-bottom: 3px solid #2e2e50;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -.5px;
}
.hero p {
  font-size: 18px;
  color: #b0aec8;
  max-width: 480px;
  margin: 0 auto 32px;
  font-style: italic;
}
.hero-sub-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-sub-form input[type="email"] {
  padding: 12px 18px;
  border: 1px solid #3e3e60;
  background: #2a2a44;
  color: #fff;
  border-radius: 3px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  width: 280px;
}
.hero-sub-form input::placeholder { color: #7070a0; }
.hero-sub-form button {
  padding: 12px 22px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 3px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .3px;
  transition: background .2s;
}
.hero-sub-form button:hover { background: #a93226; }

/* ── Article feed ── */
.feed {
  max-width: var(--max-w);
  margin: 64px auto;
  padding: 0 24px;
}
.feed-title {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 40px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.article-card {
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
}
.article-card:last-child { border-bottom: none; }
.article-meta {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.article-meta .byline::before { content: 'By '; }
.article-card h2 {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 12px;
}
.article-card h2 a { color: var(--ink); }
.article-card h2 a:hover { color: var(--accent); text-decoration: none; }
.article-excerpt {
  font-size: 17px;
  color: #555;
  line-height: 1.65;
  margin-bottom: 18px;
}
.read-more {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .3px;
}
.read-more:hover { text-decoration: underline; }

/* ── Single article ── */
.article-page {
  max-width: var(--max-w);
  margin: 56px auto;
  padding: 0 24px;
}
.article-page header { margin-bottom: 36px; }
.article-page .article-meta { margin-bottom: 14px; }
.article-page h1 {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 8px;
}
.article-divider {
  border: none;
  border-top: 2px solid var(--ink);
  width: 48px;
  margin: 24px 0;
}

.article-body { font-size: 18px; line-height: 1.85; color: #222; }
.article-body p        { margin-bottom: 1.5em; }
.article-body h2       { font-size: 1.5em; margin: 1.8em 0 .6em; }
.article-body h3       { font-size: 1.25em; margin: 1.5em 0 .5em; }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5em 0;
  padding: .5em 1.2em;
  color: #555;
  font-style: italic;
}
.article-body ul, .article-body ol { margin: 1em 0 1.5em 1.5em; }
.article-body li { margin-bottom: .4em; }
.article-body a { color: var(--accent); }
.article-body img { max-width: 100%; border-radius: 4px; margin: 1.5em 0; }
.article-body code {
  background: #f0ede8;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: .88em;
}
.article-body pre {
  background: #1a1a2e;
  color: #e8d5b7;
  padding: 20px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5em 0;
}
.article-body pre code { background: none; padding: 0; font-size: .9em; }

/* ── Subscribe section ── */
.subscribe-section {
  background: var(--ink);
  color: var(--gold);
  padding: 72px 24px;
  text-align: center;
  margin-top: 72px;
}
.subscribe-inner { max-width: 520px; margin: 0 auto; }
.subscribe-section h2 {
  font-size: 30px;
  margin-bottom: 12px;
}
.subscribe-section p {
  font-size: 17px;
  color: #b0aec8;
  margin-bottom: 28px;
  font-style: italic;
}
.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.subscribe-form input {
  padding: 13px 18px;
  border: 1px solid #3e3e60;
  background: #2a2a44;
  color: #fff;
  border-radius: 3px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
}
.subscribe-form input::placeholder { color: #7070a0; }
.subscribe-form button {
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 3px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .3px;
  transition: background .2s;
}
.subscribe-form button:hover { background: #a93226; }
.subscribe-msg {
  color: var(--gold);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ── Footer ── */
.site-footer {
  background: #111120;
  padding: 28px 24px;
  text-align: center;
}
.footer-inner {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #666;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.footer-inner a { color: #888; }
.footer-inner a:hover { color: var(--gold); text-decoration: none; }
.footer-name { color: var(--gold); font-weight: 500; }
.footer-sep { color: #444; }

/* ── Flash messages ── */
.flash {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 28px;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  animation: flashIn .3s ease;
}
.flash-success { background: #1a7a4a; color: #fff; }
.flash-error   { background: #c0392b; color: #fff; }
@keyframes flashIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ── Utility ── */
.page-content {
  max-width: var(--max-w);
  margin: 56px auto;
  padding: 0 24px;
}
.page-content h1 { font-size: 32px; margin-bottom: 24px; }

/* ── Admin styles ── */
.admin-wrap {
  min-height: 100vh;
  background: #f0eee8;
  font-family: 'Inter', sans-serif;
}
.admin-nav {
  background: var(--ink);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  height: 56px;
}
.admin-nav a {
  font-size: 14px;
  color: #b0aec8;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}
.admin-nav a:hover { color: var(--gold); text-decoration: none; }
.admin-nav .admin-brand {
  font-family: 'Lora', serif;
  color: var(--gold);
  font-size: 16px;
  margin-right: 12px;
}
.admin-nav .nav-logout { margin-left: auto; }

.admin-main {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 24px;
}
.admin-card {
  background: #fff;
  border-radius: 6px;
  padding: 32px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  margin-bottom: 28px;
}
.admin-card h2 {
  font-size: 20px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e8e4de;
}

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d8d4ce;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: #faf9f7;
  transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea { min-height: 420px; resize: vertical; font-family: 'Lora', serif; font-size: 16px; line-height: 1.7; }

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity .2s;
}
.btn:hover { opacity: .85; text-decoration: none; }
.btn-primary { background: var(--ink); color: var(--gold); }
.btn-success { background: #1a7a4a; color: #fff; }
.btn-danger  { background: var(--accent); color: #fff; }
.btn-ghost   { background: transparent; border: 1px solid #ccc; color: #555; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  padding: 8px 12px;
  border-bottom: 2px solid #e8e4de;
}
.admin-table td {
  padding: 12px 12px;
  border-bottom: 1px solid #f0ede8;
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #faf9f7; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.badge-published { background: #d4f4e4; color: #1a7a4a; }
.badge-draft     { background: #f0ede8; color: #888; }
.badge-confirmed { background: #d4f4e4; color: #1a7a4a; }
.badge-pending   { background: #fff3cd; color: #856404; }
.badge-unsub     { background: #f8d7da; color: #842029; }

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: #fff;
  border-radius: 6px;
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.stat-card .stat-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  font-family: 'Lora', serif;
}
.stat-card .stat-label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
}
.login-box {
  background: #fff;
  border-radius: 6px;
  padding: 40px 36px;
  width: 360px;
  box-shadow: 0 8px 40px rgba(0,0,0,.3);
}
.login-box h1 {
  font-family: 'Lora', serif;
  font-size: 24px;
  color: var(--ink);
  margin-bottom: 28px;
  text-align: center;
}
.login-error {
  background: #f8d7da;
  color: #842029;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 16px;
  font-family: 'Inter', sans-serif;
}

/* Responsive */
@media (max-width: 640px) {
  .site-nav a:not(.nav-subscribe) { display: none; }
  .hero { padding: 48px 20px; }
  .admin-main { padding: 0 16px; }
  .admin-card { padding: 20px; }
}

/* ── Author bio block (article page) ── */
.author-bio-block {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.author-bio-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.author-bio-name {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
}
.author-bio-text {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* ── Share buttons ── */
.share-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.share-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-right: 4px;
}
.share-btn {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  transition: all .15s;
}
.share-btn:hover { background: var(--ink); color: var(--gold); border-color: var(--ink); text-decoration: none; }
.share-twitter  { }
.share-copy     { }

/* ── Subscribe form honeypot ── */
.hp-field { display: none !important; }

/* ── Subscriber count badge ── */
.sub-count-badge {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #b0aec8;
  margin-top: 8px;
}
