/* Print Styles - LaTeX-inspired Resume */

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

  /* Disable all hover effects in print */
  *:hover {
    background: inherit !important;
    color: inherit !important;
    transform: none !important;
    box-shadow: none !important;
    border-color: inherit !important;
    text-decoration: inherit !important;
    cursor: default !important;
    outline: none !important;
  }

  @page {
    size: 8.5in 11in;
    margin: 0.75in 0.75in 0.5in 0.75in;
  }

  html,
  body {
    font-family: Times, "Times New Roman", serif;
    /* ---------------------------------------------------------------------
       Print font-size token system.

       All print font-sizes are derived from a single base via calc(). To
       globally rescale the printed document, change only `--print-font-base`
       below. The token ramp matches the discrete sizes used in this file.

       Pinning root + body font-size also prevents Chrome's print engine from
       deriving an alternate body size from a content-aware "shrink to fit"
       pass.
       ---------------------------------------------------------------------- */
    --print-font-base: 7pt;
    --print-font-3xs: calc(var(--print-font-base) * 0.7); /* 7pt   */
    --print-font-2xs: calc(var(--print-font-base) * 0.8); /* 8pt   */
    --print-font-xs: calc(var(--print-font-base) * 0.9); /* 9pt   */
    --print-font-sm: calc(var(--print-font-base) * 0.95); /* 9.5pt */
    --print-font-md: var(--print-font-base); /* 10pt  */
    --print-font-lg: calc(var(--print-font-base) * 1.05); /* 10.5pt*/
    --print-font-xl: calc(var(--print-font-base) * 1.1); /* 11pt  */
    --print-font-2xl: calc(var(--print-font-base) * 1.2); /* 12pt  */
    --print-font-4xl: calc(var(--print-font-base) * 4); /* 40pt  */

    font-size: var(--print-font-md);
    line-height: 1.4;
    color: #000;
    background: #fff;
  }

  /* Container — pin width to the printable area so Chrome's print engine
     cannot apply a "shrink to fit" scale based on natural content width. */
  .container {
    width: 7in; /* 8.5in page - 0.75in left - 0.75in right */
    max-width: 7in;
    margin: 0;
    padding: 0 !important;
  }

  /* Typography - LaTeX Style */
  h1 {
    font-size: var(--print-font-4xl);
    font-weight: 400;
    letter-spacing: 0.02em;
    margin-bottom: 6pt;
    text-align: center;
    color: #000;
  }

  h2 {
    font-size: var(--print-font-2xl);
    font-weight: 700;
    font-variant: small-caps;
    margin-top: 14pt;
    margin-bottom: 8pt;
    padding-bottom: 1pt;
    border-bottom: 1pt solid #000;
    page-break-after: avoid;
    break-after: avoid;
    color: #000;
  }

  h3 {
    font-size: var(--print-font-xl);
    font-weight: 600;
    margin-top: 8pt;
    margin-bottom: 4pt;
    page-break-after: avoid;
    color: #000;
  }

  h4 {
    font-size: var(--print-font-lg);
    font-weight: 600;
    font-style: italic;
    margin-top: 4pt;
    margin-bottom: 2pt;
    color: #000;
  }

  p {
    margin-bottom: 6pt;
    text-align: justify;
    hyphenate: auto;
    widows: 3;
    orphans: 3;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  a[href^="http"]:after {
    content: "";
  }

  /* Header */
  .resume-header {
    text-align: center;
    margin-bottom: 16pt;
    padding-bottom: 12pt;
    border-bottom: 1.5pt solid #000;
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  .resume-header h1 {
    margin-bottom: 4pt;
    text-transform: uppercase;
  }

  .contact-info {
    text-align: center;
    font-size: var(--print-font-xs);
    margin: 6pt 0;
    color: #000;
  }

  .contact-item {
    display: inline-flex;
    align-items: center;
    padding: 0;
    margin: 0 6pt;
    background: none;
    border: none;
    font-family: Times, "Times New Roman", serif;
    font-size: var(--print-font-xs);
    color: #000;
  }

  .material-symbols-outlined {
    display: none !important;
  }

  .contact-brand-icon {
    width: 8pt;
    height: 8pt;
    fill: #000;
    margin-right: 2pt;
    flex-shrink: 0;
    position: static;
  }

  .contact-screen-text {
    display: none;
  }

  .contact-print-hidden {
    display: none !important;
  }

  .contact-print-text {
    display: inline;
    font-family: Times, "Times New Roman", serif;
  }

  .contact-info a {
    display: inline-flex;
    align-items: center;
    color: #000;
  }

  .mission-statement {
    max-width: 85%;
    margin: 10pt auto 0;
    font-size: var(--print-font-md);
    line-height: 1.5;
    text-align: justify;
    font-style: italic;
    color: #222;
  }

  #qualifications-section {
    margin-bottom: 6pt;
    page-break-inside: avoid;
    page-break-after: avoid;
  }

  #qualifications-section h2 {
    margin-top: 4pt;
    margin-bottom: 4pt;
    padding-bottom: 1pt;
  }

  .qualifications-list {
    list-style: none;
    padding-left: 0;
    margin: 2pt 0 0;
  }

  .qualifications-item {
    padding-left: 10pt;
    margin-bottom: 1pt;
    font-size: var(--print-font-sm);
    color: #000;
    text-indent: -10pt;
    line-height: 1.3;
    page-break-inside: avoid;
  }

  .qualifications-item::before {
    content: "- ";
    font-weight: normal;
    color: #000;
  }

  .qualifications-label {
    font-weight: 700;
  }

  .tagline {
    max-width: 85%;
    margin: 6pt auto 0;
    font-size: var(--print-font-xs);
    font-style: italic;
    color: #555;
    text-align: center;
  }

  /* Sections */
  .section {
    margin-bottom: 12pt;
  }

  .section:last-child {
    margin-bottom: 0;
  }

  /* Timeline / Experience */
  .timeline {
    display: block;
  }

  .experience-item {
    /* margin-bottom: 0pt; */
    padding-left: 0;
    border-left: none;
    page-break-inside: avoid;
  }

  .experience-item::before {
    display: none;
  }

  .company-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6pt;
    cursor: default;
  }

  .company-name-loc {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6pt;
  }

  .company-collapsed-role {
    display: none;
    font-size: var(--print-font-xs);
    font-style: italic;
    color: #444;
  }

  .experience-item:has(.positions-container.collapsed) .company-collapsed-role {
    display: inline;
  }

  /* Collapsed positions stay collapsed in print to match screen state */
  .positions-container.collapsed {
    display: none;
  }

  .company-name {
    font-size: var(--print-font-xl);
    font-weight: 700;
    font-variant: small-caps;
    color: #000;
  }

  .company-location {
    font-size: var(--print-font-xs);
    font-style: italic;
    color: #333;
  }

  .position {
    margin-bottom: 8pt;
    padding: 0;
    background: none;
    border: none;
    page-break-inside: avoid;
  }

  .position-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3pt;
  }

  .position-title {
    font-size: var(--print-font-lg);
    font-weight: 600;
    font-style: italic;
    color: #000;
  }

  .promotion-badge {
    display: inline;
    padding: 0;
    margin-left: 4pt;
    background: none;
    color: #000;
    border-radius: 0;
    font-size: var(--print-font-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .promotion-badge::before {
    content: "[";
  }

  .promotion-badge::after {
    content: "]";
  }

  .date-range {
    font-size: var(--print-font-xs);
    color: #333;
    font-weight: normal;
  }

  .position-summary {
    margin: 4pt 0;
    font-size: var(--print-font-sm);
    color: #000;
  }

  .highlights {
    list-style: none;
    margin: 4pt 0 4pt 0;
    padding-left: 0;
  }

  .highlights li {
    padding-left: 12pt;
    margin-bottom: 2pt;
    font-size: var(--print-font-sm);
    color: #000;
    text-indent: -12pt;
  }

  .highlights li::before {
    content: "- ";
    position: static;
    font-weight: normal;
    color: #000;
  }

  .technologies {
    display: inline;
    margin-top: 4pt;
  }

  .technologies::before {
    content: "Technologies: ";
    font-weight: 600;
    font-size: var(--print-font-xs);
  }

  .tech-tag {
    display: inline;
    padding: 0;
    margin: 0;
    background: none;
    color: #000;
    border-radius: 0;
    font-size: var(--print-font-xs);
    font-weight: normal;
  }

  .courses {
    display: inline;
    margin-top: 2pt;
  }

  .course-tag {
    display: inline;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    color: #000;
    font-size: var(--print-font-xs);
    font-weight: normal;
  }

  .course-tag + .course-tag::before {
    content: ", ";
  }

  .tech-tag::after {
    content: ", ";
  }

  .tech-tag:last-child::after {
    content: "";
  }

  .courses-label {
    display: inline;
    margin: 0;
    padding: 0;
    font-weight: 600;
    font-size: var(--print-font-xs);
  }

  .courses-label::after {
    content: " ";
  }

  /* Position Projects (Company Projects) */
  .position-projects-header {
    margin-top: 6pt;
    padding: 0;
    background: none;
    border-radius: 0;
    font-size: var(--print-font-sm);
    font-weight: 600;
    color: #000;
    cursor: default;
    margin-bottom: 4pt;
  }

  /* Hide project header when followed by collapsed content */
  .position-projects-header:has(+ .position-projects-container.collapsed) {
    display: none;
  }

  .position-projects-container {
    margin-top: 4pt !important;
  }

  .position-projects-container.collapsed {
    /* Stay collapsed in print to match screen state */
    display: none;
  }

  .company-project-item {
    padding: 6pt 0 6pt 8pt;
    margin-bottom: 2pt;
    background: none;
    border: none;
    border-left: 2pt solid #ccc;
  }

  .company-project-item:last-child {
    margin-bottom: 0;
  }

  /* Projects */
  .projects {
    display: block;
  }

  .project-group-header {
    font-size: var(--print-font-xl);
    font-weight: 700;
    color: #000;
    margin-bottom: 6pt;
    margin-top: 10pt;
    border-bottom: 1pt solid #ccc;
    padding-bottom: 1pt;
  }

  .project-group-header:first-child {
    margin-top: 0;
  }

  .project-item {
    margin-bottom: 8pt;
    padding: 0;
    background: none;
    border: none;
    page-break-inside: avoid;
  }

  .project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3pt;
  }

  .project-name {
    font-size: var(--print-font-lg);
    font-weight: 700;
    color: #000;
  }

  .project-role {
    font-size: var(--print-font-xs);
    font-style: italic;
    color: #333;
  }

  .project-description {
    margin: 4pt 0;
    font-size: var(--print-font-sm);
    color: #000;
  }

  .project-metrics {
    display: block;
    margin-top: 4pt;
    padding-top: 0;
    border-top: none;
  }

  .project-metrics::before {
    content: "Metrics: ";
    font-weight: 600;
    font-size: var(--print-font-xs);
  }

  .metric {
    display: inline;
    font-size: var(--print-font-xs);
    font-weight: normal;
    color: #000;
  }

  .metric::after {
    content: " • ";
  }

  .metric:last-child::after {
    content: "";
  }

  /* Education */
  .education {
    display: block;
  }

  .education-item {
    margin-bottom: 8pt;
    padding: 0;
    background: none;
    border: none;
    page-break-inside: avoid;
  }

  .education-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3pt;
  }

  .institution-name {
    font-size: var(--print-font-lg);
    font-weight: 700;
    color: #000;
  }

  .degree-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3pt;
  }

  .degree {
    font-weight: 600;
    font-size: var(--print-font-md);
    color: #000;
  }

  .field {
    font-size: var(--print-font-md);
    color: #000;
  }

  .gpa {
    font-size: var(--print-font-xs);
    color: #333;
    white-space: nowrap;
  }

  .concentration {
    margin-top: 2pt;
    margin-bottom: 3pt;
    font-size: var(--print-font-xs);
    color: #333;
    font-style: italic;
  }

  .honors {
    display: inline;
    padding: 0;
    margin-left: 4pt;
    background: none;
    color: #000;
    border-radius: 0;
    font-size: var(--print-font-xs);
    font-weight: 600;
  }

  .honors::before {
    content: "[";
  }

  .honors::after {
    content: "]";
  }

  /* Achievements */
  .achievements {
    list-style: none;
    padding-left: 0;
  }

  .achievement-item {
    margin-bottom: 6pt;
    padding: 0 0 0 10pt;
    background: none;
    border-left: 2pt solid #000;
    page-break-inside: avoid;
  }

  .achievement-title {
    font-weight: 600;
    font-size: var(--print-font-md);
    color: #000;
    margin-bottom: 1pt;
  }

  .achievement-issuer {
    font-size: var(--print-font-xs);
    font-style: italic;
    color: #333;
    margin-bottom: 2pt;
  }

  .achievement-date {
    font-size: var(--print-font-xs);
    color: #333;
  }

  .achievement-issuer::after {
    content: " • ";
  }

  .achievement-description {
    font-size: var(--print-font-sm);
    color: #000;
    margin-bottom: 0;
  }

  /* Skills */
  .skills {
    display: block;
  }

  .skill-category {
    margin-bottom: 6pt;
    padding: 0;
    background: none;
    border: none;
    page-break-inside: avoid;
  }

  .skill-category-name {
    font-size: var(--print-font-md);
    font-weight: 700;
    color: #000;
    margin-bottom: 3pt;
    display: inline;
  }

  .skill-category-name::after {
    content: ": ";
  }

  .skill-items {
    display: inline;
  }

  .skill-item {
    display: inline;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    font-size: var(--print-font-sm);
    color: #000;
  }

  .skill-item::after {
    content: ", ";
  }

  .skill-item:last-child::after {
    content: "";
  }

  /* Project source links: show icon in print (clickable in PDF) */
  .project-link-btn {
    display: inline-flex;
    align-items: center;
    color: #000;
    text-decoration: none;
    margin-left: 4pt;
  }

  .project-link-btn .contact-brand-icon {
    width: 7.5pt;
    height: 7.5pt;
  }

  .project-link-btn .material-symbols-outlined {
    display: inline !important;
    font-size: var(--print-font-2xs);
  }

  .loading {
    display: none;
  }

  .modal {
    display: none !important;
  }

  .career-timeline-viz {
    display: none;
  }

  #notifications {
    display: none !important;
  }

  /* Note: Items with enabled:false are filtered by JavaScript before rendering,
     so they never appear in the DOM. Sections with all items disabled have
     display:none set via inline styles, which persist in print. */

  /* Page break control */
  h2,
  h3,
  .experience-item,
  .project-item,
  .education-item,
  .achievement-item,
  .skill-category {
    page-break-inside: avoid;
  }

  /* Ensure good breaks between major sections */
  .section {
    page-break-before: auto;
  }

  /* Never break between a section heading and its first item */
  .experience-item:first-child,
  .project-item:first-child,
  .education-item:first-child,
  .achievement-item:first-child,
  .skill-category:first-child {
    page-break-before: avoid;
    break-before: avoid;
  }

  /* Compact spacing for longer resumes */
  @media print and (min-height: 11in) {
    .section {
      margin-bottom: 10pt;
    }

    h2 {
      margin-top: 12pt;
      margin-bottom: 6pt;
    }
  }
}
