/* Blog index styles extracted during refactor phase 3. */

:root {
  --bg: #ffffff;
  --text: #0f172a;
  --text-rgb: 15, 23, 42;
  --muted: #475569;
  --border: #e5e7eb;
  --vh: 100vh;
  --primary: #0f172a;

  --surface: rgba(0, 0, 0, 0.02);
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  --shadow-strong: 0 20px 40px rgba(0, 0, 0, 0.08);
  --radius: 16px;
}

html.dark {
  --bg: #020617;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: #1e293b;
  --primary: #38bdf8;

  --surface: rgba(255, 255, 255, 0.03);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  --shadow-strong: 0 24px 60px rgba(0, 0, 0, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  transition:
    background-color 0.35s ease,
    color 0.35s ease;
}

body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: var(--vh);
}

/* ===== Header (reuse style) ===== */
#siteHeader {
  position: sticky;
  top: 0;
  z-index: 1000;

  background: rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px) saturate(1.1);

  transition:
    background-color 0.35s ease,
    border-color 0.35s ease;
}

html.dark #siteHeader {
  background: rgba(2, 6, 23, 0.65);
}

#siteHeader.scrolled {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

html.dark #siteHeader.scrolled {
  background: rgba(2, 6, 23, 0.8);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
}

.brand img {
  height: 80px;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.brand img:hover {
  transform: scale(1.05);
  opacity: 0.95;
}

@media (max-width: 900px) {
  .header-inner {
    padding: 0 20px;
    height: 64px;
  }

  .brand img {
    height: 72px;
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding: 0 16px;
    height: 56px;
    gap: 8px;
  }

  .brand img {
    height: 64px;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.nav a {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  position: relative;
  padding: 4px 0;
  white-space: nowrap;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--text);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav a:hover {
  color: var(--text);
}

.nav a:hover::after {
  width: 100%;
}

.nav a.active {
  color: var(--text);
  font-weight: 650;
}

.nav a.active::after {
  width: 100%;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.actions button {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
}

.actions button:hover {
  color: var(--text);
  transform: translateY(-1px);
}

/* ===== Layout ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 48px 31px;
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px 40px;
  }
}

.page-hero {
  margin-top: 96px;
  max-width: none;
}

.page-hero > .kicker,
.page-hero > h1,
.page-hero > .hero-tagline {
  max-width: 880px;
}

@media (max-width: 640px) {
  .page-hero {
    margin-top: 48px;
  }
}

.kicker {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  font-size: clamp(38px, 5.4vw, 60px);
  line-height: 1.08;
  margin: 14px 0 10px;
  font-weight: 720;
}

.hero-tagline {
  margin-top: 8px;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.6;
  font-weight: 520;
  color: var(--muted);
  max-width: 720px;
}

/* ===== Search + Filters ===== */
.blog-controls {
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 900px) {
  .blog-controls {
    grid-template-columns: 1fr;
  }
}

.search-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  box-shadow: var(--shadow);

  /* prevent mobile overflow in flex/grid */
  min-width: 0;
  max-width: 100%;
}

.search-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex: 0 0 auto;
}

.search-input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 520;
  padding: 4px 0;

  /* key fix: allow input to shrink inside flex */
  min-width: 0;
  flex: 1 1 auto;
}

.search-input::placeholder {
  color: var(--muted);
}

.clear-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  flex: 0 0 auto;
}

.clear-btn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

/* ===== Desktop: Inline Tags Layout ===== */
@media (min-width: 641px) {
  /* give tags more room than search on desktop */
  .blog-controls {
    grid-template-columns: minmax(280px, 360px) 1fr;
  }
}

/* ===== Posts Scroll Container ===== */
.posts-wrap {
  margin-top: 26px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
}

.posts-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.posts-header .meta {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.posts-wrap {
  scroll-margin-top: 88px;
}

.posts-scroll {
  overflow: visible;
  padding: 18px 18px 20px;
}

@media (max-width: 640px) {
  .posts-scroll {
    padding: 16px;
  }
}

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  background: rgba(var(--text-rgb), 0.04);
  border-color: rgba(var(--text-rgb), 0.14);
  color: var(--text);
  transform: translateY(-1px);
}

.page-btn.active {
  background: rgba(var(--text-rgb), 0.08);
  border-color: rgba(var(--text-rgb), 0.18);
  color: var(--text);
}

html.dark .page-btn.active {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.page-btn--nav {
  padding: 0 14px;
}

.pagination-ellipsis {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 2px;
}

.posts-feedback {
  grid-column: 1 / -1;
  padding: 18px;
  color: var(--muted);
  line-height: 1.7;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(var(--text-rgb), 0.02);
}

@media (max-width: 640px) {
  .pagination-bar {
    gap: 8px;
  }

  .page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    font-size: 11px;
  }

  .page-btn--nav {
    padding: 0 12px;
  }
}

/* ===== Mobile: Compact Blog Controls ===== */
@media (max-width: 640px) {
  .blog-controls {
    margin-top: 18px;
    gap: 10px;
  }

  .search-wrap {
    padding: 10px 12px;
  }

  .clear-btn {
    padding: 7px 10px;
  }
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 980px) {
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
}

.post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(4px);
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  min-height: 100%;

  /* Clickable card */
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: var(--shadow-strong);
}

.post-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.post-card:hover .read-link {
  opacity: 0.85;
}

.thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(
      1200px 400px at 10% 10%,
      rgba(56, 189, 248, 0.18),
      transparent 60%
    ),
    radial-gradient(
      800px 400px at 90% 20%,
      rgba(2, 6, 23, 0.08),
      transparent 60%
    ),
    linear-gradient(135deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.01));
  overflow: hidden;
}

.thumb.is-empty {
  display: grid;
  place-items: center;
}

.thumb.is-empty::after {
  content: "Image unavailable";
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.8;
}

html.dark .thumb {
  background:
    radial-gradient(
      1200px 400px at 10% 10%,
      rgba(56, 189, 248, 0.14),
      transparent 60%
    ),
    radial-gradient(
      800px 400px at 90% 20%,
      rgba(255, 255, 255, 0.06),
      transparent 60%
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03),
      rgba(255, 255, 255, 0.01)
    );
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform 0.35s ease;
}

.post-card:hover .thumb img {
  transform: scale(1.04);
}

.post-body {
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.post-date {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.post-title {
  font-size: 16px;
  line-height: 1.35;
  margin: 0;
  font-weight: 720;
  color: var(--text);
}

.post-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.post-tags span {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
}

.post-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
}

.read-link {
  text-decoration: none;
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
}

.read-link:hover {
  opacity: 0.85;
}

.pill-mini {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
}

/* ===== Sections ===== */
.section {
  margin-top: 44px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section h2 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 760px;
}

.section-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn.primary {
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}

html.dark .btn.primary {
  background: rgba(56, 189, 248, 0.2);
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.3);
}

.hint {
  font-size: 13px;
  color: var(--muted);
}

/* ===== Footer ================= */
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.footer-bottom {
  max-width: 1200px;
  margin: 80px auto 32px;
  padding: 32px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--muted);
}

.footer-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    padding: 32px 20px;
    margin-top: 60px;
    gap: 16px;
  }

  .footer-meta {
    justify-content: center;
  }
}

/* ===== Reveal (optional) ===== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================= Menu Button ================= */
#menuBtn {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s ease;
}

html.dark #menuBtn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

#menuBtn:hover {
  transform: scale(1.02);
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}

/* ================= Fullscreen Overlay ================= */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px) saturate(1.8);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  /* Animation hidden state */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

html.dark .menu-overlay {
  background: rgba(2, 6, 23, 0.98);
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

html.dark .close-btn {
  background: rgba(255, 255, 255, 0.1);
}

.close-btn:hover {
  transform: rotate(90deg);
  background: var(--text);
  color: var(--bg);
}

.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 32px;
  text-align: center;
}

.menu-link {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 750;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  opacity: 0.6;
  letter-spacing: -0.02em;
}

.menu-link:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.menu-link.active {
  opacity: 1;
}

.menu-actions {
  margin-top: 56px;
  display: flex;
  gap: 20px;
  align-items: center;
}

.menu-theme-btn {
  padding: 12px 24px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.menu-theme-btn:hover {
  background: var(--surface);
  transform: translateY(-2px);
}

.theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  line-height: 0;
}

.theme-icon svg {
  width: 20px;
  height: 20px;
  display: none;
}

html.dark .theme-icon-dark {
  display: block;
}

html:not(.dark) .theme-icon-light {
  display: block;
}

/* ===== Blog header: desktop ikut main page, mobile kekal menu button ===== */

.desktop-nav,
.desktop-actions {
  display: none;
}

#menuBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.desktop-nav {
  align-items: center;
  gap: 18px;
  margin-left: auto;
  margin-right: 18px;
}

.desktop-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.86;
  transition:
    opacity 0.2s ease,
    color 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a:focus-visible {
  opacity: 1;
}

.desktop-nav a.active {
  opacity: 1;
  color: var(--accent);
}

.desktop-actions {
  align-items: center;
  gap: 12px;
}

.desktop-actions .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 980px) {
  .header-inner {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    height: 56px;
  }

  .brand {
    justify-self: start;
    align-self: center;
  }

  .desktop-nav,
  .desktop-actions {
    display: flex;
    align-items: center;
    align-self: center;
    height: 56px;
  }

  .desktop-nav {
    justify-self: center;
    margin: 0;
    gap: 24px;
  }

  .desktop-nav a {
    display: inline-flex;
    align-items: center;
    height: 56px;
    padding: 0;
  }

  .desktop-nav a::after {
    bottom: 10px;
  }

  .desktop-actions {
    justify-self: end;
    margin: 0;
  }

  .desktop-actions .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
  }

  #menuBtn {
    display: none;
  }
}

@media (max-width: 900px) {
  .blog-controls {
    grid-template-columns: 1fr;
  }
}

.tag-panel {
  position: relative;
  min-width: 0;
  width: 100%;
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.tag-panel-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
  width: 100%;
}

.tag-scroll-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.tag-title {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
}

.tag-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 2px 52px 6px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overscroll-behavior-x: contain;
  cursor: grab;
  user-select: none;
  touch-action: pan-x;
}

.tag-row::-webkit-scrollbar {
  display: none;
}

.tag-row.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.tag-row.is-dragging .tag-pill {
  pointer-events: none;
}

.tag-pill {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.tag-pill:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.18);
  color: var(--text);
  transform: translateY(-1px);
}

.tag-pill.active {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.26);
  color: var(--text);
}

html.dark .tag-pill:hover {
  background: rgba(110, 168, 254, 0.08);
  border-color: rgba(110, 168, 254, 0.24);
}

html.dark .tag-pill.active {
  background: rgba(110, 168, 254, 0.14);
  border-color: rgba(110, 168, 254, 0.34);
}

.tag-pill:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

html.dark .tag-pill:focus-visible {
  outline-color: rgba(110, 168, 254, 0.5);
}

.tag-scroll-button {
  position: absolute;
  top: calc(50% - 3px);
  transform: translateY(-50%);
  z-index: 3;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease,
    box-shadow 0.2s ease;
}

html.dark .tag-scroll-button {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.tag-scroll-button:hover {
  border-color: rgba(37, 99, 235, 0.26);
  background: rgba(37, 99, 235, 0.06);
}

html.dark .tag-scroll-button:hover {
  border-color: rgba(110, 168, 254, 0.28);
  background: rgba(110, 168, 254, 0.08);
}

.tag-scroll-button:active {
  transform: translateY(-50%) scale(0.96);
}

.tag-scroll-button:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
  box-shadow: none;
}

.tag-scroll-button-left {
  left: 6px;
}

.tag-scroll-button-right {
  right: 6px;
}

.tag-scroll-button span {
  display: inline-block;
  line-height: 1;
  font-size: 18px;
  transform: translateY(-1px);
}

.tag-scroll-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  pointer-events: none;
  z-index: 2;
}

.tag-scroll-fade-left {
  left: 0;
  background: linear-gradient(
    90deg,
    #ffffff 0%,
    rgba(255, 255, 255, 0.82) 38%,
    rgba(255, 255, 255, 0) 100%
  );
}

.tag-scroll-fade-right {
  right: 0;
  background: linear-gradient(
    270deg,
    #ffffff 0%,
    rgba(255, 255, 255, 0.82) 38%,
    rgba(255, 255, 255, 0) 100%
  );
}

html.dark .tag-scroll-fade-left {
  background: linear-gradient(
    90deg,
    #161a22 0%,
    rgba(22, 26, 34, 0.82) 38%,
    rgba(22, 26, 34, 0) 100%
  );
}

html.dark .tag-scroll-fade-right {
  background: linear-gradient(
    270deg,
    #161a22 0%,
    rgba(22, 26, 34, 0.82) 38%,
    rgba(22, 26, 34, 0) 100%
  );
}

@media (max-width: 900px) {
  .blog-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tag-panel {
    padding: 10px 12px;
  }

  .tag-panel-inner {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
  }

  .tag-title {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    margin: 0;
  }

  .tag-scroll-wrap {
    min-width: 0;
    width: 100%;
  }

  .tag-row {
    padding: 2px 40px 6px 40px;
    gap: 8px;
  }

  .tag-pill {
    min-height: 36px;
    padding: 0 13px;
  }

  .tag-scroll-button {
    width: 32px;
    height: 32px;
    top: 50%;
    transform: translateY(-50%);
  }

  .tag-scroll-button-left {
    left: 0;
    right: auto;
  }

  .tag-scroll-button-right {
    right: 0;
    left: auto;
  }

  .tag-scroll-button span {
    font-size: 17px;
  }

  .tag-scroll-fade-left {
    display: none;
  }

  .tag-scroll-fade-right {
    width: 40px;
  }
}
