/* ==========================================================================
   Campai Events – Stylesheet
   CI: Bayerischer Segelverband (bayernsail.de)
   Primary  #005baa  |  Hover  #003e75  |  Navy   #33335c
   Text     #444444  |  Border #dcdfe4  |  BG     #e4ebf3
   HINWEIS: px-Werte wegen Oxygen html{font-size:62.5%}
   ========================================================================== */

/* --------------------------------------------------------------------------
   Basis & CI-Variablen
   -------------------------------------------------------------------------- */
.campai-events-list,
.campai-event-single,
.campai-booking-wrap {
  --bsv-primary:       #005baa;
  --bsv-primary-hover: #003e75;
  --bsv-navy:          #33335c;
  --bsv-text:          #444444;
  --bsv-dark:          #171717;
  --bsv-border:        #dcdfe4;
  --bsv-bg-light:      #e4ebf3;
  --bsv-bg-card:       #ffffff;
  --bsv-bg-alt:        #f5f5f5;
  --bsv-error:         #eb5757;
  --bsv-success:       #38a169;
  --bsv-warning:       #d69e2e;

  font-family: inherit;
  color: #444444;
  font-size: 16px;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Hinweis-Boxen
   -------------------------------------------------------------------------- */
.campai-notice {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.5;
}

.campai-error {
  background: #fdf1f1;
  border-left: 4px solid #eb5757;
  color: #7d1f1f;
}

.campai-notice-warning {
  background: #fffbec;
  border-left: 4px solid #d69e2e;
  color: #6b4c10;
}

.campai-notice-success {
  background: #f0fff4;
  border-left: 4px solid #38a169;
  color: #1a4731;
}

.campai-no-events {
  padding: 28px 20px;
  text-align: center;
  color: #888;
  font-size: 16px;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Event-Liste (Grid)
   -------------------------------------------------------------------------- */
.campai-events-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.campai-event-item {
  background: #ffffff;
  border: 1px solid #dcdfe4;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.campai-event-item:hover {
  box-shadow: 0 8px 28px rgba(0, 91, 170, 0.12);
  transform: translateY(-2px);
}

/* Bild */
.campai-event-image-wrapper {
  position: relative;
}

.campai-event-image-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.campai-event-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.campai-event-item:hover .campai-event-image {
  transform: scale(1.04);
}

/* Datums-Badge auf dem Bild */
.campai-event-date-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #005baa;
  color: #ffffff;
  border-radius: 8px;
  padding: 6px 10px;
  text-align: center;
  line-height: 1.1;
  min-width: 46px;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.campai-date-badge-day {
  display: block;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.campai-date-badge-month {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

/* Karteninhalt */
.campai-event-content {
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Kartentitel */
.campai-event-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.35;
  color: #171717;
}

.campai-event-title a {
  color: inherit;
  text-decoration: none;
}

.campai-event-title a:hover {
  color: #005baa;
  text-decoration: none;
}

/* Meta-Zeilen (Datum, Ort, Plätze) */
.campai-event-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 14px;
  color: #555;
  margin-bottom: 14px;
  line-height: 1.5;
}

.campai-event-date::before         { content: "\1F4C5\00a0"; }
.campai-event-location::before     { content: "\1F4CD\00a0"; }
.campai-event-availability::before { content: "\1F465\00a0"; }

/* Kurztext */
.campai-event-excerpt {
  font-size: 14px;
  color: #666;
  flex: 1;
  margin-bottom: 16px;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Tags
   -------------------------------------------------------------------------- */
.campai-event-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.campai-tag {
  display: inline-block;
  padding: 3px 11px;
  background: #e4ebf3;
  color: #005baa;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   Buttons (BSV-Stil: rounded-lg, semibold, uppercase)
   -------------------------------------------------------------------------- */
.campai-event-actions,
.campai-form-submit {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.campai-btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.2s ease, color 0.2s ease,
              border-color 0.2s ease, box-shadow 0.2s ease;
  line-height: 1.4;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  font-family: inherit;
}

/* Primär – BSV Blau, ausgefüllt */
.campai-btn-primary {
  background: #005baa;
  color: #ffffff;
  border-color: #005baa;
}

.campai-btn-primary:hover,
.campai-btn-primary:focus {
  background: #003e75;
  border-color: #003e75;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 91, 170, 0.3);
}

/* Sekundär – BSV Blau Outline */
.campai-btn-secondary {
  background: transparent;
  color: #005baa;
  border-color: #005baa;
}

.campai-btn-secondary:hover,
.campai-btn-secondary:focus {
  background: #e4ebf3;
  color: #003e75;
  border-color: #003e75;
}

/* Groß */
.campai-btn-large {
  padding: 12px 32px;
  font-size: 15px;
}

/* Deaktiviert */
.campai-btn-disabled {
  background: #c8cdd6;
  color: #ffffff;
  border-color: #c8cdd6;
  cursor: not-allowed;
  text-transform: uppercase;
}

.campai-btn[disabled],
.campai-btn.is-loading {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

/* Verfügbarkeits-Badges */
.campai-avail-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.campai-avail-ok {
  background: #e6f4ee;
  color: #276749;
}
.campai-avail-few {
  background: #fef3cd;
  color: #856404;
}
.campai-avail-soldout {
  background: #fde8e8;
  color: #9b1c1c;
}

/* --------------------------------------------------------------------------
   Einzelevent
   -------------------------------------------------------------------------- */
.campai-event-single {
  max-width: 860px;
  margin: 0 auto;
  font-size: 16px;
}

.campai-back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #005baa;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.campai-back-link:hover {
  color: #003e75;
  text-decoration: underline;
}

.campai-event-hero {
  margin: 20px 0 28px;
  border-radius: 10px;
  overflow: hidden;
}

.campai-event-hero-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Meta-Block */
.campai-event-meta-block {
  background: #e4ebf3;
  border: 1px solid #dcdfe4;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 28px;
}

.campai-meta-row {
  display: flex;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 91, 170, 0.12);
  font-size: 15px;
  line-height: 1.5;
}

.campai-meta-row:last-child  { border-bottom: none; padding-bottom: 0; }
.campai-meta-row:first-child { padding-top: 0; }

.campai-meta-label {
  font-weight: 700;
  color: #33335c;
  min-width: 150px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.campai-meta-value {
  color: #444;
  font-size: 15px;
}

/* Beschreibung */
.campai-event-description {
  margin-bottom: 32px;
  font-size: 16px;
  line-height: 1.7;
  color: #444;
}

/* Tarife */
.campai-event-rates {
  margin-bottom: 32px;
}

.campai-rates-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.campai-rate-item {
  background: #f5f5f5;
  border: 1px solid #dcdfe4;
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.campai-rate-name {
  font-weight: 700;
  font-size: 15px;
  color: #171717;
}

.campai-rate-desc {
  color: #666;
  font-size: 14px;
  width: 100%;
}

.campai-rate-price {
  margin-left: auto;
  font-weight: 700;
  font-size: 16px;
  color: #005baa;
}

/* --------------------------------------------------------------------------
   Buchungsformular
   -------------------------------------------------------------------------- */
.campai-booking-wrap {
  max-width: 700px;
  margin: 0 auto;
  font-size: 16px;
}

.campai-booking-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid #dcdfe4;
}

.campai-booking-title {
  font-size: 22px;
  font-weight: 700;
  margin: 8px 0 6px;
  color: #171717;
}

.campai-booking-date {
  color: #555;
  font-size: 15px;
  margin: 0;
}

.campai-booking-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Fieldset */
.campai-fieldset {
  border: 1px solid #dcdfe4;
  border-radius: 10px;
  padding: 22px 22px 18px;
  margin: 0;
  background: #f5f5f5;
}

.campai-fieldset legend {
  font-weight: 700;
  font-size: 13px;
  padding: 0 10px;
  color: #33335c;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Tarif-Optionen */
.campai-rate-option {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 6px;
  border: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.campai-rate-option:hover {
  background: #e4ebf3;
  border-color: #dcdfe4;
}

.campai-rate-option input[type="radio"] {
  margin: 0;
  accent-color: #005baa;
}

.campai-rate-option-name {
  font-weight: 700;
  font-size: 15px;
  color: #171717;
}

.campai-rate-option-desc {
  font-size: 13px;
  color: #666;
  width: 100%;
  padding-left: 22px;
}

.campai-rate-option-price {
  margin-left: auto;
  font-weight: 700;
  font-size: 16px;
  color: #005baa;
}

/* Formularzeilen */
.campai-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.campai-form-row:last-child { margin-bottom: 0; }

.campai-form-row--half {
  width: 48%;
  display: inline-flex;
  vertical-align: top;
}

.campai-form-row--half + .campai-form-row--half {
  margin-left: 4%;
}

.campai-form-row label {
  font-size: 14px;
  font-weight: 700;
  color: #33335c;
  letter-spacing: 0.02em;
}

/* Eingabefelder */
.campai-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #dcdfe4;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: #444;
  background: #ffffff;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.campai-input:focus {
  outline: none;
  border-color: #005baa;
  box-shadow: 0 0 0 3px rgba(0, 91, 170, 0.15);
}

.campai-textarea {
  resize: vertical;
  min-height: 90px;
}

.campai-required {
  color: #eb5757;
}

/* Checkbox */
.campai-checkbox-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.6;
  color: #444;
}

.campai-checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: #005baa;
}

/* Submit */
.campai-form-submit {
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Status / Responsive
   -------------------------------------------------------------------------- */
.campai-status-canceled .campai-event-item,
.campai-event-item.campai-status-canceled {
  opacity: 0.6;
}

@media (max-width: 540px) {
  .campai-events-items {
    grid-template-columns: 1fr;
  }
  .campai-form-row--half {
    width: 100%;
  }
  .campai-form-row--half + .campai-form-row--half {
    margin-left: 0;
  }
}

/* --------------------------------------------------------------------------
   Buchungs-Modal
   -------------------------------------------------------------------------- */

.campai-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
}

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

/* Scroll-Lock wenn Modal offen */
body.campai-modal-open {
  overflow: hidden;
}

.campai-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.campai-modal-dialog {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 32px;
}

/* iFrame-Variante: Header fix oben, Scroll-Wrapper nimmt restliche Höhe */
.campai-modal-dialog--iframe {
  padding: 0;
  display: flex;
  flex-direction: column;
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: hidden;
}

.campai-modal-iframe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 14px 24px;
  border-bottom: 1px solid #dcdfe4;
  flex-shrink: 0;
}

.campai-modal-iframe-title {
  font-size: 16px;
  font-weight: 600;
  color: #33335c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 12px;
}

/* Scrollbarer Wrapper: iFrame wächst auf Content-Höhe (via embeddable.js),
   dieser Container scrollt bei Bedarf */
.campai-modal-iframe-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  min-height: 300px;
}

.campai-booking-iframe {
  width: 100%;
  display: block;
  border: none;
  /* Keine height — embeddable.js setzt die Höhe automatisch per postMessage */
}

.campai-modal-close {
  position: sticky;
  top: 0;
  float: right;
  margin: -16px -16px 8px 8px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #444444;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

/* Im iFrame-Header: Close-Button ohne sticky */
.campai-modal-dialog--iframe .campai-modal-close {
  position: static;
  float: none;
  margin: 0;
  flex-shrink: 0;
}

.campai-modal-close:hover {
  background: #f0f0f0;
}

/* Im Modal: Booking-Header kompakter */
.campai-booking-header--modal {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dcdfe4;
}

.campai-booking-header--modal .campai-booking-title {
  font-size: 18px;
  margin: 0 0 4px;
}

.campai-booking-header--modal .campai-booking-date {
  font-size: 14px;
  color: #33335c;
  margin: 0;
}
