/* =========================================================================
   CV Reader, in-page PDF viewer + CV picker
   Self-contained, theme-aware (uses site design tokens from style.css)
   ========================================================================= */

/* ---------- CV picker (the two domain buttons) ---------- */
.cv-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 940px;
  margin: 0 auto;
}
.cv-pick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.3s var(--ease), box-shadow 0.4s var(--ease);
}
.cv-pick-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0.85;
}
.cv-pick-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.cv-pick-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cv-pick-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid var(--border-strong);
}
.cv-pick-ic .icon {
  width: 26px;
  height: 26px;
  color: var(--primary-ink);
}
.cv-pick-title {
  font-family: var(--font-head);
  font-size: 1.22rem;
  line-height: 1.15;
  color: var(--navy);
  margin: 0;
}
.cv-pick-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-ink);
  margin: 2px 0 0;
}
.cv-pick-desc {
  color: var(--muted);
  font-size: 0.96rem;
  margin: 0;
  flex: 1;
}
.cv-pick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cv-pick-tags li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: var(--text);
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-tint);
}
.cv-pick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.cv-pick-actions .btn {
  flex: 1 1 auto;
}

/* ---------- Reader overlay ---------- */
.cvr {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  flex-direction: column;
  background: var(--bg);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.cvr.is-open {
  display: flex;
  opacity: 1;
}
body.cvr-lock {
  overflow: hidden;
}

/* Toolbar */
.cvr-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}
.cvr-bar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cvr-title-wrap {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1 1 auto;
}
.cvr-title-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid var(--border-strong);
}
.cvr-title-ic .icon {
  width: 20px;
  height: 20px;
  color: var(--primary-ink);
}
.cvr-title-txt {
  min-width: 0;
}
.cvr-title {
  font-family: var(--font-head);
  font-size: 1.02rem;
  color: var(--navy);
  line-height: 1.15;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cvr-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1px 0 0;
  white-space: nowrap;
}

/* Toolbar controls */
.cvr-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-tint);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.cvr-btn .icon {
  width: 19px;
  height: 19px;
}
.cvr-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--primary-ink);
}
.cvr-btn:active {
  transform: scale(0.94);
}
.cvr-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.cvr-btn.is-on {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--primary);
  color: var(--primary-ink);
}
.cvr-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  gap: 8px;
  padding: 0 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: transparent;
  color: #04130d;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.cvr-btn-primary:hover {
  color: #04130d;
  filter: brightness(1.06);
}
.cvr-btn-label {
  white-space: nowrap;
}

.cvr-sep {
  width: 1px;
  height: 26px;
  background: var(--border);
  margin: 0 2px;
}

/* Share dropdown */
.cvr-share {
  position: relative;
}
.cvr-share-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 5;
}
.cvr-share.is-open .cvr-share-menu {
  display: flex;
  animation: cvr-pop 0.18s var(--ease);
}
@keyframes cvr-pop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.cvr-share-title {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 10px 4px;
}
.cvr-share-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.cvr-share-item:hover {
  background: var(--bg-tint);
  color: var(--primary-ink);
}
.cvr-share-item .icon {
  width: 18px;
  height: 18px;
  flex: none;
}
.cvr-share-ic {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex: none;
  color: #fff;
}
.cvr-share-ic .icon { width: 17px; height: 17px; }
.cvr-share-ic.sh-linkedin { background: #0a66c2; }
.cvr-share-ic.sh-whatsapp { background: #25d366; }
.cvr-share-ic.sh-telegram { background: #229ed9; }
.cvr-share-ic.sh-email { background: #6b7280; }
.cvr-share-ic.sh-native { background: var(--primary-dark); }
.cvr-share-ic.sh-copy { background: var(--surface-2); color: var(--primary-ink); border: 1px solid var(--border-strong); }
.cvr-share-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}

/* Page indicator */
.cvr-pagebox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
}
.cvr-page-input {
  width: 48px;
  text-align: center;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.cvr-page-input:focus {
  outline: none;
  border-color: var(--primary);
}
.cvr-page-total {
  color: var(--muted);
}
.cvr-zoom-val {
  min-width: 48px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
}

/* Body / canvas stage */
.cvr-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}
.cvr-stage {
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 26px 16px 60px;
  background: var(--bg-soft);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.cvr-doc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin: 0 auto;
}
.cvr-page {
  position: relative;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 10px 34px -8px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  max-width: 100%;
}
.cvr-page canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
.cvr-page-num {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 8px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.cvr-page:hover .cvr-page-num {
  opacity: 1;
}
.cvr-page-skeleton {
  display: grid;
  place-items: center;
  color: #9aa;
  background: linear-gradient(110deg, #f4f6f5 30%, #eef1f0 50%, #f4f6f5 70%);
  background-size: 200% 100%;
  animation: cvr-shimmer 1.3s linear infinite;
}
@keyframes cvr-shimmer {
  to { background-position: -200% 0; }
}

/* Loading & error states */
.cvr-state {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 24px;
  background: var(--bg-soft);
  z-index: 3;
}
.cvr-state.is-on {
  display: flex;
}
.cvr-spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid var(--border-strong);
  border-top-color: var(--primary);
  animation: cvr-spin 0.8s linear infinite;
}
@keyframes cvr-spin {
  to { transform: rotate(360deg); }
}
.cvr-state-txt {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.cvr-progress {
  width: 200px;
  max-width: 60vw;
  height: 5px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.cvr-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.2s var(--ease);
}
.cvr-state-ic .icon {
  width: 44px;
  height: 44px;
  color: var(--muted);
}

/* Mobile */
@media (max-width: 760px) {
  .cv-picker { grid-template-columns: 1fr; }
  .cvr-bar { flex-wrap: wrap; gap: 8px 6px; padding: 9px 10px; }
  .cvr-title-wrap { order: -1; flex-basis: 100%; }
  .cvr-sub { display: none; }
  .cvr-hide-sm { display: none !important; }
  .cvr-btn, .cvr-page-input { width: 34px; height: 34px; }
  .cvr-btn-primary { width: 34px; padding: 0; }
  .cvr-btn-primary .cvr-btn-label { display: none; }
  .cvr-stage { padding: 14px 8px 50px; }
  .cvr-doc { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .cvr, .cvr-btn, .cv-pick-card, .cvr-page-num, .cvr-stage { transition: none; }
  .cvr-spinner, .cvr-page-skeleton { animation: none; }
  .cvr-stage { scroll-behavior: auto; }
}
