/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

@import "./event-archive.css";
@import "./event-single.css";
@import "./event-calendar.css";

.post-type-archive-hora_event .iti,
.single-hora_event .iti {
  width: 100%;
}

.post-type-archive-hora_event .iti__country.iti__country,
.single-hora_event .iti__country.iti__country {
  display: flex;
}

.iti.iti {
  width: 100%;
}

.iti__country.iti__country {
  display: flex;
}

.iti__search-input.iti__search-input {
  padding: 8px;
}

:root {
  /* Primary palette */
  --hora-color-primary: #ffea00;
  --hora-color-on-primary: #000000;
  --hora-color-primary-subtle: rgba(255, 234, 0, 0.1);

  /* Neutral palette */
  --hora-color-text: #333333;
  --hora-color-text-muted: #4b5563;
  --hora-color-bg: #f8f9fa;
  --hora-color-surface: #ffffff;
  --hora-color-border: #e5e7eb;
  --hora-color-hover: #eef2ff;

  /* Semantic */
  --hora-color-error: #dc3545;
  --hora-color-success: #28a745;

  /* Shape */
  --hora-radius: 0.375rem;
  --hora-radius-pill: 50px;

  /* Layout */
  --hora-content-width: 1200px;
}

/* @media (prefers-color-scheme: dark) {
  :root {
    --hora-color-text: #f9fafb;
    --hora-color-text-muted: #9ca3af;
    --hora-color-bg: #1f2937;
    --hora-color-surface: #1f2937;
    --hora-color-border: #374151;
    --hora-color-hover: #374151;
  }
} */

.hora-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--hora-radius);
  cursor: pointer;
  font-family: inherit;
  text-wrap: nowrap;
}

.hora-btn.hora-btn-primary {
  background: var(--hora-color-primary);
  color: var(--hora-color-on-primary);
}

.hora-btn:hover {
  filter: brightness(0.95);
}

body:has(#horaEventRegisterModal[aria-hidden="false"]) {
  overflow: hidden;
}

#hora-event-registration-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#hora-event-registration-form
  .rendered-form.formbuilder-embedded-bootstrap
  .form-group:not(:last-child) {
  margin-bottom: 16px;
}

.hora-response-wrapper {
  padding: 16px;
  border-radius: 8px;
  background-color: var(--hora-color-bg);
  border: 1px solid var(--hora-color-border);

  font-family: inherit;
  font-size: 1rem;
  color: var(--hora-color-text);
  font-weight: 500;
}

.hora-response-wrapper.hora-response-success {
  background-color: #d1fae5;
  border-color: #34d399;
}

.hora-response-wrapper.hora-response-error {
  background-color: #fee2e2;
  border-color: #f87171;
}

/* Event Breadcrumbs Styles */
.hora-event-breadcrumbs {
  margin: 1rem 0;
  padding: 0.5rem 0;
}

.hora-breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.hora-breadcrumb-item {
  display: flex;
  align-items: center;
}

.hora-breadcrumb-link {
  color: var(--hora-color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 0.25rem 0;
}

.hora-breadcrumb-link:hover {
  color: var(--hora-color-primary);
  text-decoration: underline;
}

.hora-breadcrumb-text {
  color: var(--hora-color-text);
  font-weight: 500;
}

.hora-breadcrumb-current .hora-breadcrumb-text {
  color: var(--hora-color-text);
  font-weight: 600;
}

.hora-breadcrumb-separator {
  display: flex;
  align-items: center;
  color: var(--hora-color-text-muted);
  opacity: 0.6;
}

.hora-breadcrumb-arrow {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

/* Responsive breadcrumbs */
@media (max-width: 768px) {
  .hora-event-breadcrumbs {
    margin: 0.75rem 0;
    padding: 0.25rem 0;
  }

  .hora-breadcrumb-list {
    font-size: 0.8rem;
    gap: 0.375rem;
  }

  .hora-breadcrumb-arrow {
    width: 14px;
    height: 14px;
  }
}

/* Accessibility improvements */
.hora-breadcrumb-separator[aria-hidden="true"] {
  pointer-events: none;
}

/* Custom color scheme support */
.hora-event-breadcrumbs.hora-breadcrumb-light {
  color: var(--hora-color-text);
}

.hora-event-breadcrumbs.hora-breadcrumb-dark {
  color: #f8f9fa;
}

.hora-event-breadcrumbs.hora-breadcrumb-dark .hora-breadcrumb-link {
  color: #cbd5e0;
}

.hora-event-breadcrumbs.hora-breadcrumb-dark .hora-breadcrumb-link:hover {
  color: var(--hora-color-primary);
}

.hora-event-breadcrumbs.hora-breadcrumb-dark .hora-breadcrumb-text {
  color: #f8f9fa;
}

.hora-event-breadcrumbs.hora-breadcrumb-dark .hora-breadcrumb-separator {
  color: #9ca3af;
}

.hora-powered-by {
  margin-top: 32px;
}

.hora-powered-by-link {
  text-decoration: none;
  width: 100%;
}

.hora-powered-by {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

.hora-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: inherit;
  font-size: clamp(1.25rem, 2vw + 1rem, 2rem);
  font-weight: bold;
  color: var(--hora-color-text);
  text-align: center;
  z-index: 10;
  line-height: 1.2;
}

.hora-center-text .hora-accent {
  text-transform: uppercase;
}

/* Add to Calendar Dropdown Styles */
.hora-add-to-calendar-wrapper {
  position: relative;
  display: inline-block;
}

.hora-add-to-calendar-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  position: relative;
}

.hora-add-to-calendar-btn .dropdown-icon {
  transition: transform 0.2s ease;
  margin-left: auto;
}

.hora-add-to-calendar-btn[aria-expanded="true"] .dropdown-icon {
  transform: rotate(180deg);
}

.hora-add-to-calendar-dropdown {
  position: absolute;
  z-index: 1000;
  min-width: 200px;
  background: var(--hora-color-surface);
  border: 1px solid var(--hora-color-border);
  border-radius: var(--hora-radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  padding: 0.5rem 0;
}

.hora-add-to-calendar-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hora-add-to-calendar-dropdown.dropdown-bottom-left {
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
}

.hora-add-to-calendar-dropdown.dropdown-bottom-right {
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
}

.hora-add-to-calendar-dropdown.dropdown-top-left {
  bottom: 100%;
  left: 0;
  margin-bottom: 0.5rem;
}

.hora-add-to-calendar-dropdown.dropdown-top-right {
  bottom: 100%;
  right: 0;
  margin-bottom: 0.5rem;
}

.hora-add-to-calendar-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--hora-color-text);
  text-decoration: none;
  transition: background-color 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.5;
}

.hora-add-to-calendar-dropdown .dropdown-item:hover {
  background-color: var(--hora-color-hover);
  color: var(--hora-color-text);
}

.hora-add-to-calendar-dropdown .dropdown-item:focus {
  outline: 2px solid var(--hora-color-primary);
  outline-offset: -2px;
}

.hora-add-to-calendar-dropdown .calendar-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--hora-color-text-muted);
}

/* Responsive design */
@media (max-width: 768px) {
  .hora-add-to-calendar-dropdown {
    min-width: 180px;
    font-size: 0.8rem;
  }

  .hora-add-to-calendar-dropdown .dropdown-item {
    padding: 0.625rem 0.875rem;
    gap: 0.5rem;
  }

  .hora-add-to-calendar-dropdown .calendar-icon {
    width: 14px;
    height: 14px;
  }
}

/* Accessibility improvements */
.hora-add-to-calendar-dropdown .dropdown-item:focus-visible {
  outline: 2px solid var(--hora-color-primary);
  outline-offset: 2px;
}

/* Animation for dropdown toggle */
@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hora-add-to-calendar-dropdown.show {
  animation: dropdownFadeIn 0.15s ease-out;
}

/* Social Share Styles */
.hora-social-share {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hora-social-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--hora-radius);
  border: 1px solid var(--hora-color-border);
  background: var(--hora-color-surface);
  color: var(--hora-color-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.hora-social-share-btn:hover {
  background-color: var(--hora-color-hover);
  border-color: var(--hora-color-text-muted);
  color: var(--hora-color-text);
  text-decoration: none;
}

.hora-social-share-btn:focus-visible {
  outline: 2px solid var(--hora-color-primary);
  outline-offset: 2px;
}

.hora-social-share-btn svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

@media (max-width: 768px) {
  .hora-social-share-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }

  .hora-social-share-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* ============================================================
   Archive Filters — Category Chips & Search
   ============================================================ */

.hora-archive-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* Category chips column */
.hora-archive-filters-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  align-items: center;
}

.hora-filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  padding: 8px 16px;
  border: 1px solid var(--hora-color-border);
  background: var(--hora-color-bg);
  color: var(--hora-color-text);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.5;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
  white-space: nowrap;
}

.hora-filter-chip:hover {
  background-color: var(--hora-color-hover);
  border-color: var(--hora-color-text-muted);
}

.hora-filter-chip:focus-visible {
  outline: 2px solid var(--hora-color-primary);
  outline-offset: 2px;
}

.hora-filter-chip-active {
  background: var(--hora-color-primary);
  color: var(--hora-color-on-primary);
  border-color: transparent;
}

.hora-filter-chip-active:hover {
  filter: brightness(0.92);
  background: var(--hora-color-primary);
}

/* Overflow "+N" and "Show less" chips */
.hora-filter-chip-more,
.hora-filter-chip-less {
  border-style: dashed;
  color: var(--hora-color-text-muted);
}

.hora-filter-chip-more:hover,
.hora-filter-chip-less:hover {
  background-color: var(--hora-color-hover);
}

.hora-filter-chips-overflow {
  display: none;
}

.hora-filter-chips-overflow.hora-filter-chips-overflow-visible {
  display: contents;
}

.hora-hidden {
  display: none !important;
}

/* Search column */
.hora-archive-filters-search {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.hora-search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--hora-color-border);
  background: var(--hora-color-surface);
  color: var(--hora-color-text);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
  flex-shrink: 0;
}

.hora-search-toggle:hover {
  background-color: var(--hora-color-hover);
  border-color: var(--hora-color-text-muted);
}

.hora-search-toggle:focus-visible {
  outline: 2px solid var(--hora-color-primary);
  outline-offset: 2px;
}

.hora-filter-search-input {
  width: 0;
  opacity: 0;
  padding: 0;
  border: 1px solid var(--hora-color-border);
  border-radius: var(--hora-radius);
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--hora-color-text);
  background: var(--hora-color-surface);
  transition:
    width 0.3s ease,
    opacity 0.3s ease,
    padding 0.3s ease;
  overflow: hidden;
  margin-left: 0;
}

.hora-filter-search-input:focus {
  outline: 2px solid var(--hora-color-primary);
  outline-offset: -1px;
  border-color: var(--hora-color-primary);
}

.hora-search-expanded .hora-filter-search-input {
  width: 200px;
  opacity: 1;
  padding: 8px 12px;
  margin-left: 8px;
}

/* Responsive: mobile */
@media (max-width: 768px) {
  .hora-archive-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .hora-archive-filters-categories {
    order: 2;
  }

  .hora-archive-filters-search {
    order: 1;
    width: 100%;
  }

  /* Always expanded on mobile */
  .hora-search-toggle {
    display: none;
  }

  .hora-filter-search-input {
    width: 100% !important;
    opacity: 1 !important;
    padding: 10px 12px !important;
    margin-left: 0 !important;
  }
}

/* FullCalendar integration */
.hora-events-fullcalendar-wrapper {
  width: 100%;
  max-width: 100%;
}

.hora-events-fullcalendar-wrapper .fc {
  --fc-border-color: var(--hora-color-border);
  --fc-button-bg-color: var(--hora-color-primary);
  --fc-button-border-color: var(--hora-color-primary);
  --fc-button-text-color: var(--hora-color-on-primary);
  --fc-button-hover-bg-color: var(--hora-color-primary);
  --fc-button-hover-border-color: var(--hora-color-primary);
  --fc-button-active-bg-color: var(--hora-color-primary);
  --fc-button-active-border-color: var(--hora-color-primary);
  --fc-today-bg-color: var(--hora-color-primary-subtle);
  --fc-event-border-color: transparent;
  font-family: inherit;
}

.hora-events-fullcalendar-wrapper .fc .fc-button:hover {
  filter: brightness(0.9);
}

.hora-events-fullcalendar-wrapper .fc .fc-button:focus {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.hora-events-fullcalendar-wrapper .fc .fc-daygrid-event {
  border-radius: var(--hora-radius);
  padding: 2px 4px;
  font-size: 0.85em;
}

.hora-events-fullcalendar-wrapper .fc .fc-event {
  cursor: pointer;
}

.hora-events-fullcalendar-wrapper .fc .fc-list-event:hover td {
  background-color: var(--hora-color-hover);
}
