/* ============================================================
   Wiruna Wanderings — Dark Theme Stylesheet
   ============================================================ */

/* --- CSS Variables ----------------------------------------- */
:root {
  --bg-primary:    #0d1117;
  --bg-secondary:  #161b22;
  --bg-tertiary:   #1c2128;
  --bg-notes:      #1a1e25;

  --text-primary:  #e6edf3;
  --text-secondary:#8b949e;
  --text-muted:    #6e7681;

  --accent:        #c9a84c;
  --accent-hover:  #e0be5a;
  --accent-dim:    #8b7333;

  --link:          #58a6ff;
  --link-hover:    #79c0ff;

  --border:        #30363d;
  --border-accent: rgba(201,168,76,0.2);

  --table-header:  #1a1f28;
  --table-row-alt: #131820;
  --table-hover:   #1c2230;

  --specs-bg:      #161b22;
  --specs-border:  #30363d;

  --container-max: 1100px;
  --article-max:   72ch;
  --nav-height:    56px;
}

/* --- Reset & Base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--link-hover); }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
  margin: 1.5em 0 0.5em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }
ul, ol { padding-left: 1.5em; }

/* --- Layout ------------------------------------------------ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.page-content {
  padding-top: calc(var(--nav-height) + 32px);
  padding-bottom: 64px;
  min-height: calc(100vh - var(--nav-height));
}

/* --- Navigation -------------------------------------------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.nav-brand:hover { color: var(--accent-hover); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* Catalogue dropdown */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 0;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 110;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu a {
  display: block;
  padding: 8px 16px;
  border-radius: 0;
  font-size: 0.9rem;
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* --- Breadcrumbs ------------------------------------------- */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--link); }
.breadcrumbs .sep { margin: 0 6px; }

/* --- Hero (landing page) ----------------------------------- */
.hero {
  text-align: center;
  padding: 140px 24px 100px;
  min-height: 400px;
  background: linear-gradient(to bottom, rgba(13,17,23,0.35), rgba(13,17,23,0.7)), url('../images/site/hero-banner.jpg') center/cover no-repeat;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.3em;
  color: var(--text-primary);
}
.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}
.home-video {
  padding: 40px 0;
}
.home-video video {
  width: 100%;
  max-width: 900px;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.home-content {
  padding: 0 24px 64px;
}
.home-intro {
  text-align: center;
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.6;
}
.hero-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}
.hero-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 24px;
  text-align: left;
  transition: border-color 0.15s, transform 0.15s;
}
.hero-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}
.hero-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--accent);
}
.hero-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.hero-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}
.hero-card a:hover { color: inherit; }

/* --- Article styles ---------------------------------------- */
.article-header {
  margin-bottom: 32px;
}
.article-header h1 {
  margin-bottom: 8px;
}
.article-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.article-body {
  max-width: var(--article-max);
}
.article-body p {
  margin-bottom: 1.2em;
}

/* Figures in articles */
.article-body figure {
  margin: 24px 0;
  text-align: center;
}
.article-body figure img {
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  max-width: 500px;
}
.article-body figcaption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
  font-style: italic;
}

/* Article archive cards */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.article-card {
  display: flex;
  gap: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: border-color 0.15s;
}
.article-card:hover { border-color: var(--accent-dim); }
.article-card-thumb {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.article-card-body h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.article-card-body h3 a { color: var(--text-primary); }
.article-card-body h3 a:hover { color: var(--accent); }
.article-card-body .date {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.article-card-body .excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Article nav (prev/next) */
.article-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.article-nav a { color: var(--accent); }
.article-nav a:hover { color: var(--accent-hover); }

/* --- Catalogue table --------------------------------------- */
.catalogue-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}

.catalogue-search {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.catalogue-search:focus { border-color: var(--accent); }
.catalogue-search::placeholder { color: var(--text-muted); }

.catalogue-filter {
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
.catalogue-filter:focus { border-color: var(--accent); }
.catalogue-filter option { background: var(--bg-secondary); }

.catalogue-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 100%;
}

.catalogue-clear {
  padding: 8px 14px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}
.catalogue-clear:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

/* Table */
.catalogue-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.catalogue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.catalogue-table th {
  background: var(--table-header);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
  position: relative;
}
.catalogue-table th:hover { color: var(--text-primary); }
.catalogue-table th.sort-asc::after,
.catalogue-table th.sort-desc::after {
  margin-left: 6px;
  color: var(--accent);
}
.catalogue-table th.sort-asc::after { content: '\25B2'; }
.catalogue-table th.sort-desc::after { content: '\25BC'; }
.catalogue-table th.no-sort { cursor: default; }

.catalogue-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  white-space: nowrap;
}
.catalogue-table tr:nth-child(even) td {
  background: var(--table-row-alt);
}
.catalogue-table tr:hover td {
  background: var(--table-hover);
}

.catalogue-table .obj-name {
  font-weight: 600;
}
.catalogue-table .obj-name a { color: var(--text-primary); }
.catalogue-table .obj-name a:hover { color: var(--accent); }

.catalogue-table .obj-thumb {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--border);
  vertical-align: middle;
  margin-right: 10px;
}

/* Type badges */
.type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.type-badge.gc  { color: #f0b27a; background: rgba(240,178,122,0.12); }
.type-badge.oc  { color: #7ec8e3; background: rgba(126,200,227,0.12); }
.type-badge.pn  { color: #a3d977; background: rgba(163,217,119,0.12); }
.type-badge.gal { color: #c39bd3; background: rgba(195,155,211,0.12); }
.type-badge.en  { color: #f1948a; background: rgba(241,148,138,0.12); }
.type-badge.dn  { color: #85929e; background: rgba(133,146,158,0.12); }

/* --- Object page ------------------------------------------- */
.object-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.object-header h1 { margin: 0; }
.object-constellation {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Specs strip */
.specs-table-wrap {
  overflow-x: auto;
  margin-bottom: 24px;
}
.specs-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--specs-border);
  background: var(--specs-bg);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.88rem;
}
.specs-table th {
  background: var(--table-header);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid var(--specs-border);
  border-right: 1px solid var(--specs-border);
}
.specs-table th:last-child { border-right: none; }
.specs-table td {
  padding: 10px 12px;
  text-align: center;
  border-right: 1px solid var(--specs-border);
  color: var(--text-primary);
}
.specs-table td:last-child { border-right: none; }

/* DSS plate */
.dss-plate {
  text-align: center;
  margin-bottom: 32px;
}
.dss-plate img {
  max-width: 420px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.dss-plate .dss-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Section headings on object pages */
.object-section-title {
  font-size: 1.1rem;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-top: 32px;
  margin-bottom: 16px;
}

/* Observing notes box */
.observing-notes {
  background: var(--bg-notes);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin-bottom: 32px;
}
.observing-notes p { margin-bottom: 0.8em; }
.observing-notes p:last-child { margin-bottom: 0; }
.obs-date {
  float: right;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* Charts grid */
.charts-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 32px;
}
.chart-ultrawide {
  text-align: center;
}
.chart-ultrawide img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.chart-wide {
  text-align: center;
}
.chart-wide img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.charts-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.charts-pair .chart {
  text-align: center;
}
.charts-pair .chart img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.chart-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* References list */
.references-list {
  list-style: none;
  padding: 0;
}
.references-list li {
  padding: 4px 0;
}
.references-list li::before {
  content: '\2022';
  color: var(--accent-dim);
  margin-right: 8px;
}

/* Object navigation (prev/next) */
.object-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  flex-wrap: wrap;
  gap: 8px;
}
.object-nav a { color: var(--accent); }
.object-nav a:hover { color: var(--accent-hover); }
.object-nav .back-link { color: var(--text-secondary); }

/* --- Constellation pages ----------------------------------- */
.constellation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.constellation-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  transition: border-color 0.15s, transform 0.15s;
}
.constellation-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}
.constellation-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}
.constellation-card h3 a { color: var(--text-primary); }
.constellation-card h3 a:hover { color: var(--accent); }
.constellation-card .obj-count {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Object list within a constellation page */
.object-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.object-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  transition: border-color 0.15s;
}
.object-list-item:hover { border-color: var(--accent-dim); }
.object-list-item img {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.object-list-item h4 {
  margin: 0 0 2px;
  font-size: 1rem;
}
.object-list-item h4 a { color: var(--text-primary); }
.object-list-item h4 a:hover { color: var(--accent); }
.object-list-item .item-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --- Published downloads ----------------------------------- */
.download-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  transition: border-color 0.15s;
}
.download-item:hover { border-color: var(--accent-dim); }
.download-item-info h3 {
  margin: 0 0 2px;
  font-size: 1rem;
  color: var(--text-primary);
}
.download-item-info .file-size {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.download-btn:hover {
  background: var(--accent-hover);
  color: var(--bg-primary);
}

/* --- About page -------------------------------------------- */
.about-content {
  max-width: var(--article-max);
}
.about-content h2 {
  color: var(--accent);
  margin-top: 40px;
}
.about-observer {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}
.about-portrait {
  width: 300px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.equipment-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.equipment-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--accent);
}
.equipment-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* --- Footer ------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--link); }

/* --- Utilities --------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* --- Responsive -------------------------------------------- */
@media (max-width: 768px) {
  body { font-size: 16px; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }

  .hero h1 { font-size: 1.8rem; }
  .hero { padding: 72px 16px 48px; min-height: 260px; }
  .home-video { padding: 24px 0; }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  }
  .nav-links.open a {
    padding: 12px 24px;
    border-radius: 0;
  }
  .nav-toggle { display: block; }

  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 16px;
  }

  .charts-pair {
    grid-template-columns: 1fr;
  }

  .article-card {
    flex-direction: column;
  }
  .article-card-thumb {
    width: 100%;
    height: 160px;
  }

  .specs-table th,
  .specs-table td {
    padding: 6px 8px;
    font-size: 0.8rem;
  }

  .object-header {
    flex-direction: column;
  }

  .download-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-cards { grid-template-columns: 1fr; }
  .constellation-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .about-observer { flex-direction: column; align-items: center; }
  .about-portrait { width: 180px; }
  .equipment-grid { grid-template-columns: 1fr; }
}
