/* Padkos Blog. Design mirrors profgalloway.com:
   light blue-white page background, centered single column, white cards
   with soft drop shadow, full-bleed cover image on each card, small grey
   date above the title, "Read More" pill button.

   Fonts: Roboto (body) + Nunito (headings), pulled from Google Fonts.
   Brand color is the wordmark dark: #1e1e1e. The --accent variable is
   used for hover states, dates, buttons. */

:root {
  --bg: #F7FAFD;
  --card-bg: #ffffff;
  --rule: #D5DAE2;
  --ink: #1E2022;
  --ink-soft: #2c2e30;
  /* Bumped from #77838F (3.0:1 on white, failed WCAG AA) to #5b6470
     (4.7:1, passes AA for normal text). Used for dates, secondary
     copy, and search/theme icon defaults. */
  --ink-dim: #5b6470;
  /* Bumped from #9aa3ad (2.5:1 on white, fails everywhere) to #5c656f
     (4.8:1, passes AA for normal text). Used by the pagination status
     line, footer credit, search placeholder, and the empty-cover
     placeholder text on post cards. */
  --ink-faint: #5c656f;
  --accent: #1e1e1e;
  --accent-dark: #000000;
  --max-w: 720px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --display: 'Nunito', var(--sans);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; margin: 0; }

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

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

.hidden { display: none !important; }

/* ============= TOP BAR ============= */
.top-bar {
  background: #fff;
  border-bottom: 1px solid var(--rule);
}
.top-bar-inner {
  max-width: 1450px;
  margin: 0 auto;
  padding: 22px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
@media (max-width: 900px) {
  .top-bar-inner { padding: 18px 20px; }
}
.banner-logo {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 6px;
  text-decoration: none;
}
.banner-logo .banner-img {
  width: 260px; max-width: 60vw;
  height: auto;
  display: block;
}
@media (max-width: 600px) {
  .banner-logo .banner-img { width: 200px; }
}
/* .banner-byline used to render "By Shaun Osher" as separate styled
   text alongside the wordmark; the byline is now baked into the
   combined padkos-blog-logo.png so this rule is intentionally dropped. */
.top-actions {
  display: flex; align-items: center; gap: 16px;
}
.search-form {
  display: flex; align-items: center;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  height: 38px;
}
.search-form input[type="text"] {
  border: 0; outline: none; background: transparent;
  padding: 0 14px;
  font-size: 13px; font-family: var(--sans);
  color: var(--ink);
  width: 220px;
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500;
}
.search-form input[type="text"]::placeholder { color: var(--ink-faint); }
.search-form button {
  background: transparent; border: 0; cursor: pointer;
  padding: 0 14px; color: var(--ink-dim);
  display: flex; align-items: center; justify-content: center;
}
.search-form button:hover { color: var(--accent); }
.vertical-line {
  width: 1px; height: 28px; background: var(--rule);
}
.listen-button {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent);
  color: #fff !important;
  padding: 9px 22px;
  border-radius: 4px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}
.listen-button:hover { background: var(--accent-dark); color: #fff !important; }
.listen-button-icon { width: 15px; height: 15px; display: block; }

@media (max-width: 720px) {
  .top-bar-inner { flex-direction: column; gap: 18px; }
  .top-actions { flex-wrap: wrap; justify-content: center; }
  .search-form input[type="text"] { width: 160px; }
}

/* ============= TWO-COLUMN LAYOUT (POSTS + SIDEBAR) ============= */
.blog-content { background: #fff; }
.blog-wrapper {
  display: flex;
  flex-direction: row;
  max-width: 1450px;
  margin: 0 auto;
  min-height: 550px;
  background: #fff;
  align-items: flex-start;
}
.left-col {
  flex: 1 1 auto;
  width: 65%;
  padding: 28px 32px 60px 32px;
  min-width: 0;
}
.right-col {
  flex: 0 0 35%;
  max-width: 420px;
  padding: 40px 36px;
  position: sticky;
  top: 0;
  align-self: flex-start;
}
.sidebar {
  text-align: left;
}
.sidebar .profile-face {
  width: 180px; height: 180px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  margin: 0 0 24px;
  border: 5px solid #fff;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}
.sidebar .bio h2 {
  font-size: 28px;
  margin: 0 0 14px;
  color: var(--ink);
  font-weight: 800;
}
.sidebar .bio p {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 20px;
  line-height: 1.6;
}
.sidebar .bio a { color: var(--accent); text-decoration: underline; }
.social-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.social-links li { display: flex; }
.social-links a {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-dim);
  transition: color 0.15s, transform 0.15s;
}
.social-links a:hover { color: var(--accent); transform: translateY(-2px); }
.social-links svg { width: 22px; height: 22px; fill: currentColor; }

/* Mobile: stack the columns. Sidebar moves above posts and goes horizontal. */
@media (max-width: 900px) {
  .blog-wrapper { flex-direction: column; }
  .left-col { width: 100%; padding: 20px 20px 40px; }
  .right-col {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    padding: 28px 20px 8px;
    position: static;
    border-bottom: 1px solid var(--rule);
  }
  .sidebar {
    display: flex; align-items: center; gap: 22px;
    max-width: 760px; margin: 0 auto;
  }
  .sidebar .profile-face {
    width: 110px; height: 110px;
    margin: 0;
    flex-shrink: 0;
  }
  .sidebar .bio h2 { font-size: 22px; margin-bottom: 8px; }
  .sidebar .bio p { font-size: 14px; margin-bottom: 12px; }
  .social-links { gap: 12px; }
}
@media (max-width: 560px) {
  .sidebar { flex-direction: column; align-items: flex-start; text-align: left; gap: 16px; }
  .sidebar .profile-face { width: 90px; height: 90px; }
}

/* ============= NEWSLETTER PROMO (SIDEBAR CARD) ============= */
.newsletter-promo {
  margin: 28px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.newsletter-promo-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 24px 22px;
  display: block;
  text-align: left;
}
.newsletter-promo-card .eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.newsletter-promo-card h3 {
  font-size: 20px; font-weight: 800;
  margin: 0 0 8px;
  color: var(--ink);
  line-height: 1.2;
}
.newsletter-promo-card p {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--ink-dim);
  line-height: 1.5;
}
.newsletter-promo-card .promo-cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 11px 22px;
  border-radius: 4px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.newsletter-promo-card .promo-cta:hover { background: var(--accent-dark); color: #fff; }

@media (max-width: 900px) {
  /* On mobile the sidebar is horizontal at the top of the page. The promo
     drops back into the bio column and stays compact. */
  .newsletter-promo { margin: 18px 0 0; padding-top: 18px; }
}

/* ============= POSTS STREAM ============= */
.posts-section {
  width: 100%;
  margin: 0;
  padding: 0;
}
.post-card {
  display: block;
  border-radius: 6px;
  background: var(--card-bg);
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
  margin-bottom: 30px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0,0,0,0.13);
  color: inherit;
}
.post-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #F7FAFD 0%, #E6ECF2 100%);
  overflow: hidden;
}
.post-card-image img {
  width: 100%; height: 100%; object-fit: cover;
}
.post-card-image.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint);
  font-family: var(--display);
  font-size: 20px; font-weight: 800;
  letter-spacing: 0.2em; text-transform: uppercase;
  border: 1px solid var(--rule);
  border-bottom: 0;
}
.post-card-body {
  padding: 24px 28px 28px;
}
.post-card-date {
  display: block;
  font-size: 14px;
  color: var(--ink-dim);
  margin-bottom: 8px;
  font-family: var(--display);
  font-weight: 600;
}
.post-card-body h3 {
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--ink);
  font-weight: 800;
}
.post-card:hover h3 { color: var(--accent); }
.post-card-excerpt {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 18px;
  line-height: 1.55;
}
.read-more-button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 9px 20px;
  border-radius: 4px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.post-card:hover .read-more-button { background: var(--accent-dark); }

/* ============= PAGINATION ============= */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  margin: 16px 0 40px;
  flex-wrap: wrap;
}
.pagination button,
.pagination span.page {
  background: #fff;
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 4px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-style: normal;
}
.pagination button:hover { border-color: var(--accent); color: var(--accent); }
.pagination button[disabled] { opacity: 0.4; cursor: not-allowed; }
.pagination .page.current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(30, 30, 30, 0.25);
  transform: translateY(-1px);
  cursor: default;
}
.pagination .ellipsis {
  background: transparent; border: 0; color: var(--ink-faint); padding: 8px 4px;
}
.pagination .status {
  width: 100%; text-align: center;
  font-size: 13px; color: var(--ink-dim);
  margin-bottom: 6px;
}

/* ============= STATUS BLOCKS ============= */
.status-block {
  text-align: center;
  color: var(--ink-faint);
  padding: 48px 24px;
  font-size: 15px;
}

/* ============= SUBSCRIBE INLINE FORM ============= */
.subscribe-block {
  background: #fff;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 56px 24px;
  text-align: center;
}
.subscribe-block h2 {
  font-size: 28px; margin: 0 0 8px; color: var(--ink);
}
.subscribe-block p {
  font-size: 15px; color: var(--ink-dim);
  margin: 0 auto 22px;
  max-width: 460px;
}
.newsletter-form {
  display: flex; gap: 8px; max-width: 480px; margin: 0 auto;
  flex-wrap: wrap;
}
.newsletter-form input[type="email"],
.newsletter-form input[type="text"] {
  flex: 1 1 200px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: var(--sans);
  background: #fff;
  outline: none;
}
.newsletter-form input[type="email"]:focus,
.newsletter-form input[type="text"]:focus { border-color: var(--accent); }
.newsletter-form button {
  background: var(--accent); color: #fff; border: 0;
  padding: 12px 24px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
}
.newsletter-form button:hover { background: var(--accent-dark); }
.newsletter-msg {
  margin-top: 14px; min-height: 18px;
  font-size: 13px; color: var(--ink-dim);
}
.newsletter-msg.ok { color: #1f8a3d; }
.newsletter-msg.err { color: var(--accent); }

/* ============= POST PAGE ============= */
.post-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 60px;
}
.post-page-hero {
  margin-bottom: 28px;
}
.post-page-date {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-dim);
  margin-bottom: 8px;
}
.post-page-hero h1 {
  font-size: 38px;
  line-height: 1.15;
  margin: 0 0 18px;
  color: var(--ink);
}
.post-page-cover {
  width: 100%;
  margin: 0 0 32px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.post-page-cover img { width: 100%; }
.post-page-body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.post-page-body p { margin: 0 0 1.2em; }
.post-page-body a { color: var(--accent); text-decoration: underline; }
.post-page-body h1 { font-size: 28px; margin: 40px 0 16px; color: var(--ink); font-weight: 800; }
.post-page-body h2 { font-size: 24px; margin: 36px 0 14px; color: var(--ink); }
.post-page-body h3 { font-size: 20px; margin: 28px 0 10px; color: var(--ink); }
.post-page-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 24px 0;
  padding: 4px 18px;
  color: var(--ink-dim);
  font-style: italic;
}
.post-page-body img { margin: 24px auto; border-radius: 4px; max-width: 100%; }
.post-page-body ul, .post-page-body ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.post-page-body li { margin-bottom: 0.4em; }

.post-page-foot {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  font-size: 14px;
}
.post-page-foot a {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink-dim);
}
.post-page-foot a:hover { color: var(--accent); }

/* ============= FOOTER ============= */
.site-foot {
  background: #fff;
  border-top: 1px solid var(--rule);
  padding: 36px 24px 28px;
}
.site-foot-inner {
  max-width: 1450px; margin: 0 auto;
  padding: 0 32px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-dim);
}
@media (max-width: 900px) {
  .site-foot-inner { padding: 0 20px; }
}
.site-foot a { color: var(--ink-dim); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.site-foot a.ds-credit { color: var(--ink-faint); margin-left: 4px; font-size: 0.9em; letter-spacing: 0.04em; }
.site-foot a.ds-credit:hover { color: var(--ink); }

/* ============= ADMIN TOP BAR ============= */
/* Reuse the public .top-bar but tag it with a thin red bottom accent so
   admin is visually distinct from the public site. */
.top-bar-admin { border-bottom: 2px solid var(--accent); }

.admin-badge {
  display: inline-block;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(30, 30, 30, 0.08);
  padding: 6px 12px;
  border-radius: 3px;
}
.admin-link {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.admin-link:hover { color: var(--accent); }

/* ============= ADMIN ============= */
.admin-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.admin-shell h1 {
  font-size: 28px; font-weight: 800;
  margin: 0 0 24px;
}
.admin-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 24px;
}
.admin-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 24px;
}
.admin-tab {
  background: none; border: 0;
  padding: 12px 18px;
  font-size: 14px; font-weight: 700;
  font-family: var(--display);
  color: var(--ink-dim); cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.admin-tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.admin-tab:hover { color: var(--ink); }

.admin-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.admin-row > * { flex-shrink: 0; }
.admin-row .grow { flex: 1; min-width: 220px; }

.admin-input,
.admin-textarea,
.admin-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: var(--sans);
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff; color: var(--ink);
  outline: none;
}
.admin-input:focus,
.admin-textarea:focus { border-color: var(--accent); }
.admin-textarea { min-height: 200px; line-height: 1.6; resize: vertical; }
.admin-label {
  font-size: 12px; font-weight: 700; color: var(--ink-dim);
  display: block; margin-bottom: 6px;
  letter-spacing: 0.06em; text-transform: uppercase;
  font-family: var(--display);
}

.btn {
  background: var(--ink); color: #fff; border: 0;
  padding: 10px 18px; font-size: 13px; font-weight: 700;
  font-family: var(--display);
  letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 4px; cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent); color: #fff; }
.btn.btn-secondary {
  background: #fff; color: var(--ink); border: 1px solid var(--rule);
}
.btn.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
.btn.btn-danger { background: var(--accent); }
.btn.btn-danger:hover { background: var(--accent-dark); }
.btn.btn-small { padding: 6px 12px; font-size: 12px; }

.admin-post-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  align-items: center;
}
.admin-post-row:last-child { border-bottom: 0; }
.admin-post-row .title { font-weight: 700; color: var(--ink); }
.admin-post-row .meta { font-size: 12px; color: var(--ink-faint); }
.admin-post-row .actions { display: flex; gap: 6px; flex-wrap: wrap; }

.admin-toolbar {
  position: sticky; top: 0; background: var(--bg); z-index: 5;
  border-bottom: 1px solid var(--rule);
  padding: 12px 0; margin-bottom: 24px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.admin-toolbar .grow { flex: 1; }
.admin-status { font-size: 13px; color: var(--ink-dim); }
.admin-status.ok { color: #1f8a3d; }
.admin-status.err { color: var(--accent); }

.cover-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--rule);
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-preview .cover-remove {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px;
  border: 0; border-radius: 50%;
  background: rgba(30,32,34,0.78);
  color: #fff;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.cover-preview .cover-remove:hover { background: var(--accent); }

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
}
@media (max-width: 880px) {
  .editor-grid { grid-template-columns: 1fr; }
}

.login-shell {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.login-card {
  max-width: 420px; width: 100%;
  background: #fff; border: 1px solid var(--rule); border-radius: 6px;
  padding: 36px;
  text-align: center;
}
.login-card h1 { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
.login-card p { color: var(--ink-dim); margin: 0 0 24px; font-size: 14px; }

/* ============= CUSTOM MODALS ============= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30, 32, 34, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.modal-overlay.open { opacity: 1; }

.modal-card {
  background: #fff;
  border-radius: 8px;
  padding: 28px 28px 22px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s ease;
}
.modal-overlay.open .modal-card { transform: translateY(0) scale(1); }

.modal-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--ink);
}
.modal-message {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 18px;
}

.modal-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 15px;
  font-family: var(--sans);
  color: var(--ink);
  background: #fff;
  outline: none;
  margin-bottom: 18px;
}
.modal-input:focus { border-color: var(--accent); }

.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  flex-wrap: wrap;
}
.modal-btn {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.modal-btn-primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.modal-btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.modal-btn-secondary {
  background: #fff;
  color: var(--ink-soft);
  border-color: var(--rule);
}
.modal-btn-secondary:hover { color: var(--ink); border-color: var(--ink-dim); }
.modal-btn-danger {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.modal-btn-danger:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

/* ---- Subscribe modal ---- */
.modal-eyebrow {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 6px;
}
.modal-card-subscribe .modal-title { font-size: 24px; margin-bottom: 10px; }
.modal-form { margin: 0; }
.modal-form .modal-input { margin-bottom: 12px; }
.modal-form .modal-input:last-of-type { margin-bottom: 18px; }
.modal-status {
  margin-top: 12px;
  font-size: 14px;
  min-height: 1.2em;
}
.modal-status.err { color: var(--accent); }
.modal-status.ok { color: #2c8a4a; }

/* ---- Constant Contact embed hosted inside the subscribe modal ----
   The CC widget injects its own markup + stylesheet. These rules are
   scoped to .modal-cc-mount so they only retouch the embed inside our
   modal, and use !important because we're overriding a third-party
   widget's bundled styles. Class names vary between CC form versions,
   so we target both the generic elements and the known ctct-* classes. */
.modal-card-cc .modal-cc-mount { margin: 2px 0 4px; }
.modal-cc-mount .ctct-form-embed,
.modal-cc-mount .ctct-form-defaults,
.modal-cc-mount form[data-ctct-form] {
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  max-width: none !important;
  border: 0 !important;
}
/* The modal already supplies the eyebrow/title/intro, so hide CC's own
   form header to avoid a duplicate heading. */
.modal-cc-mount .ctct-form-header { display: none !important; }
.modal-cc-mount .ctct-form-text,
.modal-cc-mount .ctct-form-text p {
  font-family: var(--sans) !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: var(--ink-dim) !important;
}
.modal-cc-mount label,
.modal-cc-mount .ctct-form-label {
  font-family: var(--sans) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  color: var(--ink-soft) !important;
}
.modal-cc-mount input[type="text"],
.modal-cc-mount input[type="email"],
.modal-cc-mount .ctct-form-element {
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 11px 14px !important;
  border: 1px solid var(--rule) !important;
  border-radius: 4px !important;
  font-size: 15px !important;
  font-family: var(--sans) !important;
  color: var(--ink) !important;
  background: #fff !important;
  outline: none !important;
  margin-bottom: 12px !important;
}
.modal-cc-mount input[type="text"]:focus,
.modal-cc-mount input[type="email"]:focus,
.modal-cc-mount .ctct-form-element:focus { border-color: var(--accent) !important; }
.modal-cc-mount button,
.modal-cc-mount .ctct-form-button {
  font-family: var(--display) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  padding: 11px 22px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  background: var(--ink) !important;
  color: #fff !important;
  border: 1px solid var(--ink) !important;
  width: 100% !important;
  transition: background 0.15s, border-color 0.15s !important;
}
.modal-cc-mount button:hover,
.modal-cc-mount .ctct-form-button:hover {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}
[data-theme="dark"] .modal-cc-mount input[type="text"],
[data-theme="dark"] .modal-cc-mount input[type="email"],
[data-theme="dark"] .modal-cc-mount .ctct-form-element {
  background: var(--bg) !important;
  color: var(--ink) !important;
}
/* Dark mode: CC injects its own dark-on-light copy we don't control.
   Force every piece of its text (labels, the consent/GDPR fine print,
   footer) to a readable light tone. Scoped to .modal-cc-mount so nothing
   else on the site is affected. */
[data-theme="dark"] .modal-cc-mount,
[data-theme="dark"] .modal-cc-mount p,
[data-theme="dark"] .modal-cc-mount span,
[data-theme="dark"] .modal-cc-mount div,
[data-theme="dark"] .modal-cc-mount li,
[data-theme="dark"] .modal-cc-mount label,
[data-theme="dark"] .modal-cc-mount .ctct-form-text,
[data-theme="dark"] .modal-cc-mount .ctct-form-label { color: var(--ink-soft) !important; }
[data-theme="dark"] .modal-cc-mount a { color: var(--ink) !important; text-decoration: underline; }
/* …but keep the submit button's label dark on its light fill. Placed
   after the broad rule so it wins for the button subtree. */
[data-theme="dark"] .modal-cc-mount button,
[data-theme="dark"] .modal-cc-mount button *,
[data-theme="dark"] .modal-cc-mount .ctct-form-button,
[data-theme="dark"] .modal-cc-mount .ctct-form-button * { color: #1e1e1e !important; }

/* The floating reCAPTCHA badge sits over the modal / Close button. Google
   permits hiding it provided the reCAPTCHA disclosure is shown in the form
   flow — that text is added to the modal as .cc-recaptcha-note. */
.grecaptcha-badge { visibility: hidden !important; }
.cc-recaptcha-note {
  margin: 12px 0 0;
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-dim);
  text-align: center;
}
.cc-recaptcha-note a { color: var(--ink-dim); text-decoration: underline; }
.cc-recaptcha-note a:hover { color: var(--accent); }

/* ---- Wide preview modal (admin Preview button) ---- */
.modal-overlay-preview { padding: 36px; }
.modal-card-preview {
  max-width: 820px;
  width: 100%;
  max-height: calc(100vh - 72px);
  padding: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.preview-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--rule);
  background: #fff;
}
.preview-eyebrow {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.preview-scroll {
  overflow-y: auto;
  padding: 24px 32px 32px;
  background: var(--bg);
}
.preview-scroll .post-page {
  padding: 0;
  margin: 0;
  max-width: none;
}
.preview-cover {
  margin: 0 0 24px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.preview-cover img { width: 100%; display: block; }
@media (max-width: 640px) {
  .modal-overlay-preview { padding: 12px; }
  .preview-scroll { padding: 18px 18px 24px; }
}

/* ============= THEME TOGGLE ============= */
.theme-toggle {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-dim);
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.theme-toggle:hover { color: var(--ink); background: rgba(0,0,0,0.04); }
.theme-icon { width: 18px; height: 18px; display: block; }
.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-toggle:hover { background: rgba(255,255,255,0.06); }

/* ============= DARK MODE ============= */
[data-theme="dark"] {
  --bg: #1e1e1e;
  --card-bg: #2a2a2d;
  --rule: #383a3e;
  --ink: #ececef;
  --ink-soft: #c5c7cc;
  --ink-dim: #8a8e95;
  --ink-faint: #5d6068;
  --accent: #ffffff;
  --accent-dark: #d1d4d8;
}

/* Logo swap: black-on-white wordmark in light mode, white-on-black
   in dark mode. Two separate assets (cleaner than filter: invert
   which can leave the bg slightly off from the page surface). */
.banner-logo .banner-img-dark { display: none; }
[data-theme="dark"] .banner-logo .banner-img-light { display: none; }
[data-theme="dark"] .banner-logo .banner-img-dark { display: block; }

/* Hardcoded backgrounds that need to switch with the theme */
[data-theme="dark"] .top-bar { background: var(--card-bg); }
[data-theme="dark"] .search-form { background: var(--card-bg); }
[data-theme="dark"] .search-form input[type="text"] { color: var(--ink); }
[data-theme="dark"] .blog-content { background: var(--bg); }
[data-theme="dark"] .blog-wrapper { background: var(--bg); }
[data-theme="dark"] .newsletter-promo-card { background: var(--card-bg); }
[data-theme="dark"] .post-card { background: var(--card-bg); }
[data-theme="dark"] .pagination button { background: var(--card-bg); }
[data-theme="dark"] .newsletter-form input { background: var(--card-bg); color: var(--ink); }
[data-theme="dark"] .modal-card { background: var(--card-bg); }
[data-theme="dark"] .modal-input { background: var(--bg); color: var(--ink); }
[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, 0.65); }
[data-theme="dark"] .site-foot { background: var(--card-bg); border-top-color: var(--rule); }

/* Admin-specific dark mode overrides */
[data-theme="dark"] .admin-card { background: var(--card-bg); }
[data-theme="dark"] .admin-input,
[data-theme="dark"] .admin-textarea,
[data-theme="dark"] .admin-select { background: var(--bg); color: var(--ink); }
[data-theme="dark"] .editor-body { background: var(--bg); color: var(--ink); }
[data-theme="dark"] .editor-toolbar { background: var(--card-bg); }
[data-theme="dark"] .editor-toolbar button { color: var(--ink-soft); }
[data-theme="dark"] .editor-toolbar button:hover { background: var(--bg); color: var(--ink); border-color: var(--rule); }
[data-theme="dark"] .editor-toolbar .editor-size { color: var(--ink-soft); background: transparent; }
[data-theme="dark"] .editor-toolbar .editor-size:hover { background: var(--bg); color: var(--ink); border-color: var(--rule); }
[data-theme="dark"] .editor-toolbar .editor-size option { background: var(--card-bg); color: var(--ink); }
[data-theme="dark"] .login-card { background: var(--card-bg); }
[data-theme="dark"] .btn { color: #1e1e1e; }
[data-theme="dark"] .btn:hover { color: #1e1e1e; }
[data-theme="dark"] .btn.btn-secondary { background: var(--card-bg); color: var(--ink); border-color: var(--rule); }
[data-theme="dark"] .btn.btn-secondary:hover { background: var(--card-bg); color: var(--ink); border-color: var(--ink-dim); }
[data-theme="dark"] .btn.btn-danger { color: #1e1e1e; }
[data-theme="dark"] .btn.btn-danger:hover { color: #1e1e1e; }
[data-theme="dark"] .admin-badge { background: rgba(255,255,255,0.08); color: var(--ink); }
[data-theme="dark"] .admin-status.ok { color: #6ee79a; }
[data-theme="dark"] .admin-toolbar { background: var(--bg); }
[data-theme="dark"] .cover-preview { background: var(--card-bg); }

/* Inverted-color buttons (dark text on light bg in dark mode) */
[data-theme="dark"] .listen-button { color: #1e1e1e !important; }
[data-theme="dark"] .listen-button:hover { color: #1e1e1e !important; }
[data-theme="dark"] .modal-btn-primary { color: #1e1e1e; }
[data-theme="dark"] .modal-btn-primary:hover { color: #1e1e1e; }
[data-theme="dark"] .modal-btn-danger { color: #1e1e1e; }
[data-theme="dark"] .modal-btn-danger:hover { color: #1e1e1e; }
[data-theme="dark"] .newsletter-promo-card .promo-cta { color: #1e1e1e; }
[data-theme="dark"] .newsletter-promo-card .promo-cta:hover { color: #1e1e1e; }
[data-theme="dark"] .newsletter-form button { color: #1e1e1e; }
[data-theme="dark"] .pagination .page.current {
  color: #1e1e1e;
  box-shadow: 0 2px 12px rgba(255, 255, 255, 0.18);
}
[data-theme="dark"] .post-card .read-more-button { color: #1e1e1e; }
[data-theme="dark"] .btn { color: #1e1e1e; }
[data-theme="dark"] .btn:hover { color: #1e1e1e; }

/* Misc fixes */
[data-theme="dark"] .post-card-image.placeholder { background: var(--bg); }
[data-theme="dark"] .modal-status.ok { color: #6ee79a; }
