/* ============================================================
   krisross.com – Main Stylesheet
   ============================================================ */

:root {
  --navy:       #1a2742;
  --navy-light: #243352;
  --accent:     #0073ea;
  --accent-h:   #005bbd;
  --text:       #1f2d3d;
  --muted:      #6b7a99;
  --border:     #dde3ed;
  --bg:         #f4f6fb;
  --white:      #ffffff;
  --code-bg:    #0d1b2e;
  --code-text:  #e0f0ff;
  --success:    #00c875;
  --warning:    #ffcb00;
  --radius:     8px;
  --shadow:     0 2px 12px rgba(0,0,0,.08);
  --sidebar-w:  260px;
}

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); text-decoration: underline; }
img { max-width: 100%; height: auto; }
code, pre { font-family: 'Cascadia Code', 'Fira Code', 'Courier New', monospace; }

/* ── Top Navigation ──────────────────────────────────────── */
.topnav {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.topnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 8px;
}
.topnav-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff !important;
  letter-spacing: -.3px;
  white-space: nowrap;
  margin-right: 16px;
}
.topnav-brand:hover { text-decoration: none; opacity: .9; }
.topnav-links { display: flex; gap: 4px; flex: 1; }
.topnav-links a {
  color: rgba(255,255,255,.75);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.topnav-links a:hover,
.topnav-links a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
  text-decoration: none;
}
.topnav-links a.active { background: var(--accent); color: #fff; }
.topnav-admin { margin-left: auto; }
.topnav-admin a {
  color: rgba(255,255,255,.5);
  font-size: .8rem;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 4px;
  transition: all .15s;
}
.topnav-admin a:hover { color: #fff; border-color: rgba(255,255,255,.5); text-decoration: none; }

/* ── Page wrapper ────────────────────────────────────────── */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Hero / Page header ──────────────────────────────────── */
.page-hero {
  background: var(--navy);
  color: #fff;
  padding: 48px 0 36px;
  margin-bottom: 32px;
}
.page-hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.page-hero p { opacity: .75; font-size: 1.05rem; }
.hero-badge {
  display: inline-block;
  background: rgba(0,115,234,.3);
  color: #7ec8ff;
  font-size: .75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* ── Two-column layout (sidebar + content) ───────────────── */
.doc-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding-bottom: 60px;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 76px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.sidebar-search {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-search input {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .88rem;
  background: var(--bg);
  outline: none;
  transition: border-color .15s;
}
.sidebar-search input:focus { border-color: var(--accent); }
.sidebar-nav { padding: 8px 0 12px; max-height: calc(100vh - 180px); overflow-y: auto; }
.sidebar-section-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  padding: 12px 16px 4px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  color: var(--text);
  font-size: .88rem;
  border-left: 3px solid transparent;
  transition: all .12s;
}
.sidebar-nav a:hover {
  background: var(--bg);
  border-left-color: var(--border);
  text-decoration: none;
}
.sidebar-nav a.active {
  background: #e8f2ff;
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.sidebar-nav .icon { font-size: .9rem; opacity: .6; }

/* ── Main content area ───────────────────────────────────── */
.doc-content { flex: 1; min-width: 0; }

/* ── Section tabs (Workfront sub-sections) ───────────────── */
.section-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.section-tabs button {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: .92rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  border-radius: 4px 4px 0 0;
}
.section-tabs button:hover { color: var(--text); background: rgba(0,0,0,.03); }
.section-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ── Topic cards ─────────────────────────────────────────── */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.topic-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .15s, transform .1s;
  cursor: pointer;
}
.topic-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.topic-card-header {
  padding: 16px 18px 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.topic-card-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: #e8f2ff;
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.topic-card-title { font-weight: 600; font-size: .95rem; margin-bottom: 4px; }
.topic-card-meta { font-size: .78rem; color: var(--muted); }
.topic-card-excerpt {
  padding: 0 18px 16px;
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.5;
}
.topic-card-tags { padding: 0 18px 14px; display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: .72rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
}

/* ── Topic detail view ───────────────────────────────────── */
.topic-detail {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.topic-detail-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
}
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: .85rem; margin-bottom: 12px;
  background: none; border: none; cursor: pointer; padding: 0;
  transition: color .15s;
}
.back-btn:hover { color: var(--accent); }
.topic-detail-header h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; }
.topic-detail-header .meta { font-size: .82rem; color: var(--muted); }
.topic-detail-body { padding: 24px 28px; }

/* Content blocks */
.content-block { margin-bottom: 28px; }
.content-block h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.content-text { font-size: .92rem; line-height: 1.75; color: var(--text); }
.content-text p { margin-bottom: 12px; }

/* Video embed */
.video-section { margin-bottom: 24px; }
.video-list { display: flex; flex-direction: column; gap: 12px; }
.video-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.video-link-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background .12s;
}
.video-link-item:hover { background: #e8f2ff; text-decoration: none; }
.video-link-icon { font-size: 1.4rem; color: #ff0000; }
.video-link-title { font-weight: 500; font-size: .9rem; color: var(--text); }
.video-link-sub { font-size: .78rem; color: var(--muted); }

/* Screenshots */
.screenshot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.screenshot-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: zoom-in;
  transition: box-shadow .12s;
}
.screenshot-item:hover { box-shadow: var(--shadow); }
.screenshot-item img { width: 100%; height: 150px; object-fit: cover; }
.screenshot-caption {
  padding: 6px 10px;
  font-size: .75rem;
  color: var(--muted);
  background: var(--bg);
  border-top: 1px solid var(--border);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 1000;
  align-items: center; justify-content: center;
  padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 90vh; max-width: 90vw; border-radius: 4px; }
.lightbox-close {
  position: absolute; top: 20px; right: 24px;
  background: none; border: none;
  color: #fff; font-size: 2rem;
  cursor: pointer; line-height: 1;
}

/* ── Text Mode Examples ──────────────────────────────────── */
.textmode-wrap { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.textmode-toolbar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.textmode-toolbar input {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .88rem;
  outline: none;
  flex: 1; min-width: 200px;
  transition: border-color .15s;
}
.textmode-toolbar input:focus { border-color: var(--accent); }
.textmode-toolbar select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .88rem;
  background: var(--white);
  outline: none;
  cursor: pointer;
}
.textmode-table { width: 100%; border-collapse: collapse; }
.textmode-table th {
  background: var(--bg);
  padding: 10px 14px;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  position: sticky; top: 0;
}
.textmode-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .87rem;
  vertical-align: top;
}
.textmode-table tr:last-child td { border-bottom: none; }
.textmode-table tr:hover td { background: #fafbff; }
.type-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.type-report    { background: #dbeafe; color: #1d4ed8; }
.type-filter    { background: #dcfce7; color: #166534; }
.type-grouping  { background: #fef9c3; color: #854d0e; }
.type-column    { background: #f3e8ff; color: #6b21a8; }
.type-form      { background: #ffe4e6; color: #9f1239; }
.type-other     { background: var(--bg); color: var(--muted); }

/* Code block with copy */
.code-wrap { position: relative; }
.code-block {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 6px;
  padding: 12px 44px 12px 14px;
  font-size: .8rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 160px;
  overflow-y: auto;
}
.copy-btn {
  position: absolute; top: 6px; right: 6px;
  background: rgba(255,255,255,.1);
  border: none;
  color: rgba(255,255,255,.7);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: .72rem;
  cursor: pointer;
  transition: all .12s;
}
.copy-btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.copy-btn.copied { background: var(--success); color: #fff; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); color: #fff; text-decoration: none; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); text-decoration: none; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; text-decoration: none; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }

/* ── About / Resume ──────────────────────────────────────── */
.about-layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; padding-bottom: 60px; }
.about-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: center;
  position: sticky; top: 76px;
  height: fit-content;
}
.about-avatar {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 2.5rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  letter-spacing: -1px;
}
.about-card h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.about-card .title { color: var(--muted); font-size: .88rem; margin-bottom: 16px; }
.about-contact { list-style: none; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.about-contact li { display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.about-contact .icon { width: 28px; height: 28px; background: var(--bg); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: .9rem; flex-shrink: 0; }
.resume-section { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 28px; margin-bottom: 20px; }
.resume-section h3 { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 18px; border-bottom: 2px solid var(--border); padding-bottom: 8px; }
.resume-item { margin-bottom: 20px; }
.resume-item:last-child { margin-bottom: 0; }
.resume-item-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.resume-item-title { font-weight: 600; font-size: .95rem; }
.resume-item-date { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.resume-item-company { font-size: .87rem; color: var(--accent); margin-bottom: 6px; }
.resume-item ul { padding-left: 18px; font-size: .87rem; color: var(--text); line-height: 1.7; }
.skills-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
}

/* ── Admin ───────────────────────────────────────────────── */
.admin-wrap { max-width: 900px; margin: 40px auto; padding: 0 24px 60px; }
.admin-header { margin-bottom: 28px; }
.admin-header h1 { font-size: 1.5rem; font-weight: 700; }
.admin-header p { color: var(--muted); }
.admin-nav { display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.admin-nav a { display: flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--white); border: 1px solid var(--border); border-radius: 6px; font-size: .87rem; font-weight: 500; color: var(--text); transition: all .12s; }
.admin-nav a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.admin-nav a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input[type=text],
.form-group input[type=password],
.form-group input[type=url],
.form-group textarea,
.form-group select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px; font-size: .9rem;
  font-family: inherit; background: var(--white);
  outline: none; transition: border-color .15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--accent); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group .hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.form-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.form-card h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.admin-table th { background: var(--bg); padding: 10px 14px; text-align: left; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border-bottom: 1px solid var(--border); }
.admin-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: .87rem; vertical-align: top; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafbff; }
.video-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.video-row input { flex: 1; }
.video-row button { flex-shrink: 0; }
.alert { padding: 10px 16px; border-radius: 6px; font-size: .87rem; margin-bottom: 16px; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; opacity: .4; }
.empty-state h3 { font-weight: 600; margin-bottom: 6px; color: var(--text); }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 20px;
  font-size: .82rem;
  margin-top: 40px;
}
.site-footer a { color: rgba(255,255,255,.7); }

/* ── Rich text content (Quill output) ───────────────────── */
.ql-content { font-size: .92rem; line-height: 1.75; }
.ql-content p { margin-bottom: 10px; }
.ql-content strong { font-weight: 700; }
.ql-content em { font-style: italic; }
.ql-content u { text-decoration: underline; }
.ql-content ul, .ql-content ol { padding-left: 20px; margin-bottom: 12px; }
.ql-content ul { list-style: disc; }
.ql-content ol { list-style: decimal; }
.ql-content li { margin-bottom: 4px; line-height: 1.7; }
.ql-content a { color: var(--accent); }
.ql-content a:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .doc-layout, .about-layout { flex-direction: column; }
  .sidebar, .about-card { width: 100%; position: static; }
  .about-layout { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: 1fr; }
  .topnav-links a { padding: 6px 10px; font-size: .82rem; }
}
