/* Poppins via Google Fonts — degrader til Arial offline. */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* OsloKollega palette (brandpad.io/oslokollega) */
  --brand: #11183d;          /* Dark Blue (primary) */
  --brand-2: #1c2555;        /* subtle lift for gradients */
  --gold: #f2cc8f;           /* Gold/Tan */
  --ice: #bbe8ff;            /* Ice Blue */
  --coral: #f2545c;          /* Dark Coral (K-accent) */
  --green: #08605f;          /* secondary */
  --purple: #586ba4;         /* secondary */
  --light-blue: #d0d1dc;     /* secondary */

  /* semantic tokens */
  --bg: #f7f7fb;
  --surface: #ffffff;
  --ink: var(--brand);
  --ink-soft: #4a5273;
  --ink-mute: #8891af;
  --line: #e3e5ef;
  --brand-soft: var(--ice);
  --accent: var(--coral);
  --focus: var(--gold);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(17,24,61,.06);
  --shadow-md: 0 8px 24px rgba(17,24,61,.10);
  --maxw: 980px;

  --font: 'Poppins', Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 16px; line-height: 1.55;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 96px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
h1, h2, h3 { letter-spacing: -.2px; }

/* --- top bar --- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  padding-top: max(10px, env(safe-area-inset-top));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-block;
  width: 30px; height: 30px;
  object-fit: contain;
}
.brand-name {
  font-weight: 700; font-size: 17px;
  letter-spacing: .1px;
  color: var(--brand);
}
.brand-name em {
  color: var(--ink-mute);
  font-style: normal; font-weight: 500;
  margin-left: 6px;
  font-size: 15px;
}

.search {
  position: relative;
  flex: 1; max-width: 460px; margin-left: auto;
}
.search input {
  width: 100%;
  padding: 10px 34px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.search input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(17,24,61,.12);
}
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px;
  border: 0; background: transparent;
  border-radius: 50%;
  color: var(--ink-mute); font-size: 20px; line-height: 1;
  cursor: pointer;
}
.search-clear:hover { background: var(--line); color: var(--ink); }

/* --- layout --- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 22px 16px 24px; }

/* --- hero --- */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  padding: 26px 24px 26px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; right: -30px; top: -20px;
  width: 180px; height: 180px;
  background: radial-gradient(circle at center, rgba(242,84,92,.22) 0%, rgba(242,84,92,0) 65%);
  pointer-events: none;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 24px; font-weight: 700;
}
.hero h1 .hero-accent { color: var(--gold); }
.hero p {
  margin: 0;
  opacity: .92;
  font-size: 15px;
  max-width: 620px;
}

/* --- section tiles (home grid) --- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  text-decoration: none;
  color: var(--ink);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.tile::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--tile-color, var(--brand));
  opacity: .8;
}
.tile:hover, .tile:focus-visible {
  transform: translateY(-2px);
  border-color: var(--tile-color, var(--brand));
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.tile-icon {
  font-size: 26px; line-height: 1;
  margin-bottom: 10px; display: inline-block;
}
.tile-title { font-weight: 700; font-size: 17px; margin: 0 0 4px; color: var(--brand); }
.tile-sub { font-size: 14px; color: var(--ink-soft); margin: 0; }
.tile-meta {
  font-size: 12px; color: var(--ink-mute);
  margin-top: 10px;
  font-weight: 500;
}

/* --- section page --- */
.crumbs {
  font-size: 13px; color: var(--ink-mute);
  margin: 4px 0 12px;
  font-weight: 500;
}
.crumbs a { color: var(--ink-mute); }
.crumbs a:hover { color: var(--brand); }

.section-head {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 20px;
  padding: 16px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  border-left: 5px solid var(--section-color, var(--brand));
  box-shadow: var(--shadow-sm);
}
.section-head .section-icon {
  font-size: 34px; line-height: 1; flex-shrink: 0;
}
.section-head h1 {
  margin: 0 0 6px; font-size: 22px; color: var(--brand);
}
.section-head p { margin: 0; color: var(--ink-soft); font-size: 15px; }

.subgroup { margin-bottom: 22px; }
.subgroup h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--ink-mute); margin: 0 0 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
  font-weight: 600;
}

/* --- file list --- */
.files { list-style: none; padding: 0; margin: 0; }
.file {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s, background .15s, transform .1s;
}
.file:hover, .file:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
  text-decoration: none;
}
.file:active { transform: scale(.995); }
.file-icon {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 8px;
  font-size: 11px; font-weight: 700; color: #fff;
  letter-spacing: .3px;
  flex-shrink: 0;
}
.file-icon.pdf { background: var(--coral); }
.file-icon.doc, .file-icon.docx { background: var(--brand); }
.file-icon.ppt, .file-icon.pptx, .file-icon.pptm { background: var(--green); }
.file-icon.xls, .file-icon.xlsx { background: #16794c; }
.file-icon.other { background: var(--ink-mute); }
.file-body { flex: 1; min-width: 0; }
.file-title { font-weight: 600; font-size: 15px; color: var(--brand); }
.file-meta { font-size: 12px; color: var(--ink-mute); margin-top: 1px; }
.file-arrow { color: var(--ink-mute); font-size: 22px; flex-shrink: 0; font-weight: 300; }
.file:hover .file-arrow { color: var(--brand); }

.tag {
  display: inline-block;
  font-size: 10px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--brand);
  margin-left: 8px;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.tag-muted { background: var(--light-blue); color: var(--ink-soft); }
.file-oversized {
  opacity: .65; cursor: not-allowed;
  border-style: dashed !important;
  background: var(--bg) !important;
}
.file-oversized:hover { border-color: var(--line) !important; background: var(--bg) !important; }

/* --- search results --- */
.search-head {
  margin-bottom: 12px; color: var(--ink-soft); font-size: 14px;
  font-weight: 500;
}
.search-empty {
  padding: 32px 16px; text-align: center;
  color: var(--ink-mute);
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.hit-path { font-size: 12px; color: var(--ink-mute); font-weight: 500; }
.hit-path a { color: var(--brand); }

/* --- bottom nav (mobile app feel) --- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  box-shadow: 0 -1px 10px rgba(17,24,61,.06);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px;
  font-size: 11px; font-weight: 600;
  color: var(--ink-mute);
  text-decoration: none;
}
.bottom-nav a:hover { color: var(--brand); text-decoration: none; }
.bottom-nav a > span:first-child { font-size: 20px; line-height: 1.1; }
.bottom-nav a.active { color: var(--coral); }

/* --- footer --- */
.foot {
  max-width: var(--maxw); margin: 24px auto 0;
  padding: 16px; text-align: center;
  color: var(--ink-mute); font-size: 12px;
}
.foot-sub { margin-top: 4px; }
.foot img.foot-logo {
  height: 20px; opacity: .55; margin-bottom: 8px;
  display: block; margin-left: auto; margin-right: auto;
}

/* --- responsive --- */
@media (max-width: 520px) {
  .brand-name em { display: none; }
  .hero { padding: 20px; }
  .hero h1 { font-size: 21px; }
  .tiles { grid-template-columns: 1fr; }
  .section-head { padding: 14px; }
  .section-head h1 { font-size: 20px; }
  .wrap { padding: 16px 12px 20px; }
}
@media (min-width: 700px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
}
