/* Shared structure for the custom Type A callouts. */
:is(
  .theorem.cc-definition-a,
  .theorem.cc-proposition-a,
  .theorem.cc-theorem-a,
  .theorem.cc-example-a,
  .theorem.cc-exercise-a,
  .theorem.cc-remark-a,
  .proof.cc-proof-a,
  .proof.cc-remark-a,
  .remark.cc-remark-a
) {
  position: relative;
  width: 100%;
  margin: 1.15rem 0;
  padding: 1.05rem 1.15rem 1.1rem;
  overflow: hidden;
  border: 1px solid var(--cc-callout-border, var(--cc-border));
  border-left: 4px solid var(--cc-callout-accent, var(--cc-magenta));
  border-radius: 8px;
  background: var(--cc-callout-bg, #ffffff);
  box-shadow: var(--cc-callout-shadow, var(--cc-shadow));
  box-sizing: border-box;
}

:is(
  .theorem.cc-definition-a,
  .theorem.cc-proposition-a,
  .theorem.cc-theorem-a,
  .theorem.cc-example-a,
  .theorem.cc-exercise-a,
  .theorem.cc-remark-a,
  .proof.cc-proof-a,
  .proof.cc-remark-a,
  .remark.cc-remark-a
) .theorem-title::before,
:is(
  .theorem.cc-definition-a,
  .theorem.cc-proposition-a,
  .theorem.cc-theorem-a,
  .theorem.cc-example-a,
  .theorem.cc-exercise-a,
  .theorem.cc-remark-a,
  .proof.cc-proof-a,
  .proof.cc-remark-a,
  .remark.cc-remark-a
) .proof-title::before {
  display: inline-grid;
  width: 1.65rem;
  height: 1.65rem;
  flex: 0 0 1.65rem;
  place-items: center;
  border-radius: 999px;
  background: var(--cc-callout-accent, var(--cc-magenta));
  color: #ffffff;
  content: var(--cc-callout-icon, "");
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

:is(
  .theorem.cc-definition-a,
  .theorem.cc-proposition-a,
  .theorem.cc-theorem-a,
  .theorem.cc-example-a,
  .theorem.cc-exercise-a,
  .theorem.cc-remark-a,
  .proof.cc-proof-a,
  .proof.cc-remark-a,
  .remark.cc-remark-a
) > :first-child {
  margin-top: 0;
}

:is(
  .theorem.cc-definition-a,
  .theorem.cc-proposition-a,
  .theorem.cc-theorem-a,
  .theorem.cc-example-a,
  .theorem.cc-exercise-a,
  .theorem.cc-remark-a,
  .proof.cc-proof-a,
  .proof.cc-remark-a,
  .remark.cc-remark-a
) > :last-child {
  margin-bottom: 0;
}

:is(
  .theorem.cc-definition-a,
  .theorem.cc-proposition-a,
  .theorem.cc-theorem-a,
  .theorem.cc-example-a,
  .theorem.cc-exercise-a,
  .theorem.cc-remark-a,
  .proof.cc-proof-a,
  .proof.cc-remark-a,
  .remark.cc-remark-a
) .theorem-title,
:is(
  .theorem.cc-definition-a,
  .theorem.cc-proposition-a,
  .theorem.cc-example-a,
  .theorem.cc-exercise-a,
  .theorem.cc-remark-a,
  .proof.cc-remark-a,
  .remark.cc-remark-a
) .proof-title {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  margin-right: 0.25rem;
  color: var(--cc-callout-dark, var(--cc-magenta-dark));
  font-weight: 850;
  line-height: 1.25;
}

:is(
  .theorem.cc-definition-a,
  .theorem.cc-proposition-a,
  .theorem.cc-theorem-a,
  .theorem.cc-example-a,
  .theorem.cc-exercise-a,
  .theorem.cc-remark-a,
  .proof.cc-proof-a,
  .proof.cc-remark-a,
  .remark.cc-remark-a,
  div.callout.cc-proof-a,
  div.callout.cc-example-a,
  div.callout.cc-remark-a,
  div.callout.cc-warning-a,
  div.callout.cc-solution-a
) .math.display {
  display: block;
  max-width: 100%;
  margin: 0.85rem 0;
  padding: 0.75rem 0.9rem;
  overflow-x: auto;
  border: 1px solid rgba(54, 38, 52, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
}

div.callout:is(
  .cc-proof-a,
  .cc-example-a,
  .cc-remark-a,
  .cc-warning-a,
  .cc-solution-a
) {
  width: 100%;
  margin: 1.15rem 0 !important;
  overflow: hidden;
  border: 1px solid var(--cc-callout-border, var(--cc-border)) !important;
  border-left: 4px solid var(--cc-callout-accent, var(--cc-magenta)) !important;
  border-radius: 8px;
  background: var(--cc-callout-bg, #ffffff);
  box-shadow: var(--cc-callout-shadow, var(--cc-shadow));
  box-sizing: border-box;
}

div.callout:is(
  .cc-proof-a,
  .cc-example-a,
  .cc-remark-a,
  .cc-warning-a,
  .cc-solution-a
).callout-style-default > .callout-header {
  display: flex !important;
  align-items: center;
  gap: 0.85rem;
  min-height: 3rem;
  padding: 0.72rem 0.95rem;
  border-bottom: 1px solid var(--cc-callout-border, var(--cc-border));
  background: var(--cc-callout-soft, var(--cc-magenta-soft));
  color: var(--cc-callout-dark, var(--cc-magenta-dark));
  font-weight: 800;
}

div.callout:is(
  .cc-proof-a,
  .cc-example-a,
  .cc-remark-a,
  .cc-warning-a,
  .cc-solution-a
) .callout-icon-container {
  display: inline-grid;
  width: 1.65rem;
  height: 1.65rem;
  flex: 0 0 1.65rem;
  align-self: center;
  place-items: center;
  margin-right: 0 !important;
  border-radius: 999px;
  background: var(--cc-callout-accent, var(--cc-magenta));
  color: #ffffff;
}

div.callout:is(
  .cc-proof-a,
  .cc-example-a,
  .cc-remark-a,
  .cc-warning-a,
  .cc-solution-a
) .callout-icon-container::before {
  display: block;
  color: inherit;
  content: var(--cc-callout-icon, "");
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.65rem;
  text-align: center;
}

div.callout:is(
  .cc-proof-a,
  .cc-example-a,
  .cc-remark-a,
  .cc-warning-a,
  .cc-solution-a
) .callout-icon {
  display: none !important;
}

div.callout:is(
  .cc-proof-a,
  .cc-example-a,
  .cc-remark-a,
  .cc-warning-a,
  .cc-solution-a
) .callout-title-container {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  min-width: 0;
  color: var(--cc-callout-dark, var(--cc-magenta-dark));
  line-height: 1.32;
}

div.callout:is(
  .cc-proof-a,
  .cc-example-a,
  .cc-remark-a,
  .cc-warning-a,
  .cc-solution-a
) .callout-btn-toggle {
  margin-left: auto;
  color: var(--cc-callout-dark, var(--cc-magenta-dark));
}

div.callout:is(
  .cc-proof-a,
  .cc-example-a,
  .cc-remark-a,
  .cc-warning-a,
  .cc-solution-a
) .callout-body-container {
  padding: 0.95rem 1.08rem;
}

div.callout:is(
  .cc-proof-a,
  .cc-example-a,
  .cc-remark-a,
  .cc-warning-a,
  .cc-solution-a
) .callout-body-container > :first-child {
  margin-top: 0;
}

div.callout:is(
  .cc-proof-a,
  .cc-example-a,
  .cc-warning-a,
  .cc-solution-a
) .callout-body-container > :last-child {
  margin-bottom: 0;
}

@media (max-width: 620px) {
  :is(
    .theorem.cc-definition-a,
    .theorem.cc-proposition-a,
    .theorem.cc-theorem-a,
    .theorem.cc-example-a,
    .theorem.cc-exercise-a,
    .theorem.cc-remark-a,
    .proof.cc-proof-a,
    .proof.cc-remark-a,
    .remark.cc-remark-a
  ) {
    padding: 0.95rem;
  }
}
