/* Patchwork stylesheet. Colors are taken from the original Softr site. */
:root {
  --text-scale: 1;
  --sky: #dff1fb;
  --cream: #fbf2e2;
  --butter: #fbf3c4;
  --card-yellow: #fbf3cf;
  --ink: #2c2a26;
  --ink-soft: #6a6255;
  --green-dark: #2d502a;
  --coral: #e8604a;
  --pink: #f88ca2;
  --pink-soft: #f9c9cf;
  --line: #e6dcc6;
  --white: #fffdf8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(44, 42, 38, 0.08), 0 4px 14px rgba(44, 42, 38, 0.06);
  --heading: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --body-weight: 400;
  --strong-weight: 700;
}

/* Reading preferences (set by the bar under the menu). */
html { font-size: calc(100% * var(--text-scale)); }
html[data-font='atkinson'] { --body: 'Atkinson Hyperlegible Next', sans-serif; --heading: var(--body); }
html[data-font='lexend'] { --body: 'Lexend', sans-serif; --heading: var(--body); }
html[data-font='dyslexic'] { --body: 'OpenDyslexic', sans-serif; --heading: var(--body); }
html[data-weight='medium'] { --body-weight: 500; }
html[data-weight='bold'] { --body-weight: 700; --strong-weight: 800; }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--body);
  font-weight: var(--body-weight);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
h1, h2, h3 { font-family: var(--heading); line-height: 1.2; margin: 0 0 0.5em; font-weight: var(--strong-weight); overflow-wrap: break-word; hyphens: auto; }
p, li, dd { overflow-wrap: break-word; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-dark); }
a:hover { color: var(--coral); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.5rem 1rem; z-index: 100; }
.skip-link:focus { left: 0.5rem; top: 0.5rem; }
.muted { color: var(--ink-soft); font-weight: 400; }
.small { font-size: 0.875rem; }
.center { text-align: center; }
svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg .fill { fill: currentColor; stroke: none; }

/* ---------- header ---------- */
.site-header { background: #fdf7f6; border-bottom: 1px solid #f1e4e0; position: sticky; top: 0; z-index: 50; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; min-height: 64px; display: flex; align-items: center; gap: 1rem; }
.brand img { width: 160px; height: auto; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }
.site-nav > a, .nav-dropdown > button {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0 0.8rem; height: 64px; text-decoration: none; color: var(--ink);
  font-size: 0.9rem; font-weight: 500; background: none; border: 0; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.site-nav > a:hover, .nav-dropdown > button:hover { color: var(--coral); }
.site-nav [aria-current='page'], .nav-dropdown[aria-current='page'] > button { border-bottom-color: var(--coral); }
.nav-dropdown { position: relative; }
.nav-dropdown .chev { width: 0.9em; transition: transform 0.15s; }
.nav-dropdown.open .chev { transform: rotate(180deg); }
.dropdown-menu {
  display: none; position: absolute; right: 0; top: calc(100% - 6px); min-width: 230px;
  background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 0.4rem; border: 1px solid var(--line);
}
.nav-dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 0.55rem 0.75rem; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: 0.9rem; }
.dropdown-menu a:hover { background: var(--butter); color: var(--ink); }
.account { display: flex; align-items: center; gap: 0.5rem; margin-left: 0.5rem; font-size: 0.9rem; }
.account a { text-decoration: none; font-weight: 500; }
.nav-signup { background: var(--pink); color: var(--green-dark) !important; padding: 0.4rem 0.85rem; border-radius: 8px; }
.nav-user { color: var(--ink-soft); }
.nav-logout { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 0.3rem 0.7rem; cursor: pointer; }
.menu-toggle { display: none; margin-left: auto; align-items: center; gap: 0.4rem; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.7rem; cursor: pointer; }

/* Collapsed menu: used on small screens, or whenever the menu does not fit (e.g. 2x text). site.js sets the class. */
.nav-collapsed .menu-toggle { display: inline-flex; }
.nav-collapsed .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fdf7f6; flex-direction: column; align-items: stretch; padding: 0.5rem 1rem 1rem; border-bottom: 1px solid #f1e4e0; max-height: calc(100vh - 64px); overflow-y: auto; }
.nav-collapsed .site-nav.open { display: flex; }
.nav-collapsed .site-nav > a, .nav-collapsed .nav-dropdown > button { height: auto; padding: 0.75rem 0.5rem; border-bottom: 0; width: 100%; }
.nav-collapsed .dropdown-menu { display: block; position: static; box-shadow: none; border: 0; padding-left: 1.5rem; background: transparent; }
.nav-collapsed .nav-dropdown .chev { display: none; }
.nav-collapsed .account { margin: 0.5rem 0 0; flex-wrap: wrap; }
.site-nav > a, .nav-dropdown > button, .account > * { white-space: nowrap; }
.header-inner { position: relative; }
}

/* ---------- reading preferences bar ---------- */
.a11y-bar { background: var(--cream); }
.a11y-inner { max-width: 1000px; margin: 0 auto; padding: 0.9rem 1.25rem; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 1.25rem; }
.a11y-group { display: flex; flex-direction: column; gap: 0.3rem; }
.a11y-label { font-size: 0.75rem; font-weight: 600; opacity: 0.7; margin-left: 0.25rem; }
.segmented { display: inline-flex; gap: 0.25rem; padding: 0.25rem; background: #fff; border-radius: 10px; box-shadow: var(--shadow); width: min(12.5rem, 90vw); height: 2.5rem; }
.segmented button { flex: 1; border: 0; border-radius: 7px; background: var(--butter); font-size: 0.75rem; cursor: pointer; }
.segmented button[aria-pressed='true'] { outline: 2px solid #000; outline-offset: 1px; font-weight: 700; }
.a11y-bar select { width: min(12.5rem, 90vw); height: 2.5rem; border: 0; border-radius: 8px; background: var(--butter); padding: 0 0.75rem; font-size: 0.8rem; box-shadow: var(--shadow); cursor: pointer; }

@media (max-width: 600px) {
  .a11y-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; padding: 0.6rem 1rem; }
  .a11y-group:first-child { grid-column: 1 / -1; }
  .segmented, .a11y-bar select { width: 100%; }
}

/* ---------- shared bits ---------- */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.btn-pink, .btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: 10px; text-decoration: none; cursor: pointer; font-weight: 600; border: 0;
}
.btn-pink { background: var(--pink); color: var(--green-dark); font-size: 1.1rem; padding: 0 2rem; min-height: 3.5rem; }
.btn-pink:hover { opacity: 0.9; color: var(--green-dark); }
.btn-primary { background: var(--green-dark); color: #fff; padding: 0.7rem 1.5rem; }
.btn-primary:hover { background: #3c6b38; }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-secondary { background: #fff; border: 1px solid var(--line); padding: 0.6rem 1.4rem; color: var(--ink); }
.btn-listen {
  display: inline-flex; align-items: center; gap: 0.45rem; background: #fff; color: var(--ink);
  border: 1px solid var(--coral); border-radius: 8px; padding: 0.35rem 0.8rem; font-size: 0.875rem; cursor: pointer;
}
.btn-listen:hover, .btn-listen.playing { background: #fdeae6; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink-soft); text-decoration: underline; font-size: 0.85rem; }
.link-btn.danger { color: #b3261e; }
.link-btn:disabled { text-decoration: none; cursor: default; }
.page { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.page-narrow { max-width: 820px; }
.page > h1, .page-head h1 { font-size: 2.25rem; color: var(--green-dark); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.lead { font-size: 1.15rem; color: var(--ink-soft); }
.empty-note { text-align: center; color: var(--ink-soft); padding: 2rem 0; }
.crumbs { margin-bottom: 1rem; font-size: 0.9rem; }

/* ---------- home ---------- */
.banner { background: var(--sky); padding: 1rem 1.25rem 2.5rem; text-align: center; }
.banner-img { max-width: 1000px; margin: 0 auto 0.5rem; height: 240px; border-radius: 10px; overflow: hidden; }
.banner-img img { width: 100%; height: 100%; object-fit: cover; }
.banner-title { font-size: 1.9rem; color: var(--green-dark); margin-bottom: 0.25rem; }
.banner-sub { color: var(--ink-soft); font-weight: 600; margin-bottom: 1rem; }
.tag-search { max-width: 460px; margin: 0 auto; display: flex; align-items: center; gap: 0.5rem; background: #fff; border-radius: 999px; padding: 0 1.1rem; box-shadow: var(--shadow); }
.tag-search input[type='search'][id] { border: 0; outline: 0; flex: 1; height: 3rem; background: transparent; padding: 0; }
.tag-search:focus-within { outline: 3px solid var(--coral); }
@media (max-width: 640px) { .banner-img { height: 150px; } }

.intro { background: var(--cream); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 3.5rem; padding: 4rem 3rem; }
.intro-art { position: relative; width: 520px; max-width: 90vw; aspect-ratio: 520 / 490; flex-shrink: 0; }
.intro-frame { position: absolute; inset: 0; background: #fff; border-radius: 22px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.intro-frame img { width: 100%; height: 100%; object-fit: contain; padding: 1.5rem; }
.sparkle { position: absolute; pointer-events: none; }
.sparkle-1 { left: -46px; top: 100px; font-size: 2rem; color: #f4c93a; transform: rotate(-12deg); }
.sparkle-2 { right: -30px; top: 60px; font-size: 1.6rem; color: var(--coral); transform: rotate(10deg); }
.intro-text { flex: 1; min-width: min(18.75rem, 100%); max-width: 25rem; }
.intro-text h2 { font-size: 2.75rem; line-height: 1.08; color: var(--ink); margin-bottom: 0.9rem; }
.accent-rule { width: 120px; height: 4px; border-radius: 4px; background: var(--coral); margin-bottom: 1rem; }
.intro-text p { color: var(--ink-soft); }
@media (max-width: 640px) { .intro { padding: 3rem 1.25rem; } .sparkle { display: none; } .intro-text h2 { font-size: 2.2rem; } }

.pillars { display: flex; flex-wrap: wrap; }
.pillar { flex: 1; min-width: min(15rem, 100%); padding: 2.75rem 2.25rem; }
.pillar h2 { font-size: 1.375rem; }
.pillar p { font-size: 0.9rem; opacity: 0.9; }
.pillar-icon { width: 56px; height: 56px; border-radius: 14px; background: rgba(255, 255, 255, 0.55); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; transform: rotate(-4deg); }
.pillar-icon svg { width: 28px; height: 28px; }
.pillar-green { background: #cdd98a; color: #3f4a1f; }
.pillar-pink { background: var(--pink-soft); color: #6e2430; }
.pillar-yellow { background: #f7d97a; color: #5a4415; }
.pillar-blue { background: #bcd9ea; color: #1f3b4d; }

.learn-more { background: var(--cream); text-align: center; padding: 3rem 1.25rem; }
.learn-more h2 { font-size: 2.25rem; }
.learn-more p { color: var(--ink-soft); font-size: 1.1rem; }
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 1rem; }

.tags { max-width: 1100px; margin: 0 auto; padding: 3rem 1.25rem 4rem; }
.tags > h2 { font-size: 2rem; text-align: center; color: var(--green-dark); margin-bottom: 1.5rem; }
.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(16.25rem, 100%), 1fr)); gap: 1.25rem; }
.tag-card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--green-dark);
  background: var(--card-yellow); border: 1px solid #cfc7ad; border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s;
}
.tag-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(44, 42, 38, 0.14); color: var(--green-dark); }
.tag-card img { aspect-ratio: 1200 / 848; object-fit: cover; width: 100%; background: #fff; }
.tag-card-body { padding: 1rem 1rem 1.2rem; text-align: center; }
.tag-card h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.tag-card p { font-size: 0.9rem; font-weight: 600; margin: 0; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) { .tag-card, .nav-dropdown .chev { transition: none; } .tag-card:hover { transform: none; } }

/* ---------- team / story / glossary / conditions ---------- */
.team h1, .team .lead { text-align: center; }
.team-grid { list-style: none; padding: 0; margin: 2rem 0 2.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1.5rem; text-align: center; font-weight: 600; }
.team-grid li { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 50%; font-family: var(--heading); font-size: 1.75rem; font-weight: 700; color: var(--green-dark); }
.avatar.small { width: 1.9rem; height: 1.9rem; font-size: 0.9rem; background: var(--pink-soft); }
.c1 { background: var(--pink-soft); } .c2 { background: #cdd98a; } .c3 { background: #f7d97a; } .c4 { background: #bcd9ea; }
.mascot { text-align: center; }
.mascot-title { font-family: var(--heading); font-size: 1.5rem; font-weight: 700; color: var(--green-dark); }
.mascot img { margin: 0 auto 1.25rem; max-height: 420px; width: auto; }

.quilt-border {
  border: 8px solid;
  border-image: repeating-linear-gradient(45deg, var(--pink) 0 10px, var(--sky) 10px 20px, #ffd966 20px 30px, #a8d5a3 30px 40px) 8;
  border-radius: 0;
}
.story-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.story-head h1 { font-size: 2.25rem; color: var(--green-dark); margin: 0; }
.story-text { font-size: 1.25rem; line-height: 1.8; }
.story-text figure { margin: 1.5rem 0; }
.story-text figure img { border-radius: 12px; margin: 0 auto; }
.story-moral { color: var(--green-dark); font-weight: 700; font-size: 1.55rem; text-align: center; margin-top: 2rem; }

.glossary { display: grid; gap: 0.75rem; margin: 1rem 0 2rem; }
.glossary > div { background: var(--white); border-radius: 12px; box-shadow: var(--shadow); padding: 1rem 1.25rem; border-left: 6px solid var(--pink); }
.glossary > div:nth-child(4n + 2) { border-left-color: #a8d5a3; }
.glossary > div:nth-child(4n + 3) { border-left-color: #ffd966; }
.glossary > div:nth-child(4n + 4) { border-left-color: #9cc9e3; }
.glossary dt { font-family: var(--heading); font-weight: 700; font-size: 1.1rem; color: var(--green-dark); }
.glossary dd { margin: 0.2rem 0 0; color: var(--ink-soft); }

.condition { margin-bottom: 1.25rem; }
.condition > header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; border-bottom: 1px solid var(--line); padding-bottom: 0.75rem; margin-bottom: 1rem; }
.condition h2 { margin: 0; color: var(--green-dark); font-size: 1.5rem; }
.condition h3 { font-size: 1.05rem; margin-top: 1rem; }
.checks { list-style: none; padding: 0; }
.checks li { padding-left: 1.6rem; position: relative; margin-bottom: 0.3rem; }
.checks li::before { content: '✓'; position: absolute; left: 0; color: #3c8a3a; font-weight: 700; }
details { margin-top: 1rem; }
summary { cursor: pointer; font-weight: 600; color: var(--green-dark); display: inline-block; padding: 0.4rem 0.9rem; border-radius: 8px; background: var(--butter); }
details[open] summary { margin-bottom: 0.5rem; }
details[open] summary::after { content: ' (show less)'; font-weight: 400; }

.form-frame { padding: 0; overflow: hidden; }
.form-frame iframe { border: 0; display: block; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; margin: 0.9rem 0 0.3rem; font-size: 0.95rem; }
label.check { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 400; }
input:not([type='checkbox']):not([type='file']), textarea {
  width: 100%; padding: 0.65rem 0.8rem; border: 1px solid #d8ceb6; border-radius: 10px; background: #fff;
}
input[type='file'] { width: 100%; padding: 0.5rem; border: 1px dashed #d8ceb6; border-radius: 10px; background: #fff; }
textarea { resize: vertical; }
.form-error { color: #b3261e; font-weight: 600; min-height: 1.2em; margin: 0.75rem 0; }
.previews { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.previews img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; }

.auth { display: flex; justify-content: center; }
.auth-card { width: 100%; max-width: 420px; text-align: center; }
.auth-card form { text-align: left; }
.auth-card .btn-primary { width: 100%; margin-bottom: 1rem; }
.auth-art { width: 160px; margin: 0 auto 1rem; }

/* ---------- forum ---------- */
.board-head { display: flex; gap: 1.5rem; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; }
.board-head img { width: 220px; border-radius: 12px; box-shadow: var(--shadow); }
.board-head > div { flex: 1; min-width: 260px; }
.board-head h1 { font-size: 2.25rem; color: var(--green-dark); }
.board-head p { color: var(--ink-soft); font-size: 1.05rem; }
.composer { margin-bottom: 1.5rem; }
.composer h2 { font-size: 1.25rem; margin: 0; }
.composer-guest { margin: 0; text-align: center; }
.post-list { display: grid; gap: 1rem; }
.post-card { display: flex; gap: 1.25rem; padding: 1.25rem; }
.post-thumb img { width: 150px; height: 150px; object-fit: cover; border-radius: 10px; }
.post-card-body { flex: 1; min-width: 0; }
.post-card h2 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.post-card h2 a { text-decoration: none; color: var(--ink); }
.post-card h2 a:hover { color: var(--coral); }
.excerpt { color: var(--ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
.meta { font-size: 0.875rem; margin: 0; }
@media (max-width: 560px) { .post-card { flex-direction: column; } .post-thumb img { width: 100%; height: 200px; } }

.byline { display: flex; align-items: center; gap: 0.4rem; font-size: 0.875rem; color: var(--ink-soft); margin-bottom: 0.75rem; flex-wrap: wrap; }
.byline strong { color: var(--ink); }
.post-full h1 { font-size: 2rem; }
.post-body, .comment-body { overflow-wrap: anywhere; }
.post-body { font-size: 1.1rem; }
.post-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.item-actions { display: flex; gap: 1rem; align-items: center; }
.gallery { display: grid; gap: 0.5rem; margin: 1rem 0; }
.gallery.count-2, .gallery.count-4 { grid-template-columns: 1fr 1fr; }
.gallery.count-3 { grid-template-columns: 1fr 1fr 1fr; }
.gallery img { width: 100%; border-radius: 10px; max-height: 640px; object-fit: contain; background: #f4efe4; }
.gallery.count-2 img, .gallery.count-3 img, .gallery.count-4 img { aspect-ratio: 1; object-fit: cover; }
.comment .gallery { max-width: 420px; }
.replies-title { margin: 2rem 0 1rem; font-size: 1.35rem; }
.comments { display: grid; gap: 0.75rem; margin-bottom: 1.5rem; }
.comment { padding: 1rem 1.25rem; }
.comment .item-actions { justify-content: flex-end; }
.comment:target { outline: 3px solid var(--coral); }

/* ---------- admin ---------- */
.report blockquote { margin: 0.5rem 0; padding: 0.5rem 0.75rem; background: var(--cream); border-radius: 8px; }
.report { margin-bottom: 0.75rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
tr.banned td { color: #b3261e; }

/* ---------- footer ---------- */
.site-footer { background: #fdf7f6; border-top: 1px solid #f1e4e0; text-align: center; padding: 2rem 1rem; font-size: 0.9rem; color: var(--ink-soft); }
.site-footer img { margin: 0 auto 0.5rem; }
.site-footer p { margin: 0.25rem 0; }
