/* Palette sampled from the club logo. */
:root {
  --navy: #223242;
  --rust: #96512d;
  --gold: #c38f45;
  --olive: #626142;
  --cream: #eadcc6;
  --paper: #faf6ee;
  --text: #1e2a36;
  --radius: 10px;
  --max-width: 60rem;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--rust);
}

h1,
h2,
h3 {
  color: var(--navy);
  line-height: 1.2;
}

.site-header {
  background: var(--navy);
  color: var(--cream);
  border-bottom: 6px solid var(--gold);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  color: var(--cream);
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 700;
}

.brand img {
  width: 64px;
  height: 64px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  list-style: none;
}

.tabs a {
  display: block;
  padding: 0.6rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--cream);
  text-decoration: none;
  font-weight: 600;
}

.tabs a:hover {
  background: var(--olive);
}

.tabs a[aria-current='page'] {
  background: var(--gold);
  color: var(--navy);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.site-footer {
  background: var(--navy);
  color: var(--cream);
  text-align: center;
  padding: 1rem;
}

.hero {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.hero img {
  width: 260px;
  flex-shrink: 0;
}

.hero h1 + p {
  font-size: 1.2rem;
}

.card {
  background: #fff;
  border-left: 6px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.5rem 1.25rem;
  margin: 1.5rem 0;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
}

.grid .card {
  margin: 0;
}

.button {
  display: inline-block;
  margin: 0.25rem 0.5rem 0.25rem 0;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  background: var(--rust);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.button.secondary {
  background: var(--navy);
}

/* Marks content still to be written; remove the class once real content is in. */
.placeholder {
  background: #fff4d6;
  border: 2px dashed var(--gold);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-style: italic;
}

@media (max-width: 640px) {
  .brand {
    font-size: 1.1rem;
  }

  .brand img {
    width: 48px;
    height: 48px;
  }

  /* Tabs become a 2x2 grid of buttons so all four fit without a menu toggle. */
  .tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    padding-bottom: 0.5rem;
  }

  .tabs a {
    border-radius: var(--radius);
    text-align: center;
    padding: 0.5rem 0.25rem;
    font-size: 0.9rem;
  }

  .hero {
    flex-direction: column;
    text-align: center;
  }

  .hero img {
    width: 200px;
  }
}

/* Address beside the map; wraps to map-below-address on narrow screens. */
.location {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 2rem;
}

.map {
  width: 20rem;
  max-width: 100%;
  margin: 0;
}

.map img {
  display: block;
  border-radius: var(--radius);
}

.map figcaption {
  font-size: 0.5rem;
  text-align: center;
  color: var(--olive);
}

.map figcaption a {
  color: inherit;
}

.social-icon {
  width: 1.6em;
  height: 1.6em;
  margin-right: 0.3rem;
  vertical-align: middle;
}

.upcoming {
  list-style: none;
  padding: 0;
}

.upcoming li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--cream);
}

.upcoming li:last-child {
  border-bottom: 0;
}

.upcoming-when {
  font-weight: 700;
  margin-right: 0.5rem;
}

.upcoming-time {
  color: var(--olive);
}

.upcoming .upcoming-events {
  list-style: none;
  padding: 0;
  margin: 0.3rem 0 0;
}

.upcoming .upcoming-events li {
  width: fit-content;
  margin: 0.25rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 2rem;
  font-size: 0.9em;
  color: var(--event-text, inherit);
}

/* The summary carries the pill's padding so the whole pill toggles it. space-between keeps the image at the
   right edge while a closing pill is still wider than its contents (toggle-details-on-click.ts relies on it). */
.upcoming .upcoming-events summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.8rem;
  cursor: pointer;
  list-style: none;
}

/* Safari ignores list-style: none on summary. */
.upcoming .upcoming-events summary::-webkit-details-marker {
  display: none;
}

.upcoming .upcoming-events summary img {
  height: 3em;
  width: auto;
}

.upcoming .upcoming-events details p {
  margin: 0;
  padding: 0 0.8rem 0.6rem;
}

/* Open, the image floats out of the summary so the name and the description both flow to its left,
   as on the Meetups page. flow-root on the details itself (not the li) makes the float part of its height,
   which toggle-details-on-click.ts measures and animates. */
.upcoming .upcoming-events details[open] {
  display: flow-root;
  cursor: pointer;
}

/* The closed pill centres a one-line name against its 3em image; the extra top padding keeps the name there. */
.upcoming .upcoming-events details[open] > summary {
  display: block;
  padding-top: calc(0.2rem + (3em - 1lh) / 2);
}

.upcoming .upcoming-events details[open] > summary img {
  float: right;
  width: 8rem;
  max-width: 40%;
  height: auto;
  margin: 0.4rem 0 0.6rem 1rem;
}

/* AIDEV-NOTE: --event-text is set inline from an event's text-color (render-meetups.ts eventStyle). */
.special-event {
  display: flow-root;
  color: var(--event-text, inherit);
  margin: 0.75rem 0;
  padding: 0.25rem 1rem 0.5rem;
  border: 1px solid var(--cream);
  border-radius: var(--radius);
}

.special-event h3 {
  margin-bottom: 0.25rem;
  color: var(--event-text, var(--navy));
}

.special-event-dates {
  margin-top: 0;
  font-weight: 700;
  color: var(--event-text, var(--olive));
}

.special-event img {
  float: right;
  width: 8rem;
  max-width: 40%;
  height: auto;
  margin: 0.75rem 0 0.5rem 1rem;
}
