/* The blog: /blog (cards, the pager) and a post (the text, its sets by theme, "I dette indlæg").
   A post's text is HTML from the old CMS, so .post-body styles plain tags. */

/* CARDS: the banner cropped to 16:9, date, title, a few lines of the text */
.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--ink);
  text-decoration: none;
}

.blog-card:hover { color: var(--ink); border-color: var(--line-strong); }
.blog-card:hover .blog-card__title { color: var(--cta); }
.blog-card__image { position: relative; flex-shrink: 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--line); }
.blog-card__image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.blog-card__body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 14px 16px 18px; }
.blog-card time { font-size: 13px; line-height: 18px; color: var(--ink-3); }

.blog-card__title {
  display: -webkit-box;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.blog-card__excerpt {
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  line-height: 22px;
  color: var(--ink-2);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.blog-card--large .blog-card__title { font-size: 26px; }
.blog-card__more { margin-top: auto; padding-top: 6px; font-size: 15px; font-weight: 700; color: var(--cta); }

.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

/* /BLOG */
.blog-page, .post-page { display: flex; flex-direction: column; gap: 32px; padding-top: 20px; padding-bottom: 64px; }
.blog-head { display: flex; flex-direction: column; gap: 8px; }
.blog-head__title { margin: 0; font-family: var(--font-display); font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.blog-head p { margin: 0; font-size: 16px; line-height: 24px; color: var(--ink-2); }

.blog-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
.blog-top__side { display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 20px; }
.blog-more { display: flex; flex-direction: column; gap: 16px; }
.blog-h2 { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.015em; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }

.pager__page, .pager__edge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.pager__page { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.pager__page:hover { border-color: var(--ink); color: var(--ink); }
.pager__page[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager__edge { color: var(--ink); }
.pager__edge[aria-disabled] { color: var(--placeholder-line); }
.pager__gap { padding: 0 4px; color: var(--ink-3); }

/* A POST: the text in a white sheet, the contents beside it */
.post-page .crumbs { margin-bottom: -12px; }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 28px; }
.post-layout--single { grid-template-columns: minmax(0, 900px); }

.post {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
  padding: 40px 48px;
  background: var(--surface);
  border-radius: var(--r-xl);
}

.post__head { display: flex; flex-direction: column; gap: 14px; }
.post__title { margin: 0; font-family: var(--font-display); font-size: 42px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.post__byline { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-3); }
.post__byline strong { color: var(--ink); }

.post__avatar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--ink);
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.post__banner { display: block; width: 100%; height: auto; border-radius: var(--r-lg); }

/* The text: paragraphs, sections (<h2>), lists, pictures; the first paragraph leads.
   Ordinary flow, not flex: older posts have text and links straight in the body, between <br>s */
.post-body { min-width: 0; font-size: 17px; line-height: 28px; overflow-wrap: anywhere; }
.post-body > * { margin: 0 0 14px; }
.post-body > :last-child { margin-bottom: 0; }
.post-body > p:empty { display: none; }
.post-body > p:first-child { font-size: 20px; line-height: 30px; font-weight: 600; }
.post-body h2 { margin-top: 28px; padding-top: 6px; font-family: var(--font-display); font-size: 24px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; scroll-margin-top: 16px; }
.post-body a { font-weight: 600; color: var(--cta); }
.post-body ul, .post-body ol { display: flex; flex-direction: column; gap: 6px; padding-left: 22px; }
.post-body img { max-width: 100%; height: auto; border-radius: var(--r-md); }
.post-body iframe { max-width: 100%; }

/* A theme's sets: folds out; every row links to the set (or straight to the shop) */
.post-themes { display: flex; flex-wrap: wrap; gap: 8px; }

.post-themes a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.post-themes a:hover { border-color: var(--ink); color: var(--ink); }
.post-themes span { font-weight: 600; color: var(--ink-3); }

.post-sets { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; scroll-margin-top: 16px; }
.post-body > .post-sets { margin-bottom: 8px; }

.post-sets summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  list-style: none;
  cursor: pointer;
}

.post-sets summary::-webkit-details-marker { display: none; }
.post-sets[open] summary { border-bottom: 1px solid var(--line); }
.post-sets__title { flex: 1; margin: 0; font-size: 17px; font-weight: 800; line-height: 1.3; }
.post-sets__count { font-size: 14px; color: var(--ink-3); white-space: nowrap; }
.post-sets__chevron { flex-shrink: 0; transition: transform 0.15s; }
.post-sets[open] .post-sets__chevron { transform: rotate(180deg); }

.post-body .post-sets__list { gap: 0; margin: 0; padding: 0; list-style: none; }
.post-sets__list li { padding: 12px 16px; font-size: 15px; line-height: 22px; }
.post-sets__list li + li { border-top: 1px solid var(--line-soft); }
.post-sets__list a { color: var(--ink); text-decoration: none; }
.post-sets__list a:hover { color: var(--cta); }
.post-sets__list strong { color: var(--cta); }

.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 8px; border-top: 1px solid var(--line-soft); }

.post-nav__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
}

.post-nav__link:hover { color: var(--ink); background: var(--page); }
.post-nav__link span { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.post-nav__link strong { font-size: 15px; line-height: 21px; }
.post-nav__link--next { text-align: right; }

.post-aside { position: sticky; top: 20px; }
.post-toc { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--surface); border-radius: 18px; }
.post-toc strong { font-size: 15px; }
.post-toc ol { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 20px; }
.post-toc li { padding: 8px 0; }
.post-toc li + li { border-top: 1px solid var(--line-soft); }
.post-toc a { font-weight: 600; color: var(--ink); text-decoration: none; }
.post-toc a:hover { color: var(--cta); }

.post-section { display: flex; flex-direction: column; gap: 16px; }
.post-section__head { display: flex; flex-direction: column; gap: 4px; }
.post-section__head--row { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.post-section__title { margin: 0; font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -0.015em; }
.post-section__head p { margin: 0; font-size: 15px; color: var(--ink-3); }

@media (max-width: 1023px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-top { grid-template-columns: minmax(0, 1fr); }
  .blog-top__side { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; }
  .post-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; }
  .post { padding: 32px; }
}

@media (max-width: 767px) {
  .blog-page, .post-page { gap: 20px; padding-top: 14px; padding-bottom: 36px; }
  .blog-head__title { font-size: 38px; }

  /* Phones: the newest post stays a card, the rest are rows with the picture beside the title */
  .blog-top, .blog-top__side, .blog-grid { display: flex; flex-direction: column; gap: 8px; }
  .blog-more { gap: 8px; }
  .blog-more .blog-h2 { display: none; }

  .blog-card:not(.blog-card--large) { flex-direction: row; align-items: center; gap: 14px; padding: 10px; border-radius: 14px; }
  .blog-card:not(.blog-card--large) .blog-card__image { width: 112px; height: 72px; aspect-ratio: auto; border-radius: 10px; }
  .blog-card:not(.blog-card--large) .blog-card__body { gap: 4px; padding: 0; min-width: 0; }
  .blog-card:not(.blog-card--large) .blog-card__title { order: -1; font-family: var(--font-body); font-size: 15px; line-height: 21px; font-weight: 700; letter-spacing: 0; }
  .blog-card:not(.blog-card--large) .blog-card__excerpt { display: none; }
  .blog-card--large .blog-card__title { font-size: 22px; }
  .blog-top { margin-bottom: 4px; }

  .pager__word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  .post-page .crumbs { margin-bottom: -6px; }
  .post-layout, .post-layout--single { display: flex; flex-direction: column; align-items: stretch; gap: 20px; }
  .post { gap: 20px; padding: 20px 16px; }
  .post__title { font-size: 30px; }
  .post-body { font-size: 16px; line-height: 26px; }
  .post-body > p:first-child { font-size: 18px; line-height: 27px; }
  .post-body h2 { font-size: 21px; }
  .post-themes { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; }
  .post-themes a { flex-shrink: 0; }
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-nav__link--next { text-align: left; }
  .post-aside { display: none; }
  .post-section__title { font-size: 26px; }
}
