*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f6f7f9;
}

/* Visible keyboard focus indicator for all interactive elements. Uses
   :where() so its specificity is 0 and component-specific focus styles
   (e.g. .event-card__calendar-link) can still override it. The blue ring
   stays visible on both the light page and the dark-green header. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #0f3d3a;
  color: #fff;
}

.site-header a {
  color: #e8f5f2;
  text-decoration: none;
  margin-left: 1rem;
}

.site-header a:hover {
  text-decoration: underline;
}

.logo {
  font-weight: 700;
  margin-left: 0 !important;
}

main {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

main:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: #0f3d3a;
  color: #fff;
  border-radius: 0 0 6px 0;
  transform: translateY(-110%);
  transition: transform 0.15s ease-in-out;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-footer {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  color: #555;
  border-top: 1px solid #ddd;
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.message {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.message-success {
  background: #e6f4ea;
  color: #1e5f32;
}

.message-error {
  background: #fce8e6;
  color: #8a1c13;
}

.message-info {
  background: #e8f0fe;
  color: #174ea6;
}

.event-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.event-list li {
  margin-bottom: 0.75rem;
}

.event-cards .event-card {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.event-card--upcoming {
  border-left: 4px solid #0f3d3a;
}

.event-card--past {
  border-left: 4px solid #aaa;
}

.event-card__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.event-card__title-row .event-card__title {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.event-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.event-card__title a {
  color: #0f3d3a;
  text-decoration: none;
}

.event-card__title a:hover {
  text-decoration: underline;
}

.event-card__calendar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.event-card__calendar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0.2rem 0.35rem;
  color: #555;
  text-decoration: none;
  border-radius: 4px;
}

.event-card__calendar-link:hover,
.event-card__calendar-link:focus-visible {
  color: #0f3d3a;
  background: #e8f5f2;
  outline: none;
}

.event-card__calendar-link--google {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
}

.event-card__calendar-icon {
  display: block;
}

.event-card__highlight {
  margin: 0 0 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: #1f2937;
}

.event-card__preview {
  margin: 0 0 0.5rem;
  color: #333;
}

.event-card__more {
  display: inline-block;
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 1rem 0 0.5rem;
  line-height: 1.25;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre {
  margin: 0 0 0.75rem;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.5rem;
}

.markdown-body blockquote {
  margin-left: 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 3px solid #ccc;
  color: #555;
}

.markdown-body code {
  padding: 0.1rem 0.3rem;
  background: #f2f2f2;
  border-radius: 3px;
  font-size: 0.9em;
}

.markdown-body pre {
  padding: 0.75rem 1rem;
  background: #f2f2f2;
  border-radius: 4px;
  overflow-x: auto;
}

.markdown-body pre code {
  padding: 0;
  background: none;
}

.event-card__capacity {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: #444;
}

.event-badge {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #0f3d3a;
  background: #e8f5f2;
  border-radius: 4px;
}

.past-events {
  margin-top: 2rem;
}

.past-events summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.5rem 0;
}

.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.account-actions {
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
}

.account-actions h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.account-action-form {
  margin: 0.75rem 0;
}

.account-delete-confirm {
  margin-top: 0.75rem;
}

.home-page .lead {
  font-size: 1.1rem;
  color: #333;
}

.site-footer p {
  margin: 0.35rem 0;
}

@media (max-width: 640px) {
  .event-cards .event-card {
    padding: 1.1rem 1rem;
    margin-bottom: 1.5rem;
  }

  .event-card__title a {
    display: inline-block;
    padding: 0.15rem 0;
  }

  .calendar-actions .btn {
    width: 100%;
    text-align: center;
  }
}

.meta {
  display: block;
  font-size: 0.875rem;
  color: #555;
}

.muted {
  opacity: 0.85;
}

.empty {
  color: #666;
}

.btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  background: #0f3d3a;
  color: #fff !important;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
}

.btn.secondary {
  background: #555;
}

.btn.small {
  font-size: 0.875rem;
  padding: 0.25rem 0.6rem;
}

.stack-form p {
  margin-bottom: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.data-table th,
.data-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.body {
  margin: 1rem 0;
}

.capacity {
  font-size: 0.9rem;
  color: #444;
}

.warn {
  color: #b06000;
}

.rsvp-form input[type="text"] {
  width: 100%;
  max-width: 28rem;
  margin-bottom: 0.5rem;
}

.email {
  font-weight: 600;
  margin-bottom: 1rem;
}

.profile-photo {
  max-width: 12rem;
  height: auto;
  border-radius: 8px;
}

.member-profile h2 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.profile-form fieldset {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.profile-form legend {
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0 0.5rem;
}

.profile-form label {
  display: block;
  margin-bottom: 0.35rem;
}

.profile-form input[type="text"],
.profile-form input[type="email"],
.profile-form input[type="url"],
.profile-form textarea {
  width: 100%;
  max-width: 100%;
}

.field-help {
  display: block;
  color: #495057;
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.photo-preview {
  display: block;
  max-width: 10rem;
  height: auto;
  border-radius: 6px;
  margin-top: 0.35rem;
}
