@import url("https://fonts.googleapis.com/css2?family=Exo+2:ital,wght@1,800&family=Source+Serif+4:wght@600;700&display=swap");

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-alt: #eef2f7;
  --text: #12233a;
  --muted: #5d6b82;
  --accent: #d32f2f;
  --line: #dbe2ec;
  --shadow: 0 10px 30px rgba(18, 35, 58, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  background: radial-gradient(circle at top left, #e8eff8 0%, var(--bg) 45%);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

body.night-mode {
  --bg: #07111f;
  --surface: #0d1b2f;
  --surface-alt: #132743;
  --text: #e4edf9;
  --muted: #9db0cb;
  --line: #1f3557;
  --shadow: 0 10px 30px rgba(2, 8, 18, 0.45);
  background: radial-gradient(circle at top left, #0f2543 0%, var(--bg) 50%);
}

body.night-mode .site-header {
  background: linear-gradient(120deg, #040c17, #0c223e);
}

body.night-mode .site-footer {
  background: #040c17;
}

body.night-mode .kigali-clock {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

body.night-mode .ad-slot {
  border-color: #446188;
  background: #102541;
}

body.night-mode .category-btn:hover {
  border-color: #3d6ba3;
  background: #0d3a70;
  color: #f4f8ff;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.45;
}

body::before {
  width: 360px;
  height: 360px;
  background:
    radial-gradient(circle at 40% 40%, rgba(8, 26, 47, 0.12), rgba(8, 26, 47, 0.46) 72%, transparent 80%),
    url("/logo.jpeg") center / cover no-repeat;
  filter: blur(5px) saturate(0.82);
  opacity: 0.38;
  top: -90px;
  left: -110px;
  animation: driftA 14s ease-in-out infinite alternate;
}

body::after {
  width: 420px;
  height: 420px;
  background:
    radial-gradient(circle at 55% 55%, rgba(8, 26, 47, 0.14), rgba(8, 26, 47, 0.5) 72%, transparent 80%),
    url("/logo.jpeg") center / cover no-repeat;
  filter: blur(5px) saturate(0.85);
  opacity: 0.4;
  bottom: -140px;
  right: -120px;
  animation: driftB 18s ease-in-out infinite alternate;
}

@keyframes driftA {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(35px, 24px, 0) scale(1.08); }
}

@keyframes driftB {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-30px, -26px, 0) scale(1.06); }
}

.container {
  width: min(1200px, 94%);
  margin: 0 auto;
}

.site-header {
  background: linear-gradient(120deg, #081a2f, #12355c);
  color: #fff;
  border-bottom: 4px solid var(--accent);
}

.motto-banner {
  position: sticky;
  top: 6px;
  z-index: 90;
  padding: 0.45rem 0;
}

.motto-banner .container {
  width: min(760px, 92%);
  min-height: 56px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 999px;
  border: 1px solid #64d5c9;
  background: linear-gradient(95deg, #ddfbf4 0%, #a9ece2 48%, #77d8ca 100%);
  box-shadow: 0 10px 24px rgba(18, 35, 58, 0.2);
}

.motto-banner .container::before,
.motto-banner .container::after {
  content: "";
  position: absolute;
  inset: -35%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.92) 0 2px, transparent 3px) 14% 38% / 120px 120px,
    radial-gradient(circle, rgba(165, 246, 232, 0.84) 0 2px, transparent 3px) 72% 44% / 130px 130px,
    radial-gradient(circle, rgba(70, 196, 178, 0.88) 0 2px, transparent 3px) 46% 66% / 110px 110px,
    radial-gradient(circle, rgba(250, 236, 183, 0.72) 0 2px, transparent 3px) 84% 22% / 140px 140px;
  animation: fireworksDrift 10s linear infinite;
  opacity: 0.7;
}

.motto-banner .container::after {
  animation-direction: reverse;
  animation-duration: 13s;
  filter: blur(1px);
  opacity: 0.45;
}

.motto-banner p {
  margin: 0;
  font-size: clamp(0.66rem, 2.3vw, 0.92rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f5f67;
  animation: mottoGlow 2.8s ease-in-out infinite;
  position: relative;
  z-index: 1;
  text-align: center;
  white-space: nowrap;
  padding: 0 0.8rem;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

body.night-mode .motto-banner {
  background: transparent;
}

body.night-mode .motto-banner .container {
  border-color: #2c8f96;
  background: linear-gradient(95deg, #0c2930 0%, #11404a 48%, #17606b 100%);
  box-shadow: 0 10px 24px rgba(1, 4, 10, 0.45);
}

body.night-mode .motto-banner p {
  color: #b6f0e8;
  text-shadow: none;
}

@keyframes mottoGlow {
  0%,
  100% { opacity: 1; }
  50% { opacity: 0.78; }
}

@keyframes fireworksDrift {
  0% { transform: translate3d(-4%, 0, 0) scale(1); }
  50% { transform: translate3d(5%, -3%, 0) scale(1.03); }
  100% { transform: translate3d(-4%, 0, 0) scale(1); }
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
}

.header-tools {
  display: grid;
  gap: 0.55rem;
  width: min(460px, 100%);
}

.quick-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.quick-link {
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  background: transparent;
}

.quick-link-btn {
  cursor: pointer;
}

.kigali-clock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.clock-label {
  color: #d6e4f9;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kigali-clock strong {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.timezone-select {
  min-width: 140px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(7, 22, 39, 0.45);
  color: #fff;
  font-size: 0.82rem;
  padding: 0.28rem 0.4rem;
}

.language-switch {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  color: #d6e4f9;
  font-size: 0.82rem;
}

.language-switch label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.lang-select {
  min-width: 130px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(7, 22, 39, 0.45);
  color: #fff;
  font-size: 0.82rem;
  padding: 0.28rem 0.4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.header-brand-block {
  display: grid;
  gap: 0.5rem;
}

.brand-badge {
  width: 92px;
  height: 92px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: transparent;
  border: 0;
  overflow: hidden;
  box-shadow: none;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.16);
  transform-origin: center;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3.8vw, 3rem);
  line-height: 1;
  font-family: "Source Serif 4", "Times New Roman", serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}

.brand-k29 {
  font-family: "Exo 2", "Segoe UI", sans-serif;
  font-size: 1.62em;
  font-style: italic;
  font-weight: 800;
  color: #6ee7ff;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1;
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
  vertical-align: baseline;
  display: inline-block;
  transform: skewX(-7deg);
}

.brand-k29-nine {
  display: inline;
}

.brand-ent {
  font-weight: 400;
  font-size: 0.78em;
  letter-spacing: 0.035em;
  opacity: 0.95;
}

.brand p {
  margin: 0.1rem 0 0;
  color: #d9e3f2;
  font-size: 0.96rem;
  line-height: 1.1;
}

.brand-social-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.48rem;
  padding-left: 2px;
}

.brand-social-link {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.95);
}

.live-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(7, 22, 39, 0.42);
  color: #fff;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  font-weight: 800;
  padding: 0.35rem 0.62rem;
  cursor: pointer;
}

.live-audio-btn.active {
  background: rgba(176, 0, 32, 0.78);
  border-color: rgba(255, 203, 212, 0.95);
}

.live-audio-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff2b2b;
  box-shadow: 0 0 0 0 rgba(255, 43, 43, 0.7);
  animation: pulseLive 1.25s infinite;
}

@keyframes pulseLive {
  0% { box-shadow: 0 0 0 0 rgba(255, 43, 43, 0.7); }
  70% { box-shadow: 0 0 0 7px rgba(255, 43, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 43, 43, 0); }
}

.live-audio-host {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.live-audio-frame {
  width: 1px;
  height: 1px;
  border: 0;
}

.search-box {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.search-box input,
.search-box button {
  border: 0;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
}

.search-box input {
  flex: 1;
}

.search-box button {
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.main-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 1rem;
  padding: 1rem 0 2rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.sidebar {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.category-nav {
  display: grid;
  gap: 0.5rem;
}

.category-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.category-panel-head h2 {
  margin: 0;
}

.category-toggle {
  display: none;
  border: 1px solid #7bc8be;
  background: #e5fbf6;
  color: #0f5f67;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.category-btn {
  display: block;
  text-transform: capitalize;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--text);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.category-btn:hover {
  border-color: #1556a6;
  background: #0f4d99;
  color: #f4f8ff;
}

.read-link {
  display: inline-block;
  margin-top: 0.7rem;
  text-decoration: none;
  font-weight: 700;
  color: var(--accent);
}

.ad-slot {
  display: grid;
  place-items: center;
  text-align: center;
  border: 2px dashed #b3c2d8;
  background: #f6f9ff;
  min-height: 140px;
}

.ad-slot p {
  margin: 0;
  font-weight: 700;
}

.ad-slot small {
  color: var(--muted);
}

.social-panel h2,
.sidebar h2 {
  margin-top: 0;
}

.social-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.social-link {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  padding: 0;
  color: #1f2f45;
  background: transparent;
  border: 1px solid rgba(95, 117, 149, 0.35);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(18, 35, 58, 0.18);
}

.social-link svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.youtube { color: #ff0000; }
.instagram { color: #e1306c; }
.x { color: #111; }
.facebook { color: #1877f2; }
.whatsapp { color: #25d366; }

.social-link.x {
  background: #e8eef8;
  border-color: #9ab0cf;
}

body.night-mode .social-link {
  border-color: rgba(152, 181, 220, 0.42);
}

body.night-mode .social-link.x {
  background: #d6e4fa;
  border-color: #8ca9d6;
  color: #0a1220;
}

body.night-mode .popular-item {
  border-color: #2b4570;
  background: #112642;
}

body.night-mode .popular-item:hover {
  border-color: #4b79b3;
  background: #16355a;
}

body.night-mode .popular-badge {
  background: #12345a;
  border-color: #2f6099;
  color: #b9d8ff;
}

.popular-panel {
  display: grid;
  gap: 0.65rem;
}

.popular-list {
  display: grid;
  gap: 0.5rem;
}

.popular-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.55rem;
  align-items: center;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.62rem;
  background: var(--surface-alt);
  color: var(--text);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.popular-item:hover {
  border-color: #1556a6;
  background: #edf4ff;
  transform: translateY(-1px);
}

.popular-thumb {
  width: 64px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.popular-item-body {
  display: grid;
  gap: 0.2rem;
}

.popular-item span,
.popular-empty {
  color: var(--muted);
  font-size: 0.84rem;
}

.content {
  display: grid;
  gap: 1rem;
}

.top-ad {
  min-height: 110px;
}

.ad-image {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 10px;
}

.ad-image-inline {
  object-fit: contain;
  max-height: 220px;
}

.ad-image-sidebar {
  object-fit: contain;
  max-height: 220px;
}

.featured {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1rem;
  overflow: hidden;
  padding: 0;
}

.featured img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 260px;
}

.featured-body {
  padding: 1rem;
}

.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.featured h2 {
  margin-top: 0.4rem;
  margin-bottom: 0.6rem;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.18em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.featured h2 a,
.card h3 a {
  color: inherit;
  text-decoration: none;
}

.featured:hover h2 {
  color: #0f4d99;
  text-decoration-color: currentColor;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  overflow: hidden;
  padding: 0;
}

.card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.card-body {
  padding: 0.9rem 1rem 1rem;
}

.card h3 {
  margin: 0.5rem 0;
  font-size: 1.05rem;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.16em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.card:hover h3 {
  color: #0f4d99;
  text-decoration-color: currentColor;
}

body.night-mode .featured:hover h2,
body.night-mode .card:hover h3 {
  color: #7fb7ff;
}

.card p {
  color: var(--muted);
  margin-bottom: 0;
}

.list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.list-header h2 {
  margin: 0;
}

#resultsMeta {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  position: relative;
  overflow: hidden;
  background: #081a2f;
  color: #dce7f7;
  border-top: 4px solid var(--accent);
}

.site-footer::after {
  content: "";
  position: absolute;
  right: 18%;
  top: 50%;
  transform: translateY(-50%);
  width: 360px;
  height: 220px;
  background:
    linear-gradient(90deg, rgba(8, 26, 47, 0.88) 0%, rgba(8, 26, 47, 0.58) 26%, rgba(8, 26, 47, 0.25) 55%, rgba(8, 26, 47, 0.15) 100%),
    url("/logo.jpeg") right center / contain no-repeat;
  filter: blur(5px) saturate(0.68) brightness(0.76);
  opacity: 0.36;
  pointer-events: none;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  font-size: 0.92rem;
}

.footer-stack {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
  padding: 1.1rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}

.footer-col {
  display: grid;
  gap: 0.5rem;
}

.footer-title {
  margin: 0;
  color: #ffffff;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 1.08rem;
}

.footer-col p {
  margin: 0;
  color: #c2d2e8;
  line-height: 1.45;
}

.footer-col a {
  color: #f7fbff;
  text-decoration: none;
}

.footer-col a:hover {
  text-decoration: underline;
}

.footer-list {
  margin: 0;
  padding-left: 1.05rem;
  color: #c2d2e8;
  display: grid;
  gap: 0.35rem;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(188, 208, 234, 0.28);
  padding-top: 0.75rem;
}

.footer-copy,
.footer-tagline {
  margin: 0;
  color: #dce7f7;
  font-size: 0.9rem;
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(5, 18, 34, 0.35);
  opacity: 0;
  transform: translateY(14px) scale(0.92);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 110;
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.back-to-top:hover {
  filter: brightness(1.08);
}

body.night-mode .back-to-top {
  background: #f08a3f;
  color: #111;
}

body.night-mode .site-footer::after {
  opacity: 0.32;
  filter: blur(5px) saturate(0.6) brightness(0.72);
}

.single-column {
  grid-template-columns: 1fr;
  padding: 1rem 0 2rem;
}

.story-layout {
  padding: 1rem 0 2rem;
}

.story h1 {
  margin: 0.25rem 0 0.75rem;
}

.story-image {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: 10px;
  margin: 0.7rem 0 1rem;
}

.story-video {
  width: 100%;
  min-height: 300px;
  border: 0;
  border-radius: 10px;
  margin: 0.2rem 0 1rem;
}

.story-summary {
  font-weight: 600;
}

.story-content {
  line-height: 1.7;
}

.story-content p {
  margin: 0 0 1rem;
}

.story-inline-image {
  width: 100%;
  max-height: 430px;
  object-fit: cover;
  border-radius: 10px;
  margin: 0.35rem 0 1rem;
}

.admin-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.1fr 1fr;
  padding: 1rem 0 2rem;
}

.login-layout {
  display: grid;
  place-items: center;
  padding: 2rem 0;
}

.login-panel {
  width: min(460px, 100%);
}

.login-error {
  color: #b00020;
  min-height: 1.2rem;
}

.admin-form {
  display: grid;
  gap: 0.65rem;
}

.admin-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.admin-form input:not([type="checkbox"]),
.admin-form select,
.admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  font: inherit;
}

.checkbox-field {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.popular-badge {
  display: inline-block;
  margin-left: 0.45rem;
  border-radius: 999px;
  padding: 0.12rem 0.46rem;
  background: #e0edff;
  border: 1px solid #a2c2ef;
  color: #0f4d99;
  font-size: 0.74rem;
  font-weight: 800;
  vertical-align: middle;
}

.status-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.46rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.status-pending {
  background: #fff4d6;
  color: #8f5a00;
  border: 1px solid #efca82;
}

.status-published {
  background: #dff7e8;
  color: #0a6c3b;
  border: 1px solid #8cd4ab;
}

.status-rejected {
  background: #fde6eb;
  color: #9e173e;
  border: 1px solid #eba2b5;
}

.inline-images-editor {
  display: grid;
  gap: 0.5rem;
}

.inline-images-list {
  display: grid;
  gap: 0.5rem;
}

.inline-image-row {
  display: grid;
  grid-template-columns: 1fr 130px auto;
  gap: 0.5rem;
  align-items: center;
}

.admin-settings-block {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.admin-settings-block h3 {
  margin: 0;
}

.admin-settings-block h4 {
  margin: 0.35rem 0 0;
}

.admin-settings-block label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.admin-settings-block input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  font: inherit;
}

.admin-actions {
  display: flex;
  gap: 0.55rem;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  border: 0;
  border-radius: 10px;
  padding: 0.56rem 0.8rem;
  cursor: pointer;
  font-weight: 700;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: #e3ebf8;
  color: var(--text);
}

.popular-toggle-btn.is-popular {
  background: #0f4d99;
  color: #f4f8ff;
}

.btn-danger {
  background: #b00020;
  color: #fff;
}

.btn-link {
  text-decoration: none;
  padding: 0.5rem 0.62rem;
  border-radius: 10px;
  background: #eef2f7;
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
}

body.night-mode .btn-secondary,
body.night-mode .btn-link {
  background: #1a3458;
  color: #eef5ff;
  border: 1px solid #3b5f8c;
}

body.night-mode .btn-secondary:hover,
body.night-mode .btn-link:hover {
  background: #244773;
  color: #ffffff;
  border-color: #5f89bf;
}

.admin-list {
  display: grid;
  gap: 0.6rem;
}

.admin-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
}

.admin-row p {
  margin: 0.2rem 0 0;
}

.admin-row-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

@media (max-width: 980px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .motto-banner .container {
    width: min(680px, 94%);
  }

  .site-footer::after {
    right: 10%;
    width: 300px;
    height: 190px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .header-row,
  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-tools,
  .search-box {
    width: 100%;
  }

  .brand-badge {
    width: 74px;
    height: 74px;
  }

  .brand h1 {
    font-size: clamp(1.6rem, 7.4vw, 2.2rem);
  }

  .brand p {
    font-size: 0.84rem;
  }

  .category-toggle {
    display: inline-block;
  }

  .category-panel.collapsed .category-nav {
    display: none;
  }

  .motto-banner {
    top: 4px;
    padding: 0.35rem 0;
  }

  .motto-banner .container {
    width: 96%;
    min-height: 48px;
  }

  .social-links {
    justify-content: center;
    gap: 0.55rem;
  }

  .social-link {
    width: 34px;
    height: 34px;
  }

  .social-link svg {
    width: 20px;
    height: 20px;
  }

  .news-grid,
  .sidebar {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-row-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .inline-image-row {
    grid-template-columns: 1fr;
  }

  .card img {
    height: 170px;
  }

  .site-footer::after {
    right: 50%;
    width: 260px;
    height: 170px;
    transform: translate(50%, -50%);
    opacity: 0.3;
  }

  .back-to-top {
    right: 0.8rem;
    bottom: 0.8rem;
    width: 42px;
    height: 42px;
  }
}
