/* 
 * Estilos para Template: Programas (page-programs.php)
 * Universidad del Pacifico
 */

/* ============================
   Programs Section
   ============================ */

.programs-section {
  padding: 1rem;
  padding-bottom: 5rem;
}

.programs-container {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
}

/* ============================
   Responsive (min-width: 768px)
   ============================ */
@media (min-width: 768px) {
  .programs-section {
    padding: 1rem;
    padding-bottom: 5rem;
  }
}

@media (min-width: 1536px) {
  .programs-section {
    padding: 4rem;
    padding-bottom: 5rem;
  }
}

/* ==========================================================================
   Programas - Estilos
   ========================================================================== */

/* Layout principal */
.programas-app {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 769px) {
  .programas-app {
    flex-direction: row;
  }
}

/* ------ Mobile toggle ------ */
.programas-mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-primary);
  font-weight: 500;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  width: 100%;
}

@media (min-width: 769px) {
  .programas-mobile-toggle {
    display: none;
  }
}

/* ------ Sidebar ------ */
.programas-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-white);
  z-index: 50;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-height: 100dvh;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
}

.programas-sidebar.is-open {
  transform: translateX(0);
}

@media (min-width: 769px) {
  .programas-sidebar {
    position: static;
    transform: none;
    width: 20%;
    max-width: 20rem;
    flex-shrink: 0;
    padding: 2rem 2rem 2rem 0;
    height: auto;
    max-height: none;
    overflow-y: visible;
    z-index: auto;
  }
}

/* Mobile header dentro del sidebar */
.programas-sidebar__mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (min-width: 769px) {
  .programas-sidebar__mobile-header {
    display: none;
  }
}

.programas-sidebar__close {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
}

.programas-sidebar__clear {
  font-size: 0.875rem;
  color: var(--color-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* Boton aplicar (mobile) */
.programas-sidebar__apply {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--color-secondary);
  color: var(--color-white);
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

@media (min-width: 769px) {
  .programas-sidebar__apply {
    display: none;
  }
}

/* ------ Filtros ------ */
.programas-filter {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.programas-filter__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.programas-filter__title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
}

.programas-filter__clear {
  font-size: 0.875rem;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--color-gray-900);
}

.programas-filter__options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.programas-filter__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.programas-filter__label input[type="radio"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  flex-shrink: 0;
  margin: 0;
  width: 1.0rem;
  height: 1.0rem;
  border: 1.5px solid var(--color-radio-border);
  border-radius: 50%;
  background-color: transparent;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.programas-filter__label input[type="radio"]:checked {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
  position: relative;
}

.programas-filter__label input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background-color: var(--color-white);
}

/* ------ Main / Resultados ------ */
.programas-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.programas-results {
  border: 1px solid var(--color-gray-100);
  border-radius: 0.5rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 769px) {
  .programas-results {
    padding: 1.5rem;
  }
}

.programas-results__header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

@media (min-width: 769px) {
  .programas-results__header {
    justify-content: space-between;
  }
}

.programas-results__count {
  color: var(--color-primary);
  margin: 0;
}

.programas-results__divider {
  border: none;
  border-top: 1px solid var(--color-gray-100);
  margin: 0;
}

.programas-results__list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ------ Card de programa ------ */
.programas-card {
  display: block;
  background: oklch(from var(--color-secondary) l c h / 0.1);
  padding: 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition:
    background-color 0.3s,
    color 0.3s;
}

@media (min-width: 769px) {
  .programas-card {
    padding: 2rem;
  }
}

.programas-card:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.programas-card__title {
  font-size: calc(2400vw/var(--width_base));
  font-weight: 600;
  margin: 0 0 1rem 0;
}

.programas-card__excerpt {
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

.programas-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
  font-size: 1rem;
  width: 100%;
  justify-content: center;
  transition:
    background-color 0.3s,
    color 0.3s,
    border-color 0.3s;
}

@media (min-width: 769px) {
  .programas-card__cta {
    padding: 1rem 2rem;
    width: auto;
  }
}

.programas-card:hover .programas-card__cta {
  background: var(--color-secondary);
  color: var(--color-white);
  border-color: var(--color-secondary);
}

/* ------ Estado vacio ------ */
.programas-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 50vh;
  padding: 2rem;
  max-width: 32rem;
  margin: 0 auto;
  gap: 0.5rem;
}

.programas-empty__title {
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0;
}

.programas-empty__text {
  margin: 0;
  color: var(--color-gray-550);
}

/* ------ Loading ------ */
.programas-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30vh;
}

.programas-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid var(--color-gray-100);
  border-top-color: var(--color-secondary);
  border-radius: 50%;
  animation: programas-spin 0.7s linear infinite;
}

@keyframes programas-spin {
  to {
    transform: rotate(360deg);
  }
}
