/* =========================
   Base / Resets
   ========================= */
* { box-sizing: border-box; }

body {
  font-size: 0.875em;
  font-family: monospace;
  padding: 0;
  margin: 0;
  background: #fff; /* solid fallback behind gradient */
  color: #382F32;
}

img, video { max-width: 100%; height: auto; display: block; }

/* =========================
   Background + Page Frame
   ========================= */
.aurora-background {
  min-height: 100vh;
  width: 100%;
  position: relative;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 5% 40%, rgba(175, 109, 255, 0.48), transparent 67%),
    radial-gradient(ellipse 70% 60% at 45% 45%, rgba(255, 100, 180, 0.41), transparent 67%),
    radial-gradient(ellipse 62% 52% at 83% 76%, rgba(255, 235, 170, 0.44), transparent 63%),
    radial-gradient(ellipse 60% 48% at 75% 20%, rgba(120, 190, 255, 0.36), transparent 66%),
    linear-gradient(45deg, #f7eaff 0%, #fde2ea 100%);
}

.page-content { padding: 1.2rem; }

.wrapper {
  max-width: 1100px;
  margin: 0 auto;
}

/* =========================
   Banner
   ========================= */
.banner img { width: 100%; height: auto; display: block; }

/* =========================
   Site Header (Title Bar)
   ========================= */
.header {
  background: #DAFBF8;
  text-align: center;
  margin-top: 15px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================
   Content Islands (.box / .inner)
   ========================= */
.title { display: none; }

.box { background: #fff; padding: 10px; }

.box h1, .box h2, .box h3, .box h4 {
  background: #E8DAFB;
  margin: 0;
  padding: 0.35em 0.25em 0.3em 0.25em;
  text-align: center;
}

.inner { background: #fff; padding: 10px; }

/* =========================
   Post Previews (Home/Archive)
   ========================= */
.recent-previews .post-preview {
  display: grid;
  grid-template-columns: 150px 1fr;
  column-gap: 12px;
  align-items: flex-start;
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.recent-previews .post-preview:last-child { border-bottom: 0; }

.recent-previews .post-preview-thumb {
  grid-column: 1;
  grid-row: 1 / span 4;
  margin: 0;
}
.recent-previews .post-preview-thumb img {
  width: 150px; max-width: 150px; height: auto;
}

.recent-previews .post-preview-title,
.recent-previews .post-preview-meta,
.recent-previews .post-preview-excerpt,
.recent-previews .post-preview-read { grid-column: 2; }

.post-preview-title { margin: 0 0 0.25rem 0; }
.post-preview-meta  { font-size: 0.9em; color: #555; margin: 0 0 0.35rem 0; }
.post-preview-excerpt { margin: 0.25rem 0 0.5rem 0; }
.post-preview-read a { text-decoration: none; }
.post-preview-read a:hover { text-decoration: underline; }

/* Stack preview vertically on small screens */
@media (max-width: 640px) {
  .recent-previews .post-preview { display: block; }
  .recent-previews .post-preview-thumb { margin: 0 0 0.5rem 0; }
}

/* =========================
   Full Post Cover + Content
   ========================= */
.post-cover-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}
.post-cover { max-width: 150px; height: auto; display: block; }

/* =========================
   Primary Navigation
   ========================= */
.links {
  margin-top: 0;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 1em 1.5em;
  box-sizing: border-box;
}
.links a {
  text-decoration: none;
  color: #382F32;
  font-size: 1rem;
  padding: 0.5em 0.9em;
}
.links a:hover { background: #E8DAFB; border-radius: 4px; }

/* =========================
   Page Layout: 3 → 2 → 1 columns
   ========================= */
/* Base: 3 columns (left | main | right) */
.wrapper-2 {
  display: grid;
  grid-template-columns: 175px minmax(0, 1fr) 175px;
  column-gap: 10px;
  align-items: flex-start;
}
.sidebar-left  { grid-column: 1; }
.main          { grid-column: 2; }
.sidebar-right { grid-column: 3; }

/* Hide right sidebar when body has the flag */
body.no-right-sidebar #right,
body.no-right-sidebar .right-sidebar,
body.no-right-sidebar .sidebar-right,
body.no-right-sidebar aside.right,
body.no-right-sidebar #sidebarRight,
body.no-right-sidebar #rightSidebar {
  display: none !important;
}


/* Desktop / tablet (>=900px): widen left, collapse grid to 2 columns */
@media (min-width: 900px) {
  body.no-right-sidebar #left,
  body.no-right-sidebar .left-sidebar,
  body.no-right-sidebar aside.left,
  body.no-right-sidebar #sidebarLeft,
  body.no-right-sidebar #leftSidebar {
    width: 320px;
    max-width: 100%;
  }
  body.no-right-sidebar .wrapper-2 {
    grid-template-columns: 320px 1fr;
  }
  .content, #content, main { margin-right: 0 !important; }
}

/* Mobile (<=840px): make everything full width */
@media (max-width: 840px) {
  .wrapper-2 { display: block !important; }

  #left, .left-sidebar, aside.left, #sidebarLeft, #leftSidebar,
  #right, .right-sidebar, .sidebar-right, aside.right, #sidebarRight, #rightSidebar,
  .content, #content, main {
    width: 100% !important;
    max-width: 100%;
    float: none;
    margin: 0;
  }

  /* Space between left sidebar and content when stacked */
  #left, .left-sidebar, aside.left, #sidebarLeft, #leftSidebar {
    margin-bottom: 1rem;
  }
}


/* Wrapper padding at narrower widths */
@media (max-width: 980px) { .wrapper { padding: 0 0.5rem; } }

/* =========================
   Footer
   ========================= */
.footer {
  background: #fff;
  padding: 10px;
  text-align: center;
  color: #333;
}

/* =========================
   Utility Lists
   ========================= */
.list-unstyled { list-style: none; padding: 0; margin: 0; }
.list-unstyled li + li { margin-top: 0.25rem; }

/* =========================
   Blog Islands: Lists & Nav within Main
   ========================= */
.main #postlistdiv ul,
.main #recentpostlistdiv ul {
  font-size: 1.1em;
  padding: 0 0 0 0.75rem; /* small left padding for readability */
  list-style-type: none;
  margin: 0;
}
.main #postlistdiv li,
.main #recentpostlistdiv li { margin: 0.4rem 0; }
.main .moreposts { font-size: 0.9em; margin-top: 0.4rem; }
.main #nextprev { text-align: center; margin-top: 1.4em; }

/* Hide duplicate injected heading in recent list */
.main #recentpostlistdiv > h2 { display: none; }

/* =========================
   Per-Post: Category Links
   ========================= */
#postCategories {
  font-size: 0.9em;
  color: #555;
  margin-top: 0.25rem;
}
#postCategories a { text-decoration: none; }
#postCategories a:hover { text-decoration: underline; }

/* =========================
   Search results
   ========================= */
#searchQueryEcho { color: #555; margin: 0 0 0.75rem 0; }
.search-hit { padding: 0.5rem 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
.search-hit:last-child { border-bottom: none; }
.search-hit-title { margin: 0 0 0.25rem 0; }
.search-hit-meta { font-size: 0.9em; color: #555; margin: 0 0 0.35rem 0; }
.search-hit-snippet { margin: 0; }
.search-noresults { color: #777; }
mark { background: #fff3a6; }

/* =========================
   Left sidebar search box
   ========================= */
.sidebar-search.box .inner { padding: 0.75rem 1rem; }
.sidebar-search h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.sidebar-search form { display: flex; gap: 0.5rem; }
.sidebar-search input[type="text"] { flex: 1 1 auto; min-width: 0; }

/* On very small screens, stack input over button */
@media (max-width: 480px) {
  .sidebar-search form { flex-direction: column; }
  .sidebar-search button { width: 100%; }
}
