/*
Theme Name: DigiGaming Blog
Theme URI: https://example.com/digigaming-blog
Author: ChrisProduction
Author URI: https://chrisproduction.com
Description: Et WordPress blogtema til DigiGaming med fokus på retro gaming, handhelds, reviews, guides og sammenligninger. Magasinlayout med Plus Jakarta Sans og Space Mono, flade farver og skarpe kanter.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: digigaming-blog
*/

/* ---------- Tokens ---------- */
:root {
  --paper: #f3f0e8;
  --surface: #ffffff;
  --ink: #111111;
  --ink-2: #3b3b3b;
  --muted: #6b6860;
  --line: #111111;
  --line-soft: #d9d4c7;

  --green: #45b982;
  --green-ink: #1d6b45;
  --yellow: #ffd23f;
  --coral: #ff6b4a;
  --blue: #7fb2ff;

  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --border: 2px solid var(--line);
  --max: 1240px;
  --gap: 28px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 800; letter-spacing: -.025em; line-height: 1.12; }
::selection { background: var(--green); color: var(--ink); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.site-wrap { width: min(calc(100% - 32px), var(--max)); margin: 0 auto; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; font-family: var(--font-mono); }
.skip-link:focus { left: 8px; }

.kicker {
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--green-ink);
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.topbar-inner { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; }
.topbar-tag { color: var(--green); }

/* ---------- Header ---------- */
.site-header { background: var(--paper); border-bottom: var(--border); position: sticky; top: 0; z-index: 40; }
.admin-bar .site-header { top: 32px; }
.header-inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo img, .brand .custom-logo { height: 40px; width: auto; max-width: 220px; }
.brand-mark {
  width: 34px; height: 34px;
  background: var(--ink);
  position: relative;
  flex: none;
}
.brand-mark::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: 6px; height: 12px;
  background: var(--green);
}
.brand-mark::after {
  content: ""; position: absolute; left: 6px; bottom: 6px; width: 10px; height: 4px;
  background: var(--green);
  box-shadow: 12px 0 0 var(--paper);
}
.brand-word, .footer-brand-word {
  display: inline-flex; align-items: baseline;
  font-weight: 800; letter-spacing: -.045em; line-height: 1;
}
.brand-word { font-size: 1.6rem; }
.brand-word .digi { color: var(--ink); }
.brand-word .gaming { color: var(--green-ink); }

.header-search { display: flex; border: var(--border); background: var(--surface); }
.header-search input {
  border: 0; background: transparent; padding: 0 12px; height: 40px; width: 220px;
  font-family: var(--font-mono); font-size: .85rem; color: var(--ink);
}
.header-search input:focus { outline: none; }
.header-search:focus-within { outline: 3px solid var(--green); outline-offset: 2px; }
.header-search button {
  border: 0; border-left: var(--border); background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: .8rem; font-weight: 700; text-transform: uppercase;
  padding: 0 14px; cursor: pointer;
}
.header-search button:hover { background: var(--green); color: var(--ink); }

.main-nav { border-top: var(--border); background: var(--surface); }
.main-nav ul { display: flex; list-style: none; padding: 0; margin: 0; overflow-x: auto; scrollbar-width: none; }
.main-nav ul::-webkit-scrollbar { display: none; }
.main-nav li { flex: none; }
.main-nav a {
  display: block;
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-right: 1px solid var(--line-soft);
  white-space: nowrap;
}
.main-nav li:first-child a { border-left: 1px solid var(--line-soft); }
.main-nav a:hover { background: var(--yellow); }
.main-nav .current-menu-item > a,
.main-nav .current-menu-parent > a { background: var(--ink); color: var(--paper); }
.main-nav .sub-menu { display: none; }

/* ---------- Category labels ---------- */
.cat-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  line-height: 1;
  padding: 6px 8px;
  background: var(--cat, var(--green));
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.cat-label:hover { background: var(--ink); color: var(--paper); }

.cat-reviews { --cat: var(--green); }
.cat-guides { --cat: var(--yellow); }
.cat-sammenligninger { --cat: var(--coral); }
.cat-nyheder { --cat: var(--blue); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: var(--border);
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }
.card-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: var(--border);
  background: var(--ink);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body .cat-label { align-self: flex-start; }
.card-title { margin: 0; font-size: 1.2rem; line-height: 1.22; }
.card-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.card-excerpt { margin: 0; color: var(--ink-2); font-size: .94rem; line-height: 1.55; }
.card-meta {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--line-soft);
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* Fallback media: flat colour block with a pixel handheld */
.card-fallback {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  background: var(--cat, var(--green));
}
.fb-device {
  display: block;
  position: relative;
  height: 74%;
  aspect-ratio: 5 / 7;
  background: var(--ink);
}
.fb-device > span { position: absolute; display: block; }
.fb-screen {
  left: 12%; right: 12%; top: 9%; height: 42%;
  background: var(--paper);
  border: 3px solid #333;
}
.fb-screen::after {
  content: ""; position: absolute; left: 16%; bottom: 18%; width: 18%; aspect-ratio: 1;
  background: var(--cat, var(--green));
}
.fb-dpad-h { left: 13%; top: 67%; width: 27%; height: 8%; background: var(--paper); }
.fb-dpad-v { left: 22.5%; top: 61.5%; width: 8%; height: 19%; background: var(--paper); }
.fb-btn-a { right: 13%; top: 62%; width: 12%; aspect-ratio: 1; background: var(--cat, var(--green)); }
.fb-btn-b { right: 30%; top: 70%; width: 12%; aspect-ratio: 1; background: var(--cat, var(--green)); }
.fb-slot { left: 36%; top: 88%; width: 28%; height: 3%; background: #444; }

/* Hero card */
.card--hero .card-media { aspect-ratio: 16 / 9; }
.card--hero .card-body { padding: 24px 26px 22px; gap: 14px; }
.card--hero .card-title { font-size: clamp(1.8rem, 3.4vw, 2.9rem); line-height: 1.05; letter-spacing: -.04em; }
.card--hero .card-excerpt { font-size: 1.05rem; max-width: 640px; }

/* List card (side column, sidebar) */
.card--list {
  flex-direction: row;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  padding: 14px 0;
  gap: 14px;
}
.card--list:hover { transform: none; box-shadow: none; }
.card--list:last-child { border-bottom: 0; }
.card--list .card-media { width: 38%; flex: none; border: var(--border); aspect-ratio: 4 / 3; }
.card--list .card-body { padding: 0; gap: 8px; }
.card--list .card-title { font-size: 1rem; line-height: 1.25; }
.card--list .card-meta { border-top: 0; padding-top: 0; }

/* ---------- Front page ---------- */
.featured {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: var(--gap);
  padding: 40px 0 24px;
}
.featured-main .card { height: 100%; }
.featured-side { border: var(--border); background: var(--surface); padding: 0 18px 4px; }
.block-label {
  margin: 0 -18px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.section { padding: 36px 0 28px; }
.section-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.section-head h2 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2.1rem); white-space: nowrap; }
.section-rule { flex: 1; height: 2px; background: var(--ink); }
.section-link {
  font-family: var(--font-mono); font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
  border: var(--border); padding: 6px 10px; background: var(--surface);
}
.section-link:hover { background: var(--ink); color: var(--paper); }

.post-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }

/* Band */
.band { background: var(--ink); color: var(--paper); margin: 40px 0 12px; border-top: var(--border); border-bottom: var(--border); }
.band-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 40px;
  align-items: center;
  padding: 56px 0;
}
.band .kicker { color: var(--green); }
.band h2 { margin: 10px 0 0; font-size: clamp(1.8rem, 3.4vw, 2.8rem); line-height: 1.02; letter-spacing: -.045em; }
.band p { margin: 0; color: #cfcbc0; }
.band-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 18px;
  border: 2px solid var(--paper);
  background: transparent; color: var(--paper);
  font-family: var(--font-mono); font-size: .82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
}
.button:hover { background: var(--paper); color: var(--ink); }
.button.primary { background: var(--green); border-color: var(--green); color: var(--ink); }
.button.primary:hover { background: var(--yellow); border-color: var(--yellow); }

/* Topics */
.category-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); padding-bottom: 40px; }
.category-box {
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px;
  border: var(--border);
  background: var(--surface);
  border-top: 10px solid var(--cat, var(--green));
  transition: transform .15s ease, box-shadow .15s ease;
}
.category-box:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }
.category-count { font-family: var(--font-mono); font-size: 2rem; font-weight: 700; line-height: 1; }
.category-box strong { font-size: 1.15rem; font-weight: 800; }
.category-box span:last-child { color: var(--muted); font-size: .9rem; }

/* ---------- Archive ---------- */
.archive-head { padding: 52px 0 28px; margin-bottom: 32px; border-bottom: var(--border); }
.archive-head h1 { margin: 10px 0 10px; font-size: clamp(2.2rem, 5vw, 3.8rem); letter-spacing: -.05em; line-height: 1; }
.archive-head p { margin: 0; color: var(--ink-2); max-width: 640px; }
.archive-head a { text-decoration: underline; }
.empty { font-family: var(--font-mono); grid-column: 1 / -1; }

.pagination { margin: 40px 0 72px; }
.pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; min-width: 42px; height: 42px; justify-content: center; padding: 0 12px;
  border: var(--border); background: var(--surface);
  font-family: var(--font-mono); font-size: .85rem; font-weight: 700;
}
.pagination .page-numbers.current, .pagination a.page-numbers:hover { background: var(--ink); color: var(--paper); }
.pagination .dots { border: 0; background: transparent; }

/* ---------- Single / page ---------- */
.article-head { padding: 52px 0 28px; max-width: 920px; }
.article-cats { margin-bottom: 18px; }
.article-head h1 { margin: 0; font-size: clamp(2.3rem, 5.4vw, 4.2rem); line-height: 1.02; letter-spacing: -.05em; }
.article-dek { font-size: 1.2rem; color: var(--ink-2); margin: 18px 0 0; max-width: 760px; }
.article-meta {
  margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.article-hero { margin: 0 0 8px; border: var(--border); }
.article-hero img { width: 100%; }

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  padding: 36px 0 88px;
  border-top: var(--border);
}
.article-content { max-width: 720px; font-size: 1.08rem; }
.article-content > *:first-child { margin-top: 0; }
.article-content h2 { margin: 48px 0 12px; font-size: 1.75rem; }
.article-content h3 { margin: 36px 0 10px; font-size: 1.3rem; }
.article-content p, .article-content li { color: var(--ink-2); }
.article-content a { color: var(--green-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.article-content a:hover { background: var(--yellow); color: var(--ink); }
.article-content ul, .article-content ol { padding-left: 22px; }
.article-content ul li::marker { content: "■  "; color: var(--green); font-size: .7em; }
.article-content blockquote {
  margin: 32px 0; padding: 18px 22px;
  border-left: 8px solid var(--green); background: var(--surface);
  font-size: 1.2rem; font-weight: 600;
}
.article-content blockquote p { color: var(--ink); margin: 0; }
.article-content code, .article-content pre { font-family: var(--font-mono); font-size: .88em; }
.article-content code { background: var(--surface); border: 1px solid var(--line-soft); padding: 1px 5px; }
.article-content pre { background: var(--ink); color: var(--paper); padding: 18px; overflow-x: auto; border: var(--border); }
.article-content pre code { background: none; border: 0; padding: 0; color: inherit; }
.article-content img, .article-content figure img { border: var(--border); }
.article-content figure { margin: 32px 0; }
.article-content figcaption, .wp-element-caption { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); margin-top: 8px; }
.article-content table { width: 100%; border-collapse: collapse; margin: 28px 0; font-size: .95rem; background: var(--surface); }
.article-content th, .article-content td { border: 1.5px solid var(--ink); padding: 10px 12px; text-align: left; }
.article-content th { background: var(--ink); color: var(--paper); font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.article-content hr { border: 0; border-top: var(--border); margin: 40px 0; }

.sidebar { position: sticky; top: 140px; align-self: start; display: grid; gap: 24px; }
.sidebar-box { border: var(--border); background: var(--surface); padding: 0 18px 8px; }
.sidebar-box > h3 {
  margin: 0 -18px 4px; padding: 10px 18px;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
}
.sidebar-box > p { color: var(--ink-2); font-size: .95rem; margin: 12px 0; }
.sidebar-cats { list-style: none; padding: 0; margin: 0; }
.sidebar-cats li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-family: var(--font-mono); font-size: .82rem; }
.sidebar-cats li:last-child { border-bottom: 0; }
.sidebar-cats a { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.sidebar-cats a:hover { color: var(--green-ink); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cfcbc0; padding: 60px 0 28px; border-top: var(--border); }
.footer-grid { display: grid; grid-template-columns: 1.6fr .7fr .7fr; gap: 56px; align-items: start; }
.footer-brand-word { font-size: 2rem; }
.footer-brand-word .digi { color: var(--paper); }
.footer-brand-word .gaming { color: var(--green); }
.footer-brand-block p { max-width: 400px; margin: 16px 0 0; }
.footer-column h3 {
  color: var(--green); margin: 0 0 14px;
  font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em;
}
.footer-menu { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-menu a { color: var(--paper); font-weight: 600; }
.footer-menu a:hover { color: var(--green); }
.footer-bottom {
  border-top: 1px solid #333; margin-top: 48px; padding-top: 20px;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: #8f8b80;
}

/* ---------- WordPress core ---------- */
.alignwide { margin-left: -60px; margin-right: -60px; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-block-button__link { border-radius: 0 !important; background: var(--ink); color: var(--paper) !important; font-family: var(--font-mono); text-transform: uppercase; font-size: .82rem; font-weight: 700; text-decoration: none !important; }
.wp-block-button__link:hover { background: var(--green) !important; color: var(--ink) !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band-inner { grid-template-columns: 1fr 1fr; }
  .band-actions { grid-column: 1 / -1; }
  .alignwide { margin-left: 0; margin-right: 0; }
}
@media (max-width: 900px) {
  .featured { grid-template-columns: 1fr; padding-top: 24px; }
  .category-row { grid-template-columns: 1fr 1fr; }
  .content-layout { grid-template-columns: 1fr; gap: 40px; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-brand-block { grid-column: 1 / -1; }
}
@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}
@media (max-width: 640px) {
  :root { --gap: 18px; }
  body { font-size: 16px; }
  .topbar-tag { display: none; }
  .header-inner { min-height: 64px; flex-wrap: wrap; padding: 12px 0; gap: 12px; }
  .header-search { width: 100%; }
  .header-search input { flex: 1; width: auto; }
  .site-header { position: static; }
  .post-grid, .category-row { grid-template-columns: 1fr; }
  .band-inner { grid-template-columns: 1fr; gap: 20px; padding: 40px 0; }
  .card--hero .card-body { padding: 18px; }
  .section-head h2 { white-space: normal; }
  .footer-grid { grid-template-columns: 1fr; }
}
