/* ============================================================
   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; 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); }
.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-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); }
.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-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; align-items: center; gap: .65rem;
  text-decoration: none;
}
.site-logo:hover { text-decoration: none; }
.site-name {
  font-size: 1.15rem; font-weight: 700; color: var(--heading);
  letter-spacing: -.3px;
}
.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; }
.nav-link.active { color: var(--primary); }
.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(135deg, #f0f4ff 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.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-logo { flex-shrink: 0; opacity: .92; }
.hero-dino { width: clamp(120px, 18vw, 220px); filter: drop-shadow(0 4px 20px rgba(16,185,129,.25)); }

/* ---- 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: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; }

/* ---- 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; }
.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: center; margin-bottom: 2rem; }
.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; }
.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); }
.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); }
.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; }
.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: grid; grid-template-columns: 1fr auto 1fr; align-items: start;
  gap: 2rem;
}
.footer-brand { display: flex; flex-direction: column; gap: .5rem; }
.footer-brand img { opacity: .7; }
.footer-tagline { font-size: .82rem; color: var(--text-muted); max-width: 220px; }
.footer-nav { display: flex; flex-direction: column; gap: .4rem; text-align: center; }
.footer-nav a { font-size: .85rem; color: var(--text-muted); }
.footer-nav a:hover { color: var(--primary); }
.footer-copy { font-size: .75rem; color: var(--text-muted); text-align: right; }

/* ---- 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-logo { display: none; }
  .blog-layout.has-sidebar { grid-template-columns: 1fr; }
  .blog-sidebar { order: -1; }
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-brand { align-items: center; }
  .footer-tagline { max-width: none; }
  .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; }
}
