@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital@1&display=swap');

/* =========================
   FIXED NAVBAR OFFSET
========================= */

:root{
  --vd-navbar-offset: 72px; /* adjust if needed */
}

/* Viewer page only */
body.vd-viewer {
  padding-top: 74px; /* adjust if needed (try 70–90px) */
}

/* =========================
   BASE
========================= */

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #F8F5EF;
  color: #2f2f2f;
}

/* =========================
   NAVBAR — global (all pages)
========================= */

.vd-navbar{
  font-size: 16px; /* or 1rem */
  background-color: rgba(122, 31, 41, 0.75) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(196,179,178,0.45);
  overflow: visible !important;
}

.vd-navbar .navbar-brand{
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.6rem;
  color: #5E121A !important;
  letter-spacing: -0.01em;
}

.vd-navbar .navbar-nav .nav-link{
  font-size: 1rem;
  font-family: 'Playfair Display', serif;
  color: rgba(94, 18, 26, 0.92) !important;
  font-weight: 500;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

/* Active */
.vd-navbar .navbar-nav .nav-link.active{
  color: #5E121A !important;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* Hover */
.vd-navbar .navbar-nav .nav-link:hover{
  color: #5E121A !important;
}

/* Toggler icon visibility on tinted background */
.vd-navbar .navbar-toggler{
  border-color: rgba(94, 18, 26, 0.35);
}
.vd-navbar .navbar-toggler:focus{
  box-shadow: 0 0 0 0.15rem rgba(94, 18, 26, 0.18);
}

/* Dropdown menu styling */
.vd-navbar .dropdown-menu{
  font-size: 1rem;
  font-family: 'Playfair Display', serif;
  background: rgba(248, 245, 239, 0.98);
  border: 1px solid rgba(196,179,178,0.85);
  border-radius: 12px;
  padding: 0.35rem;
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
  position: absolute;
  z-index: 2000;
}

/* Dropdown items */
.vd-navbar .dropdown-item{
  font-size: 1rem;
  color: rgba(94, 18, 26, 0.88);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-weight: 500;
}

/* Hover/focus */
.vd-navbar .dropdown-item:hover,
.vd-navbar .dropdown-item:focus{
  color: #5E121A;
  background: rgba(94, 18, 26, 0.10);
}

/* Divider */
.vd-navbar .dropdown-divider{
  border-top: 1px solid rgba(196,179,178,0.6);
  margin: 0.35rem 0;
}
/* =========================
   NAVBAR — active state 
========================= */

.vd-navbar .dropdown-item.is-current,
.vd-navbar .dropdown-item.active{
  color: #5E121A !important;
  background: rgba(94, 18, 26, 0.10) !important;
  text-decoration: none !important;
}

/* Optional: a tiny “selected” feel without changing layout */
.vd-navbar .dropdown-item.is-current{
  font-weight: 600;
}

/* Keep top-level active exactly as your global design (underline) */
.vd-navbar .navbar-nav .nav-link.active{
  background: transparent !important;
  border-radius: 0 !important;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* =========================
   VIEWER — MAIN LAYOUT
========================= */

.main-content {
  display: flex;
  height: calc(100vh - 120px);
  overflow: hidden;
}

/* transcription + annotations (center area) */
.content-wrapper {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 1rem;
  padding: 1rem;
  align-items: stretch;
}

/* =========================
   METADATA PANEL
========================= */

.metadata-panel {
  width: 340px;
  max-width: 360px;
  min-width: 280px;
  padding: 1rem 1rem;
  border-left: 1px solid rgba(196,179,178,0.75);
  background: #F8F5EF;
}

.metadata-title {
  margin: 0 0 0.75rem 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: #2f2f2f;
}

.metadata-dl {
  margin: 0;
}

.metadata-dl dt {
  font-weight: 700;
  margin-top: 0.65rem;
}

.metadata-dl dd {
  margin: 0.15rem 0 0 0;
  color: #2f2f2f;
}

.metadata-actions {
  margin-top: 1.25rem;
}

.metadata-actions .btn {
  border-color: #5E121A !important;
  color: #5E121A !important;
}

.metadata-actions .btn:hover,
.metadata-actions .btn:focus {
  background: #5E121A !important;
  border-color: #5E121A !important;
  color: #fff !important;
}

/* ===============================
   Varela Digital buttons
=============================== */

.btn-vd {
  color: #5E121A;
  border: 1px solid #5E121A;
  background: transparent;
}

.btn-vd:hover,
.btn-vd:focus {
  color: #fff;
  background: #5E121A;
  border-color: #5E121A;
}

.btn-vd:focus {
  box-shadow: 0 0 0 0.2rem rgba(94, 18, 26, 0.25);
}

/* =========================
   COLUMNS (viewer center)
========================= */

.left-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.annotations-column,
.right-column {
  display: none !important;
  flex-direction: column;
  min-width: 0;
}

body.annotations-open .annotations-column,
body.annotations-open .right-column {
  display: flex !important;
  flex: 0 0 32%;
  max-width: 520px;
  min-width: 300px;
}

body.annotations-open .left-column {
  flex: 1 1 68%;
  min-width: 0;
}

/* =========================
   BOXES
========================= */

.transcription-box,
.annotations-box {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1rem;
  border-radius: 12px;
  background-color: #FFFFFF;
  border: 1px solid #C4B3B2;
  overflow-y: auto;
}

.annotation-card {
  background: #fff;
  border: 1px solid rgba(196,179,178,0.9);
  border-radius: 10px;
  padding: 0.85rem 0.9rem;
}

.annotation-title {
  margin: 0 0 0.35rem 0;
  font-weight: 700;
  color: #2f2f2f;
}

.annotation-idno a {
  color: #5E121A;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* =========================
   TRANSCRIPTION UI
========================= */

.transcription-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.tab-button {
  border: 1px solid #C4B3B2;
  background: #F8F5EF;
  color: #5E121A;
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.9rem;
}

.tab-button.active {
  background: rgba(122, 31, 41, 0.15);
  border-color: rgba(122, 31, 41, 0.5);
}

.translation-disclaimer-box {
  border: 1px solid rgba(196,179,178,0.9);
  background-color: #F8F5EF;
  padding: 0.85rem 1rem;
  margin: 0.75rem 0 1.4rem 0;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.translation-disclaimer-title {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
  margin-bottom: 0.4rem;
}

.translation-disclaimer-text {
  color: #555;
}

/* =========================
   TEI block spacing
========================= */

.tei-div {
  margin-bottom: 1rem;
}

.tei-opener,
.tei-closer,
.tei-postscript,
.tei-dateline,
.tei-salute,
.tei-signed,
.tei-addressee {
  margin-bottom: 0.6rem;
}

.tei-body p {
  margin: 0 0 0.9rem 0;
  line-height: 1.55;
}

.tei-body p:last-child {
  margin-bottom: 0;
}

/* =========================
   TEI notes (endorsement / hand)
========================= */

.tei-endorsement {
  margin-top: 0.9rem;
  margin-bottom: 0.9rem;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid rgba(94, 18, 26, 0.35);
  background: rgba(122, 31, 41, 0.06);
  border-radius: 8px;
}

.tei-endorsement p {
  margin: 0;
}

.tei-note-hand {
  font-style: italic;
  color: #444;
}

.tei-folio {
  white-space: nowrap;
}

.tei-note-editorial {
  margin-top: 0.9rem;
  margin-bottom: 0.9rem;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid rgba(47, 47, 47, 0.35);
  background: rgba(47, 47, 47, 0.06);
  border-radius: 8px;
  font-size: 0.9rem;
}

.tei-note-editorial-inline {
  display: inline-block;
  margin: 0 0.2rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid rgba(47, 47, 47, 0.25);
  background: rgba(47, 47, 47, 0.06);
  border-radius: 6px;
  font-size: 0.85em;
}

/* =========================
   handShift rendering
========================= */

.tei-handshift {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: rgba(47, 47, 47, 0.75);
}

/* =========================
   TEI LISTS
========================= */

.tei-list {
  margin: 0.75rem 0 1rem 1.25rem;
  padding: 0;
  list-style-type: disc;
}

.tei-list li {
  margin: 0.35rem 0;
  padding-left: 0.25rem;
  line-height: 1.45;
}

/* =========================
   TEI TABLES
========================= */

.tei-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.25rem 0;
  font-size: 0.9rem;
}

.tei-table td {
  border: 1px solid rgba(196,179,178,0.85);
  padding: 0.45rem 0.55rem;
  vertical-align: top;
  line-height: 1.35;
}

.tei-table tr:nth-child(even) td {
  background-color: rgba(248,245,239,0.6);
}

/* =========================
   CLICKABLE TEXT
========================= */

.annotated {
  cursor: pointer;
  border-bottom: 1px dotted rgba(94, 18, 26, 0.5);
}

.annotated:hover {
  background-color: rgba(122, 31, 41, 0.15);
}

/* =========================
   LETTER NAV
========================= */

#letter-info {
  line-height: 1.2;
}

#letter-info .letter-title {
  font-size: 0.95rem;
  color: #5E121A;
}

#letter-info .letter-date {
  font-size: 0.75rem;
  text-transform: uppercase;
  opacity: 0.75;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 992px) {
  .main-content {
    flex-direction: column;
    height: auto;
  }

  .content-wrapper {
    flex-direction: column;
  }

  .metadata-panel {
    width: 100%;
    max-width: none;
    border-left: none;
    border-top: 1px solid rgba(196,179,178,0.75);
  }

  body.annotations-open .annotations-column,
  body.annotations-open .right-column {
    display: flex !important;
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
  }
}

/* =========================
   FOOTER (VD standard)
========================= */

.vd-footer {
  margin-top: 3rem;
  padding-bottom: 3rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(196,179,178,0.75);
  text-align: center;
  color: #5E121A;
}

.vd-footer a {
  color: #5E121A;
  text-decoration: none;
  font-weight: 600;
}

.vd-footer a:hover {
  color: #5E121A;
  text-decoration: underline;
}

.vd-footer .footer-links {
  margin-bottom: 0.55rem;
}

.vd-footer .footer-small {
  font-size: 0.8rem;
  opacity: 0.9;
}
