/* =============================================
   Eventfoto Gallery – Frontend CSS v2
   4 Spalten, kompakte Karten, saubere Galerie
   ============================================= */

:root {
  --efg-primary:    #c0392b;
  --efg-primary-dk: #922b21;
  --efg-dark:       #1a1a1a;
  --efg-mid:        #555;
  --efg-muted:      #888;
  --efg-light:      #f7f7f7;
  --efg-border:     #e0e0e0;
  --efg-white:      #ffffff;
  --efg-radius:     8px;
  --efg-shadow:     0 2px 10px rgba(0,0,0,.10);
  --efg-shadow-hover: 0 6px 22px rgba(0,0,0,.16);
  --efg-transition: .2s ease;
}
*, *::before, *::after { box-sizing: border-box; }

/* Buttons */
.efg-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.1rem; border-radius: var(--efg-radius);
  font-size: .85rem; font-weight: 600; cursor: pointer;
  text-decoration: none; border: 2px solid transparent;
  transition: all var(--efg-transition); line-height: 1;
}
.efg-btn-primary  { background: var(--efg-primary); color: #fff; }
.efg-btn-primary:hover { background: var(--efg-primary-dk); color: #fff; }
.efg-btn-outline  { background: transparent; border-color: var(--efg-primary); color: var(--efg-primary); }
.efg-btn-outline:hover { background: var(--efg-primary); color: #fff; }
.efg-btn-ghost    { background: transparent; border-color: var(--efg-border); color: var(--efg-mid); }
.efg-btn-ghost:hover { border-color: var(--efg-primary); color: var(--efg-primary); }

/* ─── OVERVIEW ─────────────────────────────── */
.efg-overview-wrap { max-width: 100%; }
.efg-overview-title { font-size: 1.4rem; font-weight: 700; margin: 0 0 1.25rem; color: var(--efg-dark); }

/* Filter bar */
.efg-filter-bar {
  background: var(--efg-light); border: 1px solid var(--efg-border);
  border-radius: var(--efg-radius); padding: 1rem 1.2rem; margin-bottom: 1.5rem;
}
.efg-filter-row {
  display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: .75rem; align-items: end;
}
.efg-filter-field label {
  display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--efg-muted); margin-bottom: .3rem;
}
.efg-filter-field input,
.efg-filter-field select {
  width: 100%; padding: .48rem .75rem;
  border: 1px solid var(--efg-border); border-radius: 6px;
  font-size: .85rem; background: #fff; color: var(--efg-dark);
  transition: border-color var(--efg-transition);
}
.efg-filter-field input:focus,
.efg-filter-field select:focus { outline: none; border-color: var(--efg-primary); }

/* Tags */
.efg-tag-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.efg-tag {
  padding: .22rem .65rem; border: 1px solid var(--efg-border);
  border-radius: 99px; font-size: .72rem; font-weight: 600;
  color: var(--efg-mid); text-decoration: none; transition: all var(--efg-transition);
}
.efg-tag:hover, .efg-tag.active { background: var(--efg-primary); color: #fff; border-color: var(--efg-primary); }

/* ─── EVENT GRID ───────────────────────────── */
.efg-events-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin-bottom: 2rem;
}
.efg-no-events { grid-column: 1/-1; text-align: center; padding: 3rem; color: var(--efg-muted); }

/* ─── EVENT CARD ───────────────────────────── */
.efg-event-card {
  background: #fff; border-radius: var(--efg-radius);
  box-shadow: var(--efg-shadow); overflow: hidden;
  transition: transform var(--efg-transition), box-shadow var(--efg-transition);
  cursor: pointer; display: flex; flex-direction: column;
}
.efg-event-card:hover {
  transform: translateY(-3px); box-shadow: var(--efg-shadow-hover);
}
.efg-card-thumb {
  display: block; position: relative; aspect-ratio: 4/3; overflow: hidden; background: #e8e8e8;
  text-decoration: none;
}
.efg-card-thumb img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease;
}
.efg-event-card:hover .efg-card-thumb img { transform: scale(1.05); }
.efg-card-no-img {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #ccc;
}
.efg-card-count {
  position: absolute; bottom: .4rem; left: .4rem;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: .68rem; font-weight: 700; padding: .15rem .5rem; border-radius: 99px;
}
.efg-card-body { padding: .65rem .8rem .8rem; flex: 1; display: flex; flex-direction: column; gap: .45rem; }
.efg-card-title {
  font-size: .875rem; font-weight: 700; line-height: 1.35; color: var(--efg-dark); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-decoration: none;
}
.efg-card-title:hover { color: var(--efg-primary); }
a.efg-card-title { text-decoration: none; }
.efg-card-meta { display: flex; flex-direction: column; gap: .18rem; }
.efg-card-meta-item {
  display: flex; align-items: center; gap: .3rem;
  font-size: .72rem; color: var(--efg-muted); line-height: 1.2;
}
.efg-card-meta-item svg { flex-shrink: 0; width: 12px; height: 12px; }
.efg-card-meta-item svg path { fill: var(--efg-primary); }

/* Load more */
.efg-load-more-wrap { text-align: center; padding: .5rem 0 2rem; }

/* ─── SINGLE EVENT ─────────────────────────── */
.efg-single-wrap { max-width: 100%; }

.efg-back-bar { padding: .75rem 0 1rem; border-bottom: 1px solid var(--efg-border); margin-bottom: 1.5rem; }
.efg-back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .875rem; font-weight: 600; color: var(--efg-primary); text-decoration: none;
}
.efg-back-link:hover { text-decoration: underline; }
.efg-back-link svg path { fill: var(--efg-primary); }

.efg-single-title { font-size: 1.6rem; font-weight: 800; color: var(--efg-dark); margin: 0 0 .75rem; }

.efg-single-meta { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 1.25rem; }
.efg-single-meta-item {
  display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--efg-mid);
}
.efg-single-meta-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.efg-single-meta-item svg path { fill: var(--efg-primary); }
.efg-single-meta-item strong { color: var(--efg-dark); font-weight: 600; }

.efg-single-share-bar {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .85rem 0; border-top: 1px solid var(--efg-border);
  border-bottom: 1px solid var(--efg-border); margin-bottom: 1.75rem;
}
.efg-single-share-label { font-size: .75rem; font-weight: 700; color: var(--efg-muted); text-transform: uppercase; letter-spacing: .05em; margin-right: .25rem; }
.efg-share-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .85rem; border-radius: 99px; font-size: .78rem; font-weight: 600;
  text-decoration: none; transition: opacity var(--efg-transition); border: none; cursor: pointer;
}
.efg-share-pill:hover { opacity: .85; }
.efg-share-pill.fb { background: #1877F2; color: #fff; }
.efg-share-pill.wa { background: #25D366; color: #fff; }
.efg-share-pill.tw { background: #000; color: #fff; }
.efg-share-pill.lk { background: var(--efg-light); color: var(--efg-dark); border: 1px solid var(--efg-border); }
.efg-share-pill svg { width: 14px; height: 14px; }
.efg-share-pill svg path { fill: currentColor; }

/* ─── PHOTO GRID ───────────────────────────── */
.efg-gallery-wrap { }
.efg-gallery-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem;
}
.efg-gallery-count-label { font-size: .875rem; color: var(--efg-muted); font-weight: 600; }

.efg-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
}
.efg-photo-item {
  position: relative; aspect-ratio: 4/3; overflow: hidden;
  border-radius: 6px; background: #e8e8e8; cursor: pointer;
}
.efg-photo-item img {
  width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease;
}
.efg-photo-item:hover img { transform: scale(1.05); }

.efg-photo-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.42);
  opacity: 0; transition: opacity var(--efg-transition);
  display: flex; align-items: flex-end; justify-content: flex-end; padding: .45rem; gap: .3rem;
}
.efg-photo-item:hover .efg-photo-overlay { opacity: 1; }

.efg-photo-btn {
  width: 2rem; height: 2rem; border-radius: 6px;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.2); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; transition: background var(--efg-transition);
  flex-shrink: 0; position: relative;
  font-size: 1rem; line-height: 1; font-weight: 700;
}
.efg-photo-btn:hover { background: rgba(0,0,0,.8); }

/* Share popup per photo */
.efg-photo-share-wrap { position: relative; }
.efg-photo-share-pop {
  display: none; position: absolute; bottom: calc(100% + .4rem); right: 0;
  background: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.25);
  min-width: 160px; overflow: hidden; z-index: 20;
}
.efg-photo-share-pop a {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .9rem; font-size: .82rem; color: #333;
  text-decoration: none; transition: background var(--efg-transition);
  white-space: nowrap;
}
.efg-photo-share-pop a:hover { background: var(--efg-light); }
.efg-photo-share-wrap.open .efg-photo-share-pop { display: block; }
.efg-share-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 4px;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.efg-share-icon-fb { background: #1877F2; color: #fff; }
.efg-share-icon-wa { background: #25D366; color: #fff; font-size: 1rem; width: 18px; height: 18px; }

.efg-gallery-more-wrap { text-align: center; margin-top: 1.5rem; }

/* Password */
.efg-password-box {
  max-width: 400px; margin: 2rem auto; padding: 2.5rem;
  background: #fff; border-radius: var(--efg-radius); box-shadow: var(--efg-shadow); text-align: center;
}
.efg-password-box h3 { font-size: 1.2rem; margin: .6rem 0 .4rem; }
.efg-password-box p  { color: var(--efg-muted); margin-bottom: 1.25rem; }
.efg-pw-error { color: var(--efg-primary); font-size: .85rem; font-weight: 600; }
.efg-password-box input[type="password"] {
  width: 100%; padding: .6rem 1rem; border: 1px solid var(--efg-border);
  border-radius: 6px; font-size: .95rem; margin-bottom: .75rem;
}

/* ─── LIGHTBOX ─────────────────────────────── */
#efg-lightbox {
  position: fixed; inset: 0; z-index: 99999;
  display: none;
  align-items: center; justify-content: center; flex-direction: column;
}
#efg-lb-bg { position: absolute; inset: 0; background: rgba(0,0,0,.93); cursor: pointer; }
#efg-lb-inner {
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center;
  max-width: 92vw;
}
#efg-lb-img-wrap {
  position: relative; min-width: 200px; min-height: 150px;
  display: flex; align-items: center; justify-content: center;
}
#efg-lb-img {
  display: block; max-width: 86vw; max-height: 78vh;
  border-radius: 4px; object-fit: contain; transition: opacity .18s;
}
#efg-lb-spin {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 34px; height: 34px;
  border: 3px solid rgba(255,255,255,.15); border-top-color: #fff;
  border-radius: 50%; animation: efg-spin .65s linear infinite; display: none;
}
@keyframes efg-spin { to { transform: translate(-50%,-50%) rotate(360deg); } }
#efg-lb-prev, #efg-lb-next {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 3rem; height: 3rem; border-radius: 50%;
  background: rgba(255,255,255,.15); border: none; color: #fff;
  font-size: 2.2rem; line-height: 1; cursor: pointer; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, opacity .2s; user-select: none;
}
#efg-lb-prev { left: 1.25rem; }
#efg-lb-next { right: 1.25rem; }
#efg-lb-prev:hover, #efg-lb-next:hover { background: rgba(255,255,255,.3); }
#efg-lb-close {
  position: fixed; top: 1rem; right: 1rem;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: rgba(255,255,255,.15); border: none; color: #fff;
  font-size: 1.5rem; cursor: pointer; z-index: 4;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
#efg-lb-close:hover { background: rgba(255,255,255,.3); }
#efg-lb-bar {
  display: flex; align-items: center; gap: .6rem;
  margin-top: .65rem; flex-wrap: wrap; justify-content: center; z-index: 2;
}
#efg-lb-counter { font-size: .78rem; color: rgba(255,255,255,.55); min-width: 3rem; text-align: center; }
#efg-lb-bar a, #efg-lb-bar button {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .7rem; border-radius: 99px;
  background: rgba(255,255,255,.12); border: none; color: rgba(255,255,255,.8);
  font-size: .75rem; cursor: pointer; text-decoration: none;
  transition: background .2s; white-space: nowrap;
}
#efg-lb-bar a:hover, #efg-lb-bar button:hover { background: rgba(255,255,255,.25); color: #fff; }

/* ─── RESPONSIVE ───────────────────────────── */
@media (max-width: 1100px) {
  .efg-events-grid { grid-template-columns: repeat(3, 1fr); }
  .efg-photo-grid  { grid-template-columns: repeat(3, 1fr); }
  .efg-filter-row  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .efg-events-grid { grid-template-columns: repeat(2, 1fr); }
  .efg-photo-grid  { grid-template-columns: repeat(2, 1fr); }
  .efg-filter-row  { grid-template-columns: 1fr; }
  .efg-single-title { font-size: 1.3rem; }
}
@media (max-width: 480px) {
  .efg-events-grid { grid-template-columns: repeat(2, 1fr); gap: .65rem; }
  .efg-photo-grid  { grid-template-columns: repeat(2, 1fr); gap: .35rem; }
  .efg-lb-arrow    { display: none; }
}

/* ─── DARK MODE ────────────────────────────── */
.efg-dark {
  --efg-dark:    #f0f0f0;
  --efg-mid:     #b0b0b0;
  --efg-muted:   #888;
  --efg-light:   #1e1e1e;
  --efg-border:  #333;
  --efg-white:   #121212;
}
.efg-dark body,
.efg-dark .efg-single-wrap,
.efg-dark .efg-overview-wrap { background: #121212; color: #e0e0e0; }
.efg-dark .efg-event-card,
.efg-dark .efg-filter-bar,
.efg-dark .efg-order-form { background: #1e1e1e !important; border-color: #333 !important; }
.efg-dark .efg-card-title   { color: #e0e0e0 !important; }
.efg-dark .efg-photo-share-pop { background: #2a2a2a; }
.efg-dark .efg-photo-share-pop a { color: #ddd; }
.efg-dark .efg-photo-share-pop a:hover { background: #333; }
.efg-dark .efg-filter-field input,
.efg-dark .efg-filter-field select { background: #2a2a2a; color: #ddd; border-color: #444; }
.efg-dark .efg-tag  { border-color: #444; color: #aaa; }
.efg-dark .efg-tag.active { background: var(--efg-primary); color: #fff; }
.efg-dark .efg-back-link { color: #ff6b6b; }
.efg-dark .efg-single-share-bar { border-color: #333; }
.efg-dark .efg-share-pill.lk { background: #2a2a2a; color: #ddd; border-color: #444; }
.efg-dark .efg-order-fields input,
.efg-dark .efg-order-fields textarea { background: #2a2a2a; color: #ddd; border-color: #444; }
.efg-dark .efg-order-basket-bar { background: #1e1e1e; border-color: #333; }
.efg-dark .efg-btn-ghost { color: #aaa; border-color: #444; }
.efg-dark .efg-btn-ghost:hover { border-color: #ff6b6b; color: #ff6b6b; }
.efg-dark .efg-single-title,
.efg-dark .efg-overview-title { color: #e0e0e0; }
.efg-dark .efg-card-meta-item { color: #888; }

/* Dark mode toggle button */
.efg-darkmode-toggle {
  background: none; border: 1px solid var(--efg-border);
  border-radius: 99px; padding: .3rem .7rem;
  cursor: pointer; font-size: 1.1rem; line-height: 1;
  transition: all var(--efg-transition); color: var(--efg-mid);
}
.efg-darkmode-toggle:hover { border-color: var(--efg-primary); }
.efg-back-bar { display: flex; align-items: center; justify-content: space-between; }

/* ─── ORDER SECTION ────────────────────────── */
.efg-order-section {
  margin-top: 2.5rem; padding-top: 2rem;
  border-top: 2px solid var(--efg-border);
}
.efg-order-title { font-size: 1.3rem; font-weight: 700; margin: 0 0 .5rem; color: var(--efg-dark); }
.efg-order-intro { color: var(--efg-muted); margin-bottom: 1.25rem; }

#efg-order-basket-bar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: var(--efg-light); padding: .85rem 1.1rem;
  border-radius: var(--efg-radius); margin-bottom: 1.25rem;
  border: 1px solid var(--efg-border);
}
#efg-order-count-label { font-weight: 600; flex: 1; }

.efg-order-form {
  background: var(--efg-white); border: 1px solid var(--efg-border);
  border-radius: var(--efg-radius); padding: 1.5rem;
  box-shadow: var(--efg-shadow); max-width: 700px;
}
.efg-order-form h3 { margin: 0 0 1rem; font-size: 1.1rem; }

.efg-order-preview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: .4rem; margin-bottom: 1.25rem;
}
.efg-order-preview-thumb {
  position: relative; aspect-ratio: 1; border-radius: 5px; overflow: hidden;
  border: 2px solid var(--efg-primary);
}
.efg-order-preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.efg-order-preview-thumb button {
  position: absolute; top: 2px; right: 2px;
  background: rgba(192,57,43,.85); color: #fff; border: none;
  border-radius: 50%; width: 18px; height: 18px; font-size: .7rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1;
}

.efg-order-fields {
  display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; margin-bottom: 1rem;
}
.efg-order-field-full { grid-column: 1 / -1; }
.efg-order-field label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: .3rem; color: var(--efg-mid); }
.efg-order-field input,
.efg-order-field textarea {
  width: 100%; padding: .5rem .75rem; border: 1px solid var(--efg-border);
  border-radius: 6px; font-size: .875rem; font-family: inherit;
  transition: border-color var(--efg-transition);
}
.efg-order-field input:focus,
.efg-order-field textarea:focus { outline: none; border-color: var(--efg-primary); }

.efg-order-error   { background: #fdf0f0; border: 1px solid #e74c3c; border-radius: 6px; padding: .65rem 1rem; color: #c0392b; font-size: .85rem; margin-bottom: .75rem; }
.efg-order-success { background: #f0fdf4; border: 1px solid #27ae60; border-radius: 6px; padding: .65rem 1rem; color: #27ae60; font-size: .875rem; }

/* Favourite / order button on photos */
.efg-fav-btn {
  width: 2rem; height: 2rem; border-radius: 6px;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.2); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .95rem; line-height: 1;
  transition: background var(--efg-transition);
}
.efg-fav-btn:hover,
.efg-fav-btn.selected { background: var(--efg-primary); border-color: var(--efg-primary); }

@media (max-width: 600px) {
  .efg-order-fields { grid-template-columns: 1fr; }
}

/* ─── QR CODE POPUP ────────────────────────── */
#efg-qr-popup {
  position: fixed; inset: 0; z-index: 999999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.7);
}
#efg-qr-popup-inner {
  background: #fff; border-radius: 14px;
  padding: 2rem 2rem 1.5rem;
  text-align: center; max-width: 320px; width: 90%;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,.4);
  animation: efg-qr-in .2s ease;
}
@keyframes efg-qr-in {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
#efg-qr-close {
  position: absolute; top: .75rem; right: .75rem;
  background: #eee; border: none; border-radius: 50%;
  width: 2rem; height: 2rem; font-size: 1.2rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#efg-qr-close:hover { background: #ddd; }
#efg-qr-label {
  font-size: .875rem; color: #555; margin: 0 0 1.1rem; font-weight: 600;
}
#efg-qr-canvas {
  display: flex; justify-content: center; margin-bottom: .75rem;
}
#efg-qr-canvas canvas,
#efg-qr-canvas img { border-radius: 6px; }
#efg-qr-url-text {
  font-size: .68rem; color: #aaa; word-break: break-all;
  margin: 0 0 .75rem; max-height: 2.5em; overflow: hidden;
}
.efg-qr-action-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .4rem .85rem; border-radius: 99px; font-size: .78rem;
  background: #f0f0f0; border: none; color: #333;
  cursor: pointer; text-decoration: none; font-weight: 600;
  transition: background .15s;
}
.efg-qr-action-btn:hover { background: #e0e0e0; color: #111; }
a.efg-qr-action-btn { color: #333; }

/* Dark mode QR popup */
.efg-dark #efg-qr-popup-inner { background: #1e1e1e; }
.efg-dark #efg-qr-label { color: #bbb; }
.efg-dark #efg-qr-close { background: #333; color: #ddd; }
.efg-dark #efg-qr-close:hover { background: #444; }
.efg-dark .efg-qr-action-btn { background: #2a2a2a; color: #ddd; }
.efg-dark .efg-qr-action-btn:hover { background: #333; }
.efg-dark a.efg-qr-action-btn { color: #ddd; }

/* QR button in lightbox bar */
#efg-lb-qr-btn {
  background: rgba(255,255,255,.12); border: none; color: rgba(255,255,255,.8);
  font-size: .75rem; padding: .3rem .7rem; border-radius: 99px;
  cursor: pointer; transition: background .15s; white-space: nowrap;
}
#efg-lb-qr-btn:hover { background: rgba(255,255,255,.25); color: #fff; }
