/**
 * StoryBite Block Styles
 * Designed for megamenu integration with clean, modern card design
 */

/* Container */
.storybite-block-view {
  width: 100%;
}

.storybite-block-view .view-content {
  padding: 0;
}

.storybite-block-view .storybite-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #212529;
}

/* StoryBite Card - Size based on Views image style */
.storybite-card {
  display: inline-flex;
  flex-direction: column;
  background: transparent;
  border-radius: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  width: fit-content;
  max-width: 500px;
  position: relative;
}

/* Image Container - Size determined by Views image style */
.storybite-image {
  position: relative;
  overflow: hidden;
  background: #dee2e6;
  flex-shrink: 0;
  line-height: 0;
}

.storybite-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.storybite-card:hover .storybite-image img {
  transform: scale(1.08);
}

/* Content Area */
.storybite-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  background: transparent;
}

/* Title */
.storybite-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  color: #b8e0d7;
}

.storybite-card-title a {
  color: #b8e0d7 !important;
  text-decoration: none !important;
  transition: color 0.2s ease;
}

.storybite-card-title a:hover {
  color: #d5f0ea !important;
}

.storybite-card-title a:focus {
  outline: 2px solid #18453b;
  outline-offset: 2px;
  border-radius: 0;
}

/* Link */
.storybite-link {
  margin-top: auto;
}

.storybite-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  position: relative;
  padding-bottom: 2px;
  color: #5db09d;
}

.storybite-link a::after {
  content: '\2192';
  font-size: 1rem;
  padding-left: 0.5rem;
  transition: transform 0.2s ease;
}

.storybite-link a:hover {
  color: #7cc4b3;
}

.storybite-link a:hover::after {
  transform: translateX(4px);
}

.storybite-link a:focus {
  outline: 2px solid #18453b;
  outline-offset: 3px;
  border-radius: 0;
}

/* Empty State */
.storybite-block-view .view-empty {
  padding: 2rem;
  text-align: center;
  color: #6c757d;
  font-style: italic;
  font-size: 0.9375rem;
}

/* Megamenu Specific Styles */
.tb-megamenu .storybite-block-view {
  width: auto;
}

.tb-megamenu .storybite-card {
  width: fit-content;
  max-width: 500px;
}

.tb-megamenu .storybite-content {
  padding: 1rem;
}

.tb-megamenu .storybite-card-title {
  font-size: 0.9375rem;
}

.tb-megamenu .storybite-link a {
  font-size: 0.8125rem;
}

/* Responsive Adjustments */
@media (min-width: 769px) {
  .storybite-card {
    max-width: 100%;
  }

  .storybite-image {
    width: 100%;
  }

  .storybite-image img {
    width: 100%;
    height: auto;
  }
}

@media (max-width: 991px) {
  .storybite-content {
    padding: 1rem;
  }

  .storybite-card-title {
    font-size: 0.9375rem;
  }

  .storybite-link a {
    font-size: 0.8125rem;
  }
}

@media (max-width: 768px) {
  .storybite-card {
    max-width: 500px;
  }

  .storybite-image {
    width: 100%;
  }

  .storybite-image img {
    width: 100%;
  }
}

@media (max-width: 767px) {

  .storybite-content {
    padding: 0.875rem;
  }

  .storybite-card-title {
    font-size: 0.875rem;
  }

  .storybite-link a {
    font-size: 0.75rem;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .storybite-card,
  .storybite-image img,
  .storybite-card-title a,
  .storybite-link a,
  .storybite-link a::after,
  .storybite-link a::before {
    transition: none !important;
  }

  .storybite-card:hover {
    transform: none;
  }

  .storybite-card:hover .storybite-image img {
    transform: none;
  }

  .storybite-link a:hover::after {
    transform: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .storybite-card {
    border: 2px solid #000;
  }

  .storybite-card-title a,
  .storybite-link a {
    text-decoration: underline;
  }
}

