/* Cambrian-P page skeleton + Astra-specific content overrides. */

pre,
code {
  font-size: 16px;
}

pre.bibtex-block {
  box-sizing: border-box;
  width: 150% !important;
  max-width: none !important;
  margin: 1.2rem 0 2.6rem -20% !important;
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
  line-height: 1.45;
}

.project-footer {
  box-sizing: border-box;
  width: 150%;
  margin: 3rem 0 2.8rem -20%;
  padding-top: 2rem;
  border-top: 1px solid #d9e2ef;
  color: #667085;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.45;
}

.project-footer p {
  margin: 0 0 1.1rem;
}

.header-wrapper {
  background:
    radial-gradient(circle at 20% 0%, rgba(223, 238, 255, 0.95), transparent 34rem),
    linear-gradient(135deg, #f8fbff 0%, #eef4fb 52%, #f7f7f3 100%) !important;
  display: flex;
  align-items: center;
  min-height: 92vh;
}

.header-container.astra-header {
  display: grid !important;
  grid-template-columns: minmax(500px, 0.98fr) minmax(430px, 1.02fr) !important;
  column-gap: clamp(2.4rem, 5vw, 5.2rem);
  row-gap: clamp(1.2rem, 2.4vw, 2rem);
  align-content: center;
  min-height: 78vh;
  padding-top: clamp(3.8rem, 7vh, 6.5rem);
  padding-bottom: clamp(4.4rem, 8vh, 7.2rem);
}

.astra-header .header-title {
  grid-column: 1;
  max-width: 720px;
  margin: 0;
  text-align: left;
}

.astra-header .header-title h1 {
  margin: 0;
  color: #243247;
  font-family: Charter, Georgia, serif;
  font-size: clamp(1.9rem, 2.75vw, 2.8rem);
  font-style: italic;
  font-weight: 700;
  line-height: 1.08;
  white-space: nowrap;
}

.astra-header .header-title h2 {
  margin: 0.65rem 0 0;
  color: #334155;
  font-size: clamp(1.15rem, 1.7vw, 1.55rem);
  line-height: 1.24;
}

.astra-header .paper-meta {
  margin-top: 1.1rem;
  color: #334155;
}

.astra-header .paper-authors,
.astra-header .paper-affiliations,
.astra-header .paper-notes {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}

.astra-header .paper-authors {
  gap: 0.15rem 0.72rem;
  font-family: Charter, Georgia, serif;
  font-size: clamp(0.96rem, 1.15vw, 1.08rem);
  font-weight: 600;
  line-height: 1.5;
}

.astra-header .paper-authors span,
.astra-header .paper-affiliations span,
.astra-header .paper-notes span {
  white-space: nowrap;
}

.astra-header .paper-affiliations {
  gap: 0.14rem 0.68rem;
  margin-top: 0.48rem;
  color: #516174;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(0.72rem, 0.9vw, 0.82rem);
  line-height: 1.45;
}

.astra-header .paper-notes {
  gap: 0.7rem;
  margin-top: 0.32rem;
  color: #64748b;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  line-height: 1.35;
}

.astra-header .paper-meta sup {
  margin-left: 0.08em;
  font-size: 0.66em;
  line-height: 0;
}

.astra-header .header-content {
  max-width: 720px;
  margin: 0;
  text-align: left;
}

.astra-header .icon-container {
  text-align: left;
  gap: 18px;
}

.astra-header .header-image {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none !important;
}

.astra-header .teaser-image {
  width: min(100%, 700px);
  aspect-ratio: 1500 / 860;
  max-width: none !important;
  max-height: 430px;
  margin: 0 !important;
  object-fit: contain;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 42px rgba(31, 41, 55, 0.12);
}

@media (max-width: 900px) {
  .header-wrapper {
    min-height: auto;
  }

  .header-container.astra-header {
    grid-template-columns: 1fr !important;
    min-height: auto;
  }

  .astra-header .header-title {
    grid-column: auto;
    text-align: left;
  }

  .astra-header .paper-authors,
  .astra-header .paper-affiliations,
  .astra-header .paper-notes {
    justify-content: flex-start;
  }

  .astra-header .header-image {
    grid-column: auto;
    grid-row: auto;
  }

  .astra-header .header-content {
    max-width: none;
  }
}

.astra-header .icon-item {
  align-items: flex-start;
  gap: 24px;
  color: #334155;
  line-height: 1.45;
}

.astra-header .icon-item img {
  width: 46px;
  height: 46px;
  margin-right: 0;
  object-fit: contain;
}

.astra-header .icon-item strong {
  color: #1f2937;
}

.astra-header .button-container a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-color: #b8c7dc;
  background: rgba(255, 255, 255, 0.68);
  color: #1f2937;
}

.astra-header .button-container .icon.is-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  font-size: 0.98em;
}

.astra-header .button-container a.button:hover {
  border-color: #5b7fac;
  background: #ffffff;
}

.astra-header .button-container a.button.disabled:hover {
  border-color: #b8c7dc;
  background: rgba(255, 255, 255, 0.68);
  color: #1f2937;
}

.icon-badge,
.nav-dot {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #eafaf1;
  color: #14532d;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 800;
}

.icon-badge {
  width: 44px;
  height: 44px;
  font-size: 0.85rem;
}

.nav-dot {
  width: 42px;
  height: 42px;
  margin-bottom: 0.4rem;
}

.button.disabled {
  opacity: 0.55;
  pointer-events: none;
}

d-article #fig-teaser,
d-article #fig-arch {
  grid-column: text !important;
}

d-article #fig-teaser figure,
d-article #fig-arch figure {
  width: 150%;
  max-width: none;
  margin-left: -20%;
  margin-right: 0;
}

d-article figure img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.wide-section {
  width: 150%;
  margin: 0 0 0 -20%;
}

#qualitative-visualization > .text {
  width: 100%;
  margin-right: 0;
  margin-left: 0;
}

.finding-card {
  width: 150%;
  margin: 1.35rem 0 1.45rem -20%;
  overflow: hidden;
  border: 1px solid #d9e2f2;
  border-radius: 8px;
  background: #f8faff;
  box-shadow: 0 10px 28px rgba(31, 41, 55, 0.06);
}

.finding-label {
  padding: 0.92rem 1.35rem;
  background: #627df1;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 800;
  line-height: 1.15;
}

.finding-card p {
  margin: 0;
  padding: 1.35rem;
  color: #1f2937;
  font-size: clamp(1.08rem, 1.65vw, 1.35rem);
  line-height: 1.55;
}

.finding-card strong {
  color: #111827;
}

.table-wrapper {
  display: block;
  width: 150%;
  margin: 1.5rem 0 2rem -20%;
}

.table-container {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 auto;
  min-width: 100%;
  font-size: 13px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.data-table thead th {
  padding: 0.5em 0.6em;
  border-bottom: 2px solid #333;
  background: #f2f2f2;
  color: #2d3748;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.data-table td {
  padding: 0.35em 0.6em;
  border-bottom: 1px solid #ececec;
  color: #4a5568;
  text-align: center;
}

.data-table td:first-child,
.data-table th:first-child,
.data-table td:nth-child(2),
.data-table th:nth-child(2) {
  text-align: left;
}

.data-table tr.ours td {
  background: #eafaf1;
  color: #14532d;
  font-weight: 700;
}

.table-wrapper figcaption {
  width: 100%;
  margin-top: 0.6rem;
  color: #555;
  font-size: 0.95rem;
  text-align: center;
}

.sim-comparison {
  --sim-comparison-width: min(150%, calc(100vw - 88px));
  width: var(--sim-comparison-width);
  margin: 1.55rem 0 1.25rem -20%;
  overflow-x: auto;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #fbfdff;
  box-shadow: 0 12px 32px rgba(31, 41, 55, 0.08);
}

.sim-comparison-header,
.sim-comparison-row {
  display: grid;
  grid-template-columns: 1.08fr 1.12fr repeat(5, minmax(112px, 1fr));
  gap: 10px;
  align-items: center;
  min-width: 1280px;
  padding: 14px 16px;
}

.sim-comparison-header {
  border-bottom: 2px solid #2f3a4a;
  background: #f2f2f2;
  color: #2d3748;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.sim-comparison-row + .sim-comparison-row {
  border-top: 1px solid #e5ebf2;
}

.sim-context-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.sim-context-stack img,
.sim-comparison figure img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
  border: 1px solid #d0d8e2;
  border-radius: 6px;
  background: #f8fafc;
  object-fit: cover;
}

.sim-action {
  padding: 10px 12px;
  border: 1px solid #b8d9cf;
  border-radius: 8px;
  background: #f1faf6;
  color: #244033;
  font-size: 14px;
  line-height: 1.32;
  text-align: left;
}

.sim-action strong {
  display: block;
  margin-bottom: 4px;
  color: #126b59;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.sim-action span {
  display: block;
}

.sim-comparison figure {
  margin: 0;
}

.sim-comparison figure.sim-ours img {
  border: 3px solid #31a36f;
  box-shadow: 0 0 0 3px rgba(49, 163, 111, 0.13);
}

.sim-comparison-row > figure:last-child img {
  border: 3px solid #d59a22;
  box-shadow: 0 0 0 3px rgba(213, 154, 34, 0.14);
}

.case-viewer {
  display: grid;
  grid-template-columns: minmax(230px, 0.34fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  width: 100%;
  margin: 1.2rem auto 2rem;
}

.case-controls {
  display: grid;
  gap: 10px;
}

.case-tab {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fafafa;
  color: #303030;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.case-tab:hover {
  background: #f4f7f5;
}

.case-tab.is-active {
  border-color: #9fc7aa;
  background: #eafaf1;
}

.case-tab span,
.case-kicker {
  display: block;
  margin-bottom: 5px;
  color: #14532d;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.case-tab strong {
  display: block;
  margin-bottom: 6px;
  color: #263246;
  font-size: 18px;
  line-height: 1.2;
}

.case-tab small {
  display: block;
  color: #555;
  font-size: 14px;
  line-height: 1.35;
}

.case-display {
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: white;
}

.case-summary {
  padding: 18px 20px;
  border-bottom: 1px solid #d9d9d9;
  background: #fafafa;
}

.case-summary h3 {
  margin: 0 0 8px;
  color: #263246;
  font-size: 23px;
  line-height: 1.2;
}

.case-summary p {
  margin-bottom: 0;
  color: #555;
  font-size: 17px;
  line-height: 1.45;
}

.case-link {
  display: inline-block;
  margin-top: 10px;
  color: #2563eb;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.case-content {
  padding: 18px;
}

.case-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.case-media {
  margin: 0;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fafafa;
}

.case-media span {
  display: block;
  padding: 9px 11px;
  border-bottom: 1px solid #d9d9d9;
  color: #263246;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.case-media img {
  width: 100%;
  aspect-ratio: 4 / 2.6;
  border: 0;
  object-fit: cover;
  object-position: center;
}

.cot-panel {
  margin-top: 16px;
  padding: 18px;
  border-left: 4px solid #2563eb;
  background: #f7f9fc;
}

.cot-panel h4 {
  margin: 0 0 10px;
  color: #263246;
  font-size: 20px;
}

.cot-block {
  margin: 0 0 12px;
  color: #303030;
  font-size: 17px;
  line-height: 1.5;
}

.tool-call {
  margin: 14px 0;
  padding: 10px 12px;
  overflow-x: auto;
  border: 1px solid #d6dce7;
  border-radius: 6px;
  background: white;
  color: #1f4f87;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.inline-generated-view {
  margin: 14px 0;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: white;
}

.inline-generated-view span {
  display: block;
  padding: 8px 11px;
  border-bottom: 1px solid #d9d9d9;
  color: #14532d;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.inline-generated-view img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  background: #f4f4f4;
}

@media (max-width: 768px) {
  d-article #fig-teaser figure,
  d-article #fig-arch figure,
  .wide-section,
  .table-wrapper,
  .finding-card,
  pre.bibtex-block,
  .project-footer,
  .sim-comparison {
    width: 100%;
    margin-left: 0;
  }

  pre.bibtex-block {
    width: 100% !important;
    margin-left: 0 !important;
  }

  .case-viewer,
  .case-media-grid {
    grid-template-columns: 1fr;
  }
}
