/* ── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:     #1B5E7B;
  --primary-dk:  #134355;
  --accent:      #E07B39;
  --accent-lt:   #F5A96A;
  --bg:          #FFFFFF;
  --bg-soft:     #F7F9FA;
  --border:      #DEE4E8;
  --text:        #2C3A47;
  --text-muted:  #6B7C8D;
  --link:        #1B5E7B;
  --link-hover:  #E07B39;
  --radius:      6px;
  --max-w:       860px;
  --font:        system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--primary-dk);
  color: #fff;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.site-logo {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-decoration: none;
}

.site-logo .logo-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}

.site-logo .logo-tag {
  font-size: .72rem;
  color: rgba(255,255,255,.75);
  letter-spacing: .04em;
  font-style: italic;
}

nav { display: flex; align-items: center; gap: .25rem; }

nav a {
  color: rgba(255,255,255,.85);
  font-size: .9rem;
  font-weight: 500;
  padding: .4rem .75rem;
  border-radius: var(--radius);
  transition: background .15s, color .15s;
}

nav a:hover, nav a.active {
  background: rgba(255,255,255,.15);
  color: #fff;
  text-decoration: none;
}

.nav-cta {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 600 !important;
}

.nav-cta:hover { background: var(--accent-lt) !important; }

/* ── Hero banner ─────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%);
  color: #fff;
  padding: 4rem 1.5rem;
  text-align: center;
}

.hero h1 { font-size: 2.2rem; font-weight: 700; line-height: 1.25; margin-bottom: 1rem; }
.hero p  { font-size: 1.15rem; opacity: .9; max-width: 640px; margin: 0 auto 1.5rem; }

.btn {
  display: inline-block;
  padding: .65rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s;
}

.btn:hover { opacity: .9; transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-outline  { background: transparent; color: #fff; border: 2px solid #fff; }

/* ── Main content ────────────────────────────────────────────────────────── */
main { flex: 1; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-dk);
  margin-bottom: .5rem;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* ── Blog index ──────────────────────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--bg);
  transition: box-shadow .2s, transform .15s;
}

.post-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-2px);
}

.post-card-meta {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.post-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: .5rem;
  line-height: 1.35;
}

.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--link); text-decoration: none; }

.post-card p {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.tag-pill {
  display: inline-block;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: .72rem;
  padding: .15rem .6rem;
  color: var(--text-muted);
}

/* ── Blog post ───────────────────────────────────────────────────────────── */
.post-header { margin-bottom: 2rem; border-bottom: 2px solid var(--border); padding-bottom: 1.5rem; }
.post-header h1 { font-size: 2rem; line-height: 1.25; color: var(--primary-dk); margin-bottom: .75rem; }
.post-meta { font-size: .85rem; color: var(--text-muted); display: flex; gap: .75rem; flex-wrap: wrap; }

.post-body { font-size: 1.05rem; line-height: 1.8; }
.post-body h2, .post-body h3 { color: var(--primary-dk); margin: 1.75rem 0 .75rem; }
.post-body h2 { font-size: 1.4rem; }
.post-body h3 { font-size: 1.2rem; }
.post-body p  { margin-bottom: 1.25rem; }
.post-body ul, .post-body ol { margin: 0 0 1.25rem 1.5rem; }
.post-body li { margin-bottom: .4rem; }
.post-body blockquote {
  border-left: 4px solid var(--accent);
  padding: .75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--bg-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-style: italic;
}
.post-body code {
  background: var(--bg-soft);
  padding: .15rem .4rem;
  border-radius: 3px;
  font-size: .9em;
}
.post-body pre { background: var(--bg-soft); padding: 1rem; border-radius: var(--radius); overflow-x: auto; margin-bottom: 1.25rem; }
.post-body img { border-radius: var(--radius); margin: 1rem 0; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-nav a {
  font-size: .9rem;
  color: var(--primary);
  font-weight: 500;
}

/* ── Comments ────────────────────────────────────────────────────────────── */
.comments-section { margin-top: 3rem; }
.comments-section h2 { font-size: 1.3rem; margin-bottom: 1.5rem; color: var(--primary-dk); }

.comment {
  border-left: 3px solid var(--border);
  padding: .75rem 1rem;
  margin-bottom: 1.25rem;
  background: var(--bg-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.comment-meta { font-size: .8rem; color: var(--text-muted); margin-bottom: .4rem; }
.comment-body { font-size: .95rem; }

.comment-form { margin-top: 2rem; padding: 1.5rem; background: var(--bg-soft); border-radius: var(--radius); border: 1px solid var(--border); }
.comment-form h3 { margin-bottom: 1.25rem; font-size: 1.1rem; color: var(--primary-dk); }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: .9rem; font-weight: 500; margin-bottom: .35rem; color: var(--text); }

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: .6rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  transition: border-color .15s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,94,123,.12);
}

.form-group textarea { min-height: 130px; resize: vertical; }

.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }

.alert { padding: .85rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: .95rem; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ── Static pages ────────────────────────────────────────────────────────── */
.prose h2 { font-size: 1.4rem; color: var(--primary-dk); margin: 2rem 0 .75rem; }
.prose h3 { font-size: 1.15rem; color: var(--primary-dk); margin: 1.5rem 0 .5rem; }
.prose p  { margin-bottom: 1.1rem; }
.prose ul, .prose ol { margin: 0 0 1.1rem 1.5rem; }
.prose li { margin-bottom: .4rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card h3 { font-size: 1.05rem; color: var(--primary-dk); margin-bottom: .5rem; }
.card p  { font-size: .9rem; color: var(--text-muted); }

/* ── Admin ───────────────────────────────────────────────────────────────── */
.admin-header {
  background: var(--primary-dk);
  color: #fff;
  padding: .75rem 1.5rem;
  font-size: .85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header a { color: rgba(255,255,255,.8); }
.admin-header a:hover { color: #fff; }

.admin-nav {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: .5rem 1.5rem;
  display: flex;
  gap: .5rem;
}

.admin-nav a {
  padding: .4rem .85rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
}

.admin-nav a:hover, .admin-nav a.active {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

.badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-size: .7rem;
  padding: .1rem .5rem;
  margin-left: .25rem;
  font-weight: 600;
}

.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th {
  background: var(--bg-soft);
  border-bottom: 2px solid var(--border);
  padding: .6rem .85rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.data-table td {
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-soft); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-align: center; }
.stat-card .stat-num { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }

.action-btn {
  display: inline-block;
  padding: .3rem .75rem;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.action-btn-approve { background: #28a745; color: #fff; }
.action-btn-delete  { background: #dc3545; color: #fff; }
.action-btn-read    { background: var(--primary); color: #fff; }

form.inline { display: inline; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--primary-dk);
  color: rgba(255,255,255,.8);
  padding: 2.5rem 1.5rem 1.5rem;
  margin-top: auto;
  font-size: .875rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 { color: #fff; font-size: .95rem; margin-bottom: .75rem; }
.footer-col a  { color: rgba(255,255,255,.7); display: block; margin-bottom: .35rem; }
.footer-col a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .8rem;
  color: rgba(255,255,255,.55);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .header-inner { height: auto; padding: .75rem 0; flex-wrap: wrap; }
  nav { flex-wrap: wrap; gap: .15rem; }
  nav a { font-size: .82rem; padding: .3rem .55rem; }
  .hero h1 { font-size: 1.5rem; }
  .post-grid { grid-template-columns: 1fr; }
  .post-nav { flex-direction: column; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.25rem; }
}
