/* =============================================
   AI-portal för Karlskoga kommun
   Grafisk profil: DM Sans + Source Serif Pro
   Färggrupp: Grön
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,400&display=swap');

/* --- CSS Variables --- */
:root {
  /* Grön färggrupp */
  --primary:       #00A78B;
  --dark-sec:      #0F6F60;
  --light-sec:     #7AF3D7;
  --tint1:         #D2EFE7;
  --tint2:         #EEFAF7;

  /* Gul accent */
  --accent:        #FFF29D;

  /* Svart & vit */
  --dark:          #2A2F31;
  --black:         #000000;
  --white:         #FFFFFF;

  /* Typografi */
  --font-sans:     'DM Sans', sans-serif;
  --font-serif:    'Source Serif 4', serif;

  /* Layout */
  --max-width:     1100px;
  --nav-width:     260px;
  --radius:        4px;
  --radius-lg:     12px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--dark);
  background: var(--white);
  display: flex;
  min-height: 100vh;
}

a { color: var(--dark-sec); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--primary); }

h1, h2, h3, h4, h5 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.2;
  color: var(--dark);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); margin-bottom: 0.75rem; margin-top: 2rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.5rem; margin-top: 1.5rem; }
h4 { font-size: 1rem; margin-bottom: 0.4rem; margin-top: 1.2rem; }

p { margin-bottom: 1rem; }

p.lead {
  font-size: 1.1rem;
  color: #444;
  margin-bottom: 1.5rem;
}

.serif { font-family: var(--font-serif); }

strong { font-weight: 600; }

ul, ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}
li { margin-bottom: 0.3rem; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
th {
  background: var(--tint1);
  font-weight: 600;
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 2px solid var(--primary);
}
td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--tint1);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }

/* --- Sidonav --- */
.site-nav {
  width: var(--nav-width);
  min-height: 100vh;
  background: var(--dark);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1.5rem 1.25rem 1.25rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-logo-shield {
  flex-shrink: 0;
}

.nav-logo-text {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.25;
  color: var(--white);
  letter-spacing: 0.01em;
}

.nav-logo-text span {
  display: block;
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--light-sec);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-section {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 0.5rem 1.25rem 0.25rem;
}

.nav-link {
  display: block;
  padding: 0.4rem 1.25rem 0.4rem 1.25rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.04);
}

.nav-link.active {
  color: var(--light-sec);
  border-left-color: var(--primary);
  background: rgba(0,167,139,0.08);
}

.nav-link.sub {
  padding-left: 2rem;
  font-size: 0.825rem;
}

/* --- Huvudinnehåll --- */
.site-main {
  margin-left: var(--nav-width);
  flex: 1;
  min-width: 0;
}

/* --- Header med sköld-grafik --- */
.page-header {
  background: var(--dark-sec);
  color: var(--white);
  padding: 3rem 3rem 2.5rem;
  position: relative;
  overflow: hidden;
}

.page-header::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 280px;
  height: 280px;
  opacity: 0.06;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 220'%3E%3Cpath fill='white' d='M10,10 L190,10 L190,150 Q190,210 100,220 Q10,210 10,150 Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.page-header h1 {
  color: var(--white);
  max-width: 680px;
}

.page-header .lead {
  color: var(--tint1);
  max-width: 620px;
  margin-bottom: 0;
}

.page-header .breadcrumb {
  font-size: 0.8rem;
  color: var(--light-sec);
  margin-bottom: 1rem;
  opacity: 0.8;
}
.page-header .breadcrumb a {
  color: var(--light-sec);
  text-decoration: none;
}
.page-header .breadcrumb a:hover { text-decoration: underline; }

/* Hemsidhuvud */
.home-header {
  background: var(--dark-sec);
  color: var(--white);
  padding: 4rem 3rem 3rem;
  position: relative;
  overflow: hidden;
}

.home-header::before {
  content: '';
  position: absolute;
  right: 3rem;
  top: 50%;
  transform: translateY(-50%);
  width: 200px;
  height: 220px;
  opacity: 0.07;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 220'%3E%3Cpath fill='white' d='M10,10 L190,10 L190,150 Q190,210 100,220 Q10,210 10,150 Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.home-header h1 { color: var(--white); max-width: 600px; font-size: clamp(2rem, 4vw, 3rem); }
.home-header .lead { color: var(--tint1); max-width: 580px; font-size: 1.1rem; margin-bottom: 0; }

/* --- Content area --- */
.content-wrap {
  max-width: 780px;
  padding: 3rem;
}

/* --- Kortlista på startsidan --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  padding: 2.5rem 3rem;
  background: var(--tint2);
  border-top: 1px solid var(--tint1);
}

.card {
  background: var(--white);
  border: 1px solid var(--tint1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--dark);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  border-left: 4px solid var(--primary);
}

.card:hover {
  box-shadow: 0 4px 20px rgba(0,167,139,0.12);
  transform: translateY(-2px);
  border-left-color: var(--dark-sec);
  color: var(--dark);
  text-decoration: none;
}

.card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.card h3 {
  font-size: 1rem;
  margin: 0;
  color: var(--dark-sec);
}

.card p {
  font-size: 0.875rem;
  color: #555;
  margin: 0;
  line-height: 1.4;
}

/* --- Info-box --- */
.info-box {
  background: var(--tint1);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.warning-box {
  background: #fff8e1;
  border-left: 4px solid #f9a825;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

/* --- Steg-lista (kom igång) --- */
.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: flex-start;
}

.steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

/* --- FAQ accordion --- */
.faq-item {
  border-bottom: 1px solid var(--tint1);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1rem 0;
  font-family: var(--font-sans);
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-question:hover { color: var(--primary); }

.faq-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--tint1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--primary);
  transition: transform 0.2s;
}

.faq-answer {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.7;
  color: #444;
  padding-bottom: 1rem;
  display: none;
}

.faq-item.open .faq-answer { display: block; }
.faq-item.open .faq-icon { transform: rotate(45deg); }

/* --- Ordlista --- */
.glossary dt {
  font-weight: 600;
  color: var(--dark-sec);
  margin-top: 1.25rem;
}
.glossary dd {
  font-family: var(--font-serif);
  margin-left: 0;
  color: #444;
  font-size: 0.95rem;
}

/* --- Intric sub-nav --- */
.sub-page-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1.5rem 3rem 0;
  border-bottom: 1px solid var(--tint1);
  background: var(--white);
}

.sub-page-nav a {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: #555;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.sub-page-nav a:hover { color: var(--primary); }
.sub-page-nav a.active { color: var(--dark-sec); border-bottom-color: var(--primary); font-weight: 600; }

/* --- Kontaktpersoner --- */
.contact-table td:first-child { font-weight: 500; }

/* --- Footer --- */
.site-footer {
  background: var(--tint2);
  border-top: 1px solid var(--tint1);
  padding: 1.5rem 3rem;
  font-size: 0.8rem;
  color: #888;
}

/* --- Shield SVG utility --- */
.shield-inline {
  display: inline-block;
  vertical-align: middle;
}

/* --- Mobil --- */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: var(--dark-sec);
  border: none;
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.2s;
}

@media (max-width: 768px) {
  .site-nav {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .site-nav.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
  }
  .site-main { margin-left: 0; }
  .mobile-menu-toggle { display: flex; }
  .page-header, .home-header, .content-wrap, .card-grid { padding-left: 1.25rem; padding-right: 1.25rem; }
  .sub-page-nav { padding-left: 1.25rem; padding-right: 1.25rem; }
  .site-footer { padding-left: 1.25rem; padding-right: 1.25rem; }
}

/* --- Hjälpklasser --- */
.mt-0 { margin-top: 0 !important; }
.text-muted { color: #666; font-size: 0.9rem; }
.tag {
  display: inline-block;
  background: var(--tint1);
  color: var(--dark-sec);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  letter-spacing: 0.03em;
}
.divider {
  border: none;
  border-top: 1px solid var(--tint1);
  margin: 2rem 0;
}
