/* ==========================================================================
   Home page dashboard (logged-in) — layout for templates/index.html
   --------------------------------------------------------------------------
   The personalised widgets on the Home page (featured photo, stats, birthdays,
   recent stories/photos, family facts) live in their own stylesheet
   instead of Tailwind utilities because the Tailwind bundle is built with the
   standalone CLI (scripts\build_css.ps1), which is not always available.

   Like relation_picker.css this file is linked from a single template via
   `{% block head %}`. It only depends on the shared --ft-* theme tokens defined
   in static/css/input.css (light + dark) and on the Bootstrap-style component
   classes (.card, .btn, .badge, .card-link, .text-muted) shipped in the bundle,
   which it complements rather than replaces.
   ========================================================================== */

.home-dashboard { margin-top: 2rem; }

/* ---------- Section scaffolding ---------- */
.home-section { margin-top: 2.5rem; }
.home-section-title {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: left;
}
.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.home-section-head .home-section-title { margin: 0; }
.home-more { font-size: .875rem; }

/* ---------- Welcome card (the first box on the Home page) ---------- */
/* The card used to carry Tailwind's px-5 py-10 / lg:p-11, i.e. 40-44px of empty
   space above "Hello <name>" and below the buttons at every breakpoint. The two
   classes below trim that; they live here rather than in the markup because the
   prebuilt Tailwind bundle only ships the utilities that were in use when it was
   last generated (no py-6/py-7/pt-4/lg:py-* classes). */
.home-welcome-wrap { padding-top: 1rem; }
.home-welcome { padding: 1.5rem 1.25rem; }
@media (min-width: 1024px) {
  .home-welcome { padding: 1.75rem 2.75rem; }
}

/* ---------- Welcome card call-to-action row ---------- */
.home-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin-top: 1.5rem;
}

/* ---------- Featured photo banner ---------- */
.home-banner {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid var(--ft-card-border);
  background-color: var(--ft-card-bg);
  box-shadow: 0 1px 2px rgb(0 0 0 / .05);
  transition: transform .2s ease, box-shadow .2s ease;
}
.home-banner:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgb(0 0 0 / .18); }
.home-banner img { display: block; width: 100%; height: 18rem; object-fit: cover; }
@media (min-width: 640px) { .home-banner img { height: 22rem; } }
.home-banner-caption {
  position: absolute;
  inset: auto 0 0 0;
  display: block;
  padding: 1.25rem 1.5rem;
  text-align: left;
  color: #fff;
  background: linear-gradient(to top, rgb(0 0 0 / .78), rgb(0 0 0 / .15) 70%, transparent);
}
.home-kicker {
  display: block;
  margin-bottom: .25rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgb(255 255 255 / .85);
}
.home-banner-title { display: block; font-size: 1.125rem; font-weight: 600; }
.home-banner:hover .home-banner-title { text-decoration: underline; }

/* ---------- "At a glance" stat tiles ---------- */
.home-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (min-width: 1024px) {
  .home-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.home-tile { text-align: center; }
.home-tile-value { display: block; font-size: 2rem; font-weight: 600; line-height: 1.2; }
.home-tile-label { display: block; font-size: .875rem; color: var(--ft-muted); }

/* ---------- Simple two-column split (stories / photos) ---------- */
.home-split { display: grid; gap: 1.5rem; }
@media (min-width: 1024px) {
  .home-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Feed lists (birthdays, recent stories) ---------- */
.home-list { list-style: none; margin: 0; padding: 0; }
.home-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--ft-card-border);
}
.home-list > li:last-child { border-bottom: 0; }
.home-list-title { font-weight: 600; }
.home-meta { font-size: .8125rem; color: var(--ft-muted); }

/* ---------- Recent photo thumbnails ---------- */
.home-photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.home-photo-grid a { display: block; overflow: hidden; border-radius: 1rem; }
.home-photo-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform .2s ease;
}
.home-photo-grid a:hover img { transform: scale(1.05); }

/* ---------- "Family facts" strip ---------- */
.home-facts { display: grid; grid-template-columns: 1fr; gap: 1rem; text-align: left; }
@media (min-width: 768px) {
  .home-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.home-fact-label {
  margin: 0 0 .25rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ft-muted);
}
.home-fact-value { margin: 0; font-size: 1.125rem; font-weight: 600; }
.home-fact-detail { margin: 0; font-size: .875rem; color: var(--ft-muted); }

/* ---------- "Birthday today" badge ---------- */
.home-today-badge {
  display: inline-block;
  margin-left: .375rem;
  padding: .125rem .5rem;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  background: #fde68a;
  color: #78350f;
}
html[data-theme="dark"] .home-today-badge {
  background: rgb(120 53 15 / .6);
  color: #fde68a;
}
