@font-face {
  font-family: "Virgil";
  src: url("https://excalidraw.com/Virgil.woff2");
}

@font-face {
  font-family: "Cascadia";
  src: url("https://excalidraw.com/Cascadia.woff2");
}

@font-face {
  font-family: "Assistant";
  src: url("https://excalidraw.com/Assistant-Regular.woff2");
}

div.markdown-embed-title {
  display: none;
}

div.markdown-embed {
  border: none;
  padding: 0px;
  background-color: inherit;
}

div.excalidraw-svg {
  /* width: fit-content; */
  height: auto;
}

div.excalidraw-svg.excalidraw-loading {
  width: 100%;
}

.excalidraw-placeholder-surface {
  display: block;
  width: 100%;
  aspect-ratio: var(--excalidraw-width) / var(--excalidraw-height);
  background: #f5fbf6;
}

.excalidraw-placeholder-text {
  visibility: hidden;
  min-height: 1.4em;
}

svg.excalidraw-svg {
  max-width: 100%;
  max-height: 90vh;
  width: var(--page-width);
}

svg.excalidraw-svg.ex-pageheight {
  width: initial;
  height: 100%;
}

svg.excalidraw-svg.ex-pagewidth {
  width: 90vw;
  height: initial;
}

/* Excalidraw links: keep the drawing clean and reveal interactivity on hover. */
div.excalidraw-svg > svg.excalidraw-svg a {
  cursor: pointer;
  text-decoration: none !important;
  text-decoration-line: none !important;
}

div.excalidraw-svg > svg.excalidraw-svg a text {
  text-decoration: none !important;
  text-decoration-line: none !important;
  transition: fill 140ms ease;
}

@media (hover: hover) {
  div.excalidraw-svg > svg.excalidraw-svg a:hover text {
    fill: #d4e8f1 !important;
  }
}

div.excalidraw-svg > svg.excalidraw-svg a:focus-visible {
  outline: 3px solid #d4e8f1;
  outline-offset: 3px;
}

div.excalidraw-svg > svg.excalidraw-svg a:focus-visible text {
  fill: #d4e8f1 !important;
}

@media (prefers-reduced-motion: reduce) {
  div.excalidraw-svg > svg.excalidraw-svg a text {
    transition: none;
  }
}

.excalidraw-svg .text {
  width: 100%;
  text-align: center;
}

div.excalidraw-svg.enlarged {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/*
 * Diagram-first pages
 *
 * Keep normal articles at Obsidian Publish's readable line width, while
 * dedicated Excalidraw pages use the available center pane as a canvas.
 * Add `cssclasses: [publish-svg-wide]` to a page to opt in.
 */
.markdown-preview-view.publish-svg-wide {
  --page-width: 100%;
}

.markdown-preview-view.publish-svg-wide .markdown-preview-sizer {
  width: 100%;
  max-width: 1800px;
  margin-inline: auto;
  padding-inline: 32px;
}

.markdown-preview-view.publish-svg-wide .internal-embed,
.markdown-preview-view.publish-svg-wide div.excalidraw-svg {
  display: block;
  width: 100%;
  max-width: none;
}

.markdown-preview-view.publish-svg-wide svg.excalidraw-svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
}

.markdown-preview-view.publish-svg-wide div.excalidraw-svg > .text {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

/* Full-screen mode still has to fit both viewport axes. */
.markdown-preview-view.publish-svg-wide
  div.excalidraw-svg.enlarged
  > svg.excalidraw-svg {
  width: min(96vw, 1800px);
  max-width: 96vw;
  max-height: 88vh;
}

@media screen and (max-width: 750px) {
  .markdown-preview-view.publish-svg-wide .markdown-preview-sizer {
    width: 100%;
    max-width: 100%;
    padding-inline: 8px;
  }

  .markdown-preview-view.publish-svg-wide .internal-embed,
  .markdown-preview-view.publish-svg-wide div.excalidraw-svg,
  .markdown-preview-view.publish-svg-wide svg.excalidraw-svg {
    width: 100%;
    max-width: 100%;
  }
}

/* body {
  --background-primary: #fff6f0;
} */

a.site-body-left-column-site-name {
  display: none;
}

div.site-footer {
  display: none;
}

/* ==============================
   Language switcher
   Official-like custom dropdown
   ============================== */

.publish-lang-switcher {
  position: relative;
  margin: 12px 0 14px 0;
  padding: 0;
  width: 100%;
  z-index: 20;
}

.publish-lang-switcher-button {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--background-modifier-border);
  background: var(--background-secondary);
  color: var(--text-normal);
  font-size: 15px;
  line-height: 1.4;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}

.publish-lang-switcher-button:hover {
  background: var(--background-secondary-alt);
}

.publish-lang-switcher-button:focus-visible {
  outline: 2px solid var(--interactive-accent);
  outline-offset: 2px;
}

.publish-lang-switcher-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publish-lang-switcher-chevron {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  transform: translateY(-1px);
  transition: transform 120ms ease;
}

.publish-lang-switcher.is-open .publish-lang-switcher-chevron {
  transform: rotate(180deg) translateY(1px);
}

.publish-lang-switcher-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--background-modifier-border);
  background: var(--background-secondary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  z-index: 100;
}

.publish-lang-switcher.is-open .publish-lang-switcher-menu {
  display: block;
}

.publish-lang-switcher-item {
  width: 100%;
  min-height: 34px;
  box-sizing: border-box;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-normal);
  font-size: 14px;
  line-height: 1.4;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}

.publish-lang-switcher-item:hover {
  background: var(--background-modifier-hover);
}

.publish-lang-switcher-item.is-active {
  color: var(--text-normal);
}

.publish-lang-switcher-item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publish-lang-switcher-check {
  color: var(--interactive-accent);
  font-size: 14px;
  line-height: 1;
  flex: 0 0 auto;
}

/* Make it blend better with the left sidebar */
.site-body-left-column .publish-lang-switcher {
  max-width: 100%;
}

/* Mobile safety */
@media screen and (max-width: 750px) {
  .publish-lang-switcher {
    margin: 10px 0 12px 0;
  }

  .publish-lang-switcher-menu {
    position: static;
    margin-top: 6px;
  }
}
