/* CV Stylesheet - ModernCV Classic Style Facsimile */

:root {
  --burgundy: #800020;
  --dark-burgundy: #600018;
  --light-burgundy: #a0002a;
  --very-light-burgundy: #e6ccd1;
  --light-gray: #f5f5f5;
  --medium-gray: #666;
  --dark-gray: #333;
  --border-gray: #ccc;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 11pt;
}

body {
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, 'TeX Gyre Pagella', Georgia, serif;
  line-height: 1.4;
  color: var(--dark-gray);
  background: #fff;
  max-width: 8.27in;
  margin: 0 auto;
  padding: 0.5in;
}

/* Hide pandoc-generated title */
#title-block-header {
  display: none;
}

/* PDF Download Button */
.pdf-download {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: var(--burgundy);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 1000;
}

.pdf-download:hover {
  background: var(--dark-burgundy);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pdf-download i {
  font-size: 24px;
}

/* CV Header */
.cv-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5em;
  margin-bottom: 1.5em;
}

.cv-photo {
  flex-shrink: 0;
}

.cv-photo img {
  width: 1.2in;
  height: auto;
  border-radius: 2px;
  border: 0.4pt solid var(--border-gray);
}

.cv-header-content {
  flex: 1;
}

.cv-name {
  font-size: 32pt;
  font-weight: normal;
  color: var(--burgundy);
  margin-bottom: 0.3em;
  line-height: 1.1;
}

.cv-contact {
  font-size: 10pt;
  color: var(--medium-gray);
  margin-bottom: 0.5em;
  font-style: italic;
}

.cv-contact div {
  margin-bottom: 0.1em;
}

.cv-details {
  font-size: 10pt;
  color: var(--dark-gray);
  margin-bottom: 0.5em;
}

.cv-details div {
  margin-bottom: 0.15em;
}

.cv-socials {
  font-size: 10pt;
  margin-top: 0.5em;
}

.social-link {
  display: block;
  margin-bottom: 0.3em;
}

.social-link a {
  color: var(--burgundy);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.social-link a:hover {
  border-bottom-color: var(--burgundy);
}

.social-link i {
  width: 1.2em;
  text-align: center;
  margin-right: 0.3em;
}

.cv-header-separator {
  border: none;
  border-top: 0.4pt solid var(--burgundy);
  margin: 1.5em 0;
}

/* Collapsible sections */
details {
  margin: 0;
  padding: 0;
}

details summary {
  font-size: 16pt;
  color: var(--burgundy);
  border-bottom: 0.4pt solid var(--burgundy);
  margin-top: 1.2em;
  margin-bottom: 0.8em;
  padding-bottom: 0.2em;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  page-break-after: avoid;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: '▶';
  color: var(--burgundy);
  margin-right: 0.5em;
  font-size: 0.8em;
  transition: transform 0.2s;
  display: inline-block;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details summary:hover {
  color: var(--dark-burgundy);
}

/* Section headings - moderncv style (for non-collapsible if any) */
h2 {
  font-size: 16pt;
  color: var(--burgundy);
  border-bottom: 0.4pt solid var(--burgundy);
  margin-top: 1.2em;
  margin-bottom: 0.8em;
  padding-bottom: 0.2em;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 1px;
  page-break-after: avoid;
}

h3 {
  font-size: 12pt;
  color: var(--burgundy);
  margin-top: 1em;
  margin-bottom: 0.6em;
  font-weight: 600;
  font-style: italic;
  page-break-after: avoid;
}

h4 {
  font-size: 11pt;
  color: var(--medium-gray);
  margin-top: 0.8em;
  margin-bottom: 0.4em;
  font-weight: 600;
  font-style: italic;
}

p {
  margin-bottom: 0.8em;
  text-align: justify;
}

a {
  color: var(--burgundy);
  text-decoration: none;
}

a:hover {
  color: var(--dark-burgundy);
  text-decoration: underline;
}

/* Header/Title area */
header {
  margin-bottom: 2em;
  padding-bottom: 1em;
  border-bottom: 2px solid var(--burgundy);
}

/* Contact info */
.author {
  font-size: 24pt;
  color: var(--burgundy);
  margin-bottom: 0.3em;
}

.affiliation, .contact-info {
  font-size: 10pt;
  color: var(--medium-gray);
  margin-bottom: 0.2em;
}

/* Lists */
ul, ol {
  margin-left: 2em;
  margin-bottom: 1em;
}

li {
  margin-bottom: 0.3em;
}

/* CV entries (mimicking moderncv cventry) */
.cventry {
  margin-bottom: 1em;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1em;
}

.cventry .year {
  color: var(--medium-gray);
  font-style: italic;
  text-align: right;
}

.cventry .details {
  padding-left: 0;
}

.cventry .title {
  font-weight: 600;
  color: var(--dark-gray);
}

.cventry .institution {
  font-style: italic;
  color: var(--medium-gray);
}

/* Bibliography */
.references {
  margin-top: 1em;
}

.csl-entry {
  margin-bottom: 0.8em;
  padding-left: 1.5em;
  text-indent: -1.5em;
  text-align: left;
}

/* Strong elements (for bold author name) */
strong {
  font-weight: 600;
  color: var(--dark-gray);
}

/* Tables */
table {
  border-collapse: collapse;
  margin: 1em 0;
  width: 100%;
}

th, td {
  padding: 0.5em;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: var(--light-gray);
  font-weight: 600;
  color: var(--burgundy);
}

/* Code blocks (if any) */
code {
  font-family: 'Courier New', monospace;
  font-size: 10pt;
  background-color: var(--light-gray);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

/* Responsive for smaller screens */
@media screen and (max-width: 768px) {
  body {
    padding: 0.25in;
    font-size: 10pt;
  }
  
  h1 {
    font-size: 22pt;
  }
  
  h2 {
    font-size: 13pt;
  }
  
  .cventry {
    grid-template-columns: 1fr;
    gap: 0.3em;
  }
  
  .cventry .year {
    text-align: left;
  }
}

/* Print styles */
@media print {
  body {
    max-width: 100%;
    margin: 0;
    padding: 0.5in;
  }
  
  a {
    color: var(--dark-gray);
    text-decoration: none;
  }
  
  h2 {
    page-break-after: avoid;
  }
}
