/* =========================================================
   lola — shell.css
   Design tokens, fonts, header, footer.
   Shared by every page.
   ========================================================= */

/* ----- Diatype trial fonts ----- */
@font-face {
  font-family: "ABC Diatype";
  src: url("/fonts/ABCDiatypeTrial-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "ABC Diatype";
  src: url("/fonts/ABCDiatypeTrial-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "ABC Diatype Mono";
  src: url("/fonts/ABCDiatypeMonoTrial-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "ABC Diatype Mono";
  src: url("/fonts/ABCDiatypeMonoTrial-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ----- Tokens ----- */
:root {
  --bg: #f5f5f2;
  --field: #ebeae5;
  --field-focus: #e3e2dc;
  --ink: #111111;
  --ink-2: #555551;
  --ink-3: #777773;
  --ink-4: #a8a8a3;
  --rule: #d8d8d4;
  --blue: #2a4ed4;

  --sans: "ABC Diatype", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono: "ABC Diatype Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: 32px;
  --container: 1600px;
}

/* ----- Dark mode (global) ----- */
html.dark,
body.dark {
  --bg: #161614;
  --field: #1f1f1d;
  --field-focus: #262624;
  --ink: #ebeae5;
  --ink-2: #a8a8a3;
  --ink-3: #8a8a85;
  --ink-4: #5a5a55;
  --rule: #2a2a27;
  /* --blue stays the same — French blue reads well on both */
}
html.dark { background: #161614; }

@media (max-width: 720px) { :root { --gutter: 18px; } }

/* ----- Reset / base ----- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 400;
  letter-spacing: -0.011em;
  min-height: 100vh;
  padding-bottom: 64px;
}
a { color: inherit; text-decoration: none; transition: color 140ms ease; }
button { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; }
input, textarea, select { font: inherit; }
::selection { background: rgba(42, 78, 212, 0.18); }

/* =========================================================
   HEADER
   ========================================================= */
.head {
  padding: 26px var(--gutter) 22px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
}
.head__left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
}
.logo {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--ink);
  text-transform: lowercase;
}
.nav {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  justify-self: center;
}
.nav a {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ink-2);
}
.nav a:hover { color: var(--blue); }
.nav a.is-active { color: var(--ink); font-weight: 500; }

.menu-btn {
  display: none;
  width: 22px; height: 22px;
  align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink); transition: color 140ms ease;
}
.menu-btn:hover { color: var(--blue); }
.menu-btn__icon { width: 18px; height: 12px; position: relative; display: block; }
.menu-btn__bar {
  position: absolute; left: 0; right: 0; height: 1.5px;
  background: currentColor;
  transition: transform 200ms ease, top 200ms ease, bottom 200ms ease;
}
.menu-btn__bar--top { top: 0; }
.menu-btn__bar--bottom { bottom: 0; }
.menu-btn.is-open .menu-btn__bar--top { top: 50%; transform: translateY(-50%) rotate(45deg); }
.menu-btn.is-open .menu-btn__bar--bottom { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

.head__right {
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  justify-self: end;
}
.head__right .where { color: var(--ink); font-weight: 500; margin-right: 6px; }
.head__right .signin {
  color: var(--ink-2);
}
.head__right .signin:hover { color: var(--blue); }

@media (max-width: 760px) {
  .head {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
}

/* ----- Mobile menu overlay ----- */
.menu-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 100;
  display: none;
  padding-top: 70px;
}
.menu-overlay.is-open { display: block; }
.menu-overlay__inner {
  padding: 40px var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.menu-overlay__inner a {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
  padding: 12px 0;
}
.menu-overlay__inner a.is-active { color: var(--ink); }
.menu-overlay__inner a:hover { color: var(--blue); }
.menu-overlay__signout {
  font-size: 14px !important;
  color: var(--ink-3) !important;
  font-weight: 400 !important;
  margin-top: 32px;
}

/* =========================================================
   FOOTER
   ========================================================= */
.foot {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 40;
}
.foot__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--gutter);
  width: 100%;
  font-size: 12px;
  color: var(--ink-3);
}
.foot__left, .foot__right { display: flex; gap: 18px; align-items: center; }
.foot .ver { color: var(--ink-2); font-family: var(--mono); font-size: 11px; }
.foot a:hover { color: var(--blue); }
@media (max-width: 720px) {
  .foot__bar { padding: 12px 14px; font-size: 11px; }
  .foot .hide-sm { display: none !important; }
}

/* =========================================================
   COMMON UTILITIES
   ========================================================= */
.page {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}

/* Toast — quiet bottom feedback */
.toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 18px;
  font-size: 13px;
  font-family: var(--sans);
  letter-spacing: -0.005em;
  z-index: 200;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}
.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Modal — generic full-screen overlay editor (journal, trip add, place add) */
.modal {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 110;
  display: none;
  flex-direction: column;
}
.modal.is-open { display: flex; }
.modal__head {
  padding: 26px var(--gutter) 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.modal__title {
  font-size: 14px;
  color: var(--ink-3);
  letter-spacing: -0.005em;
  margin: 0;
  font-weight: 400;
}
.modal__title strong {
  color: var(--ink);
  font-weight: 500;
}
.modal__close {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-3);
  padding: 8px 12px;
  margin: -8px -12px;
  letter-spacing: -0.005em;
  cursor: pointer;
  background: none;
  border: 0;
  transition: color 140ms ease;
}
.modal__close:hover { color: var(--ink); }

.modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px var(--gutter) 100px;
  display: flex;
  justify-content: center;
}
.modal__body__inner {
  width: 100%;
  max-width: 720px;
}
.modal__foot {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 14px var(--gutter);
  background: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-3);
  font-family: var(--mono);
  letter-spacing: 0.04em;
  border-top: 1px solid var(--rule);
  min-height: 56px;
}
.modal__foot .save-btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--blue);
  letter-spacing: -0.008em;
  padding: 10px 16px;
  margin: -10px -16px;
  cursor: pointer;
  background: none;
  border: 0;
  transition: color 140ms ease, opacity 140ms ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.modal__foot .save-btn:hover { color: var(--ink); }
.modal__foot .save-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Keyboard shortcut hint inside save button */
.kbd {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.save-btn:hover .kbd { color: var(--ink-2); border-color: var(--ink-3); }

@media (max-width: 720px) {
  .modal__foot {
    padding: 12px var(--gutter);
    min-height: 60px;
  }
  .modal__foot .save-btn {
    font-size: 15px;
    padding: 12px 16px;
    margin: -12px -16px;
  }
  .modal__close {
    font-size: 15px;
    padding: 10px 12px;
    margin: -10px -12px;
  }
  /* On narrow screens, hide kbd hint */
  .kbd { display: none; }
}

/* Form fields — used in modals and admin forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 22px;
}
.field__label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.field__input,
.field__textarea,
.field__select {
  background: var(--field);
  padding: 12px 16px;
  border-radius: 2px;
  border: 0;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.005em;
  outline: none;
  width: 100%;
  transition: background 200ms ease;
}
.field__input:focus,
.field__textarea:focus,
.field__select:focus {
  background: var(--field-focus);
}
.field__textarea {
  resize: vertical;
  min-height: 90px;
  font-family: var(--sans);
}
.field__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .field__row { grid-template-columns: 1fr; }
}

/* Primary action button — used sparingly */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 22px;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 140ms ease;
}
.btn:hover { background: var(--blue); }
.btn--secondary {
  background: transparent;
  color: var(--ink-2);
  padding: 10px 0;
}
.btn--secondary:hover { color: var(--blue); background: transparent; }
.btn--danger:hover { background: #c0392b; }
