/* ============================================================
   CrossModel Knowledge Base — Custom Stylesheet
   Aligned with the crossmodel.io website design language
   ============================================================ */

/* --- Fonts --- */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

@font-face {
  font-family: "Neue Haas Unica";
  font-weight: 400;
  font-display: swap;
  src: url("https://crossmodel.io/wordpress_bricks/wp-content/uploads/2025/04/neue-haas-unica-pro-regular.ttf") format("truetype");
}

@font-face {
  font-family: "Neue Haas Unica";
  font-weight: 500;
  font-display: swap;
  src: url("https://crossmodel.io/wordpress_bricks/wp-content/uploads/2025/04/NeueHaasUnica-Medium.woff2") format("woff2"),
       url("https://crossmodel.io/wordpress_bricks/wp-content/uploads/2025/04/NeueHaasUnica-Medium.woff") format("woff");
}

@font-face {
  font-family: "Neue Haas Unica";
  font-weight: 600;
  font-display: swap;
  src: url("https://crossmodel.io/wordpress_bricks/wp-content/uploads/2025/04/NeueHaasUnica-Bold.woff2") format("woff2"),
       url("https://crossmodel.io/wordpress_bricks/wp-content/uploads/2025/04/NeueHaasUnica-Bold.woff") format("woff");
}

/* --- Design tokens (Material theme overrides) --- */

:root > * {
  /* Brand colors */
  --md-primary-fg-color: #1E3C51;
  --md-primary-fg-color--light: #2A556F;
  --md-primary-fg-color--dark: #173041;
  --md-accent-fg-color: #C69A2C;
  --md-accent-fg-color--transparent: rgba(198, 154, 44, 0.12);
  --md-accent-bg-color: #FFFFFF;
  --md-accent-bg-color--light: #FFFFFF;

  /* Background and text */
  --md-default-bg-color: #FFFFFF;
  --md-default-fg-color: #1E3C51;
  --md-typeset-color: #1E3C51;
  --md-typeset-a-color: #C69A2C;

  /* Typography */
  --md-text-font: 'Inter', 'Segoe UI', Tahoma, Arial, sans-serif;
  --md-text-font-family: 'Inter', 'Segoe UI', Tahoma, Arial, sans-serif;
  --md-code-font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  /* Layout */
  --md-header-height: 4.8rem;

  /* Subtle background watermark */
  --kb-bg-image: url('../img/logo-bg-gold-15-deg.svg');
  --kb-bg-size: 50% auto;
  --kb-bg-repeat: no-repeat;
}

/* --- Base --- */

body {
  background-color: #FFFFFF;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: var(--md-sidebar-width, 15rem);
  right: 0;
  bottom: 0;
  background-image: var(--kb-bg-image);
  background-size: var(--kb-bg-size);
  background-position: center center;
  background-repeat: var(--kb-bg-repeat);
  opacity: 0.05;
  pointer-events: none;
  z-index: -1;
}

@media screen and (max-width: 76.1875em) {
  body::before {
    left: 0;
  }
}

.md-main,
.md-main__inner {
  background: transparent;
}

/* --- Header and navigation --- */

.md-header,
.md-tabs {
  background-color: #FFFFFF;
  color: #1E3C51;
  border-bottom: 1px solid #E8EEF3;
}

.md-header,
.md-header__inner {
  min-height: var(--md-header-height);
}

.md-header__title,
.md-tabs__link,
.md-header__button,
.md-header__option {
  color: #1E3C51;
}

.md-tabs__link {
  font-weight: 500;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.md-tabs__link:hover,
.md-tabs__link--active {
  opacity: 1;
}

.md-tabs__link--active {
  border-bottom: 2px solid #C69A2C;
}

/* Logo sizing */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  width: 300px;
  height: 51px;
}

/* --- Search --- */

.md-search__form {
  background-color: #F7F9FB;
  color: #1E3C51;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.md-search__form:hover {
  background-color: #E8EEF3;
}

.md-search__input,
.md-search__input::placeholder {
  color: #1E3C51;
}

.md-search__input,
.md-search__input:focus,
[data-md-toggle='search']:checked ~ .md-header .md-search__input,
[data-md-toggle='search']:checked ~ .md-header .md-search__input:focus {
  color: #1E3C51 !important;
  -webkit-text-fill-color: #1E3C51 !important;
  caret-color: #1E3C51;
}

.md-search__input::placeholder,
.md-search__input:focus::placeholder,
[data-md-toggle='search']:checked ~ .md-header .md-search__input::placeholder {
  color: #5F7382 !important;
}

.md-search__icon,
.md-search-result__icon,
.md-search-result__more summary {
  color: #1E3C51 !important;
}

.md-search-result,
.md-search-result__list,
.md-search-result__article,
.md-search-result__meta,
.md-search-result__title,
.md-search-result__teaser {
  color: #1E3C51;
  background-color: #FFFFFF;
}

/* --- Typography --- */

.md-typeset {
  font-family: 'Inter', 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 0.8rem;
  line-height: 1.7;
  color: #1E3C51;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  font-family: "Neue Haas Unica", 'Inter', 'Segoe UI', sans-serif;
  color: #1E3C51;
  font-weight: 600;
  line-height: 1.3;
}

.md-typeset h1 {
  font-size: 2em;
  margin-bottom: 0.75em;
  letter-spacing: -0.02em;
}

.md-typeset h2 {
  font-size: 1.5em;
  margin-top: 2em;
  margin-bottom: 0.6em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid #E8EEF3;
}

.md-typeset h3 {
  font-size: 1.2em;
  margin-top: 1.6em;
  margin-bottom: 0.5em;
}

.md-typeset h4 {
  font-size: 1em;
  margin-top: 1.4em;
  font-weight: 500;
}

/* --- Links --- */

.md-typeset a {
  color: #C69A2C;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.md-typeset a:hover {
  color: #A67D1A;
  border-bottom-color: #C69A2C;
}

/* --- Sidebar navigation --- */

.md-sidebar--primary .md-sidebar__scrollwrap,
.md-sidebar--primary .md-sidebar__inner {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.md-sidebar--primary .md-sidebar__scrollwrap::-webkit-scrollbar,
.md-sidebar--primary .md-sidebar__inner::-webkit-scrollbar {
  display: none;
}

.md-nav__link {
  transition: color 0.15s ease;
}

.md-nav__link:hover {
  color: #C69A2C;
}

.md-nav__item--active > .md-nav__link {
  color: #C69A2C;
  font-weight: 600;
}

/* --- Content tables --- */

.md-typeset table:not([class]) {
  border: 1px solid #E8EEF3;
  border-radius: 8px;
  border-spacing: 0;
  overflow: hidden;
  display: table;
  width: 100%;
}

.md-typeset table:not([class]) thead {
  background-color: #F7F9FB;
}

.md-typeset table:not([class]) th {
  font-family: "Neue Haas Unica", 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.85em;
  color: #1E3C51;
  padding: 0.75em 1em;
  border-bottom: 2px solid #E8EEF3;
  text-align: left;
}

.md-typeset table:not([class]) td {
  padding: 0.65em 1em;
  border-bottom: 1px solid #F0F3F6;
  vertical-align: top;
}

.md-typeset table:not([class]) tbody tr:last-child td {
  border-bottom: none;
}

.md-typeset table:not([class]) tbody tr:hover {
  background-color: rgba(198, 154, 44, 0.04);
}

/* --- Code blocks --- */

.md-typeset code {
  background-color: #F7F9FB;
  color: #1E3C51;
  border: 1px solid #E8EEF3;
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.85em;
}

.md-typeset pre {
  border-radius: 8px;
  border: 1px solid #E8EEF3;
  overflow: hidden;
}

.md-typeset pre > code {
  border: none;
  border-radius: 0;
  padding: 1em 1.2em;
  font-size: 0.82em;
  line-height: 1.6;
}

/* --- Admonitions (tip, note, warning, etc.) --- */

.md-typeset .admonition,
.md-typeset details {
  border-radius: 8px;
  border: 1px solid #E8EEF3;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  margin: 1.5em 0;
}

.md-typeset .admonition-title,
.md-typeset summary {
  font-family: "Neue Haas Unica", 'Inter', sans-serif;
  font-weight: 600;
  border-bottom: 1px solid #E8EEF3;
}

.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-left: 4px solid #C69A2C;
}

.md-typeset .admonition.note,
.md-typeset details.note {
  border-left: 4px solid #2A556F;
}

.md-typeset .admonition.warning,
.md-typeset details.warning {
  border-left: 4px solid #ff9800;
}

.md-typeset .admonition.info,
.md-typeset details.info {
  border-left: 4px solid #0693e3;
}

/* --- Images --- */

.md-typeset img {
  border-radius: 8px;
  border: 1px solid #E8EEF3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin: 1em 0;
  transition: box-shadow 0.2s ease;
}

.md-typeset img:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* BrightGreen logo — centered and smaller */
.md-typeset img[src*="datamodeling-fundamentals/brightgreen-electronics.png"] {
  display: block;
  width: 50%;
  height: auto;
  margin: 0 auto;
}

/* Inline icons in tables should not have card styling */
.md-typeset table img {
  border: none;
  box-shadow: none;
  border-radius: 0;
  margin: 0;
  vertical-align: middle;
}

.md-typeset table img:hover {
  box-shadow: none;
}

/* Logo in header should not have card styling */
.md-header__button.md-logo img {
  border: none;
  box-shadow: none;
  border-radius: 0;
  margin: 0;
}

.md-header__button.md-logo img:hover {
  box-shadow: none;
}

/* --- Footer --- */

.md-footer,
.md-footer-meta,
.md-footer-nav {
  background-color: #1E3E52;
  color: #FFFFFF;
  border-top: none;
}

/* Base text: white */
.md-footer *,
.md-footer-meta *,
.md-footer-nav * {
  color: #FFFFFF !important;
}

/* SVG icons inherit white */
.md-footer .md-icon svg,
.md-footer-meta .md-icon svg,
.md-footer-nav .md-icon svg {
  fill: currentColor;
}

/* Direction labels ("Previous" / "Next") and copyright: gold accent */
.md-footer__direction,
.md-footer-meta__copyright {
  color: #C69A2C !important;
}

/* Nav links and social icons: white, gold on hover */
.md-footer__link:hover .md-footer__title,
.md-footer__link:hover .md-footer__direction,
.md-footer-meta__social .md-icon:hover svg {
  color: #C69A2C !important;
  fill: #C69A2C;
}

/* Social icon hover */
.md-footer-meta__social .md-icon:hover {
  color: #C69A2C !important;
}

/* Separator between footer nav and meta strip */
.md-footer-meta {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* --- Horizontal rules --- */

.md-typeset hr {
  border: none;
  border-top: 1px solid #E8EEF3;
  margin: 2em 0;
}

/* --- Blockquotes --- */

.md-typeset blockquote {
  border-left: 3px solid #C69A2C;
  color: #5F7382;
  padding: 0.5em 1em;
  margin: 1.5em 0;
  background-color: rgba(198, 154, 44, 0.04);
  border-radius: 0 8px 8px 0;
}

/* --- Lists --- */

.md-typeset ul,
.md-typeset ol {
  margin-bottom: 1em;
}

.md-typeset li {
  margin-bottom: 0.3em;
}

/* --- Glossary definition-style bold terms --- */

.md-typeset h3 + p,
.md-typeset h3 + p + p {
  margin-top: 0.3em;
}
