/* ==========================================================
   Charlie's Schedule — shared styles
   Palette & fonts match the cozy "Us" site vibe.
   ========================================================== */

:root {
  --cream: #faf3e6;
  --paper: #fffaf1;
  --ink: #4a3f35;
  --ink-soft: #8a7c6c;
  --line: #e7dbc7;
  --pink: #e8a5b0;      /* Mom / Kristine */
  --blue: #7fa8c9;      /* Dad / Tim */
  --terracotta: #d98a5f;
  --sage: #8fa789;
  --lavender: #a893d1;
  --teal: #5fada0;
  --gold: #d9a441;
  --cork: #c8935f;
  --shadow: 0 6px 16px rgba(74,63,53,0.15);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Quicksand', sans-serif;
  background-color: var(--cream);
  background-image: radial-gradient(circle, #efe2c9 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  margin: 0;
}

a { color: inherit; }

button, .btn {
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  background: var(--terracotta);
  color: #fff;
  transition: transform .12s, box-shadow .12s;
  font-size: 0.95rem;
}
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
button.ghost, .btn.ghost {
  background: transparent; color: var(--terracotta);
  border: 2px solid var(--terracotta); padding: 8px 16px;
}
button.small { padding: 5px 12px; font-size: .8rem; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

input, textarea, select {
  font-family: 'Quicksand', sans-serif;
  border: 2px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: .95rem;
  width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--terracotta); }

label {
  font-size: .8rem; font-weight: 700; color: var(--ink-soft);
  display: block; margin-bottom: 4px;
}

/* ---------- header / nav ---------- */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; background: var(--paper);
  border-bottom: 2px solid var(--line);
  position: sticky; top: 0; z-index: 20; flex-wrap: wrap; gap: 12px;
}
header .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
header .brand h1 { font-size: 1.6rem; position: relative; }
.update-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: #d9534f; border: 2px solid var(--paper);
  margin-left: 4px; vertical-align: top; position: relative; top: 2px;
}
.update-dot[hidden] { display: none; }
nav { display: flex; gap: 6px; flex-wrap: wrap; }
nav a.tab {
  background: transparent; color: var(--ink-soft);
  font-family: 'Playfair Display', serif; font-weight: 600;
  padding: 8px 16px; border-radius: 10px; text-decoration: none;
  display: inline-block;
}
nav a.tab:hover { background: #f2e3d6; }
nav a.tab.active { background: var(--terracotta); color: #fff; }
nav a.tab.active:hover { background: var(--terracotta); }

main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 80px; }

.page-head { margin-bottom: 22px; }
.page-head p { color: var(--ink-soft); max-width: 620px; line-height: 1.5; }

footer { text-align: center; padding: 30px; color: var(--ink-soft); font-size: .8rem; }

/* ---------- legend ---------- */
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 14px 0 22px; font-size: .82rem; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
/* highlighter-style swatch for Mom's/Dad's week in the legend */
.swatch {
  width: 20px; height: 10px; border-radius: 3px; display: inline-block;
  flex: 0 0 auto; transform: rotate(-2deg);
}

/* ---------- calendar ---------- */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 10px; }
.cal-header h2 { font-size: 1.5rem; }
.cal-nav { display: flex; gap: 8px; align-items: center; }

.grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  background: var(--paper); border-radius: 16px; padding: 14px;
  box-shadow: var(--shadow);
}
.grid .dow { text-align: center; font-size: .75rem; font-weight: 700; color: var(--ink-soft); padding-bottom: 6px; }

.day {
  min-height: 90px; min-width: 0; border-radius: 10px; padding: 6px;
  background: #fffdf9; border: 1px solid var(--line); cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; overflow: hidden;
  transition: background .12s, filter .12s; position: relative;
}
.day:hover { filter: brightness(0.97); }
.day.empty { background: transparent; border: none; cursor: default; }
.day.kristine { background: rgba(232,165,176,0.30); border-color: rgba(232,165,176,0.7); }
.day.tim { background: rgba(127,168,201,0.30); border-color: rgba(127,168,201,0.7); }
.day .num { font-size: .78rem; color: var(--ink-soft); font-weight: 700; }
.day.today .num {
  color: #fff; background: var(--terracotta); border-radius: 50%;
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
}
.day .evt-label {
  font-size: .65rem; line-height: 1.2; color: var(--ink);
  background: rgba(255,255,255,0.75); border-radius: 5px; padding: 1px 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.day .evt-more { color: var(--ink-soft); font-style: italic; background: transparent; padding: 1px 4px; }

/* ---------- modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(74,63,53,0.45);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.overlay.open { display: flex; }
.modal {
  background: var(--paper); border-radius: 18px; padding: 26px; width: 100%;
  max-width: 480px; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow); position: relative;
}
.modal h3 { font-size: 1.3rem; margin-bottom: 4px; }
.modal .sub { color: var(--ink-soft); font-size: .85rem; margin-bottom: 14px; }
.modal .field { margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.close-x { position: absolute; top: 18px; right: 20px; background: none; color: var(--ink-soft); font-size: 1.2rem; padding: 2px 8px; }

.day-events-list { margin: 10px 0 18px; display: flex; flex-direction: column; gap: 8px; }
.day-events-list .evt {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.day-events-list .evt .meta { font-size: .75rem; color: var(--ink-soft); }
.evt-recurring-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-state { color: var(--ink-soft); font-style: italic; padding: 12px 4px; }

.snippet-box {
  background: #fff9ef; border: 1px dashed var(--line); border-radius: 10px;
  padding: 10px; font-family: monospace; font-size: .78rem; white-space: pre-wrap;
  word-break: break-word; margin-top: 10px;
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: .85rem; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 200;
}
.toast.show { opacity: 1; }

/* ---------- corkboard / photos ---------- */
.cork {
  background-color: var(--cork);
  background-image: radial-gradient(circle, rgba(74,43,10,0.15) 1px, transparent 1px);
  background-size: 18px 18px;
  border-radius: 16px; padding: 30px;
  display: flex; flex-wrap: wrap; gap: 34px; justify-content: flex-start;
  min-height: 260px; box-shadow: var(--shadow);
}
.polaroid {
  background: #fff; padding: 10px 10px 26px; width: 190px;
  box-shadow: 0 10px 18px rgba(0,0,0,0.35); position: relative;
  font-family: 'Caveat', cursive; transform: rotate(var(--tilt, 0deg));
}
.polaroid img { width: 100%; height: 170px; object-fit: cover; display: block; background: #eee; }
.polaroid .cap { text-align: center; font-size: 1.15rem; margin-top: 8px; color: #333; }
.polaroid .ts { text-align: center; font-family: 'Quicksand', sans-serif; font-size: .65rem; color: #999; margin-top: 2px; }
.polaroid .pin {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffe28a, #b98a1f);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.polaroid-delete {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 22px; height: 22px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255,249,239,0.9); color: var(--ink-soft);
  font-size: .68rem; line-height: 1; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transform: none; box-shadow: none;
  font-family: 'Quicksand', sans-serif;
}
.polaroid-delete:hover { background: #f6e3e1; color: #b23b3b; border-color: #e3b3ae; transform: none; box-shadow: none; }

/* ---------- school / contacts page ---------- */
.card {
  background: var(--paper); border-radius: 14px; padding: 18px 20px;
  box-shadow: var(--shadow); margin-bottom: 18px;
}
.card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.card .row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .92rem; flex-wrap: wrap; }
.card .row:last-child { border-bottom: none; }
.card .row .k { color: var(--ink-soft); font-weight: 700; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.contact-grid > div {
  position: relative; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 58px 12px 14px; background: #fffdf9;
}
.contact-grid .row { padding: 5px 0; }
.icon-delete, .icon-edit {
  position: absolute; top: 10px;
  width: 18px; height: 18px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft);
  font-size: .62rem; line-height: 1; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transform: none; box-shadow: none;
}
.icon-delete { right: 8px; }
.icon-edit { right: 30px; }
.icon-delete:hover { background: #f6e3e1; color: #b23b3b; border-color: #e3b3ae; transform: none; box-shadow: none; }
.icon-edit:hover { background: #eef3e0; color: #4a7a3b; border-color: #bcd9a8; transform: none; box-shadow: none; }
.doc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.doc-list li { display: flex; align-items: center; gap: 8px; }
.doc-list a {
  background: #fff9ef; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; text-decoration: none; flex: 1;
}
.doc-list a:hover { background: #f2e3d6; }

/* ---------- click-to-reveal login info ---------- */
.secret {
  display: inline-block; background: #e7e0d1; color: var(--ink-soft);
  border-radius: 6px; padding: 2px 10px; font-size: .88rem;
  cursor: pointer; user-select: none;
}
.secret:hover { background: #ddd4bf; }
.secret.revealed {
  background: none; padding: 0; cursor: text; user-select: text;
  color: var(--ink); font-weight: 700;
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  header { padding: 14px 16px; }
  main { padding: 20px 12px 60px; }
  .day { min-height: 76px; }
  .day .evt-label { font-size: .58rem; padding: 1px 3px; }
  .contact-grid { grid-template-columns: 1fr; }
}
