/* CV page styles */

/* Main CV wrapper */
#cv {
  max-width: 980px;

  /* Main spacing controls */
  --cv-section-gap: 1.35rem;
  --cv-work-gap: 1.25rem;
  --cv-heading-gap: 1rem;
  --cv-list-item-gap: 0.25rem;
  --cv-skill-title-gap: 0.45rem;
}

/* Screen spacing below fixed navbar */
@media screen and (min-width: 768px) {
  .main {
    padding-top: calc(var(--header-height) + 1.5rem);
  }
}

/* CV card for screen view */
#cv.section.cv_container {
  background-color: var(--container-color);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  margin-bottom: 3rem;
}

/* Header */
.cv_header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cv_header h1,
.cv_header .section_subtitle {
  margin: 0;
}

.cv_header .section_title {
  font-size: 1.2rem;
  line-height: 1.2;
  color: var(--first-color);
  text-align: left;
  margin-bottom: 0.3rem;
}

.cv_header .section_subtitle {
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--title-color);
  text-align: left;
  margin-bottom: 0;
  font-weight: var(--font-medium);
}

/* Download button */
.cv_download {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.cv_download .button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--first-color);
  color: #fff;
  padding: 0.5rem 0.7rem;
  border-radius: 0.4rem;
  font-size: 0.75rem;
  font-weight: var(--font-medium);
  white-space: nowrap;
  transition: 0.3s;
}

.cv_download .button:hover {
  background-color: var(--first-color-alt);
  color: #fff;
}

.cv_download .button i {
  font-size: 0.85rem;
}

/* Contact details */
.cv_contact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  background-color: transparent;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
  border-radius: 0;
}

.cv_contact_block p {
  margin: 0 0 0.32rem 0;
  line-height: 1.45;
  font-size: 0.82rem;
  color: var(--text-color);
  overflow-wrap: break-word;
}

.cv_contact_block p:last-child {
  margin-bottom: 0;
}

.cv_contact_block p strong {
  font-weight: var(--font-semi-bold);
  color: var(--title-color);
  margin-right: 0.35rem;
}

/* Keep contact links the same color as normal CV text */
.cv_contact_block a,
.cv_contact_block a:visited,
.cv_contact_block a:hover,
.cv_contact_block a:active {
  color: var(--text-color);
  text-decoration: none;
}

/* Consistent spacing between main CV sections */
#cv > .cv_header,
#cv > .cv_contact,
#cv > .cv_section {
  margin-bottom: var(--cv-section-gap);
}

#cv > .cv_section:last-child {
  margin-bottom: 0;
}

/* Sections */
.cv_section h2 {
  font-size: 0.98rem;
  margin-bottom: var(--cv-heading-gap);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--first-color);
  color: var(--first-color);
  text-align: left;
  letter-spacing: 0.2px;
}

.cv_section p,
.cv_section li,
.cv_section span {
  color: var(--text-color);
  font-size: 0.84rem;
}

.cv_section p {
  line-height: 1.6;
  margin-bottom: 0;
}

.cv_section > p:not(:last-child) {
  margin-bottom: 0.6rem;
}

/* Work and education layout */
.cv_work_item {
  margin-bottom: var(--cv-work-gap);
}

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

.cv_work_row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1.5rem;
  align-items: flex-start;
}

.cv_dates {
  font-size: 0.8rem;
  color: var(--text-color-light);
  font-weight: var(--font-medium);
  line-height: 1.45;
}

.cv_work_content {
  padding-bottom: 0;
}

.cv_work_content h4 {
  margin: 0 0 0.22rem 0;
  font-size: 0.88rem;
  color: var(--title-color);
}

.cv_company,
.cv_location {
  margin: 0;
  color: var(--text-color);
  font-size: 0.82rem;
  line-height: 1.4;
}

.cv_company {
  margin-bottom: 0.15rem;
}

/* Space between location and bullet list */
.cv_work_content ul {
  margin-top: var(--cv-work-gap);
}

/* Bullet lists */
.cv_section ul {
  margin-bottom: 0;
  padding-left: 1.05rem;
  list-style: disc;
}

.cv_section li {
  margin-bottom: var(--cv-list-item-gap);
  line-height: 1.42;
  padding-left: 0.15rem;
}

.cv_section li:last-child {
  margin-bottom: 0;
}

.cv_section li::marker {
  color: var(--first-color);
}

/* Justify work-history bullet statements */
.cv_work_content li {
  text-align: justify;
  text-align-last: left;
}

/* Additional Skills section */
.cv_additional_skills .cv_skill_group {
  margin-bottom: var(--cv-work-gap);
}

.cv_additional_skills .cv_skill_group:last-child {
  margin-bottom: 0;
}

.cv_additional_skills .cv_skill_group_title {
  color: var(--title-color);
  font-size: 0.84rem;
  font-weight: var(--font-medium);
  line-height: 1.4;
  margin-bottom: var(--cv-skill-title-gap);
}

.cv_additional_skills .cv_skill_list {
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 1.4rem;
}

.cv_additional_skills .cv_skill_list li {
  margin-bottom: 0.22rem;
  line-height: 1.4;
  text-align: left;
}

.cv_additional_skills .cv_skill_list li:last-child {
  margin-bottom: 0;
}

.cv_additional_skills .cv_skill_list strong {
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
}

/* Utility */
.nowrap {
  white-space: nowrap;
}

/* Tablet */
@media screen and (max-width: 992px) {
  #cv {
    max-width: 900px;
  }

  .cv_header {
    flex-direction: column;
  }

  .cv_download {
    justify-content: flex-start;
  }
}

/* Mobile */
@media screen and (max-width: 767px) {
  #cv {
    --cv-section-gap: 1.25rem;
    --cv-work-gap: 1.15rem;
    --cv-list-item-gap: 0.22rem;
    --cv-skill-title-gap: 0.4rem;
  }

  #cv.section.cv_container {
    padding: 1.25rem;
    border-radius: 0.75rem;
  }

  .cv_contact {
    grid-template-columns: 1fr;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
  }

  .cv_work_row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .cv_dates {
    color: var(--first-color);
  }
}

/* Small phones */
@media screen and (max-width: 350px) {
  #cv.section.cv_container {
    padding: 1rem;
  }

  .cv_header .section_title {
    font-size: 1.05rem;
  }

  .cv_section p,
  .cv_section li,
  .cv_section span {
    font-size: 0.8rem;
  }
}

/* Print / German-style A4 CV layout */
@media print {
  @page {
    size: A4;
    margin: 20mm;
  }

  html,
  body {
    background: #fff !important;
    color: #000 !important;
    font-family: "Times New Roman", Times, serif;
    font-size: 10.5pt;
    line-height: 1.3;
    margin: 0;
    padding: 0;
  }

  .header,
  .footer,
  .scrollup,
  .nav_btns,
  .nav_toggle,
  .nav_close,
  .change-theme,
  .footer_bg,
  .cv_download {
    display: none !important;
  }

  .main {
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }

  #cv,
  .container {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
  }

  #cv {
    --cv-section-gap: 5mm;
    --cv-work-gap: 4mm;
    --cv-heading-gap: 5mm;
    --cv-list-item-gap: 0.8mm;
    --cv-skill-title-gap: 1.5mm;
  }

  #cv.section.cv_container {
    background: #fff !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .cv_header {
    margin-bottom: var(--cv-section-gap) !important;
  }

  .cv_header .section_title {
    font-size: 16pt;
    line-height: 1.15;
    color: #0000ee !important;
    margin-bottom: 1mm;
  }

  .cv_header .section_subtitle {
    font-size: 10.5pt;
    color: #000 !important;
    font-weight: normal;
  }

  .cv_contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12mm;
    background: #fff !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 0 !important;
    margin-bottom: var(--cv-section-gap) !important;
  }

  .cv_contact_block p {
    font-size: 10.5pt;
    line-height: 1.22;
    margin: 0 0 1mm 0;
    color: #000 !important;
  }

  .cv_contact_block p strong {
    color: #000 !important;
    font-weight: bold;
  }

  .cv_contact_block a,
  .cv_contact_block a:visited,
  .cv_contact_block a:hover,
  .cv_contact_block a:active {
    color: #000 !important;
    text-decoration: none !important;
  }

  .cv_section {
    margin-bottom: var(--cv-section-gap) !important;
  }

  .cv_section:last-child {
    margin-bottom: 0 !important;
  }

  .cv_section h2 {
    font-size: 12pt;
    line-height: 1.2;
    color: #0000ee !important;
    border-bottom: 1px solid #0000ee;
    padding-bottom: 1.5mm;
    margin-bottom: var(--cv-heading-gap) !important;
  }

  .cv_section p,
  .cv_section li,
  .cv_section span,
  .cv_skill_group_title {
    font-size: 10.5pt;
    color: #000 !important;
  }

  .cv_section p {
    line-height: 1.3;
    text-align: left;
  }

  .cv_work_item {
    margin-bottom: var(--cv-work-gap) !important;
    page-break-inside: auto;
    break-inside: auto;
  }

  .cv_work_item:last-child {
    margin-bottom: 0 !important;
  }

  .cv_work_row {
    display: grid;
    grid-template-columns: 34mm 1fr;
    gap: 7mm;
    align-items: start;
    page-break-inside: auto;
    break-inside: auto;
  }

  .cv_dates {
    font-size: 10.5pt;
    color: #000 !important;
    font-weight: normal;
    line-height: 1.3;
  }

  .cv_work_content {
    padding-bottom: 0;
  }

  .cv_work_content h4 {
    font-size: 10.5pt;
    color: #0000ee !important;
    margin: 0 0 1.5mm 0;
  }

  .cv_company,
  .cv_location {
    font-size: 10.5pt;
    color: #000 !important;
    line-height: 1.22;
    margin: 0;
  }

  .cv_company {
    margin-bottom: 1mm;
  }

  .cv_work_content ul {
    margin-top: var(--cv-work-gap) !important;
  }

  .cv_section ul,
  .cv_skill_list {
    margin-bottom: 0;
    padding-left: 6mm;
    list-style-position: outside;
  }

  .cv_section li,
  .cv_skill_list li {
    font-size: 10.5pt;
    line-height: 1.2;
    margin-bottom: var(--cv-list-item-gap);
    padding-left: 1mm;
    color: #000 !important;
    page-break-inside: auto;
    break-inside: auto;
  }

  .cv_section li:last-child,
  .cv_skill_list li:last-child {
    margin-bottom: 0 !important;
  }

  .cv_section li::marker,
  .cv_skill_list li::marker {
    color: #000 !important;
  }

  .cv_work_content li {
    text-align: justify;
    text-align-last: left;
  }

  .cv_skill_group {
    margin-bottom: var(--cv-work-gap) !important;
  }

  .cv_skill_group:last-child {
    margin-bottom: 0 !important;
  }

  .cv_skill_group_title {
    margin-bottom: var(--cv-skill-title-gap) !important;
  }

  .cv_skill_list strong {
    color: #000 !important;
  }

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