/* =============================================================================
   Regnify Docs — Professional Override Styles
   Material for MkDocs theme extension — minimal, polished, enterprise-grade
   ============================================================================= */

/* ---------------------------------------------------------------------------
   Typography
   --------------------------------------------------------------------------- */

:root {
  --md-text-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --md-code-font: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono",
    "Liberation Mono", "DejaVu Sans Mono", Menlo, Monaco, Consolas, monospace;
  --md-typeset-line-height: 1.65;
}

/* Slightly tighter headings */
.md-typeset h1 { font-weight: 700; letter-spacing: -0.02em; }
.md-typeset h2 { font-weight: 600; letter-spacing: -0.01em; margin-top: 2.5rem; }
.md-typeset h3 { font-weight: 600; margin-top: 2rem; }

/* Better paragraph spacing */
.md-typeset p { margin-bottom: 1rem; }
.md-typeset p + p { margin-top: 0; }

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

.md-typeset a {
  font-weight: 500;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

/* ---------------------------------------------------------------------------
   Navigation — sidebar polish
   --------------------------------------------------------------------------- */

/* Slightly tighter sidebar labels */
.md-nav__item .md-nav__link {
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Active nav item */
.md-nav__link--active {
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Header / Top bar
   --------------------------------------------------------------------------- */

.md-header {
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.08);
}

/* ---------------------------------------------------------------------------
   Announcement bar
   --------------------------------------------------------------------------- */

.md-banner {
  font-size: 0.75rem;
  letter-spacing: 0.01em;
}

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

.md-footer {
  background: var(--md-default-fg-color--lightest);
  color: var(--md-default-fg-color);
}

.md-footer-meta {
  background: var(--md-default-fg-color--lighter);
}

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

.md-typeset table:not([class]) {
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.85rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.md-typeset table:not([class]) th {
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 16px;
  border: none;
}

.md-typeset table:not([class]) td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

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

.md-typeset table:not([class]) tbody tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

/* ---------------------------------------------------------------------------
   Buttons (md-button overrides)
   --------------------------------------------------------------------------- */

.md-typeset .md-button {
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  border-radius: 6px;
  padding: 6px 16px;
  transition: all 0.15s ease;
}

.md-typeset .md-button--primary {
  border-width: 1.5px;
}

.md-typeset .md-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--md-shadow-z2);
}

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

.md-typeset code {
  font-size: 0.85em;
  border-radius: 4px;
  padding: 2px 6px;
}

.md-typeset pre > code {
  border-radius: 6px;
  padding: 16px 20px;
}

/* ---------------------------------------------------------------------------
   Admonitions
   --------------------------------------------------------------------------- */

.md-typeset .admonition {
  border-radius: 8px;
  border-left-width: 4px;
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------------------
   KB Metadata table
   --------------------------------------------------------------------------- */

.kb-metadata {
  background: var(--md-code-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 20px 0 28px 0;
  font-size: 0.85rem;
}

.kb-metadata table {
  margin: 0;
  border: none !important;
  box-shadow: none;
}

.kb-metadata table td {
  padding: 6px 8px;
  border: none;
  vertical-align: top;
}

.kb-metadata table tbody tr:hover td {
  background: transparent;
}

.kb-metadata td:first-child {
  font-weight: 600;
  white-space: nowrap;
  padding-right: 16px;
  width: 160px;
  color: var(--md-default-fg-color--light);
}

/* ---------------------------------------------------------------------------
   KB Category grid cards (home page)
   --------------------------------------------------------------------------- */

.kb-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
  margin: 28px 0;
}

.kb-category-card {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 10px;
  padding: 22px 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  background: var(--md-default-bg-color);
}

.kb-category-card:hover {
  border-color: var(--md-primary-fg-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.kb-category-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.05rem;
  font-weight: 600;
}

.kb-category-card h3 a {
  color: var(--md-default-fg-color);
  text-decoration: none;
}

.kb-category-card h3 a:hover {
  color: var(--md-primary-fg-color);
}

.kb-category-card p {
  font-size: 0.85rem;
  color: var(--md-default-fg-color--light);
  line-height: 1.5;
  margin-bottom: 12px;
}

.kb-category-card strong {
  font-size: 0.8rem;
  color: var(--md-primary-fg-color);
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   KB Status badges
   --------------------------------------------------------------------------- */

.kb-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

.kb-status-active,
.kb-status-current {
  background: #e8f5e9;
  color: #2e7d32;
}

.kb-status-revised {
  background: #fff3e0;
  color: #e65100;
}

.kb-status-superseded {
  background: #ffebee;
  color: #c62828;
}

/* ---------------------------------------------------------------------------
   KB Category index doc-table
   --------------------------------------------------------------------------- */

.kb-doc-table td:first-child {
  white-space: nowrap;
  text-align: center;
  color: var(--md-default-fg-color--light);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------
   KB Category header (icon + title)
   --------------------------------------------------------------------------- */

.kb-category-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.kb-category-header .twemoji {
  width: 2.25rem;
  height: 2.25rem;
  color: var(--md-primary-fg-color);
}

/* ---------------------------------------------------------------------------
   External-link arrows for MAS / SSO URLs
   --------------------------------------------------------------------------- */

a[href^="https://sso.agc.gov.sg"]::after,
a[href^="https://www.mas.gov.sg"]::after {
  content: " ↗";
  font-size: 0.75em;
  opacity: 0.5;
}

/* ---------------------------------------------------------------------------
   Doc page prev / next navigation
   --------------------------------------------------------------------------- */

.md-typeset .md-button .twemoji {
  vertical-align: -0.15em;
}

/* ---------------------------------------------------------------------------
   Smooth scroll
   --------------------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
}

/* ---------------------------------------------------------------------------
   Selection
   --------------------------------------------------------------------------- */

::selection {
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
}

/* ---------------------------------------------------------------------------
   Print tweaks
   --------------------------------------------------------------------------- */

@media print {
  .md-header,
  .md-footer,
  .md-tabs,
  .md-banner,
  .md-sidebar--secondary,
  .md-button {
    display: none !important;
  }
  .md-typeset h1 { font-size: 2rem; }
}
