/* ------------------------------------------------------------------ */
/* Open House — GeoCities aesthetic, modern sensibilities             */
/* Lo-fi, personal, self-contained (no webfonts, no images).          */
/* ------------------------------------------------------------------ */

:root {
  color-scheme: light dark;
  --bg: #fdf6e3;
  --bg-2: #f6ecd0;
  --fg: #2b2622;
  --muted: #5a5248;
  --accent: #b5533c;
  --accent-2: #2d6a4f;
  --card: #fffdf7;
  --border: #2b2622;
  --border-soft: #cbb994;
  --link-visited: #7c4dae;
  --shadow: rgba(43, 38, 34, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14100b;
    --bg-2: #1c1610;
    --fg: #d9f7d3;
    --muted: #9fbf99;
    --accent: #ff9f6e;
    --accent-2: #6fe3a8;
    --card: #1a1410;
    --border: #d9f7d3;
    --border-soft: #4d4030;
    --link-visited: #d99fff;
    --shadow: rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--bg);
  background-image: repeating-linear-gradient(
    45deg,
    var(--bg-2) 0px,
    var(--bg-2) 2px,
    var(--bg) 2px,
    var(--bg) 26px
  );
  color: var(--fg);
  font-family: "Courier New", Courier, "Lucida Console", monospace;
  line-height: 1.6;
  margin: 0;
  padding: 0 1rem 4rem;
}

h1, h2, h3 {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  line-height: 1.2;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

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

a:hover { color: var(--accent-2); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

main {
  max-width: 700px;
  margin: 0 auto;
}

header.site {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 0 1rem;
  text-align: center;
}

header.site h1 {
  font-size: 2rem;
  margin: 0 0 0.4rem;
}

header.site h1 a {
  text-decoration: none;
  color: inherit;
}

header.site p {
  color: var(--muted);
  margin: 0;
}

.divider {
  text-align: center;
  color: var(--muted);
  letter-spacing: 0.4rem;
  margin: 1.5rem 0;
  font-size: 1.1rem;
}

.card {
  background: var(--card);
  border: 2px solid var(--border);
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.event-image {
  display: block;
  max-width: 100%;
  height: auto;
  border: 2px solid var(--border);
  box-shadow: 4px 4px 0 var(--shadow);
  margin: 0.75rem 0 1rem;
}

.link-preview-mock-thumb {
  width: 100%;
  height: 9rem;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border-soft);
}

.crop-tool { margin-top: 0.6rem; }
.crop-tool canvas {
  max-width: 100%;
  border: 1px solid var(--border-soft);
  cursor: crosshair;
  touch-action: none;
}
.crop-tool-actions {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}
.crop-tool-actions button { width: auto; }
.image-current {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}
.image-current img {
  max-width: 10rem;
  max-height: 6rem;
  border: 1px solid var(--border-soft);
}

.event-list { list-style: none; padding: 0; margin: 0; }
.event-list li {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border-soft);
}
.event-list li:last-child { border-bottom: none; }

.event-list a.title {
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
}

.event-list a.title:hover { border-bottom-color: var(--accent-2); }

.meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.cal-links { display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; align-items: center; }

.badge {
  display: inline-block;
  background: var(--bg-2);
  color: var(--fg);
  border: 1px solid var(--border-soft);
  padding: 0.1rem 0.6rem;
  font-size: 0.8rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.badge.new {
  background: var(--accent-2);
  color: var(--bg);
  border-color: var(--accent-2);
  font-weight: 700;
  animation: sparkle 2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .badge.new { animation: none; }
}

@keyframes sparkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.canceled { color: var(--accent); font-weight: 700; }
.badge.canceled { border-color: var(--accent); }

form.stacked label {
  display: block;
  margin-top: 0.9rem;
  font-weight: 700;
  font-size: 0.9rem;
}

input[type=text],
input[type=email],
input[type=number],
input[type=datetime-local],
textarea,
select {
  background-color: var(--card);
  color: var(--fg);
  border: 2px solid var(--border);
}

form.stacked input[type=text],
form.stacked input[type=email],
form.stacked input[type=number],
form.stacked input[type=datetime-local],
form.stacked textarea,
form.stacked select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  margin-top: 0.25rem;
  border: 2px solid var(--border);
  background-color: var(--card);
  color: var(--fg);
  font-size: 1rem;
  font-family: inherit;
}

form.stacked textarea { min-height: 6rem; }

button, input[type=submit] {
  background: var(--accent);
  color: var(--card);
  border: 2px outset var(--accent);
  padding: 0.6rem 1.1rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1.1rem;
}

button:active, input[type=submit]:active {
  border-style: inset;
}

button.secondary, .btn-secondary {
  background: var(--bg-2);
  color: var(--fg);
  border: 2px outset var(--border-soft);
}

button.danger { background: #a33; border-color: #a33; color: #fff; }

table {
  border-collapse: collapse;
  width: 100%;
  background: var(--card);
  border: 2px solid var(--border);
}
table th, table td {
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px dashed var(--border-soft);
}
table th {
  background: var(--bg-2);
  border-bottom: 2px solid var(--border);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
}

/* The link-preview mock imitates a chat app's unfurl card, so its colors
   are fixed and deliberately ignore both the site theme and dark mode -
   it should look the same no matter what the page around it does. */
.link-preview-mock {
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  max-width: 28rem;
  overflow: hidden;
  background: #ffffff;
  color: #1d1c1d;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}
.link-preview-mock-body { padding: 0.6rem 0.8rem; }
.link-preview-mock-title { font-weight: 700; color: #1264a3; }
.link-preview-mock-desc {
  color: #454245;
  font-size: 0.9rem;
  margin-top: 0.15rem;
  max-height: 2.6em;
  overflow: hidden;
}
.link-preview-mock-url {
  color: #737173;
  font-size: 0.78rem;
  text-transform: uppercase;
  margin-top: 0.35rem;
}

nav.admin {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 0;
}

/* On themed admin pages (live theme preview) the nav sits on the tiled
   background, so give it the same solid card backing as everything else. */
body[class^="theme-"] nav.admin {
  background: var(--card);
  border: 2px solid var(--border);
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.attendee-list { list-style: none; padding: 0; }
.attendee-list li { padding: 0.25rem 0; border-bottom: 1px dotted var(--border-soft); }
.attendee-list li:last-child { border-bottom: none; }

.subscribe-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: stretch; }
.subscribe-form button { margin-top: 0; padding: 0.4rem 0.9rem; font-size: 0.9rem; }

/* Quieter treatment for the homepage subscribe box - it's a sidebar-ish
   utility, not the main event, so no hard shadow / heavy border / big serif. */
.subscribe-card {
  border: 1px solid var(--border-soft);
  box-shadow: none;
  padding: 0.9rem 1.1rem;
}
.subscribe-card h2 {
  font-family: inherit;
  font-size: 0.95rem;
  margin: 0 0 0.2rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.subscribe-card .meta { margin: 0 0 0.6rem; font-size: 0.85rem; }
.subscribe-card input[type=email] { padding: 0.4rem 0.5rem; font-size: 0.9rem; }
.subscribe-form input[type=email] {
  flex: 1;
  min-width: 12rem;
  padding: 0.5rem 0.6rem;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
}

.flash {
  background: var(--accent-2);
  color: var(--bg);
  border: 2px solid var(--border);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.draft-banner {
  background: var(--bg-2);
  color: var(--accent);
  border: 2px dashed var(--accent);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

footer.site {
  max-width: 700px;
  margin: 2.5rem auto 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.retro-footer {
  margin-top: 0.75rem;
  font-style: italic;
}

.badges {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.badges img { image-rendering: pixelated; }

/* ------------------------------------------------------------------ */
/* Per-event themes                                                    */
/* Each theme reskins the event page: tiled background, card colors,  */
/* headings/links, and a divider. Homepage never gets a theme class.  */
/* ------------------------------------------------------------------ */

/* Themed pages tile a busy background behind everything, so the header and
   footer need the same solid "card" treatment as content cards - otherwise
   text renders directly on the tile and is unreadable. */
body[class^="theme-"] header.site {
  border: 2px solid var(--border);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem auto;
}
/* On themed (event) pages the footer is just the badge GIFs, which are
   opaque images that read fine on any tile - no backing strip needed.
   The ornamental divider only makes sense on an open background. */
body[class^="theme-"] footer.site .divider { display: none; }
body[class^="theme-"] footer.site p { margin: 0.3rem 0; }

body.theme-red-sauce {
  --card: #fbf3df;
  --fg: #3a2620;
  --border: #6e1712;
  --muted: #6e4a3a;
  --accent: #942d22;
  color-scheme: light;
  background-color: #7a1712;
  background-image: url("/static/tiles/red-sauce.png");
  background-repeat: repeat;
  image-rendering: pixelated;
  color: #3a2620;
}
body.theme-red-sauce .card,
body.theme-red-sauce header.site {
  background: #fbf3df;
  border-color: #6e1712;
  box-shadow: 4px 4px 0 rgba(60, 10, 8, 0.55);
  color: #3a2620;
}
body.theme-red-sauce h1 a,
body.theme-red-sauce h2,
body.theme-red-sauce h3 { color: #942d22; }
body.theme-red-sauce a { color: #942d22; }
body.theme-red-sauce a:hover { color: #6e1712; }
body.theme-red-sauce .divider { color: #fbf3df; }
body.theme-red-sauce header.site p,
body.theme-red-sauce footer.site,
body.theme-red-sauce .meta { color: #6e4a3a; }

body.theme-sunny-side {
  --card: #fffaf0;
  --fg: #5a3a12;
  --border: #96602a;
  --muted: #6b4415;
  --accent: #96470f;
  color-scheme: light;
  background-color: #f7d158;
  background-image: url("/static/tiles/sunny-side.png");
  background-repeat: repeat;
  image-rendering: pixelated;
  color: #5a3a12;
}
body.theme-sunny-side .card,
body.theme-sunny-side header.site {
  background: #fffaf0;
  border-color: #96602a;
  box-shadow: 4px 4px 0 rgba(90, 58, 18, 0.4);
  color: #5a3a12;
}
body.theme-sunny-side h1 a,
body.theme-sunny-side h2,
body.theme-sunny-side h3 { color: #96470f; }
body.theme-sunny-side a { color: #96470f; }
body.theme-sunny-side a:hover { color: #7a3f10; }
body.theme-sunny-side .divider { color: #7a3f10; }
body.theme-sunny-side header.site p,
body.theme-sunny-side footer.site,
body.theme-sunny-side .meta { color: #6b4415; }

body.theme-game-night {
  --card: #1a2040;
  --fg: #e6f4ff;
  --border: #44e2e6;
  --muted: #c3cff0;
  --accent: #ffe14d;
  color-scheme: dark;
  background-color: #12162e;
  background-image: url("/static/tiles/game-night.png");
  background-repeat: repeat;
  image-rendering: pixelated;
  color: #e6f4ff;
}
body.theme-game-night .card,
body.theme-game-night header.site {
  background: #1a2040;
  border-color: #44e2e6;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
  color: #e6f4ff;
}
body.theme-game-night h1 a,
body.theme-game-night h2,
body.theme-game-night h3 { color: #ffe14d; }
body.theme-game-night a { color: #6fe9ec; }
body.theme-game-night a:hover { color: #ee7fda; }
body.theme-game-night .divider { color: #ee7fda; }
body.theme-game-night header.site p,
body.theme-game-night footer.site,
body.theme-game-night .meta { color: #c3cff0; }
body.theme-game-night .badge { background: #262c50; border-color: #44e2e6; color: #e6f4ff; }

body.theme-backyard {
  --card: #fdf6e3;
  --fg: #22331a;
  --border: #2c4d1e;
  --muted: #3f5c31;
  --accent: #8a3a29;
  color-scheme: light;
  background-color: #3a7a2e;
  background-image: url("/static/tiles/backyard.png");
  background-repeat: repeat;
  image-rendering: pixelated;
  color: #22331a;
}
body.theme-backyard .card,
body.theme-backyard header.site {
  background: #fdf6e3;
  border-color: #2c4d1e;
  box-shadow: 4px 4px 0 rgba(20, 40, 12, 0.5);
  color: #22331a;
}
body.theme-backyard h1 a,
body.theme-backyard h2,
body.theme-backyard h3 { color: #8a3a29; }
body.theme-backyard a { color: #8a3a29; }
body.theme-backyard a:hover { color: #2c4d1e; }
body.theme-backyard .divider { color: #fdf6e3; }
body.theme-backyard header.site p,
body.theme-backyard footer.site,
body.theme-backyard .meta { color: #3f5c31; }

body.theme-starfield {
  --card: #10101f;
  --fg: #eaf0ff;
  --border: #9fe6ff;
  --muted: #d3daf5;
  --accent: #ffe14d;
  color-scheme: dark;
  background-color: #06060f;
  background-image: url("/static/tiles/starfield.png");
  background-repeat: repeat;
  image-rendering: pixelated;
  color: #eaf0ff;
}
body.theme-starfield .card,
body.theme-starfield header.site {
  background: #10101f;
  border-color: #9fe6ff;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.7);
  color: #eaf0ff;
}
body.theme-starfield h1 a,
body.theme-starfield h2,
body.theme-starfield h3 { color: #ffe14d; }
body.theme-starfield a { color: #9fe6ff; }
body.theme-starfield a:hover { color: #ff9ff0; }
body.theme-starfield .divider { color: #ff9ff0; }
body.theme-starfield header.site p,
body.theme-starfield footer.site,
body.theme-starfield .meta { color: #d3daf5; }

body.theme-party {
  --card: #fffdf7;
  --fg: #33281a;
  --border: #2b2622;
  --muted: #5a4a35;
  --accent: #aa3f8a;
  color-scheme: light;
  background-color: #fcf8ee;
  background-image: url("/static/tiles/party.png");
  background-repeat: repeat;
  image-rendering: pixelated;
  color: #33281a;
}
body.theme-party .card,
body.theme-party header.site {
  background: #fffdf7;
  border-color: #2b2622;
  box-shadow: 4px 4px 0 rgba(43, 38, 34, 0.3);
  color: #33281a;
}
body.theme-party h1 a,
body.theme-party h2,
body.theme-party h3 { color: #aa3f8a; }
body.theme-party a { color: #2f6fa8; }
body.theme-party a:hover { color: #aa3f8a; }
body.theme-party header.site p,
body.theme-party footer.site,
body.theme-party .meta { color: #5a4a35; }
body.theme-party .divider {
  color: #aa3f8a;
}
