/* ============================================================
   DataDinosaur — main.css
   Dark theme: emerald primary, amber accent
   ============================================================ */

:root {
  --bg:          #0f1117;
  --surface:     #1a1d27;
  --surface2:    #22263a;
  --border:      #2e3247;
  --primary:     #10b981;
  --primary-dk:  #059669;
  --accent:      #f59e0b;
  --text:        #e2e8f0;
  --text-muted:  #8892a4;
  --heading:     #f0f4ff;
  --danger:      #ef4444;
  --success:     #22c55e;
  --radius:      8px;
  --radius-lg:   14px;
  --max-width:   1140px;
  --shadow:      0 2px 12px rgba(0,0,0,.45);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent); }

h1,h2,h3,h4,h5 {
  color: var(--heading);
  line-height: 1.25;
  font-weight: 700;
}

/* ---- Layout ---- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }
.site-main  { flex: 1; }
.text-center { text-align: center; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.3rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-size: .95rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: background .18s, color .18s, border-color .18s;
}
.btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.btn-primary:hover { background: var(--primary-dk); border-color: var(--primary-dk); color: #fff; text-decoration: none; }
.btn-outline  { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); text-decoration: none; }
.btn-ghost    { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover  { border-color: var(--text); color: var(--text); text-decoration: none; }
.btn-danger   { background: var(--danger); color: #fff; border-color: var(--danger); text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.btn-sm       { padding: .3rem .75rem; font-size: .82rem; }
.btn-lg       { padding: .75rem 2rem; font-size: 1.05rem; }
.btn-full     { width: 100%; justify-content: center; }
.btn-label    { font-size: .7rem; font-weight: 400; opacity: .7; margin-left: .15rem; }
.btn-sm       { display: inline-flex; align-items:center; padding: .25rem .6rem; font-size: .78rem;
                background: var(--surface2); color: var(--text-muted); border-radius:4px;
                text-decoration:none; border: 1px solid var(--border); }
.btn-sm:hover { background: var(--surface); color: var(--text); text-decoration:none; }

/* ---- Site Header ---- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,.4);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 1rem;
}
.site-logo {
  display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
  text-decoration: none;
}
.site-logo img { height: 36px; width: auto; }
.site-logo:hover { text-decoration: none; }
.site-tagline {
  font-size: .65rem; font-weight: 400; color: #d8e2f4;
  letter-spacing: .04em;
}
.site-nav {
  display: flex; align-items: center; gap: .15rem;
}
.nav-link {
  padding: .4rem .75rem;
  color: var(--text-muted);
  border-radius: var(--radius);
  font-size: .9rem; font-weight: 500;
  transition: color .15s, background .15s;
  text-decoration: none;
}
.nav-link:hover, .nav-link.active { color: var(--heading); background: var(--surface2); text-decoration: none; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.nav-link.active { color: var(--primary); text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.admin-link  { color: var(--accent) !important; }
.nav-link-muted { font-size: .82rem; }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: .3rem;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text-muted); border-radius: 2px; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--surface) 0%, #12162a 100%);
  border-bottom: 1px solid var(--border);
  padding: 5rem 0 4rem;
}
.hero .container {
  display: flex; align-items: center; gap: 3rem; justify-content: space-between;
}
.hero-content { flex: 1; max-width: 600px; }
.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  margin-bottom: 1.2rem;
  background: linear-gradient(to right, #f0f4ff 0%, #f0f4ff 40%, #fbbf60 50%, #f0f4ff 60%, #f0f4ff 100%);
  background-size: 400% 100%;
  background-position: 100% center;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: hero-title-sweep 6s linear infinite;
}
@keyframes hero-title-sweep {
  0%   { background-position: 100% center; }
  50%  { background-position: 100% center; }
  100% { background-position: 0% center; }
}
.hero-sub {
  color: var(--text-muted); font-size: 1.1rem; margin-bottom: 2rem; max-width: 520px;
}
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero-social { display: flex; gap: .65rem; flex-wrap: wrap; margin-top: 1.25rem; }
.hero-logo { flex-shrink: 0; opacity: .92; }

/* ---- Hero animation wrap ---- */
.hero-dino-wrap {
  position: relative;
  width: clamp(280px, 36vw, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  /* overflow must stay visible so the rotating dino isn't clipped */
  overflow: visible;
  padding: .5rem .5rem .6rem;
}

/* chomp-bit canvases — back sits behind the dino/letters, front in front, so
   bits fly out with depth on either side of the chomp. */
#hero-chomp-back,
#hero-chomp-front {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#hero-chomp-back  { z-index: 1; }

.hero-dino-svg {
  position: relative;
  z-index: 2;
  width: 100%;
  height: auto;
  overflow: visible;   /* allow dino group to rotate outside viewBox bounds */
  filter: drop-shadow(0 4px 22px rgba(57,181,74,.3));
}

#hero-chomp-front { z-index: 3; }

/* When the dino head bumps the "t" and last "a" they hold a pushed squish, then
   pulse with each of the 3 chomps, then release. Anchored at each glyph's own
   bottom-centre (fill-box) so they press down / lean rather than drift. The
   keyframe values + timing now live in hero-chomp-bits.js, which drives the
   transform off the SVG's SMIL clock (same clock as the jaw) so they can't drift
   out of sync when the tab is backgrounded. */
.dd-t, .dd-a { transform-box: fill-box; transform-origin: 50% 100%; }

.hero-tagline-anim {
  position: relative;
  z-index: 1;
  opacity: 0;
  font-family: monospace;
  font-size: .72rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #f59e0b;
  margin-top: .35rem;
  text-align: center;
  transition: opacity 1.8s ease;
}
.hero-tagline-anim.visible { opacity: 0.9; }

/* ---- Value props ---- */
.value-props { padding: 4rem 0; }
.props-grid  {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem;
}
.prop-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  transition: border-color .2s, transform .2s;
}
.prop-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.prop-icon { font-size: 2rem; margin-bottom: .75rem; }
.prop-card h3 { margin-bottom: .5rem; font-size: 1.1rem; }
.prop-card p  { color: var(--text-muted); font-size: .92rem; }

/* ---- Section header ---- */
.section-header {
  display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 2rem;
}
.section-header h2 { font-size: 1.5rem; }
.section-link { font-size: .9rem; color: var(--primary); }

/* ---- Post grid (home) ---- */
.recent-posts { padding: 4rem 0; background: var(--surface); border-top: 1px solid var(--border); }
.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.post-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  transition: border-color .2s; overflow: hidden;
}
.post-card:hover { border-color: var(--primary); }
.post-card-body { padding: 1.5rem; flex: 1; }
.post-card-title { font-size: 1.05rem; margin-bottom: .6rem; }
.post-card-title a { color: var(--heading); }
.post-card-title a:hover { color: var(--primary); text-decoration: none; }
.post-card-excerpt { color: var(--text-muted); font-size: .88rem; line-height: 1.55; }
.post-card-footer {
  padding: .85rem 1.5rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.post-meta-date { font-size: .78rem; color: var(--text-muted); }
.post-read-more  { font-size: .82rem; font-weight: 600; color: var(--primary); }

/* ---- CTA banner ---- */
.cta-banner {
  padding: 4rem 0; text-align: center;
  border-top: 1px solid var(--border);
}
.cta-banner h2 { font-size: 1.8rem; margin-bottom: .75rem; }
.cta-banner p  { color: var(--text-muted); max-width: 520px; margin: 0 auto 2rem; }

/* ---- Blog layout ---- */
.blog-layout.has-sidebar {
  display: grid; grid-template-columns: 1fr 280px; gap: 3rem; padding: 3rem 1.25rem; max-width: var(--max-width); margin: 0 auto;
}
.blog-layout:not(.has-sidebar) { padding: 3rem 1.25rem; max-width: 800px; margin: 0 auto; }
.blog-main { min-width: 0; }
.page-heading { font-size: 2rem; margin-bottom: 1.5rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.filter-notice { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
                 padding: .5rem 1rem; margin-bottom: 1.5rem; font-size: .88rem; }
.filter-notice a { color: var(--text-muted); }
.empty-state { text-align: center; color: var(--text-muted); padding: 3rem; }

/* ---- Post list rows ---- */
.post-list { display: flex; flex-direction: column; gap: 0; }
.post-row {
  padding: 1.75rem 0; border-bottom: 1px solid var(--border);
}
.post-row--pinned { border-left: 3px solid var(--primary); padding-left: 1rem; }
.pinned-badge { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--primary); margin-bottom: .4rem; }
.post-row:last-child { border-bottom: none; }
.post-row-meta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; font-size: .78rem; color: var(--text-muted); }
.post-category { background: var(--surface2); padding: .15rem .55rem; border-radius: 20px; color: var(--primary); font-weight: 600; }
.read-time      { color: var(--text-muted); }
.post-row-title { font-size: 1.25rem; margin-bottom: .6rem; }
.post-row-title a { color: var(--heading); }
.post-row-title a:hover { color: var(--primary); text-decoration: none; }
.post-row-excerpt { color: var(--text-muted); font-size: .9rem; margin-bottom: 1rem; }
.post-row-footer { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.post-author { font-size: .78rem; color: var(--text-muted); }
.btn-admin-edit { font-size: .75rem; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: .1rem .5rem; }
.btn-admin-edit:hover { background: var(--accent); color: #000; text-decoration: none; }
.btn-admin-delete { font-size: .75rem; color: var(--danger); border: 1px solid var(--danger); border-radius: 4px; padding: .1rem .5rem; background: transparent; cursor: pointer; line-height: 1.4; }
.btn-admin-delete:hover { background: var(--danger); color: #fff; }

/* ---- Pagination ---- */
.pagination { display: flex; align-items: center; gap: 1rem; justify-content: center; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.page-indicator { font-size: .85rem; color: var(--text-muted); }

/* ---- Sidebar ---- */
.blog-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.sidebar-widget h3 { font-size: .95rem; color: var(--heading); margin-bottom: .85rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.search-form { display: flex; gap: .5rem; }
.search-form input { flex: 1; }
.search-results { margin-top: .75rem; }
.search-result-item { padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .85rem; }
.search-result-item a { color: var(--heading); }
.cat-list, .recent-list { list-style: none; display: flex; flex-direction: column; gap: .35rem; }
.cat-list li { display: flex; justify-content: space-between; font-size: .88rem; }
.cat-list a    { color: var(--text); }
.cat-count { color: var(--text-muted); font-size: .75rem; }
.recent-list a { font-size: .85rem; color: var(--text); line-height: 1.4; }
.recent-list a:hover { color: var(--primary); }
.cta-widget p { font-size: .85rem; color: var(--text-muted); margin-bottom: .85rem; }
.ad-slot { min-height: 90px; display: flex; align-items: center; justify-content: center; }

/* ---- Single post ---- */
.post-single { padding: 3rem 1.25rem; max-width: 780px; margin: 0 auto; }
.post-header { margin-bottom: 2.5rem; }
.post-meta-top { display: flex; gap: 1rem; margin-bottom: 1rem; font-size: .8rem; }
.post-title { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 1rem; }
.post-meta-row { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--text-muted); }
.post-footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---- Prose (post body) ---- */
.prose { color: var(--text); font-size: 1.025rem; line-height: 1.8; }
.prose h1,.prose h2,.prose h3,.prose h4 { color: var(--heading); margin: 2rem 0 .75rem; }
.prose h2 { font-size: 1.45rem; border-bottom: 1px solid var(--border); padding-bottom: .4rem; }
.prose h3 { font-size: 1.15rem; }
.prose p  { margin-bottom: 1.25rem; }
.prose ul,.prose ol { margin: 0 0 1.25rem 1.5rem; }
.prose li { margin-bottom: .35rem; }
.prose blockquote { border-left: 3px solid var(--primary); padding: .75rem 1.25rem; background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5rem 0; color: var(--text-muted); font-style: italic; }
.prose code { background: var(--surface2); padding: .15rem .4rem; border-radius: 4px; font-size: .88em; font-family: 'SF Mono', 'Fira Code', Consolas, monospace; color: var(--accent); }
.prose pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; overflow-x: auto; margin: 1.5rem 0; }
.prose pre code { background: none; padding: 0; color: var(--text); }
.prose strong { color: var(--heading); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ---- Comments ---- */
.comments-section { max-width: 780px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.comments-heading { font-size: 1.25rem; margin-bottom: 1.5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.comments-list { display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 2.5rem; }
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.comment-meta { display: flex; gap: 1rem; margin-bottom: .6rem; font-size: .82rem; color: var(--text-muted); }
.comment-author { color: var(--heading); font-weight: 600; }
.comment-body { font-size: .92rem; }

/* ---- Forms ---- */
label { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; font-weight: 500; color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=search],
textarea, select {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  padding: .6rem .85rem; font-size: .92rem;
  transition: border-color .15s;
  width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); }
select { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.checkbox-group { display: flex; align-items: center; gap: 1.25rem; padding-top: 1.6rem; flex-wrap: nowrap; }
.checkbox-label { display: flex; align-items: center; gap: .4rem; font-size: .9rem; cursor: pointer; }
.checkbox-label input[type=checkbox] { width: 1rem; height: 1rem; accent-color: var(--primary); cursor: pointer; }
.label-full { grid-column: 1 / -1; }
.field-note { font-weight: 400; font-size: .78rem; color: var(--text-muted); }
.comment-form { display: flex; flex-direction: column; gap: 1rem; }
.comment-form-wrap { margin-top: 2rem; }
.comment-form-wrap h3 { margin-bottom: 1rem; }
.contact-form, .post-edit-form { display: flex; flex-direction: column; gap: 1rem; }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }

/* ---- Contact page ---- */
.contact-wrap { max-width: 680px; margin: 0 auto; }
.page-content { padding: 3rem 1.25rem; }
.page-lead { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 2rem; }

/* ---- Services ---- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-bottom: 3rem; }
.service-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; transition: border-color .2s; }
.service-card:hover { border-color: var(--primary); }
.service-icon { font-size: 2rem; margin-bottom: .85rem; }
.service-card h2 { font-size: 1.1rem; margin-bottom: .5rem; }
.service-card p  { color: var(--text-muted); font-size: .9rem; }
.services-cta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2.5rem; text-align: center; }
.services-cta h2 { margin-bottom: 1.25rem; }
.how-it-works { text-align: left; max-width: 480px; margin: 0 auto 2rem; display: flex; flex-direction: column; gap: .75rem; }
.how-it-works li { color: var(--text-muted); font-size: .9rem; }

/* ---- Admin ---- */
.admin-dashboard { padding: 2rem 1.25rem 4rem; }
.admin-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.admin-header-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.admin-header-actions .btn { font-size: .82rem; padding: .35rem .75rem; }
.admin-header-actions .btn { position: relative; }
.admin-header-actions .btn-label {
  display: none;
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: #0f1117; color: #e2e8f0;
  font-size: .7rem; font-weight: 400;
  padding: .25rem .5rem; border-radius: 4px;
  border: 1px solid #2e3247;
  white-space: nowrap; pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.admin-header-actions .btn-label::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #2e3247;
}
.admin-header-actions .btn:hover .btn-label { display: block; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; text-align: center; }
.stat-card.stat-alert { border-color: var(--accent); }
.stat-num   { display: block; font-size: 2.2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: .8rem; color: var(--text-muted); }
.admin-section { margin-bottom: 2.5rem; }
.admin-section h2 { font-size: 1.15rem; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th { text-align: left; color: var(--text-muted); font-weight: 600; padding: .5rem .75rem; border-bottom: 1px solid var(--border); }
.admin-table td { padding: .65rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-pagination { display: flex; align-items: center; gap: .75rem; margin-top: 1rem; }
.pagination-info { color: var(--text-muted); font-size: .85rem; }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-published { background: rgba(16,185,129,.15); color: var(--primary); }
.badge-draft     { background: rgba(245,158,11,.15);  color: var(--accent); }
.badge-new       { background: rgba(245,158,11,.15);  color: var(--accent); }
.badge-read      { background: var(--surface2); color: var(--text-muted); }
/* Post visibility toggle */
.col-visible { width: 54px; text-align: center; }
.visibility-toggle { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.visibility-toggle input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--primary); cursor: pointer; }
.admin-table tr.post-hidden td { opacity: .45; }
.admin-table tr.post-hidden td:nth-child(3) { opacity: 1; } /* keep checkbox readable */
/* Post pin toggle */
.col-pinned { width: 54px; text-align: center; }
.pin-toggle { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.pin-toggle input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--accent); cursor: pointer; }
.admin-edit { padding: 2rem 1.25rem 4rem; max-width: 900px; }
.admin-edit-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.editor-wrap { display: flex; flex-direction: column; gap: 0; }
.editor-tabs { display: flex; gap: 0; margin-bottom: -1px; }
.editor-tab { padding: .45rem 1rem; background: var(--surface2); border: 1px solid var(--border); border-bottom: none; cursor: pointer; font-size: .85rem; color: var(--text-muted); border-radius: var(--radius) var(--radius) 0 0; }
.editor-tab.active { background: var(--surface); color: var(--heading); border-bottom: 1px solid var(--surface); }
.editor-img-btn { margin-left: auto; padding: .45rem .9rem; background: var(--surface2); border: 1px solid var(--border); border-bottom: none; cursor: pointer; font-size: .85rem; color: var(--text-muted); border-radius: var(--radius) var(--radius) 0 0; }
.editor-img-btn:hover { color: var(--heading); }
.editor-img-hint { align-self: center; padding: 0 .75rem; font-size: .75rem; color: var(--text-muted); }
.md-editor.drag-over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.md-editor { border-radius: 0 var(--radius) var(--radius) var(--radius); font-family: 'SF Mono', Consolas, monospace; font-size: .9rem; resize: vertical; }
.md-preview { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; min-height: 300px; }

/* ---- Inline post images (figure + caption + alignment) ---- */
.post-image { margin: 1.75rem 0; text-align: center; }
.post-image img { max-width: 100%; height: auto; border-radius: var(--radius); }
.post-image figcaption { margin-top: .5rem; font-size: .82rem; color: var(--text-muted); font-style: italic; }
.post-image-center { text-align: center; }
.post-image-left  { float: left;  margin: .5rem 1.5rem 1rem 0; max-width: 50%; }
.post-image-right { float: right; margin: .5rem 0 1rem 1.5rem; max-width: 50%; }
@media (max-width: 600px) {
  .post-image-left, .post-image-right { float: none; max-width: 100%; margin: 1.75rem 0; }
}

/* ---- Blog slideshow (:::slideshow … ::: in a post) ---- */
.dd-slideshow {
  position: relative; margin: 1.75rem 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  outline: none;
}
.dd-slideshow:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
.dd-slides { position: relative; }
.dd-slide { display: none; margin: 0; text-align: center; }
.dd-slide.active { display: block; }
.dd-slide img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; background: #0b0d14; }
.dd-slide figcaption {
  padding: .6rem .9rem; font-size: .82rem; color: var(--text-muted);
  font-style: italic; text-align: center;
}
.dd-slide-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(15,17,23,.55); color: #fff; border: none;
  font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; z-index: 2;
}
.dd-slide-nav:hover { background: rgba(15,17,23,.85); }
.dd-slide-prev { left: 10px; }
.dd-slide-next { right: 10px; }
.dd-slide-dots {
  position: absolute; left: 0; right: 0; bottom: 8px;
  display: flex; justify-content: center; gap: 7px; z-index: 2;
}
.dd-slide-dot {
  width: 8px; height: 8px; border-radius: 50%; padding: 0;
  border: none; background: rgba(255,255,255,.4); cursor: pointer;
  transition: background .15s, transform .15s;
}
.dd-slide-dot.active { background: #fff; transform: scale(1.25); }
.dd-slide-count {
  position: absolute; top: 8px; right: 10px; z-index: 2;
  background: rgba(15,17,23,.55); color: #fff;
  font-size: 11px; padding: 2px 7px; border-radius: 10px;
}
/* ---- Quiz (:::quiz blocks) ---- */
.dd-quiz {
  margin: 1.75rem 0; padding: 1.25rem 1.4rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.dd-quiz-head { display: flex; justify-content: flex-end; min-height: 1.2rem; }
.dd-quiz-score { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.dd-quiz.dd-quiz-complete .dd-quiz-score { color: var(--primary); }
.dd-quiz-q { margin: .25rem 0 1.4rem; }
.dd-quiz-q:last-child { margin-bottom: .25rem; }
.dd-quiz-prompt { font-weight: 600; margin: 0 0 .7rem; }
.dd-quiz-num { color: var(--text-muted); margin-right: .15rem; }
.dd-quiz-opts { display: flex; flex-direction: column; gap: .5rem; }
.dd-quiz-opt {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; text-align: left; cursor: pointer;
  padding: .65rem .85rem; font-size: .92rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); transition: border-color .15s, background .15s;
}
.dd-quiz-opt:hover:not(:disabled) { border-color: var(--primary); }
.dd-quiz-opt:disabled { cursor: default; }
.dd-quiz-mark {
  flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border); transition: border-color .15s, background .15s;
}
.dd-quiz-opt.correct {
  border-color: var(--success); background: rgba(34,197,94,.12);
}
.dd-quiz-opt.correct .dd-quiz-mark {
  border-color: var(--success); background: var(--success);
  position: relative;
}
.dd-quiz-opt.correct .dd-quiz-mark::after {
  content: '\2713'; position: absolute; inset: 0; color: #fff;
  font-size: 12px; line-height: 14px; text-align: center;
}
.dd-quiz-opt.incorrect {
  border-color: var(--danger); background: rgba(239,68,68,.12);
}
.dd-quiz-opt.incorrect .dd-quiz-mark {
  border-color: var(--danger); background: var(--danger); position: relative;
}
.dd-quiz-opt.incorrect .dd-quiz-mark::after {
  content: '\2717'; position: absolute; inset: 0; color: #fff;
  font-size: 12px; line-height: 14px; text-align: center;
}
.dd-quiz-explain {
  margin: .6rem 0 0; padding: .6rem .8rem; font-size: .85rem;
  color: var(--text-muted); background: var(--bg);
  border-left: 3px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0;
}
.dd-quiz-explain.is-correct { border-left-color: var(--success); }
.dd-quiz-explain.is-wrong   { border-left-color: var(--danger); }
.dd-quiz-feedback { margin-top: .6rem; display: flex; flex-direction: column; gap: .4rem; }
.dd-quiz-feedback .dd-quiz-explain { margin: 0; }
.dd-quiz-opt-explain {
  margin: 0; padding: .55rem .8rem; font-size: .85rem; color: var(--text-muted);
  background: var(--bg); border-left: 3px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.dd-quiz-opt-explain.is-correct { border-left-color: var(--success); }
.dd-quiz-opt-explain.is-wrong   { border-left-color: var(--danger); }
.dd-quiz-opt-explain::before { font-weight: 600; margin-right: .35rem; }
.dd-quiz-opt-explain.is-correct::before { content: '\2713'; color: var(--success); }
.dd-quiz-opt-explain.is-wrong::before   { content: '\2717'; color: var(--danger); }
.dd-quiz-results { margin-top: .5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.dd-quiz-hist-title { font-weight: 600; font-size: .95rem; margin: 0 0 .8rem; }
.dd-quiz-youscored { font-weight: 600; margin: 0 0 1rem; color: var(--primary); }
.dd-quiz-hist {
  display: flex; align-items: flex-end; gap: 5px;
  height: 140px; padding-top: 18px;
}
.dd-quiz-col {
  position: relative; flex: 1 1 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}
.dd-quiz-bar {
  width: 100%; max-width: 40px; min-height: 2px;
  background: var(--border); border-radius: 4px 4px 0 0;
  transition: height .45s ease;
}
.dd-quiz-col.you .dd-quiz-bar { background: var(--primary); }
.dd-quiz-collabel { margin-top: .35rem; font-size: .72rem; color: var(--text-muted); }
.dd-quiz-col.you .dd-quiz-collabel { color: var(--primary); font-weight: 600; }
.dd-quiz-youtag {
  position: absolute; top: 0; font-size: .68rem; font-weight: 600;
  color: var(--primary); white-space: nowrap;
}
.dd-quiz-hist-cap { margin: .55rem 0 1.1rem; font-size: .78rem; color: var(--text-muted); }
.dd-quiz-retake {
  cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--primary);
  background: transparent; border: 1px solid var(--primary);
  border-radius: var(--radius); padding: .5rem 1rem;
  transition: background .15s, color .15s;
}
.dd-quiz-retake:hover { background: var(--primary); color: #fff; }

.comment-moderation { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem; }
.comment-moderation-meta { font-size: .8rem; color: var(--text-muted); margin-bottom: .4rem; }
.comment-actions { display: flex; gap: .5rem; margin-top: .75rem; }

/* ---- Alerts ---- */
.alert { padding: .85rem 1.25rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: .9rem; }
.alert-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); color: var(--success); }
.alert-error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.3);  color: var(--danger); }

/* ---- Modal (login) ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2.5rem; width: 100%; max-width: 380px; }
.modal h2 { margin-bottom: 1.25rem; }
.login-form { display: flex; flex-direction: column; gap: .85rem; }
.error-msg { color: var(--danger); font-size: .88rem; margin-bottom: .5rem; }

/* ---- Footer ---- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.5rem;
  margin-top: auto;
}
.footer-inner {
  display: flex; flex-direction: column; align-items: center; gap: .75rem; text-align: center;
}
.footer-nav { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; justify-content: center; gap: 0; }
.footer-nav a { font-size: .85rem; color: var(--text-muted); padding: 0 .6rem; }
.footer-nav a + a { border-left: 1px solid var(--border); }
.footer-nav a:hover { color: var(--primary); }
.footer-copy { font-size: .75rem; color: var(--text-muted); text-align: center; }
.footer-social { display: flex; gap: .65rem; flex-wrap: wrap; justify-content: center; }

/* Shared social link pill — used in hero and footer */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .28rem .65rem;
  transition: color .18s, border-color .18s, background .18s;
  white-space: nowrap;
}
.social-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(16,185,129,.06);
  text-decoration: none;
}
.social-link svg { flex-shrink: 0; }

/* ---- Responsive ---- */
@media (max-width: 800px) {
  .nav-toggle { display: flex; }
  .site-nav { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 1rem; gap: .25rem; }
  .site-nav.open { display: flex; }
  .hero .container { flex-direction: column; text-align: center; padding: 3rem 1.25rem 2.5rem; }
  .hero-cta { justify-content: center; }
  .hero-social { gap: 1.1rem; margin-top: 1.75rem; justify-content: center; }
  .hero-logo { display: none; }
  .blog-layout.has-sidebar { grid-template-columns: 1fr; }
  .blog-sidebar { order: -1; }
  .form-row { grid-template-columns: 1fr; }
  .footer-copy { text-align: center; }
  .hero-title { font-size: 2rem; }
}
@media (max-width: 500px) {
  .post-grid { grid-template-columns: 1fr; }
  .props-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
}
