/*
Theme Name: Hälsovett
Theme URI: https://halsovett.com/
Author: Impact Way AB
Description: Ett lätt, redaktionellt blocktema för Hälsovett. Byggt för Gutenberg och automatiserad artikelpublicering.
Version: 0.5.2
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: halsovett
*/

:root {
  --hv-paper: #FBF9F5;
  --hv-surface: #FFFFFF;
  --hv-surface-2: #F4F1EA;
  --hv-ink: #1B1D1A;
  --hv-muted: #5E625C;
  --hv-line: #E6E2D8;
  --hv-forest: #2E5A4C;
  --hv-clay: #C4703F;
  --hv-sleep: #3E5A73;
  --hv-food: #7A6A3F;
  --hv-move: #2E5A4C;
  --hv-stress: #6B5570;
  --hv-habits: #8A5A3F;
  --hv-radius: 8px;
  --hv-wide: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--hv-paper);
  color: var(--hv-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { text-underline-offset: .16em; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--hv-clay);
  outline-offset: 3px;
}
.wp-site-blocks { min-height: 100vh; }
.wp-site-blocks > main { margin-top: 0; }

/* Header */
.hv-site-header {
  background: var(--hv-paper);
  border-bottom: 1px solid var(--hv-line);
}
/* Keep the complete site header visible while the reader scrolls. */
.wp-site-blocks > header.wp-block-template-part,
header.wp-block-template-part:has(.hv-site-header) {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000;
  background: var(--hv-paper);
}
.admin-bar .wp-site-blocks > header.wp-block-template-part,
.admin-bar header.wp-block-template-part:has(.hv-site-header) {
  top: 32px !important;
}
@media (max-width: 782px) {
  .admin-bar .wp-site-blocks > header.wp-block-template-part,
  .admin-bar header.wp-block-template-part:has(.hv-site-header) {
    top: 46px !important;
  }
}
.hv-header-inner {
  min-height: 64px;
  padding-inline: 20px;
}
.hv-brand { gap: 12px; align-items: center; }
.hv-brand .wp-block-site-logo { margin: 0; }
.hv-brand .wp-block-site-logo:has(img) + .hv-site-title { display: none; }
.hv-brand--footer .wp-block-site-logo:has(img) + .wp-block-site-title { display: none; }
.hv-site-title a { color: var(--hv-ink); text-decoration: none; }
.hv-site-header .wp-block-navigation a { color: var(--hv-ink); text-decoration: none; }
.hv-site-header .wp-block-navigation a:hover { color: var(--hv-forest); }
.hv-site-header .wp-block-search {
  margin: 0;
  display: flex;
  align-items: center;
}
.hv-site-header .wp-block-search__button {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--hv-ink);
  box-shadow: none;
  display: grid;
  place-items: center;
  line-height: 1;
}
.hv-site-header .wp-block-search__button svg {
  width: 20px;
  height: 20px;
  display: block;
  transform: scaleX(-1);
  transform-origin: center;
}

/* Home - hero */
.hv-home-shell { overflow: clip; }
.hv-hero {
  padding: 0;
  margin: 0;
}
.hv-hero-top {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, .94fr);
  gap: 0;
  max-width: var(--hv-wide);
  min-height: 430px;
  margin-inline: auto;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
}
.hv-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(52px, 6vw, 82px) clamp(36px, 5vw, 68px) clamp(100px, 9vw, 120px) 24px;
}
.hv-hero h1 {
  max-width: 690px;
  margin: 0;

  letter-spacing: -.025em;
  text-wrap: balance;
}
.hv-hero .hv-lead {
  max-width: 610px;
  margin: 24px 0 0;

  line-height: 1.55;
}
.hv-hero-visual { min-width: 0; }
.hv-hero-image, .hv-hero-image img {
  width: 100%;
  height: 100%;
  margin: 0;
}
.hv-hero-image img {
  min-height: 430px;
  object-fit: cover;
  object-position: center;
  display: block;
}
.hv-question-wrap {
  position: relative;
  z-index: 4;
  max-width: var(--hv-wide);
  margin: -82px auto 0;
  padding: 0 24px;
}
.hv-question-grid.wp-block-columns,
.hv-topic-grid.wp-block-columns {
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 16px;
  margin: 0;
}
.hv-question-grid.wp-block-columns > .wp-block-column,
.hv-topic-grid.wp-block-columns > .wp-block-column { min-width: 0; margin: 0; }
.hv-question-card {
  position: relative;
  height: 100%;
  min-height: 104px;
  padding: 18px 18px 16px 66px;
  border: 1px solid var(--hv-line);
  border-radius: var(--hv-radius);
  background: rgba(255,255,255,.97);
}
.hv-question-card .hv-card-icon {
  position: absolute;
  top: 18px;
  left: 16px;
  width: 42px;
  height: 42px;
  margin: 0;
}
.hv-question-card .hv-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.hv-question-card p { margin: 0; line-height: 1.35; }
.hv-question-card a { color: var(--hv-ink); text-decoration: none; }
.hv-question-card:hover { border-color: #c9c2b5; transform: translateY(-1px); }

/* Topic cards */
.hv-topic-wrap { max-width: var(--hv-wide); margin: 28px auto 0; padding: 0 24px; }
.hv-topic-card {
  position: relative;
  min-height: 245px;
  height: 100%;
  padding: 116px 22px 24px;
  text-align: center;
  border: 1px solid var(--hv-line);
  border-top-width: 3px;
  border-radius: var(--hv-radius);
  background: rgba(255,255,255,.55);
}
.hv-topic-card .hv-card-icon {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  height: 78px;
  margin: 0;
}
.hv-topic-card .hv-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.hv-topic-card--sleep { border-top-color: var(--hv-sleep); }
.hv-topic-card--food { border-top-color: var(--hv-food); }
.hv-topic-card--move { border-top-color: var(--hv-move); }
.hv-topic-card--stress { border-top-color: var(--hv-stress); }
.hv-topic-card--habits { border-top-color: var(--hv-habits); }
.hv-topic-card h3 { margin: 0 0 12px; }
.hv-topic-card p { margin: 0; color: var(--hv-muted); line-height: 1.45; }
.hv-topic-card a { color: inherit; text-decoration: none; }
.hv-topic-card:hover { background: #fff; border-left-color: #d8d2c6; border-right-color: #d8d2c6; border-bottom-color: #d8d2c6; }

/* Shared home sections */
.hv-section {
  width: min(100%, var(--hv-wide));
  max-width: var(--hv-wide);
  margin-left: auto;
  margin-right: auto;
  margin-top: clamp(1.8rem, 3vw, 2.4rem);
  padding-inline: 24px;
}
.hv-section-title-row { margin-bottom: 18px; }
.hv-section-title-row h2 { margin: 0; }

/* Featured */
.hv-featured {
  display: grid !important;
  grid-template-columns: 1fr 1.18fr;
  gap: 0 !important;
  border: 1px solid var(--hv-line);
  border-radius: var(--hv-radius);
  background: var(--hv-surface);
  overflow: hidden;
}
.hv-featured > .wp-block-column { margin: 0; min-width: 0; }
.hv-featured .wp-block-post-featured-image,
.hv-featured .wp-block-post-featured-image img,
.hv-featured-demo-image,
.hv-featured-demo-image img {
  width: 100%;
  height: 100%;
  margin: 0 !important;
}
.hv-featured .wp-block-post-featured-image img,
.hv-featured-demo-image img {
  min-height: 330px;
  object-fit: cover;
  display: block;
}
.hv-featured-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 4vw, 56px);
}
.hv-featured-copy .taxonomy-artikeltyp,
.hv-featured-copy .hv-kicker { margin-bottom: 10px; }
.hv-featured-copy .wp-block-post-title,
.hv-featured-copy h2 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 3.4vw, 3rem) !important;
  line-height: 1.03;
}
.hv-featured-copy .wp-block-post-title a { color: var(--hv-ink); text-decoration: none; }
.hv-featured-copy .wp-block-post-excerpt { color: var(--hv-muted); }
.hv-demo-meta { color: var(--hv-muted); font-size: .82rem; }

/* Research cards */
.hv-card-grid .wp-block-post-template,
.hv-research-preview {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px;
}
.hv-card-grid .wp-block-post,
.hv-research-card {
  overflow: hidden;
  min-width: 0;
  padding: 0 0 22px;
  border: 1px solid var(--hv-line);
  border-radius: var(--hv-radius);
  background: var(--hv-surface);
}
.hv-card-grid .wp-block-post-featured-image,
.hv-research-card .wp-block-image { margin: 0 0 18px !important; }
.hv-card-grid .wp-block-post-featured-image img,
.hv-research-card img {
  width: 100%;
  aspect-ratio: 16/5;
  object-fit: cover;
  display: block;
}
.hv-card-grid .wp-block-post-title,
.hv-card-grid .wp-block-post-excerpt,
.hv-card-grid .wp-block-post-date,
.hv-card-grid .taxonomy-amne,
.hv-card-grid .taxonomy-artikeltyp,
.hv-research-card > :not(.wp-block-image) {
  margin-left: 20px;
  margin-right: 20px;
}
.hv-card-grid .wp-block-post-title a { color: var(--hv-ink); text-decoration: none; }
.hv-research-card .hv-kicker { margin-top: 0; color: var(--hv-clay); }
.hv-research-card h3 { margin-top: 6px; margin-bottom: 10px; font-size: 1.25rem !important; }
.hv-research-card p { color: var(--hv-muted); }

/* Method — same open layout as the approved mockup */
.hv-method {
  width: min(100%, var(--hv-wide));
  max-width: var(--hv-wide);
  margin-left: auto;
  margin-right: auto;
  margin-top: clamp(1.8rem, 3vw, 2.4rem);
  padding: 0 24px;
  background: transparent;
  border: 0;
}
.hv-method > * { max-width: none; margin-inline: 0; }
.hv-method > h2 {
  margin: 0 0 20px;

}
.hv-method .wp-block-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
}
.hv-method-item {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0,1fr);
  grid-template-rows: auto auto;
  column-gap: 18px;
  align-items: start;
  padding: 0 30px 0 0;
}
.hv-method-item + .hv-method-item {
  border-left: 1px solid var(--hv-line);
  padding-left: 30px;
}
.hv-method-item .hv-card-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: block;
  width: 72px;
  height: 72px;
  margin: 0;
  border: 0;
}
.hv-method-item .hv-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.hv-method-item h3 {
  grid-column: 2;
  grid-row: 1;
  margin: 2px 0 7px;
  padding: 0;

  line-height: 1.16;
}
.hv-method-item p {
  grid-column: 2;
  grid-row: 2;
  margin: 0;

  line-height: 1.45;
}
/* Start cards */
.hv-start-grid { gap: 18px; margin-top: 14px; }
.hv-start-card {
  position: relative;
  min-height: 178px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: 22px 58px 20px 22px;
  border: 1px solid var(--hv-line);
  border-radius: var(--hv-radius);
  background-color: #5d5b55;
  background-size: cover;
  background-position: center;
  color: #fff;
}
.hv-start-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20,22,19,.76), rgba(20,22,19,.05) 68%);
}
.hv-start-card > * { position: relative; z-index: 1; }
.hv-start-card h3 { margin: 0 0 6px; }
.hv-start-card p { margin: 0; }
.hv-start-card a { color: #fff; text-decoration: none; }
.hv-start-card::after {
  content: "→";
  position: absolute;
  right: 20px;
  bottom: 18px;
  z-index: 2;
  color: #fff;
  font-size: 1.65rem;
  line-height: 1;
}

/* Person */
.hv-person {
  width: min(calc(100% - 48px), var(--hv-wide));
  max-width: var(--hv-wide);
  margin-left: auto;
  margin-right: auto;
  margin-top: clamp(1.8rem, 3vw, 2.4rem);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--hv-line);
  border-radius: var(--hv-radius);
  background: var(--hv-surface);
}
.hv-person > .wp-block-columns { gap: 0; margin: 0; }
.hv-person .wp-block-column { margin: 0; }
.hv-person-copy { padding: clamp(30px, 4vw, 54px); }
.hv-person-placeholder {
  min-height: 320px;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--hv-muted);
  border-right: 1px solid var(--hv-line);
  background:
    radial-gradient(circle at 35% 32%, rgba(46,90,76,.16), transparent 28%),
    linear-gradient(145deg, rgba(46,90,76,.08), rgba(196,112,63,.11)),
    var(--hv-surface-2);
}
.hv-person-copy h2 { margin-top: 8px; }
.hv-person-links { display: flex; flex-wrap: wrap; gap: 24px; }

/* Footer */
.hv-site-footer {
  margin-top: clamp(1.8rem, 3vw, 2.4rem);
  padding-top: 56px;
  padding-bottom: 28px;
  background: var(--hv-surface-2);
  border-top: 1px solid var(--hv-line);
}
.hv-footer-grid a { color: var(--hv-ink); text-decoration: none; }
.hv-footer-grid a:hover { text-decoration: underline; }

/* Article */
.hv-article-shell { padding-top: clamp(2.75rem, 6vw, 5rem); }
.hv-article-header { max-width: 760px; margin-inline: auto; }
.hv-article-body { max-width: 680px; margin-inline: auto; }
.hv-article-body > * { margin-top: 0; margin-bottom: 1.35em; }
.hv-article-body h2 { margin-top: 2em; }
.hv-article-body h3 { margin-top: 1.65em; }
.hv-article-body p, .hv-article-body li { font-size: clamp(1.0625rem,1.3vw,1.1875rem); line-height: 1.72; }
.hv-article-body ul, .hv-article-body ol { padding-left: 1.35em; }
.hv-meta-bar { font-size: .82rem; color: var(--hv-muted); border-top: 1px solid var(--hv-line); border-bottom: 1px solid var(--hv-line); padding: 12px 0; margin: 22px 0 28px; }
.hv-kicker { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--hv-forest); font-weight: 650; }
.hv-short-answer, .hv-underlag, .hv-interpretation, .hv-unknowns, .hv-not-covered, .hv-author-box, .hv-related { margin: 34px 0; }
.hv-short-answer { background: var(--hv-surface-2); border-left: 3px solid var(--hv-forest); padding: 24px 26px; }
.hv-underlag { border: 1px solid var(--hv-line); border-radius: var(--hv-radius); padding: 24px 26px; background: var(--hv-surface); }
.hv-underlag ul { margin-bottom: 0; }
.hv-interpretation { background: rgba(46,90,76,.06); border-left: 3px solid var(--hv-forest); padding: 26px; }
.hv-unknowns, .hv-not-covered { padding-top: 22px; border-top: 1px solid var(--hv-line); }
.hv-faq details { border-top: 1px solid var(--hv-line); padding: 17px 0; }
.hv-faq details:last-child { border-bottom: 1px solid var(--hv-line); }
.hv-faq summary { cursor: pointer; font-weight: 650; }
.hv-faq details p { margin-bottom: 0; }
.hv-sources { margin-top: 46px; }
.hv-source { padding: 18px 0; border-top: 1px solid var(--hv-line); }
.hv-source:last-child { border-bottom: 1px solid var(--hv-line); }
.hv-source-tag { display:inline-block; font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; color:var(--hv-muted); margin-right:8px; }
.hv-source-country { display:inline-block; font-size:.72rem; color:var(--hv-forest); }
.hv-source a { word-break: break-word; }
.hv-author-box { border:1px solid var(--hv-line); border-radius:var(--hv-radius); padding:24px 26px; background:var(--hv-surface); }
.hv-related-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.hv-related-card { border:1px solid var(--hv-line); border-radius:var(--hv-radius); padding:20px; background:var(--hv-surface); }
.hv-related-card a { color:var(--hv-ink); text-decoration:none; }
.hv-related-card a:hover { text-decoration:underline; }

/* Archives */
.hv-archive-hero { padding-top: clamp(3.5rem,7vw,6rem); padding-bottom: clamp(2.5rem,5vw,4rem); }
.hv-archive-grid .wp-block-post-template { gap:18px; }
.hv-archive-grid .wp-block-post { padding:24px; border:1px solid var(--hv-line); border-radius:var(--hv-radius); background:var(--hv-surface); }

@media (max-width: 980px) {
  .hv-hero-top { grid-template-columns: 1fr 42%; min-height: 390px; }
  .hv-hero-copy { padding-left: 24px; padding-right: 32px; }
  .hv-question-grid.wp-block-columns, .hv-topic-grid.wp-block-columns { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hv-question-grid .wp-block-column:last-child, .hv-topic-grid .wp-block-column:last-child { grid-column: span 2; }
  .hv-featured { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 781px) {
  .hv-header-inner { min-height:56px; }
  .hv-site-header .wp-block-navigation__responsive-container.is-menu-open { padding:24px; background:var(--hv-paper); }
  .hv-hero-top { display:block; min-height:0; }
  .hv-hero-copy { padding: 48px 20px 40px; }

  .hv-hero-visual { padding: 0 20px; }
  .hv-hero-image, .hv-hero-image img { border-radius: var(--hv-radius); }
  .hv-hero-image img { min-height: 0; aspect-ratio: 16/10; }
  .hv-question-wrap { margin: 18px auto 0; padding: 0 20px; }
  .hv-question-grid.wp-block-columns { grid-template-columns: 1fr; }
  .hv-question-grid .wp-block-column:last-child { grid-column:auto; }
  .hv-question-card { min-height:0; padding:16px 16px 16px 52px; }
  .hv-topic-wrap { padding:0 20px; }
  .hv-topic-grid.wp-block-columns { grid-template-columns: repeat(2,minmax(0,1fr)); gap:12px; }
  .hv-topic-grid .wp-block-column:last-child {
    grid-column: 1 / -1;
    width: calc((100% - 12px) / 2);
    justify-self: center;
  }
  .hv-topic-card { min-height: 235px; padding: 104px 16px 22px; }
  .hv-topic-card .hv-card-icon { top: 18px; width: 72px; height: 72px; }
  .hv-featured-copy .wp-block-post-title,
  .hv-featured-copy h2 { font-size: clamp(2.15rem, 9vw, 2.55rem) !important; line-height: 1.02; }
  .hv-section { padding-inline:20px; margin-top:44px; }
  .hv-featured { display:block; }
  .hv-featured .wp-block-post-featured-image img, .hv-featured-demo-image img { min-height:0; aspect-ratio:16/10; }
  .hv-featured-copy { padding:28px 24px 32px; }
  .hv-card-grid .wp-block-post-template, .hv-research-preview { grid-template-columns:1fr; }
  .hv-method { margin-top:44px; padding:0 20px; }
  .hv-method .wp-block-columns { display:block; }
  .hv-method-item { grid-template-columns:64px minmax(0,1fr); padding:18px 0; column-gap:16px; }
  .hv-method-item .hv-card-icon { width:60px; height:60px; }
  .hv-method-item + .hv-method-item { border-left:0; border-top:1px solid var(--hv-line); padding-left:0; }
  .hv-start-grid { display:block; }
  .hv-start-grid > .wp-block-column + .wp-block-column { margin-top:14px; }
  .hv-person { width: calc(100% - 40px); margin-left:auto; margin-right:auto; }
  .hv-person > .wp-block-columns { display:block; }
  .hv-person-placeholder { min-height:220px; border-right:0; border-bottom:1px solid var(--hv-line); }

  .hv-site-footer { padding-top: 36px; padding-bottom: 24px; }
  .hv-footer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 26px 22px;
    margin-bottom: 28px;
  }
  .hv-footer-grid > .wp-block-column { margin: 0; min-width: 0; }
  .hv-footer-grid > .wp-block-column:first-child { grid-column: 1 / -1; }
  .hv-footer-grid > .wp-block-column:last-child { grid-column: 1 / -1; }
  .hv-footer-grid h3 { margin: 0 0 10px; }
  .hv-footer-grid p { margin: 0; line-height: 1.55; }
  .hv-site-footer .wp-block-separator { margin-top: 0; margin-bottom: 22px; }
  .hv-site-footer > .wp-block-group:last-child { gap: 12px; }
  .hv-site-footer > .wp-block-group:last-child p { margin: 0; line-height: 1.55; }
  .hv-related-grid { grid-template-columns:1fr; }
}

@media (max-width: 520px) {
  .hv-site-header .wp-block-search__button { min-width: 36px; min-height: 36px; }


  .hv-person-links { gap:14px; flex-direction:column; }
  .hv-footer-grid { gap: 22px 18px; }
}



@media (max-width: 781px) {
  :root {
    --wp--preset--font-size--hero: clamp(2.5rem, 11vw, 3.5rem);
    --wp--preset--font-size--topic-title: 1.16rem;
    --wp--preset--font-size--person-title: clamp(2rem, 8vw, 2.35rem);
  }
}

/* v0.4 dynamic article system */
.hv-empty-state {
  margin: 10px 0 0;
  padding: 22px 24px;
  border: 1px dashed var(--hv-line);
  border-radius: var(--hv-radius);
  color: var(--hv-muted);
  background: rgba(255,255,255,.35);
}
.hv-home-research .hv-section-title-row {
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:20px;
}
.hv-home-research .hv-section-title-row h2,
.hv-home-research .hv-section-title-row p { margin:0; }
.hv-research-dynamic-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
  margin-top:26px;
}
.hv-research-dynamic-grid .hv-research-card {
  overflow:hidden;
  padding:0 0 20px;
  border:1px solid var(--hv-line);
  border-radius:var(--hv-radius);
  background:var(--hv-surface);
}
.hv-research-card-image { display:block; }
.hv-research-card-image img {
  display:block;
  width:100%;
  aspect-ratio:2244/701;
  object-fit:cover;
}
.hv-research-dynamic-grid .hv-research-card > :not(.hv-research-card-image) {
  margin-left:20px;
  margin-right:20px;
}
.hv-research-dynamic-grid .hv-kicker { margin-top:18px; margin-bottom:8px; color:var(--hv-clay); }
.hv-research-dynamic-grid h3 { margin-top:0; margin-bottom:14px; }
.hv-research-dynamic-grid h3 a { color:var(--hv-ink); text-decoration:none; }
.hv-research-dynamic-grid p { color:var(--hv-muted); }
.hv-card-meta { color:var(--hv-muted); font-size:.82rem; line-height:1.4; }
.hv-featured-media {
  width:100%;
  height:100%;
  display:block;
  overflow:hidden;
}
.hv-featured-media a,
.hv-featured-media img {
  width:100%;
  height:100%;
  display:block;
}
.hv-featured-media img {
  object-fit:cover;
  object-position:center center;
}
.hv-featured-copy h2 a { color:var(--hv-ink); text-decoration:none; }
.hv-featured-excerpt { color:var(--hv-muted); }

/* Topic + Articles archives */
.hv-archive-hero {
  max-width: 780px;
  margin-left:0;
  padding-top:clamp(3rem,6vw,5rem);
  padding-bottom:22px;
}
.hv-archive-hero h1 { margin-bottom:14px; }
.hv-archive-hero > p { margin-top:0; }
.hv-archive-tools { margin-bottom:30px; }
.hv-archive-search {
  display:flex;
  width:min(100%,760px);
  gap:10px;
  margin-top:8px;
}
.hv-archive-search input[type="search"] {
  flex:1 1 auto;
  min-width:0;
  min-height:48px;
  padding:10px 15px;
  border:1px solid var(--hv-line);
  border-radius:var(--hv-radius);
  background:var(--hv-surface);
  color:var(--hv-ink);
  font:inherit;
}
.hv-archive-search button {
  min-height:48px;
  padding:10px 22px;
  border:1px solid var(--hv-forest);
  border-radius:var(--hv-radius);
  background:var(--hv-forest);
  color:#fff;
  font:inherit;
  cursor:pointer;
}
.hv-archive-count { margin:12px 0 0; color:var(--hv-muted); font-size:.92rem; }
.hv-archive-grid .wp-block-post-template {
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:20px;
}
.hv-archive-grid .wp-block-post {
  overflow:hidden;
  padding:0 0 20px;
  border:1px solid var(--hv-line);
  border-radius:var(--hv-radius);
  background:var(--hv-surface);
}
.hv-archive-grid .wp-block-post > :not(.wp-block-post-featured-image) {
  margin-left:20px;
  margin-right:20px;
}
.hv-archive-grid .wp-block-post-featured-image { margin:0 0 18px !important; }
.hv-archive-grid .wp-block-post-featured-image img {
  width:100%;
  aspect-ratio:3/2;
  object-fit:cover;
  display:block;
}
.hv-archive-grid .taxonomy-artikeltyp,
.hv-archive-grid .taxonomy-amne {
  margin-top:0;
  margin-bottom:8px;
  color:var(--hv-clay);
  font-size:.76rem;
  text-transform:uppercase;
  letter-spacing:.05em;
  font-weight:650;
}
.hv-archive-grid .wp-block-post-title { margin-top:0; margin-bottom:12px; line-height:1.16; }
.hv-archive-grid .wp-block-post-title a { color:var(--hv-ink); text-decoration:none; }
.hv-archive-grid .wp-block-post-excerpt { color:var(--hv-muted); margin-bottom:14px; }
.hv-archive-grid .wp-block-query-pagination { margin-top:34px; gap:12px; }
.hv-archive-grid .wp-block-query-pagination a {
  display:inline-flex;
  align-items:center;
  min-height:42px;
  padding:9px 16px;
  border:1px solid var(--hv-line);
  border-radius:var(--hv-radius);
  color:var(--hv-forest);
  text-decoration:none;
  background:var(--hv-surface);
}

/* Article main image */
.hv-article-main-image {
  width:min(100%,900px);
  margin:28px auto 38px;
}
.hv-article-main-image img {
  width:100%;
  aspect-ratio:3/2;
  object-fit:cover;
  border-radius:var(--hv-radius);
  display:block;
}

/* Footer alignment + final links */
.hv-site-footer .alignwide {
  width:min(calc(100% - 48px), var(--hv-wide));
  max-width:var(--hv-wide);
  margin-left:auto;
  margin-right:auto;
}

@media (max-width: 980px) {
  .hv-archive-grid .wp-block-post-template { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 781px) {
  .hv-research-dynamic-grid { grid-template-columns:1fr; }
  .hv-home-research .hv-section-title-row { display:block; }
  .hv-home-research .hv-section-title-row p { margin-top:12px; }
  .hv-archive-hero { padding-top:42px; }
  .hv-archive-search { width:100%; }
  .hv-site-footer .alignwide { width:calc(100% - 40px); }
}
@media (max-width: 560px) {
  .hv-archive-grid .wp-block-post-template { grid-template-columns:1fr; }
  .hv-archive-search { display:grid; grid-template-columns:1fr auto; gap:8px; }
  .hv-archive-search button { padding-inline:18px; }
}


/* 0.4.5 — metadata och Läs mer på samma rad. */
.hv-card-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-top:12px;
}
.hv-card-footer .hv-card-meta,
.hv-card-footer .hv-demo-meta { margin:0; }
.hv-card-readmore { margin-top:0; flex:0 0 auto; }
.hv-card-readmore a {
  color: var(--hv-forest);
  font-weight: 700;
  text-decoration: none;
}
.hv-card-readmore a:hover,
.hv-card-readmore a:focus-visible { text-decoration: underline; }

@media (max-width: 420px) {
  .hv-card-footer { gap:10px; }
  .hv-card-footer .hv-card-meta,
  .hv-card-footer .hv-demo-meta { font-size:.76rem; }
}

/* 0.4.6 — tydlig CTA + hela Börja här-kortet klickbart. */
.hv-card-footer {
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  column-gap:14px;
  width:100%;
}
.hv-card-footer .hv-card-meta,
.hv-card-footer .hv-demo-meta,
.hv-card-footer .hv-card-readmore {
  margin-top:0 !important;
  margin-bottom:0 !important;
}
.hv-card-footer .hv-card-readmore { justify-self:end; }

/* The existing title link becomes a full-card overlay, so image, text and arrow all click. */
.hv-start-card { cursor:pointer; }
.hv-start-card h3 a::after {
  content:"";
  position:absolute;
  inset:0;
  z-index:5;
}
.hv-start-card::after { pointer-events:none; }

@media (max-width:420px) {
  .hv-card-footer { column-gap:8px; }
}

/* 0.4.7 — prevent CTA footer from overflowing research cards. */
.hv-research-dynamic-grid .hv-card-footer {
  width:auto !important;
  min-width:0;
}
.hv-research-dynamic-grid .hv-card-footer .hv-card-meta {
  min-width:0;
}
.hv-research-dynamic-grid .hv-card-footer .hv-card-readmore {
  white-space:nowrap;
}

/* 0.4.8 — samlad finjustering av startsida och artikelkort. */

/* Säker CTA-rad i både Nytt i forskningen och artikel-/ämnesarkiven. */
.hv-research-dynamic-grid .hv-card-footer,
.hv-archive-grid .hv-card-footer {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content !important;
  align-items: center;
  column-gap: 10px;
  width: calc(100% - 40px) !important;
  max-width: calc(100% - 40px) !important;
  margin-left: 20px !important;
  margin-right: 20px !important;
  box-sizing: border-box;
}
.hv-research-dynamic-grid .hv-card-footer .hv-card-meta,
.hv-archive-grid .hv-card-footer .hv-card-meta {
  min-width: 0;
  margin: 0 !important;
}
.hv-research-dynamic-grid .hv-card-footer .hv-card-readmore,
.hv-archive-grid .hv-card-footer .hv-card-readmore {
  justify-self: end;
  margin: 0 !important;
  white-space: nowrap;
}
.hv-research-dynamic-grid .hv-card-footer .hv-card-readmore a,
.hv-archive-grid .hv-card-footer .hv-card-readmore a {
  white-space: nowrap;
}

/* Samma princip på den stora utvalda artikeln. */
.hv-featured-footer {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content !important;
  align-items: center;
  column-gap: 16px;
  width: 100% !important;
  margin-top: 16px !important;
}
.hv-featured-footer .hv-demo-meta { min-width: 0; margin: 0 !important; }
.hv-featured-footer .hv-card-readmore {
  justify-self: end;
  margin: 0 !important;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .hv-research-dynamic-grid .hv-card-footer,
  .hv-archive-grid .hv-card-footer {
    column-gap: 8px;
  }
}

/* 0.5.1 — mobile gutters for article and archive layouts. */
@media (max-width: 781px) {
  /* Keep headings, metadata and body copy away from the screen edge.
     The article hero image intentionally remains full-width. */
  .hv-article-header,
  .hv-article-body {
    width: calc(100% - 40px);
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  /* The meta bar is injected between the main image and article body. */
  .hv-article-shell > .hv-meta-bar {
    width: calc(100% - 40px);
    margin-left: auto;
    margin-right: auto;
  }

  /* Archive/topic intro, search/count and article grid use the same 20px mobile gutter. */
  main.alignwide > .hv-archive-hero,
  main.alignwide > .hv-archive-tools,
  main.alignwide > .hv-archive-grid {
    width: calc(100% - 40px);
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }
}


/* 0.5.2 — progressive article loading + proper article-only search results. */
.hv-archive-grid .wp-block-query-pagination-previous {
  display: none !important;
}
.hv-archive-grid .wp-block-query-pagination {
  justify-content: center;
}
.hv-archive-grid .wp-block-query-pagination-next.is-loading {
  opacity: .65;
  pointer-events: none;
}
.hv-archive-grid .wp-block-query-pagination-next[aria-busy="true"] {
  cursor: wait;
}
.hv-search-page {
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.hv-search-page > .wp-block-query-title {
  margin-bottom: 22px;
}
.hv-search-page > .wp-block-search {
  width: min(100%, 760px);
  margin-bottom: 30px;
}
.hv-search-page > .wp-block-search .wp-block-search__inside-wrapper {
  display: flex;
  gap: 10px;
}
.hv-search-page > .wp-block-search .wp-block-search__input {
  min-height: 48px;
  padding: 10px 15px;
  border: 1px solid var(--hv-line);
  border-radius: var(--hv-radius);
  background: var(--hv-surface);
  color: var(--hv-ink);
}
.hv-search-page > .wp-block-search .wp-block-search__button {
  min-width: 54px;
  min-height: 48px;
  margin-left: 0;
  border: 1px solid var(--hv-forest);
  border-radius: var(--hv-radius);
  background: var(--hv-forest);
  color: #fff;
}
.hv-archive-grid .wp-block-post-title a:hover,
.hv-archive-grid .wp-block-post-title a:focus-visible,
.hv-archive-grid .taxonomy-amne a:hover,
.hv-archive-grid .taxonomy-amne a:focus-visible {
  text-decoration: underline;
}
.hv-newly-loaded {
  animation: hvFadeIn .18s ease-out;
}
@keyframes hvFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hv-newly-loaded { animation: none; }
}
@media (max-width: 781px) {
  .hv-search-page {
    width: calc(100% - 40px);
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    padding-top: 42px;
  }
}
@media (max-width: 560px) {
  .hv-search-page > .wp-block-search .wp-block-search__inside-wrapper {
    gap: 8px;
  }
}
