/*
Theme Name: Solposten
Theme URI: https://solposten.se
Author: Hugo
Description: Ett varmt och hoppfullt tema för Solposten – Sveriges positivaste nyhetssajt.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: solposten
*/

:root {
  --cream: #faf6ef;
  --paper: #fffdf9;
  --paper-strong: #fffaf1;
  --beige: #e9dcc3;
  --beige-dark: #d9c5a0;
  --sun: #f5a623;
  --sun-soft: #ffd376;
  --sun-dark: #d88909;
  --ink: #2b1c11;
  --ink-soft: #655245;
  --brown: #7b4b2a;
  --brown-dark: #4d2d1a;
  --white: #ffffff;
  --border: rgba(88, 58, 36, 0.14);
  --border-strong: rgba(88, 58, 36, 0.24);
  --shadow: 0 14px 34px rgba(78, 52, 30, 0.08);
  --shadow-strong: 0 22px 60px rgba(78, 52, 30, 0.12);
  --radius: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Lato", Georgia, serif;
  background:
    radial-gradient(circle at top, rgba(255, 211, 118, 0.22), transparent 32%),
    linear-gradient(180deg, #fffdf9 0%, var(--cream) 24%, #f7f0e4 100%);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.72;
}

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

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.screen-reader-text,
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus,
.skip-link:focus {
  clip: auto;
  width: auto;
  height: auto;
  margin: 1rem;
  padding: 0.75rem 1rem;
  background: var(--brown-dark);
  color: var(--white);
  z-index: 10001;
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.page-shell {
  padding: 44px 0 88px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--sun), #ffbf49);
  color: var(--brown-dark);
  box-shadow: 0 10px 24px rgba(245, 166, 35, 0.26);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.76);
  color: var(--brown);
  border: 1px solid var(--border-strong);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2,
.section-heading h3,
.archive-title,
.front-title,
.single-post-title,
.page-title,
.error-title,
.newsletter-signup h2,
.topic-section h3,
.post-card-title,
.hero-card-title,
.story-item-title,
.topic-feature h4,
.article-nav-card strong,
.footer-heading {
  font-family: "Playfair Display", Georgia, serif;
}

.section-heading h2,
.archive-title,
.page-title {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.1;
}

.section-heading h2,
.section-heading h3 {
  color: var(--brown-dark);
}

.section-description {
  max-width: 36ch;
  margin: 0;
  color: var(--ink-soft);
}

.section-kicker,
.page-eyebrow,
.front-note-kicker,
.topic-kicker,
.hero-card-label,
.post-card-meta,
.single-post-meta,
.archive-description,
.archive-hero .section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
}

.section-kicker,
.page-eyebrow,
.front-note-kicker,
.topic-kicker,
.archive-hero .section-kicker {
  margin: 0 0 0.7rem;
  color: var(--sun-dark);
  font-weight: 700;
}

.skip-link {
  position: absolute;
  left: 0;
  top: 0;
}

.site-header {
  position: relative;
  border-bottom: 1px solid rgba(123, 75, 42, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.92), rgba(250, 246, 239, 0.96));
  backdrop-filter: blur(10px);
}

.masthead {
  border-bottom: 1px solid rgba(123, 75, 42, 0.08);
}

.masthead-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
  align-items: center;
  padding: 28px 0 24px;
}

.masthead-link {
  display: inline-flex;
  justify-self: start;
  color: inherit;
}

.masthead-text {
  text-align: center;
}

@keyframes sun-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(245, 166, 35, 0.28)); }
  50% { filter: drop-shadow(0 0 12px rgba(245, 166, 35, 0.5)); }
}

.masthead-sun {
  width: 82px;
  margin: 0 auto 6px;
  transform: translateX(-6px);
}

.masthead-sun svg {
  animation: sun-glow 5s ease-in-out infinite;
}

.masthead-name {
  font-size: clamp(2.3rem, 6vw, 4rem);
  letter-spacing: 0.18em;
  line-height: 0.95;
  font-weight: 700;
  color: var(--brown);
}

.masthead-rule {
  width: 100%;
  height: 1px;
  margin: 12px 0 10px;
  background: linear-gradient(90deg, transparent, rgba(123, 75, 42, 0.44), transparent);
}

.masthead-tagline {
  font-size: 0.86rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink);
}

.masthead-aside {
  display: grid;
  gap: 0.9rem;
  justify-items: end;
}

.masthead-dateline {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: var(--brown-dark);
  color: #f8ead2;
  font-size: 0.73rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.masthead-blurb {
  max-width: 28ch;
  margin: 0;
  color: var(--ink-soft);
  text-align: right;
}

.site-nav-shell {
  border-top: 1px solid rgba(123, 75, 42, 0.08);
  border-bottom: 1px solid rgba(123, 75, 42, 0.08);
  background: rgba(255, 252, 246, 0.78);
}

.site-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 14px 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.site-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 0.9rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease;
}

.site-nav-link:hover,
.site-nav-link.is-current {
  background: rgba(245, 166, 35, 0.16);
  color: var(--brown-dark);
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.site-search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.4rem 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
}

.site-search-input {
  width: 190px;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.site-search-input:focus {
  outline: none;
}

.site-search-button,
.header-action-link,
.footer-button,
.share-btn,
.cookie-button,
.formkit-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.site-search-button {
  min-height: 36px;
  padding: 0 0.95rem;
  background: var(--brown-dark);
  color: var(--white);
}

.site-search-button:hover,
.header-action-link:hover,
.footer-button:hover,
.share-btn:hover,
.cookie-button:hover,
.formkit-submit:hover {
  transform: translateY(-1px);
}

.header-action-link {
  min-height: 38px;
  padding: 0 1rem;
  background: linear-gradient(135deg, var(--sun), #ffbf49);
  color: var(--brown-dark);
}

.front-page {
  padding-top: 16px;
}

.front-intro {
  max-width: 820px;
  margin: 0 auto 2rem;
}

.front-intro-copy,
.front-note,
.topic-section,
.page-panel,
.newsletter-signup,
.archive-hero,
.empty-state,
.newsletter-inline {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.front-intro-copy,
.front-note {
  border-radius: var(--radius);
}

.front-intro-copy {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(1.6rem, 3vw, 2.4rem);
}

.front-title {
  margin: 0 0 1rem;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.98;
  color: var(--brown-dark);
  text-wrap: balance;
}

.front-lead {
  max-width: 42ch;
  margin: 0;
  font-size: 1.08rem;
  color: var(--ink-soft);
}

.front-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.front-note {
  padding: 1.5rem;
  background: linear-gradient(180deg, rgba(255, 251, 241, 0.95), rgba(247, 238, 220, 0.92));
}

.front-note-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink);
}

.front-note-list li + li {
  margin-top: 0.6rem;
}

.front-note-link {
  display: inline-flex;
  margin-top: 1rem;
  color: var(--brown);
  font-weight: 700;
}

.hero-layout {
  margin-bottom: 0;
}

.hero-main {
  max-width: 820px;
  margin: 0 auto 2.4rem;
}

.hero-card,
.post-card,
.story-item,
.topic-feature,
.article-nav-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.hero-card-featured {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 246, 237, 0.96));
  box-shadow: var(--shadow-strong);
}

.hero-card-inner {
  display: block;
  color: inherit;
}

.hero-card-image,
.post-card-image {
  width: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-card-image {
  aspect-ratio: 16 / 9;
}

.post-card-image {
  aspect-ratio: 16 / 10;
}

.hero-card-image-placeholder,
.post-card-image-placeholder,
.single-post-image-placeholder,
.topic-feature-image-placeholder,
.story-item-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  background: linear-gradient(135deg, #f8ecd4, #f1d8ab);
}

.hero-card-image-placeholder {
  aspect-ratio: 16 / 9;
  font-size: 5rem;
}

.post-card-image-placeholder {
  aspect-ratio: 16 / 10;
  font-size: 3rem;
}

.hero-card-body {
  display: grid;
  gap: 0.9rem;
  padding: clamp(1.4rem, 2.8vw, 2.1rem);
}

.hero-card-label {
  margin: 0;
  color: var(--brown);
  font-weight: 700;
}

.hero-card-title {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1.14;
}

.hero-card-excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.04rem;
}

.hero-card-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem 0.7rem;
  flex-wrap: wrap;
  color: var(--ink-soft);
}

.hero-card-meta .cat-pills {
  margin: 0;
}

.hero-card-meta > span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-card-meta > span::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--sun);
}

.hero-card-link {
  color: var(--brown);
  font-weight: 700;
}

.story-item-pills .cat-pills,
.post-card-pills .cat-pills {
  margin: 0;
}

.newsletter-signup {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 1.2rem;
  align-items: center;
  padding: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 2.4rem;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(245, 166, 35, 0.98), rgba(255, 211, 118, 0.95));
}

.newsletter-signup h2,
.newsletter-signup p {
  margin: 0;
}

.newsletter-signup h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  line-height: 1.08;
  color: var(--brown-dark);
  text-wrap: balance;
}

.newsletter-copy {
  display: grid;
  gap: 0.7rem;
}

.section-kicker-light {
  color: rgba(77, 45, 26, 0.8);
}

.newsletter-copy p:last-child {
  color: rgba(43, 28, 17, 0.78);
}

.formkit-fields {
  display: grid;
  gap: 0.8rem;
}

.formkit-field {
  min-width: 0;
}

.formkit-input {
  width: 100%;
  min-height: 56px;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(77, 45, 26, 0.12);
}

.formkit-input:focus {
  outline: 2px solid rgba(77, 45, 26, 0.28);
  outline-offset: 2px;
}

.formkit-submit {
  min-height: 56px;
  padding: 0 1.25rem;
  background: var(--brown-dark);
  color: var(--white);
}

.formkit-submit:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.formkit-submit span {
  display: inline-flex;
  align-items: center;
}

.newsletter-feedback {
  min-height: 1.4rem;
  margin: 0;
  color: rgba(43, 28, 17, 0.82);
  font-size: 0.92rem;
}

.newsletter-feedback.is-error {
  color: #742d14;
}

.newsletter-footnote {
  margin: 0;
  color: rgba(43, 28, 17, 0.72);
  font-size: 0.92rem;
}

.category-directory-section,
.latest-section,
.archive-listing,
.related-section {
  margin-top: 2.5rem;
}

.category-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.category-tile {
  display: grid;
  gap: 0.85rem;
  padding: 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.category-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-strong);
}

.category-tile-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.category-tile h3 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.15;
  font-family: "Playfair Display", Georgia, serif;
}

.category-tile p {
  margin: 0;
  color: var(--ink-soft);
}

.category-tile-article {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.1rem;
  padding: 0.95rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(250, 245, 235, 0.96), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(88, 58, 36, 0.1);
}

.category-tile-label,
.category-tile-date {
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.category-tile-article strong {
  font-size: 1rem;
  line-height: 1.3;
  font-family: "Playfair Display", Georgia, serif;
}

.category-tile-article-empty strong {
  font-family: "Lato", Georgia, serif;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.topic-section {
  padding: 1.2rem;
  border-radius: var(--radius);
}

.topic-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.topic-header h3 {
  margin: 0;
  font-size: 1.45rem;
}

.topic-more {
  color: var(--brown);
  font-weight: 700;
}

.topic-posts {
  display: grid;
  gap: 1rem;
}

.topic-feature-link {
  display: block;
  color: inherit;
}

.topic-feature-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.topic-feature-body {
  padding: 1rem;
}

.topic-feature-date,
.topic-list-date {
  display: inline-block;
  color: var(--ink-soft);
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
}

.topic-feature h4,
.topic-list-item h4 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.25;
}

.topic-feature p {
  margin: 0.65rem 0 0;
  color: var(--ink-soft);
}

.topic-list {
  display: grid;
  gap: 0.85rem;
}

.topic-list-item {
  padding-top: 0.85rem;
  border-top: 1px solid rgba(88, 58, 36, 0.1);
}

.topic-list-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  align-items: start;
}

.post-card {
  height: auto;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.post-card:hover,
.story-item:hover,
.topic-feature:hover,
.article-nav-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-strong);
}

.post-card-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  color: inherit;
}

.post-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem;
  flex: 1;
}

.post-card-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}

.post-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 28px;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.post-card-pills .cat-pills {
  gap: 0.35rem;
}

.post-card-pills .cat-pill {
  min-height: 28px;
  padding: 0 0.65rem;
  font-size: 0.68rem;
}

.post-card-meta .dot {
  margin-right: 0;
}

.dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--sun);
}

.post-card-title {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.2;
}

.post-card-excerpt {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.post-card-link {
  color: var(--brown);
  font-weight: 700;
  margin-top: auto;
}

.latest-actions {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

@media (min-width: 1041px) {
  .front-page > .container {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: clamp(1.4rem, 2.6vw, 2.4rem);
    row-gap: clamp(1.2rem, 2vw, 1.6rem);
  }

  .front-left {
    display: flex;
    flex-direction: column;
    gap: clamp(1.2rem, 2vw, 1.6rem);
    padding-top: 4.3rem;
    grid-column: 2;
    grid-row: 1;
  }

  .front-intro {
    display: flex;
    flex: 1;
    max-width: none;
    margin: 0;
  }

  .front-intro-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    max-width: none;
    padding: clamp(1.6rem, 2.4vw, 2.2rem);
  }

  .front-title {
    max-width: 11ch;
    font-size: clamp(2.2rem, 3.4vw, 3.4rem);
  }

  .front-lead {
    max-width: 36ch;
  }

  .hero-layout {
    display: flex;
    flex-direction: column;
    margin: 0;
    grid-column: 1;
    grid-row: 1;
  }

  .hero-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    max-width: none;
    margin: 0;
  }

  .hero-card {
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  .hero-card-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  .hero-card-image {
    flex: 1;
    object-fit: cover;
  }

  .hero-main .section-heading {
    margin-bottom: 1rem;
  }

  .newsletter-signup {
    grid-template-columns: 1fr;
    margin-bottom: 0;
  }

  .newsletter-signup h2 {
    font-size: clamp(1.5rem, 2.4vw, 2rem);
  }

  .latest-section,
  .category-directory-section {
    grid-column: 1 / -1;
    margin-top: 0;
  }
}

.archive-page .archive-hero,
.search-page .archive-hero,
.front-page .archive-hero {
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 1.8rem;
}

.archive-description {
  max-width: 58ch;
  margin: 0.9rem 0 0;
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: normal;
  font-size: 1rem;
}

.archive-feature {
  margin-bottom: 1.8rem;
}

.archive-grid {
  margin-top: 1rem;
}

.empty-state {
  padding: 2.2rem;
  border-radius: var(--radius);
  text-align: center;
}

.empty-state h2,
.error-title {
  margin: 0 0 0.8rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.empty-state p,
.error-text {
  margin: 0;
  color: var(--ink-soft);
}

.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 1.2rem;
}

.single-shell {
  padding-top: 44px;
}

.single-post {
  max-width: 1120px;
  margin: 0 auto;
}

.back-link,
.single-post-header,
.image-credit,
.single-post-actions,
.single-post-content {
  width: 100%;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--brown);
  font-weight: 700;
}

.single-post-header {
  margin: 1.2rem 0 1.8rem;
}

.single-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink-soft);
  font-weight: 700;
}

.single-meta-divider {
  color: rgba(43, 28, 17, 0.35);
}

.single-post-title {
  margin: 0.8rem 0 0.8rem;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.02;
}

.single-post-standfirst {
  margin: 0;
  font-size: 1.18rem;
  color: var(--ink-soft);
}

.single-post-image,
.single-post-image-placeholder {
  width: 100%;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-strong);
}

.single-post-image {
  max-height: min(76vh, 640px);
  object-fit: cover;
  object-position: center;
}

.single-post-image-placeholder {
  aspect-ratio: 16 / 10;
  font-size: 5rem;
}

.image-credit {
  margin: 0.7rem 0 0;
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.single-post-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin: 1.1rem 0 1.4rem;
}

.share-btn {
  min-height: 46px;
  padding: 0 1rem;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-strong);
  color: var(--brown);
}

.single-newsletter-link {
  color: var(--brown);
  font-weight: 700;
}

.single-post-content {
  font-size: 1.08rem;
  line-height: 1.9;
}

.single-post-content ul,
.single-post-content ol {
  padding-left: 1.3rem;
}

.single-post-content img,
.single-post-content figure,
.single-post-content .wp-block-image,
.single-post-content .wp-block-embed {
  max-width: 100%;
}

.single-post-content figure,
.single-post-content .wp-block-image,
.single-post-content .wp-block-embed {
  margin: 1.5rem 0;
}

.single-post-content img {
  border-radius: var(--radius-md);
}

.single-post-content > *:first-child {
  margin-top: 0;
}

.single-post-content p,
.single-post-content ul,
.single-post-content ol,
.single-post-content blockquote,
.single-post-content h2,
.single-post-content h3 {
  margin: 0 0 1.3rem;
}

.single-post-content h2,
.single-post-content h3 {
  color: var(--brown-dark);
  line-height: 1.2;
}

.single-post-content a {
  color: var(--brown);
  text-decoration: underline;
  text-decoration-color: rgba(245, 166, 35, 0.5);
  text-underline-offset: 3px;
}

.single-post-content blockquote {
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--sun);
  background: rgba(255, 251, 241, 0.86);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.single-post-content em {
  color: var(--ink-soft);
}

.newsletter-inline {
  display: grid;
  gap: 0.75rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-top: 2.2rem;
}

.newsletter-inline h2,
.newsletter-inline p {
  margin: 0;
}

.article-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.article-nav-card {
  display: grid;
  gap: 0.4rem;
  padding: 1.1rem;
  color: inherit;
}

.article-nav-label {
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.page-panel {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(1.6rem, 3vw, 2.4rem);
  border-radius: var(--radius);
}

.page-title {
  margin: 0 0 1.2rem;
}

.page-content {
  font-size: 1.05rem;
}

.page-content p,
.page-content ul,
.page-content ol,
.page-content h2,
.page-content h3 {
  margin: 0 0 1.1rem;
}

.page-content h2,
.page-content h3 {
  color: var(--brown-dark);
}

.page-content ul,
.page-content ol {
  padding-left: 1.3rem;
}

.page-content a {
  color: var(--brown);
  text-decoration: underline;
  text-decoration-color: rgba(245, 166, 35, 0.45);
  text-underline-offset: 3px;
}

.page-content .wpcf7 {
  margin-top: 1.4rem;
}

.page-content .wpcf7 input[type="text"],
.page-content .wpcf7 input[type="email"],
.page-content .wpcf7 textarea {
  width: 100%;
  margin-bottom: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--paper);
}

.page-content .wpcf7 textarea {
  min-height: 170px;
  resize: vertical;
}

.page-content .wpcf7 input[type="submit"] {
  min-height: 48px;
  padding: 0 1.2rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--sun), #ffbf49);
  color: var(--brown-dark);
  font-weight: 700;
}

.page-404 .error-404 {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.error-sun {
  font-size: 3.4rem;
  margin-bottom: 0.8rem;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin: 1.5rem 0 2.2rem;
}

.error-solstrale {
  margin-top: 2rem;
}

.error-solstrale-label {
  margin: 0 0 1rem;
  font-size: 1.4rem;
  font-family: "Playfair Display", Georgia, serif;
}

.site-footer {
  margin-top: 2rem;
  padding: 56px 0 22px;
  color: rgba(255, 248, 237, 0.92);
  background:
    linear-gradient(180deg, #4d2d1a 0%, #2b180f 100%);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(180px, 0.8fr) minmax(220px, 0.85fr);
  gap: 1.8rem;
}

.footer-logo {
  color: #ffd376;
  font-size: 1.4rem;
  font-weight: 700;
}

.footer-summary,
.footer-note,
.footer-copy {
  color: rgba(255, 248, 237, 0.76);
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.1rem;
}

.footer-button {
  min-height: 44px;
  padding: 0 1rem;
  background: linear-gradient(135deg, var(--sun), #ffbf49);
  color: var(--brown-dark);
}

.footer-link {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 248, 237, 0.94);
  font-weight: 700;
}

.footer-heading {
  margin: 0 0 0.9rem;
  font-size: 1.15rem;
  color: var(--white);
}

.footer-nav {
  display: grid;
  gap: 0.7rem;
}

.footer-nav a {
  color: rgba(255, 248, 237, 0.88);
}

.footer-bottom {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 248, 237, 0.12);
}

.footer-copy {
  margin: 0;
  font-size: 0.9rem;
}

.cookie-banner {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: rgba(255, 250, 241, 0.96);
  box-shadow: var(--shadow-strong);
  z-index: 9999;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-text {
  margin: 0;
  color: var(--ink-soft);
}

.cookie-buttons {
  display: flex;
  gap: 0.7rem;
  flex-shrink: 0;
}

.cookie-button {
  min-height: 42px;
  padding: 0 1rem;
}

.cookie-button-primary {
  background: var(--sun);
  color: var(--brown-dark);
}

.cookie-button-secondary {
  background: rgba(255, 255, 255, 0.88);
  color: var(--brown);
  border: 1px solid var(--border-strong);
}

.pagination {
  display: flex;
  justify-content: center;
  margin-top: 1.8rem;
}

.pagination .page-numbers {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.pagination .page-numbers li {
  display: contents;
}

.pagination a.page-numbers,
.pagination span.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  color: var(--brown);
  font-weight: 700;
}

.pagination .current {
  background: var(--sun);
  color: var(--brown-dark);
  border-color: transparent;
}

.pagination .dots {
  border-color: transparent;
  background: transparent;
}

.cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.cat-pill.vetenskap { background: #c62828; color: #fff; }
.cat-pill.natur { background: #2e7d32; color: #fff; }
.cat-pill.omtanke { background: #2d6a4f; color: #fff; }
.cat-pill.halsa-medicin { background: #0288d1; color: #fff; }
.cat-pill.kultur { background: #7b1fa2; color: #fff; }
.cat-pill.sport { background: #e65100; color: #fff; }
.cat-pill.djur { background: #795548; color: #fff; }
.cat-pill.innovation { background: #4a6fa5; color: #fff; }
.cat-pill.sverige { background: #1b3a6b; color: #fff; }

@media (max-width: 1040px) {
  .masthead-inner,
  .front-intro,
  .hero-layout,
  .newsletter-signup,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .category-directory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .masthead-aside {
    justify-items: start;
  }

  .masthead-blurb {
    text-align: left;
  }

  .site-nav-row {
    flex-direction: column;
    align-items: stretch;
  }

  .site-header-actions {
    justify-content: space-between;
  }

  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    gap: 1.4rem;
  }
}

@media (max-width: 900px) {
  .category-directory-grid,
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .container {
    width: min(100% - 28px, 1180px);
  }

  .front-page > .container {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
  }

  .front-left {
    display: contents;
  }

  .front-page .hero-layout,
  .front-page .hero-main {
    margin: 0;
  }

  .front-page .newsletter-signup {
    order: 10;
    margin: 0;
  }

  .front-page .latest-section {
    margin-top: 0;
  }

  .front-page .category-directory-section {
    order: 11;
    margin-top: 0;
  }

  .page-shell {
    padding: 32px 0 72px;
  }

  .page-shell.front-page {
    padding-top: 12px;
  }

  .masthead-inner {
    justify-items: center;
    padding: 14px 0 12px;
  }

  .masthead-link {
    justify-self: center;
  }

  .masthead-aside {
    display: none;
  }

  .masthead-sun {
    width: 58px;
    transform: translateX(-3px);
  }

  .masthead-tagline {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
  }

  .front-intro,
  .hero-side {
    display: none;
  }

  .site-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    gap: 0.2rem;
  }

  .site-nav-link {
    padding: 0 0.55rem;
  }

  .site-nav-shell {
    position: relative;
  }

  .site-nav-shell::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3rem;
    pointer-events: none;
    background: linear-gradient(to right, transparent, var(--cream));
    z-index: 1;
  }

  .site-header-actions {
    display: none;
  }

  .story-item-link {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .story-item-image {
    width: 88px;
    min-height: 122px;
  }

  .topic-grid,
  .category-directory-grid,
  .posts-grid,
  .related-grid,
  .article-nav {
    grid-template-columns: 1fr;
  }

  .post-card-excerpt {
    -webkit-line-clamp: 2;
  }

  .hero-card-excerpt {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .cookie-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-buttons {
    width: 100%;
    flex-direction: column;
  }

  .cookie-button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .front-actions,
  .error-actions,
  .empty-state-actions {
    flex-direction: column;
  }

  .button,
  .footer-button {
    width: 100%;
  }

  .post-card-image,
  .post-card-image-placeholder {
    aspect-ratio: 16 / 10;
  }

  .single-post-title {
    font-size: 2.15rem;
  }

  .newsletter-signup,
  .page-panel,
  .front-note,
  .front-intro-copy,
  .archive-hero,
  .newsletter-inline,
  .topic-section,
  .empty-state {
    padding: 1.2rem;
  }

  .newsletter-signup {
    gap: 0.9rem;
    padding: 1rem;
  }

  .newsletter-copy {
    gap: 0.45rem;
  }

  .newsletter-signup h2 {
    font-size: clamp(1.5rem, 7vw, 1.8rem);
    line-height: 1.08;
  }

  .formkit-fields {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: start;
  }

  .formkit-input,
  .formkit-submit {
    min-height: 48px;
  }

  .formkit-submit {
    min-width: 120px;
    padding-inline: 0.9rem;
  }

  .newsletter-feedback {
    grid-column: 1 / -1;
    min-height: 1rem;
  }
}
