/* Hub Custom Header Styles - Custom Puck Hero Section */

/* Custom hero inherits default hero styles but allows customization */
.hub-hero-banner.custom-puck-hero {
  /* Remove default background to let Puck content control it */
  background: none;
}

/* 
 * Override .full class restrictions for custom headers.
 * !important is required because Hub.css .full class (line ~47) uses !important
 * for padding: 0 24px !important and margin: 0 auto !important.
 * These can only be overridden with !important.
 */
.hub-hero-banner.custom-puck-hero.full {
  height: auto !important;
  min-height: 0;
  padding: 0 !important;
  background-size: cover;
  background-position: center;
  position: relative;
  background-color: transparent;
}

.hub-hero-banner.custom-puck-hero .overlay {
  /* Remove dark overlay for custom content */
  background-color: transparent;

  /* Use relative positioning for better mobile behavior */
  position: relative;
}

/* Header controls wrapper - uses flexbox for responsive layout */
.hub-hero-banner.custom-puck-hero .header-controls-wrapper {
  position: relative;
  z-index: 100;
  width: 100%;
}

/* Ensure header controls have proper responsive padding */
.hub-hero-banner.custom-puck-hero .header.container {
  padding: 12px 15px;
  background: transparent;
  max-width: 100%;
}

/* Container for Puck-rendered content */
.hub-custom-header-container {
  position: relative;
  width: 100%;

  /* Minimum height to ensure content is visible, but can grow */
  min-height: 200px;

  /* Remove any margin-bottom from the container itself */
  margin-bottom: 0;
}

.hub-custom-header-container .custom-header-content {
  position: relative;
  width: 100%;

  /* Remove margin-bottom from content wrapper */
  margin-bottom: 0;
}

/* Remove margin-bottom from Hero component's main container div */
.hub-custom-header-container > div:first-child,
.hub-custom-header-container .custom-header-content > div:first-child,
.hub-custom-header-container > div,
.hub-custom-header-container .custom-header-content > div {
  margin-bottom: 0;
}

/* Specifically target any divs with padding styles (Hero component) */
.hub-custom-header-container div[style*="padding"] {
  margin-bottom: 0;
}

/* Ensure Puck-rendered content doesn't conflict with existing styles */
.hub-custom-header-container .custom-header-content * {
  box-sizing: border-box;
}

/* Override default hero text styles for custom content */
.custom-puck-hero .hub-custom-header-container {
  color: inherit; /* Let Puck content control text color */
}

/* Prevent style conflicts with main page */
.hub-custom-header-container .text-block-content {
  line-height: 1.6;
}

.hub-custom-header-container .text-block-content p {
  margin-bottom: 1rem;
}

.hub-custom-header-container .text-block-content h1,
.hub-custom-header-container .text-block-content h2,
.hub-custom-header-container .text-block-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

/* Hero component specific styles */
.hub-custom-header-container .hero-section {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}

/* Stats bar in custom header */
.hub-custom-header-container .stats-bar {
  background-color: #f8f9fa;
  padding: 1.5rem 0;
}

/* Responsive container behavior */
.hub-custom-header-container > div {
  width: 100%;
}

/* Default container behavior - responsive with padding */
.hub-custom-header-container .container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

/* Breakpoint-specific container max-widths */
@media (min-width: 576px) {
  .hub-custom-header-container .container {
    max-width: 540px;
  }
}

@media (min-width: 768px) {
  .hub-custom-header-container .container {
    max-width: 720px;
  }
}

@media (min-width: 992px) {
  .hub-custom-header-container .container {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {
  .hub-custom-header-container .container {
    max-width: 1140px;
  }
}

/* Full-width container option */
.hub-custom-header-container .container-fluid {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  /* Reduce minimum height on mobile */
  .hub-custom-header-container {
    min-height: 200px;
  }

  /* Adjust hero section for mobile */
  .hub-custom-header-container .hero-section {
    min-height: 300px;
    padding: 2rem 1rem;
  }

  /* Ensure proper text sizing on mobile */
  .hub-custom-header-container h1 {
    font-size: 2rem;
  }

  .hub-custom-header-container h2 {
    font-size: 1.5rem;
  }

  .hub-custom-header-container p {
    font-size: 1rem;
  }

  /* Stack elements vertically on mobile */
  .hub-custom-header-container .row {
    margin-right: -15px;
    margin-left: -15px;
  }

  /* Ensure header controls are accessible on mobile */
  .hub-hero-banner.custom-puck-hero .header.container {
    padding: 8px 15px;
  }

  /* Adjust dropdown menu positioning on mobile */
  .hub-hero-banner.custom-puck-hero .dropdown-menu {
    position: absolute;
    right: 0;
    left: auto;
    min-width: 200px;
  }
}

/* Extra small devices */
@media (max-width: 576px) {
  /* Further reduce padding on very small screens */
  .hub-custom-header-container {
    min-height: 150px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .hub-custom-header-container .hero-section {
    padding: 1.5rem 1rem;
  }
}

/* Header Preview Wrapper and Overlay Styles */
.header-preview-wrapper {
  position: relative;
}

.header-preview-container {
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.header-preview-container:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 100;
  border-radius: 0.375rem;
  pointer-events: none;
}

.header-preview-container:hover .header-preview-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.header-preview-overlay .edit-header-btn {
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 0.75rem 1.5rem;
}

.header-preview-overlay .edit-header-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.header-preview-overlay .edit-header-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.header-actions {
  margin-top: 1rem;
}

/* 
 * ProfileBlock styling - remove default border and padding for manual card placement.
 * !important is required because Hub.css #profileInfoBlock (line ~1968) defines
 * padding: 2.2em 30px and border: 2px #1e465f solid on an ID selector.
 * ID selectors have high specificity, and these styles need to be completely reset
 * when ProfileBlock is used inside Puck components.
 */
.hub-custom-header-container #profileInfoBlock,
.hub-custom-header-container .custom-header-content #profileInfoBlock,
.content-tab-container #profileInfoBlock {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  border-radius: 0 !important;
}
