/* Guestbook stylesheet. Visual language borrowed from the blog's pinned
   "scene" theme: pixel-sky background, torn-paper lilac panels with tape,
   Permanent Marker titles, Special Elite body, bow-heart dividers.
   Compact sizing so the page stays small inside the blog's iframe panel.
   Fonts, background and divider GIF are vendored in /static (no CDN). */

@font-face {
  font-family: 'Permanent Marker';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/permanent-marker-latin.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;
}
@font-face {
  font-family: 'Special Elite';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/special-elite-latin.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;
}
@font-face {
  font-family: 'Special Elite';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/special-elite-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/caveat-latin.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;
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/caveat-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --sky: #1b2350;
  --edge: #14193e;
  --ink: #1b2036;
  --body: #383f5e;
  --panel: #ecebf7;
  --panel-deep: #dad8ee;
  --line: #7781ab;
  --accent: #b31298;
  --accent-deep: #882077;
  --meta: #965081;
  --danger: #8f2f23;
  --bar-top: #e4e1f4;
  --bar-bot: #d1cdec;
  --bar-deep: #c0bae3;
  --nav-ink: #612557;
  --on-sky: #e3ebf7;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }
body { margin: 0; }

.page-body {
  background: var(--sky);
  color: var(--on-sky);
  font-family: 'Special Elite', 'Courier New', monospace;
  min-height: 100vh;
  line-height: 1.55;
}
/* sky image on a fixed pseudo-element so image-rendering: pixelated
   does not leak onto other images */
.page-body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/static/bg.png') center center / cover no-repeat, var(--sky);
  image-rendering: pixelated;
}

a { color: var(--accent); }
a:hover { color: var(--edge); }
a:visited { color: var(--accent); }
button, select, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--edge); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--on-sky); }

/* Header / footer bars */
.site-header {
  background: linear-gradient(180deg, var(--bar-top), var(--bar-bot));
  border-bottom: 3px solid var(--edge);
  padding: 14px 16px 10px;
  text-align: center;
}
.site-title {
  font-family: 'Permanent Marker', cursive;
  font-weight: normal;
  font-size: 26px;
  margin: 0 0 6px;
}
.site-title a { color: var(--ink); text-decoration: none; }
.site-title a:hover { color: var(--accent); }
.site-nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 0;
  margin: 0;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.site-nav-link {
  color: var(--nav-ink);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.site-nav-link:hover, .site-nav-link.is-active { color: var(--accent-deep); border-bottom-color: var(--accent-deep); }

.site-footer {
  background: linear-gradient(180deg, var(--bar-bot), var(--bar-deep));
  border-top: 3px solid var(--edge);
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--nav-ink);
}
.site-footer a { color: var(--accent-deep); }
.site-footer a:hover { color: var(--edge); }
.site-footer-inner {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.site-footer-note { margin-top: 4px; font-size: 11px; font-style: italic; }

/* Content column */
.page-content { max-width: 680px; margin: 0 auto; padding: 20px 16px 28px; }

/* Torn-paper panels with a tape strip on top */
.panel {
  position: relative;
  background: var(--panel);
  color: var(--ink);
  clip-path: polygon(
    0% 12px, 4% 0, 9% 8px, 14% 0, 20% 8px, 26% 0, 32% 8px, 38% 0, 44% 8px,
    50% 0, 56% 8px, 62% 0, 68% 8px, 74% 0, 80% 8px, 86% 0, 92% 8px, 96% 0,
    100% 12px,
    100% calc(100% - 12px), 96% 100%, 90% calc(100% - 8px), 84% 100%,
    78% calc(100% - 8px), 72% 100%, 66% calc(100% - 8px), 60% 100%,
    54% calc(100% - 8px), 48% 100%, 42% calc(100% - 8px), 36% 100%,
    30% calc(100% - 8px), 24% 100%, 18% calc(100% - 8px), 12% 100%,
    6% calc(100% - 8px), 0% 100%);
  padding: 20px 18px 16px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .45);
  margin-bottom: 18px;
}
.panel:last-child { margin-bottom: 0; }
.panel::before {
  content: '';
  position: absolute;
  top: -9px;
  left: 24px;
  width: 64px;
  height: 18px;
  background: linear-gradient(100deg, rgba(224, 53, 173, .55), rgba(224, 53, 173, .32));
  transform: rotate(-7deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
}
.panel:nth-of-type(even)::before {
  left: auto;
  right: 36px;
  width: 56px;
  height: 16px;
  background: linear-gradient(100deg, rgba(183, 209, 255, .6), rgba(183, 209, 255, .35));
  transform: rotate(5deg);
}

.section-title {
  font-family: 'Permanent Marker', cursive;
  font-weight: normal;
  font-size: 19px;
  margin: 0 0 10px;
  padding-bottom: 6px;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.lede { color: var(--body); font-size: 14px; margin: 0 0 12px; }
.empty { color: var(--body); font-size: 14px; margin: 0; }
.privacy { white-space: pre-wrap; color: var(--body); font-size: 13px; line-height: 1.6; }

.notice {
  background: var(--panel-deep);
  border: 2px dashed var(--accent);
  color: var(--ink);
  padding: 9px 12px;
  margin-bottom: 16px;
  font-size: 13px;
}

/* Forms */
form.stack { display: flex; flex-direction: column; gap: 8px; }
label { font-size: 12px; font-weight: 700; color: var(--ink); }
.form-grid { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr; gap: 8px; }
.form-grid > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
input, select, textarea {
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  border: 2px dashed var(--line);
  border-radius: 0;
  padding: 7px 9px;
  width: 100%;
}
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--edge);
  outline-offset: 2px;
  border-style: solid;
}
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-block;
  align-self: flex-start;
  min-height: 44px;
  padding: 8px 16px;
  border: 2px dashed var(--ink);
  background: var(--panel-deep);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
}
.btn:hover { background: #fff; }
.btn:active { transform: translateY(1px); }
.btn--danger { border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: var(--panel); }

/* Entries, with the bow-heart GIF as divider */
.entry {
  padding: 14px 0 18px;
  background-image: url('/static/bow.gif');
  background-repeat: repeat-x;
  background-position: center bottom;
  background-size: auto 14px;
}
.entry:last-of-type { background-image: none; padding-bottom: 4px; }
.entry-title {
  font-family: 'Permanent Marker', cursive;
  font-weight: normal;
  font-size: 17px;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}
.entry-meta {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--meta);
  font-weight: 700;
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.entry-meta a { color: var(--accent); }
.msg {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 12px; }
.pager-link { color: var(--accent); text-decoration: none; }
.pager-link:hover { color: var(--edge); }
.pager-link.is-disabled { color: var(--line); }

.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 0; }
.admin-actions form { margin: 0; }

form.search { margin-bottom: 10px; }
form.search label { display: block; margin-bottom: 4px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; }
.search-row .btn { flex: none; }

/* Embed mode (?embed=1): compact variant for the iframe on the blog home page.
   No site header/footer; text sits directly on the sky, so links use the pale
   ice blue (#b7d1ff, 9.7:1 on the sky) instead of the panel magenta. */
.page-body--embed { min-height: 0; }
.page-body--embed .page-content { max-width: none; padding: 12px 12px 16px; }
.page-body--embed .panel { padding: 16px 14px 12px; margin-bottom: 14px; }
.embed-h1 {
  font-family: 'Permanent Marker', cursive;
  font-weight: normal;
  font-size: 18px;
  color: var(--on-sky);
  margin: 0 0 8px;
}
.embed-bar { margin: 0 0 8px; font-size: 11px; text-align: right; }
.embed-bar a { color: #b7d1ff; }
.embed-bar a:hover { color: var(--on-sky); }

@media (max-width: 767px) {
  .page-content { padding: 14px 12px 24px; }
  .panel { padding: 16px 14px 12px; }
  .site-header { padding: 12px 14px 8px; }
  .site-title { font-size: 24px; }
  .section-title { font-size: 18px; }
  .entry-title { font-size: 16px; }
  .btn { width: 100%; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}
