/*
Theme Name: _v1
Theme URI: https://politisk.dk
Author: politisk.dk
Description: Clean, simple, modern theme for a politics site.
Version: 1.0.0
Text Domain: _v1
*/

/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

:root {
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.5rem;
  --space-xl: 3.5rem;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #111827;
  background: #f8fafc;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

main {
  flex: 1;
  padding: var(--space-l) 0 calc(var(--space-l) + var(--space-s));
}

/* Header */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 1rem 0;
}

.site-title {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.site-logo {
  display: block;
  width: 130px;
  max-width: 40vw;
  height: auto;
}

.nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.nav-toggle {
  display: none;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
}

.primary-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.primary-menu > li {
  position: relative;
}

.primary-menu > li > a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0;
}

.submenu-toggle {
  display: none;
  border: 0;
  background: transparent;
  padding: 0.25rem 0.35rem;
  margin-left: 0.35rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.primary-menu .menu-item-has-children > a::after {
  content: "▾";
  font-size: 0.7rem;
  opacity: 0.6;
}

.primary-menu .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0.75rem;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  display: none;
  z-index: 20;
}

.primary-menu .sub-menu li + li {
  margin-top: 0.5rem;
}

.primary-menu .sub-menu a {
  display: block;
  padding: 0.35rem 0.25rem;
}

.primary-menu > .menu-item-has-children:hover > .sub-menu,
.primary-menu > .menu-item-has-children:focus-within > .sub-menu {
  display: block;
}

/* Mega menu (use .menu-item-has-mega on top-level items) */
.primary-menu > .menu-item-has-mega > .mega-menu {
  list-style: none;
  margin: 0;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 520px;
  width: min(760px, 90vw);
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  z-index: 20;
}

.primary-menu > .menu-item-has-mega:hover > .mega-menu,
.primary-menu > .menu-item-has-mega:focus-within > .mega-menu {
  display: grid;
}

.mega-column {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mega-heading {
  font-weight: 600;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e2e8f0;
}

.mega-children {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.mega-children a {
  display: inline-block;
  color: #334155;
}

/* Hero */
.hero {
  padding: var(--space-l) 0 var(--space-m);
}

.hero-news {
  padding: var(--space-m) 0 var(--space-s);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.75rem;
}

.hero p {
  max-width: 60ch;
  color: #475569;
  margin: 0;
}

/* News layout */
.news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--space-l);
  align-items: start;
}

.main-column h1,
.main-column h2 {
  margin-top: 0;
}

.section-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
  margin: 0 0 1.25rem;
}

.featured {
  display: block;
}

.featured-content {
  margin-top: 1rem;
  padding: 0;
  background: transparent;
  border: 0;
  color: #0f172a;
}

.featured-content .kicker {
  color: #1d4ed8;
}

.media-cover {
  display: block;
  background: #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  position: relative;
}

.media-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.7) 85%);
}

.media-overlay-content {
  position: absolute;
  inset: auto 1.25rem 1.25rem 1.25rem;
  color: #f8fafc;
  z-index: 1;
}

.media-overlay-content h1,
.media-overlay-content h2 {
  margin: 0.35rem 0 0;
  color: inherit;
  text-shadow: 0 2px 10px rgba(15, 23, 42, 0.45);
}

.media-overlay .kicker {
  color: #e2e8f0;
}

.media-overlay .meta-row {
  color: #e2e8f0;
  margin-bottom: 0;
}

.featured-media img {
  border-radius: 12px;
}

.featured-content h1 {
  margin: 0 0 0.75rem;
}

.kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 0.5rem;
}

.meta-row {
  color: #64748b;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.headline-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

.headline-item {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.thumb {
  display: block;
  margin-bottom: 0.75rem;
}

.headline-item:last-child {
  border-bottom: 0;
}

.headline-item h2 {
  margin: 0.35rem 0 0.5rem;
}

.article-media {
  margin: 1.5rem 0;
}

.featured-media.media-cover,
.article-media.media-cover {
  border-radius: 14px;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

.sidebar-widget {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: var(--space-m);
}

.sidebar-widget h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.sidebar-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: var(--space-m);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.card .meta {
  color: #64748b;
  font-size: 0.85rem;
}

/* Article */
.entry-header h1,
.entry-header h2 {
  margin-top: 0;
}

.entry-content {
  color: #0f172a;
}

.entry-content p {
  margin: 0 0 1.25rem;
}

/* Medium-style single article */
.medium-article {
  margin: 0 auto;
}

.medium-header {
  margin-bottom: 0;
}

.article-hero {
  margin: 0 0 1.75rem;
}

.article-hero img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
}

.medium-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.2;
  margin: 0 0 1.25rem;
}

.author-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.author-meta .avatar img {
  border-radius: 50%;
}

.author-name {
  font-weight: 600;
}

.author-details {
  color: #64748b;
  font-size: 0.9rem;
}

.medium-content {
  font-size: 1.1rem;
  line-height: 1.85;
}

.medium-content h2,
.medium-content h3 {
  margin: 2.25rem 0 1rem;
  line-height: 1.3;
}

.medium-content blockquote {
  border-left: 3px solid #e2e8f0;
  padding-left: 1rem;
  color: #334155;
  margin: 2rem 0;
}

.medium-content ul,
.medium-content ol {
  padding-left: 1.25rem;
  margin: 0 0 1.5rem;
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #f8fafc;
  padding: var(--space-l) 0;
  margin-top: auto;
}

.site-footer a {
  color: #e2e8f0;
}

/* Utilities */
.button {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .container {
    padding: 0 1rem;
  }

  main {
    padding: var(--space-m) 0 var(--space-l);
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.75rem 0;
  }

  .site-logo {
    width: 150px;
  }

  .nav {
    width: 100%;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }

  .primary-nav {
    width: 100%;
  }

  .news-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .primary-menu {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
  }

  .primary-nav.is-open .primary-menu {
    display: flex;
  }

  .primary-menu > li {
    width: 100%;
  }

  .primary-menu > li > a {
    width: 100%;
  }

  .primary-menu .sub-menu {
    position: static;
    box-shadow: none;
    border: 0;
    padding: 0.5rem 0 0.75rem;
    display: none;
  }

  .primary-menu > .menu-item-has-mega > .mega-menu {
    width: 100%;
    left: 0;
    transform: none;
    grid-template-columns: 1fr;
    position: static;
    box-shadow: none;
    border: 0;
    padding: 0.5rem 0 0.75rem;
    display: none;
  }

  .submenu-open > .sub-menu {
    display: block;
  }

  .submenu-open > .mega-menu {
    display: grid;
  }

  .submenu-toggle {
    display: inline-flex;
    align-items: center;
  }

  .media-overlay-content {
    inset: auto 0.75rem 0.75rem 0.75rem;
  }

  .medium-title {
    font-size: 2rem;
  }

  .medium-content {
    font-size: 1rem;
  }

  .author-meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}
