/* fordarlene.com — a soft, warm memorial board */

:root {
  --linen: #f6efe4;
  --linen-deep: #ede2d1;
  --ink: #3a302a;
  --ink-soft: #6f6159;
  --accent: #9c5f6a;      /* dusty rose */
  --accent-deep: #7d4550;
  --gold: #c8a35b;
  --card-shadow: 0 10px 24px rgba(74, 50, 40, .14), 0 2px 6px rgba(74, 50, 40, .10);
  --radius: 14px;
  --ui-font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display-font: "Playfair Display", Georgia, serif;
}

/* card defaults — must come BEFORE the paper/ink/font classes so those win */
.card { --paper: #fff8e7; --ink-c: #2f2a26; --card-font: "Caveat", cursive; --card-size: 1.5rem; }

/* paper colors */
.paper-cream    { --paper: #fff8e7; }
.paper-white    { --paper: #ffffff; }
.paper-blush    { --paper: #fde4e4; }
.paper-sky      { --paper: #e3f0fb; }
.paper-mint     { --paper: #e2f5e9; }
.paper-lavender { --paper: #ece4f7; }
.paper-butter   { --paper: #fff3c4; }
.paper-peach    { --paper: #ffe6d5; }
.paper-sage     { --paper: #e6ecdd; }
.paper-slate    { --paper: #e4e8ee; }

/* ink colors */
.ink-charcoal { --ink-c: #2f2a26; }
.ink-navy     { --ink-c: #1f3557; }
.ink-plum     { --ink-c: #5b2a55; }
.ink-forest   { --ink-c: #24513a; }
.ink-rose     { --ink-c: #9c3b52; }
.ink-brown    { --ink-c: #5c3d2e; }
.ink-teal     { --ink-c: #1d5c62; }
.ink-wine     { --ink-c: #6e1f2b; }

/* fonts */
.font-caveat    { --card-font: "Caveat", cursive;               --card-size: 1.5rem; }
.font-dancing   { --card-font: "Dancing Script", cursive;       --card-size: 1.45rem; }
.font-playfair  { --card-font: "Playfair Display", serif;       --card-size: 1.1rem; }
.font-lora      { --card-font: "Lora", serif;                   --card-size: 1.08rem; }
.font-nunito    { --card-font: "Nunito", sans-serif;            --card-size: 1.05rem; }
.font-patrick   { --card-font: "Patrick Hand", cursive;         --card-size: 1.35rem; }
.font-amatic    { --card-font: "Amatic SC", cursive;            --card-size: 1.7rem; }
.font-cormorant { --card-font: "Cormorant Garamond", serif;     --card-size: 1.25rem; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ui-font);
  color: var(--ink);
  background-color: var(--linen);
  background-image:
    radial-gradient(ellipse at 15% 0%, rgba(214, 173, 140, .22), transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(156, 95, 106, .14), transparent 55%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.012) 0 1px, transparent 1px 3px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-deep); }
h1, h2 { font-family: var(--display-font); font-weight: 600; letter-spacing: .005em; }
h2 { font-size: 1.7rem; margin: 0 0 .6rem; }

/* ---------- hero ---------- */
.hero { padding: 2.5rem 1rem 1rem; text-align: center; }
.eyebrow {
  font-family: "Caveat", cursive; font-size: 2.2rem; color: var(--accent); margin: 0 0 .4rem;
}
.hero-card {
  max-width: 720px; margin: 0 auto; background: #fffdf8; border-radius: 22px;
  padding: 2rem 1.5rem 1.8rem; box-shadow: var(--card-shadow);
  border: 1px solid rgba(156, 95, 106, .12);
}
.portrait {
  width: 150px; height: 150px; margin: 0 auto 1rem; border-radius: 50%; overflow: hidden;
  border: 5px solid #fff; box-shadow: 0 6px 18px rgba(0,0,0,.15); background: var(--linen-deep);
  display: grid; place-items: center; position: relative;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait-fallback { display: none; font-size: 3.5rem; }
.portrait.no-photo img { display: none; }
.portrait.no-photo .portrait-fallback { display: block; }
.hero h1 { font-size: 1.35rem; margin: 0; font-weight: 400; font-style: italic; color: var(--ink-soft); line-height: 1.25; }
.hero h1 .name { display: block; font-style: normal; font-weight: 600; font-size: 2.6rem; color: var(--ink); margin-top: .2rem; }
.dates { margin: .5rem 0 1rem; color: var(--accent); letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; font-weight: 700; }
.lede { font-size: 1.08rem; max-width: 56ch; margin: 0 auto 1.2rem; }
.services { font-size: .9rem; color: var(--ink-soft); border-top: 1px dashed rgba(0,0,0,.12); padding-top: 1rem; margin-bottom: 1.3rem; }
.services p { margin: .25rem 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  padding: .8rem 1.5rem; border-radius: 999px; text-decoration: none; transition: transform .12s, box-shadow .12s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(156, 95, 106, .35); }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .6; cursor: wait; transform: none; }
button.link { background: none; border: 0; color: var(--accent-deep); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }

/* ---------- layout ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.composer {
  max-width: 720px; margin: 1.5rem auto 3rem; background: #fffdf8; border-radius: 22px;
  padding: 1.6rem 1.4rem; box-shadow: var(--card-shadow); border: 1px solid rgba(156, 95, 106, .12);
}
.composer-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.composer-head h2 { margin: 0 0 .8rem; }
.btn-small { padding: .55rem 1.1rem; font-size: .9rem; }
.field { display: block; margin-bottom: 1.1rem; }
.field > span { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .4rem; color: var(--ink-soft); }
.field > span em { font-weight: 400; font-style: normal; color: #9a8c83; }
.field-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
input[type="text"], input[type="url"], textarea {
  width: 100%; font: inherit; padding: .7rem .85rem; border-radius: 10px; border: 1.5px solid #dccfc0;
  background: #fff; color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(156, 95, 106, .18); }
textarea { resize: vertical; min-height: 6.5rem; }

/* font chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  border: 1.5px solid #dccfc0; background: #fff; border-radius: 999px; padding: .35rem .9rem; cursor: pointer;
  font-size: 1.05rem; line-height: 1.3; color: var(--ink); transition: all .12s;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* swatches */
.swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(0,0,0,.12); cursor: pointer;
  position: relative; transition: transform .12s; padding: 0;
}
.swatch:hover { transform: scale(1.1); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent); }
.swatch[aria-checked="true"]::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: .9rem;
}
.swatch.paper[aria-checked="true"]::after { color: var(--accent-deep); }
.swatch.ink[aria-checked="true"]::after { color: #fff; }

/* dropzone */
.dropzone {
  border: 2px dashed #d3c2b0; border-radius: 14px; padding: 1.1rem; text-align: center; cursor: pointer;
  background: #fff; transition: border-color .12s, background .12s;
}
.dropzone:hover, .dropzone:focus, .dropzone.over { border-color: var(--accent); background: #fff7f5; outline: none; }
.drop-idle { display: flex; flex-direction: column; gap: .2rem; color: var(--ink-soft); font-size: .95rem; }
.drop-icon { font-size: 1.8rem; }
.drop-hint { font-size: .78rem; color: #a0928a; }
.drop-preview img { max-height: 220px; max-width: 100%; border-radius: 8px; display: block; margin: 0 auto .5rem; }
.or-row { display: flex; align-items: center; gap: .6rem; margin-top: .6rem; }
.or { white-space: nowrap; font-size: .85rem; color: var(--ink-soft); }
.or-row input { flex: 1; }

.submit-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .4rem; }
.status { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.status.error { color: #b3261e; font-weight: 600; }
.status.ok { color: #2e6b45; font-weight: 600; }

/* ---------- cards ---------- */
.preview-wrap { display: flex; justify-content: center; padding: .6rem 0 .2rem; }
.card {
  background: var(--paper); color: var(--ink-c); border-radius: 6px; width: 100%; max-width: 340px;
  box-shadow: var(--card-shadow); position: relative; transform: rotate(var(--tilt, 0deg));
  transition: transform .18s, box-shadow .18s;
  background-image: linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,0) 40%);
}
.card:hover { transform: rotate(0deg) translateY(-3px) scale(1.02); box-shadow: 0 16px 34px rgba(74, 50, 40, .2); z-index: 2; }
.tape {
  position: absolute; top: -12px; left: 50%; width: 92px; height: 26px; transform: translateX(-50%) rotate(-2deg);
  background: rgba(255, 236, 170, .75); border-left: 1px dashed rgba(0,0,0,.08); border-right: 1px dashed rgba(0,0,0,.08);
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.card:nth-child(3n) .tape { transform: translateX(-50%) rotate(3deg); background: rgba(214, 235, 255, .8); }
.card:nth-child(5n) .tape { transform: translateX(-50%) rotate(-4deg); background: rgba(255, 214, 224, .8); }
.card-img { display: block; width: 100%; height: auto; max-height: 440px; object-fit: contain; background: rgba(0,0,0,.05); border-radius: 6px 6px 0 0; cursor: zoom-in; }
.card-body { padding: 1.2rem 1.15rem 1rem; }
.card-text {
  font-family: var(--card-font); font-size: var(--card-size); line-height: 1.35; margin: 0 0 .8rem;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.card-text.placeholder { opacity: .45; }
.card-from { font-family: var(--card-font); font-size: calc(var(--card-size) * .9); margin: 0; text-align: right; opacity: .9; }
.card-date { font-family: var(--ui-font); font-size: .72rem; color: rgba(0,0,0,.45); margin: .4rem 0 0; text-align: right; }
.card.image-only .card-text { display: none; }
.card.new { animation: pop .5s ease-out; }
@keyframes pop { from { transform: scale(.85) rotate(var(--tilt, 0deg)); opacity: 0; } to { transform: scale(1) rotate(var(--tilt, 0deg)); opacity: 1; } }


/* pinned note */
.pinned { max-width: 620px; margin: 0 auto 2.5rem; text-align: center; }
.pinned h2 { font-family: "Caveat", cursive; font-weight: 600; font-size: 2rem; color: var(--accent); margin: 0 0 1rem; }
.pinned-wrap { display: flex; justify-content: center; padding-top: .6rem; }
.pinned .card { max-width: none; width: 100%; text-align: left; box-shadow: 0 14px 34px rgba(74, 50, 40, .2), 0 0 0 3px rgba(200, 163, 91, .35); }
.pinned .card:hover { transform: none; }
.pinned .card .tape { background: rgba(200, 163, 91, .55); width: 120px; }
.pinned .card .card-text { font-size: calc(var(--card-size) * 1.08); }

/* admin */
.admin-bar {
  position: sticky; top: 0; z-index: 20; background: #3a302a; color: #fff; font-size: .85rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem 1rem;
}
.admin-bar .link { color: #ffd9a3; }
.card-tools { display: flex; gap: .4rem; position: absolute; top: 6px; right: 6px; }
.tool { background: #3a302a; color: #fff; border: 0; border-radius: 999px; font: inherit; font-size: .72rem; font-weight: 700; padding: .25rem .6rem; cursor: pointer; opacity: .92; }
.tool.danger { background: #b3261e; }
.is-admin .card:not(:has(.card-img)) .card-body { padding-top: 2.4rem; }
button.link.subtle { color: #b3a89f; text-decoration: none; }
button.link.subtle:hover { text-decoration: underline; }

/* replies from Darlene */
.card-reply { margin: .9rem 0 0; padding: .7rem .8rem .6rem; border-top: 1px dashed rgba(0,0,0,.18); font-family: "Caveat", cursive; font-size: 1.25rem; line-height: 1.3; color: var(--ink-c); white-space: pre-wrap; overflow-wrap: anywhere; }
.card-reply .reply-label { display: block; font-family: var(--ui-font); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: .15rem; }
.reply-editor { margin-top: .8rem; border-top: 1px dashed rgba(0,0,0,.18); padding-top: .6rem; }
.reply-editor textarea { width: 100%; font: inherit; font-family: "Caveat", cursive; font-size: 1.2rem; padding: .5rem .6rem; border-radius: 8px; border: 1.5px solid #dccfc0; min-height: 4rem; }
.reply-editor .row { display: flex; gap: .5rem; margin-top: .4rem; }
.reply-editor .btn { padding: .4rem .9rem; font-size: .85rem; }
.card-tools .tool.reply { background: var(--accent); }
.admin-bar label { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; margin-left: 1rem; white-space: nowrap; }
.admin-bar .bar-left { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem 0; }
.composer .edit-note { font-size: .85rem; color: var(--ink-soft); margin: -.4rem 0 1rem; }
.composer.editing .picture-field { display: none; }

.toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #3a302a; color: #fff; padding: .7rem 1.2rem; border-radius: 999px; font-weight: 600; z-index: 40;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* board */
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0 .25rem .5rem; }
.board-head h2 { margin: 0; }
.board-head .count { flex: 1; }
.count { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.cards { columns: 270px; column-gap: 1.6rem; padding: 1.4rem .6rem 0; }
.cards .card { max-width: none; display: inline-block; width: 100%; break-inside: avoid; margin: 0 0 2rem; vertical-align: top; }
.empty { text-align: center; color: var(--ink-soft); padding: 2rem; }

footer { text-align: center; padding: 1.5rem 1rem 2.5rem; color: var(--ink-soft); font-size: .9rem; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(20, 12, 10, .88); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox-close { position: absolute; top: .6rem; right: 1rem; font-size: 2.4rem; background: none; border: 0; color: #fff; cursor: pointer; line-height: 1; }

@media (max-width: 560px) {
  .hero { padding-top: 1.6rem; }
  .hero h1 .name { font-size: 2.1rem; }
  .field-row.two { grid-template-columns: 1fr; }
  .composer { padding: 1.3rem 1rem; }
  .cards { columns: 1; padding: 1.2rem .2rem 0; }
  .pinned { margin-bottom: 1.6rem; }
  .board-head .btn-small { width: 100%; }
  .admin-bar { flex-direction: column; align-items: flex-start; gap: .3rem; }
  .admin-bar label { margin-left: 0; }
  .or-row { flex-direction: column; align-items: stretch; }
  .swatches { gap: .4rem; }
  .swatch { width: 30px; height: 30px; }
  .chip { font-size: 1rem; padding: .3rem .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .card:hover { transition: none; }
  .card.new { animation: none; }
}
