:root {
  --font-display:    Avenir, Montserrat, Corbel, 'URW Gothic', source-sans-pro, sans-serif;
  --color-nav:       #222;
  --color-border:    #ccc;
  --color-muted:     #555;
  --color-bg-subtle: #f0f0f0;
  --color-today:     #ff704d;
  --image-size-small: 200px;
}

body {
  max-width: 2400px; /* Prevents it from getting too wide */
  margin: 0 auto;    /* Centers horizontally */
  /*font-family: var(--font-display);*/
  /*font-family: Seravek, 'Gill Sans Nova', Ubuntu, Calibri, 'DejaVu Sans', source-sans-pro, sans-serif;*/
}

h1, h2, h3, h4 {
  font-family: system-ui, sans-serif;
}

:is(h1, h2, h3, h4) a {
  text-decoration: none;
  color: inherit;
}

section {
  margin-bottom: 1ex;
}

blockquote {
  margin: 0;
  padding: 0 1ex;
  border-left: thick solid black;
}

body > header {
  display: flex;
  flex-direction: column;
}

body > header nav {
  background-color: var(--color-nav);
  padding: 0.5rem 3rem;
}

body > header nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

body> header nav a {
  color: white;
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-weight: 600;
}

body > header nav a:hover {
  text-decoration: underline;
}

body > header nav a[aria-current="page"],
body > header nav a[aria-current="true"] {
  font-weight: 900;
}

body > header h1 {
  color: white;
  /* font-family: system-ui, sans-serif; */
  font-family: var(--font-display);
  padding: 0 3rem;
}

body > main {
  padding: 1.5rem 3rem;
}

body > footer {
  padding: 0 3rem;
}

body > footer::before {
  content: '';
  display: block;
  border-top: thin solid black;
}

table.bordered {
  border-collapse: separate;
  border-spacing: 0;
}

table.bordered th {
  text-align: left;
  padding: 1ex;
}

table.bordered td {
  border: thin solid black;
  padding: 1ex;
}

table.bordered tr:has(td) + tr td {
  border-top: none;
}

p.byline {
  font-size: smaller;
  font-style: italic;
}

article:not(:last-of-type) {
  border-bottom: thin solid grey;
}

@media screen {

  header .hero {
    background-image: url("/assets/backbay-pano-wide.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    height: 400px;

    display: flex;
    align-items: center;      /* vertical center */
    justify-content: center;  /* horizontal center */
  }

  header .hero--small {
    height: 200px;
  }

  body > header h1 {
    text-shadow: 2px 2px 8px black;
    font-weight: 900;
    font-size: 600%;
  }

  header .hero--small h1 {
    font-size: 600%;
  }

  .hero-logo {
    max-height: 80%;
    width: auto;
    filter: drop-shadow(2px 2px 8px black);
  }

}

.org-cover-image {
  height: var(--image-size-small);
}

/* Organization grid */
.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.org-card {
  border: thin solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.org-card-image {
  width: 100%;
  height: var(--image-size-small);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  padding-top: 0.5rem;
}

.org-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.org-card-body {
  padding: 1rem;
  flex: 1;
}

.org-card-body h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.org-card-link {
  text-decoration: none;
  color: inherit;
}

.org-card-link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.org-card-link:hover {
  text-decoration: underline;
}

.org-card-url {
  position: relative;
  z-index: 1;
}

.org-card-body p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.org-card-body .org-excerpt {
  color: var(--color-muted);
  margin-top: 0.5rem;
}

/* Net calendar */
#net-calendar {
  margin-bottom: 2rem;
}

.cal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.cal-month-label {
  font-weight: 700;
  font-size: 1.1rem;
  font-family: var(--font-display);
  min-width: 11em;
  text-align: center;
}

.cal-nav {
  background: var(--color-nav);
  color: white;
  border: none;
  padding: 0.2rem 0.6rem;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  border-radius: 3px;
}

.cal-nav:hover {
  background: #444;
}

.cal-subscribe {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--color-muted);
  text-decoration: none;
  border: thin solid var(--color-border);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}

.cal-subscribe:hover {
  color: var(--color-nav);
  border-color: #888;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-left: thin solid var(--color-border);
  border-top: thin solid var(--color-border);
}

.cal-dow {
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
  font-family: var(--font-display);
  padding: 0.3rem 0;
  background: var(--color-bg-subtle);
  border-right: thin solid var(--color-border);
  border-bottom: thin solid var(--color-border);
}

.cal-cell {
  min-height: 5rem;
  padding: 0.25rem;
  border-right: thin solid var(--color-border);
  border-bottom: thin solid var(--color-border);
}

.cal-cell--empty {
  background: #fafafa;
}

.cal-day-num {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 0.2rem;
  padding: 0 0.2rem;
}

.cal-cell--today .cal-day-num {
  color: black;
  background: var(--color-today);
}

.cal-pill {
  display: block;
  background: var(--color-bg-subtle);
  color: black;
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  margin-bottom: 0.15rem;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: system-ui, sans-serif;
}

.cal-pill:hover {
  background: lightblue;
}

/* Home page two-column layout */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2em;
  align-items: start;
}

.sidebar {
  border-left: 2px solid var(--color-border);
  padding-left: 1em;
}

.sidebar h2 {
  margin-top: 0;
}

@media screen and (max-width: 768px), print {
  .home-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-left: none;
    border-top: 2px solid var(--color-border);
    padding-left: 0;
    padding-top: 1em;
  }
}

@media screen and (max-width: 768px) {
  .hidden-sm {
    display: none;
  }

  /* Hero: stack logo above h1 and scale down */
  header .hero,
  header .hero--small {
    flex-direction: column;
    height: auto;
    min-height: 120px;
    padding: 1rem;
    gap: 0.5rem;
    text-align: center;
  }

  body > header h1 {
    font-size: 400%;
  }

  header .hero--small h1 {
    font-size: 400%;
  }

  .hero-logo {
    max-height: 60px;
    width: auto;
  }

  /* Nav: hamburger layout */
  body > header nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    padding: 0;
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.75rem 1rem;
    margin-left: auto;
  }

  .nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
  }

  body > header nav ul {
    display: none;
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 0.5rem 0;
  }

  body > header nav ul.open {
    display: flex;
  }

  body > header nav ul li a {
    display: block;
    padding: 0.5rem 1rem;
  }

  body > main {
    padding: 1.5rem 1rem;
  }

  body > footer {
    padding: 0 1rem;
  }
}

@media screen and (min-width: 768px) {
  .nav-toggle,
  .show-sm {
    display: none;
  }
}

@media print {
  body > header h1 {
    color: black;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  body > header nav, .noprint {
    display: none;
  }

  .org-grid {
    grid-template-columns: 1fr;
  }

  .org-card {
    border: none;
    border-radius: 0;
    break-inside: avoid;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .org-card-image {
    width: 1.5in;
    flex-shrink: 0;
    height: auto;
    background: none;
  }

  .org-card-image img {
    width: 100%;
    height: auto;
  }
}

.event-past {
  color: #999;
}

.event-past a {
  color: #999;
}
