/* Friends of Montrose Park */

:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --surface-alt: #eaf0e6;
  --text: #1d2420;
  --muted: #4d5a52;
  --border: #c9d3c6;
  --media-border: #8b9a88;
  --media-shadow: 0 1px 2px rgba(29, 36, 32, 0.12), 0 6px 18px rgba(29, 36, 32, 0.12);
  --accent: #24452f;
  --accent-strong: #183322;
  --accent-contrast: #ffffff;
  --link: #1f5d36;
  --link-hover: #133d23;
  --focus: #b8660b;
  --success-bg: #e3f1e5;
  --success-text: #184d26;
  --success-border: #8cc39a;
  --error-bg: #fbe9e7;
  --error-text: #8a1c12;
  --error-border: #e2a097;
  --radius: 10px;
  --measure: 42rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121714;
    --surface: #1a211c;
    --surface-alt: #1f2b23;
    --text: #e6ebe7;
    --muted: #aab7ae;
    --border: #36443a;
    --media-border: #4f6154;
    --media-shadow: none;
    --accent: #8fcb9f;
    --accent-strong: #a9dbb6;
    --accent-contrast: #0f1a13;
    --link: #8fd1a3;
    --link-hover: #b6e6c3;
    --focus: #f0a54a;
    --success-bg: #183222;
    --success-text: #bfe8c9;
    --success-border: #3f7a51;
    --error-bg: #3a1b17;
    --error-text: #ffc4bb;
    --error-border: #8f4337;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121714;
  --surface: #1a211c;
  --surface-alt: #1f2b23;
  --text: #e6ebe7;
  --muted: #aab7ae;
  --border: #36443a;
  --media-border: #4f6154;
  --media-shadow: none;
  --accent: #8fcb9f;
  --accent-strong: #a9dbb6;
  --accent-contrast: #0f1a13;
  --link: #8fd1a3;
  --link-hover: #b6e6c3;
  --focus: #f0a54a;
  --success-bg: #183222;
  --success-text: #bfe8c9;
  --success-border: #3f7a51;
  --error-bg: #3a1b17;
  --error-text: #ffc4bb;
  --error-border: #8f4337;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

main {
  max-width: calc(var(--measure) + 2rem);
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

/* Headings: levels are structural; sizes are set here */
h1,
h2,
h3,
h4 {
  line-height: 1.25;
  color: var(--accent-strong);
  text-wrap: balance;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 6vw, 3rem);
  margin: 0;
  letter-spacing: -0.01em;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  margin: 2.75rem 0 1rem;
}

h3 {
  font-size: 1.3rem;
  margin: 2rem 0 0.75rem;
}

h4 {
  font-size: 1.1rem;
  margin: 2.25rem 0 0.6rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

p {
  margin: 0 0 1.1rem;
}

strong {
  font-weight: 700;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Header and video */
.page-header {
  padding: 2.5rem 0 1.25rem;
}

.video {
  margin: 0 0 1rem;
}

.video video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
}

/* Figures */
.media {
  margin: 1.75rem 0 2rem;
}

.media-link {
  display: block;
  border: 2px solid var(--media-border);
  border-radius: var(--radius);
  box-shadow: var(--media-shadow);
  overflow: hidden;
  background: #fff;
}

.media img {
  display: block;
  width: 100%;
  height: auto;
}

@media (min-width: 60rem) {
  .media--wide {
    margin-left: -6rem;
    margin-right: -6rem;
  }
}

.media-link {
  cursor: zoom-in;
}

/* Full-size image modal */
.lightbox {
  width: fit-content;
  height: fit-content;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: #fff;
  overflow: auto;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.8);
}

.lightbox img {
  display: block;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  width: auto;
  height: auto;
}

.lightbox-close {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.75rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.75);
  border: 2px solid #fff;
  border-radius: 999px;
  cursor: pointer;
}

/* Call-to-action sections */
.callout {
  margin: 2.75rem -1rem 0;
  padding: 0.25rem 1rem 1.5rem;
  background: var(--surface-alt);
}

@media (min-width: 46rem) {
  .callout {
    margin-left: -2rem;
    margin-right: -2rem;
    padding: 0.25rem 2rem 2rem;
    border-radius: 16px;
  }
}

.callout > h2 {
  margin-top: 1.75rem;
}

.message-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
}

.message-box h3 {
  margin-top: 0;
}

.message {
  font-size: 1.1rem;
}

.copy-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.copy-status {
  font-weight: 600;
  color: var(--success-text);
}

.copy-fallback {
  margin-top: 1rem;
}

.copy-fallback label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.copy-fallback textarea {
  width: 100%;
  font: inherit;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-contrast);
  background: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 999px;
  cursor: pointer;
}

.button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.button:disabled {
  opacity: 0.65;
  cursor: progress;
}

/* Sign-up form */
.signup {
  margin-top: 1.5rem;
}

.form {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.required,
.optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.9rem;
}

.field input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--muted);
  border-radius: 6px;
}

.field input[aria-invalid="true"] {
  border: 2px solid var(--error-text);
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Formspree states (library default styles are disabled) */
[data-fs-error],
[data-fs-success] {
  display: none;
}

[data-fs-error][data-fs-active],
[data-fs-success][data-fs-active] {
  display: block;
}

.field-error[data-fs-active] {
  margin-top: 0.3rem;
  color: var(--error-text);
  font-size: 0.95rem;
  font-weight: 600;
}

.form-error[data-fs-active],
.form-success[data-fs-active] {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
}

.form-error[data-fs-active] {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid var(--error-border);
}

.form-success[data-fs-active] {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Keep the page from scrolling behind the open modal */
html:has(.lightbox[open]) {
  overflow: hidden;
}
