/*
 * CV Print CSS
 * A4, ATS-friendly, professional international resume styling
 */

@page {
  size: A4;
  margin: 20mm 18mm;
}

@page {
  @bottom-center {
    content: "Generated " counter(page) " — " date("yyyy-MM-dd");
    font-size: 9pt;
    color: #666;
    padding-top: 1em;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Times New Roman", Times, serif;
  font-size: 11pt;
  line-height: 1.4;
  color: #000;
  background: #fff;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

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

/* Typography */
h1 {
  font-size: 16pt;
  font-weight: bold;
  margin: 0 0 0.3em 0;
  line-height: 1.2;
  color: #000;
  page-break-after: avoid;
}

h2 {
  font-size: 14pt;
  font-weight: bold;
  margin: 1.2em 0 0.6em 0;
  line-height: 1.3;
  color: #000;
  page-break-after: avoid;
}

h3 {
  font-size: 12pt;
  font-weight: bold;
  margin: 1em 0 0.4em 0;
  line-height: 1.3;
  color: #000;
  page-break-after: avoid;
}

p {
  margin: 0 0 0.8em 0;
  text-align: left;
  page-break-inside: avoid;
}

.title {
  font-size: 12pt;
  margin: 0.3em 0 0.8em 0;
}

.contact {
  font-size: 10pt;
  margin: 0.4em 0 0.8em 0;
  line-height: 1.4;
}

.date {
  font-size: 10pt;
  color: #333;
  margin: 0.4em 0 0.6em 0;
  font-style: italic;
}

.project-tag {
  font-size: 9pt;
  color: #444;
  font-weight: normal;
}

.footer-note {
  font-size: 9pt;
  color: #666;
  margin: 1.5em 0 0 0;
  line-height: 1.3;
}

/* Links - clickable and visible */
a {
  color: #000;
  text-decoration: underline;
  text-decoration-color: #000;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration: underline;
}

/* Horizontal rules */
hr {
  border: none;
  border-top: 1px solid #000;
  margin: 1.2em 0;
  page-break-inside: avoid;
}

.footer-hr {
  border-top: 1px solid #999;
  margin: 2em 0 1em 0;
}

/* Lists */
ul {
  margin: 0 0 1em 0;
  padding-left: 2em;
  page-break-inside: avoid;
}

li {
  margin: 0 0 0.5em 0;
  line-height: 1.4;
  page-break-inside: avoid;
}

/* Code */
code {
  font-family: "Courier New", Courier, monospace;
  font-size: 10pt;
  background: #f5f5f5;
  padding: 0.1em 0.3em;
  border-radius: 2px;
}

/* Strong emphasis */
strong {
  font-weight: bold;
}

em {
  font-style: italic;
}

/* Page break management */
h1, h2, h3 {
  page-break-after: avoid;
}

ul, li {
  page-break-inside: avoid;
}

p {
  orphans: 3;
  widows: 3;
}

/* Print-specific adjustments */
@media print {
  body {
    width: 100%;
    margin: 0;
    padding: 0;
  }

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

  /* Ensure links are printed with URLs visible */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    word-break: break-all;
  }

  a[href^="mailto"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
  }

  /* Override for LinkedIn/GitHub short URLs */
  a[href*="linkedin.com"]::after,
  a[href*="github.com"]::after {
    content: "";
  }
}

/* Screen preview adjustments */
@media screen {
  body {
    background: #f5f5f5;
  }

  .cv-container {
    background: #fff;
    max-width: 210mm;
    margin: 2em auto;
    padding: 20mm 18mm;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
}