:root {
  --ink: #172126;
  --muted: #5a676e;
  --surface: #f7faf9;
  --panel: #ffffff;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --accent: #d97706;
  --line: #d9e3e6;
  --shadow: 0 18px 40px rgba(23, 33, 38, 0.09);
  --radius-lg: 20px;
  --radius-md: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(800px 360px at 90% -10%, rgba(217, 119, 6, 0.13), transparent 60%),
    radial-gradient(700px 360px at -10% 4%, rgba(15, 118, 110, 0.13), transparent 58%),
    var(--surface);
  line-height: 1.6;
}
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: "IBM Plex Mono", Consolas, monospace; }

.wrap { width: min(1160px, 92vw); margin: 0 auto; }
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(247, 250, 249, 0.88);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav {
  min-height: 64px;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.brand { font-weight: 700; letter-spacing: 0.01em; }
.nav-links, .actions, .row-actions, .card-actions, .search-row {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  color: var(--muted);
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.65);
}
.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}
.btn:hover { background: var(--brand-strong); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: #f2f7f6; }

.hero { padding: 4rem 0 2rem; }
.hero h1, .section-heading h2, .article h1, .panel h1 {
  font-family: "Merriweather", Georgia, serif;
  line-height: 1.18;
}
.hero h1 {
  max-width: 17ch;
  margin: 0.5rem 0 0;
  font-size: clamp(2rem, 4vw, 3.35rem);
}
.hero p { color: var(--muted); max-width: 62ch; font-size: 1.08rem; }
.search-row { margin-top: 1.5rem; }

.input, .textarea-input {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  font: inherit;
  background: #fff;
}
.input.compact { width: 100%; }
.file-input { padding: 0.62rem 0.75rem; }
.textarea-input { min-height: 120px; resize: vertical; }
.textarea-input.mono { font-family: "IBM Plex Mono", Consolas, monospace; font-size: 0.9rem; }
.input:focus, .textarea-input:focus {
  border-color: rgba(15, 118, 110, 0.6);
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
  padding-bottom: 4rem;
}
.sidebar {
  position: sticky;
  top: 86px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.84);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.sidebar h2 { margin: 0 0 0.7rem; font-size: 1rem; }
.country-list, .recent-list { display: grid; gap: 0.45rem; margin-bottom: 1.2rem; }
.country-list a, .recent-list a {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: #fff;
}
.recent-list a { display: block; }
.country-list a.active { border-color: rgba(15, 118, 110, 0.45); background: #edf8f6; font-weight: 700; }
.country-list small, .recent-list small { color: var(--muted); display: block; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-heading h2 { margin: 0.35rem 0 0; font-size: 1.8rem; }
.entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.entry-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.entry-media {
  display: block;
  height: 300px;
  flex: 0 0 auto;
  overflow: hidden;
  position: relative;
  background: linear-gradient(120deg, rgba(15, 118, 110, 0.2), rgba(217, 119, 6, 0.24));
}
.entry-media:has(.pill) {
  display: grid;
  place-items: center;
}
.entry-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.entry-body {
  padding: 1rem;
  flex: 1 1 auto;
  background: #fff;
  position: relative;
  z-index: 1;
}
.meta { display: flex; gap: 0.65rem; flex-wrap: wrap; color: var(--muted); font-size: 0.88rem; }
.entry-card h3 { margin: 0.35rem 0 0.55rem; font-family: "Merriweather", Georgia, serif; line-height: 1.28; }
.entry-card p { color: #2f3b41; margin: 0; }
.card-actions { margin-top: 0.85rem; }
.muted, .hint { color: var(--muted); }
.hint { margin-top: 0.35rem; font-size: 0.9rem; }
.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.8);
  padding: 1rem;
}

.page { padding: 2.4rem 0 4.4rem; }
.article, .panel {
  width: min(820px, 94vw);
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: min(4vw, 2rem);
}
.panel.wide { width: min(980px, 94vw); }
.panel.narrow { width: min(520px, 94vw); }
.article h1, .panel h1 { margin: 0.45rem 0 0.75rem; }
.hero-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  max-height: 470px;
  border-radius: 14px;
  margin: 1.2rem 0;
}
.lede { font-size: 1.1rem; color: #2e3a40; }
.post-body img { max-width: 100%; height: auto; border-radius: 12px; }
.gallery-section, .video-section { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }
.gallery-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; }
.video-frame { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 14px; background: #111; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.article-nav { display: flex; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.5rem; }

.admin-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.form-row { margin-top: 1rem; }
label { display: block; margin-bottom: 0.35rem; font-weight: 700; }
.form-grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.checkbox-row label { display: inline-flex; align-items: center; gap: 0.45rem; }
.flash { margin-top: 0.9rem; border-radius: 10px; padding: 0.7rem 0.8rem; }
.flash.error { background: #fff1f1; color: #8f2020; border: 1px solid #f4c8c8; }
.flash.success { background: #edf9f2; color: #14532d; border: 1px solid #bddcc7; }
.flash.info { background: #eef7fc; color: #124265; border: 1px solid #bfdaf0; }
.table-wrap { margin-top: 1.2rem; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f4f8f9; color: var(--muted); text-transform: uppercase; font-size: 0.86rem; letter-spacing: 0.03em; }
.inline { display: inline; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 720px) {
  .nav { align-items: flex-start; flex-direction: column; gap: 0.7rem; padding: 0.75rem 0; }
  .entry-grid, .form-grid-two, .gallery-grid { grid-template-columns: 1fr; }
  .entry-media { height: 220px; }
  .hero { padding-top: 2.8rem; }
}
