:root {
  color-scheme: light;
  --navy: #2b3a52;
  --sky: #7bb8d4;
  --gold: #d4943a;
  --green: #4e7c3a;
  --sand: #e8d5a3;
  --sand-lt: #f5edd6;
  --cream: #fdfaf3;
  --warm: #f0e8ce;
  --brown: #7a5230;
  --yellow: #f5c342;
  --yellow-lt: #fdf3cc;
  --red: #e96a6a;
  --purple: #c47fd4;

  --bg: #f2ede4;
  --border: rgba(43, 58, 82, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --gap: 1rem;
  --tabbar-height: 64px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--navy);
  line-height: 1.6;
}

h1,
h2,
h3,
h4 {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--navy);
}

h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

a {
  color: var(--navy);
}

/* ---- Topnav (desktop) ---- */
.topnav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topnav .brand {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.2rem;
  margin-right: auto;
  text-decoration: none;
  color: var(--navy);
}

.topnav .brand::after {
  content: '.';
  color: var(--gold);
}

.topnav a {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--navy);
  opacity: 0.7;
}

.topnav a:hover {
  opacity: 1;
}

.topnav form.inline-form button {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
}

/* ---- Family switcher bar ---- */
.familybar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem;
  background: var(--sand-lt);
  border-bottom: 1px solid var(--border);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
}

.familybar a {
  text-decoration: none;
  color: var(--brown);
}

.familybar .switch-hint {
  margin-left: 0.5rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-decoration: underline;
}

.familybar-icons {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.familybar-icons a {
  font-size: 1.1rem;
}

.familybar-new {
  opacity: 0.7;
  font-size: 0.8rem !important;
}

.familybar-upload {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.8rem !important;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: #fff !important;
}

/* ---- Bottom tab bar (mobile) ---- */
.tabbar {
  display: none;
}

@media (max-width: 720px) {
  .topnav {
    display: none;
  }

  .tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: #fff;
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .tabbar a,
  .tabbar button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0.5rem 0.25rem;
    min-height: 44px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.65rem;
    text-decoration: none;
    color: var(--navy);
    opacity: 0.55;
    background: none;
    border: none;
    cursor: pointer;
  }

  .tabbar a.active {
    opacity: 1;
    color: var(--gold);
  }

  .tabbar .tab-icon {
    font-size: 1.1rem;
  }

  .tabbar .tab-upload {
    flex: 0 0 auto;
    opacity: 1;
    margin-top: -22px;
  }

  .tabbar .tab-upload .tab-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--gold);
    color: #fff;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(212, 148, 58, 0.5);
  }

  .container {
    padding-bottom: calc(var(--tabbar-height) + 1rem);
  }
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

.inline-form {
  display: inline;
}

.error-page {
  text-align: center;
  padding: 3rem 1rem;
}

form.stacked {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 420px;
  background: #fff;
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(43, 58, 82, 0.07);
  margin-bottom: 1.25rem;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.media-actions form {
  margin: 0;
}

form.stacked label {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--navy);
}

form.stacked input,
form.stacked select,
form.stacked textarea {
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--sand);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--cream);
}

.btn {
  display: inline-block;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  padding: 0.6rem 1.4rem;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
}

.btn:hover {
  opacity: 0.9;
}

button:not(.btn) {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--sand);
  background: var(--cream);
  color: var(--navy);
  cursor: pointer;
}

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

.timeline-grid figure {
  margin: 0;
  position: relative;
}

.timeline-grid img,
.timeline-grid video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  box-shadow: 0 2px 8px rgba(43, 58, 82, 0.1);
}

.thumbnail-pending {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background: var(--warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.timeline-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 6px rgba(43, 58, 82, 0.06);
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.timeline-filters select,
.timeline-filters input[type='search'] {
  padding: 0.4rem 0.6rem;
  border: 1.5px solid var(--sand);
  border-radius: var(--radius-sm);
  background: var(--cream);
  font-family: inherit;
}

.timeline-filters label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

/* ---- Maand-tijdlijn: tabs + hero-kaart per maand ---- */
.month-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.75rem 0;
  margin-bottom: 1.5rem;
}

.month-tab {
  flex-shrink: 0;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--sand);
  background: #fff;
  color: var(--navy);
  text-decoration: none;
  scroll-snap-align: start;
}

.month-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 4.5rem;
}

.month-hero {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(43, 58, 82, 0.12);
  margin-bottom: 0.75rem;
  aspect-ratio: 4 / 3;
}

.month-hero img,
.month-hero .thumbnail-pending {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

.month-hero-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem 1.25rem 1rem;
  background: linear-gradient(transparent, rgba(20, 26, 38, 0.75));
  color: #fff;
}

.month-hero-overlay h2 {
  color: #fff;
  font-size: 1.6rem;
  margin-bottom: 0.15rem;
}

.month-hero-overlay p {
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0.9;
  margin: 0;
}

.month-hero-favorite {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  color: var(--yellow);
  font-size: 1.4rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.flash.error {
  background: rgba(233, 106, 106, 0.15);
  color: #a83030;
}

.flash.success {
  background: rgba(78, 124, 58, 0.15);
  color: #2d5c1a;
}

.member-list,
.child-list {
  list-style: none;
  padding: 0;
}

.member-list li,
.child-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 6px rgba(43, 58, 82, 0.06);
}

/* ---- Tags/pills, reused for roles, emoji stamps, etc. ---- */
.tag {
  display: inline-block;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--sand-lt);
  color: var(--brown);
}

/* ---- Avatars (initials, activity feed) ---- */
.avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
}

.avatar-sky {
  background: var(--sky);
}
.avatar-gold {
  background: var(--gold);
}
.avatar-green {
  background: var(--green);
}
.avatar-purple {
  background: var(--purple);
}
.avatar-red {
  background: var(--red);
}
.avatar-yellow {
  background: var(--yellow);
  color: var(--brown);
}
.avatar-brown {
  background: var(--brown);
}

/* ---- Activity feed ---- */
.activity-visits {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.25rem 0 1.25rem;
}

.visit-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.visit-avatar small {
  font-size: 0.7rem;
  opacity: 0.6;
  white-space: nowrap;
}

.activity-feed {
  list-style: none;
  padding: 0;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 6px rgba(43, 58, 82, 0.06);
}

.activity-body {
  flex: 1;
  min-width: 0;
}

.activity-body p {
  margin: 0 0 2px;
  font-size: 0.9rem;
}

.activity-body small {
  opacity: 0.55;
  font-size: 0.75rem;
}

.activity-thumb {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
}

.activity-thumb img,
.activity-thumb .thumbnail-pending {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

/* ---- Kalender ---- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.calendar-weekday {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  text-align: center;
  opacity: 0.5;
  padding-bottom: 0.25rem;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: #fff;
  text-decoration: none;
  color: var(--navy);
  box-shadow: 0 1px 4px rgba(43, 58, 82, 0.05);
}

.calendar-day.empty {
  background: transparent;
  box-shadow: none;
}

.calendar-day.has-media {
  background: var(--sand-lt);
  font-weight: 700;
}

.calendar-day.is-today {
  border: 2px solid var(--gold);
}

.calendar-day-num {
  font-size: 0.9rem;
}

.calendar-day-count {
  font-size: 0.65rem;
  color: var(--gold);
  font-weight: 700;
}

/* ---- PWA install ---- */
.ios-install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  background: var(--navy);
  color: #fff;
  font-size: 0.85rem;
}

.ios-install-banner button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.25rem;
}

.pwa-install-btn {
  margin-bottom: 1rem;
}

/* ---- Gezichtsherkenning-suggesties ---- */
.face-suggestions {
  margin-bottom: 1.25rem;
}

.face-suggestion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--yellow-lt);
  border: 1.5px solid var(--yellow);
  border-radius: var(--radius-sm);
}
