:root {
  --bg: #fff8ef;
  --ink: #1f1f1f;
  --brand: #005f73;
  --brand-alt: #bb3e03;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Merriweather", Georgia, serif;
  line-height: 1.6;
  color: var(--ink);
  background: radial-gradient(circle at top right, #ffe8d6, var(--bg));
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1216;
    --ink: #e6edf1;
    --brand: #6fc6d9;
    --brand-alt: #ffb680;
    --card: #101b21;
  }

  body {
    background: radial-gradient(circle at top right, #1b2d33, #0b1216);
  }

  .site-header {
    background: rgba(11, 18, 22, 0.88);
    border-bottom: 2px solid #31515a;
  }

  .hero {
    background: linear-gradient(135deg, #0d5256, #2d7c72);
    color: #e6f7f6;
  }

  .btn {
    background: #d8ecf2;
    color: #102027;
  }

  .post-list li {
    border: 1px solid #31515a;
  }

  .post-item:hover {
    border-color: #4f7782;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  }

  .post-teaser,
  .step-thumb {
    border: 1px solid #31515a;
  }

  .post-summary,
  .meta,
  small {
    color: #b8c8ce;
  }

  .polarsteps-callout {
    border: 1px solid #2c5963;
    border-left: 6px solid #54aebb;
    background: linear-gradient(135deg, #12242a, #16323a);
  }

  .polarsteps-callout a {
    color: #8ed8e5;
  }

  .site-footer {
    color: #b8c8ce;
  }
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 2px solid #e9d8a6;
  position: sticky;
  top: 0;
  backdrop-filter: blur(6px);
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand);
  text-decoration: none;
}

nav a {
  margin-left: 1rem;
  color: var(--brand-alt);
  text-decoration: none;
  font-weight: 600;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.hero {
  background: linear-gradient(135deg, #0a9396, #94d2bd);
  color: #001219;
  padding: 1.2rem;
  border-radius: 12px;
}

.btn {
  display: inline-block;
  padding: 0.55rem 0.9rem;
  background: #001219;
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
}

.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  background: var(--card);
  border: 1px solid #e9d8a6;
  border-radius: 10px;
  margin: 0.7rem 0;
  padding: 0.8rem;
}

.post-item {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1rem;
  align-items: start;
}

.post-item.no-image {
  grid-template-columns: 1fr;
}

.post-teaser-link {
  display: block;
}

.post-teaser {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e9d8a6;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.post-content {
  min-width: 0;
}

.post-title {
  display: inline-block;
  font-size: 1.12rem;
  line-height: 1.35;
}

.post-date {
  display: block;
  margin-top: 0.15rem;
}

.post-summary {
  margin: 0.45rem 0 0;
  color: #3e3e3e;
}

.polarsteps-callout {
  margin: 0.9rem 0 1.1rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid #c9e7df;
  border-left: 6px solid #0a9396;
  border-radius: 10px;
  background: linear-gradient(135deg, #f4fffc, #e8f8f3);
}

.polarsteps-callout p {
  margin: 0;
}

.polarsteps-callout a {
  color: #005f73;
  font-weight: 700;
  text-decoration: none;
}

.polarsteps-callout a:hover {
  text-decoration: underline;
}

.post-item:hover {
  border-color: #d8c48b;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
}

.post-list a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.meta,
small {
  color: #555;
}

.step-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin: 0.6rem 0 1rem;
}

.step-thumb-link {
  display: block;
}

.step-thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e9d8a6;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.step-thumb:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox-overlay.is-open {
  display: flex;
}

.lightbox-figure {
  margin: 0;
  max-width: min(92vw, 1200px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.lightbox-caption {
  color: #fff;
  margin-top: 0.6rem;
  font-size: 0.95rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  border: 0;
  border-radius: 999px;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  font-size: 1.5rem;
  cursor: pointer;
}

.lightbox-close {
  top: 16px;
  right: 16px;
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

.site-footer {
  padding: 1rem 1.25rem 2rem;
  text-align: center;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  nav a {
    margin-left: 0;
    margin-right: 0.8rem;
  }

  .post-item {
    grid-template-columns: 1fr;
  }

  .post-teaser {
    height: 200px;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background: radial-gradient(circle at top right, #1b2d33, #0b1216);
    color: #e6edf1;
  }

  .site-header {
    background: rgba(11, 18, 22, 0.9);
    border-bottom-color: #31515a;
  }

  .brand,
  nav a {
    color: #bfe8f1;
  }

  .hero {
    background: linear-gradient(135deg, #0d5256, #2d7c72);
    color: #e6f7f6;
  }

  .btn {
    background: #d8ecf2;
    color: #102027;
  }

  .post-list li {
    border-color: #31515a;
    background: #101b21;
  }

  .post-item:hover {
    border-color: #4f7782;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  }

  .post-teaser,
  .step-thumb {
    border-color: #31515a;
  }

  .post-title,
  .post-summary,
  .post-date,
  .meta,
  small {
    color: #c8d8de;
  }

  .polarsteps-callout {
    border-color: #2c5963;
    border-left-color: #54aebb;
    background: linear-gradient(135deg, #12242a, #16323a);
  }

  .polarsteps-callout p {
    color: #d7edf2;
  }

  .polarsteps-callout a {
    color: #9be4ef;
  }

  .site-footer {
    color: #b8c8ce;
  }
}
