/* Digital Field Notes: homepage-only additions. Card effects stay in custom.css. */
.home-field-notes {
  --fn-paper: #f9f8f5;
  --fn-ink: #172333;
  --fn-orange: #d98b60;
  --fn-muted: #8698a6;
  --fn-line: rgba(23, 35, 51, .10);
  --fn-surface: rgba(249, 248, 245, .88);
  --fn-shadow: 0 2px 10px rgba(23, 35, 51, .035);
}
html[data-theme="dark"] .home-field-notes {
  --fn-paper: #262624;
  --fn-ink: #e5e9ec;
  --fn-orange: #e4a37c;
  --fn-muted: #a3b0ba;
  --fn-line: rgba(229, 233, 236, .12);
  --fn-surface: #2e2c2a;
  --fn-shadow: 0 2px 12px rgba(0, 0, 0, .15);
}

/* Grid auto tracks were stretched to the sidebar height. Keep the grid, but
 * pack its natural-height rows at the start instead of distributing free space. */
.home-field-notes #recent-posts { align-content: start; row-gap: 0; }
/* The last card already contributes 20px. This adds only the remaining 22px. */
.home-field-notes #recent-posts > #pagination > .pagination { margin-top: 22px; }
/* One owner for the section-to-footer rhythm: remove the duplicate 96px gap. */
.home-field-notes #content-inner { padding-bottom: 36px; }
.home-field-notes #footer { margin-top: 0; }
/* Butterfly 5.5 uses footer-other, not the old footer-wrap selector. */
html.field-notes-background #footer .footer-other {
  position: relative;
  z-index: 1;
  padding: 32px 20px 30px;
  color: var(--fn-muted);
  color: color-mix(in srgb, var(--fn-muted) 65%, var(--fn-ink));
  font-size: 13.5px;
}
html.field-notes-background #footer .footer-other a { color: var(--fn-ink); }
html.field-notes-background #footer .footer-other a:hover { color: var(--fn-orange); }
html.field-notes-background #footer .footer_custom_text { color: var(--fn-ink); }

/* A single server-rendered closing note; natural height follows its copy. */
.home-field-notes .fn-end {
  position: relative;
  margin-top: 26px;
  padding: 21px 26px 23px;
  border-top: 1px solid var(--fn-line);
  color: var(--fn-ink);
  background: linear-gradient(100deg, rgba(134, 152, 166, .055), transparent 72%);
  border-radius: 0 0 12px 12px;
}
.home-field-notes .fn-end__eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--fn-muted);
  font: 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: color-mix(in srgb, var(--fn-muted) 65%, var(--fn-ink));
  letter-spacing: .18em;
}
.home-field-notes .fn-end__folio { letter-spacing: .08em; }
.home-field-notes .fn-end__title {
  margin: 10px 0 5px;
  color: var(--fn-ink);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: .04em;
}
.home-field-notes .fn-end__copy {
  margin: 0;
  color: var(--fn-muted);
  font-size: 12px;
  color: color-mix(in srgb, var(--fn-muted) 65%, var(--fn-ink));
  line-height: 1.8;
}
.home-field-notes .fn-end__trace {
  position: absolute;
  top: 28px;
  right: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 84px;
  opacity: .48;
}
.home-field-notes .fn-end__trace span { flex: 1; border-top: 1px dashed var(--fn-muted); }
.home-field-notes .fn-end__trace i { width: 4px; height: 4px; border-radius: 50%; background: var(--fn-orange); }

/* Sidebar stays quieter than the interactive article cards. No glow layer. */
.home-field-notes #aside-content .card-widget {
  border: 1px solid var(--fn-line) !important;
  background: var(--fn-surface) !important;
  box-shadow: var(--fn-shadow) !important;
}
.home-field-notes #aside-content .card-widget:hover {
  border-color: rgba(217, 139, 96, .22) !important;
  box-shadow: 0 4px 14px rgba(23, 35, 51, .055) !important;
}
html[data-theme="dark"] .home-field-notes #aside-content .card-widget:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2) !important;
}
/* Theme emits inline cloud sizes: normalise typography, not the container
 * height. Every tag remains visible and retains its original destination. */
.home-field-notes #aside-content .card-tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.home-field-notes #aside-content .card-tag-cloud a {
  margin: 0;
  padding: 3px 9px !important;
  font-size: 12px !important;
  line-height: 1.8;
  border-color: var(--fn-line);
}
.home-field-notes #aside-content .card-tag-cloud a:hover {
  border-color: rgba(217, 139, 96, .4) !important;
}

/* Decorative routes live only in genuine outer gutters, never in a column. */
.home-field-notes .fn-waypoint { display: none; }
@media (min-width: 1800px) {
  .home-field-notes .fn-waypoint {
    position: fixed;
    top: 32vh;
    z-index: 0;
    display: grid;
    justify-items: center;
    gap: 14px;
    width: 96px;
    pointer-events: none;
    user-select: none;
    color: var(--fn-muted);
    opacity: .48;
  }
  .home-field-notes .fn-waypoint--left { left: max(12px, calc((100vw - 1800px) / 2)); }
  .home-field-notes .fn-waypoint--right { right: max(12px, calc((100vw - 1800px) / 2)); }
  .home-field-notes .fn-waypoint__label { font: 9px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
  .home-field-notes .fn-waypoint path { stroke: currentColor; stroke-width: .8; stroke-dasharray: 3 8; }
  .home-field-notes .fn-waypoint circle { fill: var(--fn-orange); }
}

@media (max-width: 768px) {
  /* Mobile cards already have a 14px trailing margin: 14 + 28 = 42px. */
  .home-field-notes #recent-posts > #pagination > .pagination { margin-top: 28px; }
  /* The theme hides these widgets when aside.mobile=false, but leaves an empty
   * flex item, its top margin and its inter-column gap in the mobile flow. */
  .home-field-notes #content-inner.fn-aside-desktop-only > #aside-content { display: none; }
  .home-field-notes .fn-end { padding: 20px 16px 22px; margin-top: 24px; }
  .home-field-notes .fn-end__trace { right: 16px; width: 46px; }
  .home-field-notes .fn-end__title { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-field-notes #aside-content .card-widget,
  .home-field-notes #aside-content .card-tag-cloud a { transition: none !important; }
}
