/**
 * @file
 * Styles for EGR Aside component.
 */

/* Header section */
.egr-aside__header {
  text-align: left;
  margin-bottom: 2rem;
}

.egr-aside__title {
  color: #18453B;
  margin-bottom: 1rem;
  line-height: 1.2;
}

/* Title size variations based on heading level */
h1.egr-aside__title {
  font-size: 2.5rem;
}

h2.egr-aside__title {
  font-size: 2rem;
}

h3.egr-aside__title {
  font-size: 1.75rem;
}

h4.egr-aside__title {
  font-size: 1.5rem;
}

h5.egr-aside__title {
  font-size: 1.25rem;
}

h6.egr-aside__title {
  font-size: 1.125rem;
}

.egr-aside__subtitle {
  font-size: 1.125rem;
  color: #6c757d;
  margin-bottom: 0;
  line-height: 1.5;
  font-weight: bold;
}

/* Container and layout */
.egr-aside {
  display: grid;
  gap: 2rem;
  margin: 3rem 0;
  align-items: start;
}

/* Column ratio variations */
.egr-aside--ratio-2-1 {
  grid-template-columns: 2fr 1fr;
}

.egr-aside--ratio-3-1 {
  grid-template-columns: 3fr 1fr;
}

.egr-aside--ratio-4-1 {
  grid-template-columns: 4fr 1fr;
}

/* Responsive layout */
@media (max-width: 992px) {
  .egr-aside {
    grid-template-columns: 1fr;
  }
  
  .egr-aside__sidebar {
    order: -1; /* Move aside to top on mobile */
    max-width: 400px;
    margin: 0 auto 2rem;
  }
}

/* Alignment variations */
.egr-aside--align-center {
  align-items: center;
}

/* Main content styling */
.egr-aside__main-content {
  font-size: 1rem;
  line-height: 1.6;
  color: #212529;
}

.egr-aside__main-content h2,
.egr-aside__main-content h3,
.egr-aside__main-content h4 {
  color: #18453B;
  margin-bottom: 1rem;
}

.egr-aside__main-content p {
  margin-bottom: 1rem;
}

.egr-aside__main-content ul,
.egr-aside__main-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.egr-aside__main-content a {
  color: #18453B;
  text-decoration: underline;
}

.egr-aside__main-content a:hover {
  color: #00c24e;
}

/* Sidebar styling */
.egr-aside__sidebar {
  padding: 1.5rem;
  background-color: #f8f9fa;
}

/* Image wrapper and styling */
.egr-aside__image-wrapper {
  margin-bottom: 1.5rem;
  text-align: center;
}

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

/* Image style variations */
.egr-aside__image--default {
  /* Default styling */
}

.egr-aside__image--rounded {
  border-radius: 0.5rem;
}

.egr-aside__image--circle {
  border-radius: 50%;
  aspect-ratio: 1;
  object-fit: cover;
}

/* Sidebar content styling */
.egr-aside__sidebar-content {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #495057;
}

.egr-aside__sidebar-content h3,
.egr-aside__sidebar-content h4,
.egr-aside__sidebar-content h5 {
  color: #18453B;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.egr-aside__sidebar-content p {
  margin-bottom: 0.75rem;
}

.egr-aside__sidebar-content ul,
.egr-aside__sidebar-content ol {
  margin-bottom: 0.75rem;
  padding-left: 1.25rem;
}

.egr-aside__sidebar-content li {
  margin-bottom: 0.25rem;
}

.egr-aside__sidebar-content a {
  color: #18453B;
  text-decoration: underline;
}

.egr-aside__sidebar-content a:hover {
  color: #00c24e;
}

/* Background wrapper */
.egr-aside-bg-wrapper {
  width: 100%;
  padding: 0;
  margin: 0;
}

/* When background color is applied */
.egr-aside-bg-wrapper[style*="background-color"] {
  padding: 4rem 0;
}

/* Edge to edge layout */
.egr-aside-edge-to-edge {
  width: 100%;
  max-width: 100%;
  padding: 0 2rem;
  margin: 0;
}

/* Container-based layouts already have Bootstrap styling */
.container .egr-aside,
.container-fluid .egr-aside {
  margin: 3rem 0;
}

/* Sidebar background variations */
.egr-aside__sidebar[style*="background-color: #18453B"] {
  color: #ffffff;
}

.egr-aside__sidebar[style*="background-color: #18453B"] .egr-aside__sidebar-content {
  color: #ffffff;
}

.egr-aside__sidebar[style*="background-color: #18453B"] h3,
.egr-aside__sidebar[style*="background-color: #18453B"] h4,
.egr-aside__sidebar[style*="background-color: #18453B"] h5 {
  color: #ffffff;
}

.egr-aside__sidebar[style*="background-color: #18453B"] a {
  color: #ffffff;
  text-decoration: underline;
}

.egr-aside__sidebar[style*="background-color: #18453B"] a:hover {
  color: #b8ff9e;
  text-decoration: underline;
}

/* Button links section */
.egr-aside__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.egr-aside__button {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background-color: #18453b;
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 500;
  border-radius: 0;
  transition: all 0.3s ease;
  border: 2px solid #18453b;
}

.egr-aside__button:hover {
  background-color: #0f2b23;
  border-color: #0f2b23;
  color: #ffffff !important;
  text-decoration: none !important;
}

.egr-aside__button:focus {
  outline: none;
}

/* When main content has custom text color */
.egr-aside__main[style*="color"] .egr-aside__button {
  /* Keep button colors consistent regardless of parent text color */
  color: #ffffff !important;
}

/* Link button styling */
.egr-aside__link-wrapper {
  margin-top: 1.5rem;
}

.egr-aside__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #18453B;
  border-color: #18453B;
  color: #ffffff;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.375rem;
  transition: all 0.3s ease;
}

.egr-aside__link:hover {
  background-color: #00c24e;
  border-color: #00c24e;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.egr-aside__link .bi {
  font-size: 0.9rem;
  transition: transform 0.3s ease;
}

.egr-aside__link:hover .bi {
  transform: translateX(3px);
}

/* Link styling for dark backgrounds */
.egr-aside__sidebar[style*="background-color: #18453B"] .egr-aside__link {
  background-color: #00c24e;
  border-color: #00c24e;
}

.egr-aside__sidebar[style*="background-color: #18453B"] .egr-aside__link:hover {
  background-color: #ffffff;
  border-color: #ffffff;
  color: #18453B;
}

/* Ensure proper spacing for rich text content */
.egr-aside__main-content > :first-child,
.egr-aside__sidebar-content > :first-child {
  margin-top: 0;
}

.egr-aside__main-content > :last-child,
.egr-aside__sidebar-content > :last-child {
  margin-bottom: 0;
}

/* Responsive button styles */
@media (max-width: 576px) {
  .egr-aside__buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .egr-aside__button {
    width: 100%;
    text-align: center;
  }
}