/**
 * Styling for the Featured Biography block.
 */

/* Main container */
.featured-biography-block {
  max-width: 100%;
  margin-bottom: 2rem;
  border: none;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  background-color: #fff;
  transition: box-shadow 0.3s ease;
}

/* Demo card styling */
.saho-card--demo {
  position: relative;
  opacity: 0.85;
}

.saho-card--demo::before {
  content: 'DEMO';
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ffc107;
  color: #000;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 4px;
  z-index: 1;
}

.saho-card--demo .saho-card-link {
  pointer-events: none;
  cursor: default;
}

.featured-biography-block:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* Block title and description */
.featured-biography-block .block-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  margin-top: 1.5rem; /* Add more top spacing */
  margin-bottom: 1rem; /* More spacing below title */
  padding-left: 0.5rem; /* Left padding */
  position: relative;
}

.featured-biography-block .block-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background-color: #B22222; /* SAHO red color */
  margin-top: 12px; /* More space before underline */
  transition: width 0.3s ease;
}

.featured-biography-block:hover .block-title::after {
  width: 80px;
}

.featured-biography-block .block-description {
  font-size: 1rem;
  color: #666;
  line-height: 1.5;
  margin-top: 0.5rem; /* More spacing after title */
  margin-bottom: 1.5rem; /* More spacing before content */
  padding: 0 0.5rem 1rem 0.5rem; /* Add padding around text */
}

/* Add more spacing to the content section */
.featured-biography-content {
  padding: 1.5rem !important; /* Increase padding */
}

/* Header section */
.featured-biography-header {
  background-color: #B22222; /* SAHO red color */
  padding: 1.5rem 1.5rem; /* Increase padding */
  margin-bottom: 1rem; /* Add bottom margin */
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.featured-biography-header h2 {
  color: #fff;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Content section */
.featured-biography-content {
  padding: 1.5rem;
  max-width: 1000px; /* Limit max width for better readability */
  margin: 0 auto; /* Center the content */
}

.featured-biography-item {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  background: #fff;
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
}

.featured-biography-item:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Image styling - made more compact */
.featured-biography-image {
  display: block; /* Ensure container is displayed */
  visibility: visible; /* Ensure visibility */
  flex: 0 0 200px; /* Fixed width instead of percentage */
  max-width: 200px; /* Maximum width constraint */
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.featured-biography-image::before {
  content: "";
  display: block;
  padding-top: 125%; /* 4:5 aspect ratio - more compact than 3:4 */
}

.featured-biography-image img {
  display: block; /* Ensure img element is displayed */
  visibility: visible; /* Ensure visibility */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.3s ease;
}

.featured-biography-image a:hover img {
  transform: scale(1.03);
}

/* Details section - more compact */
.featured-biography-details {
  flex: 1;
  min-width: 300px; /* Fixed minimum width instead of percentage */
  max-width: calc(100% - 240px); /* Account for image width + gap */
}

/* Categories (breadcrumb-like) */
.featured-biography-categories {
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}

.featured-biography-category {
  color: #666;
  text-decoration: none;
  transition: color 0.2s ease;
}

.featured-biography-category:hover {
  text-decoration: underline;
  color: #B22222;
}

/* Title - more compact */
.featured-biography-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.375rem; /* Slightly smaller */
  line-height: 1.3;
  font-weight: 600;
}

.featured-biography-title a {
  color: #B22222;
  text-decoration: none;
  transition: color 0.2s ease;
}

.featured-biography-title a:hover {
  text-decoration: underline;
  color: #8B0000;
}

/* Dates */
.featured-biography-dates {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: #444;
  font-weight: 500;
}

/* Position */
.featured-biography-position {
  margin-bottom: 0.75rem;
  font-style: italic;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Summary - more compact with better line height */
.featured-biography-summary {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.5; /* Tighter line spacing */
  color: #333;
  max-height: 4.5em; /* Limit to about 3 lines */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Read more link - more modern styling */
.featured-biography-read-more {
  margin-top: 1rem;
}

.featured-biography-link {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.25rem;
  background-color: #B22222;
  color: #fff;
  text-decoration: none;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
}

/* Clean link styling for biography content */
.featured-biography-summary a,
.featured-biography-summary a:link,
.featured-biography-summary a:visited {
  color: #B22222;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.featured-biography-summary a:hover {
  color: #8B0000;
  text-decoration: none;
}

.featured-biography-link::after {
  content: '→';
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
}

.featured-biography-link:hover {
  background-color: #8B0000;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.featured-biography-link:hover::after {
  transform: translateX(3px);
}

.featured-biography-link:active {
  transform: translateY(0);
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
}

/* Empty state */
.featured-biography-empty {
  padding: 1.5rem;
  text-align: center;
  color: #666;
  font-style: italic;
}

/* Force image visibility - override any potential conflicts */
.featured-biography-image,
.featured-biography-image img,
.featured-biography-image a,
.featured-biography-image a img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Compact mode */
.compact-mode .featured-biography-image {
  flex: 0 0 25%;
  max-width: 25%;
}

.compact-mode .featured-biography-title {
  font-size: 1.25rem;
}

.compact-mode .featured-biography-summary {
  display: none;
}

.compact-mode .featured-biography-position {
  font-size: 0.9rem;
}

.compact-mode .featured-biography-dates {
  font-size: 0.9rem;
}

/* Card styling - scoped but allowing initial display */
.featured-biography-block .saho-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  transition: transform 0.5s ease;
  min-height: 400px; /* Larger min-height to ensure grid is visible */
  position: relative; /* Add positioning context */
  overflow: visible; /* Show content outside container */
  width: 100%; /* Full width */
  margin: 0;
  padding: 0;
  z-index: 1; /* Ensure it's above other elements */
}

.featured-biography-block .saho-card {
  position: relative;
  background-color: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: block !important; /* Force display */
  opacity: 1 !important; /* Force visibility */
  transform: none !important; /* Prevent transform from hiding */
  visibility: visible !important; /* Ensure visibility */
}

/* Apply animation after load instead of hiding initially */
.featured-biography-block .saho-card.saho-card--animate {
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.featured-biography-block .saho-card--hover,
.featured-biography-block .saho-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.featured-biography-block .saho-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.featured-biography-block .saho-card-image {
  position: relative;
  padding-top: 66.67%; /* 2:3 aspect ratio */
  overflow: hidden;
}

.featured-biography-block .saho-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.featured-biography-block .saho-card:hover .saho-card-image img {
  transform: scale(1.05);
}

.featured-biography-block .saho-card-image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
  color: #888;
}

.featured-biography-block .saho-card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.featured-biography-block .saho-card-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background-color: #28a745;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.25rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.featured-biography-block .saho-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  color: #333;
}

.featured-biography-block .saho-card-subtitle {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.featured-biography-block .saho-card-description {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1rem;
  line-height: 1.5;
  flex-grow: 1;
}

.featured-biography-block .saho-card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.featured-biography-block .saho-card-button {
  display: inline-flex;
  align-items: center;
  color: #B22222;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.featured-biography-block .saho-card-button i {
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
}

.featured-biography-block .saho-card:hover .saho-card-button {
  color: #8B0000;
}

.featured-biography-block .saho-card:hover .saho-card-button i {
  transform: translateX(3px);
}

/* Modern Touch-Enabled Carousel Styling */
/* Base container styling */
.featured-biography-block.enable-carousel .saho-cards-grid {
  display: flex !important; /* Force flex even if other styles applied */
  flex-wrap: nowrap !important;
  gap: 1.5rem;
  overflow: visible !important; /* Show content outside container */
  width: 100% !important; /* Ensure full width */
  will-change: transform; /* Performance optimization */
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1); /* Smooth easing */
  touch-action: pan-y; /* Allow vertical scroll but use JS for horizontal */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  cursor: grab; /* Visual cue that content is draggable */
  user-select: none; /* Prevent text selection during drag */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  transform: translateX(0) !important; /* Force initial position on screen */
  min-height: 400px !important; /* Ensure visible height */
}

/* Styling while dragging */
.featured-biography-block.enable-carousel .saho-cards-grid.dragging {
  cursor: grabbing;
  transition: none; /* No transition during drag for responsiveness */
}

/* Card styling for carousel */
.featured-biography-block.enable-carousel .saho-card {
  flex: 0 0 calc(33.333% - 1rem) !important;
  max-width: calc(33.333% - 1rem) !important;
  display: block !important; /* Ensure cards are displayed */
  visibility: visible !important;
  transform: scale(1) !important; /* Full size to ensure visibility */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform; /* Performance hint */
  position: relative !important; /* Ensure proper positioning */
  height: auto !important; /* Let content determine height */
  min-height: 300px !important; /* Minimum height to ensure visibility */
  opacity: 1 !important; /* Force visibility */
}

/* Active card styling */
.featured-biography-block.enable-carousel .saho-card.active {
  transform: scale(1);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Explicit block-specific carousel controls with better touch targets */
.featured-biography-block .featured-biography-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2rem;
  padding: 0.5rem 0;
}

/* Enhanced, more visible control buttons */
.featured-biography-block .featured-bio-prev-btn,
.featured-biography-block .featured-bio-next-btn,
.featured-biography-block .carousel-button {
  background-color: #B22222; /* SAHO red background for high visibility */
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 48px; /* Larger for better touch targets */
  height: 48px; /* Larger for better touch targets */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff; /* White icons for contrast */
  transition: all 0.3s ease;
  font-size: 1.25rem; /* Larger icons */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  margin: 0 0.5rem;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
  position: relative; /* For click debugging */
  z-index: 10; /* Ensure buttons are above other content */
  outline: none; /* Remove outline to prevent confusion */
}

/* Hover and active states for buttons with increased visual feedback */
.featured-biography-block .featured-bio-prev-btn:hover,
.featured-biography-block .featured-bio-next-btn:hover,
.featured-biography-block .carousel-button:hover {
  background-color: #8B0000; /* Darker red on hover */
  color: #fff;
  transform: translateY(-2px) scale(1.05); /* Slight scale for visual feedback */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.featured-biography-block .featured-bio-prev-btn:active,
.featured-biography-block .featured-bio-next-btn:active,
.featured-biography-block .carousel-button:active {
  transform: translateY(0) scale(0.95); /* Scale down for press effect */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Disabled state styling */
.featured-biography-block .featured-bio-prev-btn.disabled,
.featured-biography-block .featured-bio-next-btn.disabled,
.featured-biography-block .carousel-button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background-color: #999; /* Gray for disabled state */
}

/* Make sure the control container is clearly visible */
.featured-biography-block .featured-biography-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2rem;
  padding: 0.75rem 0;
  background-color: #f9f9f9; /* Light background for visibility */
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Indicators with animation */
.featured-biography-block .featured-bio-indicators {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 1rem;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  padding: 0.5rem 0;
}

/* Modern indicator styling */
.featured-biography-block .featured-bio-indicator {
  width: 10px; /* Slightly larger */
  height: 10px;
  border-radius: 50%;
  background-color: #ddd;
  margin: 0.25rem;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

/* Active indicator with animation */
.featured-biography-block .featured-bio-indicator.active {
  background-color: #B22222;
  transform: scale(1.3);
}

/* Add pulse animation to active indicator */
@keyframes indicatorPulse {
  0% { transform: scale(1.3); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1.3); }
}

.featured-biography-block .featured-bio-indicator.active {
  animation: indicatorPulse 2s infinite ease-in-out;
}
/* Enhanced mobile experience */
@media (max-width: 768px) {
  /* Optimize for touch on mobile */
  .featured-biography-block.enable-carousel .saho-cards-grid {
    gap: 1rem; /* Smaller gap on mobile */
    padding-bottom: 1rem; /* Add padding to prevent cut-off shadows */
  }

  /* Full width cards on mobile */
  .featured-biography-block.enable-carousel .saho-card {
    flex: 0 0 calc(100% - 2rem) !important;
    max-width: calc(100% - 2rem) !important;
  }

  /* Smaller controls on mobile but still touch-friendly */
  .featured-biography-block .featured-bio-prev-btn,
  .featured-biography-block .featured-bio-next-btn {
    width: 40px;
    height: 40px;
  }

  /* Center and space indicators better on mobile */
  .featured-biography-block .featured-bio-indicators {
    margin: 0.5rem 0;
  }
}
/* Multiple items styling */
.multiple-items .featured-biography-item {
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 0.375rem;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.multiple-items .featured-biography-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.multiple-items .featured-biography-image {
  flex: 0 0 100%;
  max-width: 100%;
  margin-bottom: 0;
}

.multiple-items .featured-biography-image::before {
  padding-top: 66.67%; /* 2:3 aspect ratio for grid items */
}

.multiple-items .featured-biography-details {
  padding: 1.25rem;
}

/* Enhanced responsive design for optimal screen utilization */
@media (max-width: 1024px) {
  .featured-biography-block {
    margin: 0 0.5rem 1.5rem 0.5rem;
  }

  .featured-biography-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
  }
}

@media (max-width: 991px) {
  .featured-biography-image {
    display: block !important; /* Ensure image is visible */
    visibility: visible !important; /* Force visibility */
    flex: 0 0 35%;
    max-width: 35%;
  }

  .featured-biography-image img {
    display: block !important; /* Ensure img element is visible */
    visibility: visible !important;
  }

  .compact-mode .featured-biography-image {
    display: block !important; /* Ensure image is visible */
    visibility: visible !important; /* Force visibility */
    flex: 0 0 30%;
    max-width: 30%;
  }

  .featured-biography-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  /* Enhanced mobile width utilization */
  .featured-biography-block {
    margin: 0 0.5rem 1.25rem 0.5rem;
  }

  .featured-biography-content {
    padding: 1rem;
  }

  .featured-biography-item {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .featured-biography-image,
  .compact-mode .featured-biography-image {
    display: block !important; /* Ensure image is visible */
    visibility: visible !important; /* Force visibility */
    opacity: 1 !important; /* Ensure full opacity */
    flex: 0 0 auto;
    width: 200px; /* Fixed width instead of max-width */
    max-width: 100%; /* Don't exceed container */
    height: auto; /* Let height adjust */
    margin: 0 auto 1rem auto; /* Center the image */
    position: relative; /* Ensure proper positioning */
  }

  .featured-biography-image::before {
    padding-top: 125%; /* Keep same aspect ratio */
  }

  .featured-biography-image img {
    display: block !important; /* Ensure img element is visible */
    visibility: visible !important;
    opacity: 1 !important;
  }

  .featured-biography-details {
    min-width: auto;
    max-width: 100%;
    text-align: center; /* Center text on mobile */
  }

  .featured-biography-title {
    font-size: 1.25rem;
  }

  .compact-mode .featured-biography-title {
    font-size: 1.125rem;
  }

  .featured-biography-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 0.5rem;
  }
}

@media (max-width: 480px) {
  /* Maximum width utilization on small screens */
  .featured-biography-block {
    margin: 0 0.25rem 1rem 0.25rem;
  }

  .featured-biography-header {
    padding: 0.875rem 1rem;
  }

  .featured-biography-header h2 {
    font-size: 1.3rem;
  }

  .featured-biography-content {
    padding: 0.875rem;
  }

  .featured-biography-item {
    padding: 1.25rem;
  }

  .featured-biography-image {
    display: block !important; /* Ensure image is visible */
    visibility: visible !important; /* Force visibility */
    opacity: 1 !important; /* Ensure full opacity */
    width: 150px; /* Fixed width for very small screens */
    max-width: 100%; /* Don't exceed container */
    height: auto; /* Let height adjust */
  }

  .featured-biography-image img {
    display: block !important; /* Ensure img element is visible */
    visibility: visible !important;
    opacity: 1 !important;
  }

  .featured-biography-title {
    font-size: 1.125rem;
  }

  .featured-biography-grid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
    padding: 0 0.25rem;
  }
}