@import url("style_base.css");

:root {
  --utility-rail-width: 42px;
  --utility-gap: 10px;
  --page-edge: 12px;
  --rail-top: 58px;
  --rail-bottom: 50px;
}

/* De bestaande site blijft intact. Alleen de zoekbalk en utility-rail worden
   bovenop de basisstijl geplaatst. */
.topbar {
  display: block !important;
  width: 100% !important;
  padding-top: 6px;
  padding-bottom: 0;
  box-shadow: none;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
}

/* Zoekbalk en tegelgebied delen exact dezelfde linker- en rechterlijn. */
.topbar-inner,
#blocks {
  width: auto !important;
  max-width: none !important;
  margin-left: calc(var(--page-edge) + var(--utility-rail-width) + var(--utility-gap)) !important;
  margin-right: var(--page-edge) !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}

.topbar-inner {
  display: block !important;
  min-height: 34px;
}

#searchForm {
  display: flex !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 34px;
  margin: 0 !important;
  justify-content: stretch !important;
}

.search {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  height: 34px;
  min-height: 34px;
  box-sizing: border-box;
  padding: 6px 38px 6px 12px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--panel) 76%, var(--bg));
}

.clear {
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
}

#blocks {
  margin-top: 5px !important;
}

.toggle-stack,
.edit-button {
  display: none !important;
}

/* Vaste linker rail. Bij de huidige één-pagina-layout valt de bovenrand samen
   met de eerste tegel en de onderrand met de laatste tegel. */
.utility-rail {
  position: fixed;
  top: var(--rail-top);
  left: var(--page-edge);
  bottom: var(--rail-bottom);
  z-index: 100;
  width: var(--utility-rail-width);
  box-sizing: border-box;
  padding: 6px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  border: 1px solid var(--ring);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 90%, var(--bg));
  box-shadow: 0 5px 16px rgba(0, 0, 0, .18);
  backdrop-filter: blur(10px);
}

.utility-rail::-webkit-scrollbar {
  display: none;
}

.rail-button {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  flex: 0 0 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--orange);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.rail-button:hover,
.rail-button:focus-visible {
  background: color-mix(in srgb, var(--orange) 12%, transparent);
  outline: none;
}

.rail-button:active {
  transform: scale(.94);
}

.rail-separator {
  width: 24px;
  height: 1px;
  min-height: 1px;
  margin: 2px 0;
  flex: 0 0 1px;
  background: var(--ring);
}

/* Basismaten van alle iconen. Voor merkiconen gebruiken we echte SVG/logo-
   afbeeldingen als background-image; dat voorkomt de ontbrekende iconen die
   bij cross-origin CSS masks konden ontstaan. */
.rail-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 18px;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Lokale functie-iconen: thema en bewerken. */
.icon-theme,
.icon-edit {
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

:root[data-theme="dark"] .icon-theme {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20.4 15.2A8.2 8.2 0 0 1 8.8 3.6 9 9 0 1 0 20.4 15.2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20.4 15.2A8.2 8.2 0 0 1 8.8 3.6 9 9 0 1 0 20.4 15.2Z'/%3E%3C/svg%3E");
}

:root[data-theme="light"] .icon-theme {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4' fill='black'/%3E%3Cpath fill='black' d='M11 1h2v4h-2zM11 19h2v4h-2zM1 11h4v2H1zM19 11h4v2h-4zM3.5 5l1.4-1.4 2.8 2.8-1.4 1.4zM16.3 17.7l1.4-1.4 2.8 2.8-1.4 1.4zM16.3 6.3l2.8-2.8L20.5 5l-2.8 2.8zM3.5 19l2.8-2.8 1.4 1.4-2.8 2.8z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4' fill='black'/%3E%3Cpath fill='black' d='M11 1h2v4h-2zM11 19h2v4h-2zM1 11h4v2H1zM19 11h4v2h-4zM3.5 5l1.4-1.4 2.8 2.8-1.4 1.4zM16.3 17.7l1.4-1.4 2.8 2.8-1.4 1.4zM16.3 6.3l2.8-2.8L20.5 5l-2.8 2.8zM3.5 19l2.8-2.8 1.4 1.4-2.8 2.8z'/%3E%3C/svg%3E");
}

.icon-edit {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m4 17.25-.75 3.5 3.5-.75L18.8 7.95l-2.75-2.75L4 17.25Zm14.3-14.3 2.75 2.75-1.45 1.45-2.75-2.75 1.45-1.45Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m4 17.25-.75 3.5 3.5-.75L18.8 7.95l-2.75-2.75L4 17.25Zm14.3-14.3 2.75 2.75-1.45 1.45-2.75-2.75 1.45-1.45Z'/%3E%3C/svg%3E");
}

/* Originele/herkenbare merklogo's, direct als afbeelding en in dezelfde
   oranje kleur als de rest van de rail. */
.icon-chatgpt { background-image: url("https://cdn.simpleicons.org/openai/FF9A4D"); }
.icon-mail { background-image: url("https://cdn.simpleicons.org/gmail/FF9A4D"); }
.icon-calendar { background-image: url("https://cdn.simpleicons.org/googlecalendar/FF9A4D"); }
.icon-drive { background-image: url("https://cdn.simpleicons.org/googledrive/FF9A4D"); }
.icon-photos { background-image: url("https://cdn.simpleicons.org/googlephotos/FF9A4D"); }
.icon-map { background-image: url("https://cdn.simpleicons.org/googlemaps/FF9A4D"); }

/* Voor diensten zonder Simple Icons-merklogo gebruiken we het echte favicon
   van de site en kleuren we dat monochroom oranje. */
.icon-key,
.icon-bank,
.icon-market {
  filter: brightness(0) saturate(100%) invert(65%) sepia(83%) saturate(1577%) hue-rotate(326deg) brightness(103%) contrast(101%);
}
.icon-key { background-image: url("https://www.google.com/s2/favicons?domain=passwords.google.com&sz=64"); }
.icon-bank { background-image: url("https://www.google.com/s2/favicons?domain=rabobank.nl&sz=64"); }
.icon-market { background-image: url("https://www.google.com/s2/favicons?domain=marktplaats.nl&sz=64"); }

:root[data-theme="light"] .utility-rail {
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 5px 16px rgba(31, 41, 51, .08);
}

:root[data-theme="light"] .search {
  background: #fff;
}

/* Normen: compacte, scanbare indeling binnen de bestaande uitklapkaart. */
.norms-card.open .cols {
  max-height: 900px;
}

.norms-card .cols.norms-layout {
  display: block;
}

.norm-quicklinks {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px !important;
  margin: 0 0 7px 0 !important;
}

.norm-quicklinks li,
.norm-group li {
  padding: 0 !important;
}

.norm-quicklinks a {
  display: block;
  padding: 7px 9px;
  border: 1px solid var(--ring);
  border-radius: 9px;
  background: color-mix(in srgb, var(--panel) 80%, var(--bg));
  font-weight: 700;
}

.norm-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 7px;
}

.norm-group {
  padding: 8px 9px;
  border: 1px solid var(--ring);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 86%, var(--bg));
}

.norm-group h3,
.norm-group h4 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.norm-group h3 {
  font-size: 11px;
}

.norm-group h4 {
  margin-bottom: 5px;
  font-size: 10px;
  color: var(--muted);
}

.norm-a h3 { color: var(--blue); }
.norm-b h3 { color: var(--green); }
.norm-c h3 { color: var(--purple); }

.norm-subtitle {
  margin: 1px 0 7px;
  color: var(--muted);
  font-size: 10px;
}

.norm-group ul {
  display: grid;
  gap: 3px;
}

.norm-link {
  display: grid !important;
  grid-template-columns: minmax(92px, 118px) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 4px 6px !important;
  border-radius: 7px;
}

.norm-link:hover {
  background: color-mix(in srgb, currentColor 7%, transparent);
}

.norm-code {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.norm-desc {
  color: var(--muted);
}

.norm-c-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 7px;
}

/* Ademhaling als snelkoppeling: eigen lotus-SVG in Google-palet. */
.icon-lotus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%234285F4' d='M12 3c-2.2 2.5-3.3 4.8-3.3 6.8 0 1.8 1.1 3.3 3.3 4.6 2.2-1.3 3.3-2.8 3.3-4.6C15.3 7.8 14.2 5.5 12 3Z'/%3E%3Cpath fill='%23EA4335' d='M5.2 7.1c-.1 3.9 1.4 6.6 4.5 8.2-3.4.7-5.9-.7-7.4-4.1.3-1.9 1.3-3.3 2.9-4.1Z'/%3E%3Cpath fill='%2334A853' d='M18.8 7.1c.1 3.9-1.4 6.6-4.5 8.2 3.4.7 5.9-.7 7.4-4.1-.3-1.9-1.3-3.3-2.9-4.1Z'/%3E%3Cpath fill='%23FBBC05' d='M7 14.6c1.5 1.5 3.1 2.3 5 2.3s3.5-.8 5-2.3c-.8 3.6-2.5 5.4-5 5.4s-4.2-1.8-5-5.4Z'/%3E%3C/svg%3E");
}

/* GitHub-bewerkknop blijft beschikbaar maar zweeft los van de rail. */
.floating-edit {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--ring) 85%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--panel) 34%, transparent);
  color: var(--muted);
  opacity: .58;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: opacity .15s ease, background .15s ease, transform .15s ease;
}
.floating-edit:hover,
.floating-edit:focus-visible {
  opacity: .96;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  outline: none;
}
.floating-edit:active { transform: scale(.94); }

@media (max-width: 900px) {
  .norm-quicklinks,
  .norm-top-grid,
  .norm-c-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 760px) {
  .utility-rail {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    height: 40px;
    min-height: 40px;
    padding: 3px 4px;
    flex-direction: row;
    justify-content: space-between;
    gap: 0;
    overflow-x: hidden;
    overflow-y: hidden;
  }

  .rail-button {
    width: 30px;
    min-width: 0;
    max-width: 34px;
    height: 30px;
    min-height: 30px;
    flex: 1 1 30px;
    border-radius: 7px;
  }

  .rail-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  .rail-separator {
    width: 1px;
    height: 22px;
    min-height: 22px;
    margin: 0 1px;
    flex: 0 0 1px;
  }

  .topbar-inner,
  #blocks {
    width: auto !important;
    margin-left: 12px !important;
    margin-right: 12px !important;
  }

  .norm-link {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  .floating-edit {
    right: 12px;
    bottom: 58px;
  }

  body {
    padding-bottom: 54px;
  }
}
