/* =============================================================================
   e-pro.se — Blog Stylesheet (blogg.css)
   Purpose : All styles for the blog list pages (/blogg/, /en/blog/),
             individual blog post pages, the related-posts carousel
             (blogg/mer.html), and the blogg-bild shortcode figures.
             Loaded globally (on every page via baseof.html) to cover both
             the Swedish and English blog sections.
   Author  : Mats-Olof Liljegren, e-pro
   Contact : info@e-pro.se · e-pro.se
   © 2026 e-pro. All rights reserved.
   =============================================================================

   Table of contents
   -----------------
   1. Blog list page (.blogg-lista)
   2. Category filter buttons (.blogg-filter)
   3. Blog card grid (.blogg-kort-grid)
   4. Blog card (.blogg-kort, .blogg-kort-shell)
   5. Cover image (.blogg-kort-bild-wrap, .blogg-kort-cover)
   6. Card content (.blogg-kort-inner, .blogg-kort-footer, etc.)
   7. Category badges (.blogg-kort-kategorier, .blogg-kort-kategori)
   8. Scroll navigation (.blogg-nav, .blogg-nav-pil)
   9. Single blog post (.blogg-post, .blogg-body)
  10. Blog image shortcode (.blogg-figure)
  11. Related posts section (.blogg-mer)
  12. Series navigation (.serie-nav)
  13. Back link (.blogg-tillbaka)
  14. Search field (.blogg-sok)
  15. Fact box (.faktaruta)
  16. Responsive breakpoints
   ============================================================================= */

/* Blog list page */
.blogg-lista {
  min-height: 100vh;
  padding: calc(6rem + 80px) 0 8rem;
  background: #f5f5f7;
}
.blogg-lista-header {
  padding-bottom: 1rem;
  margin-bottom: 0;
}
.blogg-lista-description p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(0,0,0,0.5);
  font-weight: 400;
  margin: 0;
}
.blogg-lista-description a {
  color: rgba(0,0,0,0.6);
  text-decoration: underline;
}
.blogg-lista-description a:hover {
  color: rgba(0,0,0,0.9);
}
.blogg-separator {
  border: none;
  border-top: 0.5px solid rgba(0,0,0,0.12);
  margin: 1rem 0;
}

/* Category filter buttons */
.blogg-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2rem;
}
.blogg-filter-knapp {
  font-family: var(--typsnitt-serif);
  font-size: 14px;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  min-height: 44px;
  border-radius: 980px;
  border: 1.5px solid rgba(0,0,0,0.1);
  background: #ffffff;
  color: rgba(0,0,0,0.5);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  letter-spacing: -0.01em;
}
.blogg-filter-knapp:hover {
  border-color: rgba(0,0,0,0.25);
  color: #1a1a1a;
  background: #fafafa;
}
.blogg-filter-knapp.active {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Blog card grid — horizontal scroll */
.blogg-kort-grid {
  display: flex;
  flex-direction: row;
  gap: 16px;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;

  padding: 16px 2rem 16px 4px;
  margin: -16px -4px;
}
.blogg-kort-grid::-webkit-scrollbar { display: none; }

/* Blog card — transparent wrapper, overflow visible so scale isn't clipped */
.blogg-kort {
  display: flex;
  flex-direction: column;
  overflow: visible;
  text-decoration: none;
  background: transparent;
  flex: 0 0 calc(33.333% - 11px);
  scroll-snap-align: start;
  min-width: 240px;
  animation: kortIn 0.5s ease both;
}
.blogg-kort:nth-child(1) { animation-delay: 0.05s; }
.blogg-kort:nth-child(2) { animation-delay: 0.15s; }
.blogg-kort:nth-child(3) { animation-delay: 0.25s; }
.blogg-kort:nth-child(4) { animation-delay: 0.35s; }
.blogg-kort:nth-child(5) { animation-delay: 0.45s; }
.blogg-kort:nth-child(6) { animation-delay: 0.55s; }

@keyframes kortIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Shell — all visual styling and animation lives here */
.blogg-kort-shell {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  flex: 1;
  will-change: transform, opacity;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Hover — scale shell, dim others */
.blogg-kort-grid:has(.blogg-kort:hover) .blogg-kort:not(:hover) .blogg-kort-shell {
  opacity: 0.5;
}
.blogg-kort-grid .blogg-kort:hover .blogg-kort-shell {
  transform: scale(1.02);
}

/* Cover image */
.blogg-kort-bild-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  flex-shrink: 0;
}
.blogg-kort-bild-wrap picture {
  display: block;
  width: 100%;
  height: 100%;
}
.blogg-kort-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Card content */
.blogg-kort-inner {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem 1rem;
  flex: 1;
}
.blogg-kort-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem 1.25rem;
}
.blogg-kort-datum {
  font-size: 12px;
  font-family: var(--typsnitt-serif);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #000000;
  margin-bottom: 0.5rem;
}
.blogg-kort-titel {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-family: var(--typsnitt-serif);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #000000;
  margin-bottom: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blogg-kort-ingress {
  font-size: 15px;
  font-family: var(--typsnitt-serif);
  font-weight: 400;
  color: rgba(0,0,0,0.6);
  line-height: 1.5;
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blogg-kort-las {
  font-size: 13px;
  font-family: var(--typsnitt-serif);
  color: var(--farg-accent);
  font-weight: 500;
}

/* Categories on cards */
.blogg-kort-kategorier {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  align-items: center;
}
.blogg-kort-kategori {
  font-family: var(--typsnitt-serif);
  font-size: 10px;
  font-weight: 600;
  color: rgba(0,0,0,0.4);
  background: rgba(0,0,0,0.06);
  padding: 0.2rem 0.55rem;
  border-radius: 980px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Scroll navigation */
.blogg-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
}
.blogg-nav-raknar {
  font-size: 13px;
  font-family: var(--typsnitt-serif);
  color: rgba(0,0,0,0.35);
  letter-spacing: 0.04em;
}
.blogg-nav-pilar { display: flex; gap: 8px; }
.blogg-nav-pil {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.blogg-nav-pil:hover { background: #e8e8ed; }

/* Single blog post */
.blogg-post {
  min-height: 100vh;
  padding: calc(6rem + 80px) 0 8rem;
  background: #ffffff;
}
.blogg-post-header {
  max-width: 720px;
  margin-bottom: 4rem;
  padding-bottom: 3rem;
  border-bottom: 0.5px solid rgba(0,0,0,0.1);
}
.blogg-post h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}
.blogg-datum {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: rgba(0,0,0,0.35);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.blogg-translation-note {
  font-size: 0.8rem;
  color: rgba(0,0,0,0.4);
  font-style: italic;
  border-left: 2px solid var(--farg-accent);
  padding-left: 0.75rem;
  margin-top: 1rem;
  margin-bottom: 0;
}

/* Blog body text */
.blogg-body { max-width: 680px; }
.blogg-ingress {
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  line-height: 1.47;
  color: rgba(0,0,0,0.75);
  margin-bottom: 2.5rem;
  font-weight: 400;
  font-style: italic;
}
.blogg-body p {
  color: rgba(0,0,0,0.75);
  font-size: clamp(1rem, 2vw, 1.1rem);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}
.blogg-body p:last-child { margin-bottom: 0; }
.blogg-body h2 {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 3.5rem 0 1.25rem;
  color: var(--farg-text-mork);
  clear: left;
}
.blogg-body blockquote {
  clear: left;
  margin: 2.5rem 0;
  padding: 1.25rem 1.75rem;
  background: rgba(0,0,0,0.03);
  border-left: 3px solid var(--farg-accent);
  border-radius: 0 6px 6px 0;
}
.blogg-body blockquote p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-style: italic;
  color: rgba(0,0,0,0.65);
  margin-bottom: 0;
  line-height: 1.6;
}
.blogg-body a {
  color: var(--farg-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity 0.2s;
}
.blogg-body a:hover { opacity: 0.7; }

/* Blog image with caption */
.blogg-figure {
  float: left;
  width: 280px;
  margin: 0.25rem 2.5rem 1.5rem 0;
}
.blogg-figure img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}
.blogg-figure figcaption {
  font-size: 0.75rem;
  color: rgba(0,0,0,0.4);
  margin-top: 0.5rem;
  font-style: italic;
  line-height: 1.5;
}
.blogg-figure--smal {
  width: 180px;
}
.blogg-figure--liten {
  width: 140px;
}
.blogg-figure--bred {
  float: none;
  width: 100%;
  margin: 1.5rem 0;
}

/* Related posts carousel — below single post */
.blogg-mer {
  background: #f5f5f7;
  padding: 5rem 0 4rem;
  border-top: 0.5px solid rgba(0,0,0,0.08);
}
.blogg-mer-fraga {
  font-family: var(--typsnitt-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1a1a1a;
  margin-bottom: 2rem;
}

/* Series navigation */
.serie-nav {
  background: #f5f5f7;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
  max-width: 420px;
}
.serie-nav-rubrik {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--farg-accent-ljus);
  margin-bottom: 0.75rem;
}
.serie-nav-lista {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.serie-nav-post {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--typsnitt-serif);
  font-size: 0.88rem;
  line-height: 1.35;
}
.serie-nav-nr {
  flex-shrink: 0;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: rgba(0,0,0,0.1);
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,0.5);
}
.serie-nav-lank {
  color: var(--farg-accent);
  text-decoration: none;
}
.serie-nav-lank:hover {
  text-decoration: underline;
}
.serie-nav-post.aktiv .serie-nav-nr {
  background: var(--farg-accent);
  color: #fff;
}
.serie-nav-post.aktiv .serie-nav-text {
  font-weight: 600;
  color: #1a1a1a;
}
.serie-nav-post.kommande .serie-nav-text {
  color: rgba(0,0,0,0.3);
  font-style: italic;
}
.serie-nav-post.kommande .serie-nav-nr {
  background: rgba(0,0,0,0.05);
}
.serie-nav--inline {
  margin-top: 3rem;
  max-width: 100%;
}
@media (min-width: 1300px) {
  .serie-nav:not(.serie-nav--inline) {
    position: fixed;
    right: 2rem;
    top: 120px;
    margin-bottom: 0;
    max-width: 220px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  }
  .serie-nav--inline {
    display: none;
  }
}

/* Back link */
.blogg-tillbaka {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 4rem;
  color: rgba(0,0,0,0.4);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.blogg-tillbaka:hover { color: var(--farg-text-mork); }

/* Search field */
.blogg-sok-wrap {
  margin-bottom: 1.25rem;
}
.blogg-sok {
  width: 100%;
  max-width: 420px;
  font-family: var(--typsnitt-serif);
  font-size: 0.9rem;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 980px;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 0.8rem center / 14px;
  color: var(--farg-text-mork);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.blogg-sok:focus {
  border-color: var(--farg-accent-ljus);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.blogg-sok::placeholder { color: rgba(0,0,0,0.35); }
.blogg-sok::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Fact box */
.faktaruta {
  float: right;
  width: 220px;
  margin: 0.25rem 0 1.5rem 2.5rem;
  padding: 1.25rem 1.25rem 1rem;
  background: #f5f5f7;
  border-radius: 12px;
  border-left: 3px solid var(--farg-accent-ljus);
}
.faktaruta .faktaruta-rubrik {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--farg-accent-ljus);
  margin-bottom: 0.6rem;
}
.faktaruta p {
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(0,0,0,0.6);
  margin-bottom: 0.6rem;
}
.faktaruta p:last-child { margin-bottom: 0; }
.faktaruta a {
  color: var(--farg-accent-ljus);
}
.faktaruta-bild-wrap {
  margin: 0 0 0.75rem;
}
.faktaruta-bild-wrap img {
  width: 100%;
  border-radius: 8px;
  display: block;
}
.faktaruta-bild-wrap figcaption {
  font-size: 0.7rem;
  color: rgba(0,0,0,0.4);
  font-style: italic;
  margin-top: 0.35rem;
  line-height: 1.4;
}

/* Responsive */
@media (max-width: 900px) {
  .blogg-kort { flex: 0 0 calc(50% - 8px); }
}
@media (max-width: 600px) {
  .faktaruta {
    float: none;
    width: 100%;
    margin: 0 0 1.5rem;
  }
  .blogg-kort { flex: 0 0 80vw; }
  .blogg-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  
    scrollbar-width: none;
  }
  .blogg-filter::-webkit-scrollbar { display: none; }
  .blogg-filter-knapp {
    flex-shrink: 0;
    font-size: 13px;
    padding: 0.4rem 1rem;
    min-height: 36px;
  }
  .blogg-figure {
    float: none;
    width: 100%;
    margin: 1.5rem 0;
  }
}

/* Tallrik-del: icon left, text right */
.tallrik-del { display: flex; align-items: flex-start; gap: 1.25rem; margin-bottom: 1.25rem; }
.tallrik-del-ikon { flex-shrink: 0; width: 64px; }
.tallrik-del-ikon img { width: 64px; height: auto; display: block; }
.tallrik-del-ikon [data-lightbox] { display: block; cursor: zoom-in; }
.tallrik-del-text { flex: 1; }
.tallrik-del-text p { margin: 0; color: rgba(0,0,0,0.75); font-size: clamp(0.95rem, 1.8vw, 1.05rem); line-height: 1.6; }

/* Lightbox */
.lightbox-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; transition: opacity 0.2s ease; }
.lightbox-overlay.lightbox-visible { opacity: 1; }
.lightbox-inner { position: relative; max-width: 90vw; max-height: 90vh; }
.lightbox-img { display: block; max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 4px; }
.lightbox-stang { position: absolute; top: -2rem; right: 0; background: none; border: none; color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; padding: 0; opacity: 0.7; }
.lightbox-stang:hover { opacity: 1; }
