/**
 * @file
 * Custom styles for Surgery New Jersey Olivero subtheme.
 */

/* Override Olivero theme's region.css margin rules - eliminate margin-block-end globally */
.region > *:where(:not([data-big-pipe-placeholder-id])) {
  margin-block-end: 0 !important;
  margin-bottom: 0 !important;
}

/* Override for all media queries as well */
@media (min-width: 43.75rem) {
  .region > *:where(:not([data-big-pipe-placeholder-id])) {
    margin-block-end: 0 !important;
    margin-bottom: 0 !important;
  }
}

@media (min-width: 62.5rem) {
  .region > *:where(:not([data-big-pipe-placeholder-id])) {
    margin-block-end: 0 !important;
    margin-bottom: 0 !important;
  }
}

/* Medical theme color scheme */
:root {
  --color-primary: #2c5aa0; /* Medical blue */
  --color-secondary: #4a90e2; /* Light blue */
  --color-accent: #e8f4fd; /* Light accent blue */
  --color-success: #28a745; /* Medical green */
  --color-warning: #ffc107; /* Medical amber */
  --color-danger: #dc3545; /* Medical red */
}

/* Hide all Olivero header elements */
.site-header,
.site-header__fixable,
.site-header__initial,
.site-header__inner,
.site-header__inner__container,
.sticky-header-toggle,
.mobile-buttons,
.mobile-nav-button,
.header-nav {
  display: none !important;
}

/* New simple sticky header */
.custom-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 500 !important;
  background-color: var(--color-primary) !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  padding: 1rem 2rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

/* Make gin-secondary-toolbar sticky right after the custom header */
.gin-secondary-toolbar {
  position: sticky !important;
  top: calc(var(--gin-toolbar-height, 39px) + 80px + 20px) !important; /* Toolbar + header height + 20px lower */
  z-index: 499 !important; /* Below header */
  background: var(--gin-bg-layer, #fff) !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Dark mode support for secondary toolbar */
.gin--dark-mode .gin-secondary-toolbar {
  background: var(--gin-bg-layer, #1b1b1d) !important;
}

/* Position custom header directly below main admin toolbar */
body.toolbar-fixed .custom-header,
body.toolbar-oriented .custom-header,
body:has(#gin-toolbar-bar) .custom-header,
body:has(.toolbar) .custom-header,
body[data-toolbar-menu] .custom-header {
  /* Position directly below main toolbar only */
  top: var(--gin-toolbar-height, 39px) !important;
  z-index: 500 !important; /* Below toolbar but above secondary toolbar */
}

/* For Gin horizontal toolbar - use top bar height if present */
body:has(.gin--navigation-top-bar) .custom-header {
  top: var(--admin-toolbar-top-bar-height, 54px) !important;
}

/* Fallback for when CSS variables aren't available */
body.toolbar-fixed .custom-header {
  top: 39px !important;
}

/* Logo and branding on the left */
.header-branding {
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
}

.header-logo img {
  max-height: 40px !important;
  width: auto !important;
}

.header-logo svg {
  max-height: 40px !important;
  width: auto !important;
}

.header-title {
  color: white !important;
  font-size: 1.5rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  margin: 0 !important;
}

.header-title:hover {
  color: white !important;
  text-decoration: none !important;
}

/* Main menu on the right */
.header-menu {
  display: flex !important;
  align-items: center !important;
  gap: 2rem !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.header-menu ul {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.75rem !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.header-menu li {
  margin: 0 !important;
}

.header-menu a {
  color: white !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  padding: 0.5rem 1rem !important;
  border-radius: 4px !important;
  transition: background-color 0.2s ease !important;
}

.header-menu a:hover,
.header-menu a:focus {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
}

/* Body padding for fixed header */
body {
  padding-top: 80px !important;
}

/* Adjust body padding when toolbar is present (toolbar + header height) */
/* Header is approximately 80px tall */
/* Note: Header is sticky right after toolbar, secondary toolbar is sticky after header */
body.toolbar-fixed,
body.toolbar-oriented,
body:has(#gin-toolbar-bar),
body:has(.toolbar) {
  /* Main toolbar + sticky header */
  padding-top: calc(var(--gin-toolbar-height, 39px) + 80px) !important;
}

/* For Gin with top bar */
body:has(.gin--navigation-top-bar) {
  padding-top: calc(var(--admin-toolbar-top-bar-height, 54px) + 80px) !important;
}

/* Button styling with medical theme */
.button--primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  border-radius: 4px;
  font-weight: 500;
}

.button--primary:hover,
.button--primary:focus {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
}

/* Medical card styling */
.card {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid var(--color-accent);
}

/* Form improvements */
.form-element {
  border-radius: 4px;
  border: 1px solid #ddd;
}

.form-element:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.2);
}

/* Content area improvements */
.content {
  line-height: 1.6;
}

/* Hide search blocks */
.block-search,
.block--search-form-block,
.search-form,
.search-block-form {
  display: none !important;
}

/* Login icon styling */
.login-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  color: white !important;
  text-decoration: none !important;
  border-radius: 4px !important;
  transition: background-color 0.2s ease !important;
}

.login-link:hover,
.login-link:focus {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
}

.login-icon {
  width: 20px !important;
  height: 20px !important;
  fill: currentColor !important;
}

/* Specific targeting for main menu block */
/* Only show in header-menu area, hide duplicates elsewhere when logged in */
#block-surgerynewjersey-olivero-main-menu {
  display: flex !important;
  align-items: center !important;
}

/* Hide duplicate block when toolbar is present (logged in users) - hide all instances outside header-menu */
body.toolbar-fixed #block-surgerynewjersey-olivero-main-menu:not(.custom-header .header-menu #block-surgerynewjersey-olivero-main-menu),
body.toolbar-oriented #block-surgerynewjersey-olivero-main-menu:not(.custom-header .header-menu #block-surgerynewjersey-olivero-main-menu),
body:has(.toolbar) #block-surgerynewjersey-olivero-main-menu:not(.custom-header .header-menu #block-surgerynewjersey-olivero-main-menu),
body:has(#gin-toolbar-bar) #block-surgerynewjersey-olivero-main-menu:not(.custom-header .header-menu #block-surgerynewjersey-olivero-main-menu) {
  display: none !important;
}

/* Hide block in content areas (more specific) */
.layout-container > #block-surgerynewjersey-olivero-main-menu,
.main-content #block-surgerynewjersey-olivero-main-menu,
.main-content__container #block-surgerynewjersey-olivero-main-menu,
.content #block-surgerynewjersey-olivero-main-menu,
body.toolbar-fixed .layout-container > #block-surgerynewjersey-olivero-main-menu,
body.toolbar-fixed .main-content #block-surgerynewjersey-olivero-main-menu {
  display: none !important;
}

/* Keep the one in header-menu visible */
.header-menu #block-surgerynewjersey-olivero-main-menu {
  display: flex !important;
  align-items: center !important;
}

/* Remove contextual links from main menu block */
#block-surgerynewjersey-olivero-main-menu .contextual,
#block-surgerynewjersey-olivero-main-menu .contextual-links,
#block-surgerynewjersey-olivero-main-menu .contextual-region,
#block-surgerynewjersey-olivero-main-menu [data-contextual-id],
#block-surgerynewjersey-olivero-main-menu + .contextual,
#block-surgerynewjersey-olivero-mainnavigation .contextual,
#block-surgerynewjersey-olivero-mainnavigation .contextual-links,
#block-surgerynewjersey-olivero-mainnavigation .contextual-region,
#block-surgerynewjersey-olivero-mainnavigation [data-contextual-id],
#block-surgerynewjersey-olivero-mainnavigation + .contextual {
  display: none !important;
  visibility: hidden !important;
}

/* Also hide trigger buttons */
#block-surgerynewjersey-olivero-main-menu .trigger,
#block-surgerynewjersey-olivero-main-menu .contextual-trigger,
#block-surgerynewjersey-olivero-mainnavigation .trigger,
#block-surgerynewjersey-olivero-mainnavigation .contextual-trigger {
  display: none !important;
}

#block-surgerynewjersey-olivero-main-menu ul {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.75rem !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

#block-surgerynewjersey-olivero-main-menu li {
  margin: 0 !important;
}

#block-surgerynewjersey-olivero-main-menu a {
  color: white !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  padding: 0.5rem 1rem !important;
  border-radius: 4px !important;
  transition: background-color 0.2s ease !important;
}

#block-surgerynewjersey-olivero-main-menu a:hover,
#block-surgerynewjersey-olivero-main-menu a:focus {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
}


/* Hamburger menu button - hidden on desktop */
.hamburger-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background-color: white;
  transition: all 0.3s ease;
  transform-origin: 1px;
}

/* Hamburger animation when active */
.hamburger-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: rotate(45deg);
}

.hamburger-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: rotate(-45deg);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  /* Show hamburger button on mobile */
  .hamburger-menu-toggle {
    display: flex !important;
  }
  
  /* Hide desktop menu on mobile */
  .header-menu {
    position: fixed !important;
    top: 80px !important;
    left: 0 !important;
    right: 0 !important;
    background-color: var(--color-primary) !important;
    flex-direction: column !important;
    padding: 1rem 0 !important;
    transform: translateY(-100%) !important;
    transition: transform 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    z-index: 999 !important;
  }
  
  /* Show menu when hamburger is active */
  .header-menu.menu-open {
    transform: translateY(0) !important;
  }
  
  /* Style menu items for mobile */
  .header-menu li {
    width: 100% !important;
    text-align: center !important;
    margin: 0.5rem 0 !important;
  }
  
  .header-menu a {
    display: block !important;
    padding: 1rem !important;
    width: 100% !important;
    text-align: center !important;
  }
  
  /* Adjust header padding on mobile */
  .custom-header {
    padding: 1rem !important;
  }
  
  /* Adjust body padding for mobile */
  body {
    padding-top: 80px !important;
  }
}

/* Desktop styles - ensure horizontal menu */
@media (min-width: 769px) {
  .header-menu {
    display: flex !important;
    flex-direction: row !important;
    position: static !important;
    transform: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  
  .header-menu ul {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }
  
  .header-menu li {
    margin: 0 !important;
  }
  
  .header-menu a {
    padding: 0.5rem 1rem !important;
  }
}

/* Override any Bootstrap or other theme media queries that affect header at 1200px+ */
@media (min-width: 1200px) {
  .custom-header {
    padding: 1rem 2rem !important;
    height: auto !important;
    min-height: 80px !important;
  }
  
  .header-title {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
  }
  
  .custom-header .header-menu a,
  .header-menu a {
    font-size: 1rem !important;
    padding: 0.5rem 1rem !important;
  }
  
  .header-menu ul {
    gap: 0.75rem !important;
  }
}

/* Ensure consistent header behavior across all screen sizes */
@media (min-width: 1400px) {
  .custom-header {
    padding: 1rem 2rem !important;
    height: auto !important;
    min-height: 80px !important;
  }
  
  .header-title {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
  }
  
  .custom-header .header-menu a,
  .header-menu a {
    font-size: 1rem !important;
    padding: 0.5rem 1rem !important;
  }
}

/* Overview Text Component Styling */
.overview-text-component {
  margin: 2rem 0;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.overview-text-component__content {
  max-width: 1200px;
  margin: 0 auto;
}

.overview-text-component__title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.overview-text-component__text {
  font-size: 1.125rem;
  line-height: 1.6;
  color: #555;
  margin-bottom: 1.5rem;
  text-align: center;
}

.overview-text-component__detailed-content {
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
}

.overview-text-component__detailed-content p {
  margin-bottom: 1rem;
}

.overview-text-component__detailed-content p:last-child {
  margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .overview-text-component {
    margin: 1rem 0;
    padding: 1.5rem;
  }
  
  .overview-text-component__title {
    font-size: 2rem;
    margin-bottom: 1rem;
  }
  
  .overview-text-component__text {
    font-size: 1rem;
  }
}

/* Component 2 Columns Styling */
.component-2-columns {
  margin: 2rem 0;
  padding: 0;
}

.component-2-columns__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.component-2-columns__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.component-2-columns__left,
.component-2-columns__right {
  padding: 2rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  border: 1px solid #e9ecef;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.component-2-columns__left:hover,
.component-2-columns__right:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
}

.component-2-columns__left h1,
.component-2-columns__left h2,
.component-2-columns__left h3,
.component-2-columns__left h4,
.component-2-columns__left h5,
.component-2-columns__left h6,
.component-2-columns__right h1,
.component-2-columns__right h2,
.component-2-columns__right h3,
.component-2-columns__right h4,
.component-2-columns__right h5,
.component-2-columns__right h6 {
  color: #2c3e50;
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.component-2-columns__left p,
.component-2-columns__right p {
  color: #555;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.component-2-columns__left p:last-child,
.component-2-columns__right p:last-child {
  margin-bottom: 0;
}

.component-2-columns__left ul,
.component-2-columns__left ol,
.component-2-columns__right ul,
.component-2-columns__right ol {
  color: #555;
  line-height: 1.6;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.component-2-columns__left ul:last-child,
.component-2-columns__left ol:last-child,
.component-2-columns__right ul:last-child,
.component-2-columns__right ol:last-child {
  margin-bottom: 0;
}

.component-2-columns__left li,
.component-2-columns__right li {
  margin-bottom: 0.5rem;
}

.component-2-columns__left li:last-child,
.component-2-columns__right li:last-child {
  margin-bottom: 0;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .component-2-columns {
    margin: 1.5rem 0;
  }
  
  .component-2-columns__container {
    padding: 0 0.5rem;
  }
  
  .component-2-columns__content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .component-2-columns__left,
  .component-2-columns__right {
    padding: 1.5rem;
  }
  
  .component-2-columns__left:hover,
  .component-2-columns__right:hover {
    transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .component-2-columns__content {
    gap: 2rem;
  }
  
  .component-2-columns__left,
  .component-2-columns__right {
    padding: 1.75rem;
  }
}

/* Component 1 Column Styling */
.component-1-column {
  margin: 2rem 0;
  padding: 0;
}

.component-1-column__wrapper {
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  border: 1px solid #e9ecef;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.component-1-column__wrapper:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
}

.component-1-column__content {
  padding: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.component-1-column__title {
  color: #2c3e50;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 1.5rem 0;
  line-height: 1.3;
  text-align: left;
}

.component-1-column__body {
  color: #555;
  line-height: 1.6;
}

.component-1-column__body h1,
.component-1-column__body h2,
.component-1-column__body h3,
.component-1-column__body h4,
.component-1-column__body h5,
.component-1-column__body h6 {
  color: #2c3e50;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.component-1-column__body h1:first-child,
.component-1-column__body h2:first-child,
.component-1-column__body h3:first-child,
.component-1-column__body h4:first-child,
.component-1-column__body h5:first-child,
.component-1-column__body h6:first-child {
  margin-top: 0;
}

.component-1-column__body p {
  margin-bottom: 1rem;
  color: #555;
}

.component-1-column__body p:last-child {
  margin-bottom: 0;
}

.component-1-column__body ul,
.component-1-column__body ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: #555;
}

.component-1-column__body ul:last-child,
.component-1-column__body ol:last-child {
  margin-bottom: 0;
}

.component-1-column__body li {
  margin-bottom: 0.5rem;
}

.component-1-column__body li:last-child {
  margin-bottom: 0;
}

.component-1-column__body blockquote {
  border-left: 4px solid #007bff;
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #666;
}

.component-1-column__body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .component-1-column {
    margin: 1.5rem 0;
  }
  
  .component-1-column__content {
    padding: 1.5rem;
  }
  
  .component-1-column__title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }
  
  .component-1-column__wrapper:hover {
    transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .component-1-column__content {
    padding: 2rem;
  }
  
  .component-1-column__title {
    font-size: 1.875rem;
  }
}

/* Component Hero Styling */
.component-hero {
  margin: 0;
  padding: 0;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.paragraph--type--component-hero {
  --component-hero-left-offset: 43px;
  max-width: none;
  width: calc(100vw + var(--component-hero-left-offset));
  margin-left: calc(50% - 50vw - var(--component-hero-left-offset));
  margin-right: calc(50% - 50vw);
  padding: 0;
}

.component-hero__wrapper {
  width: 100%;
  position: relative;
  height: 300px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 2rem 0;
}

.component-hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.component-hero__content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 2rem;
}

.component-hero__text {
  max-width: 600px;
}

.component-hero__title {
  color: #ffffff;
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  line-height: 1.2;
  text-align: left;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.component-hero__subtitle {
  color: #ffffff;
  font-size: 1.25rem;
  line-height: 1.5;
  margin: 0 0 2rem 0;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.component-hero__cta {
  text-align: left;
}

.component-hero__cta-button {
  display: inline-block;
  padding: 0.75rem 2rem;
  background-color: #ffffff;
  color: #007bff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: 2px solid #007bff;
  text-shadow: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.component-hero__cta-button:hover {
  background-color: #007bff;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}

.component-hero__cta-button:focus {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .component-hero__wrapper {
    height: 250px;
  }
  
  .component-hero__content {
    padding: 0 1rem;
  }
  
  .component-hero__title {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }
  
  .component-hero__subtitle {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
  }
  
  .component-hero__cta-button {
    padding: 0.625rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .component-hero__wrapper {
    height: 280px;
  }
  
  .component-hero__title {
    font-size: 2.5rem;
  }
  
  .component-hero__subtitle {
    font-size: 1.125rem;
  }
}
