/*
  ════════════════════════════════════════════════════════════════
  POTS SCOTLAND — CITATION SYSTEM STYLES (citations.css)
  Link in <head> of every page that uses the citation system.
  ════════════════════════════════════════════════════════════════
*/

/* ── Superscript cite marker ─────────────────────────────────── */
.cite-sup {
  position: relative;
  display: inline-block;
  vertical-align: super;
  font-size: 0.7em;
  line-height: 1;
  margin-left: 1px;
}

.cite-link {
  color: #D85A30;            /* --coral */
  text-decoration: none;
  font-weight: 500;
  font-family: 'DM Sans', system-ui, sans-serif;
  border-bottom: 1px dotted #F0997B;
  padding-bottom: 0;
  transition: color 0.15s;
}

.cite-link:hover,
.cite-sup:focus .cite-link {
  color: #B84820;            /* --coral-dark */
}

/* ── Hover / focus tooltip ───────────────────────────────────── */
.cite-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1A1410;       /* --ink */
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  line-height: 1.55;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 400;
  padding: 10px 14px;
  border-radius: 6px;
  width: 320px;
  max-width: 90vw;
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  white-space: normal;
}

/* Arrow */
.cite-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1A1410;
}

.cite-sup:hover .cite-tooltip,
.cite-sup:focus .cite-tooltip {
  display: block;
}

.cite-tooltip-line {
  display: block;
  margin-bottom: 4px;
  font-style: normal;
}

.cite-tooltip-line:last-child { margin-bottom: 0; }

/* ── Reference section ───────────────────────────────────────── */
#references-section {
  background: #F5F0EB;       /* --paper-mid */
  border: 1px solid #EDE5DC; /* --paper-dark */
  border-radius: 10px;
  padding: 2rem 2.25rem;
  margin-top: 3rem;
}

.ref-list-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  color: #1A1410;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.ref-list-note {
  font-size: 13px;
  color: #7A6E68;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #EDE5DC;
}

.ref-list {
  list-style: none;
  counter-reset: ref-counter;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ref-item {
  counter-increment: ref-counter;
  padding: 0.85rem 0;
  border-bottom: 1px solid #EDE5DC;
  font-size: 13.5px;
  line-height: 1.6;
  color: #4A3F38;
  transition: background 0.3s;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.ref-item:last-child { border-bottom: none; }

.ref-item::before {
  content: counter(ref-counter) '.';
  font-size: 12px;
  font-weight: 500;
  color: #D85A30;
  flex-shrink: 0;
  min-width: 20px;
  text-align: right;
}

.ref-item .ref-content {
  flex: 1;
  min-width: 0;
}

.ref-authors,
.ref-title,
.ref-journal,
.ref-year {
  display: inline;
}

.ref-authors {
  font-weight: 500;
  color: #1A1410;
}

.ref-title {
  color: #4A3F38;
}

.ref-journal {
  font-style: italic;
  color: #1A1410;
}

.ref-year { color: #4A3F38; }

.ref-doi {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: #7A6E68;
}

.ref-doi a {
  color: #D85A30;
  text-decoration: none;
  border-bottom: 1px dotted #F0997B;
}

.ref-doi a:hover { color: #B84820; }

.ref-note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #7A6E68;
  font-style: italic;
}

/* Highlight flash when navigating to a reference */
@keyframes ref-flash {
  0%   { background: #FAECE7; }
  100% { background: transparent; }
}

.ref-highlight {
  animation: ref-flash 2s ease forwards;
  border-radius: 4px;
}
