/* Tema visual único das páginas públicas Greco. */
:root {
  --greco-page-bg: linear-gradient(180deg, #f7f8fc 0%, #ffffff 42%, #f2f6f8 100%);
  --greco-surface: #ffffff;
  --greco-surface-soft: #f8fbfd;
  --greco-text: #212529;
  --greco-muted: #495057;
  --greco-border: #dee2e6;
  --greco-card-shadow: 0 10px 30px rgba(16, 42, 67, .08);
}

[data-bs-theme="dark"] {
  --greco-page-bg: linear-gradient(180deg, #111827 0%, #1f2937 55%, #0f172a 100%);
  --greco-surface: #1e293b;
  --greco-surface-soft: #273449;
  --greco-text: #f8fafc;
  --greco-muted: #cbd5e1;
  --greco-border: #475569;
  --greco-card-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}

html,
body { min-height: 100%; }

body {
  background: var(--greco-page-bg);
  color: var(--greco-text);
  transition: background-color .2s ease, color .2s ease;
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-secondary {
  color: var(--greco-muted) !important;
}

[data-bs-theme="dark"] .text-white-75 {
  color: rgba(255, 255, 255, .82) !important;
}

/* Superfícies estruturais devem usar as cores do tema. */
.greco-card,
[data-bs-theme="dark"] .section-card,
[data-bs-theme="dark"] .card {
  box-shadow: var(--greco-card-shadow);
}

.section-card {
  background: var(--greco-surface);
  color: var(--greco-text);
  border-color: var(--greco-border);
}

[data-bs-theme="dark"] .bg-light:not([class*="text-bg"]):not([class*="bg-opacity"]) {
  background-color: var(--greco-surface-soft) !important;
  color: var(--greco-text);
}

[data-bs-theme="dark"] .bg-light:not([class*="text-bg"]) .text-muted,
[data-bs-theme="dark"] .bg-light:not([class*="text-bg"]) .text-secondary {
  color: var(--greco-muted) !important;
}

/* Blocos que permanecem brancos precisam conservar texto escuro. */
[data-bs-theme="dark"] .bg-white:not([class*="bg-opacity"]),
[data-bs-theme="dark"] .stat-card,
[data-bs-theme="dark"] .highlight-card {
  color: #111827;
}

/* Cards técnicos: superfície clara intencional, sempre com texto escuro. */
.greco-info-card {
  background: #ffffff;
  color: #111827;
  border-color: #d1d5db !important;
}

.greco-info-card .text-muted,
.greco-info-card .text-secondary,
.greco-info-card .greco-info-label,
.greco-info-card .greco-info-more,
.greco-info-card small {
  color: #374151 !important;
}

[data-bs-theme="dark"] .bg-white:not([class*="bg-opacity"]) .text-muted,
[data-bs-theme="dark"] .stat-card .text-muted,
[data-bs-theme="dark"] .highlight-card .text-muted,
.highlight-card .text-muted {
  color: #111827 !important;
}

[data-bs-theme="dark"] .bg-white:not([class*="bg-opacity"]) .text-uppercase,
[data-bs-theme="dark"] .bg-white:not([class*="bg-opacity"]) .small {
  color: #111827 !important;
}

.highlight-card,
.highlight-card h3,
.highlight-card p,
.greco-highlight-text {
  color: #111827 !important;
}

/* Rótulos dos cards de informações do navio ficam legíveis sobre fundo branco. */
.greco-info-label,
.greco-info-more {
  color: #111827 !important;
}

/* Rótulos do quadro-resumo precisam acompanhar o contraste do tema. */
.summary-label {
  color: var(--greco-muted) !important;
}

[data-bs-theme="dark"] .sticky-box .section-card dl .greco-info-label {
  color: var(--greco-muted) !important;
}

[data-bs-theme="dark"] .section-card:not(.bg-white) .text-muted,
[data-bs-theme="dark"] .sticky-box .text-muted {
  color: var(--greco-muted) !important;
}

/* Badges longos nunca podem aumentar a largura do card. */
.badge {
  display: inline-block;
  min-width: 0;
  max-width: 100% !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  text-align: left;
}

.d-flex.flex-wrap > .badge {
  flex: 0 1 auto;
  min-width: 0;
}
