/* Events module — sits inside the site's own frame and stylesheet (css/styles.css). */
.ev {
  --ev-ink: #5a3528;
  --ev-muted: #9a7466;
  --ev-accent: #c0502f;
  --ev-line: #ecdccf;
  --ev-tint: #fbf3ec;
  color: var(--ev-ink);
  font-size: 15px;
  line-height: 1.55;
  padding: 4px 4px 24px;
}
.ev a { color: var(--ev-accent); }
.ev [hidden], .ev-lb[hidden], .ev-lb [hidden] { display: none !important; }

.ev-h2 { font-size: 17px; font-style: italic; color: var(--ev-accent); margin: 26px 0 10px; padding-bottom: 4px; border-bottom: 1px solid var(--ev-line); }
.ev-h2:first-child { margin-top: 6px; }
.ev-year { font-size: 15px; color: var(--ev-muted); margin: 18px 0 6px; font-weight: bold; }
.ev-count { font-size: 13px; color: var(--ev-muted); font-style: normal; font-weight: normal; }
.ev-empty { color: var(--ev-muted); font-style: italic; }
.ev-back { margin: 0 0 12px; display: flex; justify-content: space-between; gap: 10px; }
.ev-admin-links a { font-size: 12px; background: var(--ev-tint); border: 1px solid var(--ev-line); border-radius: 3px; padding: 2px 8px; text-decoration: none; }

/* list */
.ev-list { display: flex; flex-direction: column; }
.ev-item { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dotted var(--ev-line); text-decoration: none; color: var(--ev-ink) !important; }
.ev-item:hover .ev-item-title { text-decoration: underline; }
.ev-thumb { flex: 0 0 120px; height: 84px; background: var(--ev-tint) url(/images/design_05.gif) center no-repeat; border: 1px solid var(--ev-line); overflow: hidden; }
.ev-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ev-item-title { font-size: 15px; font-weight: bold; color: var(--ev-accent); }
.ev-item-meta { color: var(--ev-muted); }
.ev-item-tags { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ev-muted); }

.ev-badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 9px; background: #f4e1d4; color: var(--ev-accent); font-weight: bold; }
.ev-badge.now { background: #e1efd9; color: #3d6b2a; }
.ev-badge.draft { background: #eee; color: #777; }

/* single event */
.ev-title { font-size: 21px; font-style: italic; color: var(--ev-accent); margin: 0 0 4px; line-height: 1.25; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; color: var(--ev-muted); margin: 0 0 14px; }
.ev-date { font-weight: bold; color: var(--ev-ink); }
.ev-body p { margin: 0 0 10px; max-width: 70ch; }
.ev-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.ev-gallery a { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--ev-tint); }
.ev-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.ev-gallery a:hover img { transform: scale(1.04); }
.ev-gallery a:focus-visible { outline: 2px solid var(--ev-accent); outline-offset: 2px; }

/* photo viewer */
.ev-lb { position: fixed; inset: 0; z-index: 1000; background: rgba(30, 18, 12, .93); display: flex; align-items: center; justify-content: center; }
.ev-lb figure { margin: 0; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; }
.ev-lb img { max-width: 92vw; max-height: 84vh; object-fit: contain; box-shadow: 0 4px 30px rgba(0, 0, 0, .5); }
.ev-lb figcaption { color: #f1e6da; font-size: 14px; margin-top: 10px; text-align: center; max-width: 80ch; white-space: pre-wrap; }
.ev-lb button { position: absolute; background: none; border: 0; color: #f1e6da; font-size: 46px; line-height: 1; cursor: pointer; padding: 10px 16px; opacity: .8; }
.ev-lb button:hover, .ev-lb button:focus-visible { opacity: 1; }
.ev-lb-close { top: 6px; right: 10px; }
.ev-lb-prev { left: 6px; top: 50%; transform: translateY(-50%); }
.ev-lb-next { right: 6px; top: 50%; transform: translateY(-50%); }

/* admin */
.ev-adminbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.ev-adminbar a { padding: 3px 10px; border: 1px solid var(--ev-line); border-radius: 3px; background: var(--ev-tint); text-decoration: none; font-size: 13px; }
.ev-adminbar a.on { background: var(--ev-accent); color: #fff; border-color: var(--ev-accent); }
.ev-alert { background: #eef6e8; border: 1px solid #cfe3c2; padding: 8px 12px; border-radius: 3px; }
.ev-alert.err { background: #fbe9e4; border-color: #f0c6b8; }
.ev-form { display: flex; flex-direction: column; gap: 10px; }
.ev-form.narrow { max-width: 300px; }
.ev-form label { display: flex; flex-direction: column; gap: 3px; font-weight: bold; font-size: 13px; }
.ev-form label small { font-weight: normal; color: var(--ev-muted); }
.ev-form input:not([type=checkbox]):not([type=radio]):not([type=file]), .ev-form select, .ev-form textarea {
  font: inherit; font-weight: normal; color: var(--ev-ink); padding: 5px 7px; border: 1px solid #d9c3b3; border-radius: 3px; background: #fff; box-sizing: border-box; width: 100%;
}
.ev-form textarea { resize: vertical; }
.ev-form label.ev-check { flex-direction: row; align-items: center; gap: 6px; font-weight: normal; }
.ev-row { display: flex; gap: 12px; }
.ev-row > label { flex: 1; }
.ev-hint { font-size: 12px; color: var(--ev-muted); margin: -4px 0 0; }
.ev-actions { display: flex; gap: 14px; align-items: center; margin: 4px 0 0; }
.ev-btn { font: inherit; font-weight: bold; background: var(--ev-accent); color: #fff; border: 0; border-radius: 3px; padding: 6px 16px; cursor: pointer; }
.ev-btn:hover { background: #a7401f; }
.ev-btn.danger { background: #fff; color: #a33; border: 1px solid #e3b5b5; }

.ev-drop { border: 2px dashed #dcc2b0; border-radius: 4px; padding: 12px 14px; background: var(--ev-tint); margin-bottom: 14px; }
.ev-drop.over { border-color: var(--ev-accent); background: #f8e6da; }
.ev-drop p { margin: 0 0 6px; }
.ev-pick { color: var(--ev-accent); text-decoration: underline; cursor: pointer; }
.ev-queue { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.ev-q { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.ev-q .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-q .s { color: var(--ev-muted); flex-shrink: 0; }
.ev-q.ok .s img { height: 28px; display: block; }
.ev-q.err .s { color: #a33; flex-shrink: 1; text-align: right; }

.ev-photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ev-photo { border: 1px solid var(--ev-line); padding: 6px; display: flex; flex-direction: column; gap: 5px; background: #fff; }
.ev-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.ev-photo input[type=text], .ev-photo input:not([type]) { font-size: 12px !important; }
.ev-photo-tools { display: flex; gap: 6px; align-items: center; font-size: 12px; flex-wrap: wrap; }
.ev-photo-tools label { flex-direction: row !important; align-items: center; gap: 2px !important; font-weight: normal !important; font-size: 12px !important; }
.ev-photo-tools .del { color: #a33; margin-left: auto; }
.ev-photo-tools button { font: inherit; padding: 0 6px; border: 1px solid var(--ev-line); background: var(--ev-tint); border-radius: 3px; cursor: pointer; }

.ev-table { width: 100%; border-collapse: collapse; }
.ev-table th { text-align: left; font-size: 12px; color: var(--ev-muted); border-bottom: 1px solid var(--ev-line); padding: 4px 6px; }
.ev-table td { border-bottom: 1px dotted var(--ev-line); padding: 6px; vertical-align: top; }
.ev-table td small { display: block; color: var(--ev-muted); }
.ev-table tr.draft td { opacity: .65; }
.nowrap { white-space: nowrap; }

@media (max-width: 720px) {
  .ev-row { flex-direction: column; gap: 10px; }
  .ev-thumb { flex-basis: 90px; height: 66px; }
}
@media (prefers-reduced-motion: reduce) { .ev-gallery img { transition: none; } }
@media print { .noprint { display: none; } }
