:root {
  --smf-primary: #6495ED;
  --smf-accent: #4A7BC8;
  --smf-next-issue-mm2-26: #c6716b;
  --smf-bg: #ffffff;
  --smf-surface: #f8f9fa;
  --smf-text: #2c3e50;
  --smf-text-light: #6c757d;
  --smf-border: #dee2e6;
  --spacing: 1rem;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
  --think2e-deepblue: #292578;
  --think2e-accent: #EA1E8C;
  --think2e-turquoise: #22A7DB;
  --think2e-white: #FEFEFE;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--smf-text);
  background: var(--smf-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
header {
  background: var(--smf-primary);
  color: white;
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: white;
}

.logo {
  height: 50px;
  width: auto;
  margin-right: 1rem;
}

.site-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.site-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: white;
}

.site-title p {
  font-size: 0.875rem;
  margin: 0;
  opacity: 0.9;
  color: white;
}

.masthead {
  height: 30px;
  width: auto;
}

nav {
  margin-left: auto;
  display: flex;
  gap: 1rem;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: background 0.2s;
}

nav a:hover, nav a:active {
  background: rgba(255,255,255,0.1);
}

/* Hero Section */
.hero {
  position: relative;
  height: 60vh;
  min-height: 400px;
  max-height: 600px;
  overflow: hidden;
  background: var(--smf-primary);
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  color: white;
}

.hero-overlay h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.hero-overlay p {
  font-size: 1.125rem;
  opacity: 0.9;
}

.hero-credit {
  position: absolute;
  bottom: 0.5rem;
  right: 0.75rem;
  color: white;
  font-size: 0.75rem;
  font-style: italic;
  opacity: 0.7;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  pointer-events: none;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Section Titles */
h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--smf-primary);
  font-weight: 600;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--smf-primary);
  font-weight: 600;
}

/* Grid Layouts */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.lokalavdelning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

/* Kompakt variant för text-only badges (inga logos) — t.ex. "Information från Riks".
   Smalare minmax så 5 badges får plats på en rad i desktop. */
.lokalavdelning-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

/* Brev/hälsning-ruta på t.ex. about.html (ansvarig utgivare till medlemmarna).
   Mycket ljus blå bakgrund #eef4fa med diskret grå kantlinje. */
.editor-letter {
  background: #f5f5f5; 
  border: 1px solid #d0d7de;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 0 0 2rem 0;
}
.editor-letter-title {
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
  color: var(--smf-accent);
}
.editor-letter p {
  margin: 0 0 0.75rem 0;
}
.editor-letter p:last-child {
  margin-bottom: 0;
}

/* Article Card */
.article-card {
  background: var(--smf-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.article-card:hover, .article-card:active {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.article-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--smf-border);
}

.article-card-content {
  padding: 1.25rem;
}

.article-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--smf-primary);
}

.article-card-meta {
  font-size: 0.875rem;
  color: var(--smf-text-light);
  margin-bottom: 0.75rem;
}

.article-card-excerpt {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--smf-text);
}

/* Lokalavdelning Badge */
.lokalavdelning-badge {
  background: white;
  border: 2px solid var(--smf-border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.lokalavdelning-badge:hover, .lokalavdelning-badge:active {
  border-color: var(--smf-accent);
  transform: translateY(-2px);
}

.lokalavdelning-logo {
  height: 60px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  margin: 0 auto 0.5rem;
  display: block;
}

.lokalavdelning-name {
  font-weight: 600;
  color: var(--smf-primary);
  font-size: 1rem;
}

/* Article Reader */
.article-reader {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.article-header {
  margin-bottom: 2rem;
}

.article-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--smf-primary);
}

.article-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--smf-text-light);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}

.article-content {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.article-content p {
  margin-bottom: 1.25rem;
}

.article-content .ingress {
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  color: var(--smf-text);
}

.article-content figure {
  margin: 2rem 0;
}

.article-content figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0;
}

/* Figcaption-konvention: gäller alla figure i tidningen — bildtext ovanför,
   credit (foto-byline) underst, tunn linje mellan bild och text. */
figcaption {
  margin-top: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  color: var(--smf-text-light);
  border-top: 1px solid var(--smf-border);
}

figcaption .caption {
  display: block;
  margin-bottom: 0.25rem;
  font-style: italic;
}

figcaption .credit {
  display: block;
  font-size: 0.875rem;
  opacity: 0.8;
}

.article-content img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 2rem 0;
  box-shadow: var(--shadow);
}

/* Table of Contents */
.toc-section {
  margin-bottom: 3rem;
}

.toc-list {
  list-style: none;
}

.toc-item {
  border-left: 3px solid var(--smf-border);
  padding: 0.75rem 0 0.75rem 1rem;
  margin-bottom: 0.5rem;
  transition: border-color 0.2s;
}

.toc-item:hover {
  border-color: var(--smf-accent);
}

.toc-link {
  text-decoration: none;
  color: var(--smf-text);
  display: block;
}

.toc-link:hover {
  color: var(--smf-accent);
}

.toc-title {
  font-weight: 600;
  font-size: 1.0625rem;
  margin-bottom: 0.25rem;
}

.toc-author {
  font-size: 0.875rem;
  color: var(--smf-text-light);
}

/* Navigation Controls */
.article-nav {
  display: flex;
  justify-content: space-between;
  margin: 3rem 0;
  gap: 1rem;
}

.nav-button {
  flex: 1;
  padding: 1rem 1.5rem;
  background: var(--smf-primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.nav-button:hover, .nav-button:active {
  background: var(--smf-accent);
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: auto;
  color: white;
  font-size: 1.5rem;
  line-height: 1;
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
}

.menu-overlay.active {
  display: block;
}

.side-menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100%;
  background: white;
  box-shadow: -2px 0 8px rgba(0,0,0,0.2);
  z-index: 201;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.side-menu.active {
  right: 0;
}

.menu-header {
  padding: 1rem;
  background: var(--smf-primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: white;
}

.menu-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.menu-content {
  padding: 1rem;
}

.menu-section {
  margin-bottom: 2rem;
}

.menu-section h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  color: var(--smf-text-light);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.menu-links {
  list-style: none;
}

.menu-links li {
  margin-bottom: 0.5rem;
}

.menu-links a {
  display: block;
  padding: 0.5rem;
  color: var(--smf-text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.menu-links a:hover, .menu-links a:active {
  background: var(--smf-surface);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .hero-overlay h1 {
    font-size: 1.75rem;
  }
  
  .site-title h1 {
    font-size: 1.25rem;
  }
  
  .site-title p {
    font-size: 0.75rem;
  }
  
  .highlights-grid {
    grid-template-columns: 1fr;
  }
  
  .lokalavdelning-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .article-title {
    font-size: 1.5rem;
  }
  
  nav {
    display: none;
  }
  
  .hamburger {
    display: block;
  }
}

/* Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
  .article-card, .nav-button, .lokalavdelning-badge {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
  }
}

/* About/GDPR Pages */
.about-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.about-page h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--smf-primary);
}

.about-page h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  color: var(--smf-primary);
}

.about-page p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.about-page a {
  color: var(--smf-primary);
  text-decoration: underline;
}

.about-page a:hover {
  color: var(--smf-accent);
}

.divider {
  width: 100%;
  max-width: 600px;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--smf-border) 50%, 
    transparent 100%);
  margin: 2.5rem auto;
}

.powered-by {
  text-align: center;
  margin: 2rem 0;
  padding: 0.75rem 2rem;
  background: var(--think2e-deepblue);
  border-radius: var(--radius);
}

.powered-by-intro {
  font-size: 1rem;
  color: var(--think2e-accent);
  margin-bottom: 0.5rem;
}

.powered-by-title {
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  color: var(--think2e-accent);
}

.powered-by-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  margin-bottom: 1rem;
}

.powered-by-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--think2e-accent);
  transition: transform 0.2s;
}

.powered-by-item:hover {
  transform: translateY(-4px);
}

.powered-by-logo {
  height: 60px;
  width: auto;
}

.claude-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, #6495ED 0%, #4A7BC8 100%);
  color: white;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9375rem;
  box-shadow: 0 2px 8px rgba(100, 149, 237, 0.3);
}

.powered-by-name {
  font-size: 0.9375rem;
  color: var(--smf-text);
}

.powered-by-tagline {
  font-size: 0.875rem;
  color: var(--smf-text-light);
}

/* GDPR Approval Button */
.gdpr-approval {
  margin: 3rem 0;
  padding: 2rem;
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: var(--radius);
  text-align: center;
}

.gdpr-approval-button {
  display: inline-block;
  padding: 1rem 2rem;
  background: #dc3545;
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s, transform 0.2s;
  box-shadow: var(--shadow);
}

.gdpr-approval-button:hover,
.gdpr-approval-button:active {
  background: #c82333;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Utilities */
.hidden {
  display: none;
}

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

.mb-2 {
  margin-bottom: 2rem;
}

/* Footer */
.site-footer {
  background: var(--smf-primary);
  color: white;
  padding: 2rem 1rem;
  margin-top: 4rem;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-logo {
  height: 40px;
  width: auto;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copyright {
  font-weight: 600;
  opacity: 0.9;
}

.footer-separator {
  opacity: 0.5;
}

.site-footer a {
  color: white;
  text-decoration: none;
  transition: opacity 0.2s;
  font-weight: 500;
}

.site-footer a:hover,
.site-footer a:active {
  opacity: 0.8;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .footer-links {
    justify-content: center;
  }
}

/* Footer logo link */
.site-footer a:has(.footer-logo) {
  display: inline-block;
  transition: opacity 0.2s;
}

.site-footer a:has(.footer-logo):hover {
  opacity: 0.8;
  text-decoration: none;
}

/* === Medlemsantal-tabell === */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  -webkit-overflow-scrolling: touch;
}

.medlemsantal-tabell {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.medlemsantal-tabell th,
.medlemsantal-tabell td {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--smf-border);
  text-align: left;
}

.medlemsantal-tabell th {
  font-weight: 600;
  font-size: 0.8125rem;
  background: white;
  color: var(--smf-text);
  border-bottom: 2px solid var(--smf-primary);
  vertical-align: bottom;
}

.medlemsantal-tabell th:not(:first-child),
.medlemsantal-tabell td:not(:first-child) {
  text-align: right;
}

.medlemsantal-tabell .antal {
  font-weight: 600;
  color: var(--smf-primary);
}

.medlemsantal-tabell .negativ {
  color: #c0392b;
}

.medlemsantal-tabell .neutral {
  color: var(--smf-text-light);
}

.medlemsantal-tabell .total-rad td {
  border-top: 2px solid var(--smf-primary);
  font-weight: 700;
  background: white;
}

@media (max-width: 768px) {
  .medlemsantal-tabell {
    font-size: 0.8125rem;
  }
  .medlemsantal-tabell th,
  .medlemsantal-tabell td {
    padding: 0.5rem 0.5rem;
  }
  .medlemsantal-tabell th {
    font-size: 0.75rem;
  }
}

/* SMF link in copyright */
.footer-smf-link {
  font-weight: 600;
  color: white;
}

/* === Styrelse-listor (boards.json → injicerade i rader-artiklar) === */
.board-listing-wrapper {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--smf-border);
}

.board-listing {
  margin-bottom: 2.5rem;
}

.board-listing:last-child {
  margin-bottom: 0;
}

.board-listing-title {
  color: var(--smf-primary);
  font-size: 1.5rem;
  margin: 0 0 1.25rem;
}

.board-info {
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--smf-surface);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  font-size: 0.9375rem;
}

.board-info-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.board-info-key {
  font-weight: 600;
  color: var(--smf-text);
}

.board-info-key::after {
  content: ":";
}

.board-info-value {
  color: var(--smf-text);
}

.board-info-value a {
  color: var(--smf-primary);
  text-decoration: underline;
  word-break: break-all;
}

.board-section-title {
  color: var(--smf-primary);
  font-size: 1.125rem;
  margin: 1.75rem 0 0.75rem;
}

.board-section-intro {
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  color: var(--smf-text);
  line-height: 1.6;
}

.board-members {
  list-style: none;
  margin: 0;
  padding: 0;
}

.board-member {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--smf-border);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.board-member:last-child {
  border-bottom: none;
}

.board-role {
  font-weight: 600;
  color: var(--smf-primary);
  font-size: 0.9375rem;
}

.board-info-stack {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.9375rem;
}

.board-name {
  color: var(--smf-text);
}

.board-email {
  color: var(--smf-primary) !important;
  text-decoration: underline;
  word-break: break-all;
  font-size: 0.9rem;
}

.board-address {
  color: var(--smf-text-light);
  font-size: 0.875rem;
}

.board-lokal {
  color: var(--smf-text-light);
  font-size: 0.875rem;
  font-style: italic;
}

@media (min-width: 640px) {
  .board-member {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1.5rem;
  }
  .board-role {
    flex: 0 0 12rem;
  }
  .board-info-stack {
    flex: 1 1 16rem;
  }
}

/* === Medlemsförmåner: partner-grid och sektioner === */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 2rem 0 3rem;
}

.partner-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: white;
  border: 2px solid var(--smf-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
  text-align: center;
  gap: 1rem;
  min-height: 140px;
}

.partner-tile:hover,
.partner-tile:active {
  border-color: var(--smf-accent);
  transform: translateY(-2px);
}

.partner-tile img {
  max-height: 70px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.partner-tile-label {
  font-weight: 600;
  color: var(--smf-primary);
  font-size: 0.9375rem;
}

.partner-section {
  margin: 3rem 0;
  scroll-margin-top: 2rem;
}

.partner-section h2 {
  color: var(--smf-primary);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--smf-border);
  padding-bottom: 0.5rem;
}

.partner-section p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.partner-section a {
  color: var(--smf-primary);
  text-decoration: underline;
}

/* === Nästa nummer-artikel === */
.next-issue-cta {
  background: var(--smf-next-issue-mm2-26);
  color: white;
  padding: 2.5rem 2rem;
  border-radius: var(--radius) var(--radius) 0 0;
  text-align: center;
  margin-bottom: 0;
  border: none !important;
}

/* Desktop: skjut ner blå plattan så den inte krockar med absolut-positionerad
   "Skriv ut sidan"-knapp. På mobil ligger knappen statiskt ovanför, ingen krock. */
@media (min-width: 641px) {
  .next-issue-cta {
    margin-top: 2.5rem;
  }
}

.next-issue-cta .article-title {
  color: white !important;
  font-size: 2.25rem;
  margin: 0 0 1rem;
}

.next-issue-tema,
.next-issue-deadline {
  font-size: 1.25rem;
  margin: 0.5rem 0;
  color: white;
}

.next-issue-mail {
  margin-top: 1.5rem;
  font-size: 1rem;
  color: white;
}

.next-issue-mail a {
  color: white;
  text-decoration: underline;
  font-weight: 600;
}

.next-issue-hero {
  margin: 0 0 2rem !important;
}

.next-issue-hero img {
  width: 100%;
  height: auto;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  display: block;
}

/* Utgivningsplan-tabell (på nasta-nummer-sidan) */
.utgivningsplan {
  margin: 1rem 0 1.5rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.utgivningsplan th,
.utgivningsplan td {
  padding: 0.5rem 1rem;
  border: 1px solid var(--smf-border);
  text-align: left;
}

.utgivningsplan th {
  background: #f5f5f5;
  font-weight: 600;
  color: var(--smf-text);
}

/* === PRINT BUTTONS (skärm-only) === */
.print-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: var(--smf-accent, #6495ED);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.2s, transform 0.2s;
  white-space: nowrap;
}

.print-button:hover,
.print-button:active {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.print-button-secondary {
  background: var(--smf-text-light, #777);
}

.print-button-icon {
  font-size: 1.1em;
  line-height: 1;
}

@media (max-width: 640px) {
  .print-button-label {
    display: none;
  }
}

/* "Skriv ut hela tidningen" i navbar (alla sidor utom article) */
.print-button-magazine {
  background: var(--smf-primary, #2c3e50);
  margin-left: 0.5rem;
}

/* "Skriv ut sidan" inuti artikel — top-höger på desktop, block på mobil */
.article-reader {
  position: relative;
}

.article-print-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 5;
}

@media (max-width: 640px) {
  .article-print-button {
    position: static;
    margin-bottom: 1rem;
    display: inline-flex;
  }
  .article-print-button .print-button-label {
    display: inline;
  }
}

/* "Skriv ut hela tidningen" CTA på index (legacy, ej längre använd i index men kvar för bakåtkompatibilitet) */
.print-magazine-cta {
  text-align: center;
  margin-bottom: 3rem;
}

.print-magazine-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  background: var(--smf-primary, #2c3e50);
  color: white;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}

.print-magazine-button:hover,
.print-magazine-button:active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Skärm-preview av print-all.html */
.print-all-screen-controls {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  padding: 1rem;
  border-bottom: 1px solid var(--smf-border);
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.print-cover-page,
.print-toc-page,
.print-article {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem;
}

.print-cover-image {
  width: 100%;
  height: auto;
  display: block;
}

.print-cover-credit {
  text-align: right;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--smf-text-light);
  margin-top: 0.4rem;
}

.print-toc-category h2 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--smf-primary);
}

.print-toc-page ul {
  list-style: none;
  padding: 0;
}

.print-toc-page li {
  padding: 0.4rem 0;
  border-bottom: 1px dotted var(--smf-border);
}

.print-toc-page a {
  color: inherit;
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.print-toc-author {
  color: var(--smf-text-light);
  font-style: italic;
  font-size: 0.9em;
}

/* === @media print: gäller alla sidor som skrivs ut === */
@media print {
  @page {
    size: A4;
    margin: 2.5cm 2cm 2.5cm 2cm;
    /* Sidhuvud: tidningens namn (statiskt — Chrome stöder inte string-set) */
    @top-left {
      content: "MarsvinsMagazinet";
      font-family: Georgia, "Times New Roman", serif;
      font-size: 9pt;
      color: #555;
    }
    @top-center { content: ""; }   /* dölj browser-default (URL/datum) */
    @top-right {
      content: "Nr 2 2026 \00B7  \00C5rg\00E5ng 44";
      font-family: Georgia, "Times New Roman", serif;
      font-size: 9pt;
      color: #555;
      font-style: italic;
    }
    /* Sidfot: sidnummer högerställt */
    @bottom-left { content: ""; }   /* dölj browser-default */
    @bottom-center { content: ""; }
    @bottom-right {
      content: counter(page) " (" counter(pages) ")";
      font-family: Georgia, "Times New Roman", serif;
      font-size: 9pt;
      color: #555;
    }
  }

  /* Cover-sidan i print-all: minimal marginal (säker zon för konsumentskrivare),
     inga sidhuvuden, ingen sidnummer */
  @page cover {
    margin: 1cm;
    /* Tom sträng (inte "none") krävs för att överstyra Chromes browser-default
       headers/footers (datum, titel, URL, sidnummer) */
    @top-left { content: ""; }
    @top-center { content: ""; }
    @top-right { content: ""; }
    @bottom-left { content: ""; }
    @bottom-center { content: ""; }
    @bottom-right { content: ""; }
  }

  /* Namngiven default-sida för TOC och artiklar – Chrome låter annars
     @page cover läcka ut på sida 2. Samma regler som unnamed @page ovan. */
  @page main {
    size: A4;
    margin: 2.5cm 2cm 2.5cm 2cm;
    @top-left {
      content: "MarsvinsMagazinet";
      font-family: Georgia, "Times New Roman", serif;
      font-size: 9pt;
      color: #555;
    }
    @top-center { content: ""; }
    @top-right {
      content: "Nr 2 2026 \00B7  \00C5rg\00E5ng 44";
      font-family: Georgia, "Times New Roman", serif;
      font-size: 9pt;
      color: #555;
      font-style: italic;
    }
    @bottom-left { content: ""; }
    @bottom-center { content: ""; }
    @bottom-right {
      content: counter(page) " (" counter(pages) ")";
      font-family: Georgia, "Times New Roman", serif;
      font-size: 9pt;
      color: #555;
    }
  }

  .print-cover-page { page: cover; }
  .print-toc-page,
  .print-article { page: main; }

  /* Dölj UI-chrome, knappar och footer */
  header, nav, .hamburger, .menu-overlay, .side-menu,
  .print-button, .print-magazine-cta, .print-all-screen-controls,
  .article-print-button, .print-button-magazine,
  .site-footer, footer, .gdpr-approval, .powered-by,
  .claude-badge, .hero {
    display: none !important;
  }

  /* Bas: typografi och färg */
  html, body {
    background: white !important;
    color: #000 !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 12pt;
    line-height: 1.5;
  }

  *, *::before, *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Inga URL:er bredvid länkar */
  a, a:visited {
    color: inherit !important;
    text-decoration: none !important;
  }
  a::after { content: "" !important; }

  /* Bilder: max 30 % av sidhöjd, undvik delning över sidbrytning */
  img {
    max-width: 100% !important;
    max-height: 8cm !important;
    object-fit: contain !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Logos & assets — mindre än vanliga bilder (Agria, lokalavdelnings-logos m.m.) */
  img[src*="assets/" i],
  img[src*="logo" i],
  .lokalavdelning-logo,
  .footer-logo,
  .powered-by-logo {
    max-height: 4cm !important;
    width: auto !important;
  }

  /* Figure: figcaption (caption + credit) och linjen ska följa bildens bredd */
  figure {
    display: table;
    margin: 1rem auto;
    page-break-inside: avoid;
    break-inside: avoid;
    max-width: 100%;
  }
  figure img {
    display: block;
    width: auto !important;
    max-width: 100% !important;
  }
  figcaption {
    display: table-caption;
    caption-side: bottom;
  }

  /* Tabeller: visa hela bredden, mindre teckensnitt på papper */
  .table-wrapper {
    overflow: visible !important;
    -webkit-overflow-scrolling: auto !important;
  }
  .medlemsantal-tabell,
  .medlemsantal-tabell th,
  .medlemsantal-tabell td {
    font-size: 9pt !important;
  }
  .medlemsantal-tabell th,
  .medlemsantal-tabell td {
    padding: 0.25rem 0.4rem !important;
  }
  table {
    width: 100% !important;
  }

  /* Container: ta bort skärmlås */
  .container, .article-reader {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Rubriker — håll ihop med kropp */
  h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", serif;
    page-break-after: avoid;
    break-after: avoid-page;
    color: #000 !important;
  }

  h1 { font-size: 22pt; }
  h2 { font-size: 16pt; }
  h3 { font-size: 13pt; }

  p {
    orphans: 3;
    widows: 3;
  }

  /* === print-all.html: cover, TOC, artiklar === */
  .print-cover-page {
    display: grid;
    grid-template-rows: 1fr;
    grid-template-columns: 1fr;
    page-break-after: always;
    break-after: page;
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh;
    max-width: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print-cover-image {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: none !important;
    display: block;
  }

  .print-cover-title {
    grid-area: 1 / 1;
    align-self: end;
    justify-self: stretch;
    padding: 0 2cm 4cm;
    text-align: center;
  }

  .print-cover-title h1 {
    font-size: 54pt;
    font-weight: 700;
    color: #36454F !important;
    margin: 0 0 0.3cm;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print-cover-title p {
    font-size: 20pt;
    color: #36454F !important;
    margin: 0;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print-cover-credit {
    grid-area: 1 / 1;
    align-self: end;
    justify-self: end;
    padding: 0 0.75cm 0.5cm 0;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 9pt;
    font-style: italic;
    color: #36454F !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Nästa nummer-sidan: panel + bild ska sitta ihop som ett block (samma som webb) */
  .article-header.next-issue-cta {
    margin: 0 !important;
    padding: 1.5rem 1.5rem !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .next-issue-hero {
    display: block !important;
    margin: 0 0 1rem !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .next-issue-hero img {
    border-radius: 0 0 var(--radius) var(--radius) !important;
    max-height: 12cm !important;
    margin: 0 !important;
    display: block;
  }
  /* Override generic figcaption rule (display: table-caption) – funkar inte
     när .next-issue-hero är display: block. Block-layout + inline credit
     håller fotobylinen på 1 rad och hindrar text under bilden från att gömmas. */
  .next-issue-hero figcaption {
    display: block !important;
    caption-side: auto;
    margin: 0.3rem 0 0;
    padding: 0.3rem 0 0;
    border-top: 1px solid #ccc;
    font-size: 9pt;
    font-style: italic;
    color: #555;
    text-align: right;
  }
  .next-issue-hero figcaption .credit {
    display: inline !important;
  }

  .print-toc-page {
    page-break-after: always;
    break-after: page;
    max-width: none !important;
  }

  .print-toc-page h1 { font-size: 24pt; margin-bottom: 1rem; }
  .print-toc-page h2 { font-size: 14pt; margin-top: 1rem; }

  .print-toc-page ul {
    list-style: none;
    padding: 0;
  }

  .print-toc-page li {
    padding: 0.3rem 0;
    border-bottom: 1px dotted #888;
  }

  .print-toc-page a {
    display: block;
    text-decoration: none !important;
    color: #000 !important;
  }
  .print-toc-page .print-toc-title {
    display: inline;
  }
  .print-toc-page .print-toc-author {
    display: inline;
    margin-left: 0.4em;
  }

  /* Sidnummer i TOC: target-counter() har för dåligt browser-stöd för print —
     skippas medvetet. Re-implementera med JS om behovet kommer tillbaka. */

  .print-toc-author {
    color: #555 !important;
    font-style: italic;
  }

  /* Sidbrytning mellan artiklar i print-all */
  .print-article {
    page-break-before: always;
    break-before: page;
    max-width: none !important;
  }

  .article-header {
    page-break-after: avoid;
    margin-bottom: 1rem;
  }

  .article-title {
    font-size: 22pt !important;
    margin: 0 0 0.4rem !important;
    padding: 0 !important;
    text-align: left !important;
  }

  .article-meta {
    display: block;
    font-size: 10pt;
    color: #555 !important;
    margin: 0 0 1rem !important;
    padding: 0 !important;
    text-align: left !important;
  }
  .article-meta span {
    display: inline;
  }

  table {
    page-break-inside: avoid;
    break-inside: avoid;
    border-collapse: collapse;
  }

  /* === Sidor utanför articles/ – print-knapp i top-höger som articles === */
  .about-page,
  .form-page {
    position: relative;
  }

  /* === Annonser.html: vid utskrift, visa bara grundutseendet (intro + kontakt + huvudval). Göm undersektionerna även om någon valt en annonstyp. === */
  .form-page [data-section] {
    display: none !important;
  }

  /* === About.html: design-info i .powered-by ÄR innehåll här. Override generella regeln som gömmer .powered-by. === */
  .about-page .powered-by {
    display: block !important;
  }
}

/* === Rabattkod (medlemsformaner.html) ===
   Visuellt avvikande från brödtexten – läsare ska direkt se att detta är
   en kod att kopiera. Streckad ram + monospace + spärrad text ger
   kupong-/biljettkänsla. Ej fet, ej kursiv enligt önskemål.
   Klick kopierar koden via JS (se inline-script i medlemsformaner.html). */
.rabattkod {
  display: block;
  max-width: max-content;
  margin: 1.5rem auto;
  padding: 0.75rem 1.5rem;
  text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.25rem;
  font-weight: normal;
  font-style: normal;
  letter-spacing: 0.08em;
  color: var(--smf-accent);
  background: var(--smf-surface);
  border: 2px dashed var(--smf-primary);
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s, border-color 0.15s, transform 0.05s;
  user-select: all; /* fallback: gör koden markerbar med ett klick även om JS inte laddar */
}
.rabattkod:hover {
  background: #fff;
  border-color: var(--smf-accent);
}
.rabattkod:active {
  transform: scale(0.98);
}
.rabattkod:focus-visible {
  outline: 3px solid var(--smf-accent);
  outline-offset: 3px;
}
/* Bekräftelse-bubbla över koden när den just kopierats */
.rabattkod.copied::after {
  content: "Kopierat ✓";
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--smf-text);
  color: #fff;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: normal;
  white-space: nowrap;
  pointer-events: none;
  animation: rabattkodCopiedFade 1.6s ease forwards;
}
@keyframes rabattkodCopiedFade {
  0%   { opacity: 0; transform: translateX(-50%) translateY(4px); }
  12%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-2px); }
}

/* === Disclaimer / finstilt text ===
   Återanvändbar klass för villkor, undantag, juridiska påpekanden o.s.v.
   Mindre och dämpad färg så texten finns där utan att konkurrera med brödet.
   Sträcker sig över hela kolumnens bredd – då löper ögat snabbt förbi
   och stycket smälter in i textflödet i stället för att framstå som en
   egen ruta. Använd på <p> eller <div> som behöver tonas ned. */
.disclaimer {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--smf-text-light);
  margin: 1rem 0;
}

/* Skärmvy: positionera print-knappen på .about-page och .form-page (samma stil som .article-reader använder via .article-print-button) */
.about-page,
.form-page {
  position: relative;
}