/* The Cabin Center for Creativity and Discovery — thecabin518.org
   One page, one column, plain HTML. One typeface: Atkinson Hyperlegible. */

:root {
  --bg: #c8c4b4;        /* khaki, shown until the background photo loads */
  --paper: #fffef8;     /* the white column */
  --tint: #f6f3e6;      /* boxes inside the column */
  --ink: #1e1e1a;
  --muted: #55544c;
  --rule: #b9b3a0;
  --frame: #8f8a78;
  --green: #2f5d3a;
  --brown: #66482e;     /* earthy brown, same depth as the green and blue */
  --blue: #2c4870;
  --error: #b00000;     /* only for error messages and delete buttons, not decoration */
  --link: #1a3fa6;
  --visited: #5a2a82;
}

* { box-sizing: border-box; }


body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", Calibri, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

/* A random gallery photo behind the column (site.js sets --bg-photo).
   A fixed layer instead of background-attachment: fixed, which iPhones ignore. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg-photo, none) center / cover no-repeat;
}

button { font-family: inherit; }

#page {
  width: 760px;
  max-width: calc(100% - 32px);
  margin: 0 auto 40px;
  padding: 24px 36px 16px;
  background: var(--paper);
  border: 1px solid var(--frame);
  border-top: 0;
  box-shadow: 0 6px 1px var(--green);
}

a { color: var(--link); }
a:visited { color: var(--visited); }
a:hover { color: var(--brown); }

h1, h2, h3, h4 { line-height: 1.25; }

/* ---------- header: logo left, name right ---------- */

#header {
  display: flex;
  align-items: center;
  gap: 24px;
}

#logo {
  flex: none;
  display: block;
  width: 170px;
  height: auto;
  mix-blend-mode: multiply; /* the PNG has a white background */
}

#header .titles {
  flex: 1;
  text-align: center;
}

#header h1 {
  margin: 0 0 8px;
  font-size: 31px;
  font-weight: 700;
}

.where {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

/* ---------- nav: one plain bar of equal boxes ---------- */

#nav {
  display: flex;
  margin: 18px 0 8px;
  border: 2px solid var(--green);
}

#nav a,
#nav a:visited {
  flex: 1;
  padding: 8px 4px;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  color: var(--green);
  background: var(--tint);
}
#nav a + a { border-left: 2px solid var(--green); }
#nav a:hover,
#nav a:focus-visible {
  color: #fff;
  background: var(--green);
  outline: none;
}

/* ---------- sections ---------- */

.section {
  padding: 8px 0 4px;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 12px;
}

.section h2 {
  margin: 22px 0 10px;
  font-size: 28px;
  text-align: center;
}

.section h3 {
  margin: 24px 0 6px;
  font-size: 21px;
  color: var(--green);
  border-bottom: 1px dotted var(--rule);
}

.lede p { margin: 0 0 12px; }
.lede {
  font-size: 19px;
  text-align: center;
  margin: 8px 12px 18px;
}

.sig { text-align: right; font-style: italic; color: var(--muted); }

.totop {
  margin: 14px 0 8px;
  font-size: 14px;
  text-align: right;
}

.tba, .note { color: var(--muted); font-style: italic; }
.note { font-size: 15px; text-align: center; margin-top: 0; }

/* ---------- vision table ---------- */

table { border-collapse: collapse; width: 100%; }

.vision {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.vision-item {
  padding: 12px 14px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--tint);
}
.vision b { font-size: 18px; color: var(--brown); }
.vision p { margin: 4px 0 0; font-size: 16px; }

/* ---------- board ---------- */

.minutes {
  margin: 14px 0;
  padding: 10px 14px;
  background: var(--tint);
  border: 1px dashed var(--rule);
  text-align: center;
}

.member {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin: 18px 0 26px;
}
.member img {
  flex: none;
  width: 160px;
  height: auto;
  border: 1px solid var(--frame);
  padding: 4px;
  background: #fff;
}
.member h4 { margin: 0; font-size: 21px; }
.member .role {
  margin: 2px 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brown);
}
.member p { margin: 0 0 10px; }

/* ---------- schedule & contact tables ---------- */

.events th, .contact th {
  text-align: left;
  font-size: 15px;
  background: var(--blue);
  color: #fff;
  padding: 6px 10px;
}
.events td {
  padding: 10px;
  border: 1px solid var(--rule);
  vertical-align: top;
}
.events .date {
  width: 120px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- gallery ---------- */

.photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.photos a { cursor: zoom-in; }
.photos a:first-child { grid-column: 1 / -1; }
.photos img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--frame);
  padding: 4px;
  background: #fff;
}
.photos a:first-child img { aspect-ratio: 16 / 9; }
.photos a:hover img { border-color: var(--brown); }

/* ---------- lightbox ---------- */

#lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
#lightbox::backdrop { background: rgba(20, 20, 16, 0.88); }

.lb-frame {
  position: absolute;
  inset: 48px 64px 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-frame img {
  max-width: 100%;
  max-height: 100%;
  border: 6px solid var(--paper);
  box-shadow: 0 6px 1px var(--green);
  cursor: default;
}

.lb-caption {
  position: absolute;
  left: 64px;
  right: 64px;
  bottom: 16px;
  margin: 0;
  text-align: center;
  color: #eeeadb;
  font-size: 15px;
}

.lb-btn {
  position: absolute;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid var(--green);
  background: var(--paper);
  color: var(--green);
  font-size: 28px;
  font-weight: 700;
  line-height: 38px;
  cursor: pointer;
}
.lb-btn:hover { background: var(--green); color: #fff; }
.lb-prev  { left: 10px;  top: 50%; margin-top: -22px; }
.lb-next  { right: 10px; top: 50%; margin-top: -22px; }
.lb-close { right: 10px; top: 10px; }

/* ---------- contact ---------- */

.contact { width: auto; margin: 10px auto 24px; }
.contact th { width: 110px; }
.contact td {
  padding: 8px 14px;
  border: 1px solid var(--rule);
}

/* ---------- footer ---------- */

#footer {
  text-align: center;
  font-size: 15px;
  color: var(--muted);
}
#footer p { margin: 10px 0; }
.updated { font-size: 13px; }

/* ---------- blog ---------- */

.post-item { margin: 16px 0 22px; }
.post-item h3 { margin: 0; border: 0; font-size: 21px; }
.post-item h3 a, .post-item h3 a:visited { color: var(--green); }
.post-item p { margin: 4px 0 0; }
.post-date { margin: 2px 0 0; font-size: 15px; color: var(--muted); }
.more { text-align: center; font-weight: 700; }
.post-body h4 { font-size: 20px; margin: 22px 0 6px; color: var(--green); }
.post-photo img { display: block; max-width: 100%; height: auto; margin: 0 auto; border: 1px solid var(--frame); padding: 4px; background: #fff; }
.draft-note {
  margin: 14px 0 0;
  padding: 8px 12px;
  background: #fff3c4;
  border: 1px solid #c9a400;
  text-align: center;
  font-weight: 700;
}
.center { text-align: center; }

/* ---------- log in ---------- */

.login-form {
  max-width: 340px;
  margin: 26px auto 18px;
  padding: 18px 20px;
  background: var(--tint);
  border: 2px solid var(--green);
}
.login-form label { display: block; font-weight: 700; margin-bottom: 6px; }
.login-form input {
  display: block;
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  border: 1px solid var(--frame);
  background: #fff;
}
.login-form button {
  margin-top: 14px;
  width: 100%;
  padding: 9px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--green);
  border: 0;
  cursor: pointer;
}
.login-form button:hover { background: #23472c; }
.form-error { margin: 0 0 12px; color: var(--error); font-weight: 700; }
#page.login { margin-top: 0; }

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  body { font-size: 16px; }
  #page { padding: 18px 14px 12px; max-width: calc(100% - 20px); margin-bottom: 24px; }
  #header { flex-direction: column; gap: 6px; }
  #logo { width: 140px; }
  #header h1 { font-size: 23px; }
  #nav { flex-wrap: wrap; border-width: 2px 0 0 2px; }
  #nav a { flex: 1 1 33.33%; border: solid var(--green); border-width: 0 2px 2px 0; }
  #nav a + a { border-left: 0; }
  .lede { font-size: 17px; margin: 8px 0 16px; }
  .vision { grid-template-columns: 1fr; }
  .member { flex-direction: column; align-items: center; gap: 10px; }
  .member > div { width: 100%; }
  .member img { width: 200px; }
  .member h4, .member .role { text-align: center; }
  .events .date { width: auto; white-space: normal; }
  .photos { grid-template-columns: 1fr; }
  .lb-frame { inset: 60px 8px 70px; }
  .lb-prev, .lb-next { top: auto; bottom: 12px; margin: 0; }
  .lb-caption { bottom: 22px; font-size: 14px; }
}
