/* Base styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #222;
  background: #fafafa;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid #444;
  outline-offset: 4px;
}

/* Persistent navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #d5d5d5;
}

.navbar {
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.app-name {
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-box,
.interests summary {
  padding: 0.6rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.profile-box {
  background: #f3f3f3;
}

/* Native details provides keyboard-accessible dropdown behavior. */
.interests {
  position: relative;
}

.interests summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.interests summary::-webkit-details-marker {
  display: none;
}

.interests summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 180ms ease;
}

.interests[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.interests-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 230px;
  padding: 1rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.interests fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.interests legend {
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.interests label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  cursor: pointer;
}

.interests input {
  width: 1rem;
  height: 1rem;
  accent-color: #444;
}

/* Home screen */
.home {
  max-width: 1300px;
  margin: 0 auto;
  width: 88%;
  padding: 4rem 1.5rem;
  text-align: center;
}

h1 {
  max-width: 760px;
  margin: 0 auto 1rem;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
}

.intro {
  margin: 0 0 3rem;
  color: #555;
  font-size: 1.125rem;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.meeting-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.meeting-card {
  position: relative;
  padding: 2rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  min-height: 220px;
  transition: background-color 200ms ease;
}

.meeting-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.meeting-card p {
  margin: 0;
  color: #555;
  font-weight: 400;
  transition: color 200ms ease;
}

/* Stretch the native button's click target over its entire card. */
.meeting-card button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.meeting-card button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
}

.meeting-card button:focus-visible {
  outline: none;
}

.meeting-card button:focus-visible::after {
  outline: 3px solid #444;
  outline-offset: 4px;
}

.meeting-card--upcoming:hover,
.meeting-card--upcoming:focus-within {
  background-color: #e8eeea;
}

.meeting-card--past:hover,
.meeting-card--past:focus-within {
  background-color: #eeebe6;
}

/* Both weights share a fixed word-sized grid cell, including while invisible. */
.weight-word {
  display: inline-grid;
  vertical-align: baseline;
  white-space: nowrap;
}

.weight-word > span {
  grid-area: 1 / 1;
  transition: opacity 200ms ease;
}

.weight-regular {
  font-weight: 400;
}

.weight-bold {
  font-weight: 700;
}

.meeting-card h3 .weight-regular,
.meeting-card p .weight-bold,
.meeting-card:is(:hover, :focus-within) h3 .weight-bold,
.meeting-card:is(:hover, :focus-within) p .weight-regular {
  opacity: 0;
}

.meeting-card:is(:hover, :focus-within) h3 .weight-regular,
.meeting-card:is(:hover, :focus-within) p .weight-bold {
  opacity: 1;
}

.meeting-card:is(:hover, :focus-within) p {
  color: #222;
}

.location-context {
  margin: 1.5rem 0 0;
  color: #666;
  font-size: 0.875rem;
}

.text-control {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-underline-offset: 3px;
}

.text-control:hover,
.text-control:focus-visible {
  text-decoration: underline;
}

.change-location {
  margin-left: 0.5rem;
}

/* Normal document flow keeps this utility from covering content on small screens. */
.language-selector {
  margin-top: auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.4rem;
  color: #555;
  font-size: 0.875rem;
}

.language-option[aria-current="true"] {
  font-weight: 700;
  color: #222;
}

.language-divider {
  color: #777;
}

/* Upcoming meetings: separate styles leave the home cards unchanged. */
.upcoming-screen {
  max-width: 1300px;
  width: 88%;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.upcoming-screen h1 {
  margin-left: 0;
}

.upcoming-intro {
  margin: 1rem 0;
  color: #555;
}

.sample-notice {
  color: #666;
  font-size: 0.875rem;
  margin: 0 0 2rem;
}

.upcoming-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.upcoming-row {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 2rem;
  padding: 1.75rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: #222;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.upcoming-row::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 0.4rem;
  height: 0.4rem;
  border-top: 1px solid #666;
  border-right: 1px solid #666;
  transform: translateY(-50%) rotate(45deg);
}

.meeting-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  margin-top: 2rem;
  color: #666;
}

.page-control {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  min-width: 2rem;
  min-height: 44px;
  padding: 0.25rem;
  cursor: pointer;
}

.page-control[aria-current="page"] {
  font-weight: 700;
  color: #222;
}

.page-control:enabled:hover,
.page-control:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.page-control:disabled {
  color: #aaa;
  cursor: default;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.upcoming-row:hover,
.upcoming-row:focus-visible {
  background: #f2f5f3;
  border-color: #89958c;
}

.upcoming-date,
.upcoming-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.upcoming-date span:first-child {
  font-weight: 700;
}

.upcoming-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.upcoming-board,
.upcoming-preview,
.upcoming-categories {
  color: #555;
}

.upcoming-board,
.upcoming-categories,
.upcoming-count,
.interest-match {
  font-size: 0.875rem;
}

.interest-match {
  padding: 0.25rem 0.5rem;
  background: #e8eeea;
  color: #34483a;
  border-radius: 4px;
}

/* Meeting detail: editorial agenda rows, without card boxes or badges. */
.meeting-detail {
  max-width: 1300px;
  width: 88%;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.meeting-back {
  color: #555;
  margin-bottom: 2rem;
  font-size: 0.875rem;
}

.meeting-detail h1 {
  margin-left: 0;
}

.meeting-detail-header {
  max-width: 850px;
  margin-bottom: 3rem;
}

.detail-meta,
.detail-preview {
  color: #555;
  margin: 1rem 0;
}

.agenda-item {
  margin: 0;
}

.agenda-summary {
  position: relative;
  padding: 1.75rem 2rem 1.75rem 0;
  list-style: none;
  cursor: pointer;
  transition: background-color 180ms ease;
}

.agenda-summary::-webkit-details-marker {
  display: none;
}

.agenda-summary:hover,
.agenda-summary:focus-visible {
  background: #f2f5f3;
}

.agenda-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.agenda-summary::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 0.4rem;
  height: 0.4rem;
  border-bottom: 1px solid #666;
  border-right: 1px solid #666;
  transform: rotate(45deg);
  pointer-events: none;
  transition: transform 180ms ease;
}

.agenda-item[open] > .agenda-summary::after {
  transform: rotate(225deg);
}

.agenda-expanded {
  max-width: 800px;
  padding: 0 0 1.75rem;
  color: #555;
  line-height: 1.7;
}

.agenda-expanded h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #444;
}

.agenda-expanded p {
  margin: 0 0 1rem;
}

.agenda-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 1.5rem 0 0.75rem;
}

.agenda-action {
  display: inline-block;
  padding: 0.3rem 0;
  border: 0;
  background: none;
  color: #333;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: #aaa;
  text-underline-offset: 4px;
  cursor: pointer;
}

.agenda-action:hover,
.agenda-action:focus-visible {
  text-decoration-color: currentColor;
}

.agenda-action-note {
  font-size: 0.825rem;
  color: #666;
  overflow-wrap: anywhere;
}

.agenda-action:disabled {
  color: #777;
  cursor: default;
  text-decoration: none;
}

.agenda-question {
  margin-top: 1.25rem;
}

.agenda-question label {
  display: block;
  margin-bottom: 0.5rem;
}

.agenda-question textarea {
  display: block;
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  color: #222;
  font: inherit;
  resize: vertical;
}

.agenda-subtitle {
  margin: 0 0 1rem;
  color: #666;
  font-size: 0.95rem;
}

.agenda-description {
  max-width: 800px;
  margin: 0;
  line-height: 1.7;
}

.agenda-divider {
  margin: 1.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid #ddd;
  color: #666;
  font-size: 0.875rem;
}

@media (prefers-reduced-motion: reduce) {
  .agenda-summary,
  .agenda-summary::after,
  .upcoming-row,
  .interests summary::after,
  .meeting-card,
  .weight-word > span,
  .meeting-card p {
    transition: none;
  }
}

/* Stack cards and give navigation room on smaller screens. */
@media (max-width: 600px) {
  .navbar {
    padding: 1rem;
  }

  .nav-controls {
    width: 100%;
    justify-content: space-between;
  }

  .interests-panel {
    right: auto;
    left: 0;
    max-width: calc(100vw - 2rem);
  }

  .home,
  .meeting-detail,
  .upcoming-screen {
    padding: 2.5rem 1rem;
  }

  .meeting-options {
    grid-template-columns: 1fr;
  }

  .upcoming-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem;
  }
}
