/* Root Variables */
/* Import Modular CSS */
@import 'css_modules/spellblocks/alert.css';
@import 'css_modules/spellblocks/card.css';
@import 'css_modules/spellblocks/accordion.css';

:root {
    --sb-btn-default-color: var(--sb-primary-color);
    --sb-btn-default-bg: var(--sb-primary-bg);
    --sb-btn-default-border: var(--sb-primary-border);
}

/* Content Link Styling - Only for spellbook content, not navigation */
/* Target links within spellbook content containers */
.sb-content a,
.sb-markdown-content a,
.sb-blockquote a {
  color: var(--link-color, var(--primary-color, #60a5fa));
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  font-weight: 500;
  transition: color 0.2s ease-in-out, text-decoration-color 0.2s ease-in-out;
}

.sb-content a:hover,
.sb-markdown-content a:hover,
.sb-blockquote a:hover {
  color: var(--link-hover-color, var(--accent-color, #fbbf24));
  text-decoration-thickness: 2px;
}

.sb-content a:visited,
.sb-markdown-content a:visited,
.sb-blockquote a:visited {
  color: var(--link-visited-color, var(--emphasis-color, #a78bfa));
}

.sb-content a:focus-visible,
.sb-markdown-content a:focus-visible,
.sb-blockquote a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Quote Block */
.sb-blockquote {
  position: relative;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  background-color: color-mix(in srgb, var(--neutral-color) 3%, white);
  border-left: 4px solid var(--accent-color);
  border-radius: 0.375rem;
  max-width: 90%;
  margin: auto;
  margin-bottom: 1.5rem;
  box-shadow: 0 0.125rem 0.25rem color-mix(in srgb, black 5%, transparent);
  transition: all 0.2s ease-in-out;
}

.sb-blockquote:hover {
  box-shadow: 0 0.25rem 0.5rem color-mix(in srgb, black 7.5%, transparent);
  border-left-width: 6px;
}

.sb-blockquote p {
  font-style: italic;
  color: color-mix(in srgb, var(--neutral-color) 90%, black);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.sb-blockquote footer {
  font-size: 0.875rem;
  color: color-mix(in srgb, var(--neutral-color) 70%, black);
}

.sb-blockquote cite {
  font-weight: 600;
  font-style: normal;
}
/* Quote block styles with image support */
.sb-quote-with-image .sb-quote-inner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.sb-quote-image-wrapper {
  flex-shrink: 0;
}

.sb-quote-image {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sb-quote-content {
  flex-grow: 1;
  min-width: 0; /* Prevents text from overflowing */
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .sb-quote-with-image .sb-quote-inner {
      flex-direction: column;
      align-items: center;
      text-align: center;
  }
  
  .sb-quote-image {
      margin-bottom: 0.75rem;
  }
}

/* Practice Block */
.sb-practice-block {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 90%;
  margin: auto;
  margin-bottom: 2rem;
  word-wrap: break-word;
  background-color: white;
  background-clip: border-box;
  border: 1px solid color-mix(in srgb, var(--neutral-color) 20%, transparent);
  border-radius: 0.5rem;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 0.125rem 0.375rem color-mix(in srgb, black 10%, transparent);
}

.sb-practice-block:hover {
  box-shadow: 0 0.5rem 1rem color-mix(in srgb, black 15%, transparent);
  transform: translateY(-3px);
}

.sb-practice-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem;
  background-color: color-mix(in srgb, var(--neutral-color) 5%, white);
  border-bottom: 1px solid color-mix(in srgb, var(--neutral-color) 15%, transparent);
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.sb-practice-content {
  padding: 1.25rem;
}

.sb-practice-content h3 {
  margin-top: 0;
  color: color-mix(in srgb, var(--primary-color) 80%, black);
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.sb-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.sb-badge strong {
  margin-right: 0.25rem;
}

/* Difficulty badges */
.sb-difficulty-level[data-difficulty="beginner"] {
  background-color: color-mix(in srgb, var(--success-color) 15%, white);
  color: color-mix(in srgb, var(--success-color) 70%, black);
}

.sb-difficulty-level[data-difficulty="intermediate"] {
  background-color: color-mix(in srgb, var(--warning-color) 15%, white);
  color: color-mix(in srgb, var(--warning-color) 70%, black);
}

.sb-difficulty-level[data-difficulty="advanced"] {
  background-color: color-mix(in srgb, var(--error-color) 15%, white);
  color: color-mix(in srgb, var(--error-color) 70%, black);
}

/* Impact badges */
.sb-impact-level[data-impact="high"] {
  background-color: color-mix(in srgb, var(--info-color) 15%, white);
  color: color-mix(in srgb, var(--info-color) 70%, black);
}

.sb-impact-level[data-impact="transformative"] {
  background-color: color-mix(in srgb, var(--primary-color) 15%, white);
  color: color-mix(in srgb, var(--primary-color) 70%, black);
}

/* Focus badges */
.sb-focus-area {
  background-color: color-mix(in srgb, var(--secondary-color) 15%, white);
  color: color-mix(in srgb, var(--secondary-color) 70%, black);
}

/* Timeframe badges */
.sb-time-commitment {
  background-color: color-mix(in srgb, var(--accent-color) 15%, white);
  color: color-mix(in srgb, var(--accent-color) 70%, black);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .sb-practice-metadata {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .sb-badge {
    width: 100%;
  }
}

/* Metadata Component */
.sb-metadata {
  position: relative;
  margin-bottom: 1.5rem;
  transition: all 0.2s ease-in-out;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.sb-metadata:hover {
  box-shadow: 0 0.25rem 0.5rem color-mix(in srgb, var(--neutral-color, #6b7280) 15%, transparent);
}

.sb-metadata-user {
  border-color: color-mix(in srgb, var(--secondary-color) 25%, transparent);
  background-color: color-mix(in srgb, var(--secondary-color) 10%, var(--surface-color, var(--background-color, #ffffff)));
}

.sb-metadata-directory {
  border-color: color-mix(in srgb, var(--secondary-color) 25%, transparent);
  background-color: color-mix(in srgb, var(--secondary-color) 10%, var(--surface-color, var(--background-color, #ffffff)));
}

.sb-metadata-dev {
  border-color: color-mix(in srgb, var(--info-color) 25%, transparent);
  background-color: color-mix(in srgb, var(--info-color) 10%, var(--surface-color, var(--background-color, #ffffff)));
}

.sb-metadata-title {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.sb-metadata-grid {
  display: grid;
  gap: 0.5rem;
}

.sb-metadata-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sb-metadata-label {
  font-weight: 600;
  color: var(--secondary-color, #64748b);
  white-space: nowrap;
}

.sb-metadata-value {
  word-break: break-word;
}

.sb-metadata-code {
  font-family: monospace;
  background-color: color-mix(in srgb, var(--neutral-color, #6b7280) 10%, transparent);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  word-break: break-all;
}

.sb-metadata-tags {
  margin-top: 0.5rem;
}

.sb-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 9999px;
  background-color: color-mix(in srgb, var(--primary-color) 10%, white);
  color: color-mix(in srgb, var(--primary-color) 70%, black);
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
}

.sb-tag:hover {
  background-color: color-mix(in srgb, var(--primary-color) 15%, white);
}

.sb-metadata-navigation {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid color-mix(in srgb, var(--secondary-color) 15%, transparent);
  display: flex;
  justify-content: space-between;
}

.sb-metadata-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.sb-metadata-nav-link:hover {
  color: color-mix(in srgb, var(--primary-color) 70%, black);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .sb-metadata-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .sb-metadata-code {
    width: 100%;
    overflow-x: auto;
  }
}

/* ==========================================================================
   ProgressBar Component
   ========================================================================== */

.sb-progress-container {
  /* Primary container, width is handled by sb-w-full utility */
  transition: all 0.2s ease-in-out;
}

.sb-progress-container:hover {
  font-weight: bold;
}

.sb-progress-label-external {
  /* Styling for label displayed above the bar */
  /* font-size, margin-bottom handled by sb-text-sm, sb-mb-1 utilities */
}

.sb-progress {
  /* The track/background of the progress bar */
  display: flex; /* Ensures children (the fill) behave as expected */
  /* width, height, bg-color, border-radius handled by utility classes */
  /* sb-overflow-hidden is crucial to clip the sb-progress-bar if rounded corners are used */
}

.sb-progress-bar {
  /* The colored fill part of the progress bar */
  /* height, bg-color, border-radius handled by utility classes */
  /* sb-flex, sb-items-center, sb-justify-center for positioning the internal label */
  color: #ffffff; /* Default text color for internal label, assuming dark fill. Adjust if needed. */
  text-align: center;
  transition: width 0.6s ease;
  position: relative; /* Helps contain absolutely positioned children if ever needed, though not used here. */
}

.sb-progress-label-internal {
  /* Styling for label displayed INSIDE the bar */
  /* font-size, font-weight, padding handled by sb-text-xs, sb-font-semibold, sb-px-1 utilities */
  /* sb-whitespace-nowrap, sb-overflow-hidden, sb-text-ellipsis ensure text behaves well if too long for the bar */
  line-height: 1; /* Helps with vertical centering and consistency */
  display: inline-block; /* Allows text-ellipsis to work with overflow:hidden */
  max-width: 100%; /* Ensures the label doesn't try to be wider than its parent bar */
}

/* Striped Effect */
.sb-progress-bar-striped {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem; /* Adjust size of stripes */
}

/* Animation for Striped Bars */
.sb-progress-bar-animated {
  animation: sb-progress-bar-stripes 1s linear infinite;
}

@keyframes sb-progress-bar-stripes {
  from { background-position-x: 1rem; }
  to { background-position-x: 0; }
}

.sb-progress-container:hover {
  font-weight: bold;
  cursor: default;
  scale: 1.05;
}


.sb-progress-popover-content {
  transition: all 0.2s ease-in-out;
  position: fixed;
  z-index: 1000;
  border: 2px solid rgb(87, 87, 87);
  border-radius: 5px;
  padding: 0.75rem; /* sb-p-3 */
  box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.15); /* var(--sb-shadow-md) */
  max-width: 90%; /* Or whatever max-width is suitable */
  pointer-events: none; /* So the popover itself doesn't interfere with mouse events on elements below it */
  /* display: none; is handled by JS and inline style */
}

.sb-animate-fade-in {
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
    /* ==========================================================================
   Hero SpellBlock Styles (MVP)
   ========================================================================== */

/* --- I. Main Hero Container --- */
.sb-hero {
  position: relative; /* For potential absolute positioned children like overlays */
  display: flex; /* Default to flex for content alignment, can be overridden by layout specifics */
  width: 100%;
  overflow: hidden; /* Prevents content from spilling, especially with background images */
  padding: 2rem 1rem; /* Default padding, adjust as needed (e.g., var(--sb-spacing-8) var(--sb-spacing-4)) */
  box-sizing: border-box;
  /* min-height will be set by inline style from parameter, or by .sb-min-h-screen if used */
}



/* --- Layout Modifier Classes (applied to .sb-hero) --- */

/* 1. Layout: Text Left, Image Right */
.sb-hero-layout--text-left-image-right .sb-hero-content-wrapper {
  display: grid;
  grid-template-columns: 1fr; /* Mobile: single column */
  gap: 2rem; /* Default gap, (e.g., var(--sb-spacing-8)) */
  align-items: center; /* Vertically align columns if they have different heights */
  width: 100%;
  max-width: var(--sb-breakpoint-lg, 1024px); /* Example max-width for content */
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) { /* md breakpoint, adjust as per your theme */
  .sb-hero-layout--text-left-image-right .sb-hero-content-wrapper {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* Two equal columns on medium screens and up */
  }
}

.sb-hero-layout--text-left-image-right .sb-hero-text-column {
  /* Specific styles if text column needs them beyond what content wrapper provides */
  /* e.g., text alignment for mobile might be here if not handled by utilities */
}
/* Style for when text background is applied */
.sb-hero-text-column[class*="sb-bg-"] { /* Selects if any sb-bg-* class is present */
  padding: 1rem; /* Or var(--sb-spacing-4) - adjust as needed */
  border-radius: var(--sb-border-radius-sm, 0.25rem); /* Optional: slightly round the text background */
}

.sb-hero-layout--text-left-image-right .sb-hero-media-column {
  display: flex; /* To help center or align the image if needed */
  justify-content: center; /* Example alignment */
  align-items: center;
}

/* 2. Layout: Text Centered, Image Background */
.sb-hero-layout--text-center-image-background {
  /* The main .sb-hero itself will often carry the background image via inline style or a class */
  background-size: cover;
  background-position: center center;
  display: flex; /* Ensure it remains a flex container for vertical alignment */
  justify-content: center; /* Horizontally center the .sb-hero-content-wrapper */
  /* Vertical alignment is handled by .sb-items-* on .sb-hero */
  padding: 4rem 1rem; /* Larger default padding for this layout (e.g., var(--sb-spacing-16) var(--sb-spacing-4)) */
}

.sb-hero-layout--text-center-image-background .sb-hero-background-image-wrapper {
  /* This is an alternative if you want a dedicated div for the background image
     instead of putting it on the main .sb-hero section.
     If used, it would need absolute positioning to fill .sb-hero. */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-size: cover;
  background-position: center center;
}
.sb-hero-layout--text-center-image-background .sb-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.1); /* Default overlay, make this configurable */
  /* z-index is also not strictly needed here due to source order within the media wrapper */}

  .sb-hero-layout--text-center-image-background .sb-hero-content-wrapper {
    position: relative; /* Establishes a stacking context and allows z-index to work reliably */
    z-index: 1;         /* Sits on top of .sb-hero-background-media-wrapper (which is z-index: 0) */
    text-align: center;
    max-width: var(--sb-breakpoint-md, 768px); /* Adjust as needed */
    width: 90%; /* Example: ensure it doesn't touch edges on smaller viewports if padding on parent is small */
    padding: 1rem; /* Add some padding inside the content wrapper if it has its own background (text_bg_color) */
    box-sizing: border-box;
    /* The margin:auto for horizontal centering is handled by justify-content:center on the parent .sb-hero */
  }

/* 3. Layout: Text Only, Centered */
.sb-hero-layout--text-only-centered {
  display: flex; /* Ensure it remains a flex container for vertical alignment */
  justify-content: center; /* Horizontally center the .sb-hero-content-wrapper */
  text-align: center; /* Center text within the content wrapper by default */
  padding: 3rem 1rem; /* Default padding (e.g., var(--sb-spacing-12) var(--sb-spacing-4)) */
}

.sb-hero-layout--text-only-centered .sb-hero-content-wrapper {
  max-width: var(--sb-breakpoint-md, 768px); /* Constrain text width */
  width: 100%;
}


/* --- II. Content Wrappers & Columns (General styles if not layout-specific) --- */
.sb-hero-content-wrapper {
  width: 100%;
  box-sizing: border-box;
  /* Basic styles if needed, specific layouts will override or add to this */
}

.sb-hero-text-column {
  /* Styles for the text column, e.g., ensuring proper flow of Hx, P, buttons */
}

.sb-hero-text-column > :first-child {
  margin-top: 0; /* Remove top margin from the first element (e.g. h1) */
}
.sb-hero-text-column > :last-child {
  margin-bottom: 0; /* Remove bottom margin from the last element (e.g. last button) */
}

.sb-hero-media-column {
  /* Styles for the media column */
}

/* --- III. Media Elements --- */
.sb-hero-image {
  display: block; /* Remove extra space below image */
  max-width: 100%;
  height: auto;
  border-radius: var(--sb-border-radius-md, 0.375rem); /* Optional default rounding for images */
}

/* --- IV. Height Utilities (Example) --- */
/* You might have these as global utilities already */
.sb-min-h-screen {
  min-height: 100vh; /* Consider 100dvh for better mobile behavior if supported */
}
/* Other specific height utilities like .sb-min-h-50vh, .sb-min-h-400px
   are better handled by inline styles as the number of variations can be large.
   If `min_height` parameter directly sets `style="min-height: {{ min_height }};"`,
   then only special values like "screen" might need a class. */

/* --- CTA Area (Optional, for styling button groups) --- */
.sb-hero-cta-area {
  margin-top: 1.5rem; /* e.g., var(--sb-spacing-6) */
  display: flex;
  flex-wrap: wrap; /* Allow buttons to wrap on small screens */
  gap: 0.75rem; /* e.g., var(--sb-spacing-3) */
  /* Default alignment for buttons (start, center, end) could be set here or by utilities */
}


/* Layout: Text Right, Image Left */
.sb-hero-layout--text-right-image-left .sb-hero-content-wrapper {
  display: grid;
  grid-template-columns: 1fr; /* Mobile: single column */
  gap: 2rem;
  align-items: center;
  width: 100%;
  max-width: var(--sb-breakpoint-lg, 1024px);
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 768px) { /* md breakpoint */
  .sb-hero-layout--text-right-image-left .sb-hero-content-wrapper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sb-hero-layout--text-right-image-left .sb-hero-media-column {
    order: 1; /* Image first */
  }
  .sb-hero-layout--text-right-image-left .sb-hero-text-column {
    order: 2; /* Text second */
  }
}

/* Layout: Image Top, Text Bottom */
.sb-hero-layout--image-top-text-bottom .sb-hero-content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center; /* Or stretch, depending on desired text width */
  width: 100%;
}
.sb-hero-layout--image-top-text-bottom .sb-hero-media-fullwidth {
  width: 100%;
  margin-bottom: 1.5rem; /* e.g., var(--sb-spacing-6) */
}
.sb-hero-layout--image-top-text-bottom .sb-hero-media-fullwidth .sb-hero-image {
  width: 100%;
  height: auto; /* Or a fixed aspect ratio / max-height */
  object-fit: cover; /* If you set a specific height */
}
.sb-hero-layout--image-top-text-bottom .sb-hero-text-bottom-content {
  width: 100%;
  max-width: var(--sb-breakpoint-md, 768px); /* Constrain text width for readability */
  text-align: center; /* Default, can be overridden by utilities */
}
.sb-hero-text-bottom-content[class*="sb-bg-"] { /* If text_bg_color is applied */
    padding: 1rem 1.5rem;
    border-radius: var(--sb-border-radius-md);
}
.sb-hero-full-bleed-image { /* Used in image_only_full layout if using an <img> tag */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures the image covers the entire area, cropping if necessary */
  object-position: center center; /* Centers the image within its bounds */
  z-index: 1; /* Typically behind any overlaid content */
  /* No border-radius here usually, as it's meant to be edge-to-edge */
}

/* Layout: Image Only Full */
.sb-hero-layout--image-only-full {
  padding: 0; /* No padding on the main hero for full bleed */
  display: grid; /* Allows easy centering of overlaid content */
  place-items: center; /* Default to center overlay; can be overridden by content_align_vertical */
  /* The background image can be set on .sb-hero itself using bg_color/image_src
     OR by including an <img class="sb-hero-full-bleed-image"> inside.
     If using the <img> tag method, .sb-hero itself might just need position:relative.
  */
}

.sb-hero-layout--image-only-full .sb-hero-content-overlay {
  position: relative; /* If .sb-hero is display:grid and this is the grid item */
                      /* Or position:absolute if .sb-hero is just position:relative */
  z-index: 2; /* Above the sb-hero-full-bleed-image */
  padding: var(--sb-spacing-8, 2rem); /* Example padding */
  text-align: center; /* Default text alignment for overlay */
  width: 100%;
  max-width: var(--sb-breakpoint-md, 768px); /* Constrain overlay content width */
  box-sizing: border-box;
}

/* If text_bg_color is applied to the overlay content itself */
.sb-hero-layout--image-only-full .sb-hero-content-overlay[class*="sb-bg-"] {
    border-radius: var(--sb-border-radius-md, 0.375rem); /* Optional rounded background for the text block */
    padding: 1.5rem; /* Adjust padding if it has its own background */
    /* display: inline-block; /* If you want the background to wrap tightly around the text content */
    /* max-width: fit-content; /* If display: inline-block and you want it to shrink to text */
}

.sb-hero-content-overlay[class*="sb-bg-"] { /* If text_bg_color is applied */
    border-radius: var(--sb-border-radius-md);
    /* display: inline-block; /* If you want the background to wrap tightly */
}

.sb-hero-video {
  display: block;
  width: 100%; /* Or max-width: 100% depending on desired scaling */
  height: auto;
  border-radius: var(--sb-border-radius-md, 0.375rem);
  object-fit: cover; /* If you want it to fill a specific aspect ratio box */
}
.sb-hero-layout--text-center-image-background .sb-hero-background-media-wrapper {
  position: absolute; /* Fills the parent .sb-hero which should be position:relative */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden; /* Clips the video/image */
  z-index: 0;
}
.sb-hero-layout--text-center-image-background .sb-hero-background-image-actual {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover; /* Ensures the image covers the area, cropping if necessary */
  object-position: center center; /* Default, but good to be explicit */
  /* z-index is not strictly needed here as its parent .sb-hero-background-media-wrapper handles the base stacking. */
}
.sb-hero-full-bleed-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 1;
}
/* The .sb-hero-layout--image-only-full would need position: relative */
.sb-hero-video-embed-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* Common aspect ratios: */
  /* padding-top: 56.25%; 16:9 */
  /* padding-top: 75%;    4:3 */
}
.sb-hero-video-embed-wrapper.sb-aspect-video { /* Default to 16:9 if this class is used */
    padding-top: 56.25%;
}

.sb-hero-video-embed-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Align Block */
.sb-align-outer-wrapper {
  display: flex;
  overflow: scroll;
}

.sb-align-inner-block {
  width: 100%;
  height: 100%;
}

.sb-align-content {
  width: 100%;
}

/* Button Block */
/* Base sb-btn styles - Using your CSS variables where applicable */
    .sb-btn {
        display: inline-block;
        font-weight: 600;
        line-height: 1.5;
        text-align: center;
        text-decoration: none;
        vertical-align: middle;
        cursor: pointer;
        user-select: none;
        background-color: transparent;
        border: 2px solid transparent; /* Base border, color variants will override color */
        padding: 0.5rem 1rem;
        font-size: 1rem;
        border-radius: var(--sb-border-radius-md, 0.375rem);
        transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, transform 0.15s ease-in-out;
    }

    .sb-btn-default {
        color: var(--sb-btn-default-color, var(--sb-primary-color));
        background-color: var(--sb-btn-default-bg, var(--sb-primary-bg));
        border-color: var(--sb-btn-default-border, var(--sb-primary-border));
    }
    
    /* Hover and Focus-Visible for scaling effect */
    .sb-btn:hover,
    .sb-btn:focus-visible {
        /* Combined for consistent visual feedback */
        transform: scale(1.05); /* Scale effect on hover/focus */
    }
    /* Specific focus-visible style for outline/box-shadow if needed beyond hover */
    .sb-btn:focus-visible {
        outline: 0;
        box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.4); /* Example focus ring */
    }
    /* If hover also changes other properties like background, ensure they are defined in variant :hover states below */
    /* Disabled state */
    .sb-btn:disabled,
    .sb-btn.sb-disabled {
        pointer-events: none;
        opacity: 0.65;
        transform: none; /* Ensure disabled buttons don't scale */
    }
    /* --- Click Animation (from your old code) --- */
    @keyframes click-animation {
        0% {
            /* Start with a more prominent border using accent color */
            box-shadow: 0 0 0 3px var(--accent-color, #f59e0b), inset 0 0 0 1px var(--accent-color, #f59e0b);
            transform: scale(1.03); /* Slight initial pop for the animation */
        }
        50% {
            /* Briefly 'press in' - could reduce scale or change shadow */
            box-shadow: 0 0 0 1px var(--accent-color, #f59e0b), inset 0 1px 2px rgba(0, 0, 0, 0.2);
            transform: scale(0.98);
        }
        100% {
            /* Return to a slightly popped state before settling */
            box-shadow: 0 0 0 3px var(--accent-color, #f59e0b), inset 0 0 0 1px var(--accent-color, #f59e0b);
            transform: scale(1.03);
        }
    }
    .sb-btn.click-animation {
        /* Apply the animation when this class is added */
        animation: click-animation 0.4s ease-in-out;
    }
    /* --- Color Variants (ensure hover styles here also work with the scale transform) --- */
    /* Primary Button */
    .sb-btn-primary {
        color: #fff;
        background-color: var(--primary-color, #3b82f6);
        border-color: var(--primary-color, #3b82f6);
    }
    .sb-btn-primary:hover {
        color: #fff;
        background-color: #2573df; /* Darker shade */
        border-color: #1c6cd9;
        transform: scale(1.05); /* Explicitly keep or enhance hover transform if needed */
    }
    .sb-btn-primary:focus-visible {
        /* transform: scale(1.05); Combined above */
        box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.5);
    }
    /* Add :active state for immediate feedback on click, separate from keyframe animation */
    .sb-btn-primary:active {
        background-color: #1c6cd9; /* Even darker or same as hover */
        transform: scale(0.98); /* "Pressed" effect */
    }
    /* Secondary Button */
    .sb-btn-secondary {
        color: #fff;
        background-color: var(--secondary-color, #6b7280);
        border-color: var(--secondary-color, #6b7280);
    }
    .sb-btn-secondary:hover {
        color: #fff;
        background-color: #5a6268;
        border-color: #545b62;
        transform: scale(1.05);
    }
    .sb-btn-secondary:focus-visible {
        /* transform: scale(1.05); */
        box-shadow: 0 0 0 0.25rem rgba(107, 114, 128, 0.5);
    }
    .sb-btn-secondary:active {
        background-color: #545b62;
        transform: scale(0.98);
    }
    /* Accent Button */
    .sb-btn-accent {
        color: #000;
        background-color: var(--accent-color, #f59e0b);
        border-color: var(--accent-color, #f59e0b);
    }
    .sb-btn-accent:hover {
        color: #000;
        background-color: #e08e0a;
        border-color: #d48609;
        transform: scale(1.05);
    }
    .sb-btn-accent:focus-visible {
        /* transform: scale(1.05); */
        box-shadow: 0 0 0 0.25rem rgba(245, 158, 11, 0.5);
    }
    .sb-btn-accent:active {
        background-color: #d48609;
        transform: scale(0.98);
    }
    /* Error Button */
    .sb-btn-error {
        color: #fff;
        background-color: var(--error-color, #dc2626);
        border-color: var(--error-color, #dc2626);
    }
    .sb-btn-error:hover {
        color: #fff;
        background-color: #c02222;
        border-color: #b62020;
        transform: scale(1.05);
    }
    .sb-btn-error:focus-visible {
        /* transform: scale(1.05); */
        box-shadow: 0 0 0 0.25rem rgba(220, 38, 38, 0.5);
    }
    .sb-btn-error:active {
        background-color: #b62020;
        transform: scale(0.98);
    }
    /* Warning Button */
    .sb-btn-warning {
        color: #000;
        background-color: var(--warning-color, #f59e0b);
        border-color: var(--warning-color, #f59e0b);
    }
    .sb-btn-warning:hover {
        color: #000;
        background-color: #e08e0a;
        border-color: #d48609;
        transform: scale(1.05);
    }
    .sb-btn-warning:focus-visible {
        /* transform: scale(1.05); */
        box-shadow: 0 0 0 0.25rem rgba(245, 158, 11, 0.5);
    }
    .sb-btn-warning:active {
        background-color: #d48609;
        transform: scale(0.98);
    }
    /* Success Button */
    .sb-btn-success {
        color: #fff;
        background-color: var(--success-color, #16a34a);
        border-color: var(--success-color, #16a34a);
    }
    .sb-btn-success:hover {
        color: #fff;
        background-color: #138d40;
        border-color: #11803b;
        transform: scale(1.05);
    }
    .sb-btn-success:focus-visible {
        /* transform: scale(1.05); */
        box-shadow: 0 0 0 0.25rem rgba(22, 163, 74, 0.5);
    }
    .sb-btn-success:active {
        background-color: #11803b;
        transform: scale(0.98);
    }
    /* Info Button */
    .sb-btn-info {
        color: #fff;
        background-color: var(--info-color, #2563eb);
        border-color: var(--info-color, #2563eb);
    }
    .sb-btn-info:hover {
        color: #fff;
        background-color: #1e54d3;
        border-color: #1c4fc3;
        transform: scale(1.05);
    }
    .sb-btn-info:focus-visible {
        /* transform: scale(1.05); */
        box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.5);
    }
    .sb-btn-info:active {
        background-color: #1c4fc3;
        transform: scale(0.98);
    }
    /* Black Button */
    .sb-btn-black {
        color: #fff;
        background-color: #1f2937;
        border-color: #1f2937;
    }
    .sb-btn-black:hover {
        color: #fff;
        background-color: #111827;
        border-color: #0d1117;
        transform: scale(1.05);
    }
    .sb-btn-black:focus-visible {
        /* transform: scale(1.05); */
        box-shadow: 0 0 0 0.25rem rgba(31, 41, 55, 0.5);
    }
    .sb-btn-black:active {
        background-color: #0d1117;
        transform: scale(0.98);
    }
    /* White Button */
    .sb-btn-white {
        color: #1f2937;
        background-color: #ffffff;
        border-color: #d1d5db;
    }
    .sb-btn-white:hover {
        color: #111827;
        background-color: #f9fafb;
        border-color: #adb5bd;
        transform: scale(1.05);
    }
    .sb-btn-white:focus-visible {
        /* transform: scale(1.05); */
        box-shadow: 0 0 0 0.25rem rgba(209, 213, 219, 0.5);
    }
    .sb-btn-white:active {
        background-color: #e9eafb; /* Your previous hover color for white button */
        border-color: #9ca3af;
        transform: scale(0.98);
    }
    /* Emphasis Button */
    .sb-btn-emphasis {
        color: #fff;
        background-color: var(--emphasis-color, #8b5cf6);
        border-color: var(--emphasis-color, #8b5cf6);
    }
    .sb-btn-emphasis:hover {
        color: #fff;
        background-color: #7a4fe2;
        border-color: #6a3ec9;
        transform: scale(1.05);
    }
    .sb-btn-emphasis:focus-visible {
        /* transform: scale(1.05); Combined above */
        box-shadow: 0 0 0 0.25rem rgba(139, 92, 246, 0.5);
    }
    .sb-btn-emphasis:active {
        background-color: #6a3ec9;
        transform: scale(0.98);
    }
    /* Subtle Button */
    .sb-btn-subtle {
        color: #000;
        background-color: var(--subtle-color, #f3f4f6);
        border-color: var(--subtle-color, #f3f4f6);
    }
    .sb-btn-subtle:hover {
        color: #000;
        background-color: #e5e7eb;
        border-color: #d1d5db;
        transform: scale(1.05);
    }
    .sb-btn-subtle:focus-visible {
        /* transform: scale(1.05); Combined above */
        box-shadow: 0 0 0 0.25rem rgba(209, 213, 219, 0.5);
    }
    .sb-btn-subtle:active {
        background-color: #d1d5db;
        transform: scale(0.98);
    }
    /* Distinct Button */
    .sb-btn-distinct {
        color: #fff;
        background-color: var(--distinct-color, #06b6d4);
        border-color: var(--distinct-color, #06b6d4);
    }
    .sb-btn-distinct:hover {
        color: #fff;
        background-color: #05a1b8;
        border-color: #048c9e;
        transform: scale(1.05);
    }
    .sb-btn-distinct:focus-visible {
        /* transform: scale(1.05); Combined above */
        box-shadow: 0 0 0 0.25rem rgba(6, 182, 212, 0.5);
    }
    .sb-btn-distinct:active {
        background-color: #048c9e;
        transform: scale(0.98);
    }
    /* Aether Button */
    .sb-btn-aether {
        color: #000;
        background-color: var(--aether-color, #c026d3);
        border-color: var(--aether-color, #c026d3);
    }
    .sb-btn-aether:hover {
        color: #000;
        background-color: #b725c9;
        border-color: #a625c0;
        transform: scale(1.05);
    }
    .sb-btn-aether:focus-visible {
        /* transform: scale(1.05); Combined above */
        box-shadow: 0 0 0 0.25rem rgba(194, 38, 211, 0.5);
    }
    .sb-btn-aether:active {
        background-color: #a625c0;
        transform: scale(0.98);
    }
    /* Artifact Button */
    .sb-btn-artifact {
        color: #fff;
        background-color: var(--artifact-color, #a16207);
        border-color: var(--artifact-color, #a16207);
    }
    .sb-btn-artifact:hover {
        color: #fff;
        background-color: #8f4f0d;
        border-color: #7f4a0b;
        transform: scale(1.05);
    }
    .sb-btn-artifact:focus-visible {
        /* transform: scale(1.05); Combined above */
        box-shadow: 0 0 0 0.25rem rgba(161, 98, 7, 0.5);
    }
    .sb-btn-artifact:active {
        background-color: #7f4a0b;
        transform: scale(0.98);
    }
    /* Sylvan Button */
    .sb-btn-sylvan {
        color: #000;
        background-color: var(--sylvan-color, #3f6212);
        border-color: var(--sylvan-color, #3f6212);
    }
    .sb-btn-sylvan:hover {
        color: #000;
        background-color: #2d4706;
        border-color: #233e06;
        transform: scale(1.05);
    }
    .sb-btn-sylvan:focus-visible {
        /* transform: scale(1.05); Combined above */
        box-shadow: 0 0 0 0.25rem rgba(63, 98, 18, 0.5);
    }
    .sb-btn-sylvan:active {
        background-color: #233e06;
        transform: scale(0.98);
    }
    /* Danger Button */
    .sb-btn-danger {
        color: #fff;
        background-color: var(--danger-color, #a80000);
        border-color: var(--danger-color, #a80000);
    }
    .sb-btn-danger:hover {
        color: #fff;
        background-color: #9c0000;
        border-color: #8a0000;
        transform: scale(1.05);
    }
    .sb-btn-danger:focus-visible {
        /* transform: scale(1.05); Combined above */
        box-shadow: 0 0 0 0.25rem rgba(154, 0, 0, 0.5);
    }
    .sb-btn-danger:active {
        background-color: #8a0000;
        transform: scale(0.98);
    }
    
    /* Outline Button */
    .sb-btn-outline {
        color: var(--primary-color, #3b82f6);
        background-color: transparent;
        border: 2px solid var(--primary-color, #3b82f6);
    }
    .sb-btn-outline:hover {
        color: white;
        background-color: var(--primary-color, #3b82f6);
        border-color: var(--primary-color, #3b82f6);
        transform: scale(1.05);
    }
    .sb-btn-outline:focus-visible {
        box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.5);
    }
    .sb-btn-outline:active {
        transform: scale(0.98);
    }
    
    /* Ghost Button */
    .sb-btn-ghost {
        color: var(--text-color, #1f2937);
        background-color: transparent;
        border-color: transparent;
    }
    .sb-btn-ghost:hover {
        color: var(--primary-color, #3b82f6);
        background-color: color-mix(in srgb, var(--primary-color) 10%, transparent);
        border-color: transparent;
        transform: scale(1.05);
    }
    .sb-btn-ghost:focus-visible {
        box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
    }
    .sb-btn-ghost:active {
        transform: scale(0.98);
    }

    .sb-btn-sm {
    padding: 0.25rem 0.75rem; /* Example: Smaller padding */
    font-size: 0.875rem;     /* Example: Smaller font size */
    /* Adjust border-radius if you want it proportional, e.g., var(--sb-border-radius-sm) */
}

.sb-btn-lg {
    padding: 0.75rem 1.5rem; /* Example: Larger padding */
    font-size: 1.125rem;    /* Example: Larger font size */
    /* Adjust border-radius if you want it proportional, e.g., var(--sb-border-radius-lg) */
}

/* --- Icon Styling within Buttons --- */
.sb-btn .sb-icon { /* Assuming icons are always in buttons for this context */
    display: inline-block;
    vertical-align: middle; 
    width: 1em;             /* Default width, scales with font-size of parent */
    height: 1em;            /* Default height */
    line-height: 1;

    /* --- For SVG mask technique --- */
    background-color: currentColor; /* This makes the icon take the color of the surrounding text.
                                       You can change this to any specific color too. */
}

.sb-btn .sb-icon-left {
    margin-right: 0.5em; /* Space between icon and text */
}

.sb-btn .sb-icon-right {
    margin-left: 0.5em; /* Space between icon and text */
}

/* --- Specific Icon Definitions using SVG Masks --- */

.sb-icon-download {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-download.svg'); /* Path relative to this CSS file */
    mask-size: contain;                      /* Ensures the entire SVG fits */
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-spotlight {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-spotlight.svg'); /* Path relative to this CSS file */
    mask-size: contain;                      /* Ensures the entire SVG fits */
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-edit {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-edit.svg'); /* Path relative to this CSS file */
    mask-size: contain;                      /* Ensures the entire SVG fits */
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-arrow-right {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-arrow-right.svg'); /* Path relative to this CSS file */
    mask-size: contain;                      /* Ensures the entire SVG fits */
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-arrow-left {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-arrow-left.svg'); /* Path relative to this CSS file */
    mask-size: contain;                      /* Ensures the entire SVG fits */
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-settings {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-settings.svg'); /* Path relative to this CSS file */
    mask-size: contain;                      /* Ensures the entire SVG fits */
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-user {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-user.svg'); /* Path relative to this CSS file */
    mask-size: contain;                      /* Ensures the entire SVG fits */
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-plus {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-plus.svg'); /* Path relative to this CSS file */
    mask-size: contain;                      /* Ensures the entire SVG fits */
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-minus {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-minus.svg'); /* Path relative to this CSS file */
    mask-size: contain;                      /* Ensures the entire SVG fits */
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-arcanum {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-arcanum.svg'); /* Or your chosen path style */
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-elven-city {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-elven-city.svg'); /* Or your chosen path style */
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-glimmering-forest {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-glimmering-forest.svg'); /* Or your chosen path style */
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-ancient-tome {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-ancient-tome.svg');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-ellipsis-horizontal {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-ellipsis-horizontal.svg');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-gemcut {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-gemcut.svg');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-swirl-energy {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-swirl-energy.svg');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.sb-icon-sylvan-leaf {
    mask-image: url('/static/django_spellbook/svgs/sb-icon-sylvan-leaf.svg');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

/* Optional: Ensure text and icons align nicely */
.sb-btn-text {
    display: inline-block;
    vertical-align: middle;
}
