/* =========================
   Global Reset & Defaults
   ========================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =========================
   General Layout
   ========================= */

body {
  font-family: "Atkinson Hyperlegible Mono", sans-serif;
  background: #fff;
  color: #333333;
  margin: 0;
  padding: 2rem;
  font-size: 20px;
  position: relative;
  z-index: 1;
}

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4rem;
}

.header-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-nav {
  margin-left: auto;
}

.header-title a {
  display: inline-block;
}

.header-title img {
  display: block;
  max-height: 60px;
}

nav a,
nav a:visited {
  color: #333333;
  text-decoration: none;
  margin-left: 1.5rem;
}

nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

main article {
  margin-bottom: 3rem;
}

h1,
h2 {
  font-weight: normal;
}

/* =========================
   Index Page Intro
   ========================= */

.intro {
  font-family: "Rock 3D", serif;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-top: 30vh;
  margin-bottom: 4rem;
  font-size: 4rem;
  line-height: 1.9;
  color: #0D0D0D;
  text-shadow: 0.5px 0 0 currentColor, -0.5px 0 0 currentColor;
}

/* =========================
   Background Video (Index)
   ========================= */

#bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

#video-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  z-index: 0;
}


/* =========================
   Footer
   ========================= */

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  padding: 1rem 2rem;
  font-size: 0.9rem;
  color: #fff;
  z-index: 1;
}

/* =========================
   Journal List Page
   ========================= */

body.journal-page {
  background: #F0FCFF;
}

/* Journal preview container */
.journal-preview {
  display: grid;
  grid-template-columns: 1fr auto; /* Text on left, image on right */
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

/* Preview image */
.preview-image img {
  width: 100%;
  max-width: 220px;
  height: auto;
  border-radius: 6px;
  display: block;
}

.journal-text {
  display: flex;
  flex-direction: column;
}

/* Journal title */
.journal-title {
  margin-top: 0;
  line-height: 1.2;
  font-family: "Rock 3D", serif;
  font-size: 2rem;
  color: #0D0D0D;
  text-decoration: none;
  margin-bottom: 0.25rem;
  display: block;
}

.journal-title:visited {
  color: #0D0D0D;
}

.journal-title:hover {
  text-decoration: underline;
}

/* Journal date */
.journal-date {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.25rem;
  display: block;
}

/* Journal excerpt */
.journal-excerpt {
  margin-top: 0.25rem;
  font-size: 1rem;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* limit to 3 lines in preview */
  -webkit-box-orient: vertical;
}

/* =========================
   Sketchbook Masonry Grid
   ========================= */

body.sketchbook-page {
  background: #F6F1E0;
}

.sketchbook-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 50px;
  gap: 1rem;
}

.sketchbook-tile {
  grid-row-end: span var(--row-span);
}

.tile-inner {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

/* Filter UI */
.filter-container {
  position: relative;
  margin-left: 1.5rem;
}

.filter-toggle {
  background: none;
  border: none;
  font-family: "Atkinson Hyperlegible Mono", sans-serif;
  font-size: 1rem;
  cursor: pointer;
  color: #333;
}

.filter-menu {
  position: absolute;
  right: 0;
  top: 120%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.5rem;
  display: none;
  z-index: 10;
}

.filter-menu button {
  display: block;
  background: none;
  border: none;
  padding: 0.3rem 0.6rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.filter-menu button:hover {
  background: #f0f0f0;
}

.sketchbook-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

/* Text-only dropdown */
#sketchbook-filter {
  font-family: "Atkinson Hyperlegible Mono", sans-serif;
  font-size: 0.95rem;
  color: #000;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

#sketchbook-filter:focus {
  outline: none;
}

#sketchbook-filter:hover {
  opacity: 0.7;
}

.sketchbook-tile.is-hidden {
  display: none;
}

/* Images (GPU Accelerated) */
.sketchbook-tile img {
  width: 100%;
  height: auto;
  display: block;
  will-change: transform;
  transform: translateZ(0);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.sketchbook-tile:hover .tile-inner img {
  transform: scale(1.05);
  filter: brightness(60%);
}

/* Overlay & Date */
.tile-inner .overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
}
.tile-inner img {
  position: relative;
  z-index: 1;
}

.sketchbook-tile:hover .tile-inner .overlay {
  opacity: 1;
}

.tile-inner .overlay .date {
  font-family: "Rock 3D", serif;
  font-size: 1.5rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
}

.tile-inner .overlay .title {
  font-family: "Atkinson Hyperlegible Mono", sans-serif;
  font-size: 0.95rem;
  color: #F6F1E0;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  line-height: 1.3;
  max-width: 90%;
}

/* =========================
   Journal Entry Pages
   ========================= */

body.journal-entry-page {
  background: #F0FCFF;
  font-family: "Atkinson Hyperlegible Mono", sans-serif;
  color: #111;
  padding: 3rem 2rem;
  line-height: 1.8;
}

/* Headings */
body.journal-entry-page h1, 
body.journal-entry-page h2, 
body.journal-entry-page h3 {
  font-family: "Rock 3D", serif;
  color: #0D0D0D;
  margin-bottom: 1rem;
}

/* Paragraphs */
body.journal-entry-page p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

/* Images inside entries */
body.journal-entry-page img {
  max-width: calc(100% - 2rem); /* prevents edge-to-edge */
  height: auto;
  display: block;
  margin: 1.5rem auto;
  border-radius: 4px;
}

/* Wrapped image inside journal entry */
.journal-inline-image {
  float: right;
  width: 30%;
  max-width: 400px;
  margin: 0 0 1rem 2rem; /* space between text and image */
  border-radius: 4px;
}

.journal-image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1rem auto;
  max-width: 1000px;
  padding: 0 0.5rem;
}

/* Two large images variant */
.journal-image-grid.grid-two-large {
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 900px;
}

.journal-image-grid img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .journal-image-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .journal-image-grid {
    grid-template-columns: 1fr;
  }
}

.clear-below {
  clear: both;
}

/* Journal entry layout */
.journal-entry {
  max-width: 1000px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Clear float at end of article */
.journal-entry::after {
  content: "";
  display: block;
  clear: both;
}

/* Figure captions */
body.journal-entry-page figure figcaption {
  font-size: 0.9rem;
  text-align: center;
  color: #555;
  margin-top: 0.5rem;
}

/* Links inside entries */
body.journal-entry-page a {
  color: #0D0D0D;
  text-decoration: none;
}

body.journal-entry-page a:hover {
  text-decoration: underline;
}
/* Journal inline links */
.journal-entry-page .journal-link {
  font-family: "Atkinson Hyperlegible Mono", sans-serif;
  font-size: inherit;
  color: #0D0D0D;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Hover (optional, subtle) */
.journal-entry-page .journal-link:hover {
  opacity: 0.7;
}

/* Visited link color: dark grey-blue */
.journal-entry-page .journal-link:visited {
  color: #3E4A5A;
}


@media (max-width: 1024px) {

  .site-header {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
  }

  /* Remove absolute positioning entirely */
  .header-title {
    position: static;
    transform: none;
    order: 1;
  }

  .header-nav {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-left: 0;
    order: 2;
  }

  .header-nav a {
    margin-left: 0;
    font-size: 1rem;
  }
}

.tile-inner .overlay {
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
}

.tile-inner .overlay .title {
  font-family: "Atkinson Hyperlegible Mono", sans-serif;
  font-size: 0.95rem;
  opacity: 0.95;
}

.tile-inner .overlay .date {
  font-family: "Rock 3D", serif;
  font-size: 1.1rem;
}








