/*
 * Shared CSS for the Logbuch surface — index page and per-article entries.
 * Linked from templates/logbuch/<slug>.html and logbuch/index.html via
 *   <link rel="stylesheet" th:href="@{/css/logbuch.css(v=${assetVersion})}">
 * so the per-deploy ?v=<sha> query suffix invalidates the browser cache.
 *
 * Visual identity is intentionally identical to the prior Caddy-served
 * Ansible-rendered output (former _content-base.html.j2) so the
 * migration is invisible to a visitor — same palette tokens, same
 * typography, same hero/portrait figure rules.
 */

:root {
  color-scheme: dark;
  --bg-deep: #071016;
  --bg-panel: #0d1a22;
  --bg-elevated: #152532;
  --divider: #1d2e3a;
  --gold: #f1bd56;
  --gold-deep: #c88d2f;
  --cyan: #35d8ee;
  --text: #f4ead0;
  --text-dim: #b3a888;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100vh; }
body {
  background: radial-gradient(ellipse at top, #0d1a22 0%, var(--bg-deep) 60%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.65;
}
header.site {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
header.site a.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
}
header.site .brand .accent { color: var(--gold); }
header.site .brand img { width: 28px; height: 28px; }
header.site .section, header.site a.section {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}
header.site a.section:hover { color: var(--cyan); }
main { flex: 1; }
article {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}
article .stand {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0 0 1.5rem;
  letter-spacing: 0.02em;
}
article h1 {
  font-size: 2.1rem;
  font-weight: 600;
  margin: 0 0 1.75rem;
  color: var(--text);
  line-height: 1.2;
}
article h1 .accent { color: var(--gold); }
article h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2.25rem 0 0.75rem;
  color: var(--gold);
}
article p { margin: 0.85rem 0; }
article p:first-of-type { font-size: 1.05rem; }
article a { color: var(--cyan); text-decoration: underline; text-decoration-color: rgba(53, 216, 238, 0.35); }
article a:hover { text-decoration-color: var(--cyan); }
article blockquote {
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  border-left: 2px solid var(--gold);
  color: var(--text-dim);
  font-style: italic;
}
article hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 2rem 0;
}
article .signature {
  margin-top: 2rem;
  color: var(--text-dim);
  font-size: 0.95rem;
  text-align: right;
}
article figure { margin: 0.5rem 0 1rem; padding: 0; }
article figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--divider);
  border-radius: 2px;
  cursor: zoom-in;
}
article figure figcaption {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 0.4rem;
  line-height: 1.45;
}
article figure.hero { margin: 0 0 2rem; clear: both; }
article figure.hero img { width: 100%; }
@media (min-width: 640px) {
  article figure.right {
    float: right;
    width: 280px;
    margin: 0.4rem 0 0.8rem 1.5rem;
    shape-outside: margin-box;
  }
  article figure.left {
    float: left;
    width: 280px;
    margin: 0.4rem 1.5rem 0.8rem 0;
    shape-outside: margin-box;
  }
  article figure.portrait.right {
    float: right;
    width: 210px;
    margin: 0.4rem 0 0.8rem 1.5rem;
    shape-outside: margin-box;
  }
  article figure.portrait.left {
    float: left;
    width: 210px;
    margin: 0.4rem 1.5rem 0.8rem 0;
    shape-outside: margin-box;
  }
}
article.clearfix::after,
article .clearfix::after {
  content: "";
  display: table;
  clear: both;
}
dialog.lightbox {
  background: transparent;
  border: none;
  padding: 0;
  max-width: 96vw;
  max-height: 96vh;
  overflow: visible;
}
dialog.lightbox::backdrop { background: rgba(0, 0, 0, 0.88); }
dialog.lightbox img {
  display: block;
  max-width: 96vw;
  max-height: 96vh;
  width: auto;
  height: auto;
}
dialog.lightbox .lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
dialog.lightbox .lightbox-close:hover { color: var(--gold); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.lang-switch {
  margin-left: auto;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.lang-switch .current {
  color: var(--text);
  font-weight: 600;
  padding: 0 0.4rem;
}
.lang-switch .sep {
  color: var(--text-dim);
  opacity: 0.5;
}
.lang-switch a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0 0.4rem;
  transition: color 0.15s;
}
.lang-switch a:hover,
.lang-switch a:focus-visible {
  color: var(--gold);
  outline: none;
}

.translation-disclosure {
  max-width: 680px;
  margin: 0 auto 1.2rem;
  padding: 0.55rem 0.9rem;
  background: var(--bg-elevated);
  border-left: 3px solid var(--cyan);
  border-radius: 2px;
  color: var(--text-dim);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}
.translation-disclosure a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: rgba(53, 216, 238, 0.4);
  transition: text-decoration-color 0.15s;
}
.translation-disclosure a:hover { text-decoration-color: var(--cyan); }

a.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0.6rem 1rem;
  border: 1px solid var(--gold);
  border-radius: 2px;
  text-decoration: none;
  z-index: 1000;
  transition: top 0.15s;
}
a.skip-link:focus { top: 1rem; }
button.text-button {
  background: none;
  border: none;
  color: var(--cyan);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(53, 216, 238, 0.35);
  padding: 0;
  margin: 0 0 0 0.4rem;
  font: inherit;
}
button.text-button:hover { text-decoration-color: var(--cyan); }
button.text-button:focus-visible { outline: 1px dashed var(--cyan); outline-offset: 2px; }
article.logbuch-index .lead {
  color: var(--text-dim);
  font-size: 1rem;
  margin-bottom: 2.5rem;
}
article.logbuch-index ul.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
article.logbuch-index .article-card {
  padding: 1.5rem 0;
  border-top: 1px solid var(--divider);
}
article.logbuch-index ul.article-list > li:first-child .article-card { border-top: none; padding-top: 0; }
article.logbuch-index ul.article-list > li { list-style: none; }
article.logbuch-index .article-card .hero-link {
  display: block;
  margin: 0.6rem 0 0.9rem;
  overflow: hidden;
  border: 1px solid var(--divider);
  border-radius: 2px;
  transition: border-color 0.15s;
}
article.logbuch-index .article-card .hero-link:hover { border-color: var(--gold); }
article.logbuch-index .article-card .hero-link img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
  object-position: center;
}
article.logbuch-index .sort-control {
  text-align: right;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0 0 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--divider);
}
article.logbuch-index .article-card .meta {
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
article.logbuch-index .article-card h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
  color: var(--text);
}
article.logbuch-index .article-card h2 a {
  color: inherit;
  text-decoration: none;
}
article.logbuch-index .article-card h2 a:hover { color: var(--gold); }
article.logbuch-index .article-card .teaser {
  margin: 0 0 0.6rem;
  color: var(--text);
}
article.logbuch-index .article-card .more { margin: 0; font-size: 0.9rem; }
nav.article-nav {
  width: 100%;
  max-width: 680px;
  box-sizing: border-box;
  margin: 2.5rem auto 1.5rem;
  padding: 1.5rem 1.5rem 0;
  border-top: 1px solid var(--divider);
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
}
nav.article-nav a {
  flex: 1 1 0;
  text-decoration: none;
  color: var(--text);
}
nav.article-nav .nav-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
nav.article-nav .nav-title {
  display: block;
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: rgba(53, 216, 238, 0.35);
}
nav.article-nav a:hover .nav-title {
  text-decoration-color: var(--cyan);
  color: var(--gold);
}
nav.article-nav .article-nav-older { text-align: left; }
nav.article-nav .article-nav-newer { text-align: right; }
@media (max-width: 540px) {
  nav.article-nav { flex-direction: column; gap: 1.25rem; }
  nav.article-nav .article-nav-older,
  nav.article-nav .article-nav-newer { text-align: left; }
}
nav.breadcrumbs {
  padding: 1rem 1.5rem 0;
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
nav.breadcrumbs a { color: var(--text-dim); text-decoration: none; }
nav.breadcrumbs a:hover { color: var(--cyan); }
nav.breadcrumbs .separator { color: var(--divider); margin: 0 0.4rem; }
nav.breadcrumbs [aria-current="page"] { color: var(--text); }
footer.byline {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  border-top: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 1rem;
}
footer.byline img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--divider);
  flex-shrink: 0;
}
footer.byline .byline-text {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-dim);
  margin: 0;
}
footer.byline .byline-name {
  color: var(--text);
  font-weight: 600;
}
footer.byline .byline-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}
article aside.tutorial {
  margin: 2rem 0 1rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--gold);
  background: rgba(241, 189, 86, 0.05);
  border-radius: 2px;
  clear: both;
}
article aside.tutorial .tutorial-label {
  font-size: 0.72rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-style: normal;
}
article aside.tutorial h3 {
  font-size: 1.05rem;
  margin: 0 0 0.6rem;
  color: var(--text);
  font-weight: 600;
}
article aside.tutorial p {
  font-size: 0.92rem;
  margin: 0.5rem 0;
  color: var(--text);
}
article aside.tutorial p:first-of-type { font-size: 0.92rem; }
article aside.tutorial p:last-child { margin-bottom: 0; }
article aside.tutorial .tutorial-source {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.9rem;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(241, 189, 86, 0.2);
}
article aside.tutorial .tutorial-source a {
  color: var(--cyan);
}
article aside.fitting-widget {
  margin: 2rem 0 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--divider);
  border-left: 3px solid var(--cyan);
  background: rgba(53, 216, 238, 0.04);
  border-radius: 2px;
  clear: both;
}
article aside.fitting-widget .fitting-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.4rem;
}
article aside.fitting-widget .fitting-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
}
article aside.fitting-widget .fitting-price {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
article aside.fitting-widget .fitting-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0 0 0.8rem;
  font-style: italic;
}
article aside.fitting-widget pre.eft {
  margin: 0;
  padding: 0.8rem 1rem;
  background: rgba(7, 16, 22, 0.6);
  border: 1px solid var(--divider);
  border-radius: 2px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
}
article aside.fitting-widget .fitting-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}
article aside.fitting-widget .fitting-actions button,
article aside.fitting-widget .fitting-actions a {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  background: transparent;
  border: 1px solid var(--cyan);
  border-radius: 2px;
  color: var(--cyan);
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
article aside.fitting-widget .fitting-actions button:hover,
article aside.fitting-widget .fitting-actions a:hover {
  background: rgba(53, 216, 238, 0.12);
  color: var(--text);
}
article aside.fitting-widget .fitting-actions a.disabled,
article aside.fitting-widget .fitting-actions a[href="#"] {
  opacity: 0.45;
  pointer-events: none;
  border-style: dashed;
}
article .fitting-block { clear: both; }
@media (min-width: 1080px) {
  article .fitting-block { position: relative; }
  article .fitting-block aside.fitting-widget.side-right {
    position: absolute;
    top: 0;
    left: calc(100% + 30px);
    width: 340px;
    margin: 0;
  }
  article aside.fitting-widget.side-right pre.eft {
    font-size: 0.7rem;
    padding: 0.6rem 0.75rem;
    line-height: 1.5;
  }
  article aside.fitting-widget.side-right .fitting-header {
    flex-wrap: wrap;
    gap: 0.3rem 1rem;
  }
  article aside.fitting-widget.side-right .fitting-actions {
    gap: 0.4rem;
  }
  article aside.fitting-widget.side-right .fitting-actions button,
  article aside.fitting-widget.side-right .fitting-actions a {
    padding: 0.35rem 0.6rem;
    font-size: 0.76rem;
  }
}
nav.article-nav .article-nav-fallback .nav-title {
  color: var(--text-dim);
  text-decoration-color: rgba(179, 168, 136, 0.3);
}
nav.article-nav .article-nav-fallback:hover .nav-title {
  color: var(--gold);
  text-decoration-color: var(--gold);
}
footer.site {
  padding: 1.5rem 1rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--divider);
}
footer.site a {
  color: var(--text-dim);
  text-decoration: none;
  margin: 0 0.6rem;
}
footer.site a:hover { color: var(--cyan); }
footer.site .ai-credit {
  font-size: 0.72rem;
  color: var(--text-dim);
  opacity: 0.75;
  margin: 0.6rem auto 0;
  max-width: 540px;
  line-height: 1.5;
}
footer.site .ai-credit + .ai-credit { margin-top: 0.2rem; }
footer.site .ai-credit--quiet { font-size: 0.68rem; opacity: 0.5; }
footer.site .eve-credit {
  font-size: 0.7rem;
  color: var(--text-dim);
  opacity: 0.55;
  margin-top: 0.6rem;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Inline EVE-item gloss: small icon + name with a tooltip that opens
 * on hover (mouse), focus (keyboard), or click (touch / explicit).
 * Markup comes from _fragments/eve-item.html; touch + viewport-edge
 * behaviour lives in static/logbuch/eve-item-tooltip.js. */
.eve-item {
  position: relative;
  display: inline;
  cursor: help;
  border-bottom: 1px dotted rgba(179, 168, 136, 0.45);
  padding-bottom: 1px;
  color: var(--gold);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.eve-item:hover,
.eve-item:focus-visible {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  outline: none;
}
.eve-item-icon {
  width: 1.05em;
  height: 1.05em;
  vertical-align: text-bottom;
  margin-right: 0.25em;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.25);
}
.eve-item-label {
  /* Label sits inline; nothing to do, just claim the selector. */
}
.eve-item-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  width: max-content;
  max-width: min(320px, calc(100vw - 2rem));
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  background: var(--bg-deep, #0f0f12);
  color: var(--text, #e8e2d0);
  border: 1px solid var(--divider, rgba(179, 168, 136, 0.3));
  font-size: 0.8rem;
  font-weight: normal;
  line-height: 1.4;
  white-space: normal;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-out;
  z-index: 20;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.eve-item:hover > .eve-item-tip,
.eve-item:focus-visible > .eve-item-tip,
.eve-item.is-open > .eve-item-tip {
  opacity: 1;
}
/* Viewport-edge flip — JS adds is-flipped-right when the tooltip
 * would overflow the right edge. */
.eve-item.is-flipped-right > .eve-item-tip {
  left: auto;
  right: 0;
}
