/* ==========================================================================
   LENDAX EEAT — FRONTEND CSS v1.1.0
   Seriös, dämpad palett som matchar Lendax visuella identitet.
   Klassprefix: lendax-eeat-

   Palett:
     - Primär: #0f3057 (mörkblå, finansiell pondus)
     - Accent: #2c7a7b (dämpad teal, matchar Lendax-tagline)
     - Text:   #1a202c
     - Muted:  #6b7280
     - Subtle bg: #f7fafc
     - Border: #e5e7eb
   ========================================================================== */

.lendax-eeat-byline,
.lendax-eeat-fact-checked,
.lendax-eeat-toc,
.lendax-eeat-author-box {
  --le-primary: #0f3057;
  --le-primary-hover: #0a223e;
  --le-accent: #2c7a7b;
  --le-accent-hover: #225a5b;
  --le-text: #1a202c;
  --le-muted: #6b7280;
  --le-bg-subtle: #f7fafc;
  --le-bg-card: #ffffff;
  --le-border: #e5e7eb;
  --le-border-strong: #d1d5db;
  --le-radius: 6px;
  --le-radius-lg: 8px;
}

/* ==========================================================================
   TEMA-SKYDD — förhindra att temat tvingar inline-element till block eller
   tilldelar dem full bredd. Vi använder flex-containers för rad-layout,
   men säkerställer också att children inte expanderar till 100% bredd.
   ========================================================================== */

.lendax-eeat-byline .lendax-eeat-byline-name,
.lendax-eeat-fact-checked a {
  width: auto !important;
  max-width: none !important;
}

.lendax-eeat-author-box .lendax-eeat-author-box-link,
.lendax-eeat-author-box .lendax-eeat-author-box-link span {
  display: inline-block !important;
  width: auto !important;
  max-width: none !important;
}

.lendax-eeat-toc .lendax-eeat-toc-item a {
  display: flex !important;
}

/* ==========================================================================
   BYLINE — författare + roll + datum (överst)
   ========================================================================== */

.lendax-eeat-byline {
  display: flex !important;
  align-items: center;
  gap: 16px;
  margin: 0 0 1.6em 0;
  padding: 16px 0;
  border-top: 1px solid var(--le-border);
  border-bottom: 1px solid var(--le-border);
}

.lendax-eeat-avatar-link {
  flex-shrink: 0;
  line-height: 0;
  text-decoration: none;
  display: inline-block;
}

.lendax-eeat-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: block;
  border: 2px solid var(--le-bg-card);
  box-shadow: 0 1px 3px rgba(15, 48, 87, .08);
}

.lendax-eeat-byline-text {
  display: flex !important;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.lendax-eeat-byline-author {
  display: flex !important;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
  font-size: 1.02em;
  line-height: 1.3;
  color: var(--le-text);
}

.lendax-eeat-byline-prefix {
  color: var(--le-muted);
  font-weight: 400;
  width: auto !important;
  max-width: none !important;
}

.lendax-eeat-byline-name {
  color: var(--le-primary);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
  width: auto !important;
  max-width: none !important;
}

.lendax-eeat-byline-name:hover,
.lendax-eeat-byline-name:focus-visible {
  color: var(--le-accent);
  border-bottom-color: var(--le-accent);
}

.lendax-eeat-byline-role {
  font-size: .88em;
  color: var(--le-muted);
  line-height: 1.4;
}

.lendax-eeat-byline-dates {
  display: flex !important;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 4px;
  font-size: .85em;
  color: var(--le-muted);
  line-height: 1.4;
  margin-top: 2px;
}

.lendax-eeat-byline-published,
.lendax-eeat-byline-updated {
  width: auto !important;
  max-width: none !important;
}

.lendax-eeat-byline-updated {
  font-style: italic;
}

.lendax-eeat-byline-updated::before {
  content: "·";
  margin: 0 6px 0 0;
  color: var(--le-border-strong);
  font-style: normal;
}

@media (max-width: 480px) {
  .lendax-eeat-byline {
    gap: 12px;
  }
  .lendax-eeat-avatar {
    width: 56px;
    height: 56px;
  }
  .lendax-eeat-byline-dates {
    font-size: .82em;
  }
}

/* ==========================================================================
   FAKTAGRANSKAD-BOX — dämpad, neutral med accent-stripe
   ========================================================================== */

.lendax-eeat-fact-checked {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--le-bg-subtle);
  border: 1px solid var(--le-border);
  border-left: 3px solid var(--le-accent);
  border-radius: var(--le-radius);
  padding: 11px 16px;
  margin: 0 0 1.6em 0;
  color: var(--le-text);
  font-size: .94em;
  line-height: 1.5;
}

.lendax-eeat-fact-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--le-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.lendax-eeat-fact-icon svg {
  display: block;
}

.lendax-eeat-fact-body {
  flex: 1;
  min-width: 0;
}

.lendax-eeat-fact-label {
  display: block;
  color: var(--le-primary);
  font-weight: 600;
  margin-bottom: 2px;
}

.lendax-eeat-fact-info {
  display: flex !important;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 4px;
}

.lendax-eeat-fact-against {
  color: var(--le-text);
  width: auto !important;
  max-width: none !important;
}

.lendax-eeat-fact-year {
  color: var(--le-muted);
  font-size: .92em;
  width: auto !important;
  max-width: none !important;
}

.lendax-eeat-fact-year::before {
  content: "·";
  margin: 0 6px 0 0;
  color: var(--le-border-strong);
}

/* ==========================================================================
   INNEHÅLLSFÖRTECKNING — collapsible
   ========================================================================== */

.lendax-eeat-toc {
  background: var(--le-bg-card);
  border: 1px solid var(--le-border);
  border-radius: var(--le-radius-lg);
  margin: 0 0 1.6em 0;
  overflow: hidden;
}

.lendax-eeat-toc-toggle {
  width: 100%;
  background: var(--le-bg-subtle);
  border: 0;
  border-bottom: 1px solid var(--le-border);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  color: var(--le-primary);
  font-family: inherit;
  text-align: left;
  transition: background-color .15s ease;
}

.lendax-eeat-toc-toggle:hover {
  background: #eef2f6;
}

.lendax-eeat-toc-toggle:focus-visible {
  outline: 2px solid var(--le-accent);
  outline-offset: -2px;
}

.lendax-eeat-toc-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--le-muted);
  transition: transform .2s ease;
}

.lendax-eeat-toc-arrow svg {
  display: block;
}

.lendax-eeat-toc-toggle[aria-expanded="false"] .lendax-eeat-toc-arrow {
  transform: rotate(-90deg);
}

.lendax-eeat-toc-toggle[aria-expanded="false"] {
  border-bottom: 0;
}

.lendax-eeat-toc-list {
  list-style: none;
  margin: 0;
  padding: 4px 18px 8px 18px;
  background: var(--le-bg-card);
  counter-reset: lendax-eeat-toc-counter;
}

.lendax-eeat-toc-item {
  padding: 0;
  margin: 0;
  counter-increment: lendax-eeat-toc-counter;
}

.lendax-eeat-toc-item a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  color: var(--le-text);
  text-decoration: none;
  font-size: .94em;
  line-height: 1.4;
  transition: color .15s ease;
}

.lendax-eeat-toc-item a::before {
  content: counter(lendax-eeat-toc-counter) ".";
  color: var(--le-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  flex-shrink: 0;
  min-width: 1.5em;
}

.lendax-eeat-toc-item a:hover,
.lendax-eeat-toc-item a:focus-visible {
  color: var(--le-accent);
}

.lendax-eeat-toc-h3 a {
  padding-left: 24px;
  font-size: .9em;
  color: var(--le-muted);
}

.lendax-eeat-toc-h3 a::before {
  content: none;
}

.lendax-eeat-toc-h3 a::after {
  content: none;
}

.lendax-eeat-toc-list[hidden] {
  display: none;
}

/* Smooth scroll + offset så att rubriker inte hamnar under fixerade headers */
.entry-content h2[id],
.entry-content h3[id] {
  scroll-margin-top: 80px;
}

/* ==========================================================================
   FÖRFATTARBOX — i botten av artikeln ("Om författaren")
   ========================================================================== */

.lendax-eeat-author-box {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: var(--le-bg-subtle);
  border: 1px solid var(--le-border);
  border-radius: var(--le-radius-lg);
  padding: 24px 26px;
  margin: 2.2em 0 1em 0;
}

.lendax-eeat-author-box-avatar-wrap {
  flex-shrink: 0;
  line-height: 0;
}

.lendax-eeat-author-box-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: block;
  border: 3px solid var(--le-bg-card);
  box-shadow: 0 3px 10px rgba(15, 48, 87, .14);
}

.lendax-eeat-author-box-body {
  flex: 1;
  min-width: 0;
}

.lendax-eeat-author-box-header {
  margin-bottom: 10px;
}

.lendax-eeat-author-box-eyebrow {
  display: block;
  font-size: .78em;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--le-accent);
  margin-bottom: 6px;
}

.lendax-eeat-author-box-name {
  margin: 0;
  font-size: 1.3em;
  font-weight: 700;
  color: var(--le-primary);
  line-height: 1.3;
}

.lendax-eeat-author-box-role {
  font-size: .9em;
  color: var(--le-muted);
  margin-top: 3px;
}

.lendax-eeat-author-box-bio {
  margin: 10px 0 14px 0;
  color: var(--le-text);
  font-size: .95em;
  line-height: 1.6;
}

.lendax-eeat-author-box-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 0;
}

.lendax-eeat-author-box-link {
  display: inline-block;
  color: var(--le-accent);
  font-weight: 600;
  font-size: .92em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}

.lendax-eeat-author-box-link:hover,
.lendax-eeat-author-box-link:focus-visible {
  color: var(--le-accent-hover);
  border-bottom-color: var(--le-accent-hover);
}

.lendax-eeat-author-box-link span {
  display: inline-block;
  transition: transform .15s ease;
}

.lendax-eeat-author-box-link:hover span {
  transform: translateX(3px);
}

.lendax-eeat-author-box-link-secondary {
  color: var(--le-primary);
}

.lendax-eeat-author-box-link-secondary:hover,
.lendax-eeat-author-box-link-secondary:focus-visible {
  color: var(--le-primary-hover);
  border-bottom-color: var(--le-primary-hover);
}

@media (max-width: 600px) {
  .lendax-eeat-author-box {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    align-items: center;
    text-align: center;
  }
  .lendax-eeat-author-box-avatar {
    width: 96px;
    height: 96px;
  }
  .lendax-eeat-author-box-links {
    justify-content: center;
  }
}

/* ==========================================================================
   PRINT — visa hela TOC öppen, dölj knapp-affordance
   ========================================================================== */

@media print {
  .lendax-eeat-toc-toggle {
    pointer-events: none;
    background: transparent;
  }
  .lendax-eeat-toc-arrow {
    display: none;
  }
  .lendax-eeat-toc-list[hidden] {
    display: block !important;
  }
  .lendax-eeat-author-box-link {
    display: none;
  }
}
