/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Outfit", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14pt;
  line-height: 1.5;
  color: #333;
  background: #f0f0f0;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Download Button Block */
.download {
  display: flex;
  justify-content: flex-start;
  width: 960px;
  margin: 0.5rem auto;
}

.download__button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.4rem 0.8rem;
  background-color: #4a90e2;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 4px;
  font-size: 0.8em;
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.1s;
  box-shadow: 0 3px 0 #357abd;
  cursor: pointer;
}

.download__button:hover {
  background-color: #357abd;
}

.download__button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #357abd;
}

.download__icon {
  font-size: 0.9em;
  margin-right: 4px;
}

/* Resume Block */
.resume {
  max-width: 960px;
  margin: 0.6rem auto;
  padding: 12mm;
  background: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

/* Header Block */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 5mm;
  padding: 0;
  page-break-inside: avoid;
}

.header__left {
  display: flex;
  gap: 6px;
  align-items: center;
}

.header__right {
  text-align: right;
}

.header__photo {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #4a90e2;
  margin-right: 1rem;
}

.header__title {
  font-size: 24pt;
  margin: 0;
  line-height: 1.2;
  font-weight: 600;
  color: #2c3e50;
}

.header__subtitle {
  margin: 0;
  font-weight: 600;
  color: #666;
  font-size: 20pt;
}

/* Contact Block */
.contact {
  font-size: 0.85em;
  line-height: 1.3;
  text-align: right;
}

.contact__item {
  text-align: left;
  margin: 2px 0;
}

.contact__icon {
  margin-right: 6px;
  color: #4a90e2;
  width: 16px;
  text-align: center;
}

.contact__link {
  color: #000;
  text-decoration: none;
}

/* Content Block */
.content {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-bottom: 12px;
  width: 100%;
  page-break-inside: avoid;
}

/* Sidebar Block */
.sidebar {
  grid-column: 1 / 4;
  font-size: 0.85em;
  padding-top: 6mm;
  padding-bottom: 6mm;
}

.sidebar__section {
  margin-bottom: 8mm;
  page-break-inside: avoid;
}

.sidebar__title {
  font-size: 14pt;
  font-weight: 600;
  color: #34495e;
  margin: 8mm 0 6mm;
  padding-bottom: 2mm;
  border-bottom: 2px solid #4a90e2;
  position: relative;
}

.sidebar__title:first-child {
  margin-top: 6mm;
}

.sidebar__title::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 30px;
  height: 2px;
  background: #e74c3c;
}

.sidebar__subtitle {
  color: #4a90e2;
  font-size: 1em;
  margin-bottom: 4mm;
  margin-top: 4mm;
  font-size: 12pt;
  font-weight: 600;
}

.sidebar__list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 5mm;
}

.sidebar__item {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 2.5mm;
  line-height: 1.4;
}

.sidebar__item::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #4a90e2;
  font-weight: bold;
}

.sidebar__interest-title {
  font-weight: bold;
  color: #333;
}

/* Main Content Block */
.main {
  grid-column: 5 / 13;
  font-size: 0.95em;
  padding-top: 6mm;
  padding-bottom: 6mm;
}

.main__section {
  margin-bottom: 4mm;
  page-break-inside: avoid;
}

.main__title {
  font-size: 14pt;
  font-weight: 600;
  color: #34495e;
  margin: 6mm 0 6mm;
  padding-bottom: 2mm;
  border-bottom: 2px solid #4a90e2;
  position: relative;
}

.main__title::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 30px;
  height: 2px;
  background: #e74c3c;
}

.main__paragraph {
  margin-bottom: 2mm;
}

.main__highlight {
  font-weight: bold;
}

/* Experience Block */
.experience {
  margin-bottom: 4mm;
  page-break-inside: avoid;
}

.experience__title {
  font-size: 12pt;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 2mm;
}

.experience__date {
  color: #333;
  font-size: 0.9em;
  margin-bottom: 2mm;
}

.experience__description {
  margin-bottom: 2mm;
}

.experience__list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 2mm;
}

.experience__item {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 1.5mm;
}

.experience__item::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #4a90e2;
  font-weight: bold;
}

/* Education Block */
.education {
  margin-bottom: 4mm;
  page-break-inside: avoid;
}

.education__title {
  font-size: 12pt;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 2mm;
}

.education__date {
  color: #333;
  font-size: 0.9em;
  margin-bottom: 2mm;
}

.education__description {
  margin-bottom: 2mm;
}

.education__list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 2mm;
}

.education__item {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 1.5mm;
}

.education__item::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #4a90e2;
  font-weight: bold;
}

/* Responsive */
@media (max-width: 996px) {
  .resume {
    margin: 0.5rem;
  }
  .download {
    width: 100%;
    margin: 0.5rem;
  }
}

@media (max-width: 768px) {
  .resume {
    padding: 6mm;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .header__right {
    text-align: left;
  }

  .content {
    display: flex;
    flex-direction: column;
  }

  .main {
    order: 1;
  }

  .sidebar {
    order: 2;
  }

  .sidebar,
  .main {
    grid-column: 1 / -1;
    padding: 4mm 0;
    font-size: 0.9em;
  }

  .header__title {
    font-size: 22pt;
  }

  .sidebar__title,
  .main__title {
    font-size: 13pt;
    margin: 0 0 6mm;
  }

  .sidebar__subtitle,
  .experience__title,
  .education__title {
    font-size: 11pt;
  }

  .content {
    gap: 0;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 12pt;
  }

  .download__button {
    width: 100%;
    margin: 0.2rem;
    justify-content: center;
  }

  .header__title {
    font-size: 20pt;
  }

  .resume {
    padding: 12px;
    margin: 0.2rem;
  }

  .download {
    margin: 0;
  }

  .contact__item {
    margin: 0.5rem 0;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.2;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    width: 100%;
    margin: 0;
  }

  .resume {
    width: 100%;
    max-width: 100%;
    padding: 15mm;
    margin: 0 auto;
    box-shadow: none;
  }

  .header,
  .main__section,
  .sidebar__section,
  .experience,
  .education,
  .content {
    page-break-inside: avoid;
  }

  .header {
    display: flex;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0;
  }

  .header__left,
  .header__right {
    text-align: left;
  }

  .header__photo {
    width: 80px;
    height: 80px;
  }

  .content {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 5%;
  }

  .sidebar {
    flex: 0 0 25%;
    order: 0;
    padding-top: 1mm;
    padding-bottom: 1mm;
  }

  .main {
    flex: 0 0 70%;
    order: 1;
    padding-top: 1mm;
    padding-bottom: 1mm;
  }

  .header__title {
    font-size: 20pt;
  }

  .sidebar__title,
  .main__title {
    font-size: 12pt;
    margin: 6mm 0 4mm;
  }

  .sidebar__title:first-child {
    margin-top: 6mm;
  }

  .sidebar__subtitle,
  .experience__title,
  .education__title {
    font-size: 10pt;
    margin-bottom: 2mm;
    margin-top: 3mm;
  }

  .sidebar__section {
    margin-bottom: 6mm;
  }

  .sidebar__list {
    margin-bottom: 4mm;
  }

  .sidebar__item {
    margin-bottom: 2mm;
    line-height: 1.3;
  }

  .main__paragraph,
  .experience__description,
  .education__description,
  .experience__list,
  .education__list,
  .experience__item,
  .education__item {
    margin-bottom: 1mm;
    font-size: 10pt;
  }

  .sidebar__item::before,
  .experience__item::before,
  .education__item::before {
    left: 0;
  }

  .download {
    display: none !important;
  }
}
