/* ==========================================================================
   Redbelly Blocks Design System — MkDocs Material overrides
   Brand: Charcoal #283A46, Red #FF5050, Reverse #F5F5F5
   Action: #0070AF (primary), #00527F (deep), #29B1FF (mid)
   Font: Readex Pro (loaded via mkdocs.yml Google Fonts integration)
   ========================================================================== */

/* --- Color scheme: Light mode ------------------------------------------- */

:root,
[data-md-color-scheme="default"] {
  --md-primary-fg-color:        #283A46;
  --md-primary-fg-color--light: #3a5060;
  --md-primary-fg-color--dark:  #142530;
  --md-primary-bg-color:        #FFFFFF;
  --md-primary-bg-color--light: #FFFFFF;

  --md-accent-fg-color:         #0070AF;
  --md-accent-fg-color--transparent: rgba(0, 112, 175, 0.1);

  --md-typeset-a-color:         #0070AF;

  --md-default-bg-color:        #FFFFFF;
  --md-default-fg-color:        #283A46;
  --md-default-fg-color--light: #848B91;

  --md-code-bg-color:           #F5F5F5;
  --md-code-fg-color:           #283A46;
}

/* --- Color scheme: Dark mode -------------------------------------------- */

[data-md-color-scheme="slate"] {
  --md-primary-fg-color:        #283A46;
  --md-primary-fg-color--light: #3a5060;
  --md-primary-fg-color--dark:  #142530;
  --md-primary-bg-color:        #F5F5F5;
  --md-primary-bg-color--light: #F5F5F5;

  --md-accent-fg-color:         #29B1FF;
  --md-accent-fg-color--transparent: rgba(41, 177, 255, 0.1);

  --md-typeset-a-color:         #29B1FF;

  --md-default-bg-color:        #142530;
  --md-default-fg-color:        #F5F5F5;
  --md-default-fg-color--light: #848B91;

  --md-code-bg-color:           #1c3140;
  --md-code-fg-color:           #F5F5F5;
}

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

.md-typeset {
  font-size: 1.125rem;
  line-height: 1.6;
}

.md-typeset h1 {
  font-weight: 700;
  letter-spacing: -0.04em;
}

.md-typeset h2 {
  font-weight: 700;
  letter-spacing: -0.04em;
}

.md-typeset h3 {
  font-weight: 700;
  letter-spacing: -0.04em;
}

.md-typeset h4 {
  font-weight: 700;
}

.md-typeset h5 {
  font-weight: 700;
}

.md-typeset h6 {
  font-weight: 700;
}

.md-typeset hr {
  border: 0 none;
  border-bottom: 2px solid #ECEBEC;
  margin-top: 48px;
  margin-bottom: 40px;
}

[data-md-color-scheme="slate"] .md-typeset hr {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

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

.md-header {
  background-color: #283A46;
}

.md-header__inner {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  width: auto;
  height: 2.2rem;
  object-fit: contain;
}

.md-tabs {
  background-color: #283A46;
}

/* Hide site name / title from sidebar top (keep it visible in header) */
.md-nav--primary > .md-nav__title {
  display: none;
}

.md-nav--primary > .md-nav__title[for="__drawer"] {
  display: none;
}

/* Ensure header title is visible */
.md-header__topic {
  display: flex !important;
}

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

.md-typeset a:hover {
  color: #00527F;
}

[data-md-color-scheme="slate"] .md-typeset a:hover {
  color: #80D1FE;
}

/* --- Buttons ------------------------------------------------------------ */

.md-typeset .md-button {
  border-radius: 4px;
  font-family: "Readex Pro", sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0;
  text-transform: none;
  padding: 0.625rem 1.5rem;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.md-typeset .md-button--primary {
  background-color: #0070AF;
  border-color: #0070AF;
  color: #FFFFFF;
}

.md-typeset .md-button--primary:hover {
  background-color: #00527F;
  border-color: #00527F;
  color: #FFFFFF;
}

.md-typeset .md-button:not(.md-button--primary) {
  color: #0070AF;
  border-color: #0070AF;
}

.md-typeset .md-button:not(.md-button--primary):hover {
  color: #FFFFFF;
  background-color: #0070AF;
  border-color: #0070AF;
}

[data-md-color-scheme="slate"] .md-typeset .md-button:not(.md-button--primary) {
  color: #29B1FF;
  border-color: #29B1FF;
}

[data-md-color-scheme="slate"] .md-typeset .md-button:not(.md-button--primary):hover {
  color: #FFFFFF;
  background-color: #0070AF;
  border-color: #0070AF;
}

/* --- Navigation sidebar ------------------------------------------------- */

.md-nav__link {
  color: #0070AF;
}

.md-nav__link:hover {
  color: #00527F;
}

.md-nav__link--active,
.md-nav__item--active > .md-nav__link {
  color: #0070AF !important;
  font-weight: 500;
}

.md-nav__item--active > .md-nav__link--index {
  border-left: 3px solid #FF5050;
  padding-left: calc(0.6rem - 3px);
}

[data-md-color-scheme="slate"] .md-nav__link {
  color: #29B1FF;
}

[data-md-color-scheme="slate"] .md-nav__link:hover {
  color: #80D1FE;
}

[data-md-color-scheme="slate"] .md-nav__link--active,
[data-md-color-scheme="slate"] .md-nav__item--active > .md-nav__link {
  color: #29B1FF !important;
}

/* Section labels (bold headings) keep default text color */
.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link,
.md-nav--primary > .md-nav__list > .md-nav__item--nested > label.md-nav__link {
  font-weight: 600;
  color: var(--md-default-fg-color);
}

.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link:hover,
.md-nav--primary > .md-nav__list > .md-nav__item--nested > label.md-nav__link:hover {
  color: #0070AF;
}

/* --- Hide right-hand Table of Contents (TOC) entirely ------------------- */

.md-sidebar--secondary {
  display: none !important;
  width: 0 !important;
}

.md-content {
  max-width: 100% !important;
  margin-right: 0 !important;
}

.md-content__inner {
  padding-bottom: 0 !important;
}

.md-main__inner {
  margin-bottom: 0 !important;
}

.md-main {
  padding-bottom: 0 !important;
}

/* Also hide any inline TOC that toc.integrate puts in the left sidebar */
.md-nav--secondary {
  display: none !important;
}

/* --- Admonitions (Alerts) ----------------------------------------------- */

/* Info / Note */
.md-typeset .admonition.note,
.md-typeset details.note,
.md-typeset .admonition.info,
.md-typeset details.info {
  border-color: #0070AF;
}

.md-typeset .note > .admonition-title,
.md-typeset .note > summary,
.md-typeset .info > .admonition-title,
.md-typeset .info > summary {
  background-color: #D4EFFE;
  border-color: #0070AF;
}

.md-typeset .note > .admonition-title::before,
.md-typeset .note > summary::before,
.md-typeset .info > .admonition-title::before,
.md-typeset .info > summary::before {
  color: #0070AF;
}

/* Success */
.md-typeset .admonition.success,
.md-typeset details.success,
.md-typeset .admonition.check,
.md-typeset details.check,
.md-typeset .admonition.done,
.md-typeset details.done {
  border-color: #00801C;
}

.md-typeset .success > .admonition-title,
.md-typeset .success > summary,
.md-typeset .check > .admonition-title,
.md-typeset .check > summary,
.md-typeset .done > .admonition-title,
.md-typeset .done > summary {
  background-color: #D3FFDD;
  border-color: #00801C;
}

.md-typeset .success > .admonition-title::before,
.md-typeset .success > summary::before,
.md-typeset .check > .admonition-title::before,
.md-typeset .check > summary::before,
.md-typeset .done > .admonition-title::before,
.md-typeset .done > summary::before {
  color: #00801C;
}

/* Warning */
.md-typeset .admonition.warning,
.md-typeset details.warning,
.md-typeset .admonition.caution,
.md-typeset details.caution,
.md-typeset .admonition.attention,
.md-typeset details.attention {
  border-color: #D4B800;
}

.md-typeset .warning > .admonition-title,
.md-typeset .warning > summary,
.md-typeset .caution > .admonition-title,
.md-typeset .caution > summary,
.md-typeset .attention > .admonition-title,
.md-typeset .attention > summary {
  background-color: #FFFFB6;
  border-color: #D4B800;
}

.md-typeset .warning > .admonition-title::before,
.md-typeset .warning > summary::before,
.md-typeset .caution > .admonition-title::before,
.md-typeset .caution > summary::before,
.md-typeset .attention > .admonition-title::before,
.md-typeset .attention > summary::before {
  color: #D4B800;
}

/* Error / Danger */
.md-typeset .admonition.danger,
.md-typeset details.danger,
.md-typeset .admonition.error,
.md-typeset details.error {
  border-color: #D40300;
}

.md-typeset .danger > .admonition-title,
.md-typeset .danger > summary,
.md-typeset .error > .admonition-title,
.md-typeset .error > summary {
  background-color: #FFEDED;
  border-color: #D40300;
}

.md-typeset .danger > .admonition-title::before,
.md-typeset .danger > summary::before,
.md-typeset .error > .admonition-title::before,
.md-typeset .error > summary::before {
  color: #D40300;
}

/* Dark mode admonition title backgrounds */
[data-md-color-scheme="slate"] .md-typeset .warning > .admonition-title,
[data-md-color-scheme="slate"] .md-typeset .caution > .admonition-title,
[data-md-color-scheme="slate"] .md-typeset .attention > .admonition-title {
  background-color: rgba(212, 184, 0, 0.15);
}

[data-md-color-scheme="slate"] .md-typeset .note > .admonition-title,
[data-md-color-scheme="slate"] .md-typeset .info > .admonition-title {
  background-color: rgba(0, 112, 175, 0.15);
}

[data-md-color-scheme="slate"] .md-typeset .success > .admonition-title,
[data-md-color-scheme="slate"] .md-typeset .check > .admonition-title,
[data-md-color-scheme="slate"] .md-typeset .done > .admonition-title {
  background-color: rgba(0, 128, 28, 0.15);
}

[data-md-color-scheme="slate"] .md-typeset .danger > .admonition-title,
[data-md-color-scheme="slate"] .md-typeset .error > .admonition-title {
  background-color: rgba(212, 3, 0, 0.15);
}

/* --- Vine Feature Cards (Homepage) -------------------------------------- */

.vine-feature {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.vine-feature__icon {
  flex-shrink: 0;
  width: 80px;
  display: flex;
  justify-content: center;
}

.vine-feature__icon img {
  width: 100%;
  max-width: 80px;
  height: auto;
  object-fit: contain;
}

.vine-feature__content {
  flex: 1;
}

.vine-feature__content h4 {
  margin: 0 0 0.5rem !important;
}

.vine-feature__content p {
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

.vine-feature__content a {
  text-decoration: none;
}

/* Dark background feature row (Network status + Community) */
.vine-dark-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0 0;
  padding: 2.5rem 0;
  background: #1a3040;
  box-shadow: 0 0 0 100vmax #1a3040;
  clip-path: inset(0 -100vmax);
  margin-bottom: 0;
  padding-bottom: 3rem;
}

.vine-feature-dark {
  background: #243d50;
  border-radius: 12px;
  padding: 2rem;
}

.vine-feature-dark .vine-feature {
  padding: 0;
}

.vine-feature-dark .vine-feature__content h4 {
  color: #FFFFFF;
  margin-top: 0 !important;
}

.vine-feature-dark .vine-feature__content p {
  color: #d0d8de;
}

.vine-feature-dark .vine-feature__content a {
  color: #80D1FE;
  text-decoration: none;
}

.vine-feature-dark .vine-feature__content a:hover {
  color: #29B1FF;
}

.vine-feature-dark .md-button--outline {
  color: #FFFFFF !important;
  border-color: #FFFFFF !important;
  background: transparent !important;
}

.vine-feature-dark .md-button--outline:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

@media screen and (max-width: 45em) {
  .vine-dark-row {
    grid-template-columns: 1fr;
  }
}

/* Outline button variant (white bg, blue border) matching original */
.md-typeset .md-button--outline {
  background-color: #FFFFFF;
  color: #0070AF;
  border: 2px solid #0070AF;
}

.md-typeset .md-button--outline:hover {
  background-color: #0070AF;
  color: #FFFFFF;
}

/* --- Vine Step Cards (Getting Started) ---------------------------------- */

.vine-step {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: #f5f5f5;
  border-radius: 8px;
  margin: 1rem 0;
}

.vine-step__icon {
  flex-shrink: 0;
  width: 80px;
  display: flex;
  justify-content: center;
  padding-top: 0.25rem;
}

.vine-step__icon img {
  width: 100%;
  max-width: 48px;
  height: auto;
  object-fit: contain;
}

.vine-step__content {
  flex: 1;
}

.vine-step__badge {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #FF5050;
  margin: 0 0 0.25rem;
}

.vine-step__content h4 {
  margin: 0 0 0.5rem !important;
}

.vine-step__content p {
  margin: 0 0 1rem;
  line-height: 1.6;
}

/* --- Vine Section Cards (Identity page) --------------------------------- */

.vine-section {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem 0;
}

.vine-section__icon {
  flex-shrink: 0;
  width: 80px;
  display: flex;
  justify-content: center;
}

.vine-section__icon img {
  width: 100%;
  max-width: 80px;
  height: auto;
  object-fit: contain;
}

.vine-section__content h4 {
  margin: 0 0 0.5rem !important;
}

.vine-section__content p {
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

.vine-section__content a {
  text-decoration: none;
}

@media screen and (max-width: 30em) {
  .vine-step,
  .vine-feature,
  .vine-section {
    flex-direction: column;
    gap: 1rem;
  }

  .vine-feature__icon,
  .vine-step__icon,
  .vine-section__icon {
    width: auto;
  }
}

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

.md-typeset code {
  border-radius: 4px;
}

.md-typeset pre > code {
  border-radius: 4px;
}

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

.md-footer {
  display: none;
}

.vine-footer {
  background-color: #283A46;
  color: #F5F5F5;
  padding: 3rem 2rem 2rem;
  font-family: "Readex Pro", sans-serif;
}

.vine-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 3rem;
}

@media screen and (max-width: 60em) {
  .vine-footer__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.vine-footer__logo {
  height: 2rem;
  width: auto;
  margin-bottom: 1rem;
}

.vine-footer__subtitle {
  color: #F5F5F5;
  font-size: 0.875rem;
  margin: 0.25rem 0;
  opacity: 0.85;
}

.vine-footer__copyright {
  color: #848B91;
  font-size: 0.8rem;
  margin-top: 1rem;
}

.vine-footer__heading {
  color: #F5F5F5;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: 0;
}

.vine-footer__heading--policies {
  margin-top: 1.5rem;
}

.vine-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vine-footer__links li {
  margin: 0.3rem 0;
}

.vine-footer__links a {
  color: #80D1FE;
  text-decoration: none;
  font-size: 0.85rem;
}

.vine-footer__links a:hover {
  color: #29B1FF;
  text-decoration: underline;
}

.vine-footer__links-start a {
  color: #F5F5F5;
  font-weight: 600;
  font-size: 0.9rem;
  border-left: 3px solid #FF5050;
  padding-left: 0.5rem;
}

.vine-footer__support p {
  color: #F5F5F5;
  font-size: 0.85rem;
  opacity: 0.85;
  margin: 0 0 1rem;
  line-height: 1.5;
}

.vine-footer__support-btn {
  display: inline-block;
  background-color: #0070AF;
  color: #FFFFFF !important;
  font-family: "Readex Pro", sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.5rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.vine-footer__support-btn:hover {
  background-color: #00527F;
}

/* --- Vine Card (reusable grey-background card with icon) ---------------- */

.vine-card {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

[data-md-color-scheme="slate"] .vine-card {
  background: #1c3140;
}

.vine-card__icon {
  flex-shrink: 0;
  width: 80px;
  display: flex;
  justify-content: center;
}

.vine-card__icon img {
  width: 100%;
  max-width: 80px;
  height: auto;
  object-fit: contain;
}

.vine-card__content {
  flex: 1;
}

.vine-card__content h4,
.vine-card__content h5 {
  margin: 0 0 0.5rem !important;
}

.vine-card__content p {
  margin: 0 0 1rem;
  line-height: 1.6;
}

.vine-card__content a.md-button {
  margin-top: 0.5rem;
}

@media screen and (max-width: 30em) {
  .vine-card {
    flex-direction: column;
    gap: 1rem;
  }
  .vine-card__icon {
    width: auto;
  }
}

/* --- Vine Image Card (image alongside text, no grey bg) ----------------- */

.vine-image-card {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.vine-image-card__image {
  flex-shrink: 0;
  width: 120px;
  display: flex;
  justify-content: center;
}

.vine-image-card__image img {
  width: 100%;
  max-width: 120px;
  height: auto;
  object-fit: contain;
}

.vine-image-card__content {
  flex: 1;
}

.vine-image-card__content h4,
.vine-image-card__content h5 {
  margin: 0 0 0.5rem !important;
}

.vine-image-card__content p {
  margin: 0 0 1rem;
  line-height: 1.6;
}

@media screen and (max-width: 30em) {
  .vine-image-card {
    flex-direction: column;
    gap: 1rem;
  }
  .vine-image-card__image {
    width: auto;
  }
}

/* --- Vine Content Image (full-width screenshot/diagram) ----------------- */

.vine-content-image {
  margin: 1.5rem 0;
}

.vine-content-image img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid #ECEBEC;
}

[data-md-color-scheme="slate"] .vine-content-image img {
  border-color: rgba(255, 255, 255, 0.12);
}

/* --- Vine Hero (intro image + text) ------------------------------------- */

.vine-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin: 1rem 0 1.5rem;
}

.vine-hero__image {
  flex-shrink: 0;
  width: 140px;
}

.vine-hero__image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
}

.vine-hero__content {
  flex: 1;
}

@media screen and (max-width: 30em) {
  .vine-hero {
    flex-direction: column;
    gap: 1rem;
  }
  .vine-hero__image {
    width: 100px;
  }
}

/* --- Vine Card Label (uppercase heading in cards) ----------------------- */

.vine-card__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #666;
  margin: 0 0 0.5rem;
}

[data-md-color-scheme="slate"] .vine-card__label {
  color: #aaa;
}

/* --- Environment Card --------------------------------------------------- */

.vine-env-card {
  background: #f5f5f5;
  border-radius: 12px;
  padding: 2rem 2.5rem;
  margin: 2rem 0;
}

[data-md-color-scheme="slate"] .vine-env-card {
  background: #1c3140;
}

.vine-env-card__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.vine-env-card__header img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.vine-env-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.vine-env-card table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

.vine-env-card table thead {
  display: none;
}

[data-md-color-scheme="slate"] .vine-env-card table {
  background: #263845;
  border-color: rgba(255, 255, 255, 0.1);
}

.vine-env-card table td {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.9rem;
  vertical-align: middle;
}

[data-md-color-scheme="slate"] .vine-env-card table td {
  border-color: rgba(255, 255, 255, 0.08);
}

.vine-env-card table tr:last-child td {
  border-bottom: none;
}

.vine-env-card table td:first-child {
  color: #666;
  font-weight: 400;
  width: 140px;
  white-space: nowrap;
}

[data-md-color-scheme="slate"] .vine-env-card table td:first-child {
  color: #aaa;
}

.vine-env-card table td:last-child {
  font-weight: 500;
}

.vine-env-card table td:last-child code {
  background: none;
  padding: 0;
  font-size: 0.9rem;
  color: inherit;
  border: none;
  box-shadow: none;
}

.vine-env-callout {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  border: 1px solid #e0e0e0;
}

[data-md-color-scheme="slate"] .vine-env-callout {
  background: #263845;
  border-color: rgba(255, 255, 255, 0.1);
}

.vine-env-callout img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.vine-env-callout__text {
  flex: 1;
}

.vine-env-callout__text strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.vine-env-callout__text a {
  font-size: 0.85rem;
}

/* --- Header CTA Button -------------------------------------------------- */

.md-header__cta {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.md-header__cta a {
  background-color: #0070AF;
  color: #FFFFFF !important;
  font-family: "Readex Pro", sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  padding: 0.4rem 1.2rem;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.md-header__cta a:hover {
  background-color: #00527F;
}

/* Show site title in header */
.md-header__topic .md-ellipsis {
  font-weight: 500;
}
