/**
 * Hurpedia Design — global stylesheet (v1.1)
 *
 * Två användningssätt:
 * 1) Wrappa innehållet i <article class="hp-art"> för full design.
 * 2) Använd komponenterna fristående (.hp-snabb, .hp-stats, .hp-info, .hp-tips,
 *    .hp-process, .hp-faq) i vilket inlägg som helst.
 *
 * Stylesheeten laddas med priority 999 (efter temat) så våra regler vinner via
 * källordning. Alla klasser prefixade med .hp- för att aldrig krocka med temat.
 *
 * Ändringar i v1.1:
 * - Bort vertikal bar framför H2 — ren typografi istället
 * - Snyggare snabbfakta-tabell med tydligare label/värde-hierarki
 * - Snyggare FAQ med kort-design och subtle borders
 */

/* ================================================================
 * DESIGN-TOKENS
 * ================================================================ */
.hp-art,
.hp-snabb,
.hp-stats,
.hp-info,
.hp-tips,
.hp-process,
.hp-internlankar,
.hp-kallor,
.hp-cta-block,
.hp-byline,
.hp-faq {
  --hp-primary: #3377bb;
  --hp-primary-dark: #2a5f93;
  --hp-primary-soft: #eef5fc;
  --hp-dark: #353535;
  --hp-warm: #d97706;
  --hp-warm-bg: #fffbeb;
  --hp-warm-border: #f59e0b;
  --hp-green: #059669;
  --hp-green-bg: #ecfdf5;
  --hp-green-border: #34d399;
  --hp-info-color: #1e3a8a;
  --hp-info-bg: #eff6ff;
  --hp-info-border: #3377bb;
  --hp-text: #1f2937;
  --hp-muted: #6b7280;
  --hp-border: #e5e7eb;
  --hp-bg-soft: #faf9f7;
}

/* ================================================================
 * ARTIKEL-WRAPPER
 * ================================================================ */
.hp-art {
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.65;
  color: var(--hp-text);
}

/* H2 — ren typografi utan vertikal bar */
.hp-art h2 {
  font-size: 1.75em;
  line-height: 1.25;
  margin: 56px 0 18px;
  letter-spacing: -0.015em;
  color: var(--hp-dark);
  font-weight: 700;
}

.hp-art h3 {
  font-size: 1.2em;
  line-height: 1.35;
  margin: 36px 0 12px;
  color: var(--hp-dark);
  font-weight: 600;
}

.hp-art p { margin: 0 0 16px; }
.hp-art ul, .hp-art ol { margin: 0 0 16px; padding-left: 24px; }
.hp-art li { margin-bottom: 8px; }

.hp-art a {
  color: var(--hp-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(51,119,187,0.4);
  transition: text-decoration-color 0.2s;
}
.hp-art a:hover { text-decoration-color: var(--hp-primary); }
.hp-art strong { font-weight: 600; color: var(--hp-dark); }

.hp-art table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: #fff;
  border: 1px solid var(--hp-border);
  border-radius: 4px;
  overflow: hidden;
}
.hp-art th, .hp-art td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--hp-border);
  vertical-align: top;
}
.hp-art th {
  background: var(--hp-bg-soft);
  font-weight: 600;
  font-size: 0.95em;
  color: var(--hp-dark);
}
.hp-art tr:last-child td { border-bottom: 0; }

/* ================================================================
 * SNABBFAKTA — modern fakta-kort, redaktionell stil
 *
 * OBS: !important används för flera regler eftersom WordPress-teman
 * (särskilt klassiska teman som Mercia) har aggressiva border/padding-regler
 * på <table>, <tr> och <td> som annars bryter igenom.
 * ================================================================ */
.hp-snabb {
  background: #fff !important;
  border: 1px solid var(--hp-border) !important;
  border-radius: 8px !important;
  padding: 0 !important;
  margin: 32px 0 !important;
  overflow: hidden !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.hp-snabb h2 {
  margin: 0 !important;
  padding: 18px 24px !important;
  font-size: 0.78em !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: #fff !important;
  background: var(--hp-primary-dark) !important;
  font-weight: 700 !important;
  border-radius: 0 !important;
  border: 0 !important;
}

.hp-snabb table,
.hp-snabb tbody,
.hp-snabb thead {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  border-collapse: collapse !important;
  display: block !important;
  box-shadow: none !important;
}

.hp-snabb tr {
  display: grid !important;
  grid-template-columns: 38% 1fr !important;
  align-items: baseline !important;
  gap: 16px !important;
  padding: 14px 24px !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid #f0eeea !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: background 0.12s ease;
}

.hp-snabb tr:last-child {
  border-bottom: 0 !important;
}

.hp-snabb tr:hover {
  background: #faf9f6 !important;
}

.hp-snabb td {
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  vertical-align: baseline !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.hp-snabb td:first-child {
  color: var(--hp-dark) !important;
  font-size: 0.95em !important;
  width: auto !important;
  padding-right: 0 !important;
  font-weight: 600 !important;
  letter-spacing: -0.005em !important;
}

.hp-snabb td:last-child {
  font-weight: 400 !important;
  color: var(--hp-text) !important;
  font-size: 0.95em !important;
  letter-spacing: 0 !important;
}

/* ================================================================
 * STAT-GRID
 * ================================================================ */
.hp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.hp-stat {
  background: var(--hp-primary-soft);
  padding: 22px 18px;
  border-radius: 6px;
  text-align: center;
  border-top: 3px solid var(--hp-primary);
}
.hp-stat-num {
  font-size: 2em;
  font-weight: 700;
  color: var(--hp-primary-dark);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.hp-stat-label {
  font-size: 0.85em;
  color: var(--hp-dark);
  margin-top: 6px;
  font-weight: 500;
}

/* ================================================================
 * TIPS-BOX
 * ================================================================ */
.hp-tips {
  background: var(--hp-green-bg);
  border-left: 4px solid var(--hp-green-border);
  padding: 18px 22px;
  margin: 24px 0;
  border-radius: 0 4px 4px 0;
}
.hp-tips-rubrik {
  font-weight: 600;
  color: var(--hp-green);
  margin: 0 0 8px;
  font-size: 1em;
}
.hp-tips p:last-child { margin: 0; }

/* ================================================================
 * INFO-BOX
 * ================================================================ */
.hp-info {
  background: var(--hp-info-bg);
  border-left: 4px solid var(--hp-info-border);
  padding: 18px 22px;
  margin: 24px 0;
  border-radius: 0 4px 4px 0;
}
.hp-info-rubrik {
  font-weight: 600;
  color: var(--hp-info-color);
  margin: 0 0 8px;
  font-size: 1em;
}
.hp-info p:last-child { margin: 0; }

/* ================================================================
 * PROCESS-STEG
 * ================================================================ */
.hp-process {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 24px 0;
  padding-left: 0;
  list-style: none;
  counter-reset: hp-item;
}
.hp-process li {
  background: #fff;
  border: 1px solid var(--hp-border);
  border-radius: 6px;
  padding: 18px 20px 18px 70px;
  position: relative;
  margin: 0;
}
.hp-process li::before {
  content: counter(hp-item);
  counter-increment: hp-item;
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--hp-primary);
  color: #fff;
  font-weight: 700;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================================================================
 * INTERNLÄNKSBOX
 * ================================================================ */
.hp-internlankar {
  background: var(--hp-primary-soft);
  border-left: 4px solid var(--hp-primary);
  padding: 22px 26px;
  margin: 36px 0;
  border-radius: 0 6px 6px 0;
}
.hp-internlankar h2 {
  margin: 0 0 14px;
  font-size: 0.85em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hp-primary-dark);
  font-weight: 700;
}
.hp-internlankar ul { list-style: none; padding: 0; margin: 0; }
.hp-internlankar li {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid rgba(51,119,187,0.15);
}
.hp-internlankar li:last-child { border-bottom: 0; }
.hp-internlankar a {
  color: var(--hp-primary-dark);
  text-decoration: none;
  font-weight: 500;
}
.hp-internlankar a:hover { text-decoration: underline; }

/* ================================================================
 * FAQ — ny design med kort-stil
 * ================================================================ */
.hp-faq {
  margin: 24px 0;
  display: grid;
  gap: 10px;
}
.hp-faq dt {
  font-weight: 600;
  font-size: 1.05em;
  color: var(--hp-dark);
  padding: 16px 20px 12px 20px;
  background: #fff;
  border: 1px solid var(--hp-border);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  margin: 0;
  position: relative;
  padding-left: 50px;
}
.hp-faq dt::before {
  content: "?";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--hp-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hp-faq dd {
  margin: 0;
  padding: 12px 20px 18px 50px;
  background: #fff;
  border: 1px solid var(--hp-border);
  border-top: 0;
  border-radius: 0 0 6px 6px;
  color: var(--hp-text);
}
.hp-faq dd p { margin: 0 0 12px; }
.hp-faq dd p:last-child { margin: 0; }

/* ================================================================
 * BYLINE
 * ================================================================ */
.hp-byline {
  margin: 48px 0 24px;
  padding: 24px 0 0;
  border-top: 1px solid var(--hp-border);
  font-size: 0.9em;
  color: var(--hp-muted);
}
.hp-byline p { margin: 0 0 4px; }
.hp-byline strong { color: var(--hp-dark); }

/* ================================================================
 * KÄLLOR
 * ================================================================ */
.hp-kallor {
  font-size: 0.9em;
  color: var(--hp-text);
  margin: 24px 0;
  padding: 18px 22px;
  background: var(--hp-bg-soft);
  border: 1px solid var(--hp-border);
  border-radius: 6px;
}
.hp-kallor h2 {
  margin: 0 0 12px;
  font-size: 0.85em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hp-muted);
  font-weight: 700;
}
.hp-kallor ul { padding-left: 18px; margin: 0; }
.hp-kallor li { margin-bottom: 6px; }

/* ================================================================
 * VALKOMPASS-CTA-block — subtil blå accent-box runt rubrik+text
 * (shortcoden visas separat efter, med pluginets egen design)
 * ================================================================ */
.hp-cta-block {
  background: var(--hp-primary-soft);
  border-left: 4px solid var(--hp-primary);
  padding: 28px 32px;
  margin: 44px 0 24px;
  border-radius: 0 6px 6px 0;
}
.hp-cta-block h2 {
  margin: 0 0 12px;
  font-size: 1.4em;
  color: var(--hp-primary-dark);
  letter-spacing: -0.01em;
}
.hp-cta-block p {
  color: var(--hp-text);
  margin: 0 0 12px;
}
.hp-cta-block p:last-of-type {
  margin-bottom: 0;
}
.hp-cta-block strong {
  color: var(--hp-dark);
}

/* ================================================================
 * MOBIL — tabeller blir kort (≤600px)
 * ================================================================ */
@media (max-width: 600px) {
  .hp-art h2 { font-size: 1.45em; margin-top: 40px; }
  .hp-art h3 { font-size: 1.12em; }

  .hp-art table:not(.hp-snabb table) {
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .hp-art table:not(.hp-snabb table) thead { display: none; }
  .hp-art table:not(.hp-snabb table) tr {
    display: block;
    background: #fff;
    border: 1px solid var(--hp-border);
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 12px;
  }
  .hp-art table:not(.hp-snabb table) td {
    display: block;
    padding: 6px 0;
    border-bottom: 1px solid var(--hp-border);
  }
  .hp-art table:not(.hp-snabb table) td:last-child { border-bottom: 0; }
  .hp-art table:not(.hp-snabb table) td::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--hp-muted);
    display: block;
    font-size: 0.85em;
    margin-bottom: 2px;
  }

  .hp-snabb h2 { padding: 14px 18px; font-size: 0.72em; }
  .hp-snabb tr {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 14px 18px;
  }
  .hp-snabb td:first-child {
    font-size: 0.82em;
    margin-bottom: 0;
  }
  .hp-snabb td:last-child {
    font-size: 1em;
  }

  .hp-cta-block { padding: 22px 24px; }
  .hp-cta-block h2 { font-size: 1.2em; }

  .hp-stats { gap: 10px; }
  .hp-stat { padding: 16px 12px; }
  .hp-stat-num { font-size: 1.6em; }

  .hp-process li { padding: 16px 18px 16px 60px; }
  .hp-process li::before { left: 14px; width: 32px; height: 32px; font-size: 1em; }

  .hp-faq dt { padding: 14px 16px 10px 44px; font-size: 1em; }
  .hp-faq dt::before { left: 12px; width: 22px; height: 22px; font-size: 0.8em; }
  .hp-faq dd { padding: 10px 16px 16px 44px; }
}
