/* -----------------------------------------------------------------
   Family Website - Warm & Homey theme
   Soft earth tones, rounded corners, friendly typography.
----------------------------------------------------------------- */

:root {
  --cream:       #faf4ea;
  --cream-dark:  #f2e9d6;
  --paper:       #ffffff;
  --ink:         #3b2e23;
  --ink-soft:    #5d4a3a;
  --muted:       #8b7a66;
  --rust:        #b05a3c;
  --rust-dark:   #8f4629;
  --sage:        #6f8a6a;
  --sage-dark:   #536d4e;
  --sunflower:   #e1a740;
  --border:      #e6d9c2;
  --danger:      #a83d3d;
  --shadow:      0 2px 8px rgba(75, 55, 35, 0.07);
  --shadow-lg:   0 10px 30px rgba(75, 55, 35, 0.12);
  --radius:      14px;
  --radius-sm:   8px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Georgia', 'Iowan Old Style', 'Palatino Linotype', serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 15% -10%, #fff3dc 0%, transparent 60%),
    radial-gradient(1000px 500px at 100% 10%, #fbe4d0 0%, transparent 55%),
    var(--cream);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: 'Georgia', 'Iowan Old Style', serif;
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

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

/* ----- Layout ----- */

.site {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.brand {
  font-family: 'Georgia', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
}
.brand a { color: inherit; text-decoration: none; }
.brand .brand-mark {
  display: inline-block;
  width: 10px; height: 10px;
  background: var(--rust);
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: 2px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.nav a {
  color: var(--ink-soft);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s ease;
}
.nav a:hover { background: var(--cream-dark); }
.nav a.active {
  background: var(--ink);
  color: var(--cream);
}

.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ----- Cards / panels ----- */

.panel {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.panel h2:first-child, .panel h3:first-child { margin-top: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card a.card-link { color: inherit; text-decoration: none; display: block; }
.card .card-body { padding: 1rem 1.1rem 1.1rem; }
.card .card-title { font-size: 1.1rem; margin: 0 0 0.3rem; }
.card .card-meta { color: var(--muted); font-size: 0.85rem; }
.card .card-cover {
  aspect-ratio: 4/3;
  background: var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 2rem;
}
.card .card-cover img { width: 100%; height: 100%; object-fit: cover; }

/* ----- Buttons ----- */

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.05s ease;
  background: var(--ink);
  color: var(--cream);
}
.btn:hover { background: var(--ink-soft); text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--rust); color: #fff7ea; }
.btn-primary:hover { background: var(--rust-dark); }

.btn-secondary {
  background: var(--cream-dark);
  color: var(--ink);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--cream-dark); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #822f2f; }

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.85rem; }

/* ----- Forms ----- */

form.stack > * + * { margin-top: 0.85rem; }

label { display: block; font-weight: 600; color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 0.3rem; }

input[type="text"], input[type="password"], input[type="date"], input[type="time"],
input[type="email"], input[type="url"], input[type="file"], textarea, select {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(176, 90, 60, 0.15);
}

textarea { min-height: 8rem; resize: vertical; font-family: inherit; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

/* ----- Page header (title + action) ----- */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.page-head .page-title { margin: 0; }
.page-head .page-subtitle { color: var(--muted); margin: 0.2rem 0 0; }

/* ----- Flash messages ----- */

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  background: var(--cream-dark);
}
.flash.success { border-color: #b5cfa9; background: #e8f2e2; color: #3d5a32; }
.flash.error   { border-color: #e3b7b0; background: #fbe3dc; color: #7a2d22; }

/* ----- Tags / pills ----- */

.tag {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--cream-dark);
  color: var(--ink-soft);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.tag.rust    { background: #f5dccb; color: var(--rust-dark); }
.tag.sage    { background: #dfe8da; color: var(--sage-dark); }
.tag.sun     { background: #fbe8c2; color: #7a5a18; }
.tag.neutral { background: var(--cream-dark); color: var(--ink-soft); }

/* ----- Login / setup card ----- */

.auth-shell {
  max-width: 420px;
  margin: 4rem auto;
  padding: 2.25rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.auth-shell h1 { text-align: center; font-size: 1.6rem; }
.auth-shell p.lead { text-align: center; color: var(--muted); margin-bottom: 1.5rem; }

/* ----- Photo grid ----- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem;
}
.photo-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--cream-dark);
}
.photo-tile img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.25s ease;
}
.photo-tile:hover img { transform: scale(1.04); }
.photo-tile .photo-delete {
  position: absolute; top: 6px; right: 6px;
  opacity: 0; transition: opacity 0.15s ease;
}
.photo-tile:hover .photo-delete { opacity: 1; }

/* ----- Lists ----- */

.listing { list-style: none; padding: 0; margin: 0; }
.listing li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--border);
}
.listing li:last-child { border-bottom: none; }
.listing .meta { color: var(--muted); font-size: 0.88rem; }

.itinerary-day { margin-top: 1.25rem; }
.itinerary-day h4 { margin-bottom: 0.4rem; color: var(--rust-dark); }

/* ----- Calendar ----- */

.calendar-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  margin-bottom: 1rem;
}
.calendar-head .month-title { font-size: 1.4rem; margin: 0; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar-grid .weekday {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: center;
  padding: 0.25rem 0;
}
.calendar-grid .day {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 80px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}
.calendar-grid .day.empty { background: transparent; border-color: transparent; }
.calendar-grid .day.today { border-color: var(--rust); box-shadow: 0 0 0 2px rgba(176, 90, 60, 0.2); }
.calendar-grid .day .date-num { font-weight: 700; color: var(--ink-soft); }
.calendar-grid .day .event {
  background: var(--cream-dark);
  color: var(--ink);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar-grid .day .event.school      { background: #dfe8da; color: var(--sage-dark); }
.calendar-grid .day .event.birthday    { background: #fbe8c2; color: #7a5a18; }
.calendar-grid .day .event.appointment { background: #f5dccb; color: var(--rust-dark); }
.calendar-grid .day .event.holiday     { background: #e1d4ec; color: #4e3e65; }

/* ----- Musings / prose ----- */

.prose {
  max-width: 680px;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink);
}
.prose h1, .prose h2 { color: var(--ink); }
.prose blockquote {
  border-left: 3px solid var(--rust);
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 1rem 0;
}

/* ----- Misc ----- */

.muted { color: var(--muted); }
.center { text-align: center; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; }
.row-split { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.actions { display: inline-flex; gap: 0.4rem; align-items: center; }
.hidden-submit { display: none; }

/* ----- Empty states ----- */

.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}
.empty .big-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }

/* ----- Responsive tweaks ----- */

@media (max-width: 640px) {
  .site-header { flex-direction: column; align-items: flex-start; }
  .nav { width: 100%; overflow-x: auto; }
  h1 { font-size: 1.65rem; }
  .panel { padding: 1.1rem; }
  .calendar-grid .day { min-height: 60px; font-size: 0.78rem; }
}
