/* Eldstad — the hearth.
   Warm neutrals and an ember accent, rather than the blue-grey of every
   admin dashboard. This is a page the family sees, not an ops console. */

:root {
  color-scheme: light dark;

  --bg:        #faf6f0;
  --surface:   #fffefb;
  --surface-2: #f4ede3;
  --text:      #2a221c;
  --muted:     #75665b;
  --border:    #e4d9cb;
  --ember:     #b8410c;
  --ember-dim: #e8975a;
  --shadow:    0 1px 2px rgba(60, 40, 25, .06), 0 6px 18px rgba(60, 40, 25, .06);

  --serif: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --wrap:  64rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #15110d;
    --surface:   #1e1813;
    --surface-2: #271f18;
    --text:      #ece3d8;
    --muted:     #a08f81;
    --border:    #34291f;
    --ember:     #f0a34a;
    --ember-dim: #8a4d16;
    --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
}

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); }

/* ---- wordmark ---------------------------------------------------------- */

.wordmark {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: .01em;
}
.wordmark-lg { font-size: 2.1rem; margin-bottom: 1.5rem; }

.ember { width: 1.1em; height: 1.1em; color: var(--ember); flex: none; }
.wordmark-lg .ember { width: 1em; height: 1em; }

/* ---- header / footer --------------------------------------------------- */

.top {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.top-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 1rem; padding-bottom: 1rem;
}
.whoami { color: var(--muted); font-size: .9rem; }

.foot {
  display: flex; justify-content: space-between; gap: 1rem;
  margin: 3.5rem auto 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: .85rem;
}

/* ---- the public gate --------------------------------------------------- */

.gate {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 2rem 1.25rem;
}
.gate-inner { max-width: 34rem; }
.gate p { margin: 0 0 1rem; }
.lead { font-size: 1.15rem; }

.button {
  display: inline-block;
  margin-top: 1.25rem;
  padding: .7rem 1.5rem;
  border-radius: 999px;
  background: var(--ember);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.button:hover { filter: brightness(1.08); }
@media (prefers-color-scheme: dark) { .button { color: #1a1208; } }

/* ---- house switcher ---------------------------------------------------- */

.housebar {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
  margin: 1.75rem 0 .5rem;
}
.housebar-label { color: var(--muted); font-size: .85rem; margin-right: .25rem; }

/* Not your default view — say so quietly, so a missing tile reads as
   "this is Haus Gerling's view" rather than "something is broken". */
.housebar-alt {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: .6rem .75rem;
}

.chip {
  font: inherit; font-size: .85rem;
  padding: .35rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.chip:hover { border-color: var(--ember-dim); color: var(--text); }
.chip-on {
  background: var(--ember); border-color: var(--ember);
  color: #fff; font-weight: 600;
}
@media (prefers-color-scheme: dark) { .chip-on { color: #1a1208; } }

/* ---- tiles ------------------------------------------------------------- */

.cat { margin-top: 2.25rem; }
.cat h2 {
  font-family: var(--serif); font-size: 1.05rem; font-weight: 600;
  color: var(--muted);
  margin: 0 0 .85rem;
  letter-spacing: .04em; text-transform: uppercase;
}

.tiles {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .85rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.tile {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: .85rem; row-gap: .15rem;
  padding: 1rem 1.1rem;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .8rem;
  box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
  transition: transform .12s ease, border-color .12s ease;
}
.tile:hover { transform: translateY(-2px); border-color: var(--ember-dim); }

.tile-icon {
  grid-row: 1 / 3;
  width: 1.6rem; height: 1.6rem;
  color: var(--ember);
  align-self: center;
}
.tile-name { font-weight: 600; }
.tile-desc { color: var(--muted); font-size: .88rem; line-height: 1.45; }

/* ---- photos -----------------------------------------------------------

   A justified row: each tile grows in proportion to its aspect ratio, so a
   row fills the width and nothing is letterboxed. --r comes from Immich's
   EXIF, and defaults to 1 when the share has EXIF stripped. */

.fotos {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.fotos li {
  flex-grow: var(--r, 1);
  flex-basis: calc(var(--r, 1) * 9rem);
  height: 9rem;
  margin: 0;
  border-radius: .5rem;
  overflow: hidden;
  background: var(--surface-2);
}
.fotos img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* Stops the last, short row from stretching its tiles absurdly wide. */
.fotos::after { content: ""; flex-grow: 999999; }

@media (max-width: 30rem) { .fotos li { height: 6.5rem; } }

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

.prose {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  max-width: 42rem;
}
.prose h1 { font-family: var(--serif); font-size: 1.6rem; margin: 0 0 1rem; }
.prose h2 {
  font-family: var(--serif); font-size: 1.15rem;
  margin: 2rem 0 .5rem;
}
.prose p { margin: 0 0 1rem; }
.prose code {
  background: var(--surface-2); padding: .1em .35em;
  border-radius: .25rem; font-size: .9em;
}

/* ---- notices ----------------------------------------------------------- */

.notice {
  margin-top: 1.5rem;
  padding: .8rem 1rem;
  border-radius: .6rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: .9rem;
}
.notice-warn { border-color: var(--ember-dim); }
.notice code { font-size: .95em; }

@media (max-width: 30rem) {
  .top-inner { flex-direction: column; align-items: flex-start; gap: .35rem; }
  .foot { flex-direction: column; gap: .35rem; }
}
