/* Allison's Baking Adventures — teal #099183, hot pink #ea476f, Baloo 2 */

* { box-sizing: border-box; }

:root {
  color-scheme: light dark;
  --teal: #099183;
  --teal-dark: #067a6e;
  --pink: #ea476f;
  --pink-dark: #d12f59;
  --cream: #fff8ef;
  --cream-soft: #fffdf8;
  --border-pink: #f6c9d4;
  --border-teal: #bfe3dd;
  --ink: #33302e;
  --muted: #6b625c;
}

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

body {
  margin: 0;
  font-family: "Baloo 2", "Comic Sans MS", system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { color: var(--teal); line-height: 1.2; margin: 0 0 0.5rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 0.75rem; }

/* ---------- Header + toggle ---------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 3px solid var(--border-pink);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--teal);
  font-weight: 800;
  font-size: 1.15rem;
  min-width: 0;
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--border-pink);
}

.view-toggle {
  display: flex;
  background: var(--cream);
  border: 2px solid var(--border-pink);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.toggle-btn {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 1.3rem;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
}

.toggle-btn.active {
  background: var(--pink);
  color: #fff;
  box-shadow: 0 2px 6px rgba(234, 71, 111, 0.4);
}

.site-header .btn { align-self: center; }
.header-grownups { margin-left: auto; }

.toggle-btn:focus-visible, .btn:focus-visible, .back-btn:focus-visible,
.tab-btn:focus-visible, .lightbox-close:focus-visible,
input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

/* ---------- Layout ---------- */
main { max-width: 960px; margin: 0 auto; padding: 0 1rem 2rem; }

.section {
  background: var(--cream-soft);
  border: 2px solid var(--border-pink);
  border-radius: 20px;
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.section-intro { color: var(--muted); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 1.5rem 1rem 0.5rem;
}

.hero-logo {
  width: min(340px, 80vw);
  margin: 0 auto 0.75rem;
}

.hero-tagline {
  color: var(--teal);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0.5rem 0 0;
}

.stickers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.sticker {
  display: inline-block;
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  transform: rotate(-2deg);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.sticker-pink { background: var(--pink); }
.sticker-teal { background: var(--teal); transform: rotate(2deg); }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.bake-card {
  background: #fff;
  border: 3px solid var(--border-pink);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-align: left;
  color: inherit;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bake-card:nth-child(even) { border-color: var(--border-teal); }

.bake-card:hover, .bake-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.bake-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.bake-card-body { padding: 0.9rem 1rem 1.1rem; }
.bake-card-body h3 { margin-bottom: 0.25rem; }
.bake-card-body .tagline { color: var(--muted); margin-bottom: 0.4rem; }
.bake-card-body .date { font-weight: 700; color: var(--pink); margin: 0; font-size: 0.95rem; }

/* ---------- Detail ---------- */
.detail { margin-top: 1.25rem; }

.back-btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: var(--teal);
  background: #fff;
  border: 2px solid var(--border-teal);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  margin-bottom: 1rem;
}

.detail-hero { border-radius: 16px; overflow: hidden; margin-bottom: 1rem; }
.detail-hero img { width: 100%; max-height: 420px; object-fit: cover; }
.detail h3 { font-size: 1.7rem; }
.detail .tagline { color: var(--muted); font-size: 1.1rem; }
.detail .date { font-weight: 700; color: var(--pink); }

.stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tab-btn {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  border: 2px solid var(--border-pink);
  background: #fff;
  color: var(--teal);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
}

.tab-btn.active { background: var(--pink); border-color: var(--pink); color: #fff; }

.stage-text {
  white-space: pre-line;
  background: #fff;
  border: 2px solid var(--border-teal);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  font-size: 1.08rem;
}

.source-credit { margin-top: 0.75rem; color: var(--muted); font-weight: 600; }
.source-credit a { color: var(--pink); }

/* ---------- Photo galleries / lightbox ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.photo-card {
  background: #fff;
  border: 3px solid var(--border-pink);
  border-radius: 16px;
  padding: 0.5rem;
  margin: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.photo-card-teal { border-color: var(--border-teal); }
.photo-card:nth-child(even) { border-color: var(--border-teal); }

.photo-card img {
  width: 100%;
  border-radius: 10px;
  cursor: zoom-in;
}

.photo-card figcaption {
  padding: 0.5rem 0.25rem 0.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.photo-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-item { position: relative; padding: 0; border: 0; background: none; font-family: inherit; cursor: zoom-in; }
.gallery-item img {
  width: 100%;
  border-radius: 12px;
  border: 3px solid #fff;
  outline: 3px solid var(--border-pink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}
.gallery-item:nth-child(even) img { outline-color: var(--border-teal); }

@media (hover: hover) {
  .gallery-item:hover img { transform: scale(1.04); }
  .gallery-item:hover .expand-badge { opacity: 1; }
}

.expand-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(9, 145, 131, 0.9);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(30, 20, 25, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: min(1000px, 94vw);
  max-height: 88vh;
  width: auto;
  border-radius: 16px;
  border: 4px solid #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--pink);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Senses ---------- */
.senses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.sense-card {
  background: #fff;
  border: 3px solid var(--border-pink);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.sense-card:nth-child(even) { border-color: var(--border-teal); }

.sense-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.sense-card:nth-child(even) .sense-number { background: var(--teal); }
.sense-card h3 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.sense-card p { margin: 0; }

.credit-line { text-align: center; color: var(--muted); font-weight: 600; margin-top: 1rem; }

/* ---------- Comments ---------- */
.comment-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.25rem; }
.comment-list:empty { display: none; }

.comment-bubble {
  background: #fff;
  border: 2px solid var(--border-pink);
  border-radius: 18px 18px 18px 4px;
  padding: 0.7rem 1rem;
  max-width: 520px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transform: rotate(-1deg);
}

.comment-bubble:nth-child(even) { border-color: var(--border-teal); align-self: flex-start; transform: rotate(1deg); }

.comment-author { font-weight: 800; color: var(--teal); }
.comment-bubble p { margin: 0.15rem 0 0; }
.comment-date { font-size: 0.85rem; color: var(--muted); }

.no-comments { color: var(--muted); font-style: italic; }

/* ---------- Forms ---------- */
.add-form, .comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 640px;
}

.add-form label, .comment-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-weight: 700;
  color: var(--teal);
}

.required { color: var(--pink); }

input[type="text"], input[type="url"], input[type="password"], textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--border-pink);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  width: 100%;
}

input[type="file"] { font-family: inherit; font-size: 0.95rem; color: var(--ink); }

textarea { resize: vertical; }

.btn {
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1.6rem;
  cursor: pointer;
  align-self: flex-start;
}

.btn-pink { background: var(--pink); color: #fff; box-shadow: 0 3px 8px rgba(234, 71, 111, 0.35); }
.btn-pink:hover { background: var(--pink-dark); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dark); }

.btn-small {
  font-size: 0.95rem;
  padding: 0.4rem 1rem;
}

.btn-danger { background: #fff; color: var(--pink-dark); border: 2px solid var(--pink); }
.btn-danger:hover { background: #fdeef2; }

.form-note {
  background: #e6f5f2;
  border: 2px solid var(--border-teal);
  color: var(--teal-dark);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font-weight: 600;
  margin: 0;
}

.form-note[hidden] { display: none; }
.form-note.warning { background: #fdf3e7; border-color: #f0c98a; color: #7a5a1d; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  background: #fff;
  border: 3px dashed var(--border-pink);
  border-radius: 20px;
  margin: 1rem 0;
}

.empty-state-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--teal);
  margin: 0;
}

/* ---------- Grown-ups ---------- */
.grownups { border-color: var(--border-teal); }
.pending-list { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 1rem; }
.pending-list:empty { display: none; }

.pending-item {
  background: #fff;
  border: 2px solid var(--border-teal);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}

.pending-item p { margin: 0 0 0.4rem; }
.pending-context { font-size: 0.9rem; color: var(--muted); font-weight: 700; }
.pending-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }

/* ---------- Misc ---------- */
.loading { color: var(--muted); }
.error-msg { color: var(--pink-dark); font-weight: 700; background: #fdeef2; border: 2px solid var(--border-pink); border-radius: 12px; padding: 0.7rem 1rem; }
.error-msg[hidden] { display: none; }

.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 1rem;
  border-top: 2px solid var(--border-pink);
}

.footer-logo { width: 72px; margin: 0 auto 0.5rem; }

[hidden] { display: none !important; }

@media (max-width: 560px) {
  h2 { font-size: 1.6rem; }
  .site-header { justify-content: center; text-align: center; padding: 0.5rem 0.75rem; gap: 0.5rem; }
  .brand { font-size: 1rem; gap: 0.45rem; min-width: 0; }
  .brand img { width: 40px; height: 40px; }
  .brand-name { font-size: 1rem; line-height: 1.2; white-space: normal; flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
  .section { padding: 1rem; }
  .toggle-btn { padding: 0.4rem 0.9rem; font-size: 0.95rem; }
  .btn { font-size: 0.95rem; padding: 0.55rem 1.2rem; }
  .sense-number { width: 56px; height: 56px; font-size: 1.9rem; }
}

/* ---------- Dark mode: follows the device setting, like the artifact ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --cream: #221a1e;
    --cream-soft: #2e2329;
    --border-pink: #6b3a49;
    --border-teal: #1e4a44;
    --ink: #f6ece4;
    --muted: #c9b3a8;
  }

  .site-header { background: #2e2329; }

  .bake-card, .photo-card, .sense-card, .comment-bubble, .pending-item,
  .stage-text, .empty-state { background: #2e2329; }

  .back-btn, .tab-btn { background: #2e2329; }

  input[type="text"], input[type="url"], input[type="password"], textarea {
    background: #2e2329;
    color: var(--ink);
  }

  input[type="file"] { color: var(--ink); }

  .btn-danger { background: #2e2329; }
  .btn-danger:hover { background: #40222e; }

  .form-note { background: #1e3a35; color: #bfe3dd; }
  .form-note.warning { background: #3a2c17; border-color: #6b5322; color: #e8c98a; }

  .error-msg { background: #3d2230; }

  .gallery-item img { border-color: #2e2329; }
}
