/* herman_style.css
   im herman, and im stylish
*/

/* --------------------------
   FONTS
-------------------------- */
@font-face {
  font-family: 'Algerian';
  src: url('fonts/Algerian Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Balthazar';
  src: url('fonts/Balthazar-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* fallbacks used where custom fonts fail */
:root {
  --body-fallback: 'Georgia', 'Garamond', serif;
  --header-fallback: 'Garamond', 'Times New Roman', serif;
}

/* --------------------------
   PAGE BACKGROUND & LAYOUT
-------------------------- */
body {
  background-image: url('media/paper-background.jpg');
  background-repeat: no-repeat;
  background-position: top left;
  background-size: 100% 101.65%;
  background-attachment: fixed;
  background-blend-mode: multiply;

  margin: 0;
  padding: 2rem;
  color: #3a2a1f;                 /* dark-brown text for parchment */
  font-family: 'Balthazar', var(--body-fallback);
  line-height: 1.7;
  text-align: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  overflow-x: hidden;
}

/* center the content, keep internal text left-aligned */
#preview {
  max-width: 900px;
  margin: 2rem auto 0 auto;   /* add top margin */
  text-align: left;
  padding: 1rem;  
}

/* --------------------------
   TYPOGRAPHY: HEADINGS + STROKES
-------------------------- */
/* universal small readable stroke fallback */
.heading-stroke {
  -webkit-text-stroke: 0.9px rgba(0,0,0,0.55);
  text-shadow:
    0 1px 0 rgba(255,255,220,0.65),
    -1px 0 0 rgba(0,0,0,0.55),
    1px 0 0 rgba(0,0,0,0.55),
    0 -1px 0 rgba(0,0,0,0.55),
    0 2px 6px rgba(0,0,0,0.45);
}

/* HEADINGS - Algerian only */
h1,h2,h3,h4,h5,h6 {
  font-family: 'Algerian', var(--header-fallback);
  color: #4b1f1f;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* H1 - main title */
h1 {
  border-bottom: 3px solid #800000;
  padding-bottom: 0.3em;
  font-size: 2.6em;
  margin-top: 0;
  -webkit-text-stroke: 1px rgba(0,0,0,0.6);
  text-shadow:
    0 1px 0 rgba(255,255,220,0.7),
    -1px 0 0 rgba(0,0,0,0.6),
    1px 0 0 rgba(0,0,0,0.6),
    0 -1px 0 rgba(0,0,0,0.6),
    0 3px 8px rgba(0,0,0,0.45);
}

/* H2 - section headers */
h2 {
  border-bottom: 2px solid #800000;
  padding-bottom: 0.2em;
  margin-top: 1.5em;
  font-size: 2em;
  -webkit-text-stroke: 0.8px rgba(0,0,0,0.55);
  text-shadow:
    0 1px 0 rgba(255,255,220,0.66),
    -1px 0 0 rgba(0,0,0,0.45),
    1px 0 0 rgba(0,0,0,0.45),
    0 2px 6px rgba(0,0,0,0.35);
}

/* H3 smaller sections */
h3 {
  margin-top: 1em;
  font-size: 1.4em;
  -webkit-text-stroke: 0.7px rgba(0,0,0,0.45);
  text-shadow:
    0 1px 0 rgba(255,255,220,0.6),
    0 2px 4px rgba(0,0,0,0.35);
}

/* H6 - subtitle / meta */
h6 {
  font-size: 0.9em;
  color: #5d4a3f;
  font-style: italic;
  margin-bottom: 0.5em;
  text-shadow: 0 1px 0 rgba(255,255,220,0.55);
}

/* --------------------------
   BODY TEXT, EMPHASIS
-------------------------- */
p, li, .stats-box, pre {
  font-family: 'Balthazar', var(--body-fallback);
}

p {
  margin: 0.5em 0;
  text-shadow: 0 1px 0 rgba(255,255,220,0.55), 0 1px 3px rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.0);
  padding: 0;
}

strong {
  color: #8b0000;
  -webkit-text-stroke: 0.2px rgba(0,0,0,0.4);
  text-shadow: 0 1px 0 rgba(255,235,200,0.5), 0 1px 2px rgba(0,0,0,0.25);
}

em {
  color: #aa3333;
  font-style: italic;
}

/* --------------------------
   BLOCKS, PANELS & MISC
-------------------------- */
pre {
  background: rgba(60, 40, 30, 0.82);
  padding: 1em;
  border-radius: 8px;
  overflow-x: auto;
  color: #f0e1c6;
  font-family: "Courier New", monospace;
  margin: 1em 0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

.stats-box {
  background: rgba(90, 60, 50, 0.66);
  padding: 1em;
  border-left: 4px solid #800000;
  margin: 1em 0;
  border-radius: 5px;
  -webkit-text-stroke: 0.15px rgba(0,0,0,0.25);
}

blockquote {
  border-left: 4px solid #800000;
  padding-left: 1em;
  color: #5a3c32;
  font-style: italic;
  margin: 1em 0;
  text-shadow: 0 1px 0 rgba(255,255,220,0.45);
}

/* links */
a { color: #800000; text-decoration: none; }
a:hover { text-decoration: underline; }

/* hr */
hr { border: none; height: 2px; background: #800000; margin: 2em 0; }

/* small scrollable helper */
.scroll-section {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.5em;
  scrollbar-width: thin;
  scrollbar-color: #800000 rgba(0,0,0,0.3);
}
.scroll-section::-webkit-scrollbar { width: 8px; }
.scroll-section::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.scroll-section::-webkit-scrollbar-thumb { background-color: #800000; border-radius: 4px; }

/*Navbar*/
.nav-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(75, 0, 0, 0.35);
  border-bottom: 1px solid #c60000;
  padding: 0.4em 2em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  text-align: left;
  z-index: 1000;

  box-sizing: border-box; /* <-- fixes the width overflow */
    }
    .nav-bar a {
      color: #c60000;
      text-decoration: none;
      margin-right: 1.5em;
      font-family: 'Balthazar', var(--body-fallback);
      text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    }
    .nav-bar a:hover {
      color: #ff0000;
      text-decoration: underline;
    }

  .content {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1rem;
  }

  /*Art*/
  .art {
    margin: 2.5rem 0;
    text-align: center;
  }

  .art img {
    max-width: 100%;
    height: auto;
    border: 2px solid #3a2f1f;
    background: #efe5c9;
  }

  .art figcaption {
    margin-top: 0.5rem;
    font-family: "Balthazar", serif;
    font-size: 0.95rem;
    cursor: url("media/misc/magnifier.png");
    color: #3a2f1f;
    opacity: 0.85;
  }

  .art img {
    cursor: url("media/misc/magnifier.png"), auto;
  }

  #lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
  }

  #lightbox img {
    max-width: 98vw;
    max-height: 98vh;
    object-fit: contain;

    /* the important part */
    background: #111;
    padding: 24px;
    border-radius: 8px;

    box-shadow:
      0 0 0 1px rgba(255,255,255,0.05),
      0 20px 80px rgba(0,0,0,0.9);
  }


  .lightbox-inner {
    position: relative;
    display: inline-block;
  }

  .render-set {
    display: none;
    margin-top: 0.6rem;
  }

  .render-set img {
    max-width: 100%;
    margin-top: 0.5rem;
  }

  .toggle-renders {
    background: rgba(120, 0, 0, 0.25);
    border: 1px solid #800000;
    color: #3a2f1f;
    font-family: "Balthazar", serif;
    padding: 0.4em 0.8em;
  }
  
  .render-group {
    margin-top: 0.6rem;
  }

  .render-controls {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    margin: 0.6rem 0;
  }
  
  /*Stuff for scrollbar*/
  html {
    scrollbar-width: auto;  /* Options: auto, thin, or none */
    scrollbar-color: #c60000 #000000;  /* thumb and track colors */
  }

  ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
  }
  
  ::-webkit-scrollbar-track {
    background-color: #c60000;
    border-radius: 10px;
  }
  
  ::-webkit-scrollbar-thumb {
    background-color: #000000;
    border-radius: 10px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background-color: #500010;
  }

  .video-frame {
    max-width: 720px;
    margin: 2em auto;
    padding: 10px;
    background: #f2e6c8;
    border: 2px solid #5a4632;
  }

  .video-frame iframe,
  .video-frame video {
    width: 100%;
    height: 405px;
  }

  /*Stuff for mouse*/
  html, body, a, button, input, label, select, textarea, .blood, [role="button"] {
    cursor: url("media/misc/quill.png"), auto !important;
  }

  /*Side media*/
  .side-media {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin: 2rem 0;
  }

  .side-media.left {
    flex-direction: row;
  }

  .side-media.right {
    flex-direction: row-reverse;
  }

  .side-media img {
    width: clamp(180px, 30%, 320px);
    height: auto;
    flex-shrink: 0;

    border: 2px solid #3a2f1f;
    background: #efe5c9;
  }

  /* blood layer sits inside the document; script will set its height to match document */
  #blood-layer {
    position: absolute; /* script will size it to the document height */
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 5;
  }

  /* stain visuals — keep background-size: contain and make them absolute by default */
  .blood {
    position: absolute;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.22; /* tweak for subtlety */
    pointer-events: none;
  }

/* End of herman_style.css */
