/**
 * Atlas Events Calendar — estilos que replican la apariencia de la página
 * de eventos de atlassolutionsmarketing.com (tarjetas redondeadas, acentos
 * azules, mini-calendario lateral fijo).
 */

.atlas-ev-root,
.atlas-ev-detail-wrap {
  --atlas-blue: #2563eb;
  --atlas-blue-dark: #1d4ed8;
  --atlas-blue-soft: #eff6ff;
  --atlas-text: #0a0a0a;
  --atlas-muted: #6b7280;
  --atlas-border: #e5e7eb;
  --atlas-bg: #ffffff;
  --atlas-bg-soft: #f9fafb;
  --atlas-amber: #d97706;
  --atlas-amber-soft: #fffbeb;
  --atlas-amber-border: #fde68a;
  font-family: inherit;
  color: var(--atlas-text);
}

/* Resets defensivos: los temas de WordPress suelen meter padding, min-width
   o box-sizing propios a botones y spans, lo que rompe la cuadrícula. */
.atlas-ev-root *,
.atlas-ev-root *::before,
.atlas-ev-root *::after,
.atlas-ev-detail-wrap *,
.atlas-ev-detail-wrap *::before,
.atlas-ev-detail-wrap *::after {
  box-sizing: border-box;
}

.atlas-ev-root button {
  min-width: 0;
  margin: 0;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

/* ---------- Layout general ---------- */

.atlas-ev-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .atlas-ev-layout {
    flex-direction: row;
    align-items: flex-start;
  }
  .atlas-ev-sidebar {
    position: sticky;
    top: 6rem;
    width: 20rem;
    flex-shrink: 0;
  }
}

.atlas-ev-main {
  min-width: 0;
  flex: 1;
}

/* ---------- Mini calendario ---------- */

.atlas-ev-cal-card {
  overflow: hidden;
  max-width: 100%;
  border: 1px solid var(--atlas-border);
  border-radius: 1rem;
  background: var(--atlas-bg);
  padding: 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(30, 58, 138, 0.05);
}

.atlas-ev-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.atlas-ev-cal-month {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.atlas-ev-cal-nav {
  display: grid;
  place-items: center;
  height: 2.25rem;
  width: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--atlas-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.atlas-ev-cal-nav:hover {
  background: var(--atlas-blue-soft);
  color: var(--atlas-blue-dark);
}

.atlas-ev-cal-grid {
  /* Reglas críticas con !important: los temas de WordPress pueden redefinir
     display, width o padding de divs/botones y desbordar la cuadrícula.
     minmax(0, 1fr): sin el mínimo 0, el contenido de los botones impide
     encoger las columnas. */
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 0.25rem !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: center;
}

.atlas-ev-cal-grid > span,
.atlas-ev-cal-grid > button {
  min-width: 0 !important;
  max-width: 100% !important;
  float: none !important;
}

.atlas-ev-cal-weekday {
  display: block !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0.25rem 0 !important;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #9ca3af;
}

.atlas-ev-cal-day {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  min-height: 0 !important;
  height: 2.5rem !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0.5rem;
  background: transparent;
  box-shadow: none;
  font-size: 0.875rem !important;
  line-height: 1 !important;
  color: var(--atlas-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.atlas-ev-cal-day:disabled {
  cursor: default;
  opacity: 0.65;
}

.atlas-ev-cal-day.has-events {
  font-weight: 700;
  color: var(--atlas-blue-dark);
}

.atlas-ev-cal-day.has-events:hover {
  background: var(--atlas-blue-soft);
}

.atlas-ev-cal-day.is-selected {
  background: var(--atlas-blue);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.atlas-ev-cal-day.has-holiday {
  font-weight: 700;
  color: var(--atlas-amber);
}

.atlas-ev-cal-day.has-holiday:hover {
  background: var(--atlas-amber-soft);
}

.atlas-ev-cal-day.is-today {
  box-shadow: inset 0 0 0 1px #60a5fa;
}

.atlas-ev-cal-dots {
  position: absolute;
  bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.atlas-ev-cal-dot {
  height: 0.25rem;
  width: 0.25rem;
  border-radius: 9999px;
  background: #3b82f6;
}

.atlas-ev-cal-dot.is-holiday {
  background: #f59e0b;
}

.atlas-ev-cal-day.is-selected .atlas-ev-cal-dot {
  background: #ffffff;
}

.atlas-ev-cal-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f3f4f6;
  font-size: 0.75rem;
  color: var(--atlas-muted);
}

.atlas-ev-legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.atlas-ev-legend-dot {
  height: 0.375rem;
  width: 0.375rem;
  border-radius: 9999px;
  background: #3b82f6;
}

.atlas-ev-legend-dot.is-holiday {
  background: #f59e0b;
}

.atlas-ev-cal-clear {
  margin-top: 1rem;
  width: 100%;
  padding: 0.5rem 1rem;
  border: 1px solid var(--atlas-border);
  border-radius: 0.5rem;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 700;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.atlas-ev-cal-clear:hover {
  border-color: #93c5fd;
  color: var(--atlas-blue-dark);
}

/* ---------- Barra superior ---------- */

.atlas-ev-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--atlas-border);
  border-radius: 1rem;
  background: var(--atlas-bg);
}

.atlas-ev-bar-label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--atlas-muted);
}

.atlas-ev-bar-count {
  display: grid;
  place-items: center;
  height: 2.25rem;
  width: 2.25rem;
  flex-shrink: 0;
  border: 1px solid var(--atlas-border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 800;
}

/* ---------- Días festivos ---------- */

.atlas-ev-holidays {
  margin-bottom: 1.5rem;
}

.atlas-ev-holidays-label {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--atlas-amber);
}

.atlas-ev-holidays-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .atlas-ev-holidays-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.atlas-ev-holiday-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--atlas-amber-border);
  border-radius: 0.75rem;
  background: var(--atlas-amber-soft);
}

.atlas-ev-holiday-icon {
  display: grid;
  place-items: center;
  height: 3rem;
  width: 3rem;
  flex-shrink: 0;
  font-size: 1.75rem;
  line-height: 1;
}

.atlas-ev-holiday-body {
  min-width: 0;
}

.atlas-ev-holiday-name {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: #78350f;
}

.atlas-ev-holiday-meta {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(180, 83, 9, 0.8);
}

/* ---------- Cuadrícula de tarjetas ---------- */

.atlas-ev-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .atlas-ev-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1280px) {
  .atlas-ev-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.atlas-ev-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--atlas-border);
  border-radius: 1rem;
  background: var(--atlas-bg);
  box-shadow: 0 10px 15px -3px rgba(30, 58, 138, 0.05);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.atlas-ev-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 50px -12px rgba(30, 58, 138, 0.15);
}

.atlas-ev-card-media {
  position: relative;
  height: 13rem;
  overflow: hidden;
  background: #f3f4f6;
}

.atlas-ev-card-media img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.atlas-ev-card:hover .atlas-ev-card-media img {
  transform: scale(1.05);
}

.atlas-ev-card-date {
  position: absolute;
  left: 1rem;
  top: 1rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.95);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--atlas-blue-dark);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.atlas-ev-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.25rem;
}

.atlas-ev-card-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.35;
  transition: color 0.15s;
}

.atlas-ev-card:hover .atlas-ev-card-title {
  color: var(--atlas-blue-dark);
}

.atlas-ev-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--atlas-muted);
}

.atlas-ev-card-line {
  margin: 0;
}

.atlas-ev-clamp {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.atlas-ev-online {
  font-weight: 600;
  color: var(--atlas-blue);
}

.atlas-ev-card-cta {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--atlas-blue);
  transition: transform 0.15s;
}

.atlas-ev-card:hover .atlas-ev-card-cta {
  transform: translateX(4px);
}

/* ---------- Estado vacío / error ---------- */

.atlas-ev-empty {
  padding: 3rem;
  border: 1px dashed #d1d5db;
  border-radius: 1rem;
  background: var(--atlas-bg-soft);
  text-align: center;
}

.atlas-ev-empty-icon {
  display: block;
  margin-bottom: 1rem;
  font-size: 2.5rem;
}

.atlas-ev-empty h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.atlas-ev-empty p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--atlas-muted);
}

/* ---------- Vista de detalle ---------- */

.atlas-ev-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--atlas-blue);
  text-decoration: none;
  transition: color 0.15s;
}

.atlas-ev-back:hover {
  color: #1e40af;
}

.atlas-ev-detail {
  overflow: hidden;
  border: 1px solid var(--atlas-border);
  border-radius: 1rem;
  background: var(--atlas-bg);
  box-shadow: 0 25px 50px -12px rgba(30, 58, 138, 0.1);
}

@media (min-width: 1024px) {
  .atlas-ev-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  /* En desktop la imagen va a la derecha, completa y sin recortes. */
  .atlas-ev-detail-media {
    order: 2;
    position: sticky;
    top: 5rem;
    align-self: flex-start;
  }
  .atlas-ev-detail-body {
    order: 1;
  }
}

.atlas-ev-detail-media {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: #f3f4f6;
}

.atlas-ev-detail-media img {
  max-height: 420px;
  width: auto;
  max-width: 100%;
  border-radius: 0.75rem;
  object-fit: contain;
}

@media (min-width: 1024px) {
  .atlas-ev-detail-media {
    padding: 1.5rem;
  }
  .atlas-ev-detail-media img {
    max-height: 600px;
  }
}

.atlas-ev-detail-body {
  padding: 1.5rem;
}

@media (min-width: 640px) {
  .atlas-ev-detail-body {
    padding: 2.5rem;
  }
}

.atlas-ev-detail-title {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1.2;
}

@media (min-width: 640px) {
  .atlas-ev-detail-title {
    font-size: 2.25rem;
  }
}

.atlas-ev-detail-meta {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .atlas-ev-detail-meta {
    grid-template-columns: repeat(2, 1fr);
  }
}

.atlas-ev-meta-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--atlas-blue-soft);
}

.atlas-ev-meta-icon {
  flex-shrink: 0;
  font-size: 1.125rem;
  line-height: 1.4;
}

.atlas-ev-meta-min {
  min-width: 0;
}

.atlas-ev-meta-strong {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
}

.atlas-ev-meta-sub {
  margin: 0.125rem 0 0;
  font-size: 0.875rem;
  color: var(--atlas-muted);
}

.atlas-ev-meta-link {
  display: block;
  margin-top: 0.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--atlas-blue);
  text-decoration: underline;
}

.atlas-ev-detail-about {
  margin-top: 2rem;
}

.atlas-ev-detail-about h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
}

.atlas-ev-description {
  line-height: 1.65;
  color: #374151;
}

.atlas-ev-description a {
  font-weight: 600;
  color: var(--atlas-blue);
  text-decoration: underline;
}

.atlas-ev-description ul {
  list-style: disc;
  padding-left: 1.25rem;
}

.atlas-ev-description ol {
  list-style: decimal;
  padding-left: 1.25rem;
}

.atlas-ev-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  background: linear-gradient(to right, #2563eb, #4338ca);
  font-weight: 700;
  color: #ffffff !important;
  text-decoration: none;
  box-shadow: 0 10px 15px -3px rgba(30, 58, 138, 0.2);
  transition: transform 0.15s;
}

.atlas-ev-cta:hover {
  transform: scale(1.01);
  background: linear-gradient(to right, #1d4ed8, #3730a3);
}
