/* =================================================================
   WooPID Design System
   Subtle OpenGov-inspired palette: deep brown headings, light blue
   surfaces, red-orange accent. Geist body, Geist Mono for data UI.
   All tokens use woo- prefix, shared with WooGLe.
   ================================================================= */

/* ----------------------------- Fonts ----------------------------- */

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/geist:vf@latest/latin-wght-normal.woff2) format('woff2-variations');
}

@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/geist-mono:vf@latest/latin-wght-normal.woff2) format('woff2-variations');
}

/* ----------------------------- Design Tokens ----------------------------- */

:root {
  /* OpenGov-derived palette (muted for business use) */
  --woo-dark: #380504;             /* OpenGov Deep Brown — headings, dark UI */
  --woo-accent: #ff2903;           /* OpenGov Red Orange — accent bar, active states */
  --woo-accent-hover: #cc2002;     /* Darkened accent for hover */
  --woo-light-blue: #c7fafb;       /* OpenGov Light Blue — surface tints */

  /* Functional colors */
  --woo-bg: #fafcfc;               /* Barely-there cool white (light blue tint) */
  --woo-white: #ffffff;
  --woo-text: #2b2b2b;
  --woo-text-muted: #4a4a4a;
  --woo-text-link: #c03510;        /* Muted red-orange — OpenGov as link color */
  --woo-text-link-hover: #380504;  /* Deep brown on hover */
  --woo-border: #cdd6da;

  /* Tag colors (light blue family) */
  --woo-tag-bg: #daf0f1;           /* Desaturated light blue */
  --woo-tag-border: #8dcfd2;
  --woo-tag-text: #2c3e3f;

  /* Warning */
  --woo-warning-bg: #fff3cd;
  --woo-warning-border: #ffecb5;
  --woo-warning-text: #664d03;

  /* Table */
  --woo-table-head-bg: #380504;
  --woo-table-summary-bg: #e4f6f7;
  --woo-table-summary-border: #80d0d3;
  --woo-table-row-hover: rgba(199, 250, 251, 0.4);

  /* Footer */
  --woo-footer-border: #d8e0e3;

  /* Typography */
  --woo-font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --woo-font-mono: 'Geist Mono', 'Menlo', 'Consolas', monospace;
  --woo-font-size-xs: 0.75rem;
  --woo-font-size-sm: 0.875rem;
  --woo-font-size-base: 1rem;
  --woo-font-size-lg: 1.125rem;
  --woo-font-size-xl: 1.5rem;
  --woo-font-size-2xl: 1.75rem;
  --woo-font-weight-light: 300;
  --woo-font-weight-normal: 400;
  --woo-font-weight-medium: 500;
  --woo-font-weight-bold: 700;

  /* Spacing */
  --woo-space-xs: 0.375rem;
  --woo-space-sm: 0.625rem;
  --woo-space-md: 1rem;
  --woo-space-lg: 1.5rem;
  --woo-space-xl: 2rem;
  --woo-space-2xl: 3rem;

  /* Surfaces */
  --woo-radius-sm: 4px;
  --woo-radius-md: 6px;
  --woo-radius-lg: 8px;
  --woo-radius-pill: 50rem;
  --woo-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --woo-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ----------------------------- Base ----------------------------- */

body {
  font-family: var(--woo-font-family);
  background-color: var(--woo-bg);
  color: var(--woo-text);
  line-height: 1.6;
  margin: 0;
}

a {
  color: var(--woo-text-link);
  text-decoration: none;
}

a:hover {
  color: var(--woo-text-link-hover);
  text-decoration: underline;
  cursor: pointer;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--woo-font-weight-medium);
  color: var(--woo-dark);
  margin-top: 0;
}

h1 {
  font-size: var(--woo-font-size-2xl);
  margin-bottom: var(--woo-space-md);
  line-height: 1.35;
}

h2 {
  font-size: var(--woo-font-size-xl);
  margin-bottom: var(--woo-space-sm);
}

h3 {
  font-size: var(--woo-font-size-lg);
  padding: 0;
  margin-bottom: var(--woo-space-sm);
}

h5 {
  font-size: var(--woo-font-size-base);
  margin-bottom: var(--woo-space-sm);
}

/* ----------------------------- Skip Link ----------------------------- */

.woo-skip-link {
  position: absolute;
  top: -100%;
  left: var(--woo-space-md);
  background: var(--woo-dark);
  color: var(--woo-white);
  padding: var(--woo-space-xs) var(--woo-space-md);
  border-radius: 0 0 var(--woo-radius-sm) var(--woo-radius-sm);
  z-index: 1000;
  font-size: var(--woo-font-size-sm);
}

.woo-skip-link:focus {
  top: 0;
  color: var(--woo-white);
  text-decoration: none;
}

/* ----------------------------- Accent Bar ----------------------------- */

.woo-accent-bar {
  height: 4px;
  background: var(--woo-accent);
}

/* ----------------------------- Breadcrumbs ----------------------------- */

.woo-breadcrumbs {
  background-color: var(--woo-white);
  border-bottom: 1px solid var(--woo-border);
  padding: var(--woo-space-sm) 0;
  font-size: var(--woo-font-size-sm);
}

.woo-breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--woo-space-xs);
  margin: 0;
  padding: 0;
  font-family: var(--woo-font-mono);
  font-size: var(--woo-font-size-xs);
}

.woo-breadcrumbs li {
  display: flex;
  align-items: center;
  gap: var(--woo-space-xs);
  color: var(--woo-text-muted);
}

.woo-breadcrumbs li + li::before {
  content: "\203A";
  color: var(--woo-text-muted);
  margin-right: var(--woo-space-xs);
}

.woo-breadcrumbs a {
  color: var(--woo-text-link);
}

.woo-breadcrumbs .active {
  color: var(--woo-dark);
  font-weight: var(--woo-font-weight-medium);
}

.woo-breadcrumb-hint {
  font-family: var(--woo-font-family);
  color: var(--woo-text-muted);
  opacity: 0.7;
}

/* ----------------------------- Footer ----------------------------- */

.woo-footer {
  border-top: 1px solid var(--woo-footer-border);
  padding: var(--woo-space-lg) 0;
  margin-top: var(--woo-space-2xl);
  font-size: var(--woo-font-size-xs);
  color: var(--woo-text-muted);
}

.woo-footer a {
  color: var(--woo-text-muted);
}

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

/* ----------------------------- Dossier Header ----------------------------- */

.woo-dossier-publisher {
  font-size: var(--woo-font-size-sm);
  color: var(--woo-text-muted);
  margin-top: var(--woo-space-lg);
  margin-bottom: var(--woo-space-xs);
  font-weight: var(--woo-font-weight-medium);
  letter-spacing: 0.01em;
}

.woo-dossier-title {
  font-size: var(--woo-font-size-2xl);
  font-weight: var(--woo-font-weight-bold);
  color: var(--woo-dark);
  margin-bottom: var(--woo-space-xs);
  line-height: 1.3;
}

/* When there's no publisher above, the title needs its own top margin */
.woo-dossier-title:first-child {
  margin-top: var(--woo-space-lg);
}

/* ----------------------------- Card / Surface ----------------------------- */

.woo-card {
  background: var(--woo-white);
  border: 1px solid var(--woo-border);
  border-radius: var(--woo-radius-lg);
  box-shadow: var(--woo-shadow-sm);
  overflow-wrap: break-word;
  overflow: hidden;
  padding: var(--woo-space-lg);
  margin-bottom: var(--woo-space-md);
}

/* ----------------------------- Results ----------------------------- */

.woo-result {
  padding: var(--woo-space-lg) 0;
  border-bottom: 1px solid var(--woo-border);
}

.woo-result:last-child {
  border-bottom: none;
}

.woo-result-title {
  font-size: var(--woo-font-size-lg);
  font-weight: var(--woo-font-weight-medium);
  margin: 0 0 var(--woo-space-sm);
  padding: 0;
  line-height: 1.4;
}

.woo-result-title a {
  color: var(--woo-text-link);
  text-decoration: none;
}

.woo-result-title a:hover {
  color: var(--woo-text-link-hover);
  text-decoration: underline;
}

.woo-meta-description {
  color: var(--woo-text-muted);
  font-size: var(--woo-font-size-sm);
  line-height: 1.55;
  word-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.woo-meta-description .date-result {
  color: #808080;
}

/* External source link below dossier description */
.woo-source-link {
  margin-top: var(--woo-space-sm);
  font-size: var(--woo-font-size-xs);
  font-family: var(--woo-font-mono);
  color: var(--woo-text-muted);
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.woo-source-link i {
  font-size: 0.7rem;
  opacity: 0.6;
}

.woo-source-link a {
  color: var(--woo-text-muted);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.woo-source-link a:hover {
  color: var(--woo-text-link);
  text-decoration-style: solid;
}


/* ----------------------------- Tags ----------------------------- */

.woo-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.25rem 0.6rem;
  font-family: var(--woo-font-mono);
  font-size: var(--woo-font-size-xs);
  border-radius: 2px;
  margin-right: var(--woo-space-xs);
  margin-top: var(--woo-space-xs);
  margin-bottom: 0;
  color: var(--woo-tag-text);
  background-color: var(--woo-tag-bg);
  border: 1px solid var(--woo-tag-border);
  text-decoration: none;
  white-space: nowrap;
  transition: box-shadow 0.15s, background-color 0.15s;
}

.woo-tag:hover {
  background-color: #d0edee;
  box-shadow: var(--woo-shadow-sm);
}

.woo-tag--warning {
  background-color: var(--woo-warning-bg);
  border-color: var(--woo-warning-border);
  color: var(--woo-warning-text);
}

.woo-tag--warning:hover {
  background-color: #ffe9a0;
}

.meta-attributes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: var(--woo-space-sm);
}

/* Extra bottom margin only when chips follow the dossier title (detail page) */
.woo-dossier-title + .meta-attributes {
  margin-bottom: var(--woo-space-md);
}

/* ----------------------------- Infobox (dl-based metadata) ----------------------------- */

.woo-infobox {
  margin-top: var(--woo-space-lg);
}

.woo-infobox dl {
  margin: 0;
}

.woo-infobox .row {
  padding: var(--woo-space-sm) 0;
  border-bottom: 1px solid var(--woo-border);
}

.woo-infobox .row:last-child {
  border-bottom: none;
}

.woo-infobox dt {
  font-weight: var(--woo-font-weight-medium);
  color: var(--woo-text-muted);
  font-size: var(--woo-font-size-sm);
}

.woo-infobox dd {
  font-size: var(--woo-font-size-xs);
  margin-bottom: 0;
}

/* ----------------------------- Tables ----------------------------- */

.woo-table {
  width: 100%;
  font-size: var(--woo-font-size-sm);
}

.woo-table thead th {
  background-color: var(--woo-table-head-bg);
  color: var(--woo-white);
  font-weight: var(--woo-font-weight-medium);
  font-size: var(--woo-font-size-xs);
  padding: var(--woo-space-md) var(--woo-space-md);
  white-space: nowrap;
  border: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.woo-table tbody td,
.woo-table tbody th {
  padding: var(--woo-space-sm) var(--woo-space-md);
  border-bottom: 1px solid var(--woo-border);
  vertical-align: middle;
}

.woo-table tbody tr:hover {
  background-color: var(--woo-table-row-hover);
}

.woo-table-summary td,
.woo-table-summary th {
  font-weight: var(--woo-font-weight-bold);
  background-color: var(--woo-dark);
  color: var(--woo-white);
  border-bottom: 2px solid var(--woo-accent);
}

.woo-table-summary a {
  color: var(--woo-light-blue);
}

.woo-table tbody tr:nth-child(even) {
  background-color: rgba(199, 250, 251, 0.1);
}

/* Numeric cells in monospace for alignment */
.woo-table .text-end {
  font-family: var(--woo-font-mono);
  font-size: var(--woo-font-size-xs);
}

/* ----------------------------- Documents ----------------------------- */

.woo-doc-item {
  padding: var(--woo-space-sm) 0;
  display: flex;
  align-items: baseline;
  gap: var(--woo-space-sm);
  border-left: 2px solid transparent;
  padding-left: var(--woo-space-sm);
  transition: border-color 0.15s;
}

.woo-doc-item:hover {
  border-left-color: var(--woo-accent);
}

.woo-doc-item > i {
  color: var(--woo-dark);
  width: 1.2em;
  text-align: center;
  opacity: 0.5;
  flex-shrink: 0;
}

.woo-doc-meta {
  color: var(--woo-text-muted);
  font-size: var(--woo-font-size-xs);
  white-space: nowrap;
}

/* Action links — clickable text links for Tekst, ZIP, JSON */
.woo-doc-action {
  font-size: var(--woo-font-size-sm);
  color: var(--woo-text-link);
  white-space: nowrap;
  margin-left: var(--woo-space-xs);
}

.woo-doc-action:hover {
  color: var(--woo-text-link-hover);
  text-decoration: underline;
}

/* Dossier-level actions (ZIP, JSON) */
.woo-dossier-actions {
  display: flex;
  align-items: center;
  gap: var(--woo-space-sm);
  margin-top: var(--woo-space-sm);
}

.woo-action-label {
  font-weight: var(--woo-font-weight-medium);
  color: var(--woo-text-muted);
  font-size: var(--woo-font-size-xs);
}

.woo-action-sep {
  color: var(--woo-text-muted);
  opacity: 0.5;
}

.documents {
  margin-top: var(--woo-space-lg);
}

.documents ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: var(--woo-space-md);
}

.documents li {
  line-height: 1.5;
}

.documents h5 {
  margin-top: var(--woo-space-xl);
  margin-bottom: var(--woo-space-sm);
  font-size: var(--woo-font-size-xs);
  font-weight: var(--woo-font-weight-medium);
  color: var(--woo-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--woo-border);
  padding-bottom: var(--woo-space-xs);
}

/* Google-inspired document card layout */
.woo-doc-card {
  padding: var(--woo-space-lg) var(--woo-space-sm);
  border-bottom: 1px solid var(--woo-border);
}

.woo-doc-card:last-child {
  border-bottom: none;
}

/* Line 1: source — favicon + domain + metadata */
.woo-doc-card-source {
  display: flex;
  align-items: center;
  gap: var(--woo-space-sm);
  font-size: var(--woo-font-size-xs);
  color: var(--woo-text-muted);
  margin-bottom: var(--woo-space-xs);
  line-height: 1;
}

.woo-doc-card-source > i {
  font-size: 0.85rem;
  opacity: 0.4;
  flex-shrink: 0;
}

.woo-doc-favicon {
  flex-shrink: 0;
  border-radius: 2px;
}

.woo-doc-domain {
  font-weight: var(--woo-font-weight-medium);
  color: var(--woo-text);
}

.woo-doc-domain::after {
  content: " \203A";
  color: var(--woo-text-muted);
  margin: 0 0.15em;
}

.woo-doc-meta {
  color: var(--woo-text-muted);
  font-size: var(--woo-font-size-xs);
  white-space: nowrap;
}

/* Line 2: title */
.woo-doc-card-title {
  line-height: 1.35;
}

.woo-doc-card-title a {
  color: var(--woo-text-link);
  font-size: var(--woo-font-size-base);
}

.woo-doc-card-title a:hover {
  text-decoration: underline;
}

/* Document description snippet */
.woo-doc-card-description {
  font-size: var(--woo-font-size-xs);
  color: var(--woo-text-muted);
  line-height: 1.45;
  margin-top: 0.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Separator between primary documents and secondary sections */
.woo-doc-separator {
  border: none;
  border-top: 1px solid var(--woo-border);
  margin: var(--woo-space-lg) 0 var(--woo-space-sm);
}

/* Demoted secondary sections (Onderdeel van, URLs, Gelinkt aan) */
.woo-doc-secondary-section {
  font-size: var(--woo-font-size-sm);
  color: var(--woo-text-muted);
  padding: var(--woo-space-xs) 0;
  display: flex;
  align-items: baseline;
  gap: var(--woo-space-xs);
}

.woo-doc-secondary-section .woo-doc-secondary-label {
  font-weight: var(--woo-font-weight-medium);
  white-space: nowrap;
}

.woo-doc-secondary-section a {
  color: var(--woo-text-link);
}

.woo-doc-secondary-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.woo-doc-secondary-list li {
  font-size: var(--woo-font-size-sm);
  color: var(--woo-text-muted);
  padding: var(--woo-space-xs) 0;
  padding-left: var(--woo-space-sm);
}

/* ----------------------------- Search Widget ----------------------------- */

.woo-search-widget {
  margin-bottom: var(--woo-space-lg);
  position: sticky;
  top: var(--woo-space-md);
  z-index: 10;
  background-color: var(--woo-bg);
  padding-bottom: var(--woo-space-sm);
}

.woo-search-widget h5 {
  font-size: var(--woo-font-size-sm);
  font-weight: var(--woo-font-weight-medium);
  margin-bottom: var(--woo-space-xs);
  color: var(--woo-text);
}

.woo-btn-search {
  background-color: var(--woo-dark);
  border-color: var(--woo-dark);
  color: var(--woo-white);
  font-weight: var(--woo-font-weight-medium);
  padding: 0.5rem 1.25rem;
  border-radius: 0 var(--woo-radius-sm) var(--woo-radius-sm) 0;
  transition: background-color 0.15s;
}

.woo-btn-search:hover {
  background-color: var(--woo-text-link);
  border-color: var(--woo-text-link);
  color: var(--woo-white);
}

/* ----------------------------- Hierarchy Chips ----------------------------- */

.woo-hierarchy-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--woo-space-sm);
  align-items: center;
  margin-bottom: var(--woo-space-md);
  font-size: var(--woo-font-size-sm);
}

.woo-hierarchy-chips .label {
  font-weight: var(--woo-font-weight-medium);
  color: var(--woo-text-muted);
  margin-right: var(--woo-space-xs);
}

.woo-hierarchy-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.3rem 0.75rem;
  font-family: var(--woo-font-mono);
  font-size: var(--woo-font-size-xs);
  border-radius: var(--woo-radius-sm);
  background-color: var(--woo-white);
  border: 1px solid var(--woo-border);
  color: var(--woo-text-link);
  text-decoration: none;
  transition: all 0.15s;
}

.woo-hierarchy-chip:hover {
  background-color: var(--woo-tag-bg);
  border-color: var(--woo-tag-border);
  color: var(--woo-dark);
  text-decoration: none;
}

.woo-hierarchy-chip.active {
  background-color: var(--woo-dark);
  border-color: var(--woo-dark);
  color: var(--woo-white);
}

/* ----------------------------- Social Links ----------------------------- */

.socials img {
  width: 24px;
  height: 24px;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.socials img:hover {
  opacity: 1;
}

/* ----------------------------- Search highlight ----------------------------- */

em {
  font-style: inherit;
  font-weight: var(--woo-font-weight-bold);
  position: relative;
}

em:after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  background: rgba(199, 250, 251, 0.35);
  pointer-events: none;
}

/* ----------------------------- Utility ----------------------------- */

.link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--woo-space-xs);
}

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

/* Color scale (completeness indicators) */
.color-A { background-color: #75fa6e !important; color: black !important; margin: 0 !important; }
.color-B { background-color: #add200 !important; color: black !important; margin: 0 !important; }
.color-C { background-color: #d1a500 !important; color: black !important; margin: 0 !important; }
.color-D { background-color: #e86f00 !important; color: black !important; margin: 0 !important; }
.color-E { background-color: #c23f3f !important; color: black !important; margin: 0 !important; }

/* ----------------------------- Responsive ----------------------------- */

/* Aside — transparent floating panel, like Woogle's filter sidebar */
.woo-aside {
  padding: var(--woo-space-md) var(--woo-space-sm);
  font-size: var(--woo-font-size-sm);
}

@media (max-width: 992px) {
  .woo-card {
    padding: var(--woo-space-md);
  }
}

@media (min-width: 993px) {
  .woo-aside {
    padding: 0 0 0 var(--woo-space-lg);
  }
}

@media (max-width: 768px) {
  h1,
  .woo-dossier-title {
    font-size: var(--woo-font-size-xl);
    margin-bottom: var(--woo-space-sm);
  }

  /* Tighter result padding */
  .woo-result {
    padding: var(--woo-space-md) 0;
  }

  /* Reduce gap before document sections */
  .documents {
    margin-top: var(--woo-space-sm);
  }

  .documents h5 {
    margin-top: var(--woo-space-lg);
  }

  /* Tighter document items */
  .woo-doc-item {
    padding: var(--woo-space-xs) 0;
    padding-left: var(--woo-space-xs);
  }

  .woo-doc-card {
    padding: var(--woo-space-md) var(--woo-space-xs);
  }

  .woo-infobox dt,
  .woo-infobox dd {
    font-size: var(--woo-font-size-xs);
  }

  .woo-table {
    font-size: var(--woo-font-size-xs);
  }

  .woo-table thead th,
  .woo-table tbody td,
  .woo-table tbody th {
    padding: var(--woo-space-xs) var(--woo-space-sm);
  }
}
