/* Global background for the whole site */
body {
  background-image: url("/background.svg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}


/* Navigation spacing */
.headerLinks li {
  margin-left: 0.75rem !important;
  margin-right: 0.75rem !important;
}

/* Navigation link hover effects */
.headerLinks a {
  text-decoration: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.headerLinks a::before,
.headerLinks a::after {
  content: "";
  position: absolute;
  background-color: #A6A6A6;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transition: transform 0.4s;
}

.headerLinks a::before {
  top: -2px;
  left: 0;
  transform-origin: left;
}

.headerLinks a::after {
  bottom: -2px;
  right: 0;
  transform-origin: right;
}

.headerLinks a:hover::before,
.headerLinks a:hover::after {
  transform: scaleX(1);
}

/* Left-align post titles within their centered containers */
.postTitle {
  text-align: left !important;
}

/* Mermaid diagrams */
.mermaid {
  margin: 2rem 0;
  padding: 2rem 2.5rem;
  background: rgba(37, 38, 39, 0.5);
  border-radius: 8px;
  overflow-x: auto;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.mermaid:hover {
  background: rgba(37, 38, 39, 0.7);
}

.mermaid svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Node label padding inside Mermaid SVGs */
.mermaid svg .label {
  padding: 8px 12px;
}

.mermaid svg .nodeLabel {
  padding: 8px 12px;
}

.mermaid svg g.node rect,
.mermaid svg g.node circle,
.mermaid svg g.node ellipse,
.mermaid svg g.node polygon {
  rx: 6px;
  ry: 6px;
}

/* Sequence diagram actor and message padding */
.mermaid svg .actor {
  padding: 12px 16px;
}

.mermaid svg text.actor {
  font-size: 14px;
}

.mermaid svg .messageText {
  font-size: 13px;
}

.mermaid svg .labelBox {
  padding: 6px 10px;
}

/* Mermaid lightbox modal */
.mermaid-modal {
  display: none;
  position: fixed !important;
  z-index: 9999 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.95) !important;
  cursor: zoom-out;
  overflow: auto;
  padding: 2rem;
  margin: 0 !important;
}

.mermaid-modal.active {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.mermaid-modal-content {
  max-width: 95vw;
  max-height: 95vh;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mermaid-modal-content svg {
  width: auto !important;
  height: auto !important;
  max-width: 90vw !important;
  max-height: 85vh !important;
  min-width: 60vw;
  min-height: 40vh;
}

.mermaid-modal-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  color: #f8f8ff;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  background: rgba(45, 55, 72, 0.8);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #80AADD;
}

.mermaid-modal-close:hover {
  background: rgba(45, 55, 72, 1);
  border-color: #63b3ed;
}

/* Callout blocks for important information */
.callout {
  margin: 2rem 0;
  padding: 1.5rem;
  border-left: 4px solid #6b7280;
  background: rgba(107, 114, 128, 0.1);
  border-radius: 0 4px 4px 0;
}

.callout p:first-child {
  margin-top: 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* Callout variants */
.callout.info {
  border-left-color: #6b7280;
  background: rgba(107, 114, 128, 0.1);
}

.callout.warning {
  border-left-color: #92703a;
  background: rgba(146, 112, 58, 0.1);
}

.callout.success {
  border-left-color: #4a7058;
  background: rgba(74, 112, 88, 0.1);
}

.callout.danger {
  border-left-color: #8a5a5c;
  background: rgba(138, 90, 92, 0.1);
}

/* Table styling for better readability */
/* Only target tables NOT inside pre/code blocks */
.postWrapper > table,
.postWrapper p + table,
.postWrapper h2 + table,
.postWrapper h3 + table,
article table,
main table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 2rem 0 !important;
  font-size: 0.9rem !important;
}

.postWrapper > table th,
.postWrapper > table td,
.postWrapper p + table th,
.postWrapper p + table td,
.postWrapper h2 + table th,
.postWrapper h2 + table td,
.postWrapper h3 + table th,
.postWrapper h3 + table td,
article table th,
article table td,
main table th,
main table td {
  padding: 1rem 2rem !important;
  text-align: left !important;
  border: 1px solid rgba(107, 114, 128, 0.3) !important;
}

.postWrapper > table th,
.postWrapper p + table th,
.postWrapper h2 + table th,
.postWrapper h3 + table th,
article table th,
main table th {
  font-weight: 600 !important;
  background: rgba(58, 74, 92, 0.4) !important;
  border-bottom: 2px solid rgba(107, 114, 128, 0.5) !important;
}

.postWrapper > table tr:hover,
.postWrapper p + table tr:hover,
.postWrapper h2 + table tr:hover,
.postWrapper h3 + table tr:hover,
article table tr:hover,
main table tr:hover {
  background: rgba(58, 74, 92, 0.2) !important;
}

.postWrapper > table td:first-child,
.postWrapper > table th:first-child,
.postWrapper p + table td:first-child,
.postWrapper p + table th:first-child,
.postWrapper h2 + table td:first-child,
.postWrapper h2 + table th:first-child,
.postWrapper h3 + table td:first-child,
.postWrapper h3 + table th:first-child,
article table td:first-child,
article table th:first-child,
main table td:first-child,
main table th:first-child {
  font-weight: 600 !important;
}

/* Ensure code blocks are not affected - must override table padding */
.highlight table,
.highlight table td,
.highlight table th {
  all: revert !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: none !important;
  width: auto !important;
  font-weight: normal !important;
}

/* Wider content area for technical articles with diagrams */
@media only screen and (min-width: 992px) {
  .main {
    width: 1024px !important;
    max-width: 95vw !important;
  }
}

