/* Ursprung Sverige - Scandinavian Minimal Design */

/* Self-hosted fonts - DM Serif Display */
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/DMSerifDisplay-Regular.ttf') format('truetype');
}

/* Self-hosted fonts - Karla (variable font) */
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/Karla-Variable.ttf') format('truetype');
}

:root {
  /* Swedish-inspired palette */
  --color-bg: #faf9f7;
  --color-bg-alt: #f0eeea;
  --color-text: #1a1a1a;
  --color-text-muted: #5a5a5a;
  --color-accent: #005baa;
  --color-accent-gold: #fecc00;
  --color-border: #d8d4cc;
  --color-card-bg: #ffffff;
  
  /* Badge tier colors */
  --badge-tier-1-bg: linear-gradient(135deg, #c9a227 0%, #f4d03f 50%, #c9a227 100%);
  --badge-tier-1-text: #1a1a1a;
  --badge-tier-2-bg: linear-gradient(135deg, #7b8a8b 0%, #bdc3c7 50%, #7b8a8b 100%);
  --badge-tier-2-text: #1a1a1a;
  --badge-tier-3-bg: linear-gradient(135deg, #a0522d 0%, #cd853f 50%, #a0522d 100%);
  --badge-tier-3-text: #ffffff;
  --badge-tier-4-bg: var(--color-accent);
  --badge-tier-4-text: #ffffff;
  
  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Karla', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  
  /* Sizes */
  --max-width: 1200px;
  --border-radius: 4px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: 800px;
}

/* Header */
.site-header {
  background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

.site-header--single {
  padding: var(--space-lg) 0;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
}

.header-content {
  flex: 1;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.site-title--small {
  font-size: 1.5rem;
  margin-bottom: 0;
}

.site-title-link {
  text-decoration: none;
  color: inherit;
}

.site-title-link:hover .site-title {
  color: var(--color-accent);
}

.site-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 500px;
}

.header-decoration {
  flex-shrink: 0;
}

.sweden-motif {
  width: 80px;
  height: 48px;
  opacity: 0.9;
}

/* Filters */
.filter-section {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.filter-group select,
.filter-group input {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background-color: var(--color-card-bg);
  color: var(--color-text);
  min-width: 160px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-group select:hover,
.filter-group input:hover {
  border-color: var(--color-accent);
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 91, 170, 0.1);
}

.clear-filters-btn {
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background-color: var(--color-bg-alt);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-filters-btn:hover {
  background-color: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}

.filter-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.entry-count {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.badges-info-link {
  font-size: 0.875rem;
  color: var(--color-accent);
  text-decoration: none;
}

.badges-info-link:hover {
  text-decoration: underline;
}

/* Main content */
.site-main {
  flex: 1;
  padding-bottom: var(--space-xl);
}

.site-main--single {
  padding-top: var(--space-lg);
}

/* Entry cards grid */
.entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}

.entry-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.entry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.entry-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.entry-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entry-card-content {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.entry-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.entry-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: var(--border-radius);
  flex-shrink: 0;
}

.entry-card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--color-text);
  flex: 1;
}

.entry-card h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.entry-card h2 a:hover {
  color: var(--color-accent);
}

/* Badges */
.badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  white-space: nowrap;
  cursor: help;
}

.badge-tier-1 {
  background: var(--badge-tier-1-bg);
  color: var(--badge-tier-1-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.badge-tier-2 {
  background: var(--badge-tier-2-bg);
  color: var(--badge-tier-2-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.badge-tier-3 {
  background: var(--badge-tier-3-bg);
  color: var(--badge-tier-3-text);
}

.badge-tier-4 {
  background: var(--badge-tier-4-bg);
  color: var(--badge-tier-4-text);
}

.entry-meta {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.entry-meta .filter-btn,
.filter-link {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
  text-decoration: none;
}

.entry-meta .filter-btn:hover,
.filter-link:hover {
  opacity: 0.8;
  transform: scale(1.02);
}

.entry-meta .category,
.filter-link.category {
  background: var(--color-accent);
  color: white;
}

.entry-meta .region,
.filter-link.region {
  background: var(--color-accent-gold);
  color: var(--color-text);
}

.entry-body {
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  font-size: 0.9375rem;
  flex: 1;
}

.entry-body p {
  margin-bottom: var(--space-sm);
}

.entry-body p:last-child {
  margin-bottom: 0;
}

.website-link {
  display: inline-block;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
  transition: opacity 0.2s ease;
}

.website-link:hover {
  opacity: 0.7;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: auto;
}

.tag {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.tag:hover {
  background: var(--color-accent);
  color: white;
}

/* No results */
.no-results {
  text-align: center;
  padding: var(--space-xl);
  color: var(--color-text-muted);
  font-size: 1.125rem;
}

/* Hidden utility */
[hidden] {
  display: none !important;
}

/* Single entry page */
.single-entry {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.single-image {
  aspect-ratio: 21/9;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.single-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.single-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  padding-bottom: var(--space-sm);
}

.single-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: var(--border-radius);
  flex-shrink: 0;
}

.single-title-wrapper {
  flex: 1;
}

.single-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.single-header .badge {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
}

.single-meta {
  display: flex;
  gap: var(--space-sm);
  padding: 0 var(--space-lg);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.single-body {
  padding: 0 var(--space-lg);
  margin-bottom: var(--space-lg);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text);
}

.single-body p {
  margin-bottom: var(--space-md);
}

.single-entry .website-link {
  display: block;
  padding: 0 var(--space-lg);
  margin-bottom: var(--space-lg);
}

.single-entry .tags {
  padding: 0 var(--space-lg);
  margin-bottom: var(--space-lg);
}

.back-link {
  display: block;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

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

/* Footer */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: var(--space-lg) 0;
  text-align: center;
}

.site-footer p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.footer-tagline {
  margin-top: var(--space-xs);
  font-style: italic;
}

.footer-nav {
  margin-top: var(--space-md);
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
}

.footer-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.footer-nav a:hover {
  color: var(--color-accent);
}

/* Responsive */
@media (max-width: 768px) {
  .site-header .container {
    flex-direction: column;
    text-align: center;
  }
  
  .header-decoration {
    order: -1;
  }
  
  .site-subtitle {
    margin: 0 auto;
  }
  
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group select,
  .filter-group input {
    width: 100%;
  }
  
  .clear-filters-btn {
    width: 100%;
  }
  
  .entries-grid {
    grid-template-columns: 1fr;
  }

  .single-header {
    flex-direction: column;
    text-align: center;
  }
}

/* About page */
.about-page {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
}

.about-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  margin-bottom: var(--space-lg);
}

.about-section {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.about-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.about-section h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: var(--space-md);
}

.about-section p {
  margin-bottom: var(--space-sm);
  line-height: 1.7;
}

.about-section ul {
  list-style: none;
  margin: var(--space-md) 0;
}

.about-section li {
  padding: var(--space-sm) 0;
  padding-left: var(--space-lg);
  position: relative;
  line-height: 1.6;
}

.about-section li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

.about-page .back-link {
  display: inline-block;
  margin-top: var(--space-lg);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.about-page .back-link:hover {
  color: var(--color-accent);
}

/* Badges info page */
.badges-page {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
}

.badges-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  margin-bottom: var(--space-md);
}

.badges-page .intro {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
  line-height: 1.7;
}

.badge-tier-section {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.badge-tier-section:last-of-type {
  border-bottom: none;
}

.badge-tier-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.tier-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--border-radius);
}

.badge-tier-section p {
  margin-bottom: var(--space-sm);
  line-height: 1.7;
}

.badge-tier-section .criteria {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius);
  margin-top: var(--space-md);
}

.why-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.why-section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: var(--space-md);
}

.why-section ul {
  list-style: none;
  margin: var(--space-md) 0;
}

.why-section li {
  padding: var(--space-sm) 0;
  padding-left: var(--space-lg);
  position: relative;
}

.why-section li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

.badges-page .back-link {
  display: inline-block;
  margin-top: var(--space-lg);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.badges-page .back-link:hover {
  color: var(--color-accent);
}

/* Print styles */
@media print {
  .filter-section,
  .header-decoration,
  .back-link {
    display: none;
  }
  
  .entry-card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }
}
