/* ==============================================
   Resume page styles with cards, tags, and print support
   Improvements:
     - Removed redundant tokens, using main.css tokens
     - Added full light/dark theme support using main.css tokens
     - Aligned button styles with main.css .btn
     - Used --cursor-pointer for interactive elements
     - Optimized print styles for better compatibility
     - Added theme-aware gradients and textures
     - Ensured accessibility with --focus and reduced-motion support
   ============================================== */

/* ------------------------------ BASE ------------------------------ */
body.theme-dark,
body.theme-light {
  background: var(--bg);
  color: var(--text);
}

/* ------------------------------ LAYOUT ------------------------------ */
.resume-wrap {
  position: relative;
  isolation: isolate;
  width: min(100%, var(--container));
  margin-inline: auto;
  padding: clamp(16px, 4vw, 28px);
  box-shadow: var(--shadow);
  background: var(--surface);
}

/* Subtle checker texture (assuming assets exist; fallback to solid if missing) */
.resume-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background-image: url("/assets/images/checker.png");
  background-repeat: repeat;
  background-size: 22px 22px;
  opacity: 0.06;
  /* Default; override per theme if needed */
}

body.theme-light .resume-wrap::before {
  opacity: 0.08;
}

/* Keep real content above the pattern */
.resume-wrap>* {
  position: relative;
  z-index: 1;
}

/* ------------------------------ HEADER ------------------------------ */
.resume-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.resume-header .id h1 {
  margin: 0 0 6px 0;
  font-size: clamp(24px, 4.6vw, 34px);
  line-height: 1.1;
  letter-spacing: 0.2px;
  font-weight: 900;
  background: linear-gradient(180deg, var(--text) 0%, var(--blue-400) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.resume-header .role {
  margin: 0;
  color: var(--accent-2);
  font-weight: 700;
}

.resume-photo {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.resume-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ------------------------------ TAGS ------------------------------ */
.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.stack-tags .tag {
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text);
  font-size: 0.92rem;
  cursor: var(--cursor-pointer);
  transition: var(--transition);
}

.stack-tags .tag:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

/* ------------------------------ ACTIONS ------------------------------ */
.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 22px 0;
}

/* Align with main.css .btn */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow);
  transition: var(--transition), transform 0.2s ease;
  cursor: var(--cursor-pointer);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px) scale(1.02);
  background: var(--primary-strong);
}

.btn:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn.secondary:hover {
  background: var(--primary-soft);
  border-color: var(--border);
}

/* ------------------------------ CARDS & CONTENT ------------------------------ */
.resume-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
  transition: var(--transition);
}

.resume-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--blue-400);
}

.resume-card h2 {
  margin: 0 0 10px 0;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--blue-400);
}

.resume-grid {
  display: grid;
  gap: 12px;
}

.sum-com {
  color: var(--text);
}

.kv {
  display: grid;
  gap: 4px;
}

.kv .k {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.kv .v {
  color: var(--text);
}

.item {
  display: grid;
  gap: 6px;
}

.item .title {
  font-weight: 800;
  color: var(--text);
}

.item .meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.item ul {
  margin: 6px 0 0 18px;
}

.item li {
  margin: 4px 0;
  color: var(--text);
}

.footer-note {
  text-align: center;
  color: var(--muted);
  margin-top: 12px;
  font-size: 0.9rem;
}

/* ------------------------------ MOTION PREFERENCES ------------------------------ */
@media (prefers-reduced-motion: reduce) {

  .btn,
  .stack-tags .tag,
  .resume-card {
    transition: none !important;
  }
}

/* ------------------------------ PRINT ------------------------------ */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .site-header,
  .site-footer,
  .resume-actions,
  .btn {
    display: none !important;
  }

  .resume-wrap {
    background: #fff !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }

  .resume-wrap::before {
    display: none !important;
  }

  .resume-card,
  .resume-header {
    box-shadow: none !important;
    border: 0 !important;
    background: #fff !important;
    color: #000 !important;
  }

  .resume-header .id h1,
  .resume-card h2 {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    color: #000 !important;
  }

  .stack-tags .tag {
    background: none !important;
    border: 1px solid #000 !important;
    color: #000 !important;
  }

  a {
    color: #000 !important;
    text-decoration: underline !important;
  }

  @page {
    size: A4;
    margin: 14mm;
  }
}