/* ═══════════════════════════════════════════════════════
   style.css — cozy digital journal
   ═══════════════════════════════════════════════════════
   TABLE OF CONTENTS
   1.  Fonts & Variables
   2.  Reset & Base
   3.  Page Layout
   4.  Header & Banner
   5.  Navigation
   6.  Widget System (the little boxes)
   7.  Sidebar — Left
   8.  Sidebar — Right
   9.  Dashboard / Home
   10. Journal Entry List
   11. New Entry Form / Editor
   12. Single Entry View
   13. Search & Filter Bar
   14. Photoblog Grid
   15. Mood Selector
   16. Pixel Pets / Adopted
   17. Fanlistings / Stamps
   18. Guestbook
   19. Toast Notifications
   20. Modal / Overlay
   21. Footer
   22. Animations & Hover
   23. Scrollbar
   24. Responsive (mobile)
   ═══════════════════════════════════════════════════════ */


/* ──────────────────────────────────────────
   1. FONTS & VARIABLES
   ────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400;1,600&family=Nunito:wght@400;600;700&family=Homemade+Apple&display=swap');

:root {
  /* PALETTE — change these to repaint the whole site */
  --cream:       #f7f2e9;   /* page background */
  --cream-mid:   #ede6d6;   /* widget backgrounds */
  --cream-dark:  #e0d5c1;   /* borders, dividers */
  --parchment:   #f9f5ec;   /* entry backgrounds */
  --pink:        #e8c4c4;   /* dusty rose */
  --pink-soft:   #f2dada;   /* light pink */
  --sage:        #9db89a;   /* sage green */
  --sage-light:  #c8d9c6;   /* light sage */
  --brown:       #7a5c44;   /* warm brown text */
  --brown-soft:  #a07858;   /* medium brown */
  --brown-pale:  #c4aa90;   /* light brown borders */
  --text:        #4a3728;   /* main text */
  --text-soft:   #8a7060;   /* secondary text */
  --text-muted:  #b09880;   /* placeholder text */
  --link:        #7a8fa6;   /* links */
  --link-hover:  #4a6f8a;
  --danger:      #c47a7a;   /* delete button */
  --success:     #7aab7a;   /* save button */

  /* SPACING */
  --gap:    8px;
  --radius: 3px;

  /* SHADOW */
  --shadow-sm: 2px 2px 0 rgba(90,60,30,0.08);
  --shadow:    3px 3px 6px rgba(90,60,30,0.12);
}

/* ──────────────────────────────────────────
   2. RESET & BASE
   ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--cream);
  /* subtle linen texture via CSS — no image needed */
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 24px,
      rgba(180,150,110,0.04) 24px,
      rgba(180,150,110,0.04) 25px
    );
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

h1, h2, h3 {
  font-family: 'Lora', serif;
  font-weight: 600;
  line-height: 1.3;
}

button, input, textarea, select {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
}

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

::selection {
  background: var(--pink);
  color: var(--text);
}

/* ──────────────────────────────────────────
   3. PAGE LAYOUT
   ────────────────────────────────────────── */
#page-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 12px;
}

/* Three-column grid: left sidebar | main | right sidebar */
#content-grid {
  display: grid;
  grid-template-columns: 190px 1fr 190px;
  gap: var(--gap);
  align-items: start;
}

#left-sidebar, #right-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

#main-content {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0; /* prevent grid blowout */
}

/* ──────────────────────────────────────────
   4. HEADER / BANNER
   ────────────────────────────────────────── */
#site-header {
  margin-bottom: var(--gap);
  position: relative;
}

.banner {
  width: 100%;
  height: 120px;
  background:
    linear-gradient(135deg,
      rgba(232,196,196,0.7) 0%,
      rgba(247,242,233,0.5) 40%,
      rgba(200,217,198,0.6) 100%
    ),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(180,150,110,0.03) 10px,
      rgba(180,150,110,0.03) 11px
    );
  border: 1px solid var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Decorative pressed-flower circles in the banner */
.banner::before, .banner::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.25;
}
.banner::before {
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--pink) 0%, transparent 70%);
  top: -60px; left: -40px;
}
.banner::after {
  width: 150px; height: 150px;
  background: radial-gradient(circle, var(--sage-light) 0%, transparent 70%);
  bottom: -50px; right: 80px;
}

.banner-text {
  position: relative;
  z-index: 1;
  text-align: center;
}

.banner-title {
  font-family: 'Homemade Apple', cursive;
  /* CHANGE THIS: your site name */
  font-size: 28px;
  color: var(--brown);
  text-shadow: 1px 1px 0 rgba(255,255,255,0.6);
  display: block;
  line-height: 1.4;
}

.banner-sub {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-soft);
  display: block;
  margin-top: 4px;
}

/* ──────────────────────────────────────────
   5. NAVIGATION
   ────────────────────────────────────────── */
#site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  border: 1px solid var(--cream-dark);
  border-top: none;
  background: var(--cream-mid);
  padding: 4px 8px;
}

.nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-family: 'Nunito', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-soft);
  padding: 4px 10px;
  border-right: 1px solid var(--cream-dark);
  transition: color 0.15s, background 0.15s;
  position: relative;
}
.nav-btn:last-child { border-right: none; }
.nav-btn:hover, .nav-btn.active {
  color: var(--brown);
  background: rgba(255,255,255,0.5);
}
.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--pink);
  border-radius: 2px;
}

/* ──────────────────────────────────────────
   6. WIDGET SYSTEM
   ────────────────────────────────────────── */
.widget {
  background: var(--cream-mid);
  border: 1px solid var(--cream-dark);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
}

/* Title bar of every widget */
.widget-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-soft);
  padding: 5px 8px;
  border-bottom: 1px solid var(--cream-dark);
  background: rgba(255,255,255,0.35);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

/* The □ × decorations in every title bar */
.widget-title .w-controls {
  font-size: 9px;
  color: var(--brown-pale);
  gap: 3px;
  display: flex;
}
.widget-title .w-controls span {
  cursor: pointer;
  transition: color 0.15s;
}
.widget-title .w-controls span:hover { color: var(--brown-soft); }

.widget-body {
  padding: 9px 10px;
}

/* Collapsible widget state */
.widget.collapsed .widget-body { display: none; }

/* ──────────────────────────────────────────
   7. SIDEBAR WIDGET CONTENTS — LEFT
   ────────────────────────────────────────── */

/* Profile */
.profile-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.profile-pic {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 2px solid var(--cream-dark);
  flex-shrink: 0;
  border-radius: 2px;
}
.profile-pic-placeholder {
  width: 56px; height: 56px;
  background: var(--cream);
  border: 1px dashed var(--brown-pale);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.profile-name {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--brown);
  display: block;
}
.profile-sub {
  font-size: 11px;
  color: var(--text-soft);
  display: block;
  line-height: 1.5;
}

/* Currently widget */
.currently-list {
  list-style: none;
  font-size: 12px;
}
.currently-list li {
  padding: 3px 0;
  border-bottom: 1px dotted var(--cream-dark);
  display: flex;
  gap: 5px;
  align-items: baseline;
}
.currently-list li:last-child { border-bottom: none; }
.c-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 52px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
/* These are editable inline */
.c-value {
  color: var(--text);
  flex: 1;
  cursor: text;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s;
  outline: none;
  min-width: 0;
}
.c-value:focus {
  border-color: var(--pink);
}

/* Mood display in sidebar */
.mood-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-soft);
  padding: 3px 8px;
  background: var(--parchment);
  border: 1px solid var(--cream-dark);
  border-radius: 20px;
  margin-top: 4px;
}

/* Moon phase */
.moon-display {
  font-size: 36px;
  text-align: center;
  padding: 6px 0 2px;
  line-height: 1;
}
.moon-name {
  text-align: center;
  font-size: 11px;
  color: var(--text-soft);
  font-style: italic;
}

/* Updates list */
.upd-list {
  list-style: none;
  font-size: 12px;
}
.upd-list li {
  padding: 3px 0;
  border-bottom: 1px dotted var(--cream-dark);
  display: flex;
  gap: 6px;
}
.upd-list li:last-child { border-bottom: none; }
.upd-date {
  font-size: 10px;
  color: var(--sage);
  font-weight: 700;
  flex-shrink: 0;
}

/* ──────────────────────────────────────────
   8. SIDEBAR WIDGET CONTENTS — RIGHT
   ────────────────────────────────────────── */

/* Reading mini widget */
.reading-block { margin-bottom: 8px; }
.reading-block:last-of-type { margin-bottom: 0; }
.reading-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}
.reading-title {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--brown);
  display: block;
}
.reading-author {
  font-size: 11px;
  color: var(--text-soft);
}

/* Site info */
.site-info-list {
  list-style: none;
  font-size: 11px;
  color: var(--text-soft);
  line-height: 2;
}

/* Mini star rating */
.stars { color: var(--brown-soft); font-size: 11px; letter-spacing: 1px; }

/* Pixel pets */
.pixel-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pixel-grid img {
  width: 40px; height: 40px;
  image-rendering: pixelated;
  transition: transform 0.2s;
}
.pixel-grid img:hover { transform: scale(1.2) rotate(-3deg); }
.pixel-empty {
  width: 40px; height: 40px;
  border: 1px dashed var(--brown-pale);
  background: var(--cream);
  border-radius: 2px;
}

/* Fanlistings stamps */
.stamp-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.stamp-grid img {
  width: 88px; height: 31px;
  object-fit: cover;
  image-rendering: pixelated;
  border: 1px solid var(--cream-dark);
  transition: transform 0.15s, box-shadow 0.15s;
}
.stamp-grid img:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.12);
}
.stamp-empty {
  width: 88px; height: 31px;
  border: 1px dashed var(--brown-pale);
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--text-muted);
}

/* ──────────────────────────────────────────
   9. DASHBOARD / HOME
   ────────────────────────────────────────── */
.welcome-box {
  font-size: 13px;
  line-height: 1.8;
}
.welcome-box p { margin-bottom: 8px; }
.welcome-sig {
  font-family: 'Homemade Apple', cursive;
  font-size: 18px;
  color: var(--brown-soft);
  display: block;
  margin-top: 6px;
}

/* Mini calendar */
.mini-cal {
  float: right;
  margin: 0 0 10px 12px;
  background: var(--parchment);
  border: 1px solid var(--cream-dark);
  padding: 6px 8px;
  font-size: 10px;
  text-align: center;
  min-width: 120px;
}
.cal-month-label {
  font-weight: 700;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-soft);
  margin-bottom: 4px;
}
.mini-cal table { border-collapse: collapse; width: 100%; }
.mini-cal th, .mini-cal td {
  width: 16px;
  height: 15px;
  text-align: center;
  font-size: 9px;
  padding: 1px;
}
.mini-cal th { color: var(--text-muted); }
.mini-cal .cal-today {
  background: var(--pink);
  color: var(--brown);
  border-radius: 50%;
  font-weight: 700;
}
.clearfix::after { content: ''; display: table; clear: both; }

/* Quick stats bar */
.stats-bar {
  display: flex;
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.stat-box {
  flex: 1;
  background: var(--parchment);
  border: 1px solid var(--cream-dark);
  padding: 10px;
  text-align: center;
  border-radius: var(--radius);
}
.stat-num {
  font-family: 'Lora', serif;
  font-size: 22px;
  color: var(--brown);
  display: block;
  line-height: 1;
}
.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ──────────────────────────────────────────
   10. JOURNAL ENTRY LIST
   ────────────────────────────────────────── */
.entry-card {
  background: var(--parchment);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: var(--gap);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
  /* notebook left margin line */
  border-left: 3px solid var(--pink-soft);
}
.entry-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.entry-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.entry-card-title {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 16px;
  color: var(--brown);
  cursor: pointer;
}
.entry-card-title:hover { color: var(--link); }

.entry-card-date {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  flex-shrink: 0;
  margin-top: 3px;
}

.entry-card-mood {
  font-size: 16px;
  flex-shrink: 0;
}

.entry-card-preview {
  font-size: 12.5px;
  color: var(--text-soft);
  margin-bottom: 8px;
  line-height: 1.6;
}

.entry-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.tag-pill {
  font-size: 10px;
  background: var(--cream-dark);
  color: var(--text-soft);
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid var(--brown-pale);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tag-pill:hover, .tag-pill.active {
  background: var(--sage-light);
  color: var(--brown);
  border-color: var(--sage);
}

.entry-card-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ──────────────────────────────────────────
   11. NEW ENTRY FORM / EDITOR
   ────────────────────────────────────────── */
.entry-form {
  background: var(--parchment);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  /* lined paper effect */
  background-image:
    repeating-linear-gradient(
      transparent,
      transparent 25px,
      rgba(180,150,110,0.1) 25px,
      rgba(180,150,110,0.1) 26px
    );
  background-attachment: local;
}

.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 120px;
}

.form-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.form-input {
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 6px 9px;
  color: var(--text);
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(232,196,196,0.3);
}
.form-input::placeholder { color: var(--text-muted); }

#entry-title-input {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 17px;
  padding: 8px 10px;
}

#entry-body {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 2.0; /* matches the lined-paper spacing */
  font-family: 'Nunito', sans-serif;
  transition: border-color 0.2s;
}
#entry-body:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(232,196,196,0.2);
}

/* Mood selector grid */
.mood-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}
.mood-option {
  font-size: 20px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  background: none;
  line-height: 1;
}
.mood-option:hover { transform: scale(1.2); }
.mood-option.selected {
  border-color: var(--pink);
  background: var(--pink-soft);
}

/* Tag input area */
.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 4px 7px;
  min-height: 34px;
  cursor: text;
  transition: border-color 0.2s;
}
.tag-input-wrap:focus-within {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(232,196,196,0.3);
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  background: var(--sage-light);
  border: 1px solid var(--sage);
  border-radius: 10px;
  padding: 1px 8px;
  color: var(--brown);
}
.tag-chip .remove-tag {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1;
  transition: color 0.15s;
}
.tag-chip .remove-tag:hover { color: var(--danger); }
#tag-input-field {
  border: none;
  outline: none;
  background: transparent;
  font-size: 12px;
  color: var(--text);
  flex: 1;
  min-width: 80px;
}

/* Form buttons */
.btn-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
  flex-wrap: wrap;
}

.btn {
  padding: 7px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--sage);
  color: #fff;
  border-color: #7a9878;
  box-shadow: 0 2px 0 #6a8868;
}
.btn-secondary {
  background: var(--cream-dark);
  color: var(--text);
  border-color: var(--brown-pale);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: #a86060;
  box-shadow: 0 2px 0 #a06060;
}
.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--cream-dark);
}
.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}
.btn-new-entry {
  width: 100%;
  background: var(--pink-soft);
  color: var(--brown);
  border: 1px dashed var(--pink);
  font-size: 13px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.2s;
  font-weight: 600;
}
.btn-new-entry:hover { background: var(--pink); }

/* ──────────────────────────────────────────
   12. SINGLE ENTRY VIEW
   ────────────────────────────────────────── */
.entry-full {
  background: var(--parchment);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  background-image:
    repeating-linear-gradient(
      transparent,
      transparent 25px,
      rgba(180,150,110,0.08) 25px,
      rgba(180,150,110,0.08) 26px
    );
  border-left: 4px solid var(--pink-soft);
  position: relative;
}

.entry-full-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dotted var(--cream-dark);
}

.entry-full-title {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 22px;
  color: var(--brown);
  margin-bottom: 6px;
}

.entry-full-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
}

.entry-full-body {
  font-size: 14px;
  line-height: 2.0;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.back-btn:hover { background: var(--cream-dark); text-decoration: none; }

/* ──────────────────────────────────────────
   13. SEARCH & FILTER BAR
   ────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: var(--gap);
}

.search-input {
  flex: 1;
  background: var(--parchment);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 6px 10px;
  color: var(--text);
  min-width: 140px;
  transition: border-color 0.2s;
}
.search-input:focus {
  outline: none;
  border-color: var(--pink);
}

.filter-select {
  background: var(--parchment);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 6px 8px;
  color: var(--text);
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--pink); }

.result-count {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 4px;
}

/* ──────────────────────────────────────────
   14. PHOTOBLOG GRID
   ────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.photo-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.25s;
  display: block;
}
.photo-item:hover img {
  transform: scale(1.07) rotate(1deg);
}

.photo-placeholder {
  aspect-ratio: 1;
  background: var(--cream);
  border: 1px dashed var(--brown-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-muted);
}

.view-more-link {
  font-size: 11px;
  color: var(--text-soft);
  text-align: right;
  display: block;
  margin-top: 5px;
}

/* ──────────────────────────────────────────
   15. MOOD SELECTOR (standalone widget)
   ────────────────────────────────────────── */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  text-align: center;
}
.mood-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 5px 2px;
  cursor: pointer;
  font-size: 18px;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.mood-btn span:last-child {
  font-size: 9px;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  line-height: 1;
}
.mood-btn:hover { transform: scale(1.15); background: var(--cream); }
.mood-btn.active {
  background: var(--pink-soft);
  border-color: var(--pink);
}

/* ──────────────────────────────────────────
   17. GUESTBOOK
   ────────────────────────────────────────── */
.gbook-log {
  max-height: 130px;
  overflow-y: auto;
  margin-bottom: 8px;
  padding-right: 4px;
}
.gbook-msg {
  border-bottom: 1px dotted var(--cream-dark);
  padding: 5px 0;
  font-size: 12px;
}
.gbook-msg:last-child { border-bottom: none; }
.gbook-sender { font-weight: 700; color: var(--sage); }
.gbook-date { font-size: 10px; color: var(--text-muted); }
.gbook-input {
  width: 100%;
  background: var(--parchment);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 5px 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 5px;
  resize: none;
  transition: border-color 0.2s;
}
.gbook-input:focus { outline: none; border-color: var(--pink); }
.gbook-note {
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 6px;
}

/* ──────────────────────────────────────────
   18. TOAST NOTIFICATIONS
   ────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--parchment);
  border: 1px solid var(--cream-dark);
  border-left: 3px solid var(--sage);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  pointer-events: all;
}
.toast.error { border-left-color: var(--danger); }

@keyframes toastIn  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* ──────────────────────────────────────────
   19. MODAL / OVERLAY
   ────────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 55, 40, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-box {
  background: var(--parchment);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  transform: scale(0.96);
  transition: transform 0.2s;
}
#modal-overlay.open .modal-box { transform: scale(1); }
.modal-title {
  font-family: 'Lora', serif;
  font-size: 16px;
  color: var(--brown);
  margin-bottom: 10px;
}
.modal-body { font-size: 13px; color: var(--text-soft); margin-bottom: 16px; }

/* ──────────────────────────────────────────
   20. FOOTER
   ────────────────────────────────────────── */
#site-footer {
  text-align: center;
  padding: 14px 0 8px;
  margin-top: 10px;
  border-top: 1px dotted var(--cream-dark);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 2;
}
.footer-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0;
}
.footer-badges img {
  height: 31px;
  image-rendering: pixelated;
  transition: transform 0.15s;
}
.footer-badges img:hover { transform: translateY(-2px); }
.footer-badges .stamp-empty {
  height: 31px;
  width: 88px;
}

/* ──────────────────────────────────────────
   21. ANIMATIONS & HOVER
   ────────────────────────────────────────── */
@keyframes wiggle {
  0%, 100% { transform: rotate(-2deg); }
  50%       { transform: rotate(2deg); }
}
.wiggle-hover:hover { animation: wiggle 0.4s ease infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}
.float { animation: float 3s ease-in-out infinite; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 36px; margin-bottom: 8px; }
.empty-state p { font-size: 13px; font-style: italic; }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--cream-dark);
  border-top-color: var(--sage);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ──────────────────────────────────────────
   22. SCROLLBAR
   ────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--cream-mid); }
::-webkit-scrollbar-thumb { background: var(--brown-pale); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--brown-soft); }

/* ──────────────────────────────────────────
   23. RESPONSIVE
   ────────────────────────────────────────── */
@media (max-width: 768px) {
  #content-grid {
    grid-template-columns: 1fr;
  }
  #left-sidebar  { order: 2; }
  #main-content  { order: 1; }
  #right-sidebar { order: 3; }

  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-bar  { flex-wrap: wrap; }
  .stat-box   { min-width: calc(50% - 4px); }
  .form-row   { flex-direction: column; }
  .entry-full { padding: 14px; }
}

@media (max-width: 480px) {
  .banner-title { font-size: 20px; }
  .mood-grid    { grid-template-columns: repeat(4, 1fr); }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════
   ADDITIONS — Auth, Rich Editor, Images, Dashboard
   ═══════════════════════════════════════════════════════ */

/* ── ADMIN BAR ── */
#admin-bar {
  background: var(--cream-mid);
  border-bottom: 1px solid var(--cream-dark);
  padding: 5px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-soft);
  gap: 8px;
  flex-wrap: wrap;
}
#admin-bar-greeting { font-style: italic; color: var(--sage); }
#admin-bar-actions  { display: flex; gap: 6px; }

/* Tiny key icon in banner corner */
.auth-corner-btn {
  position: absolute;
  bottom: 8px; right: 10px;
  background: rgba(255,255,255,0.4);
  border: 1px solid rgba(200,191,175,0.5);
  border-radius: var(--radius);
  padding: 2px 6px;
  font-size: 13px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.auth-corner-btn:hover { opacity: 1; }

/* ── VISIBILITY TOGGLE ── */
.visibility-toggle {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}
.vis-option {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  cursor: pointer;
  padding: 3px 8px;
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  background: var(--parchment);
  transition: background 0.15s, border-color 0.15s;
}
.vis-option:has(input:checked) {
  background: var(--sage-light);
  border-color: var(--sage);
}
.vis-option input { display: none; }

/* ── CHECKBOX LABELS ── */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.checkbox-label input[type="checkbox"] {
  accent-color: var(--sage);
  width: 13px; height: 13px;
}

/* ── RICH TEXT EDITOR ── */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--cream-mid);
  border: 1px solid var(--cream-dark);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 4px 6px;
  flex-wrap: wrap;
}
.toolbar-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 2px 7px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
  line-height: 1.4;
  min-width: 26px;
  text-align: center;
}
.toolbar-btn:hover {
  background: var(--cream-dark);
  border-color: var(--brown-pale);
}
.toolbar-sep {
  color: var(--cream-dark);
  margin: 0 3px;
  font-size: 14px;
}

.rich-editor {
  width: 100%;
  min-height: 260px;
  max-height: 600px;
  overflow-y: auto;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--cream-dark);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 12px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 2.0;
  font-family: 'Nunito', sans-serif;
  outline: none;
  word-break: break-word;
}
.rich-editor:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(232,196,196,0.2); }
.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
  font-style: italic;
}
.rich-editor blockquote {
  border-left: 3px solid var(--pink);
  margin: 8px 0;
  padding-left: 10px;
  color: var(--text-soft);
  font-style: italic;
}
.rich-editor ul { margin-left: 18px; }
.rich-editor a  { color: var(--link); }

/* ── COVER IMAGE DROP ZONE ── */
.cover-drop-zone {
  width: 100%;
  height: 160px;
  border: 2px dashed var(--brown-pale);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
  background: var(--cream);
  transition: border-color 0.2s, background 0.2s;
}
.cover-drop-zone:hover { border-color: var(--pink); background: var(--pink-soft); }
.cover-drop-zone.drag-over { border-color: var(--sage); background: var(--sage-light); }
.cover-drop-zone img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}
#cover-placeholder { text-align: center; pointer-events: none; }
.cover-remove-btn {
  position: absolute;
  top: 6px; right: 8px;
  background: rgba(196,122,122,0.85);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  z-index: 2;
}
.cover-remove-btn:hover { background: var(--danger); }

/* ── IMAGE UPLOAD DROP ZONE ── */
.img-drop-zone {
  width: 100%;
  padding: 20px;
  border: 2px dashed var(--brown-pale);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  background: var(--cream);
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}
.img-drop-zone:hover { border-color: var(--sage); background: rgba(200,217,198,0.15); }
.img-drop-zone.drag-over { border-color: var(--sage); background: var(--sage-light); }

/* ── IMAGE PREVIEW GRID ── */
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.img-preview-item {
  position: relative;
  aspect-ratio: 1;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  overflow: visible;
}
.img-preview-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}
.img-preview-item .img-remove {
  position: absolute;
  top: -6px; right: -6px;
  width: 18px; height: 18px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
  padding: 0;
}
.img-preview-item .img-caption {
  width: 100%;
  border: none;
  border-top: 1px dotted var(--cream-dark);
  background: transparent;
  font-size: 10px;
  color: var(--text-soft);
  padding: 2px 4px;
  font-family: 'Nunito', sans-serif;
  outline: none;
  margin-top: 2px;
  display: block;
}
.img-preview-item .img-caption::placeholder { color: var(--text-muted); }

/* ── UPLOAD PROGRESS BAR ── */
.progress-bar-track {
  height: 6px;
  background: var(--cream-dark);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--sage);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ── ENTRY COVER IMAGE (in view) ── */
.entry-cover {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

/* ── ENTRY IMAGE GALLERY ── */
.entry-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dotted var(--cream-dark);
}
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.gallery-item:hover { transform: scale(1.03) rotate(0.5deg); box-shadow: var(--shadow); }
.gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.gallery-caption {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: 3px 4px;
  background: rgba(255,255,255,0.7);
  font-style: italic;
}

/* ── LIGHTBOX ── */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(30,20,10,0.88);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
}
#lightbox.open { display: flex; }
#lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}
#lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border: 3px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  display: block;
  margin: 0 auto;
}
#lightbox-caption {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-style: italic;
  margin-top: 8px;
}
#lightbox-close {
  position: absolute;
  top: -14px; right: -14px;
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  line-height: 28px;
  text-align: center;
  padding: 0;
  transition: background 0.2s;
}
#lightbox-close:hover { background: var(--danger); }

/* ── ENTRY CARD — badges for private/pinned/fave ── */
.entry-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid;
  margin-right: 3px;
  vertical-align: middle;
}
.badge-private { background: #f8e8e8; border-color: var(--pink); color: var(--danger); }
.badge-pinned  { background: #fff8e0; border-color: #d4b800; color: #8a7000; }
.badge-fave    { background: #fffae0; border-color: #d4b800; color: #8a7000; }
.badge-draft   { background: var(--cream-dark); border-color: var(--brown-pale); color: var(--text-soft); }

/* Pinned entry card gets a subtle highlight */
.entry-card.is-pinned { border-left-color: #e0c84a; }
.entry-card.is-fave   { border-left-color: var(--sage); }

/* ── DASHBOARD MINI ENTRY ROWS ── */
.dash-entry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px dotted var(--cream-dark);
  font-size: 12px;
  gap: 8px;
}
.dash-entry-row:last-child { border-bottom: none; }
.dash-entry-title {
  font-family: 'Lora', serif;
  font-style: italic;
  color: var(--brown);
  cursor: pointer;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-entry-title:hover { color: var(--link); }
.dash-entry-date { font-size: 10px; color: var(--text-muted); flex-shrink: 0; }

/* ── TAG CLOUD ── */
.tag-cloud-item {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  background: var(--cream-dark);
  border: 1px solid var(--brown-pale);
  font-size: 11px;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tag-cloud-item:hover { background: var(--sage-light); color: var(--brown); border-color: var(--sage); }

/* ── AUTH STATUS in sidebar ── */
#auth-status-widget .logged-in-status {
  color: var(--sage);
  font-style: italic;
}
#auth-status-widget .logged-out-status {
  color: var(--text-muted);
  font-style: italic;
}

/* ── ENTRY CARD COVER THUMBNAIL ── */
.entry-card-cover-thumb {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  display: block;
  margin-bottom: 8px;
  cursor: pointer;
  transition: filter 0.2s;
}
.entry-card-cover-thumb:hover { filter: brightness(1.05); }
