/* Factsheet-specific refinements layered on top of the main site styles */

/* Hide Quarto-generated page title completely - we use hero title instead */
#title-block-header,
.quarto-title,
header.quarto-title-block {
  display: none !important;
}

/* Override Quarto's container constraints */
#quarto-content,
.page-layout-full,
main.content {
  max-width: none !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

.sheet {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 55px -35px rgba(17, 24, 39, 0.45);
  margin: 0 auto 2rem;
  max-width: 1200px;
  width: 100%;
  padding: 2rem 2.5rem;
}

.sheet .hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 65%, #312e81 100%);
  border-radius: 14px;
  color: #f8fafc;
  margin-bottom: 1rem;
  padding: 1rem 1.5rem;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet .hero::after {
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  content: "";
  inset: 0;
  position: absolute;
  pointer-events: none;
}

/* Show hero title on screen and print */
.sheet .hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
  position: relative;
  z-index: 1;
}

.sheet .hero-meta {
  position: relative;
  z-index: 1;
}

.sheet .hero-meta div {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #cbd5f5;
}

.sheet .hero-meta strong {
  color: #f8fafc;
  font-weight: 600;
}

.sheet .meta-chip {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #f8fafc;
  display: inline-flex;
  font-size: 0.85rem;
  gap: 0.4rem;
  margin: 0.35rem 0.5rem 0 0;
  padding: 0.35rem 0.8rem;
  position: relative;
  z-index: 1;
}

.sheet .meta-chip b {
  color: inherit;
}

.sheet .section {
  margin-bottom: 1rem;
}

.sheet .section h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.sheet .section h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  margin-top: 0.8rem;
}

.sheet .section.purpose .lede {
  font-size: 1rem;
  line-height: 1.5;
  color: #1e293b;
}

.sheet .tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.sheet .tile {
  background: rgba(88, 28, 135, 0.05);
  border-radius: 4px;
  flex: 1 1 200px;
  padding: 0.3rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sheet .tile h4 {
  font-size: 0.7rem;
  margin: 0;
  font-weight: 500;
  flex: 1;
}

.sheet .tile .value {
  color: #581c87;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  line-height: 1;
  white-space: nowrap;
}

.sheet .layout-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
}

.sheet .layout-columns .column {
  flex: 1 1 260px;
  min-width: 240px;
}

.sheet img.chart {
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
  display: block;
  margin-top: 0.8rem;
  width: 100%;
  height: auto;
}

.sheet .sparkline {
  margin-bottom: 1.35rem;
}

.sheet .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0;
}

.sheet .chip {
  background: rgba(94, 100, 114, 0.08);
  border-radius: 999px;
  font-size: 0.85rem;
  padding: 0.35rem 0.9rem;
}

.sheet ul.key-takeaways {
  margin: 1rem 0 0 1.1rem;
  padding: 0;
}

.sheet ul.key-takeaways li {
  margin-bottom: 0.55rem;
}

/* Fundamentals table - clean two-column layout */
.sheet .fundamentals-table {
  width: 100%;
  max-width: 500px;
  border-collapse: collapse;
  margin: 0.5rem 0;
}

.sheet .fundamentals-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.9rem;
  line-height: 1.4;
}

.sheet .fundamentals-table tr:last-child td {
  border-bottom: none;
}

.sheet .fundamentals-table .fund-label {
  color: #64748b;
  font-weight: 500;
  width: 60%;
}

.sheet .fundamentals-table .fund-value {
  color: #1e293b;
  font-weight: 600;
  text-align: right;
  width: 40%;
}

.sheet .mini-bars .mini {
  align-items: center;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr auto auto;
  margin-bottom: 0.4rem;
}

.sheet .mini-bars .bar {
  background: rgba(14, 177, 210, 0.2);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  width: 140px;
}

.sheet .mini-bars .bar i {
  background: #0eb1d2;
  display: block;
  height: 100%;
}

.sheet table.compact {
  font-size: 0.75rem;
  line-height: 1.3;
  border-collapse: collapse;
  width: 100%;
}

.sheet table.compact thead {
  background: rgba(88, 28, 135, 0.08);
}

.sheet table.compact th {
  padding: 0.35rem 0.5rem;
  font-weight: 600;
  font-size: 0.7rem;
  text-align: left;
  color: #1e293b;
}

.sheet table.compact td {
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.sheet table.compact tbody tr:last-child td {
  border-bottom: none;
}

.sheet table.compact tbody tr:hover {
  background: rgba(88, 28, 135, 0.02);
}

.sheet .note {
  color: #64748b;
  font-size: 0.78rem;
  margin-top: 0.75rem;
}

/* Print header that will be added via HTML */
.pdf-header {
  display: none;
}

/* Strategy navigation - mobile-first responsive design */
.strategy-nav {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.strategy-nav .nav-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #1e293b;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.strategy-nav .nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.strategy-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: #334155;
  font-weight: 500;
  transition: all 0.2s ease;
}

.strategy-nav a:hover {
  color: #581c87;
  transform: translateX(2px);
}

.strategy-nav a.current {
  font-weight: 700;
  color: #581c87;
}

.strategy-nav hr {
  margin: 0.75rem 0;
  border: none;
  border-top: 1px solid #e2e8f0;
}

/* Desktop: fixed sidebar navigation */
@media (min-width: 1200px) {
  .strategy-nav {
    position: fixed;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    margin-bottom: 0;
    max-width: 160px;
    z-index: 1000;
  }
}

@media print {
  /* Hide navigation in print */
  .no-print {
    display: none !important;
  }
  @page {
    size: letter portrait;
    margin: 0;
  }

  * {
    margin: 0;
    padding: 0;
  }

  html, body {
    background: #ffffff !important;
    color: #0f172a;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Hide site navigation and header elements */
  nav,
  header,
  .navbar,
  #quarto-header,
  #quarto-margin-sidebar,
  #quarto-sidebar,
  .search,
  .navbar-brand,
  .navbar-nav,
  .page-navigation,
  footer,
  #quarto-content > *:not(main),
  .page-rows-contents > *:not(main) {
    display: none !important;
  }

  /* Remove ALL margins and padding from wrapper elements */
  #quarto-content,
  .page-rows-contents,
  main,
  .column-page-left,
  #quarto-document-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  /* Show PDF header - full bleed */
  .pdf-header {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #581c87;
    height: 50px;
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
  }

  .pdf-header img {
    height: 36px;
    width: auto;
  }

  .sheet {
    box-shadow: none !important;
    margin: 50px 0 0 0 !important;
    max-width: none !important;
    padding: 0 0.4in 0.3in 0.4in !important;
    border-radius: 0 !important;
  }

  /* Hide Quarto page title in print */
  #title-block-header {
    display: none !important;
  }

  .sheet .section {
    margin-bottom: 0.6rem !important;
  }

  .sheet .hero {
    margin-bottom: 0.6rem !important;
    margin-left: -0.4in !important;
    margin-right: -0.4in !important;
    padding: 0.8rem 0.4in !important;
    border-radius: 0 !important;
    justify-content: space-between !important;
  }

  /* Show hero title in print */
  .sheet .hero-title {
    display: block !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #f8fafc !important;
    margin: 0 !important;
    position: relative;
    z-index: 1;
  }

  .sheet .hero-meta {
    text-align: right !important;
  }

  .sheet .layout-columns {
    gap: 0.8rem !important;
  }

  .sheet .tile {
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
    padding: 0.25rem 0.45rem !important;
    border-radius: 3px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.4rem !important;
  }

  .sheet .tile h4 {
    font-size: 0.65rem !important;
    margin: 0 !important;
    font-weight: 500 !important;
    flex: 1 !important;
  }

  .sheet .tile .value {
    font-size: 0.8rem !important;
    margin: 0 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .sheet .tiles {
    margin-bottom: 0.4rem !important;
    gap: 0.6rem !important;
  }

  .stats-badge {
    padding: 0.45rem 0.55rem !important;
    margin-bottom: 0.7rem !important;
  }

  .stats-badge > div {
    gap: 0.3rem 0.6rem !important;
  }

  .stats-badge div[style*="font-size: 0.75rem"] {
    font-size: 0.68rem !important;
  }

  .stats-badge div[style*="font-size: 0.9rem"] {
    font-size: 0.75rem !important;
  }

  .sheet .hero {
    border-radius: 0;
  }

  .sheet .hero h1 {
    font-size: 1.75rem !important;
    margin-bottom: 0.4rem !important;
  }

  .sheet h2 {
    margin-bottom: 0.4rem !important;
    font-size: 1.2rem !important;
  }

  .sheet h3 {
    margin-bottom: 0.3rem !important;
    font-size: 1rem !important;
  }

  .sheet .note {
    margin-top: 0.3rem !important;
    font-size: 0.68rem !important;
    line-height: 1.3 !important;
  }

  .sheet table {
    margin: 0.3rem 0 !important;
  }

  .sheet table.compact {
    font-size: 0.7rem !important;
  }

  .sheet table.compact thead {
    background: rgba(88, 28, 135, 0.1) !important;
  }

  .sheet table.compact th {
    padding: 0.25rem 0.4rem !important;
    font-size: 0.65rem !important;
  }

  .sheet table.compact td {
    padding: 0.22rem 0.4rem !important;
  }

  .sheet ul.key-takeaways {
    margin: 0.5rem 0 0 1rem !important;
    font-size: 0.85rem !important;
  }

  .sheet ul.key-takeaways li {
    margin-bottom: 0.25rem !important;
    line-height: 1.35 !important;
  }

  .sheet .section.purpose {
    margin-bottom: 0.6rem !important;
  }

  .sheet .section.purpose .lede {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
  }

  .sheet .section.positioning {
    margin-bottom: 0.5rem !important;
  }

  .sheet .mini-bars .mini {
    margin-bottom: 0.25rem !important;
    font-size: 0.8rem !important;
  }
}
