/*
  Brand layer over Material, kept in step with the portal's globals.css
  (../niceggie-portal/apps/niceggie-portal/src/app/globals.css): one brand blue
  for links and actions, navy for deliberate dark bands, a light header bar.
  Byte-identical in en/ zh/ ja/.
*/
:root {
  --nc-brand: #1a5ce0;
  --nc-brand-hover: #164fc2;
  --nc-navy: #0b1f44;
  --nc-title: #111827;
  --nc-body: #4b5563;
  --nc-muted: #6b7280;
  --nc-line: #e5e7eb;
  --nc-surface-2: #f3f4f6;
  --nc-mist: #f2f5fb;

  --md-primary-fg-color: var(--nc-brand);
  --md-primary-fg-color--light: #4d82ea;
  --md-primary-fg-color--dark: var(--nc-navy);
  --md-primary-bg-color: #ffffff;
  --md-accent-fg-color: var(--nc-brand-hover);
  --md-accent-fg-color--transparent: rgba(26, 92, 224, 0.1);
  --md-typeset-a-color: var(--nc-brand);
  --md-footer-bg-color: var(--nc-navy);
  --md-footer-bg-color--dark: #08172f;
}

/* ---------- Header: light bar like the portal's, not a solid primary band ---------- */
.md-header {
  background-color: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--nc-title);
}
.md-header--shadow {
  box-shadow: 0 1px 0 var(--nc-line);
}
.md-header__topic:first-child {
  font-weight: 600;
}
.md-header__button.md-logo img {
  height: 1.5rem;
}

@media screen and (min-width: 60em) {
  .md-search__input {
    background-color: var(--nc-surface-2);
    color: var(--nc-title);
  }
  .md-search__input:hover {
    background-color: #e9ebef;
  }
  .md-search__input::placeholder,
  .md-search__input + .md-search__icon {
    color: var(--nc-muted);
  }
}

.nc-header-cta {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.4rem;
}
.nc-header-cta a {
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 125ms, color 125ms;
}
.nc-header-cta__signin {
  color: var(--nc-title);
}
.nc-header-cta__signin:hover {
  background-color: var(--nc-surface-2);
}
.nc-header-cta__start {
  background-color: var(--nc-brand);
  color: #ffffff;
}
.nc-header-cta__start:hover {
  background-color: var(--nc-brand-hover);
  color: #ffffff;
}
@media screen and (max-width: 44.9375em) {
  .nc-header-cta__signin {
    display: none;
  }
}
@media screen and (max-width: 29.9375em) {
  .nc-header-cta {
    margin-left: 0.2rem;
  }
  .nc-header-cta a {
    padding: 0.3rem 0.6rem;
    font-size: 0.65rem;
  }
}

/* ---------- Type: portal headings are dark and bold, not Material's light grey ---------- */
.md-typeset h1 {
  color: var(--nc-title);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.md-typeset h2 {
  color: var(--nc-title);
  font-weight: 650;
}
.md-typeset h3 {
  color: var(--nc-title);
  font-weight: 600;
}
.md-typeset a:hover {
  color: var(--nc-brand-hover);
}

/* ---------- Page meta line under the H1 (hooks/page_meta.py) ---------- */
.md-typeset .nc-page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin: -0.6rem 0 1.4rem;
  color: var(--nc-muted);
  font-size: 0.7rem;
}
.md-typeset .nc-page-meta__date {
  margin-right: auto;
}
.md-typeset .nc-page-meta__action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--nc-line);
  border-radius: 999px;
  background: #ffffff;
  padding: 0.2rem 0.65rem;
  color: var(--nc-title);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 125ms, color 125ms;
}
.md-typeset .nc-page-meta__action:hover,
.md-typeset .nc-page-meta__action:focus-visible {
  border-color: var(--nc-brand);
  color: var(--nc-brand);
}
.md-typeset .nc-page-meta__action svg {
  width: 0.8rem;
  height: 0.8rem;
  fill: currentColor;
}

/* ---------- "Who can use this" box at the top of product guides ---------- */
.md-typeset .admonition.scope,
.md-typeset details.scope {
  border: 1px solid #d6e2fa;
  border-radius: 12px;
  background-color: var(--nc-mist);
  box-shadow: none;
  font-size: 0.75rem;
}
.md-typeset .scope > .admonition-title,
.md-typeset .scope > summary {
  background-color: transparent;
  color: var(--nc-title);
  font-weight: 650;
}
.md-typeset .scope > .admonition-title::before,
.md-typeset .scope > summary::before {
  background-color: var(--nc-brand);
  -webkit-mask-image: var(--nc-scope-icon);
  mask-image: var(--nc-scope-icon);
}
:root {
  --nc-scope-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20m-1 15v-6h2v6zm0-8V7h2v2z"/></svg>');
}
.md-typeset .scope ul {
  margin-top: 0.2rem;
  margin-bottom: 0.4rem;
}
.md-typeset .scope li {
  margin-bottom: 0.2rem;
}

/* ---------- Home: search hero + entry cards (index.md) ---------- */
.md-typeset .nc-hero {
  margin: 0 0 1.6rem;
  border-radius: 20px;
  background:
    radial-gradient(120% 140% at 85% 0%, rgba(26, 92, 224, 0.55) 0%, rgba(26, 92, 224, 0) 60%),
    var(--nc-navy);
  padding: 2.4rem 1.4rem 2.2rem;
  color: #ffffff;
  text-align: center;
}
.md-typeset .nc-hero h1 {
  margin: 0 0 0.6rem;
  color: #ffffff;
  font-size: 1.8rem;
  line-height: 1.25;
}
.md-typeset .nc-hero p {
  max-width: 34rem;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.85rem;
}
.md-typeset .nc-hero__search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 30rem;
  margin: 1.4rem auto 0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(8, 23, 47, 0.25);
  padding: 0.75rem 1rem;
  color: var(--nc-muted);
  font-size: 0.8rem;
  text-align: left;
  cursor: text;
}
.md-typeset .nc-hero__search:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}
.md-typeset .nc-hero__search svg {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.md-typeset .nc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 2rem;
}
.md-typeset .nc-cards > p {
  display: contents;
}
.md-typeset a.nc-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border: 1px solid var(--nc-line);
  border-radius: 14px;
  background: #ffffff;
  padding: 1rem 1.1rem;
  color: var(--nc-body);
  font-size: 0.72rem;
  line-height: 1.55;
  transition: border-color 125ms, box-shadow 125ms, transform 125ms;
}
.md-typeset a.nc-card:hover,
.md-typeset a.nc-card:focus-visible {
  border-color: var(--nc-brand);
  box-shadow: 0 6px 18px rgba(11, 31, 68, 0.08);
  color: var(--nc-body);
  transform: translateY(-1px);
}
/* Icon tile, as in the portal's Products menu (SiteHeader .megaIcon): lucide
   line icons on a neutral tile; the two lead products carry brand blue /
   Listing AI teal. */
.md-typeset .nc-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.md-typeset .nc-card__icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: #f1f1f5;
  color: var(--nc-body);
}
.md-typeset .nc-card__icon svg {
  width: 0.95rem;
  height: 0.95rem;
}
.md-typeset .nc-card__icon--brand {
  background: #e8effc;
  color: var(--nc-brand);
}
.md-typeset .nc-card__icon--teal {
  background: #e7f2f0;
  color: #0b7a6d;
}
.md-typeset .nc-card__title {
  color: var(--nc-title);
  font-size: 0.85rem;
  font-weight: 650;
}
.md-typeset .nc-card__tag {
  border-radius: 999px;
  background: var(--md-accent-fg-color--transparent);
  padding: 0.05rem 0.5rem;
  color: var(--nc-brand);
  font-size: 0.62rem;
  font-weight: 600;
}

.md-typeset .nc-quicklinks ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0 2rem;
  padding: 0;
}
.md-typeset .nc-quicklinks ul li {
  margin: 0;
  list-style: none;
}
.md-typeset .nc-quicklinks a {
  display: inline-block;
  border: 1px solid var(--nc-line);
  border-radius: 999px;
  background: #ffffff;
  padding: 0.3rem 0.8rem;
  color: var(--nc-title);
  font-size: 0.72rem;
  font-weight: 500;
}
.md-typeset .nc-quicklinks a:hover {
  border-color: var(--nc-brand);
  color: var(--nc-brand);
}

@media screen and (max-width: 44.9375em) {
  .md-typeset .nc-hero {
    border-radius: 14px;
    padding: 1.8rem 1rem 1.6rem;
  }
  .md-typeset .nc-hero h1 {
    font-size: 1.4rem;
  }
}
