/* === Squarespace Code Box Styling === */
.code-box {
  position: relative;
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  padding: 20px;
  margin-bottom: 1.5rem;
}

.code-box pre {
  margin: 0;
  font-family: monospace;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 50px;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  z-index: 2;
  backdrop-filter: blur(4px);
  transition: background 0.3s ease;
}
.copy-btn:hover { background: rgba(0,0,0,1); }
.copy-btn .material-icons { font-size: 16px; }

@media screen and (max-width: 600px) {
  .copy-btn {         
        top: 8px;
        right: 8px;
        width: auto;
        font-size: 15px;
        padding: 8px 14px;}
  .code-box pre { max-height: 300px; }
}

/* ===== Scrollbar Styling for Code Box ===== */

/* Hide scrollbar by default, show on hover or while scrolling */
.code-box pre::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: transparent; /* Invisible track */
}

/* Hide completely by default */
.code-box pre::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
}

/* Show only when hovering */
.code-box pre:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
}

/* Firefox support */
.code-box pre {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent; /* hides scrollbar until hover */
}

.code-box pre:hover {
  scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}
