/**
 * Stylesheet for [FR] Horarios Activos Gutenberg Block
 * Theme-agnostic design system: inherits colors and backgrounds from the active theme.
 * Uses translucent neutrals for borders and hovers to support both light and dark modes natively.
 */

:root {
  --fr-radius: 12px;
  --fr-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base block wrapper */
.fr-horarios-block-container {
  font-family: inherit;
  margin: 1.5rem 0;
  color: inherit;
  background: transparent;
}

/* Base Card Design */
.fr-horario-card {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(128, 128, 128, 0.2);
  border-radius: var(--fr-radius);
  padding: 1.5rem;
  box-shadow: none;
  transition: var(--fr-transition);
  position: relative;
  overflow: hidden;
}

.fr-horario-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, currentColor, rgba(128, 128, 128, 0.2));
  opacity: 0;
  transition: var(--fr-transition);
}

.fr-horario-card:hover {
  transform: translateY(-2px);
  border-color: rgba(128, 128, 128, 0.4);
}

.fr-horario-card:hover::before {
  opacity: 1;
}

/* Card Header */
.fr-horario-card-header {
  margin-bottom: 0;
}

.fr-horario-public-header {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.5;
  color: inherit;
}

.fr-horario-public-header p,
.fr-horarios-accordion-title p {
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

/* Card Body Content */
.fr-horario-card-body {
  font-size: 0.975rem;
  line-height: 1.65;
}

.fr-horario-desc-text {
  color: inherit;
  opacity: 0.9;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(128, 128, 128, 0.2);
}

.fr-horario-desc-text p {
  margin: 0 0 6px 0;
  color: inherit;
}
.fr-horario-desc-text p:last-child {
  margin-bottom: 0;
}

/* 1. EXTEND VERTICAL (Stack Layout) */
.fr-horarios-display-vertical {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* 2. EXTEND HORIZONTAL (Grid Layout) */
.fr-horarios-display-horizontal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* 3. ACCORDION (Collapsible Panels) */
.fr-horarios-display-accordion {
  border: 1px solid rgba(128, 128, 128, 0.2);
  border-radius: var(--fr-radius);
  overflow: hidden;
  background: transparent;
  color: inherit;
}

.fr-horarios-accordion-item {
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
  background: transparent;
  color: inherit;
}

.fr-horarios-accordion-item:last-child {
  border-bottom: none;
}

.fr-horarios-accordion-header {
  width: 100%;
  padding: 1.15rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: var(--fr-transition);
  color: inherit;
}

.fr-horarios-accordion-header:hover {
  background: rgba(128, 128, 128, 0.05);
}

.fr-horarios-accordion-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.fr-horarios-accordion-title {
  font-size: 1.075rem;
  font-weight: 700;
  color: inherit;
  margin: 0;
  line-height: 1.45;
  flex: 1;
}

.fr-horarios-accordion-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
  color: inherit;
  opacity: 0.65;
  margin-left: 12px;
}

.fr-horarios-accordion-icon::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  transition: var(--fr-transition);
}

.fr-horarios-accordion-item.active .fr-horarios-accordion-icon {
  transform: rotate(180deg);
  color: inherit;
  opacity: 1;
}

.fr-horarios-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  background: transparent;
  color: inherit;
}

.fr-horarios-accordion-content-inner {
  padding: 0 1.5rem 1.5rem 1.5rem;
}

/* 4. SLIDE (Carousel Layout) */
.fr-horarios-display-slide {
  position: relative;
  overflow: hidden;
  border-radius: var(--fr-radius);
  border: 1px solid rgba(128, 128, 128, 0.2);
  background: transparent;
  padding: 1.5rem;
  color: inherit;
}

.fr-horarios-slider {
  position: relative;
  width: 100%;
}

.fr-horarios-slider-viewport {
  overflow: hidden;
  width: 100%;
}

.fr-horarios-slider-track {
  display: flex;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.fr-horarios-slide {
  flex: 0 0 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 0 2.25rem;
}

.fr-horarios-slide .fr-horario-card {
  border: none;
  box-shadow: none;
  padding: 0;
}

.fr-horarios-slide .fr-horario-card::before {
  display: none;
}

.fr-horarios-slide .fr-horario-card:hover {
  transform: none;
}

/* Slider buttons */
.fr-horarios-slider-prev,
.fr-horarios-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(128, 128, 128, 0.03);
  border: 1px solid rgba(128, 128, 128, 0.25);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--fr-transition);
  z-index: 10;
  color: inherit;
  outline: none;
  padding: 0;
  backdrop-filter: blur(4px);
}

.fr-horarios-slider-prev:hover,
.fr-horarios-slider-next:hover {
  background: rgba(128, 128, 128, 0.1);
  color: inherit;
  border-color: rgba(128, 128, 128, 0.5);
}

.fr-horarios-slider-prev {
  left: -8px;
}

.fr-horarios-slider-next {
  right: -8px;
}

.fr-horarios-slider-prev::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border-bottom: 2.5px solid currentColor;
  border-left: 2.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 4px;
}

.fr-horarios-slider-next::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border-top: 2.5px solid currentColor;
  border-right: 2.5px solid currentColor;
  transform: rotate(45deg);
  margin-right: 4px;
}

/* Dots navigation */
.fr-horarios-slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 1.25rem;
}

.fr-horarios-slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(128, 128, 128, 0.3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: var(--fr-transition);
}

.fr-horarios-slider-dot.active {
  background: currentColor;
  width: 18px;
  border-radius: 4px;
}

/* Empty State */
.fr-horarios-block-empty {
  text-align: center;
  padding: 2rem;
  background: transparent;
  border: 1px dashed rgba(128, 128, 128, 0.2);
  border-radius: var(--fr-radius);
  color: inherit;
  opacity: 0.65;
  font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .fr-horario-card {
    padding: 1.15rem;
  }
  .fr-horarios-slide {
    padding: 0 1.75rem;
  }
  .fr-horarios-slider-prev {
    left: -4px;
  }
  .fr-horarios-slider-next {
    right: -4px;
  }
  .fr-horarios-accordion-header {
    padding: 1rem;
  }
  .fr-horarios-accordion-content-inner {
    padding: 0 1rem 1rem 1rem;
  }
}
