/* =====================================================
   Event Search for WP Event Manager v1.1 – styles
   ===================================================== */

#es-wrapper {
  font-family: inherit;
  max-width: 1200px;
  margin: 0 auto;
}

/* ---- Formulář ---- */
.es-form {
  background: #f8f9fa;
  border: 1px solid #e2e6ea;
  border-radius: 10px;
  padding: 20px 24px 16px;
  margin-bottom: 20px;
}

/* Hlavní řádek: search + checkbox + tlačítka */
.es-main-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Vyhledávací pole */
.es-search-wrap {
  position: relative;
  flex: 1 1 280px;
  min-width: 200px;
}

.es-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #adb5bd;
  pointer-events: none;
}

.es-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px 10px 40px;
  border: 1px solid #ced4da;
  border-radius: 7px;
  font-size: 0.95rem;
  background: #fff;
  color: #212529;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.es-search-input:focus {
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74,144,217,0.2);
  outline: none;
}

/* Checkbox "Je nás slyšet" */
.es-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.es-checkbox-label input[type="checkbox"] {
  display: none;
}

.es-checkbox-box {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 2px solid #ced4da;
  border-radius: 5px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.es-checkbox-box::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0;
  transition: opacity 0.1s;
}

.es-checkbox-label input:checked + .es-checkbox-box {
  background: #2c6fad;
  border-color: #2c6fad;
}

.es-checkbox-label input:checked + .es-checkbox-box::after {
  opacity: 1;
}

.es-checkbox-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
}

/* Tlačítka */
.es-btn {
  padding: 10px 20px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.es-btn:active { transform: scale(0.97); }

.es-btn--primary  { background: #2c6fad; color: #fff; }
.es-btn--primary:hover { background: #245d93; }
.es-btn--secondary { background: #e9ecef; color: #495057; }
.es-btn--secondary:hover { background: #dee2e6; }

/* ---- Pokročilé vyhledávání ---- */
.es-advanced-toggle {
  margin-top: 12px;
}

.es-advanced-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #2c6fad;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  transition: color 0.15s;
}
.es-advanced-btn:hover { color: #1a4d7a; }

#es-advanced-arrow {
  transition: transform 0.2s ease;
}
#es-advanced-arrow.open {
  transform: rotate(180deg);
}

.es-advanced-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e6ea;
}

.es-advanced-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.es-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.es-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.es-field input,
.es-field select {
  padding: 8px 11px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.92rem;
  background: #fff;
  color: #212529;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  width: 100%;
}
.es-field input:focus,
.es-field select:focus {
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74,144,217,0.2);
  outline: none;
}

/* ---- Toolbar (info + řazení) ---- */
.es-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  min-height: 36px;
}

.es-results-info {
  font-size: 0.88rem;
  color: #6c757d;
}

.es-sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.es-sort-wrap label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6c757d;
  white-space: nowrap;
}

.es-sort-wrap select {
  padding: 6px 10px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.88rem;
  background: #fff;
  color: #212529;
  cursor: pointer;
}

/* ---- Grid dlaždic ---- */
.es-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

/* ---- Karta ---- */
.es-card {
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
}
.es-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

/* Obrázková hlavička s odznakem data */
.es-card__header {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e9ecef, #dee2e6);
}

.es-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder bez obrázku */
.es-card__header--noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #adb5bd;
}

/* Odznak datumu – trhací kalendář: měsíc nahoře, den dole */
.es-card__date-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 7px;
  overflow: hidden;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.30);
}

.es-badge-mesic {
  display: block;
  width: 100%;
  text-align: center;
  background: #d63f3f;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 4px;
  line-height: 1.2;
}

.es-badge-den {
  display: block;
  width: 100%;
  text-align: center;
  background: rgba(255,255,255,0.95);
  color: #0d1b2a;
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1;
  padding: 4px 2px 5px;
}

/* Tělo karty */
.es-card__body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.es-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: #212529;
  line-height: 1.35;
  margin: 0;
}

.es-card__meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.es-card__meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  color: #6c757d;
}
.es-card__meta-item svg { flex-shrink: 0; color: #adb5bd; }

.es-card__excerpt {
  font-size: 0.86rem;
  color: #495057;
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.es-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 6px;
}

.es-tag {
  font-size: 0.73rem;
  padding: 3px 8px;
  border-radius: 20px;
  background: #e8f0fb;
  color: #2c6fad;
  font-weight: 600;
}

/* ---- Prázdný stav ---- */
.es-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}
.es-empty__icon { font-size: 3rem; display: block; margin-bottom: 10px; }

/* ---- Loading ---- */
.es-loading {
  text-align: center;
  padding: 40px;
  color: #6c757d;
  font-size: 0.95rem;
}
.es-spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 3px solid #dee2e6;
  border-top-color: #2c6fad;
  border-radius: 50%;
  animation: es-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes es-spin { to { transform: rotate(360deg); } }

/* ---- Stránkování ---- */
.es-pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.es-page-btn {
  min-width: 40px; height: 40px;
  padding: 0 10px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
  color: #2c6fad;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.es-page-btn:hover { background: #e8f0fb; border-color: #4a90d9; }
.es-page-btn--active { background: #2c6fad; border-color: #2c6fad; color: #fff; cursor: default; }
.es-page-btn--disabled { opacity: 0.4; cursor: default; pointer-events: none; }

/* ---- Responzivita ---- */
@media (max-width: 640px) {
  .es-main-row { flex-direction: column; align-items: stretch; }
  .es-search-wrap { flex: 1 1 100%; }
  .es-checkbox-label { justify-content: flex-start; }
  .es-btn { width: 100%; text-align: center; }
  .es-advanced-fields { grid-template-columns: 1fr; }
  .es-grid { grid-template-columns: 1fr; }
  .es-toolbar { flex-direction: column; align-items: flex-start; }
}

/* =====================================================
   MODÁLNÍ OKNO – editorial magazínový styl
   ===================================================== */

/* Scroll lock */
body.es-no-scroll { overflow: hidden; }

/* Overlay */
#es-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 12, 20, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

#es-modal-overlay.es-modal--open {
  display: flex;
  animation: esm-fade-in 0.22s ease both;
}

@keyframes esm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Modal okno */
#es-modal {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.08);
  animation: esm-slide-up 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  scrollbar-width: thin;
  scrollbar-color: #dee2e6 transparent;
}

@keyframes esm-slide-up {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Zavírací tlačítko */
#es-modal-close {
  position: sticky;
  top: 16px;
  float: right;
  margin: 16px 16px -48px 0;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
}

#es-modal-close:hover {
  background: #fff;
  transform: scale(1.08);
}

/* Hero obrázek */
.esm-hero {
  width: 100%;
  height: 320px;
  background-size: cover;
  background-position: center;
  border-radius: 16px 16px 0 0;
  position: relative;
}

.esm-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(
    to bottom,
    transparent 40%,
    rgba(0,0,0,0.55) 100%
  );
}

.esm-hero--nophoto {
  height: 80px;
  background: linear-gradient(135deg, #1a3a5c 0%, #2c6fad 50%, #4a90d9 100%);
}

/* Tělo modálu */
.esm-body {
  padding: 28px 36px 36px;
}

/* Tagy */
.esm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.esm-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 20px;
  background: #e8f0fb;
  color: #2c6fad;
}

/* Název */
.esm-title {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.25;
  color: #0d1b2a;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}

/* Meta řádek: datum + místo */
.esm-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f0f2f5;
  align-items: flex-start;
}

.esm-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #0d1b2a;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 30px;
  white-space: nowrap;
  flex-shrink: 0;
}

.esm-date-pill svg { opacity: 0.7; }

.esm-location {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #495057;
  font-size: 0.88rem;
  line-height: 1.5;
  padding-top: 6px;
}

.esm-location svg { flex-shrink: 0; margin-top: 2px; color: #2c6fad; }

.esm-location-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.esm-location-text strong {
  color: #0d1b2a;
  font-weight: 700;
  font-size: 0.92rem;
}

.esm-location-text span {
  color: #6c757d;
}

.esm-kraj {
  font-size: 0.78rem;
  font-weight: 600;
  color: #2c6fad !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* Popis */
.esm-desc {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #2d3748;
  margin-bottom: 28px;
}

.esm-desc p {
  margin: 0 0 1em;
}

.esm-desc p:last-child { margin-bottom: 0; }

.esm-desc ul, .esm-desc ol {
  margin: 0 0 1em 1.4em;
  padding: 0;
}

.esm-desc li { margin-bottom: 0.3em; }

.esm-desc strong { color: #0d1b2a; }

.esm-desc a { color: #2c6fad; }

/* Kontakty */
.esm-contacts {
  background: #f8f9fb;
  border: 1px solid #e8ecf0;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 28px;
}

.esm-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #adb5bd;
  margin: 0 0 12px;
}

.esm-contact-item {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #edf0f3;
  font-size: 0.88rem;
  align-items: baseline;
}

.esm-contact-item:last-child { border-bottom: none; padding-bottom: 0; }

.esm-contact-label {
  min-width: 130px;
  font-weight: 600;
  color: #6c757d;
  flex-shrink: 0;
  font-size: 0.82rem;
}

.esm-contact-item a {
  color: #2c6fad;
  text-decoration: none;
}

.esm-contact-item a:hover { text-decoration: underline; }

/* CTA tlačítko */
.esm-footer {
  display: flex;
  justify-content: flex-end;
}

.esm-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2c6fad;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(44, 111, 173, 0.35);
}

.esm-cta:hover {
  background: #245d93;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(44, 111, 173, 0.45);
  color: #fff;
  text-decoration: none;
}

/* Responzivita */
@media (max-width: 640px) {
  #es-modal-overlay { padding: 0; align-items: flex-end; }

  #es-modal {
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    animation-name: esm-slide-up-mobile;
  }

  @keyframes esm-slide-up-mobile {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  .esm-hero { height: 220px; border-radius: 20px 20px 0 0; }
  .esm-hero::after { border-radius: 20px 20px 0 0; }
  .esm-body { padding: 20px 20px 28px; }
  .esm-title { font-size: 1.3rem; }
  .esm-meta-row { flex-direction: column; gap: 10px; }
  .esm-contact-item { flex-direction: column; gap: 2px; }
  .esm-contact-label { min-width: unset; }
  .esm-footer { justify-content: stretch; }
  .esm-cta { width: 100%; justify-content: center; }
}

/* Tlačítko editace v modálu – pouze pro přihlášené */
.esm-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: #6c757d;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  margin-right: auto;
}

.esm-edit-btn:hover {
  background: #f8f9fa;
  color: #495057;
  border-color: #adb5bd;
  text-decoration: none;
}
