/* ================= GENERAL ================= */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

body {
  background: black;
  color: #eaeaea;
  font-family: "EB Garamond", serif;
}

/* ================= TOP AUDIO BAR ================= */
#audio-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: rgba(0,0,0,0.9);
  border-bottom: 1px solid rgba(255,255,255,0.2);
  z-index: 9999;
}

#audio-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}

#audio-label {
  font-size: 13px;
  opacity: 0.7;
  font-family: "Cinzel", serif;
}

/* ================= MAIN SHELL ================= */
/* Diary shell with vellum background */
#diary-shell {
  width: 1000px;
  max-height: calc(100vh - 60px);
  margin: 90px auto 60px auto;
  padding: 26px;
  background-image: url("https://i.postimg.cc/RFdhv7cK/Vellum.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid #555;
  border-radius: 0px;
  box-shadow: 0 0 40px rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Panels with partial transparency to reveal vellum texture */
#years-panel,
#entries-panel {
  background: rgba(10,10,10,0.4); /* semi-transparent to see vellum */
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 0px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ================= HEADER ================= */
#diary-header {
  text-align: center;
  margin-bottom: 18px;
  flex: 0 0 auto;
}

#diary-header h1 {
  margin: 0;
  font-family: "Cinzel", serif;
  letter-spacing: 2px;
  font-size: 28px;
}

.subtitle {
  margin-top: 6px;
  opacity: 0.55;
  font-size: 13px;
}

/* ================= GRID ================= */
#diary-grid {
  display: grid;
  grid-template-columns: 30% 70%; /* years panel / entries panel */
  gap: 18px;
  flex: 1 1 auto;
  overflow: hidden;

  /* Vellum background */
  /*background-image: url('https://i.postimg.cc/RFdhv7cK/Vellum.jpg'); /* replace with your image path */
  /*background-size: cover;       /* make sure it covers the whole grid */
  /*background-position: center;  /* center the image */
  /*background-repeat: no-repeat;

  /* Optional: add subtle overlay for readability */
  /*position: relative;
/*}

#diary-grid::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3); /* adjust opacity to make text readable */
  pointer-events: none;        /* let clicks pass through */
}

/* ================= PANELS ================= */
#years-panel,
#entries-panel {
  background: rgba(10,10,10,0.55);
  border: 1px solid rgba(255,255,255,0.14); /* always visible */
  border-radius: 0px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

#entries-panel {
  width: 95%;
}

/* ================= PANEL TITLE ================= */
.panel-title {
  padding: 12px 14px;
  font-family: "Cinzel", serif;
  font-size: 14px;
  letter-spacing: 1px;
  opacity: 0.75;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  flex: 0 0 auto;
}

/* ================= LIST BOX ================= */
.list-box {
  padding: 12px;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Custom scrollbar for list-box */
.list-box::-webkit-scrollbar {
  width: 8px;
}

.list-box::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
}

.list-box::-webkit-scrollbar-thumb {
  background-color: rgba(200,200,200,0.6);
  border-radius: 4px;
}

/* ================= YEARS ================= */
.year-item {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(18,18,18,0.65);
  color: #eaeaea;
  font-family: "Cinzel", serif;
  cursor: pointer;
}

.year-item.active {
  background: rgba(45,15,15,0.55);
}

/* ================= ENTRIES ================= */
.entry-item {
  margin-bottom: 12px;
}

.entry-btn {
  width: 100%;
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 0px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(18,18,18,0.65);
  color: #eaeaea;
  cursor: pointer;
}

.entry-btn[aria-expanded="true"] .arrow {
  transform: rotate(90deg);
}

.arrow {
  transition: transform 0.22s ease;
}

.entry-date {
  font-family: "Cinzel", serif;
  font-size: 12px;
  opacity: 0.6;
  min-width: 60px;
}

/* ENTRY PANEL (outer panel keeps border always) */
.entry-panel {
  overflow: hidden;
  transition: max-height 0.35s ease;
  border-radius: 0px;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,0.1); /* always visible */
}

/* ENTRY BODY (scrollable text) */
.entry-body {
  margin-top: 10px;
  padding: 12px;
  border-radius: 0px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.1);
  overflow-y: auto;
  max-height: 200px;
  white-space: normal;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Hide content on collapse but keep panel border */
.entry-btn[aria-expanded="false"] + .entry-panel .entry-body {
  max-height: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

/* Scrollbar for entry body */
.entry-body::-webkit-scrollbar {
  width: 6px;
}

.entry-body::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
}

.entry-body::-webkit-scrollbar-thumb {
  background-color: rgba(200,200,200,0.6);
  border-radius: 0px;
}

.entry-body p {
  margin-bottom: 14px;
  font-size: 16px;
  line-height: 1.7;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* EMPTY */
.empty {
  opacity: 0.55;
  font-style: italic;
}

/* FOOTER */
#diary-footer {
  text-align: center;
  margin-top: 18px;
  flex: 0 0 auto;
}

#diary-footer a {
  color: #aaa;
  text-decoration: none;
}

/* RESPONSIVE */
@media (max-width: 980px) {
  #diary-shell {
    width: 92%;
  }
}

@media (max-width: 720px) {
  #diary-grid {
    grid-template-columns: 1fr;
  }
}
