/* Isolated Template 6: Ivy League / Tech Minimalist - Spacing Updated */
/* ==========================================================================
   FORCE ZERO BROWSER MARGINS IN PRINT ENGINE
   Overrides Chrome/Edge/Firefox 'Default' margin behavior automatically.
   ========================================================================== */
@page {
    size: A4 portrait;
    margin: 0 !important; /* Forces browser default margins to zero */
}

.tpl-ivy {
  --ivy-text: #000000;
  --ivy-muted: #333333;
  --ivy-rule: #000000;
  font-family: "Times New Roman", Times, Georgia, serif;
  color: var(--ivy-text);
  line-height: 1.45;
  background: #ffffff;
  width: 100%;
  box-sizing: border-box;
}

/* Header */
.tpl-ivy .ivy-header {
  text-align: center;
  margin-bottom: 16px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.tpl-ivy .candidate-name {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 6px 0;
  line-height: 1.1;
}

.tpl-ivy .contact-bar {
  font-size: 10.5px;
  color: var(--ivy-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  align-items: center;
  line-height: 1.4;
}

.tpl-ivy .contact-bar span:not(:last-child)::after {
  content: "•";
  margin-left: 6px;
  color: #666666;
}

/* Section Rule */
.tpl-ivy .ivy-section {
  margin-bottom: 14px;
}

.tpl-ivy .section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--ivy-rule);
  padding-bottom: 2px;
  margin: 0 0 8px 0;
  break-inside: avoid;
  page-break-inside: avoid;
  break-after: avoid;
  page-break-after: avoid;
}

.tpl-ivy .summary-text {
  font-size: 10.5px;
  line-height: 1.55;
  margin: 0;
  text-align: justify;
}

/* Experience & Education Item Hierarchy */
.tpl-ivy .entry-item {
  margin-bottom: 12px;
  break-inside: auto;
  page-break-inside: auto;
}

/* Company / Institution Line */
.tpl-ivy .entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11.5px;
  margin-bottom: 4px; /* Space between Company and Designation */
  break-inside: avoid;
  page-break-inside: avoid;
  break-after: avoid;
  page-break-after: avoid;
}

.tpl-ivy .entry-title-left {
  font-weight: 700;
}

.tpl-ivy .entry-meta-right {
  font-weight: 700;
  white-space: nowrap;
}

/* Role / Degree Sub-Header Line */
.tpl-ivy .entry-sub-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10.5px;
  font-style: italic;
  margin-bottom: 6px; /* Space before bullets */
  break-inside: avoid;
  page-break-inside: avoid;
  break-after: avoid;
  page-break-after: avoid;
}

/* Description & Bullet Spacing */
.tpl-ivy .entry-description {
  font-size: 10.5px;
  line-height: 1.55;
  margin-top: 4px;
  white-space: pre-line;
}

.tpl-ivy .entry-description ul {
  margin: 3px 0 0 16px;
  padding: 0;
}

.tpl-ivy .entry-description li {
  margin-bottom: 3px;
  line-height: 1.55;
}

/* Skills */
.tpl-ivy .skills-list {
  font-size: 10.5px;
  line-height: 1.6;
}

.tpl-ivy .skill-item {
  display: inline;
}

.tpl-ivy .skill-item:not(:last-child)::after {
  content: ", ";
}

/* Screen Preview Container Bounds */
#ivyPreview {
  width: 210mm;
  min-height: 297mm;
  box-sizing: border-box;
  background-color: #ffffff !important;
  color: #000000 !important;
  padding: 14mm 16mm;
  margin: 0 auto;
}

/* Print Standard Overrides */
@media print {
  body {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.print-ivy #template-classic,
  body.print-ivy #template-modern,
  body.print-ivy #template-executive,
  body.print-ivy #template-tech,
  body.print-ivy #template-creative {
    display: none !important;
  }

  body.print-classic #template-ivy,
  body.print-sidebar #template-ivy,
  body.print-executive #template-ivy,
  body.print-tech #template-ivy,
  body.print-creative #template-ivy {
    display: none !important;
  }

  body.print-ivy #template-ivy {
    display: block !important;
    width: 100% !important;
  }

  body.print-ivy {
    margin: 0 !important;
    padding: 0 !important;
    background-color: #ffffff !important;
  }

  body.print-ivy #ivyPreview {
    padding: 0 !important;
    width: 100% !important;
    box-shadow: none !important;
  }

  body.print-ivy .print-layout-table {
    width: 100% !important;
    border-collapse: collapse !important;
    height: auto !important;
  }

  body.print-ivy thead { display: table-header-group !important; }
  body.print-ivy tfoot { display: table-footer-group !important; }

  body.print-ivy .print-page-spacer-top {
    display: table-cell !important;
    height: 12mm !important;
    padding: 0 !important;
  }

  body.print-ivy .print-page-spacer-bottom {
    display: table-cell !important;
    height: 12mm !important;
    padding: 0 !important;
  }

  body.print-ivy .print-layout-table tbody,
  body.print-ivy .print-layout-table tr,
  body.print-ivy .print-layout-table td {
    border: none !important;
    page-break-inside: auto !important;
    break-inside: auto !important;
  }

  .tpl-ivy {
    width: 100% !important;
    background: transparent !important;
  }
}
