/* Events preview — additive styles only. Live styles.css is unchanged. */

/* Headings and prose already use text-wrap: pretty in styles.css.
   Reinforce it on event-specific blocks and keep a sensible measure. */
.event-card h3,
.event-card p,
.event-card-date,
.event-detail-copy p,
.event-meta,
.event-pager,
.preview-banner,
.admin-note,
.event-thanks p,
.rsvp-block p,
.event-ended p {
  text-wrap: pretty;
}

.hero-live-events {
  background-image: url("../assets/photos/live/AdobeStock_219643557v2.jpg");
  background-position: center center;
  background-size: cover;
}
.hero-live-events.page-hero--tinted {
  background-image:
    linear-gradient(rgba(0,40,60,0.28), rgba(0,40,60,0.12)),
    url("../assets/photos/live/AdobeStock_219643557v2.jpg");
}
.hero-live-events.page-hero--tinted::after {
  background: linear-gradient(90deg, rgba(0,40,60,0.22), rgba(0,40,60,0.05));
}
.hero-live-events .hero-brand--with-title .hero-page-title {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.45), 0 1px 2px rgba(0,0,0,0.35);
}
@media (max-width: 1024px) {
  .hero-live-events { background-position: center center; }
}
@media (max-width: 720px) {
  .hero-live-events {
    background-position: center center;
    min-height: 280px;
  }
}

.preview-banner {
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 0.9rem;
  text-align: center;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
}
.preview-banner p {
  margin: 0 auto;
  max-width: 46rem;
}

.events-intro {
  margin: 0 0 1.75rem;
  max-width: none;
  width: 100%;
}

.sample-flag {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal);
  font-weight: 600;
  margin: 0 0 0.4rem;
}

.event-card-date {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  margin: 0 0 0.45rem;
}

.event-card-placeholder {
  width: 100%;
  height: 180px;
  background-color: var(--teal);
  background-image: url("../assets/pattern.jpg");
  background-repeat: repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px 4px 0 0;
}
.event-card-placeholder img {
  height: 44px;
  width: auto;
  max-width: 70%;
}

/* Event photos: fit the full image in a fixed-height media box (no crop).
   Overrides styles.css .blog-card img { object-fit: cover; height: 180px }. */
.event-card > img,
.blog-card.event-card > img {
  width: 100%;
  height: 180px;
  max-height: 180px;
  object-fit: contain;
  object-position: center center;
  background-color: #f3f5f6;
  background-image: none;
  border-radius: 4px 4px 0 0;
}

.event-meta {
  color: var(--muted);
  margin: 0 0 1.25rem;
  max-width: none;
  width: 100%;
}
.event-meta span {
  display: block;
  margin: 0 0 0.15rem;
}

.event-detail-photo {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 540px;
  object-fit: contain;
  object-position: center center;
  border-radius: 6px;
  margin: 0 0 1.35rem;
  background: var(--offwhite, #f3f5f6);
}

.event-detail-copy,
.event-detail-copy.content-copy {
  max-width: none;
  width: 100%;
  margin: 0 0 2rem;
}

.event-ended,
.event-thanks,
.rsvp-off-note {
  background: var(--offwhite);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.15rem 1.25rem;
  margin: 0 0 1.5rem;
  max-width: none;
  width: 100%;
}
.event-thanks h2,
.rsvp-block h2 {
  margin-top: 0;
}
.rsvp-block {
  max-width: none;
  width: 100%;
  margin: 0 0 2rem;
}
.rsvp-block .form-grid {
  margin-top: 1rem;
}

.archive-link-row {
  margin: 2.5rem 0 0;
  text-align: center;
}

.event-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: center;
  margin: 2.5rem 0 0;
}
.event-pager .is-disabled {
  color: var(--muted);
  pointer-events: none;
  text-decoration: none;
  opacity: 0.65;
}

/* Native form controls not listed in styles.css */
input[type="password"],
input[type="time"] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  background: #f3f5f6;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  min-height: 44px;
}

/* Admin */
.admin-shell {
  background: var(--offwhite);
  min-height: 100vh;
}
.admin-bar {
  background-color: var(--teal);
  background-image: url("../assets/pattern.jpg");
  background-repeat: repeat;
  color: #fff;
}
.admin-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 0;
  min-height: 72px;
}
.admin-bar .logo-link img {
  height: 44px;
  width: auto;
}
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.admin-nav a {
  color: #fff;
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius);
}
.admin-nav a:hover,
.admin-nav a[aria-current="page"] {
  background: #fff;
  color: var(--teal);
  text-decoration: none;
}

.admin-wrap {
  padding: 2.25rem 0 3.5rem;
}
.admin-note {
  background: var(--teal-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  margin: 0 0 1.5rem;
  color: var(--teal-dark);
  max-width: none;
  width: 100%;
}

.admin-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,40,60,0.04);
  padding: 1.5rem 1.35rem 1.6rem;
  margin: 0 0 1.5rem;
}

.login-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
}
.login-card {
  max-width: 26rem;
  margin: 2.5rem auto;
  width: 100%;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 0 1.25rem;
}

.event-table-wrap {
  overflow-x: auto;
}
.event-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.event-table th,
.event-table td {
  text-align: left;
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.event-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
.event-table .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  white-space: normal;
}
.event-table .row-actions a,
.event-table .row-actions button {
  font-size: 0.85rem;
}

.status-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--teal-light);
  color: var(--teal-dark);
}
.status-pill.is-off {
  background: #eee;
  color: var(--muted);
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0.35rem 0 1rem;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  font-weight: 500;
}
.toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.toggle-ui {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #c5d0d5;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}
.toggle-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-ui {
  background: var(--teal);
}
.toggle input:checked + .toggle-ui::after {
  transform: translateX(20px);
}
.toggle input:focus-visible + .toggle-ui {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.photo-preview {
  margin-top: 0.75rem;
  max-width: 20rem;
  background: var(--offwhite, #f3f5f6);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.photo-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  object-position: center center;
  border-radius: 6px;
}
.photo-preview[hidden] { display: none; }

.admin-form-banner {
  background: var(--teal-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  margin: 0 0 1.15rem;
  color: var(--teal-dark);
}
.admin-form-banner[hidden] { display: none; }

@media (max-width: 720px) {
  .event-card-placeholder { height: 220px; }
  .event-card > img,
  .blog-card.event-card > img {
    height: 220px;
    max-height: 220px;
    object-fit: contain;
    object-position: center center;
  }
  .admin-bar-inner { padding: 0.7rem 0; }

  /* Stack admin tables into cards so phones do not need sideways scrolling. */
  .event-table-wrap {
    overflow: visible;
  }
  .event-table,
  .event-table thead,
  .event-table tbody,
  .event-table th,
  .event-table td,
  .event-table tr {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .event-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .event-table tr {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin: 0 0 0.85rem;
    padding: 0.7rem 0.85rem 0.75rem;
  }
  .event-table td {
    border-bottom: 0;
    padding: 0.28rem 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 0.85rem;
  }
  .event-table td + td {
    border-top: 1px solid var(--border);
    padding-top: 0.45rem;
    margin-top: 0.2rem;
  }
  .event-table td::before {
    content: attr(data-label);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 600;
    flex: 0 0 auto;
  }
  .event-table td.row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.4rem 0.5rem;
    padding-top: 0.65rem;
  }
  .event-table td.row-actions::before {
    flex-basis: 100%;
    margin-bottom: 0.15rem;
  }
}

/* Hero "Events" label can be a <p> on detail pages; keep the same look as the h1. */
.hero-live-events .hero-brand--with-title .hero-page-title {
  font-family: var(--font-serif);
  font-weight: 400;
}
/* Event title is the page's single h1, styled like the previous h2. */
h1.event-page-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.45rem, 2.6vw, 2.1rem);
  color: var(--teal);
  line-height: 1.25;
  margin: 0 0 0.6em;
  text-wrap: pretty;
}

/* Shared description typography (editor preview + public event page) */
.event-detail-copy,
.tpl-editor-surface {
  color: var(--text);
}
.event-detail-copy ul,
.event-detail-copy ol,
.tpl-editor-surface ul,
.tpl-editor-surface ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}
.event-detail-copy li,
.tpl-editor-surface li {
  margin: 0 0 0.35rem;
  text-wrap: pretty;
}
.event-detail-copy blockquote,
.tpl-editor-surface blockquote {
  margin: 0 0 1rem 0;
  padding: 0 0 0 1.15rem;
  border-left: 3px solid var(--border);
  color: inherit;
}
.event-detail-copy a,
.tpl-editor-surface a {
  color: var(--teal);
  text-decoration: underline;
}
.event-detail-copy h2,
.tpl-editor-surface h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.45rem, 2.6vw, 2.1rem);
  color: var(--teal);
  line-height: 1.25;
  margin: 0 0 0.55em;
  text-wrap: pretty;
}
.event-detail-copy h3,
.tpl-editor-surface h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--teal);
  line-height: 1.3;
  margin: 0.85em 0 0.4em;
  text-wrap: pretty;
}
.tpl-color-dark-blue { color: #004a66; }
.tpl-color-light-blue { color: #005F80; }
.tpl-color-black { color: #222222; }
.tpl-color-gray { color: #555555; }

/* Admin WYSIWYG */
.tpl-editor {
  max-width: 100%;
}
.tpl-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.45rem;
  max-width: 100%;
}
.tpl-ed-sep {
  display: inline-block;
  width: 1px;
  height: 1.35rem;
  background: var(--border);
  margin: 0 0.15rem;
}
.tpl-ed-btn {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
  color: var(--teal);
  background: #fff;
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  padding: 0.45rem 0.6rem;
  min-height: 36px;
  cursor: pointer;
}
.tpl-ed-btn:hover,
.tpl-ed-btn.is-active {
  background: var(--teal);
  color: #fff;
}
.tpl-ed-btn strong,
.tpl-ed-btn em {
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
}
.tpl-ed-swatches {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}
.tpl-ed-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
  background: #222;
}
.tpl-ed-swatch[data-color="tpl-color-dark-blue"] { background: #004a66; }
.tpl-ed-swatch[data-color="tpl-color-light-blue"] { background: #005F80; }
.tpl-ed-swatch[data-color="tpl-color-black"] { background: #222222; }
.tpl-ed-swatch[data-color="tpl-color-gray"] { background: #555555; }
.tpl-ed-swatch:hover,
.tpl-ed-swatch.is-active {
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--teal);
}
.tpl-editor-linkbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  align-items: center;
  margin: 0 0 0.45rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--offwhite);
}
.tpl-editor-linkbar[hidden] { display: none; }
.tpl-editor-linkbar label {
  margin: 0;
  font-size: 0.82rem;
}
.tpl-editor-linkbar input {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 36px;
}
.tpl-editor-surface {
  min-height: 12rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  background: #f3f5f6;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  box-sizing: border-box;
}
.tpl-editor-surface:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  background: #fff;
}
.tpl-editor-surface[hidden] { display: none; }
.tpl-editor.is-enhanced .tpl-editor-input { display: none; }
.tpl-editor-toolbar[hidden] { display: none; }
@media (max-width: 720px) {
  .tpl-editor-toolbar {
    overflow: visible;
  }
  .tpl-ed-sep { display: none; }
}


/* Events body copy uses the full .container width on desktop.
   Overrides the site-wide 40rem / 34rem measures in styles.css for events pages only.
   Selectors must match or beat .section .container > p and .content-copy > p. */
.section .container > p.events-intro,
.section .container > p.event-meta,
.section .container > p.admin-note,
.section .container > p.event-ended,
.section .container > p.event-thanks,
.section .container > p.rsvp-off-note,
.section .container > .events-intro,
.section .container > .event-meta,
.section .container > .admin-note,
.section .container > .event-ended,
.section .container > .event-thanks,
.section .container > .rsvp-off-note,
.section .container > .event-detail-copy,
.section .container > .rsvp-block,
.events-intro,
.event-meta,
.event-detail-copy,
.event-detail-copy.content-copy,
.event-detail-copy p,
.event-detail-copy.content-copy > p,
.event-detail-copy ul,
.event-detail-copy ol,
.event-detail-copy li,
.event-detail-copy blockquote,
.event-ended,
.event-thanks,
.rsvp-off-note,
.rsvp-block,
.admin-note,
.admin-wrap .admin-note,
.admin-wrap .admin-card,
.admin-wrap .form-note,
.admin-wrap .form-grid .form-note,
.form-grid .tpl-editor,
.form-grid .tpl-editor-surface,
.tpl-editor,
.tpl-editor-surface {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}
.form-grid .tpl-editor,
.form-grid > .tpl-editor,
.form-grid .full .tpl-editor {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
}
/* Login box stays compact and centered. */
.login-card,
.admin-wrap .login-card {
  max-width: 26rem;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Match <p class="full"> vertical rhythm now that Description/Photo use div.full.form-field. */
.form-grid > .full.form-field,
.form-grid .form-field {
  margin: 0 0 1rem;
  min-width: 0;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  grid-column: 1 / -1;
}

.admin-wrap .form-note,
.form-grid .form-field .form-note,
.form-grid .form-note {
  display: block;
  width: 100%;
  max-width: none;
}
