:root {
  --archive-list-width: 980px;
  --archive-item-radius: 20px;
  --archive-thumb-width: 260px;
  --archive-thumb-radius: 16px;
  --archive-surface: #ffffff;
  --archive-text: #1f2937;
  --archive-muted: #5f6b7a;
  --archive-lead: #334155;
  --archive-border: rgba(15, 23, 42, 0.1);
  --archive-badge-bg: rgba(15, 23, 42, 0.06);
  --archive-badge-text: #334155;
  --archive-button-bg: #1f2937;
  --archive-button-text: #ffffff;
  --archive-hover-bg: rgba(15, 23, 42, 0.025);
  --archive-hover-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
  --archive-focus-outline: rgba(15, 23, 42, 0.28);
  --archive-thumb-bg: #dbe2ea;
  --archive-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  --post-hero-min-height: 420px;
  --post-hero-min-height-mobile: 320px;
  --post-hero-radius: 24px;
  --post-hero-width: 1100px;
  --post-content-width: 860px;
  --post-overlay: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.52) 55%,
    rgba(0, 0, 0, 0.68) 100%
  );
  --post-badge-bg: rgba(255, 255, 255, 0.16);
  --post-badge-border: rgba(255, 255, 255, 0.24);
  --post-badge-text: #ffffff;
  --post-hero-text: #ffffff;
  --post-meta-text: rgba(255, 255, 255, 0.92);
  --post-surface: #ffffff;
  --post-hero-bg: #2f3b4a;
  --post-hero-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  --post-no-cover-badge-bg: rgba(0, 0, 0, 0.05);
  --post-no-cover-badge-border: rgba(0, 0, 0, 0.08);
  --post-text: #1f2937;
  --post-muted: #5f6b7a;
  --post-border: rgba(15, 23, 42, 0.1);
  --post-link: #0f5ea8;
  --post-link-hover: #0b4c87;
  --post-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
}

html[data-theme="dark"] {
  --archive-surface: #111827;
  --archive-text: #f8fafc;
  --archive-muted: #cbd5e1;
  --archive-lead: #e2e8f0;
  --archive-border: #334155;
  --archive-badge-bg: rgba(96, 165, 250, 0.16);
  --archive-badge-text: #60a5fa;
  --archive-button-bg: #60a5fa;
  --archive-button-text: #020617;
  --archive-hover-bg: rgba(96, 165, 250, 0.1);
  --archive-hover-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
  --archive-focus-outline: rgba(96, 165, 250, 0.55);
  --archive-thumb-bg: #1f2937;
  --archive-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);

  --post-badge-bg: rgba(15, 23, 42, 0.38);
  --post-badge-border: rgba(255, 255, 255, 0.22);
  --post-surface: #111827;
  --post-hero-bg: #0f172a;
  --post-hero-shadow: 0 18px 42px rgba(0, 0, 0, 0.52);
  --post-no-cover-badge-bg: rgba(96, 165, 250, 0.16);
  --post-no-cover-badge-border: rgba(96, 165, 250, 0.28);
  --post-text: #f8fafc;
  --post-muted: #cbd5e1;
  --post-border: #334155;
  --post-link: #93c5fd;
  --post-link-hover: #bfdbfe;
  --post-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
}

html.theme-is-changing .archive-item,
html.theme-is-changing .archive-badge,
html.theme-is-changing .archive-arrow,
html.theme-is-changing .archive-pagination-link,
html.theme-is-changing .archive-pagination-current,
html.theme-is-changing .post-loading,
html.theme-is-changing .post-article,
html.theme-is-changing .post-hero,
html.theme-is-changing .post-category-badge,
html.theme-is-changing .post-content,
html.theme-is-changing .post-content a,
html.theme-is-changing .back-to-archive,
html.theme-is-changing .back-to-top {
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

.archive-page {
  padding: 24px 0 48px;
}

.archive-hero {
  margin-bottom: 20px;
}

.archive-title {
  margin: 0;
}

.archive-content .container {
  max-width: 1100px;
}

.archive-hidden {
  display: none !important;
}

.archive-list {
  max-width: var(--archive-list-width);
  margin: 0 auto;
}

.archive-item {
  display: flex;
  gap: 22px;
  align-items: stretch;
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid var(--archive-border);
  border-radius: var(--archive-item-radius);
  background: var(--archive-surface);
  box-shadow: var(--archive-shadow);
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease;
}

.archive-item:hover,
.archive-item:focus-visible {
  transform: translateY(-2px);
  background: var(--archive-hover-bg);
  box-shadow: var(--archive-hover-shadow);
}

.archive-item:focus-visible {
  outline: 2px solid var(--archive-focus-outline);
  outline-offset: 2px;
}

.archive-media {
  flex: 0 0 var(--archive-thumb-width);
  width: var(--archive-thumb-width);
  align-self: flex-start;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--archive-thumb-radius);
  background: var(--archive-thumb-bg);
}

.archive-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.archive-content-inner {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.archive-date {
  margin: 0 0 8px;
  color: var(--archive-muted);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.archive-item-title {
  margin: 0 0 10px;
  color: var(--archive-text);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.archive-lead {
  margin: 0 0 14px;
  color: var(--archive-lead);
  font-size: 1rem;
  line-height: 1.55;
}

.archive-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
}

.archive-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--archive-badge-bg);
  color: var(--archive-badge-text);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.archive-arrow {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--archive-button-bg);
  color: var(--archive-button-text);
  transition:
    transform 0.18s ease,
    opacity 0.18s ease;
}

.archive-item:hover .archive-arrow,
.archive-item:focus-visible .archive-arrow {
  transform: translateX(2px);
  opacity: 0.94;
}

.archive-arrow svg {
  display: block;
  width: 20px;
  height: 20px;
}

.archive-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: var(--archive-list-width);
  margin: 28px auto 0;
}

.archive-pagination-link,
.archive-pagination-current,
.archive-pagination-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.archive-pagination-link {
  border: 1px solid var(--archive-border);
  background: var(--archive-surface);
  color: var(--archive-text);
}

.archive-pagination-link:hover,
.archive-pagination-link:focus-visible {
  background: var(--archive-hover-bg);
}

.archive-pagination-current {
  background: var(--archive-button-bg);
  color: var(--archive-button-text);
}

.archive-pagination-dots {
  color: var(--archive-muted);
}

.blog-post-page {
  padding: 24px 0 48px;
}

.post-loading {
  max-width: var(--post-content-width);
  margin: 0 auto 24px;
  padding: 18px 20px;
  border: 1px solid var(--post-border);
  border-radius: 16px;
  background: var(--post-surface);
  color: var(--post-muted);
  box-shadow: var(--post-shadow);
}

.post-article {
  color: var(--post-text);
}

.is-hidden {
  display: none !important;
}

.post-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: var(--post-hero-min-height);
  margin: 0 auto 32px;
  max-width: var(--post-hero-width);
  border-radius: var(--post-hero-radius);
  overflow: hidden;
  background-color: var(--post-hero-bg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: var(--post-hero-shadow);
}

.post-hero.post-hero-no-cover {
  min-height: auto;
  padding: 40px 0 10px;
  background: transparent;
  box-shadow: none;
}

.post-hero.post-hero-no-cover .post-hero-overlay {
  display: none;
}

.post-hero.post-hero-no-cover .post-title,
.post-hero.post-hero-no-cover .post-meta,
.post-hero.post-hero-no-cover .post-category-badge {
  color: var(--post-text);
}

.post-hero.post-hero-no-cover .post-category-badge {
  background: var(--post-no-cover-badge-bg);
  border-color: var(--post-no-cover-badge-border);
}

.post-hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--post-overlay);
  pointer-events: none;
}

.post-hero.is-no-cover .post-hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.12) 0%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

.post-hero .container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--post-content-width);
}

.post-hero-content {
  max-width: 860px;
  padding: 42px 0 40px;
  color: var(--post-hero-text);
}

.post-category-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 14px;
  padding: 6px 12px;
  border: 1px solid var(--post-badge-border);
  border-radius: 999px;
  background: var(--post-badge-bg);
  color: var(--post-badge-text);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.post-title {
  margin: 0 0 16px;
  color: var(--post-hero-text);
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.post-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--post-meta-text);
  font-size: 1rem;
  font-weight: 600;
}

.post-meta-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.post-meta-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.post-lead-section,
.post-body-section {
  max-width: var(--post-content-width);
  margin: 0 auto;
  text-align: justify;
}

.post-lead-section {
  margin-bottom: 24px;
}

.post-lead {
  margin: 0;
  color: var(--post-text);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.6;
}

.post-content {
  color: var(--post-text);
  font-size: 1rem;
  line-height: 1.6;
  word-wrap: break-word;
}

.post-content > :first-child {
  margin-top: 0;
}

.post-content > :last-child {
  margin-bottom: 0;
}

.post-content h2,
.post-content h3,
.post-content h4,
.post-content p,
.post-content ul,
.post-content ol,
.post-content li,
.post-content blockquote,
.post-content th,
.post-content td {
  color: var(--post-text);
}

.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 1.7em;
  margin-bottom: 0.6em;
  line-height: 1.25;
}

.post-content h2 {
  font-size: 1.7rem;
  font-weight: 800;
}

.post-content h3 {
  font-size: 1.35rem;
  font-weight: 750;
}

.post-content h4 {
  font-size: 1.1rem;
  font-weight: 700;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content table {
  margin-top: 0;
  margin-bottom: 1em;
}

.post-content ul,
.post-content ol {
  padding-left: 1.4em;
  line-height: 1.6;
}

.post-content li + li {
  margin-top: 0.25em;
}

.post-content a {
  color: var(--post-link);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.post-content a:hover,
.post-content a:focus-visible {
  color: var(--post-link-hover);
}

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5em auto;
  border-radius: 18px;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--post-border);
  border-radius: 14px;
}

.post-content th,
.post-content td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--post-border);
  text-align: left;
  vertical-align: top;
}

.post-content th {
  font-weight: 700;
}

.post-content blockquote {
  margin-left: 0;
  padding: 14px 18px;
  border-left: 4px solid currentColor;
  opacity: 0.9;
}

.post-bottom-nav {
  max-width: var(--post-content-width);
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--post-border);
}

.back-to-archive {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--post-text);
  font-weight: 700;
  text-decoration: none;
}

.back-to-archive:hover,
.back-to-archive:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  width: 46px;
  height: 46px;
  border: 1px solid var(--post-border);
  border-radius: 999px;
  background: var(--post-surface);
  color: var(--post-text);
  box-shadow: var(--post-shadow);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  transform: translateY(-2px);
}

.blog-leaflet-map {
  position: relative;
  width: 100%;
  height: clamp(420px, 62vh, 620px);
  margin: 1.75rem 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  background: #f3f4f6;
}

.blog-leaflet-map .leaflet-control-attribution {
  font-size: 0.68rem;
}

.blog-map-line-switcher {
  display: flex;
  gap: 0.4rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.blog-map-line-button {
  min-width: 2.35rem;
  height: 2.15rem;
  padding: 0 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.blog-map-line-button:hover {
  border-color: #9ca3af;
  color: #4b5563;
}

.blog-map-line-button.is-active {
  border-color: #2563eb;
  background: #dbeafe;
  color: #2563eb;
}

.blog-map-line-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.3);
  outline-offset: 2px;
}

.blog-map-stop-marker {
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  border: 0;
  background: transparent;
}

.blog-map-stop-marker svg {
  display: block;
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18));
}

.stop-tooltip-inner {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 8px 10px;
  box-shadow: var(--shadow-popup);
  border: 1px solid var(--border-subtle);
  font-family: 'DM Sans';
}

.stop-tooltip-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: var(--accent);
}

.stop-tooltip-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.stop-tooltip-row {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.stop-tooltip-subtitle {
  margin-top: 1px;
  font-size: 10px;
  color: var(--text-muted);
}

.stop-tooltip-lines {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
  padding-left: 22px;
  min-height: 14px;
}

.stop-tooltip-line-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 14px;
  padding: 0 4px;
  border: 1px solid #2563eb;
  border-radius: 999px;
  background: #dbeafe;
  color: #2563eb;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

.blog-map-stop-tooltip.leaflet-tooltip {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.blog-map-stop-tooltip.leaflet-tooltip-top::before {
  border-top-color: var(--bg-card);
}

.blog-map-stop-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.blog-map-stop-popup .leaflet-popup-content {
  margin: 0;
  width: auto !important;
  line-height: normal;
}

.blog-map-stop-popup .leaflet-popup-tip-container {
  margin-top: -1px;
}

.blog-map-stop-popup .leaflet-popup-tip {
  background: var(--bg-card);
  box-shadow: none;
}

.blog-leaflet-map--error {
  display: grid;
  place-items: center;
}

.blog-map-error-message {
  margin: 0;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .archive-item {
    gap: 18px;
    padding: 16px;
  }

  .archive-media {
    flex-basis: 220px;
    width: 220px;
  }

  .archive-item-title {
    font-size: 1.22rem;
  }
}

@media (max-width: 700px) {
  .archive-page {
    padding-top: 18px;
    padding-bottom: 36px;
  }

  .archive-item {
    flex-direction: column;
  }

  .archive-media {
    width: 100%;
    flex-basis: auto;
  }

  .archive-item-title {
    font-size: 1.15rem;
  }

  .archive-lead {
    font-size: 0.98rem;
  }
}

@media (max-width: 900px) {
  .post-hero {
    min-height: 360px;
    margin-bottom: 22px;
    border-radius: 20px;
  }

  .post-hero-content {
    padding: 34px 0 30px;
  }

  .post-hero.is-no-cover {
    min-height: 220px;
  }
}

@media (max-width: 640px) {
  .blog-post-page {
    padding-top: 16px;
    padding-bottom: 36px;
  }

  .post-hero {
    min-height: var(--post-hero-min-height-mobile);
    border-radius: 18px;
  }

  .post-hero.is-no-cover {
    min-height: 200px;
  }

  .post-hero-content {
    padding: 28px 0 26px;
  }

  .post-category-badge {
    margin-bottom: 12px;
    font-size: 0.86rem;
  }

  .post-title {
    margin-bottom: 14px;
  }

  .post-meta {
    font-size: 0.96rem;
  }

  .post-lead {
    font-size: 1.02rem;
    line-height: 1.55;
  }

  .post-content {
    line-height: 1.55;
  }

  .post-content h2 {
    font-size: 1.45rem;
  }

  .post-content h3 {
    font-size: 1.22rem;
  }
  
  .blog-leaflet-map {
    height: 460px;
    margin: 1.4rem 0;
    border-radius: 0.85rem;
  }

  .blog-map-line-switcher {
    gap: 0.3rem;
  }

  .blog-map-line-button {
    min-width: 2.15rem;
    height: 2rem;
    padding: 0 0.55rem;
  }
}

