/* Hellmark.org — site styles. Greyscale + blue links, mono type. */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: #e7e7e7;
  color: #4D4D4D;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  padding: 0 18px 50px;
}
::selection { background: #3a5da8; color: #fff; }

a { color: #3a5da8; font-weight: 700; text-decoration: none; }
a:hover { color: #cc2222; text-decoration: underline; }

/* ---- shell ---- */
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #c4c4c4;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.header-bar {
  background: #cccccc;
  border-bottom: 1px solid #9a9a9a;
  height: 128px;
  padding: 10px 26px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.header-bar img { height: 100%; width: auto; display: block; object-fit: contain; }
.title-bar {
  background: #ededed;
  border-bottom: 1px solid #cfcfcf;
  padding: 14px 26px;
}
.title-bar span {
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: #999999;
}

/* ---- layout ---- */
.layout { display: grid; grid-template-columns: minmax(0,1fr) 290px; }
.content { padding: 30px 28px; min-height: 520px; border-right: 1px solid #e2e2e2; }
.sidebar { padding: 26px 22px; display: flex; flex-direction: column; gap: 26px; }

/* ---- headings + body ---- */
h2 { font-family: 'Space Mono', monospace; font-size: 24px; font-weight: 700; color: #999999; margin-bottom: 16px; }
.content > p { margin-bottom: 15px; max-width: 660px; }
.eyebrow { color: #cc2222; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 12px; }

/* ---- sidebar ---- */
.side-head {
  color: #888; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid #e0e0e0;
}
.side-list { display: flex; flex-direction: column; gap: 6px; }
.side-list a { font-size: 13px; }
.side-list nav a, .side-block nav.side-list a { display: block; padding: 6px 10px; border-radius: 5px; }
.side-list a.active { color: #fff; background: #3a5da8; }
.side-list a.active:hover { text-decoration: none; }
.cats { gap: 4px; }
.cats a { font-size: 12px; }
.search { display: flex; gap: 6px; }
.search input {
  flex: 1; min-width: 0; padding: 6px 9px; border: 1px solid #bcbcbc; border-radius: 4px;
  font-family: inherit; font-size: 13px; background: #fafafa; color: #333;
}
.search button {
  padding: 6px 14px; border: 1px solid #9a9a9a; border-radius: 4px;
  background: linear-gradient(180deg,#f4f4f4,#e2e2e2);
  font-family: inherit; font-size: 13px; font-weight: 700; color: #444; cursor: pointer;
}

/* ---- footer ---- */
.footer {
  background: #ededed; border-top: 1px solid #cfcfcf; padding: 16px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: #888; font-size: 12px;
}
.footer .muted { color: #aaa; font-size: 11px; }

/* ---- blog: post meta + lists ---- */
.post-meta { display: flex; gap: 10px; align-items: center; }
.post-meta .date { color: #888; font-size: 11px; }
.post-meta .cat { color: #3a5da8; font-size: 11px; font-weight: 700; }

.feed article { padding-top: 4px; }
.feed article + article { margin-top: 32px; padding-top: 32px; border-top: 3px solid #b5b5b5; }
.feed h3 { font-family: 'Space Mono', monospace; font-size: 23px; font-weight: 700; line-height: 1.15; margin-bottom: 7px; }
.feed h3 a { color: #999999; }
.feed .post-meta { margin-bottom: 16px; }

.older-btn { margin-top: 34px; padding-top: 22px; border-top: 3px solid #b5b5b5; display: flex; justify-content: center; }
.older-btn a {
  display: inline-block; font-size: 13px; font-weight: 700;
  border: 1px solid #bcbcbc; border-radius: 5px; padding: 9px 20px;
  background: linear-gradient(180deg,#fafafa,#f0f0f0);
}
.older-btn a:hover { border-color: #999; text-decoration: none; }

.results-bar {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
  border-bottom: 1px solid #e2e2e2; padding-bottom: 10px; margin-bottom: 4px; font-size: 13px; color: #666;
}
.results-bar .count { font-size: 12.5px; color: #888; }
.results-bar .left { display: flex; gap: 12px; align-items: baseline; }

.post-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.post-list .item { padding: 15px 0; }
.post-list .item + .item { border-top: 2px solid #d2d2d2; }
.post-list h3 { font-family: 'Space Mono', monospace; font-size: 18px; font-weight: 700; margin-bottom: 5px; }
.post-list h3 a { color: #999999; }
.post-list .excerpt { color: #666; font-size: 13.5px; max-width: 620px; margin-bottom: 6px; }
.post-list .more { font-size: 12.5px; }

/* ---- pager ---- */
.pager { margin-top: 20px; padding-top: 14px; border-top: 1px solid #ececec; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 13px; }
.pager .cur { color: #444; font-weight: 700; }
.pager .gap, .pager .dash { color: #bbb; }
.pager .disabled { color: #bbb; font-weight: 700; }

/* ---- single post ---- */
.back-link { display: inline-block; margin-bottom: 18px; font-size: 13px; }
.post-head-meta { margin-bottom: 22px; }

/* ---- markdown body ---- */
.md-body { color: #4D4D4D; font-size: 14.5px; line-height: 1.7; max-width: 660px; }
.md-body h2 { font-size: 19px; margin: 26px 0 10px; }
.md-body h3 { font-family: 'Space Mono', monospace; font-size: 16px; font-weight: 700; color: #999999; margin: 22px 0 8px; }
.md-body p { margin: 0 0 14px; }
.md-body ul, .md-body ol { margin: 0 0 14px; padding-left: 22px; }
.md-body li { margin: 0 0 6px; }
.md-body strong { color: #333; }
.md-body blockquote { margin: 0 0 14px; padding: 8px 16px; border-left: 3px solid #c4c4c4; color: #777; font-style: italic; }
.md-body code { background: #f0f0f0; border: 1px solid #e0e0e0; border-radius: 3px; padding: 1px 5px; font-size: 12.5px; }
.md-body pre { background: #f6f6f6; border: 1px solid #e0e0e0; border-radius: 6px; padding: 14px 16px; overflow: auto; margin: 0 0 14px; }
.md-body pre code { background: none; border: none; padding: 0; }

/* ---- gallery ---- */
.gallery-controls { border: 1px solid #e2e2e2; border-radius: 6px; margin-bottom: 14px; }
.gallery-controls .count { padding: 10px 14px; border-bottom: 1px solid #ececec; font-size: 13px; color: #666; text-align: right; }
.gallery-controls .opts { padding: 10px 14px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.gallery-controls label { font-size: 12.5px; color: #666; display: flex; gap: 7px; align-items: center; }
.gallery-controls select { font-family: 'JetBrains Mono', monospace; font-size: 12px; padding: 4px 6px; border: 1px solid #bcbcbc; border-radius: 4px; background: #fafafa; color: #444; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid .tile {
  position: relative; width: 100%; padding-top: 100%; border-radius: 4px; overflow: hidden;
  background: #ededed; border: 1px solid #e0e0e0; cursor: zoom-in; display: block;
}
.grid .tile:hover { border-color: #999; }
.grid .tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

.album-back { margin: -8px 0 18px; font-size: 12.5px; }

/* ---- lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 1000; background: rgba(20,20,18,.92);
  display: none; align-items: center; justify-content: center; padding: 40px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 76vh; object-fit: contain; background: #fff; border-radius: 4px; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
.lightbox .caption { color: #e9e7da; font-size: 13px; text-align: center; margin-top: 14px; }
.lightbox .caption .sub { color: #9a9a86; font-size: 11.5px; margin-top: 3px; }
.lightbox .lb-box { display: flex; flex-direction: column; align-items: center; cursor: default; }
.lightbox button {
  position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.4); background: rgba(0,0,0,.4);
  color: #fff; font-size: 20px; cursor: pointer;
}
.lightbox .lb-prev { left: 18px; }
.lightbox .lb-next { right: 18px; }
.lightbox .lb-close { top: 18px; right: 20px; transform: none; width: 40px; height: 40px; }

/* ---- responsive ---- */
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .content { border-right: none; border-bottom: 1px solid #e2e2e2; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .header-bar { height: 92px; }
}
