:root{
  --bg: #0E1113;
  --surface: #141A1D;
  --text: #F2F4F5;
  --muted: #B7C0C3;
  --line: rgba(255,255,255,.08);
  --accent: #FFC300;
  --accent2: #123E3A;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --radius: 16px;
  --radius-sm: 12px;
  --max: 1060px;
  --content-pad: 22px;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
html{ overflow-y: scroll; }


body{
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: .2px;
}

/* Detta är nyckeln: bara "sidans content-wrap" (inte headerns wrap) får växa */
body > .wrap{
  flex: 1 0 auto;
}

/* Footern ska aldrig krympa och hamnar automatiskt längst ner */
.footer-wrap{
  flex-shrink: 0;
  margin-top: auto;
}

/* Länkar ska INTE bli “default blå” */
a{ color: inherit; text-decoration: none; }
a:visited{ color: inherit; }

:focus-visible{
  outline: 2px solid rgba(255,195,0,.55);
  outline-offset: 2px;
  border-radius: 8px;
}

.wrap{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0px 18px 40px;
}

/* Enhetlig vertikal rytm – bara i sidans content (inte headerns wrap) */
body > .wrap > * + *{
  margin-top: 18px;  /* justera 14–20px */
}

/* ---------- HEADER (global) ---------- */

.site-header{
  border-bottom: none !important;
  box-shadow: none !important;
}

.site-header .wrap{
  padding: 4px 18px 2px;
}

.header-right-link{
  margin-left: auto;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.header-right-link a{
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.header-right-link a:hover{
  text-decoration: underline;
  opacity: 0.9;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding: 4px var(--content-pad) 8px;
}

/* ---------- HEADER: högerlänk "Om KLN Teknik AB" ---------- */

.site-header .topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}

.site-header .header-right-link{
  display:flex;
  align-items:center;
  margin-left:auto;
}

.site-header .header-right-link .cta-link{
  font-size: 12px;              /* samma som .nav */
  color: var(--accent);           /* orange */
  text-decoration: none;
  opacity: .75;
  padding: 6px 8px;               /* samma känsla som .nav a */
  border-radius: 8px;
  white-space: nowrap;
}

.site-header .header-right-link .cta-link:hover{
  background: rgba(255,255,255,.05);
  opacity: 1;
}

/* robust styling: alla länkar i header ska få rätt ton */
.site-header a{
  color: var(--muted);
}
.site-header a:hover{
  color: var(--text);
}

.logo-link{
  display:flex;
  align-items:center;
  line-height:0;
  margin-left: -22px; /* din “justera vänster” */
}

.logo-link img{
  height: 100px;
  width:auto;
  display:block;
}

.logo-link:hover img{ opacity:.85; }

/* Fallback: om loggan saknar .logo-link i HTML */
img[alt="KLN Teknik AB"]{
  height: 56px;
  width:auto;
  display:block;
}

.nav{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content:flex-end;
  color: var(--muted);
  font-size: 12px;
}

.nav span{ opacity:.55; }

.nav a{
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--muted);
}

.nav a:hover{
  background: rgba(255,255,255,.05);
  color: var(--text);
}

/* ---------- HERO ---------- */

.hero{
  padding: 18px 0 6px; /* luft mellan meny och första blocket */
  margin-bottom: 6px;
}

/* Enhetligt avstånd mellan alla block i hero-sektionen */
.hero > * + *{
  margin-top: 18px; /* justera 14–18px */
}

.hero-card{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  padding: 18px 28px 16px; /* var 28px 28px 26px */
  margin-bottom: 0px;
  position: relative;
}

/* Tightare typografi i hero-cards (minskar luft i botten och mellan stycken) */
.hero-card p{ margin: 0 0 10px; }
.hero-card ul{ margin: 0 0 10px; padding-left: 18px; }
.hero-card ul li{ margin: 6px 0; }

/* Ta bort extra luft på sista elementet i kortet */
.hero-card p:last-child,
.hero-card ul:last-child{ margin-bottom: 0; }

.hero-inner{ position: relative; }

.kicker{
  color: rgba(183,192,195,.85);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1.4px;
  margin-bottom: 8px;
}

h1{
  margin: 0 0 10px;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.15;
  font-weight: 600;
  color: var(--accent);
}

.lead{
  margin: 0 0 8px;
  max-width: 80ch;
  color: rgba(242,244,245,.85);
  font-size: 14px;
}

.seo-note{
  margin-top: 6px;
  max-width: 80ch;
  color: rgba(183,192,195,.60);
  font-size: 12px;
}

.signature-line{
  font-size: 12px;
  letter-spacing: .4px;
  color: rgba(242,244,245,.60);
  margin: 0 0 8px;
}

/* Finare radbrytning på moderna webbläsare */
.lead, .seo-note{
  text-wrap: pretty;
  hyphens: auto;
}

/* ---------- SECTIONS ---------- */

section{ padding: 6px 0 0; }

.section-title{
  margin: 0 0 8px;
  font-size: 18px;
}

.hero-card h2{
  color: var(--accent);
  font-size: 18px;     /* matcha din section-title */
  line-height: 1.2;
  font-weight: 600;
  margin: 10 0 10px;
}

.section-sub{
  color: var(--muted);
  margin: 0 0 14px;
  max-width: 92ch;
}

.page .section-card{
  margin-left: 0;
}

/* ---------- GRID / CARDS ---------- */

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  margin-top: 0px;    /* ---------- Ändrade från 10 ---------- */
}

.card{
  grid-column: span 4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  overflow: hidden;
  transition: box-shadow .2s ease;
}

.card:hover{ transform:none; }

/* CARD IMAGE (16:9) */
.thumb{
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

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

/* Finjustera crop per bild */
.thumb img[alt*="Industri"]{ object-position: 50% 55%; }
.thumb img[alt*="System"]{ object-position: 50% 50%; }
.thumb img[alt*="Rådgivning"]{ object-position: 50% 25%; }

.card-body{ padding: 14px 16px 12px; }

.card h3{
  margin: 6px 0 6px;    /* ---------- tidigare 8 0 6 ---------- */
  font-size: 16px;
  color: var(--accent);
}

.micro{
  color: var(--muted);
  font-size: 14px;
}

.micro-more{
  margin-top: 8px;    /* ---------- tidigare 8 ---------- */
  font-size: 14px;
  color: rgba(242,244,245,.82);
}

/* Fyll ut brödtexten i korten (”justify”) */
.card .micro,
.card .micro-more{
  hyphens: auto;
}

/* ---------- INNOVATION BLOCK ---------- */

#innovation{ margin-top: 22px; }   /* ---------- tidigare 26 ---------- */

#innovation h2{
  color: var(--accent);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 10px;
}

/* ---------- FOOTER CONTACT + FOOTER ---------- */

.footer-wrap{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--content-pad) 28px;
  text-align: left; /* viktig: aldrig “center” i wrap */
}

.footer-contact{
  margin-top: 10px;
  margin-bottom: 14px;
}

.footer-contact-text{
  color: rgba(242,244,245,.75);
  font-size: 12px;
  line-height: 1.55;
}

/* mail-länk i raden (gul/orange) */
.footer-contact-text a.footer-mail-inline,
.footer-mail-inline,
.footer-mail-inline:visited{
  color: var(--accent) !important;
  font-weight: 600;
  text-decoration: none;
}

.footer-mail-inline:hover{ opacity:.85; }

/* OBS: vi stylar .site-footer (inte generiska footer-taggen) för att undvika konflikter */
.site-footer{
  margin-top: 12px;
  padding-top: 0;
  border-top: none;
  color: rgba(242,244,245,.65);
  font-size: 12px; /* mindre, som du ville */
  display:flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  text-align:left;
}

.footer-left{ max-width: 70ch; }
.footer-right{
  font-weight: 500;
  opacity: .85;
  white-space: nowrap;
}

/* Footer About link */
.footer-about-link{
  color: var(--accent) !important;
}



/* ---------- UNDERSIDOR (page) ---------- */

.page{
  padding-bottom: 8px;
}

.page-hero{
  margin-bottom: 8px;    /* ---------- tidigare 10 ---------- */
}

.page-section{
  padding-top: 10px;
}

.page-card{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  padding: 16px 18px;
}

/* typografi i undersidans boxar: matcha index */
.page .page-card p,
.page .page-card li{
  color: rgba(242,244,245,.82);
  font-size: 12px;
  line-height: 1.65;
}

.page .page-card p:first-child{ margin-top: 0; }
.page .page-card p:last-child{ margin-bottom: 0; }

.page h1{ color: var(--accent); }
.page .section-title{ color: var(--accent); }

.page-list{
  margin: 10px 0 0;
  padding-left: 18px;
}

.page-list li{ margin: 6px 0; }

/* ---------- RESPONSIVE ---------- */

@media (max-width: 980px){
  .card{ grid-column: span 6; }
}

@media (max-width: 640px){
  /* loggan mindre på iPhone */
  .logo-link img{ height: 38px; }

  /* menyn synlig men mer kompakt (inte “standard blå”) */
  .nav{
    font-size: 12px;
    gap: 6px;
    justify-content: flex-start;
  }
  .nav a{
    padding: 4px 6px;
    border-radius: 7px;
  }

  .card{ grid-column: span 12; }

  .site-footer{
    font-size: 12px;
  }
  .footer-right{
    white-space: normal;
  }
}

.footer-wrap{
  width: 100%;
}

.site-footer{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  text-align: left;
}

.footer-left{
  text-align: left;
}

.footer-right{
  text-align: right;
}



/* Bildblock - Om-sidan */
.image-block {
  position: relative;
  min-height: 260px;
  border-radius: 18px;
  overflow: hidden;
  background-image: url('/assets/kln-bakgrund.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 20px;    /* ---------- tidigare 40 ---------- */
}

/* subtil mörk toning så den matchar övriga block */
.image-block .image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(14,17,19,0.75),
    rgba(14,17,19,0.35),
    rgba(14,17,19,0.75)
  );
}

/* ===== Enhetlig brödtext över hela sajten ===== */


/* Säkerställ vänsterlinjering */
.block,
.hero-card {
  text-align: left;
}

/* Säkerställ att alla undersidor använder samma layoutbredd */
.wrap.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-divider {
  height: 1px;
  margin: 10px 0 25px 0;  /* ---------- tidigare 20 0 25 ---------- */
  background: linear-gradient(
    to right,
    rgba(255,255,255,0.15) 0%,
    rgba(255,255,255,0.15) 60%,
    transparent 100%
  );
}

.card a {
    font-weight: 600;
    font-size: 0.95rem;
}

.highlight-link {
  color: var(--accent) !important;
  text-decoration: none;
  font-weight: 500;
}

.highlight-link:hover {
  opacity: 0.85;
}

/* Luft mellan micro-stycken (men inte inne i hero-cards) */
.wrap > p.micro + p.micro{
  margin-top: 10px;
}

/* --- FIX: micro-element ska aldrig krympa/centreras i flex-layouter --- */
p.micro,
ul.micro{
  width: 100%;
  max-width: 100%;
  align-self: stretch;  /* gör att de fyller bredd även om parent är flex + align-items:center */
}

/* Säkerställ att content alltid fyller bredden */
.wrap { width: 100%; }
.hero-card { width: 100%; }

/* Om någon parent råkar vara flex+center: sträck ut blocken */
.hero-card, .hero-inner, p.micro, ul.micro {
  max-width: 100%;
}

/* Topbar: logo left, language right */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
}

/* Language switch styling */
.lang-switch{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 11px;          /* <- matcha din övriga UI-text */
  line-height: 1;
}

.lang-switch a{
  display:flex;
  align-items:center;
  gap: 6px;
  color: var(--muted);
  text-decoration:none;
  letter-spacing: .02em;
  opacity: .85;
  font-weight: 500;
}

.lang-switch a:hover{ opacity: 1; }

.lang-switch .sep{
  opacity:.35;
  user-select:none;
}

.flag-icon{
  width: 12px;
  height: 8px;
  display:block;
  border-radius: 2px;
  /* om svg:n har “luft” runt sig kan du prova: */
  /* transform: translateY(-0.5px); */
}

/* FORCE flag size (wins over global img rules + svg intrinsic size) */
.lang-switch img.flag-icon{
  width: 12px !important;
  height: 8px !important;
  max-width: 12px !important;
  max-height: 8px !important;
  display: inline-block !important;
}

.lang-switch{
  display: flex;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.lang-switch a{
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
}

