/* =========================================================
   GLOBAL SHARED STYLES & VIEW TRANSITIONS
   ========================================================= */

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
  animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
}

* {
  box-sizing: border-box;
}

/* --- THE CORNER BOOKMARK / RIBBON NAVIGATION --- */
#nav-toggle-btn {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 100000;
  background: rgba(28, 22, 17, 0.88);
  color: #d4c4a8;
  border: 1px solid rgba(184, 159, 128, 0.45);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 18px;
  border-radius: 20px;
  font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
  font-size: 15px;
  letter-spacing: 1.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  user-select: none;
}

#nav-toggle-btn:hover {
  background: #2b1f16;
  border-color: #d4c4a8;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

#nav-toggle-btn .seal-icon {
  font-size: 14px;
  color: #9e372a;
  transition: transform 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.seal-favicon-img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  transform: scale(1.15);
  display: block;
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
}

.nav-favicon-glyph {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  transform: scale(1.15);
  vertical-align: middle;
  transition: opacity 0.25s ease;
  display: inline-block;
  opacity: 0.6;
}

.nav-favicon-glyph:hover {
  opacity: 1;
}

#drawer-site-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  transform: scale(1.1);
  border: 1.5px solid rgba(139, 115, 85, 0.5);
  margin-bottom: 14px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  background: #0c0a08;
}

#nav-toggle-btn.open .seal-icon {
  transform: rotate(90deg);
}

/* Navigation Overlay Drawer */
#nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(12, 10, 9, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

#nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  width: 100%;
  max-width: 380px;
  height: 100%;
  background-color: #e8d5aa;
  background-image: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.18'/%3E%3C/svg%3E"),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 0%, rgba(120, 85, 15, 0.25) 100%);
  color: #2b1f16;
  padding: 80px 40px 40px;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6);
  border-left: 1px solid rgba(139, 115, 85, 0.35);
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

#nav-overlay.open .nav-drawer {
  transform: translateX(0);
}

.nav-drawer-header {
  border-bottom: 1px dashed rgba(139, 115, 85, 0.5);
  padding-bottom: 18px;
  margin-bottom: 30px;
}

.nav-drawer-header h2 {
  margin: 0;
  font-family: 'EB Garamond', Garamond, serif;
  font-size: 22px;
  letter-spacing: 2px;
  font-weight: 400;
  color: #2b1f16;
  text-transform: uppercase;
}

.nav-drawer-header span {
  font-family: 'EB Garamond', serif;
  font-size: 13px;
  font-style: italic;
  color: #755f47;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-links a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  color: #2b1f16;
  text-decoration: none;
  font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
  font-size: 20px;
  letter-spacing: 1px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.25s ease;
}

.nav-links a .nav-num {
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  color: #9e372a;
  letter-spacing: 0;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(43, 31, 22, 0.1);
  color: #9e372a;
  transform: translateX(6px);
}

.nav-drawer-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px dashed rgba(139, 115, 85, 0.4);
  font-family: 'EB Garamond', serif;
  font-size: 14px;
  color: #755f47;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-drawer-footer a {
  color: #755f47;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 1px;
}
.nav-drawer-footer a:hover {
  color: #2b1f16;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  #nav-toggle-btn {
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    font-size: 13px;
  }
  .nav-drawer {
    max-width: 85%;
    padding: 70px 25px 30px;
  }
  .nav-links a {
    font-size: 18px;
  }
}

/* =========================================================
   LITERARY FORMATTING & HIGHLIGHTS
   ========================================================= */
.literary-line-wrap {
  text-align: center;
  margin: 32px 0;
  clear: both;
}
.literary-line {
  border: none;
  border-top: 1px solid rgba(139, 115, 85, 0.45);
  width: 45%;
  max-width: 260px;
  margin: 0 auto;
  display: block;
}
mark, .styled-highlight {
  background-color: #fae8c8;
  color: inherit;
  padding: 2px 4px;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
[data-theme="dark"] mark, [data-theme="dark"] .styled-highlight {
  background-color: rgba(212, 196, 168, 0.25);
  color: inherit;
}
