/* ================================================
   NITRO Studio Downloads Page — style.css
   Crow Canyon Software
   ================================================ */

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

:root {
  --navy:        #1a2740;
  --navy-light:  #243352;
  --navy-dark:   #111c2e;
  --gold:        #FAAA1C;
  --gold-dark:   #d98f0a;
  --gold-light:  #fdc84b;
  --white:       #ffffff;
  --off-white:   #f5f7fa;
  --gray-light:  #e8ecf2;
  --gray-mid:    #c2cad8;
  --gray-text:   #6b7a99;
  --text:        #1e2a3a;
  --text-light:  #4a5568;
  --info-bg:     #eef4ff;
  --info-border: #bed0f7;
  --info-text:   #1e3a7a;
  --radius:      6px;
  --radius-lg:   10px;
  --shadow-sm:   0 1px 4px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.12);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.16);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Barlow', sans-serif;
  background: var(--off-white);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ─────────────────────────────────────── */
.site-header {
  background: var(--navy-dark);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo-link { display: flex; align-items: center; }
.logo-img  { height: 36px; width: auto; }
.logo-img-sm { height: 28px; }

.back-link {
  font-size: .85rem;
  font-weight: 500;
  color: var(--gray-mid);
  letter-spacing: .02em;
  transition: color .2s;
}
.back-link:hover { color: var(--gold); }

/* ── Hero ───────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, #1e3460 100%);
  color: var(--white);
  padding: 56px 0 48px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 300px at 80% 50%, rgba(250,170,28,.08) 0%, transparent 70%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.hero-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 14px;
}

.hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,.75);
  max-width: 520px;
  line-height: 1.65;
}

/* ── Main ───────────────────────────────────────── */
.main-content { padding: 36px 0 64px; }
.section      { margin-bottom: 44px; }

.section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
  margin-bottom: 8px;
}

/* One-line intro (e.g. "For version-specific builds, see Archive below") */
.section-intro {
  font-size: .93rem;
  color: var(--text-light);
  margin: 10px 0 20px;
  white-space: nowrap;
}
@media (max-width: 680px) { .section-intro { white-space: normal; } }

/* Multi-line section description — wraps normally, constrained to table width */
.section-desc {
  font-size: .93rem;
  color: var(--text-light);
  margin: 8px 0 20px;
  max-width: 100%;
  line-height: 1.65;
}

/* Section header row — title + collapse toggle on same line */
.section-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

/* Collapse toggle button next to section title */
.section-toggle {
  background: none;
  border: 1px solid var(--gray-mid);
  border-radius: var(--radius);
  padding: 3px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--navy);
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.section-toggle:hover { background: var(--gray-light); border-color: var(--navy); }
.section-toggle .chevron { color: var(--navy); width: 16px; height: 16px; }

.section-intro a {
  color: var(--navy);
  font-weight: 600;
  border-bottom: 1px solid var(--gold);
}
.section-intro a:hover { color: var(--gold-dark); }

/* ── Version Banner ─────────────────────────────── */
.version-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.version-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.version-label {
  font-size: .73rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(250,170,28,.12);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(250,170,28,.25);
}

.version-number {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
}

.version-sep { color: rgba(255,255,255,.3); }

/* Version log button — same rectangular style as banner */
.btn-banner-outline {
  display: inline-block;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .03em;
  padding: 8px 20px;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background .18s, color .18s;
}
.btn-banner-outline:hover {
  background: var(--gold);
  color: var(--navy-dark);
}

/* ── Upgrade Note ───────────────────────────────── */
.upgrade-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-left: 4px solid #4a7fd4;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 32px;
  font-size: .9rem;
  color: var(--info-text);
  line-height: 1.6;
}

.upgrade-note strong { color: var(--navy); display: block; margin-bottom: 2px; }

.upgrade-note-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #4a7fd4;
  margin-top: 2px;
}

/* ── Table Wrapper ──────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-light);
}

/* ── Downloads Table ────────────────────────────── */
.downloads-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: .9rem;
}

.downloads-table thead tr { background: var(--navy); color: var(--white); }

.downloads-table thead th {
  padding: 13px 16px;
  text-align: left;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.downloads-table thead th:first-child { border-radius: var(--radius-lg) 0 0 0; }
.downloads-table thead th:last-child  { border-radius: 0 var(--radius-lg) 0 0; }

.downloads-table tbody tr {
  border-bottom: 1px solid var(--gray-light);
  transition: background .15s;
}
.downloads-table tbody tr:last-child { border-bottom: none; }
.downloads-table tbody tr:hover { background: #f0f4fa; }

.downloads-table tbody td {
  padding: 16px 16px;
  vertical-align: top;
  color: var(--text-light);
  line-height: 1.55;
}

/* Column widths — current table */
.col-edition  { width: 185px; }
.col-ver      { width: 105px; white-space: nowrap; }
.col-desc     { min-width: 200px; }
.col-articles { width: 195px; }
.col-download { width: 140px; }
.col-md5      { min-width: 175px; }

/* ── Edition Cell ───────────────────────────────── */
.edition-cell { vertical-align: top; }

.edition-name {
  font-weight: 600;
  color: var(--text);
  font-size: .93rem;
  line-height: 1.3;
  margin-top: 5px;
}

.edition-sub    { font-size: .78rem; color: var(--gray-text); margin-top: 3px; }
.edition-sub-sm { font-size: .76rem; color: var(--gray-text); margin-top: 3px; }

/* Component note tag (inside edition cell) */
.comp-note {
  display: inline-block;
  margin-top: 5px;
  font-size: .7rem;
  font-weight: 600;
  color: #7a5a00;
  background: #fff8e1;
  border: 1px solid #ffe08a;
  padding: 1px 7px;
  border-radius: 3px;
}

/* ── Badges ─────────────────────────────────────── */
.edition-badge {
  display: inline-block;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
}

.badge-azure   { background: #e8f0fe; color: #1a56c4; }
.badge-secure  { background: #fff3e0; color: #b45309; }
.badge-gcc     { background: #e6f4ea; color: #1a7a4a; }
.badge-teams   { background: #ede7f6; color: #5b21b6; }
.badge-service { background: #fce4ec; color: #9b1c3a; }
.badge-modern  { background: #e0f2f5; color: #0e6b7d; }

.badge-sm { font-size: .62rem; padding: 2px 7px; }

/* ── Version cell ───────────────────────────────── */
.ver-cell {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .98rem;
  font-weight: 700;
  color: var(--navy);
  vertical-align: middle;
}

/* ── Articles cell ──────────────────────────────── */
.articles-cell {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.article-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .83rem;
  font-weight: 500;
  color: var(--navy);
  padding: 5px 10px;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  background: var(--off-white);
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.article-link:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.article-link-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--navy);
  border-bottom: 1px solid var(--gold);
  line-height: 1.4;
  transition: color .15s;
  white-space: nowrap;
}
.article-link-sm:hover { color: var(--gold-dark); }

.article-icon { font-size: .95em; line-height: 1; }
.no-article   { font-size: .82rem; color: var(--gray-text); font-style: italic; }

/* ── Download button ────────────────────────────── */
.download-cell { vertical-align: middle; text-align: center; }

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold);
  color: var(--navy-dark);
  font-weight: 700;
  font-size: .83rem;
  letter-spacing: .02em;
  padding: 8px 14px;
  border-radius: var(--radius);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(250,170,28,.3);
  transition: background .18s, box-shadow .18s, transform .1s;
}
.btn-download:hover {
  background: var(--gold-dark);
  box-shadow: 0 4px 12px rgba(250,170,28,.4);
  transform: translateY(-1px);
}
.btn-download:active { transform: translateY(0); }
.btn-download-sm { font-size: .78rem; padding: 6px 11px; }

.dl-icon { width: 15px; height: 15px; flex-shrink: 0; }

/* ── MD5 ────────────────────────────────────────── */
.md5-cell { font-size: .75rem; vertical-align: middle; }
.md5-cell code {
  font-family: 'Courier New', monospace;
  color: var(--gray-text);
  word-break: break-all;
  background: var(--off-white);
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid var(--gray-light);
}

/* ── Row highlight (base — always applied) ──────── */
.row-highlight {
  background: #fffbea !important;
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  position: relative;
  z-index: 1;
}

/* ── Option A: Spotlight fade ───────────────────── */
/* Applied to sibling rows and other sections */
.faded {
  opacity: 0.18;
  transition: opacity 0.4s ease;
  pointer-events: none;   /* prevent accidental clicks while faded */
}
/* Smooth lift when fade is removed */
.fade-lifting {
  opacity: 1 !important;
  transition: opacity 0.6s ease !important;
  pointer-events: auto;
}

/* ── Option B: Pulse glow ────────────────────────── */
.row-pulse {
  background: #fff3c4 !important;
  box-shadow: 0 0 0 4px rgba(250, 170, 28, 0.55),
              0 0 18px 4px rgba(250, 170, 28, 0.30);
  transition: box-shadow 0.35s ease, background 0.35s ease;
}
/* Ensure smooth transition back */
.row-highlight {
  transition: box-shadow 0.35s ease, background 0.35s ease;
}

/* ── Toast ──────────────────────────────────────── */
.edition-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: var(--white);
  font-size: .87rem;
  padding: 12px 22px;
  border-radius: 30px;
  border-left: 4px solid var(--gold);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .35s, transform .35s;
  z-index: 999;
  white-space: nowrap;
  pointer-events: none;
}
.edition-toast strong { color: var(--gold); margin-right: 4px; }
.toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Archive Groups ─────────────────────────────── */
.archive-group {
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.archive-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--navy);
  color: var(--white);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}
.archive-group-header:hover { background: var(--navy-light); }

.archive-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.archive-group-body { background: var(--off-white); }

.archive-empty {
  padding: 20px 24px;
  font-size: .9rem;
  color: var(--gray-text);
  font-style: italic;
}

.load-error {
  padding: 20px;
  text-align: center;
  color: #c0392b;
  font-size: .9rem;
}

/* ── Version Blocks (inside archive groups) ─────── */
.ver-block {
  border-bottom: 1px solid var(--gray-light);
}
.ver-block:last-child { border-bottom: none; }

.ver-block-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 20px;
  background: #eef1f7;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}
.ver-block-header:hover { background: #e3e8f2; }

.ver-block-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ver-tag {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--gray-mid);
  padding: 2px 10px;
  border-radius: 4px;
}

.ver-date {
  font-size: .83rem;
  color: var(--gray-text);
  font-weight: 500;
}

.ver-note {
  font-size: .8rem;
  color: #7a5a00;
  background: #fff8e1;
  border: 1px solid #ffe08a;
  padding: 2px 8px;
  border-radius: 3px;
  max-width: 380px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
}

.ver-block-body { padding: 16px 20px; }

/* ── Chevron ────────────────────────────────────── */
.chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--gold);
  transition: transform .25s;
}
.chevron-sm { color: var(--gray-text); width: 16px; height: 16px; }

[aria-expanded="false"] .chevron { transform: rotate(-90deg); }

/* ── Older table inside archive ─────────────────── */
.older-table tbody td { padding: 12px 16px; font-size: .86rem; }

/* ── Footer ─────────────────────────────────────── */
.site-footer {
  background: var(--navy-dark);
  border-top: 3px solid var(--gold);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { font-size: .85rem; color: var(--gray-mid); transition: color .2s; }
.footer-links a:hover { color: var(--gold); }
.footer-copy { font-size: .78rem; color: rgba(255,255,255,.3); }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 960px) {
  .downloads-table { font-size: .83rem; }
  .downloads-table thead th,
  .downloads-table tbody td { padding: 11px 12px; }
  .col-edition { width: 160px; }
  .col-md5     { min-width: 150px; }
}

@media (max-width: 640px) {
  .hero { padding: 36px 0 30px; }
  .version-banner { flex-direction: column; align-items: flex-start; }
  .footer-inner   { flex-direction: column; align-items: flex-start; }
  .footer-links   { gap: 16px; }
  .edition-toast  { white-space: normal; text-align: center; width: 90vw; }
  .ver-note       { max-width: 180px; }
}

/* ── Option C: Sticky "You are here" indicator ──── */
.sticky-indicator {
  position: fixed;
  left: 0;
  z-index: 200;
  background: var(--gold);
  color: var(--navy-dark);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 5px 12px 5px 10px;
  border-radius: 0 4px 4px 0;
  box-shadow: 2px 2px 8px rgba(0,0,0,.18);
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-50%);  /* vertically center on the anchor point */
  transition: top 0.1s linear;
}

/* Arrow pointing right toward the table */
.sticky-indicator::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-left-color: var(--gold);
  border-right: none;
}

/* When row is above viewport — indicator docks at top with down arrow */
.ind-above::after {
  right: auto;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--gold);
  border-bottom: none;
}

/* When row is below viewport — indicator docks at bottom with up arrow */
.ind-below::after {
  right: auto;
  left: 50%;
  top: auto;
  bottom: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--gold);
  border-top: none;
}

/* ── Knowledge Base header link ─────────────────── */
.kb-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--navy-dark);
  background: var(--gold);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 6px 14px;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background .18s, color .18s;
}
.kb-link:hover {
  background: var(--gold-dark);
  color: var(--navy-dark);
}

.kb-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
}

/* ── Share / copy-link button ───────────────────── */
.col-share { width: 36px; padding: 0 !important; }

.share-cell {
  text-align: center;
  vertical-align: middle;
  padding: 0 6px !important;
}

.btn-share {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  border-radius: var(--radius);
  color: var(--gray-mid);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
}
.btn-share:hover {
  color: var(--navy);
  background: var(--gray-light);
}
.btn-share-copied {
  color: #1a7a4a !important;
  background: #e6f4ea !important;
}

.share-icon { width: 16px; height: 16px; }
