:root {
  --gpe-primary: #2563eb;
  --gpe-secondary: #111827;
  --gpe-border: #e5e7eb;
  --gpe-muted: #6b7280;
  --gpe-bg: #ffffff;
  --gpe-soft: #f8fafc;
  --gpe-radius: 14px;
  --gpe-shadow: 0 10px 28px rgba(17, 24, 39, .08);
}

.gpe-events-shell {
  --gpe-shell-max-width: 1180px;
  --gpe-card-min: 220px;
  --gpe-card-pad: .78rem;
  --gpe-card-gap: .55rem;
  --gpe-card-title-size: 1.02rem;
  --gpe-card-text-size: .9rem;
  --gpe-card-button-height: 36px;
  --gpe-image-ratio: 16 / 8.6;
  margin: 1rem auto;
  max-width: var(--gpe-shell-max-width);
  width: 100%;
}

.gpe-width-full {
  max-width: none;
}

.gpe-size-mini {
  --gpe-card-min: 170px;
  --gpe-card-pad: .6rem;
  --gpe-card-gap: .42rem;
  --gpe-card-title-size: .92rem;
  --gpe-card-text-size: .82rem;
  --gpe-card-button-height: 32px;
  --gpe-image-ratio: 16 / 7.4;
}

.gpe-size-compacto {
  --gpe-card-min: 210px;
  --gpe-card-pad: .72rem;
  --gpe-card-gap: .5rem;
  --gpe-card-title-size: 1rem;
  --gpe-card-text-size: .88rem;
  --gpe-card-button-height: 36px;
  --gpe-image-ratio: 16 / 8.4;
}

.gpe-size-normal {
  --gpe-card-min: 260px;
  --gpe-card-pad: 1rem;
  --gpe-card-gap: .72rem;
  --gpe-card-title-size: clamp(1.08rem, 2vw, 1.28rem);
  --gpe-card-text-size: .95rem;
  --gpe-card-button-height: 42px;
  --gpe-image-ratio: 16 / 10;
}

.gpe-size-grande {
  --gpe-card-min: 310px;
  --gpe-card-pad: 1.18rem;
  --gpe-card-gap: .85rem;
  --gpe-card-title-size: clamp(1.2rem, 2.4vw, 1.45rem);
  --gpe-card-text-size: 1rem;
  --gpe-card-button-height: 44px;
  --gpe-image-ratio: 16 / 10.5;
}

.gpe-tagdiv-block .gpe-events-shell {
  margin-top: .75rem;
}

.gpe-filters {
  align-items: end;
  background: var(--gpe-soft);
  border: 1px solid var(--gpe-border);
  border-radius: var(--gpe-radius);
  display: grid;
  gap: .7rem;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  margin-bottom: .9rem;
  padding: .85rem;
}

.gpe-filters label {
  color: var(--gpe-secondary);
  display: grid;
  font-size: .88rem;
  gap: .22rem;
}

.gpe-filters input,
.gpe-filters select {
  background: #fff;
  border: 1px solid var(--gpe-border);
  border-radius: 10px;
  color: var(--gpe-secondary);
  min-height: 38px;
  padding: .45rem .58rem;
  width: 100%;
}

.gpe-filter-check {
  align-items: center;
  display: flex !important;
  gap: .45rem !important;
  grid-template-columns: auto !important;
}

.gpe-events {
  display: grid;
  gap: .9rem;
}

.gpe-events-grid,
.gpe-events-cards,
.gpe-events-upcoming {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--gpe-card-min)), 1fr));
}

.gpe-columns-1 .gpe-events-grid,
.gpe-columns-1 .gpe-events-cards,
.gpe-columns-1 .gpe-events-upcoming { grid-template-columns: 1fr; }
.gpe-columns-2 .gpe-events-grid,
.gpe-columns-2 .gpe-events-cards,
.gpe-columns-2 .gpe-events-upcoming { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gpe-columns-3 .gpe-events-grid,
.gpe-columns-3 .gpe-events-cards,
.gpe-columns-3 .gpe-events-upcoming { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gpe-columns-4 .gpe-events-grid,
.gpe-columns-4 .gpe-events-cards,
.gpe-columns-4 .gpe-events-upcoming { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gpe-columns-5 .gpe-events-grid,
.gpe-columns-5 .gpe-events-cards,
.gpe-columns-5 .gpe-events-upcoming { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.gpe-columns-6 .gpe-events-grid,
.gpe-columns-6 .gpe-events-cards,
.gpe-columns-6 .gpe-events-upcoming { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.gpe-events-list {
  grid-template-columns: 1fr;
}

.gpe-events-list .gpe-event-card {
  display: grid;
  grid-template-columns: minmax(150px, 240px) 1fr;
}

.gpe-event-card {
  background: var(--gpe-bg);
  border: 1px solid var(--gpe-border);
  border-radius: var(--gpe-radius);
  box-shadow: var(--gpe-shadow);
  overflow: clip;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.gpe-event-card:focus-within,
.gpe-event-card:hover {
  border-color: rgba(37, 99, 235, .28);
  box-shadow: 0 16px 42px rgba(17, 24, 39, .12);
  transform: translateY(-2px);
}

.gpe-card-image {
  aspect-ratio: var(--gpe-image-ratio);
  background: var(--gpe-soft);
  display: block;
  overflow: hidden;
}

.gpe-card-image img,
.gpe-event-image {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.gpe-card-body {
  display: grid;
  gap: var(--gpe-card-gap);
  padding: var(--gpe-card-pad);
}

.gpe-event-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.gpe-pill {
  align-items: center;
  background: var(--gpe-soft);
  border: 1px solid var(--gpe-border);
  border-radius: 999px;
  color: var(--gpe-secondary);
  display: inline-flex;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.1;
  padding: .16rem .45rem;
}

.gpe-status {
  background: rgba(37, 99, 235, .08);
  border-color: rgba(37, 99, 235, .25);
  color: var(--gpe-primary);
}

.gpe-event-title {
  font-size: var(--gpe-card-title-size);
  line-height: 1.18;
  margin: 0;
}

.gpe-event-title a {
  color: var(--gpe-secondary);
  text-decoration: none;
}

.gpe-event-title a:hover,
.gpe-event-title a:focus {
  color: var(--gpe-primary);
  text-decoration: underline;
}

.gpe-event-excerpt {
  color: var(--gpe-muted);
  font-size: var(--gpe-card-text-size);
  line-height: 1.42;
}

.gpe-event-excerpt p {
  margin: 0;
}

.gpe-event-facts {
  color: var(--gpe-secondary);
  display: grid;
  font-size: var(--gpe-card-text-size);
  gap: .22rem;
  line-height: 1.32;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gpe-event-facts li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.gpe-size-mini .gpe-event-excerpt {
  display: none;
}

.gpe-size-mini .gpe-event-facts li:nth-child(n+3) {
  display: none;
}

.gpe-card-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.gpe-button {
  align-items: center;
  background: var(--gpe-primary);
  border: 1px solid var(--gpe-primary);
  border-radius: 10px;
  color: #fff !important;
  cursor: pointer;
  display: inline-flex;
  font-size: .86rem;
  font-weight: 800;
  justify-content: center;
  line-height: 1.1;
  min-height: var(--gpe-card-button-height);
  padding: .5rem .72rem;
  text-decoration: none;
}

.gpe-button:hover,
.gpe-button:focus {
  filter: brightness(.95);
  text-decoration: none;
}

.gpe-secondary {
  background: #fff;
  color: var(--gpe-primary) !important;
}

.gpe-full {
  width: 100%;
}

.gpe-empty {
  border: 1px dashed var(--gpe-border);
  border-radius: var(--gpe-radius);
  padding: 1rem;
}

.gpe-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

.gpe-pagination .page-numbers {
  border: 1px solid var(--gpe-border);
  border-radius: 8px;
  padding: .35rem .6rem;
  text-decoration: none;
}

.gpe-pagination .current {
  background: var(--gpe-primary);
  color: #fff;
}

.gpe-single-event {
  margin: 1.5rem auto;
  max-width: 1180px;
}

.gpe-single-hero {
  background: var(--gpe-secondary);
  border-radius: 24px;
  color: #fff;
  overflow: clip;
  position: relative;
}

.gpe-single-hero img {
  display: block;
  max-height: 520px;
  object-fit: cover;
  opacity: .65;
  width: 100%;
}

.gpe-single-heading {
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  inset: auto 0 0 0;
  padding: clamp(1.25rem, 4vw, 3rem);
  position: absolute;
}

.gpe-single-heading h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 4rem);
  margin: .55rem 0 0;
}

.gpe-single-heading-meta {
	display: flex;
	flex-wrap: wrap;
	gap: .6rem;
	margin-top: .15rem;
}

.gpe-lead {
  font-size: 1.1rem;
  max-width: 760px;
}

.gpe-single-layout {
  align-items: start;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr) 340px;
  margin-top: 1.5rem;
}

.gpe-content-section,
.gpe-box {
  background: #fff;
  border: 1px solid var(--gpe-border);
  border-radius: var(--gpe-radius);
  box-shadow: var(--gpe-shadow);
  margin-bottom: 1rem;
  padding: 1.25rem;
}

.gpe-gallery {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 1rem;
}

.gpe-gallery img {
  border-radius: 14px;
  height: 150px;
  object-fit: cover;
  width: 100%;
}

.gpe-details,
.gpe-custom-fields {
  display: grid;
  gap: .5rem .75rem;
  grid-template-columns: 120px 1fr;
}

.gpe-details dt,
.gpe-custom-fields dt {
  color: var(--gpe-secondary);
  font-weight: 800;
}

.gpe-details dd,
.gpe-custom-fields dd {
  color: var(--gpe-muted);
  margin: 0;
}

.gpe-map iframe {
  border: 0;
  border-radius: 14px;
  min-height: 360px;
  width: 100%;
}

.gpe-share {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.gpe-share h2 {
  margin-bottom: 0;
  width: 100%;
}

.gpe-calendar {
  background: #fff;
  border: 1px solid var(--gpe-border);
  border-radius: var(--gpe-radius);
  overflow: hidden;
}

.gpe-calendar-head {
  background: var(--gpe-secondary);
  color: #fff;
  padding: 1rem;
}

.gpe-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.gpe-calendar-weekdays div {
  background: var(--gpe-soft);
  border-bottom: 1px solid var(--gpe-border);
  font-weight: 800;
  padding: .75rem;
}

.gpe-calendar-day {
  border-bottom: 1px solid var(--gpe-border);
  border-right: 1px solid var(--gpe-border);
  min-height: 120px;
  padding: .55rem;
}

.gpe-calendar-number {
  font-weight: 800;
}

.gpe-calendar-day ul {
  font-size: .85rem;
  margin: .45rem 0 0;
  padding-left: 1rem;
}

.is-empty {
  background: #fafafa;
}

@media (max-width: 1100px) {
  .gpe-columns-5 .gpe-events-grid,
  .gpe-columns-5 .gpe-events-cards,
  .gpe-columns-5 .gpe-events-upcoming,
  .gpe-columns-6 .gpe-events-grid,
  .gpe-columns-6 .gpe-events-cards,
  .gpe-columns-6 .gpe-events-upcoming {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .gpe-columns-4 .gpe-events-grid,
  .gpe-columns-4 .gpe-events-cards,
  .gpe-columns-4 .gpe-events-upcoming,
  .gpe-columns-5 .gpe-events-grid,
  .gpe-columns-5 .gpe-events-cards,
  .gpe-columns-5 .gpe-events-upcoming,
  .gpe-columns-6 .gpe-events-grid,
  .gpe-columns-6 .gpe-events-cards,
  .gpe-columns-6 .gpe-events-upcoming {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .gpe-events-list .gpe-event-card,
  .gpe-single-layout {
    grid-template-columns: 1fr;
  }

  .gpe-single-heading {
    background: var(--gpe-secondary);
    position: static;
  }

  .gpe-single-hero img {
    opacity: 1;
  }

  .gpe-calendar-day {
    font-size: .84rem;
    min-height: 90px;
  }
}

@media (max-width: 640px) {
  .gpe-columns-2 .gpe-events-grid,
  .gpe-columns-2 .gpe-events-cards,
  .gpe-columns-2 .gpe-events-upcoming,
  .gpe-columns-3 .gpe-events-grid,
  .gpe-columns-3 .gpe-events-cards,
  .gpe-columns-3 .gpe-events-upcoming,
  .gpe-columns-4 .gpe-events-grid,
  .gpe-columns-4 .gpe-events-cards,
  .gpe-columns-4 .gpe-events-upcoming,
  .gpe-columns-5 .gpe-events-grid,
  .gpe-columns-5 .gpe-events-cards,
  .gpe-columns-5 .gpe-events-upcoming,
  .gpe-columns-6 .gpe-events-grid,
  .gpe-columns-6 .gpe-events-cards,
  .gpe-columns-6 .gpe-events-upcoming {
    grid-template-columns: 1fr;
  }

  .gpe-events-shell {
    margin: .75rem auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gpe-event-card {
    transition: none;
  }

  .gpe-event-card:hover {
    transform: none;
  }
}

/* Event detail modal. */
body.gpe-modal-open {
	overflow: hidden;
}

.gpe-modal {
	align-items: center;
	display: none;
	inset: 0;
	justify-content: center;
	padding: 24px;
	position: fixed;
	z-index: 999999;
}

.gpe-modal.is-open {
	display: flex;
}

.gpe-modal-backdrop {
	background: rgba(17, 24, 39, 0.72);
	inset: 0;
	position: absolute;
}

.gpe-modal-dialog {
	background: #fff;
	border-radius: 24px;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
	max-height: min(92vh, 980px);
	max-width: 1120px;
	overflow: auto;
	position: relative;
	width: min(100%, 1120px);
	z-index: 1;
}

.gpe-modal-dialog:focus {
	outline: 3px solid var(--gpe-primary, #2563eb);
	outline-offset: 4px;
}

.gpe-modal-close {
	align-items: center;
	background: #111827;
	border: 0;
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	font-size: 28px;
	height: 44px;
	justify-content: center;
	line-height: 1;
	position: sticky;
	top: 14px;
	float: right;
	margin: 14px 14px -58px 0;
	width: 44px;
	z-index: 3;
}

.gpe-modal-close:hover,
.gpe-modal-close:focus {
	background: var(--gpe-primary, #2563eb);
	outline: none;
}

.gpe-modal-content {
	padding: 0;
}

.gpe-modal-content .gpe-single-event {
	border-radius: 24px;
	margin: 0;
	overflow: hidden;
}

.gpe-modal-content .gpe-single-hero {
	padding-top: 0;
}

.gpe-modal-loading {
	font-size: 18px;
	padding: 56px 28px;
	text-align: center;
}

.gpe-open-event-modal {
	cursor: pointer;
}

@media (max-width: 782px) {
	.gpe-modal {
		align-items: stretch;
		padding: 10px;
	}

	.gpe-modal-dialog {
		border-radius: 18px;
		max-height: 96vh;
	}

	.gpe-modal-close {
		height: 40px;
		margin: 10px 10px -50px 0;
		width: 40px;
	}
}

/* Modal compacto y limpio para ficha de evento. */
.gpe-modal {
	padding: clamp(10px, 2vw, 22px);
}

.gpe-modal-dialog {
	border-radius: 22px;
	max-height: calc(100vh - 48px);
	max-width: 1080px;
	overflow: hidden;
	width: min(100%, 1080px);
}

.admin-bar .gpe-modal-dialog {
	max-height: calc(100vh - 80px);
}

.gpe-modal-content {
	max-height: inherit;
	overflow-y: auto;
	scrollbar-width: none;
}

.gpe-modal-content::-webkit-scrollbar {
	height: 0;
	width: 0;
}

.gpe-modal-close {
	box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
	float: none;
	margin: 0;
	position: absolute;
	right: 16px;
	top: 16px;
	z-index: 10;
}

.gpe-modal-content .gpe-single-event {
	max-width: none;
	width: 100%;
}

.gpe-single-event--modal .gpe-single-hero {
	border-radius: 0;
	display: grid;
	grid-template-columns: minmax(280px, 46%) minmax(0, 1fr);
	min-height: 0;
}

.gpe-single-event--modal .gpe-single-hero img {
	aspect-ratio: 16 / 10;
	height: clamp(230px, 34vh, 340px);
	max-height: none;
	opacity: 1;
	object-position: center;
}

.gpe-single-event--modal .gpe-single-heading {
	align-content: center;
	background: linear-gradient(135deg, #0f172a 0%, #15233b 54%, #1e293b 100%);
	display: grid;
	gap: .9rem;
	inset: auto;
	overflow: hidden;
	padding: clamp(1.1rem, 2.8vw, 2.35rem) clamp(1.1rem, 3vw, 2.5rem);
	position: static;
}

.gpe-single-event--modal .gpe-single-heading::before {
	background:
		radial-gradient(circle at top right, rgba(96, 165, 250, .16), transparent 42%),
		linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, 0));
	content: '';
	inset: 0;
	pointer-events: none;
	position: absolute;
}

.gpe-single-event--modal .gpe-single-heading > * {
	position: relative;
	z-index: 1;
}

.gpe-single-event--modal .gpe-single-heading h1 {
	background: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	color: #ffffff;
	font-size: clamp(2.15rem, 4.8vw, 3.5rem);
	font-weight: 800;
	letter-spacing: -.04em;
	line-height: .95;
	margin: 0;
	max-width: 11ch;
	outline: 0 !important;
	padding: 0;
	text-shadow: 0 8px 24px rgba(0, 0, 0, .24);
}

.gpe-single-event--modal .gpe-single-heading .gpe-single-heading-meta {
	margin-top: 0;
}

.gpe-single-event--modal .gpe-single-heading .gpe-status {
	align-self: start;
	background: rgba(37, 99, 235, .22);
	border-color: rgba(96, 165, 250, .55);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
	color: #dbeafe;
	font-size: .82rem;
	font-weight: 800;
	letter-spacing: .02em;
	padding: .34rem .78rem;
}

.gpe-single-event--modal .gpe-lead {
	color: rgba(226, 232, 240, .88);
	font-size: .98rem;
	line-height: 1.52;
	margin-top: 0;
	max-height: 6.2em;
	max-width: 40rem;
	overflow: hidden;
}

.gpe-single-event--modal .gpe-lead p {
	margin: 0;
}

.gpe-modal-content .gpe-single-layout {
	align-items: stretch;
	gap: 1rem;
	grid-template-columns: minmax(0, 1.45fr) minmax(260px, .75fr);
	margin: 0;
	padding: 1rem;
}

.gpe-modal-content .gpe-single-main {
	display: grid;
	gap: 1rem;
}

.gpe-modal-content .gpe-content-section,
.gpe-modal-content .gpe-box {
	box-shadow: none;
	margin: 0;
	padding: 1rem 1.1rem;
}

.gpe-modal-content .gpe-content-section h2,
.gpe-modal-content .gpe-box h2 {
	font-size: clamp(1.15rem, 2vw, 1.45rem);
	line-height: 1.15;
	margin: 0 0 .8rem;
}

.gpe-modal-content .gpe-content-section p {
	line-height: 1.55;
	margin: 0 0 .65rem;
}

.gpe-modal-content .gpe-content-section p:last-child {
	margin-bottom: 0;
}

.gpe-modal-content .gpe-details,
.gpe-modal-content .gpe-custom-fields {
	gap: .48rem .75rem;
	grid-template-columns: minmax(88px, .42fr) minmax(0, 1fr);
}

.gpe-modal-content .gpe-details dt,
.gpe-modal-content .gpe-custom-fields dt {
	font-size: .92rem;
}

.gpe-modal-content .gpe-details dd,
.gpe-modal-content .gpe-custom-fields dd {
	font-size: .92rem;
	line-height: 1.35;
}

.gpe-modal-content .gpe-button.gpe-full {
	margin-top: 1rem;
}

.gpe-modal-content .gpe-gallery {
	display: flex;
	gap: .7rem;
	margin: 0;
	overflow-x: auto;
	padding-bottom: .15rem;
	scrollbar-width: none;
}

.gpe-modal-content .gpe-gallery::-webkit-scrollbar {
	height: 0;
}

.gpe-modal-content .gpe-gallery a {
	flex: 0 0 150px;
}

.gpe-modal-content .gpe-gallery img {
	height: 110px;
}

.gpe-modal-content .gpe-map iframe {
	min-height: 230px;
}

.gpe-modal-content .gpe-share {
	gap: .5rem;
}

.gpe-modal-content .gpe-share h2 {
	font-size: 1.15rem;
}

.gpe-modal-content .gpe-share a {
	border: 1px solid var(--gpe-border);
	border-radius: 999px;
	font-size: .9rem;
	padding: .3rem .65rem;
	text-decoration: none;
}

@media (max-width: 900px) {
	.gpe-single-event--modal .gpe-single-hero,
	.gpe-modal-content .gpe-single-layout {
		grid-template-columns: 1fr;
	}

	.gpe-single-event--modal .gpe-single-hero img {
		height: clamp(190px, 32vh, 280px);
	}

	.gpe-single-event--modal .gpe-single-heading h1 {
		font-size: clamp(1.9rem, 8vw, 2.7rem);
		max-width: none;
	}
}

@media (max-width: 782px) {
	.gpe-modal {
		padding: 8px;
	}

	.gpe-modal-dialog,
	.admin-bar .gpe-modal-dialog {
		border-radius: 18px;
		max-height: calc(100vh - 16px);
	}

	.gpe-modal-close {
		height: 38px;
		right: 10px;
		top: 10px;
		width: 38px;
	}

	.gpe-modal-content .gpe-single-layout {
		padding: .8rem;
	}

	.gpe-modal-content .gpe-content-section,
	.gpe-modal-content .gpe-box {
		padding: .9rem;
	}
}
