/* ─────────────────────────────────────────────────────────────
   Blog — /blogs/, the category pages and posts (inc/blog.php).
   Same voice as Anmeldelser: purple eyebrow, Fredoka headline,
   Poppins everywhere else, white rounded cards on the warm page.
   ───────────────────────────────────────────────────────────── */

.dp-blog-page {
  background: var(--dp-bg);
  padding: 64px 20px 112px;
}

.dp-blog-page__inner {
  width: min(1120px, calc(100vw - 40px));
  margin: 0 auto;
}

/* ── Header ── */

.dp-blog-head {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 2rem;
}

.dp-blog-head__eyebrow {
  margin: 0 0 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dp-accent);
}

.dp-blog-head__title {
  margin: 0 0 0.875rem;
  font-family: "Fredoka", "Poppins", sans-serif;
  font-size: clamp(2.25rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--dp-text);
}

.dp-blog-head__tagline {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--dp-text-soft);
}

/* ── Category pills ── */

.dp-blog-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0 auto 2.75rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.dp-blog-tabs::-webkit-scrollbar {
  display: none;
}

/* Centred while they fit, scrollable from the left edge when they don't. */
.dp-blog-tabs__item:first-child {
  margin-left: auto;
}

.dp-blog-tabs__item:last-child {
  margin-right: auto;
}

.dp-blog-tabs__item {
  flex: none;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--dp-border);
  border-radius: 999px;
  background: #fff;
  color: var(--dp-text-soft);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.dp-blog-tabs__item:hover {
  border-color: rgba(106, 90, 224, 0.45);
  color: var(--dp-accent-strong);
}

.dp-blog-tabs__item.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--dp-accent), var(--dp-accent-strong));
  color: #fff;
  box-shadow: 0 8px 20px rgba(106, 90, 224, 0.28);
}

/* ── Grid ── */

.dp-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 28px;
}

/* ── Picture frame (inc/blog.php decides crop or whole) ── */

.dp-blog-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f1eefb;
}

.dp-blog-media__image,
.dp-blog-media__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
}

.dp-blog-media__image {
  object-fit: cover;
  transition: transform 0.45s ease;
}

.dp-blog-media.is-whole .dp-blog-media__image {
  object-fit: contain;
}

/* A blurred copy of the picture fills the frame around a picture shown whole. */
.dp-blog-media__backdrop {
  inset: -32px;
  width: calc(100% + 64px);
  height: calc(100% + 64px);
  object-fit: cover;
  filter: blur(24px) saturate(1.2);
  opacity: 0.6;
}

.dp-blog-media--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(106, 90, 224, 0.35);
  font-size: 2.6rem;
}

/* ── Card ── */

.dp-blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--dp-border-soft);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(19, 36, 64, 0.04), 0 12px 32px rgba(57, 44, 115, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dp-blog-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px 24px 24px;
}

.dp-blog-card__meta,
.dp-article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--dp-text-muted);
  font-size: 0.8125rem;
}

.dp-blog-card__category,
.dp-article__category {
  position: relative;
  z-index: 2;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(106, 90, 224, 0.1);
  color: var(--dp-accent-strong);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.16s ease;
}

.dp-blog-card__category:hover,
.dp-article__category:hover {
  background: rgba(106, 90, 224, 0.18);
}

.dp-blog-card__title {
  margin: 12px 0 8px;
  font-family: "Poppins", sans-serif;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--dp-text);
}

.dp-blog-card__link {
  color: inherit;
  text-decoration: none;
}

/* The title link covers the whole card. */
.dp-blog-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.dp-blog-card__link:focus-visible {
  outline: none;
}

.dp-blog-card:has(.dp-blog-card__link:focus-visible) {
  outline: 3px solid var(--dp-accent);
  outline-offset: 3px;
}

.dp-blog-card__excerpt {
  display: -webkit-box;
  margin: 0 0 18px;
  overflow: hidden;
  color: var(--dp-text-soft);
  font-size: 0.9375rem;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.dp-blog-card__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: var(--dp-accent-strong);
  font-size: 0.9rem;
  font-weight: 600;
}

.dp-blog-card__arrow {
  transition: transform 0.2s ease;
}

@media (hover: hover) {
  .dp-blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 2px 4px rgba(19, 36, 64, 0.04), 0 22px 48px rgba(57, 44, 115, 0.13);
  }

  .dp-blog-card:hover .dp-blog-media__image {
    transform: scale(1.035);
  }

  .dp-blog-card:hover .dp-blog-card__arrow {
    transform: translateX(4px);
  }
}

/* The newest post on a listing: picture left, text right. */
@media (min-width: 750px) {
  .dp-blog-card--featured {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  }

  .dp-blog-card--featured .dp-blog-media {
    height: 100%;
  }

  .dp-blog-card--featured .dp-blog-card__body {
    justify-content: center;
    padding: 40px 44px;
  }

  .dp-blog-card--featured .dp-blog-card__title {
    margin: 16px 0 12px;
    font-size: clamp(1.45rem, 2.4vw, 1.875rem);
    font-weight: 700;
    line-height: 1.25;
  }

  .dp-blog-card--featured .dp-blog-card__excerpt {
    margin-bottom: 24px;
    font-size: 1rem;
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }

  .dp-blog-card--featured .dp-blog-card__more {
    margin-top: 0;
  }
}

/* ── Empty category ── */

.dp-blog-empty {
  padding: 3rem 1.5rem 4rem;
  border: 1px dashed var(--dp-border);
  border-radius: 22px;
  background: #fff;
  text-align: center;
}

.dp-blog-empty__symbol {
  margin-bottom: 1rem;
  color: rgba(106, 90, 224, 0.4);
  font-size: 2.4rem;
  line-height: 1;
}

.dp-blog-empty__heading {
  margin: 0 0 0.5rem;
  font-family: "Fredoka", "Poppins", sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--dp-text);
}

.dp-blog-empty__text {
  margin: 0;
  color: var(--dp-text-soft);
  line-height: 1.65;
}

/* ── Article ── */

.dp-article-page {
  background: #fff;
  padding: 56px 20px 0;
}

.dp-article {
  max-width: 980px;
  margin: 0 auto;
}

.dp-article__head,
.dp-article__content,
.dp-article__back {
  max-width: 720px;
  margin-right: auto;
  margin-left: auto;
}

.dp-article__head {
  margin-bottom: 32px;
}

.dp-article__category {
  display: inline-block;
}

.dp-article__title {
  margin: 16px 0 14px;
  font-family: "Fredoka", "Poppins", sans-serif;
  font-size: clamp(2rem, 4.4vw, 2.875rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--dp-text);
}

.dp-article__meta {
  margin: 0;
  font-size: 0.875rem;
}

/* Hero: the picture's own shape, capped in height; whatever the cap leaves
   at the sides is the blurred copy. */
.dp-blog-media--hero {
  aspect-ratio: var(--dp-media-ratio, 16 / 9);
  max-height: min(560px, 72vh);
  width: 100%;
  margin: 0 auto 44px;
  border-radius: 26px;
}

.dp-blog-media--hero .dp-blog-media__image {
  object-fit: contain;
}

.dp-article__content {
  color: rgba(19, 36, 64, 0.84);
  font-size: 1.0625rem;
  line-height: 1.8;
}

.dp-article__content h2 {
  margin: 2.2em 0 0.6em;
  font-size: clamp(1.4rem, 2.6vw, 1.7rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--dp-text);
}

.dp-article__content h3 {
  margin: 1.9em 0 0.5em;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--dp-text);
}

.dp-article__content h4 {
  margin: 1.6em 0 0.4em;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dp-text);
}

.dp-article__content > :first-child {
  margin-top: 0;
}

.dp-article__content p,
.dp-article__content ul,
.dp-article__content ol {
  margin: 0 0 1.15em;
}

.dp-article__content li {
  margin-bottom: 0.4em;
}

.dp-article__content li::marker {
  color: var(--dp-accent);
}

.dp-article__content strong {
  color: var(--dp-text);
  font-weight: 600;
}

.dp-article__content a {
  color: var(--dp-accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.dp-article__content a:hover {
  text-decoration-thickness: 2px;
}

.dp-article__content blockquote {
  margin: 1.8em 0;
  padding: 18px 22px;
  border-left: 3px solid var(--dp-accent);
  border-radius: 0 16px 16px 0;
  background: rgba(106, 90, 224, 0.06);
  color: var(--dp-text);
}

.dp-article__content blockquote p:last-child {
  margin-bottom: 0;
}

.dp-article__back {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--dp-border-soft);
}

.dp-article__back-link {
  color: var(--dp-accent-strong);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.dp-article__back-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Read next (end of an article) ── */

.dp-article-related {
  margin: 72px -20px 0;
  padding: 64px 20px 104px;
  background: var(--dp-bg);
}

.dp-article-related__title {
  width: min(1120px, 100%);
  margin: 0 auto 28px;
  font-family: "Fredoka", "Poppins", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--dp-text);
}

.dp-blog-grid--related {
  width: min(1120px, 100%);
  margin: 0 auto;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.dp-article-page:not(:has(.dp-article-related)) {
  padding-bottom: 104px;
}

/* ── Phones ── */

@media (max-width: 749px) {
  .dp-blog-page {
    padding: 36px 14px 72px;
  }

  .dp-blog-page__inner {
    width: 100%;
  }

  .dp-blog-head {
    margin-bottom: 1.5rem;
  }

  .dp-blog-head__tagline {
    font-size: 1rem;
  }

  /* All four fit on a 390 px phone; narrower ones scroll. */
  .dp-blog-tabs {
    gap: 0.3rem;
    margin: 0 -14px 1.75rem;
    padding: 2px 14px 6px;
  }

  .dp-blog-tabs__item {
    padding: 0.5rem 0.72rem;
    font-size: 0.8rem;
  }

  .dp-blog-grid {
    gap: 18px;
  }

  .dp-blog-card {
    border-radius: 20px;
  }

  .dp-blog-card__body {
    padding: 18px 18px 20px;
  }

  .dp-blog-card__title {
    margin-top: 10px;
    font-size: 1.125rem;
  }

  .dp-blog-card__excerpt {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .dp-article-page {
    padding: 32px 14px 0;
  }

  .dp-article__head {
    margin-bottom: 24px;
  }

  .dp-blog-media--hero {
    max-height: 80vh;
    margin-bottom: 28px;
    border-radius: 18px;
  }

  .dp-article__content {
    font-size: 1rem;
    line-height: 1.75;
  }

  .dp-article-related {
    margin: 56px -14px 0;
    padding: 44px 14px 72px;
  }

  .dp-article-related__title {
    margin-bottom: 18px;
  }

  /* Read next as compact rows: thumbnail and title. */
  .dp-blog-grid--related {
    gap: 12px;
  }

  .dp-blog-grid--related .dp-blog-card {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    border-radius: 16px;
  }

  .dp-blog-grid--related .dp-blog-media {
    height: 100%;
    min-height: 104px;
    aspect-ratio: auto;
  }

  .dp-blog-grid--related .dp-blog-card__body {
    justify-content: center;
    padding: 12px 14px;
  }

  .dp-blog-grid--related .dp-blog-card__title {
    margin: 8px 0 0;
    font-size: 0.98rem;
    line-height: 1.35;
  }

  .dp-blog-grid--related .dp-blog-card__excerpt,
  .dp-blog-grid--related .dp-blog-card__more {
    display: none;
  }

  .dp-article-page:not(:has(.dp-article-related)) {
    padding-bottom: 72px;
  }
}
