:root {
  --bg: #f1f5f3;
  --surface: #ffffff;
  --primary: #0f4d3f;
  --primary-2: #1b6a59;
  --text: #13231f;
  --muted: #4e635d;
  --danger: #b42318;
  --radius: 16px;
  --shadow: 0 8px 20px rgba(15, 77, 63, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", "Roboto", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

.container { width: min(1080px, 92%); margin: 0 auto; }
.main-content { padding: 1.2rem 0 6rem; }

.top-appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(135deg, var(--primary), #0a392f);
  color: white;
  box-shadow: var(--shadow);
}
.appbar-inner {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
}
.brand {
  color: white;
  font-weight: 800;
  font-size: 1.18rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: 0.2px;
}
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.brand:hover { text-decoration: none; opacity: 0.96; }

.top-search { display: flex; gap: 0.5rem; width: min(520px, 100%); }
.top-search input {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 0.68rem 1rem;
  background: rgba(255,255,255,0.96);
}
.top-search button {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.05rem;
  font-weight: 700;
  background: #d6f3e9;
  color: #08342a;
}

.desktop-nav {
  display: flex;
  gap: 0.65rem;
  padding: 0.8rem;
  margin-top: 0.7rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(4px);
  border: 1px solid #deebe5;
  box-shadow: 0 8px 22px rgba(15,77,63,0.08);
}
.desktop-nav a {
  border-radius: 999px;
  padding: 0.48rem 0.9rem;
  font-weight: 700;
  color: #0f4d3f;
  transition: all .2s ease;
}
.desktop-nav a:hover {
  text-decoration: none;
  background: #e5f4ee;
  transform: translateY(-1px);
}

h1 { font-size: clamp(1.4rem, 2vw, 2rem); margin: 0 0 1rem; }
h2 { margin: 0 0 0.8rem; font-size: 1.15rem; }

.card,
.post-card,
.table-wrap,
.auth-card,
.archive-sidebar {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card { padding: 1rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.post-card { overflow: hidden; }
.post-card .thumb img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.post-card .card-content { padding: 0.9rem; }
.meta { color: var(--muted); font-size: 0.9rem; margin: 0.3rem 0 0.8rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.6rem; }
.tags a {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: #e7f4ef;
  font-size: 0.82rem;
}

.single-post .single-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 0.8rem 0 1rem;
}
.single-post .content {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}
.single-post .content p { margin: 0 0 0.85rem; }
.single-post .content h2,
.single-post .content h3,
.single-post .content h4 { margin: 1rem 0 0.65rem; }
.single-post .content ul,
.single-post .content ol { padding-left: 1.4rem; margin: 0.6rem 0 1rem; }
.single-post .content blockquote {
  border-left: 4px solid #8ac9b2;
  margin: 0.8rem 0;
  padding: 0.45rem 0.8rem;
  color: #2d4940;
  background: #eef7f3;
}
.single-post .content code,
.single-post .content pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
}
.single-post .content code { padding: 0.1rem 0.4rem; }
.single-post .content pre { padding: 0.8rem; overflow-x: auto; }
.single-post .content img { max-width: 100%; height: auto; border-radius: 12px; }

.comments { margin-top: 1.2rem; }
.comment-item { margin-top: 0.8rem; }

form { display: grid; gap: 0.8rem; }
label { display: grid; gap: 0.4rem; font-weight: 600; }
input, textarea, select {
  width: 100%;
  border: 1px solid #c3d5cd;
  border-radius: 12px;
  padding: 0.68rem 0.8rem;
  font: inherit;
}
button, .btn, .btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  padding: 0.62rem 0.95rem;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover, .btn-small:hover { background: var(--primary-2); text-decoration: none; }

.btn-link { color: white; font-weight: 600; }
.btn-small { padding: 0.45rem 0.7rem; font-size: 0.86rem; }
.danger { background: var(--danger) !important; }

.pagination {
  margin: 1.2rem 0;
  display: flex;
  gap: 0.7rem;
  align-items: center;
  justify-content: center;
}
.pagination a {
  background: #dceee7;
  border-radius: 999px;
  padding: 0.42rem 0.8rem;
}

.site-footer {
  margin-top: 2rem;
  padding: 1.2rem 0 5rem;
  color: #f2f8f5;
  background: #093c31;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: linear-gradient(135deg, #0b4f40, #0a3d31);
  border-top: 1px solid rgba(255,255,255,0.18);
  z-index: 60;
}
.bottom-nav a {
  color: white;
  text-align: center;
  padding: 0.5rem 0.2rem;
  font-size: 0.74rem;
  display: grid;
  gap: 0.2rem;
  justify-items: center;
  transition: background .2s ease;
}
.bottom-nav a:hover { background: rgba(255,255,255,0.08); text-decoration: none; }

.alert { border-radius: 12px; padding: 0.7rem 0.9rem; font-weight: 600; }
.alert.error { background: #fde7e7; color: #7a1f1f; }
.alert.success { background: #e4f7ec; color: #14532d; }

.table-wrap { overflow-x: auto; padding: 0.9rem; }
table { border-collapse: collapse; width: 100%; min-width: 620px; }
th, td { border-bottom: 1px solid #e4ece9; padding: 0.62rem; text-align: left; vertical-align: top; }
.status { border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }
.status.published { background: #d8f4e7; color: #0f5132; }
.status.draft { background: #efefef; color: #555; }

.admin-body { background: #edf3f0; }
.admin-header {
  background: var(--primary);
  color: white;
  padding: 0.9rem 4%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.inline-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.stats-grid .card { text-align: center; }
.stats-grid h2 { font-size: 1.8rem; margin-bottom: 0.2rem; }
.two-col {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 1rem;
}
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.auth-card { width: min(460px, 95%); padding: 1.2rem; }
.small { font-size: 0.85rem; color: var(--muted); }
.archive-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.nav-card h2 a { color: var(--text); }
.nav-card p { margin: 0.3rem 0; }
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.tag-cloud a {
  padding: 0.46rem 0.8rem;
  border-radius: 999px;
  background: #e8f5ef;
  color: #0f4d3f;
  font-weight: 700;
}
.tag-cloud a small { font-weight: 600; opacity: 0.8; }

@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .archive-layout { grid-template-columns: 1fr; }
}

.post-media { margin-top: 1rem; }
.post-media-image,
.post-media-video { width: 100%; border-radius: 12px; display: block; }
.video-wrap { position: relative; padding-top: 56.25%; border-radius: 12px; overflow: hidden; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

.post-ad-slot {
  margin-top: 1rem;
  text-align: center;
  overflow: hidden;
}
.post-ad-slot ins { max-width: 100% !important; }

.social-comment-panel { margin-bottom: 0.9rem; }
.social-actions .social-btn.google { background: #1a73e8; }
.social-actions .social-btn.facebook { background: #1877f2; }
.social-user-badge {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.social-user-badge img,
.comment-head img {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
}
.comment-head { display: flex; gap: 0.7rem; align-items: center; margin-bottom: 0.45rem; }
.comment-head h3 { margin: 0; font-size: 1rem; }

@media (max-width: 760px) {
  .appbar-inner { flex-direction: column; align-items: stretch; }
  .two-col { grid-template-columns: 1fr; }
}
