/* Shared styles used across pages (kept intentionally small).
   Pages can still define their own :root variables + layout in their inline <style>. */

/* Global color override:
   Many pages use --neon-green for highlight text (strong tags, accents, gradients).
   We remap it to the existing gold variable so highlight text matches the header gold. */
:root {
  --neon-green: var(--circuit-gold);
}

/* Shared header behavior:
   - Always span full viewport width
   - Never crop or stretch text inside the image
   - Height follows the image aspect ratio */
header {
  display: block;
}

.header-img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}

/* Paper cover images */
.cover-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  margin: 0 0 22px 0;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* Paper title course code badge (matches papers.html) */
.course-code {
  display: inline-block;
  margin-right: 10px;
  padding: 4px 10px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg-dark);
  background: linear-gradient(to right, var(--neon-green), var(--neon-blue));
  border-radius: 999px;
  vertical-align: middle;
}

/* Top bar is the only layout used site-wide; index-style (social left, nav center) is below. */

/* Nav bar: image buttons (legacy .nav-container – not used by current top-bar markup) */
.nav-container nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 18px;
}

.nav-container nav a {
  display: inline-block;
  line-height: 0;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-container nav a:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 20px rgba(0, 204, 255, 0.35);
}

.nav-container nav img {
  display: block;
  height: 240px;
  width: auto;
  max-width: 840px;
  object-fit: contain;
}

@media (max-width: 768px) {
  .nav-container nav img {
    height: 216px;
    max-width: 720px;
  }
}

/* --- Top bar: index-style layout (social left, nav center) + text nav buttons --- */
.top-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px 24px;
  background: rgba(10, 25, 47, 0.98);
  border-bottom: 1px solid rgba(192, 160, 98, 0.25);
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Exact index layout: social icons left, 28px; nav pills center */
.top-bar .social-podcast-bar {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  justify-self: start;
}

.top-bar .social-podcast-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 6px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.top-bar .social-podcast-bar a:hover {
  transform: scale(1.15);
  filter: brightness(1.2);
}

.top-bar .social-podcast-bar img {
  width: auto !important;
  height: 28px !important;
  max-height: 28px !important;
  max-width: 28px !important;
  object-fit: contain;
  display: block;
}

.top-bar .site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  justify-self: center;
}

.top-bar .site-nav .nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px !important;
  padding: 0 12px !important;
  background: rgba(192, 160, 98, 0.08);
  border: 1px solid rgba(192, 160, 98, 0.35);
  border-radius: 999px;
  color: var(--text-light);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem !important;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.top-bar .site-nav .nav-btn:hover {
  background: rgba(192, 160, 98, 0.18);
  border-color: var(--circuit-gold);
  color: #fff;
  box-shadow: 0 0 12px rgba(192, 160, 98, 0.25);
}

.top-bar .site-nav .nav-btn:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 2px rgba(0, 204, 255, 0.35);
}

.top-bar .site-nav .nav-btn.active {
  background: rgba(192, 160, 98, 0.35);
  border-color: var(--circuit-gold);
  color: #fff;
}

@media (max-width: 600px) {
  .top-bar {
    grid-template-columns: 1fr;
    padding: 8px 12px;
    gap: 10px 12px;
  }
  .top-bar .social-podcast-bar {
    justify-self: center;
  }
  .top-bar .social-podcast-bar img {
    height: 24px !important;
    max-height: 24px !important;
    max-width: 24px !important;
  }
  .top-bar .site-nav {
    order: 2;
  }
  .top-bar .site-nav .nav-btn {
    height: 26px !important;
    font-size: 0.65rem !important;
    padding: 0 10px !important;
  }
}

/* --- Readable links on dark paper / info panels (avoid low-contrast cyan-on-navy) --- */
main.paper-content a.inline-related,
.paper-content a.inline-related {
  color: #f5ecd8;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(192, 160, 98, 0.9);
  text-underline-offset: 3px;
}
main.paper-content a.inline-related:hover,
.paper-content a.inline-related:hover {
  color: #ffffff;
  text-decoration-color: #fff;
}

/* Plain links inside common tinted boxes (related papers, notes, etc.) */
main.paper-content .audit-note a,
main.paper-content .logic-box a,
main.paper-content .note a,
main.paper-content .context-box a {
  color: #f5ecd8;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(192, 160, 98, 0.85);
  text-underline-offset: 3px;
}
main.paper-content .audit-note a:hover,
main.paper-content .logic-box a:hover,
main.paper-content .note a:hover,
main.paper-content .context-box a:hover {
  color: #ffffff;
  text-decoration-color: #fff;
}

