/* Blog pages (public/blog.php): terminal window chrome like the homepage and weather.html, readable prose inside */
@font-face {
  font-family: 'Fira Code';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/firacode/v27/uU9eCBsR6Z2vfE9aq3bL0fxyUs4tcw4W_A9sJVD7NuzlojwUKQ.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --user-font-family: 'Fira Code', monospace;
  --custom-wallpaper: none;
  --bg: rgb(23 24 25 / 96%);
  --text: #e6e6e6;
  --muted: #8a8a8a;
  --border: #2c2d2f;
  --yellow: #F7FCA0;
  --blue: #6A77D2;
  --cyan: #9CEAF3;
  --teal: #66C2CD;
  --green: #5AD786;
  --red: #F78F85;
  --code-bg: #0f1011;
  --mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 28px 20px 88px;
  background: #0b141e url('../static/tahoe-night.jpg') center / 100% 100% no-repeat fixed;
  background-image: image-set(url('../static/tahoe-night.webp') type('image/webp'), url('../static/tahoe-night.jpg') type('image/jpeg'));
  background-size: 100% 100% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
  color: var(--text);
  font-family: var(--user-font-family);
  position: relative;
}

/* Day layer sits fixed over the night body background and crossfades */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #1c5d85 url('../static/tahoe-day.jpg') center / 100% 100% no-repeat fixed;
  background-image: image-set(url('../static/tahoe-day.webp') type('image/webp'), url('../static/tahoe-day.jpg') type('image/jpeg'));
  background-size: 100% 100% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
  opacity: 1;
  transition: opacity 1.2s ease-in-out;
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  html:not(.wallpaper-day) body::before,
  body:not(.wallpaper-day)::before {
    opacity: 0;
  }
}

html.wallpaper-night body::before,
body.wallpaper-night::before {
  opacity: 0 !important;
}

html.wallpaper-day body::before,
body.wallpaper-day::before {
  opacity: 1 !important;
}

/* Custom wallpaper override */
html.has-custom-wallpaper body,
body.has-custom-wallpaper {
  background-image: var(--custom-wallpaper) !important;
  background-size: 100% 100% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

html.has-custom-wallpaper body::before,
body.has-custom-wallpaper::before {
  opacity: 0 !important;
}

.window {
  width: 100%;
  max-width: 880px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(23, 24, 25, 0.85);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  box-shadow: rgba(0, 0, 0, 0.45) 0 25px 60px -10px, rgba(0, 0, 0, 0.3) 0 16px 36px -12px, inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.menu {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 14px;
  background: rgba(45, 45, 47, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.dot:hover {
  opacity: 0.85;
  transform: scale(1.08);
}
.red { background: #F5544D; }
.yellow { background: #FABD2F; }
.green { background: #47D043; }
.menu h1 {
  flex: 1;
  margin-right: 60px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: #b0b0b0;
}

.content { padding: 18px 24px 28px; background: rgba(23, 24, 25, 0.82); }
.prompt { color: var(--yellow); font-size: 14px; }
.prompt span { color: var(--blue); }
.prompt .dir { color: var(--cyan); }
.command { margin: 2px 0 20px; color: var(--green); font-size: 14px; }
.caret { color: var(--green); }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Post list */
.posts { list-style: none; }
.posts li { padding: 14px 0; border-top: 1px solid var(--border); }
.posts li:first-child { border-top: none; padding-top: 0; }
.post-title { font-size: 18px; }
.summary { margin-top: 6px; font-family: var(--sans); font-size: 15px; line-height: 1.55; color: #cfcfcf; }
.meta { margin-top: 4px; font-size: 12px; color: var(--muted); }
.tag { color: var(--teal); }
.draft { color: var(--red); }
.empty, .error { color: var(--red); font-size: 14px; }
.footer { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* Article */
article { max-width: 72ch; margin: 0 auto; font-family: var(--sans); font-size: 17px; line-height: 1.7; color: var(--text); }
article header { margin-bottom: 28px; }
article header h1 { font-family: var(--mono); font-size: 28px; line-height: 1.3; color: #fff; }
article header .meta { margin-top: 8px; font-family: var(--mono); }
article h1, article h2, article h3, article h4 {
  font-family: var(--mono);
  font-weight: 500;
  line-height: 1.35;
  color: var(--yellow);
  scroll-margin-top: 36px;
}
article > h1 { font-size: 26px; margin: 40px 0 14px; }
article h2 { font-size: 21px; margin: 40px 0 12px; }
article h3 { font-size: 18px; margin: 30px 0 10px; color: var(--cyan); }
article h4 { font-size: 16px; margin: 24px 0 8px; color: var(--cyan); }
article p, article ul, article ol, article blockquote, article pre, article .table-wrap, article hr { margin: 0 0 18px; }
article ul, article ol { padding-left: 1.5em; }
article li { margin: 4px 0; }
article li > ul, article li > ol { margin: 4px 0 0; }
article li::marker { color: var(--teal); }
article strong { color: #fff; }
article img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 4px; }
article hr { border: none; border-top: 1px dashed var(--border); margin: 32px 0; }
article blockquote { padding: 4px 0 4px 16px; border-left: 3px solid var(--blue); color: #c8c8c8; }
article blockquote > :last-child { margin-bottom: 0; }

article code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #26282b;
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--teal);
}
article pre {
  overflow-x: auto;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--code-bg);
  line-height: 1.55;
}
article pre code { padding: 0; background: none; font-size: 13.5px; color: #dcdcdc; }

.table-wrap { overflow-x: auto; }
article table { width: 100%; border-collapse: collapse; font-size: 15px; }
article th, article td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
article th { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--yellow); }

/* macOS Dock on Blog pages */
.mac-dock {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
}
.dock-container {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  gap: 10px;
  background: rgba(45, 45, 47, 0.45);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.dock-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s cubic-bezier(0.2, 0, 0.1, 1);
}
.dock-item:hover {
  transform: translateY(-4px) scale(1.08);
}
.dock-icon-wrapper {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dock-app-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.dock-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.dock-item.active .dock-dot {
  opacity: 1;
}

/* Light Theme support */
html.theme-light body,
body.theme-light {
  color: #1d1d1f;
}
html.theme-light .window,
body.theme-light .window {
  background: rgba(246, 246, 248, 0.92);
}
html.theme-light .menu,
body.theme-light .menu {
  background: #e5e5e7;
  border-color: #d1d1d6;
}
html.theme-light .menu h1,
body.theme-light .menu h1 {
  color: #1d1d1f;
}
html.theme-light .content,
body.theme-light .content {
  background: rgba(255, 255, 255, 0.88);
}
html.theme-light .summary,
body.theme-light .summary {
  color: #333333;
}
html.theme-light article,
body.theme-light article {
  color: #1d1d1f;
}
html.theme-light article header h1,
body.theme-light article header h1,
html.theme-light article strong,
body.theme-light article strong {
  color: #111111;
}
html.theme-light article h2,
body.theme-light article h2,
html.theme-light article h3,
body.theme-light article h3,
html.theme-light article h4,
body.theme-light article h4 {
  color: #0066cc;
}
html.theme-light article pre,
body.theme-light article pre {
  background: #f6f8fa;
  border-color: #d0d7de;
}
html.theme-light article pre code,
body.theme-light article pre code {
  color: #24292f;
}
html.theme-light article code,
body.theme-light article code {
  background: rgba(0, 0, 0, 0.06);
  color: #0969da;
}

@media (max-width: 640px) {
  body { padding: 8px 8px 80px; }
  .menu h1 { margin-right: 0; }
  .content { padding: 12px 14px 20px; }
  article { font-size: 16px; }
  article header h1 { font-size: 23px; }
  article h2 { font-size: 19px; }
}
