/* Gulf Fish Phylogenetics — shared stylesheet */

:root {
  --accent: #0a6e7c;
  --accent-dark: #064f5a;
  --accent-light: #e0f4f7;
  --text: #1a1a1a;
  --muted: #555;
  --border: #cde8ed;
  --max-width: 860px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  background: #fff;
  color: var(--text);
  line-height: 1.7;
}

/* ── Navigation ── */
nav {
  background: var(--accent);
  padding: 0 1.5rem;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  max-width: var(--max-width);
  margin: 0 auto;
}

nav ul li a {
  display: block;
  color: #fff;
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  padding: 0.85rem 0.7rem;
  transition: background 0.15s;
}

nav ul li a:hover,
nav ul li a.active {
  background: var(--accent-dark);
}

/* ── Page header ── */
header.page-header {
  background: var(--accent-light);
  border-bottom: 2px solid var(--border);
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
}

header.page-header h1 {
  font-size: 2rem;
  color: var(--accent-dark);
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ── Main content ── */
main {
  max-width: var(--max-width);
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

/* ── Hero buttons (landing page) ── */
.hero-intro {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero-intro p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.btn-card {
  display: block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  text-align: center;
  padding: 1.6rem 1.2rem;
  border-radius: 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: bold;
  line-height: 1.4;
  transition: background 0.15s, transform 0.1s;
}

.btn-card:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

/* ── Placeholder block ── */
.placeholder {
  background: var(--accent-light);
  border: 1.5px dashed var(--accent);
  border-radius: 4px;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.92rem;
}

.placeholder p {
  margin-bottom: 0.4rem;
}

/* ── Section headings inside main ── */
main h2 {
  font-size: 1.35rem;
  color: var(--accent-dark);
  margin: 2.5rem 0 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}

main p {
  margin-bottom: 1.1rem;
}

/* ── Code blocks ── */
pre {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
}

pre code {
  font-family: "Courier New", Courier, monospace;
  color: #1a1a1a;
  background: none;
  padding: 0;
}

/* ── Data table ── */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
  margin: 1.5rem 0;
}

table.data-table th {
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 0.75rem;
  text-align: left;
}

table.data-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.data-table tr:nth-child(even) td {
  background: var(--accent-light);
}

table.data-table em {
  font-style: italic;
}

/* ── Figures and images ── */
figure {
  margin: 1.5rem 0;
}

figure img {
  max-width: 100%;
  border-radius: 6px;
  display: block;
}

figcaption {
  font-style: italic;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

/* Hero image on landing page */
.hero-image {
  margin: 1.5rem 0;
}

.hero-image img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

/* ── Figure placeholder ── */
.fig-placeholder {
  background: var(--accent-light);
  border: 1.5px dashed var(--accent);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
  font-style: italic;
}

/* ── Discussion / collapsible questions ── */
details {
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 1rem 0;
  background: #fff;
}

details + details {
  margin-top: 0.5rem;
}

summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--accent-dark);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

summary::before {
  content: "▶";
  font-size: 0.7rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details[open] summary {
  border-bottom: 1px solid var(--border);
}

.details-body {
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  color: var(--text);
}

.details-body p {
  margin-bottom: 0;
}

/* ── Bottom navigation (unified prev/next/refs bar) ── */
nav.bottom-nav {
  max-width: var(--max-width);
  margin: 3rem auto 1rem auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
}

nav.bottom-nav a {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  transition: background 0.15s;
  white-space: nowrap;
}

nav.bottom-nav a:hover {
  background: var(--accent-dark);
}

nav.bottom-nav a.refs-btn {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--border);
  font-weight: 400;
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
}

nav.bottom-nav a.refs-btn:hover {
  background: var(--accent-light);
}

nav.bottom-nav span {
  flex: 1;
}

/* ── Inline term & reference links ── */
a.term {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  font-style: inherit;
}

a.term:hover {
  background: var(--accent-light);
  border-radius: 2px;
}

sup a.ref {
  color: var(--accent-dark);
  text-decoration: none;
  font-size: 0.72em;
  font-family: Arial, Helvetica, sans-serif;
}

sup a.ref:hover {
  text-decoration: underline;
}

/* ── Glossary definition list ── */
dl.glossary {
  margin: 1.5rem 0;
}

dl.glossary dt {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-dark);
  margin-top: 1.75rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

dl.glossary dd {
  margin: 0.4rem 0 0 0;
  padding-left: 1rem;
  border-left: 3px solid var(--accent-light);
  color: var(--text);
  font-size: 0.97rem;
  line-height: 1.7;
}

.gloss-ref {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Literature cited list ── */
ol.literature {
  margin: 1.5rem 0 1.5rem 1.5rem;
  font-size: 0.95rem;
  line-height: 1.75;
}

ol.literature li {
  margin-bottom: 1.1rem;
  padding-left: 0.25rem;
}

ol.literature li a {
  color: var(--accent);
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
}

ol.literature li a:hover {
  text-decoration: underline;
}

main h3 {
  font-size: 1.1rem;
  color: var(--accent-dark);
  margin: 2rem 0 0.6rem;
}

/* ── Slideshows ── */
.slideshow {
  margin: 1.5rem 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.ss-frame {
  position: relative;
  height: 460px;
  overflow: hidden;
  background: #111;
}

.ss-frame img.ss-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.ss-frame img.ss-img.fading {
  opacity: 0;
}

.ss-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.42);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  border-radius: 3px;
  line-height: 1;
  transition: background 0.15s;
}

.ss-nav:hover { background: rgba(0,0,0,0.72); }
.ss-prev { left: 0.6rem; }
.ss-next { right: 0.6rem; }

.ss-footer {
  background: var(--accent-light);
  padding: 0.5rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ss-caption {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text);
  margin: 0;
  line-height: 1.45;
  flex: 1;
}

.ss-dots {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.ss-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ccc;
  border: 1px solid var(--accent);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}

.ss-dot.active { background: var(--accent); }

/* ── Troubleshooting details (build-your-own-tree) ── */
details.troubleshoot {
  border-color: #e6a817;
  background: #fffdf5;
}

details.troubleshoot summary {
  color: #7a4f00;
}

details.troubleshoot summary::before {
  content: "🔧";
  font-size: 0.85rem;
}

details.troubleshoot[open] summary {
  border-bottom-color: #e6a817;
}

/* ── Footer ── */
footer {
  border-top: 2px solid var(--border);
  text-align: center;
  padding: 1.25rem 1.5rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4rem;
}
