/* ============================================
   RESUME STYLES
   Print-first design with screen enhancements
   ============================================ */

/* Import base design system tokens */
@import url('./styles.css');

/* ============================================
   SCREEN STYLES
   ============================================ */

.resume-container {
  background: var(--color-bg, #fff);
  min-height: 100vh;
}

.resume-actions {
  background: var(--color-primary-light, #e3f3ff);
  border-bottom: 1px solid var(--color-border, #e0e0e0);
  padding: var(--space-md, 1.5rem) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.resume-actions .container {
  display: flex;
  gap: var(--space-sm, 1rem);
  flex-wrap: wrap;
}

.resume-actions button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: var(--font-weight-medium, 500);
  border-radius: var(--border-radius, 4px);
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: 44px;
}

.resume-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.resume-actions button:active {
  transform: translateY(0);
}

.resume-actions button:focus-visible {
  outline: 3px solid var(--color-primary, #0176d3);
  outline-offset: 2px;
}

.resume-content {
  padding: var(--space-2xl, 3rem) 0;
}

/* ============================================
   RESUME HEADER
   ============================================ */

.resume-header {
  text-align: center;
  margin-bottom: var(--space-2xl, 3rem);
  padding-bottom: var(--space-lg, 2rem);
  border-bottom: 2px solid var(--color-primary, #0176d3);
}

.resume-name {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: var(--font-weight-bold, 700);
  color: var(--color-text-primary, #181818);
  margin: 0 0 var(--space-xs, 0.5rem);
  line-height: 1.2;
}

.resume-title {
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  font-weight: var(--font-weight-medium, 500);
  color: var(--color-primary, #0176d3);
  margin: 0 0 var(--space-md, 1.5rem);
}

.resume-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-text-secondary, #5a5a5a);
}

.resume-contact a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.resume-contact a:hover {
  color: var(--color-primary, #0176d3);
  text-decoration: underline;
}

/* ============================================
   RESUME SECTIONS
   ============================================ */

.resume-section {
  margin-bottom: var(--space-2xl, 3rem);
  page-break-inside: avoid;
}

.resume-section > h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: var(--font-weight-bold, 700);
  color: var(--color-primary, #0176d3);
  margin: 0 0 var(--space-lg, 2rem);
  padding-bottom: var(--space-xs, 0.5rem);
  border-bottom: 1px solid var(--color-border, #e0e0e0);
}

.resume-section > p {
  font-size: var(--font-size-base, 1rem);
  line-height: 1.6;
  color: var(--color-text-primary, #181818);
}

/* ============================================
   JOB ENTRIES
   ============================================ */

.job {
  margin-bottom: var(--space-lg, 2rem);
  page-break-inside: avoid;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md, 1.5rem);
  margin-bottom: var(--space-sm, 1rem);
}

.job-title {
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  font-weight: var(--font-weight-semibold, 600);
  color: var(--color-text-primary, #181818);
  margin: 0 0 0.25rem;
}

.job-company {
  font-size: var(--font-size-base, 1rem);
  font-weight: var(--font-weight-medium, 500);
  color: var(--color-text-secondary, #5a5a5a);
  margin: 0;
}

.job-meta {
  text-align: right;
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-text-secondary, #5a5a5a);
  flex-shrink: 0;
}

.job-location {
  display: block;
  font-style: italic;
  margin-top: 0.25rem;
}

.job-highlights {
  list-style: none;
  padding: 0;
  margin: 0;
}

.job-highlights li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--color-text-primary, #181818);
}

.job-highlights li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--color-primary, #0176d3);
  font-weight: bold;
}

.job-highlights strong {
  color: var(--color-primary, #0176d3);
  font-weight: var(--font-weight-semibold, 600);
}

/* ============================================
   JOB GROUP (EXPANDABLE)
   ============================================ */

.job-group {
  margin-top: var(--space-xl, 2.5rem);
  padding-top: var(--space-lg, 2rem);
  border-top: 1px dashed var(--color-border, #e0e0e0);
}

.job-group-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  padding: var(--space-sm, 1rem);
  background: var(--color-primary-light, #e3f3ff);
  border-radius: var(--border-radius, 4px);
  transition: background 0.2s ease;
}

.job-group-toggle:hover {
  background: #d0e9ff;
}

.job-group-toggle::marker {
  display: none;
}

.job-group-toggle h3 {
  margin: 0;
  font-size: var(--font-size-lg, 1.125rem);
  font-weight: var(--font-weight-semibold, 600);
  color: var(--color-primary, #0176d3);
}

.job-group[open] .job-group-toggle {
  margin-bottom: var(--space-lg, 2rem);
}

.job-group .job h4 {
  font-size: var(--font-size-base, 1rem);
  margin: 0 0 0.25rem;
}

/* ============================================
   EDUCATION
   ============================================ */

.education {
  margin-bottom: var(--space-md, 1.5rem);
}

.education-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md, 1.5rem);
  margin-bottom: var(--space-sm, 1rem);
}

.education h3 {
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  font-weight: var(--font-weight-semibold, 600);
  color: var(--color-text-primary, #181818);
  margin: 0 0 0.25rem;
}

.education-details {
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-text-secondary, #5a5a5a);
  margin: 0 0 0.25rem;
}

.education-institution {
  font-size: var(--font-size-base, 1rem);
  font-weight: var(--font-weight-medium, 500);
  color: var(--color-text-secondary, #5a5a5a);
  margin: 0;
}

.education-meta {
  text-align: right;
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-text-secondary, #5a5a5a);
  flex-shrink: 0;
}

.education-note {
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-text-secondary, #5a5a5a);
  font-style: italic;
  margin: 0;
}

/* ============================================
   CERTIFICATIONS
   ============================================ */

.cert-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.cert-list li {
  position: relative;
  padding-left: 1.5rem;
  line-height: 1.6;
}

.cert-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-primary, #0176d3);
  font-weight: bold;
  font-size: 1.2em;
}

/* ============================================
   SKILLS
   ============================================ */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg, 2rem);
}

.skill-category h3 {
  font-size: var(--font-size-lg, 1.125rem);
  font-weight: var(--font-weight-semibold, 600);
  color: var(--color-primary, #0176d3);
  margin: 0 0 var(--space-sm, 1rem);
}

.skill-category p {
  font-size: var(--font-size-sm, 0.875rem);
  line-height: 1.6;
  color: var(--color-text-primary, #181818);
  margin: 0;
}

/* ============================================
   LANGUAGES
   ============================================ */

.language-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.language-list li {
  font-size: var(--font-size-base, 1rem);
  line-height: 1.6;
}

/* ============================================
   PRINT STYLES
   ============================================ */

.print-header {
  display: none;
}

@media print {
  /* Reset for print */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  @page {
    size: letter;
    margin: 0.75in;
  }

  body {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 11pt;
    line-height: 1.4;
    color: #000;
    background: #fff;
  }

  /* Hide screen-only elements */
  .screen-only,
  .resume-actions,
  #header-placeholder,
  #footer-placeholder,
  nav,
  .skip-link {
    display: none !important;
  }

  /* Show print header */
  .print-header {
    display: block;
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2pt solid #000;
  }

  .print-header h1 {
    font-size: 20pt;
    font-weight: bold;
    margin: 0 0 0.5rem;
  }

  .print-contact {
    font-size: 10pt;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
  }

  /* Reset container */
  .resume-container,
  .resume-content {
    padding: 0;
    margin: 0;
    background: none;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  /* Hide screen header */
  .resume-header {
    display: none;
  }

  /* Section headings */
  .resume-section > h2 {
    font-size: 14pt;
    font-weight: bold;
    color: #000;
    margin: 1rem 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1pt solid #000;
    page-break-after: avoid;
  }

  .resume-section {
    margin-bottom: 1rem;
    page-break-inside: avoid;
  }

  /* Job entries */
  .job {
    margin-bottom: 0.75rem;
    page-break-inside: avoid;
  }

  .job-header {
    margin-bottom: 0.25rem;
  }

  .job-title {
    font-size: 11pt;
    font-weight: bold;
    margin-bottom: 0.125rem;
  }

  .job-company {
    font-size: 10pt;
    font-weight: normal;
  }

  .job-meta {
    font-size: 9pt;
  }

  .job-highlights {
    margin-top: 0.25rem;
  }

  .job-highlights li {
    font-size: 10pt;
    margin-bottom: 0.25rem;
    padding-left: 1.25rem;
  }

  .job-highlights li::before {
    content: "•";
  }

  /* Expandable sections - show all content */
  .job-group {
    border-top: none;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
  }

  .job-group-toggle {
    display: none;
  }

  .job-group[open] summary ~ * {
    display: block !important;
  }

  /* Education */
  .education h3 {
    font-size: 11pt;
    font-weight: bold;
  }

  .education-details,
  .education-institution {
    font-size: 10pt;
  }

  /* Skills */
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .skill-category h3 {
    font-size: 10pt;
    font-weight: bold;
    margin-bottom: 0.25rem;
  }

  .skill-category p {
    font-size: 9pt;
  }

  /* Languages */
  .language-list {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }

  .language-list li {
    font-size: 10pt;
  }

  /* Certifications */
  .cert-list {
    gap: 0.25rem;
  }

  .cert-list li {
    font-size: 10pt;
    padding-left: 1rem;
  }

  /* Show URLs after links */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }

  a[href^="mailto:"]::after,
  a[href^="tel:"]::after {
    content: "";
  }

  /* Orphans and widows */
  p, li {
    orphans: 3;
    widows: 3;
  }

  h2, h3, h4 {
    page-break-after: avoid;
    orphans: 4;
    widows: 4;
  }

  /* Remove backgrounds and gradients */
  * {
    background: none !important;
    box-shadow: none !important;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
