/**
 * SGK Single Post — normalisert utseende for alle nyhetsartikler.
 * Sørger for at gamle migrerte poster (inline HTML, blandede bildedimensjoner,
 * eldre WP-shortcodes) rendrer konsistent og lesbart.
 */

.sgk-single {
  --sgk-content-bg: #fff;
  --sgk-content-fg: #1a1d1b;
  --sgk-muted: #5a625e;
  --sgk-accent: #2a4d3a;
  --sgk-gold: #c9a961;

  background: var(--sgk-content-bg);
  color: var(--sgk-content-fg);
  padding: 32px 24px 80px;
}

.sgk-single__breadcrumb {
  max-width: 1200px;
  margin: 0 auto 24px;
}
.sgk-single__back a {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sgk-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.sgk-single__back a:hover {
  border-bottom-color: var(--sgk-gold);
}

/* Featured image — full-width hero med myk skygge */
.sgk-single .wp-block-post-featured-image {
  margin: 0 auto 24px;
  max-width: 1200px;
}
.sgk-single .wp-block-post-featured-image img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

/* Meta-rad: dato + kategori */
.sgk-single__meta {
  max-width: 760px;
  margin: 0 auto 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sgk-single__meta .sgk-single__date,
.sgk-single__meta .sgk-single__cat,
.sgk-single__meta time,
.sgk-single__meta a {
  color: var(--sgk-gold);
  text-decoration: none;
}
.sgk-single__meta .sgk-single__cat a:hover {
  text-decoration: underline;
}

/* Tittel */
.sgk-single__title {
  max-width: 760px;
  margin: 0 auto 32px;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.2;
  font-weight: 600;
  color: var(--sgk-content-fg);
}

/* Innholds-wrapper — det er her gamle migrerte poster rendrer */
.sgk-single__content {
  max-width: 760px;
  margin: 0 auto;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--sgk-content-fg);
}

/* Bilder inni innholdet — alle skal være responsive og sentrerte */
.sgk-single__content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 24px auto;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* Captions hvis det finnes */
.sgk-single__content .wp-caption,
.sgk-single__content figure {
  max-width: 100% !important;
  width: auto !important;
  margin: 28px auto;
}
.sgk-single__content figcaption,
.sgk-single__content .wp-caption-text {
  font-size: 13px;
  color: var(--sgk-muted);
  font-style: italic;
  text-align: center;
  margin-top: 8px;
  font-family: Inter, system-ui, sans-serif;
}

/* Avsnitt */
.sgk-single__content p {
  margin: 0 0 20px;
}

/* Lenker */
.sgk-single__content a {
  color: var(--sgk-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.sgk-single__content a:hover {
  color: var(--sgk-gold);
}

/* Overskrifter inni innholdet */
.sgk-single__content h2,
.sgk-single__content h3,
.sgk-single__content h4 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  margin: 36px 0 16px;
  line-height: 1.3;
  color: var(--sgk-content-fg);
}
.sgk-single__content h2 { font-size: 28px; }
.sgk-single__content h3 { font-size: 22px; }
.sgk-single__content h4 { font-size: 18px; }

/* Lister */
.sgk-single__content ul,
.sgk-single__content ol {
  margin: 0 0 20px 24px;
  padding: 0;
}
.sgk-single__content li {
  margin-bottom: 8px;
}

/* Blockquote */
.sgk-single__content blockquote {
  border-left: 4px solid var(--sgk-gold);
  margin: 28px 0;
  padding: 8px 20px;
  font-style: italic;
  color: var(--sgk-muted);
}

/* Tabeller (gamle scorekort etc.) */
.sgk-single__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
  font-family: Inter, system-ui, sans-serif;
}
.sgk-single__content th,
.sgk-single__content td {
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8df;
  text-align: left;
}
.sgk-single__content th {
  background: #f5efe3;
  font-weight: 600;
}

/* Embed-iframer */
.sgk-single__content iframe {
  max-width: 100%;
  margin: 24px 0;
  border-radius: 6px;
}

/* Strip lange inline-style="width: ..."px på bilder fra gamle WP-poster */
.sgk-single__content img[style*="width:"] {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
}
.sgk-single__content img.alignleft,
.sgk-single__content img.alignright {
  float: none;
  margin: 24px auto;
}

/* Wp-smiley emoji images injected by WP — skjul i innhold */
.sgk-single__content img.wp-smiley {
  display: none;
}

/* Separator */
.sgk-single__sep {
  max-width: 760px;
  margin: 48px auto;
  border: 0;
  border-top: 1px solid #e2e8df;
}

/* Footer-navigasjon */
.sgk-single__footer {
  max-width: 760px;
  margin: 0 auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sgk-single__footer a {
  color: var(--sgk-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.sgk-single__footer a:hover {
  border-bottom-color: var(--sgk-gold);
}

@media (max-width: 720px) {
  .sgk-single { padding: 24px 16px 60px; }
  .sgk-single__title { font-size: 28px; margin-bottom: 24px; }
  .sgk-single__content { font-size: 17px; }
  .sgk-single .wp-block-post-featured-image img { max-height: 320px; }
}
