/* ==========================================================================
   TriScale Innov Theme for Legolas++ (MkDocs Material)
   Colors inspired by https://triscale-innov.com:
     - Primary Deep Teal:  #177272
     - Primary Light Teal: #229999
     - Primary Dark Teal:  #0e4b4b
     - Accent Warm Coral:  #ee6f40
     - Accent Light Coral: #f28b63
     - Accent Coral Glow:  rgba(238, 111, 64, 0.15)
     - Slate Background:   #0f1722
     - Card Background:    #182230
     - Card Border:        #253549
   ========================================================================== */

:root {
  --md-primary-fg-color:        #177272;
  --md-primary-fg-color--light: #229999;
  --md-primary-fg-color--dark:  #0e4b4b;
  --md-accent-fg-color:         #ee6f40;
  --md-accent-fg-color--transparent: rgba(238, 111, 64, 0.12);
  --md-typeset-a-color:         #177272;
  --md-default-bg-color:        #f8fafc;
  --md-default-bg-color--light: #ffffff;
  --md-default-bg-color--lighter: #f1f5f9;
}

/* Global Typography Scaling (Harmonious proportions, preventing huge text) */
.md-typeset h1 {
  font-size: 1.55rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  margin-top: 0.5rem;
  margin-bottom: 0.9rem;
  line-height: 1.25;
}

.md-typeset h2 {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.md-typeset h3 {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
}

.md-typeset p, 
.md-typeset li {
  font-size: 0.88rem !important;
  line-height: 1.65 !important;
}

.md-typeset code {
  font-size: 0.82rem !important;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color:        #177272;
  --md-primary-fg-color--light: #28a3a3;
  --md-primary-fg-color--dark:  #0b3838;
  --md-accent-fg-color:         #ee6f40;
  --md-accent-fg-color--transparent: rgba(238, 111, 64, 0.18);
  --md-default-bg-color:        #0f1722;
  --md-default-bg-color--light: #16202e;
  --md-default-bg-color--lighter: #1e2b3d;
  --md-typeset-a-color:         #38bdf8;
}

/* Header & Navigation */
.md-header {
  background-color: #177272 !important;
  box-shadow: 0 2px 10px rgba(14, 75, 75, 0.4);
}

[data-md-color-scheme="slate"] .md-header {
  background-color: #0d2828 !important;
  border-bottom: 1px solid #1c4d4d;
}

.md-tabs {
  background-color: #0e4b4b !important;
}

[data-md-color-scheme="slate"] .md-tabs {
  background-color: #0a1f1f !important;
  border-bottom: 1px solid #163636;
}

.md-tabs__link--active, 
.md-tabs__link:hover {
  color: #ee6f40 !important;
}

/* Links & Accents */
.md-typeset a:hover {
  color: #ee6f40 !important;
  text-decoration: underline;
}

/* Admonitions */
.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-color: #177272;
}
.md-typeset .tip > .admonition-title,
.md-typeset .tip > summary {
  background-color: rgba(23, 114, 114, 0.12);
}

.md-typeset .admonition.warning,
.md-typeset details.warning,
.md-typeset .admonition.important,
.md-typeset details.important {
  border-color: #ee6f40;
}
.md-typeset .warning > .admonition-title,
.md-typeset .warning > summary,
.md-typeset .important > .admonition-title,
.md-typeset .important > summary {
  background-color: rgba(238, 111, 64, 0.12);
}

/* Buttons */
.md-button--primary {
  background-color: #ee6f40 !important;
  border-color: #ee6f40 !important;
  color: #ffffff !important;
  font-weight: 700;
  transition: all 0.2s ease;
}

.md-button--primary:hover {
  background-color: #f28b63 !important;
  border-color: #f28b63 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(238, 111, 64, 0.35);
}

.md-button--secondary {
  background-color: transparent !important;
  border-color: #177272 !important;
  color: #177272 !important;
  font-weight: 700;
}

[data-md-color-scheme="slate"] .md-button--secondary {
  color: #38bdf8 !important;
  border-color: #38bdf8 !important;
}

/* ==========================================================================
   Showcase Cards & Energy Efficiency Highlights (TriScale Aesthetics)
   ========================================================================== */

.showcase-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 1.5rem 0 2.5rem 0;
}

.showcase-card {
  position: relative;
  background: linear-gradient(145deg, #131d2b 0%, #1a2738 100%);
  border: 1px solid #283a50;
  border-top: 4px solid #177272;
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.showcase-card:hover {
  transform: translateY(-3px);
  border-top-color: #ee6f40;
  border-color: #3a5372;
  box-shadow: 0 8px 25px rgba(23, 114, 114, 0.2);
}

.showcase-card.featured {
  border-top: 4px solid #ee6f40;
  background: linear-gradient(145deg, #152030 0%, #1e2c3e 100%);
}

.showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.showcase-domain {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  background-color: rgba(23, 114, 114, 0.22);
  color: #5eead4;
  border: 1px solid rgba(23, 114, 114, 0.45);
}

.showcase-badge-hot {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  background-color: rgba(238, 111, 64, 0.22);
  color: #ee6f40;
  border: 1px solid rgba(238, 111, 64, 0.55);
}

.showcase-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0.2rem 0 0.4rem 0;
}

.showcase-description {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 0.8rem;
}

/* Metrics Pill Row - Balanced & Proportional */
.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 0.9rem 0;
}

@media (max-width: 580px) {
  .metric-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.metric-pill {
  background: rgba(15, 23, 34, 0.85);
  border: 1px solid #223447;
  border-radius: 7px;
  padding: 0.55rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-pill:hover {
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.metric-value {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 1.05rem;
  font-weight: 800;
  color: #38bdf8;
  display: block;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.metric-value.highlight-orange {
  color: #ee6f40;
}

.metric-value.highlight-green {
  color: #34d399;
}

.metric-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.25rem;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Green Computing & Energy Box */
.energy-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(23, 114, 114, 0.15) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.9rem;
}

.energy-box-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.3rem;
}

.energy-box-body {
  font-size: 0.80rem;
  color: #e2e8f0;
  line-height: 1.45;
}

.energy-stat {
  font-weight: 700;
  color: #5eead4;
}

/* Card Action Footer */
.showcase-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #223447;
  padding-top: 0.75rem;
  margin-top: auto;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.showcase-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ee6f40 !important;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none !important;
}

.showcase-link:hover {
  color: #f28b63 !important;
  transform: translateX(2px);
}

.source-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #64748b;
}

/* ==========================================================================
   Dual-Mode Logo Support (Light / Dark Mode Visibility)
   ========================================================================== */

.logo-dark-only {
  display: none !important;
}

.logo-light-only {
  display: inline-block !important;
}

[data-md-color-scheme="slate"] .logo-dark-only {
  display: inline-block !important;
}

[data-md-color-scheme="slate"] .logo-light-only {
  display: none !important;
}

/* ==========================================================================
   Responsive Tables & Peak Hardware Badges
   ========================================================================== */

.md-typeset table:not([class]) {
  display: table;
  width: 100% !important;
  font-size: 0.82rem !important;
  border-collapse: collapse;
  margin: 0.8rem 0;
}

.md-typeset__table {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0 1.5rem 0;
  border-radius: 8px;
  border: 1px solid #223447;
}

/* Eliminate nested scrollbars if inside a custom container */
.table-responsive {
  overflow: visible !important;
}

/* Custom sleek scrollbar for table container */
.md-typeset__table::-webkit-scrollbar {
  height: 5px;
}

.md-typeset__table::-webkit-scrollbar-track {
  background: #0f1722;
  border-radius: 3px;
}

.md-typeset__table::-webkit-scrollbar-thumb {
  background: #253549;
  border-radius: 3px;
}

.md-typeset__table::-webkit-scrollbar-thumb:hover {
  background: #177272;
}

.md-typeset table:not([class]) th {
  background: #182230 !important;
  color: #38bdf8 !important;
  font-size: 0.78rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.65rem 0.75rem !important;
  white-space: nowrap;
  border-bottom: 2px solid #283a50 !important;
}

.md-typeset table:not([class]) td {
  padding: 0.65rem 0.75rem !important;
  font-size: 0.82rem !important;
  border-bottom: 1px solid #1e2b3d !important;
  vertical-align: middle;
  line-height: 1.4;
}

/* Prevent awkward word wrapping in table code & identifiers */
.md-typeset table:not([class]) code {
  white-space: nowrap !important;
  font-size: 0.80rem !important;
}

.md-typeset table:not([class]) td:first-child,
.md-typeset table:not([class]) th:first-child {
  white-space: nowrap !important;
}

.md-typeset table:not([class]) td small {
  display: block;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.15rem;
  white-space: nowrap;
}

.badge-peak {
  display: inline-block;
  padding: 0.22rem 0.55rem;
  border-radius: 5px;
  background: rgba(52, 211, 153, 0.16);
  color: #34d399 !important;
  border: 1px solid rgba(52, 211, 153, 0.4);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-sub {
  display: inline-block;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.2rem;
  white-space: nowrap;
}


