/* Isolated Template 5: Creative Minimalist - Complete Layout & Spacing */
/* ==========================================================================
   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-creative {
  --primary-accent: #d94680;
  --text-dark: #111827;
  --text-muted: #4b5563;
  --bg-light: #ffffff;
  --border-light: #fce7f3;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-dark);
  line-height: 1.5;
  background: #ffffff;
  width: 100%;
  box-sizing: border-box;
}

/* =========================================================
   HERO ROW: Photo (Left) + Centered Candidate Info (Right)
   ========================================================= */
.tpl-creative .creative-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.tpl-creative .hero-left {
  width: 32%;
  flex-shrink: 0;
}

.tpl-creative .hero-right {
  width: 64%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tpl-creative .photo-container {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 4px;
  background: #fdf2f8;
}

.tpl-creative .photo-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tpl-creative.no-photo .creative-hero {
  align-items: flex-start;
  margin-bottom: 16px;
}

.tpl-creative.no-photo .hero-left {
  display: none;
}

.tpl-creative.no-photo .hero-right {
  width: 100%;
}

.tpl-creative .role-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--primary-accent);
  margin-bottom: 6px;
}

.tpl-creative .candidate-name {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 400;
  color: var(--primary-accent);
  margin: 0;
}

/* =========================================================
   BODY ROW: Baseline Alignment System
   ========================================================= */
.tpl-creative .creative-body {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.tpl-creative .creative-sidebar {
  width: 32%;
  box-sizing: border-box;
}

.tpl-creative .creative-main {
  width: 64%;
  box-sizing: border-box;
}

.tpl-creative .section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--primary-accent);
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 4px;
}

/* Sidebar Components */
.tpl-creative .sidebar-section {
  margin-bottom: 22px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.tpl-creative .contact-block {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.65;
  word-break: break-word;
}

.tpl-creative .contact-block div {
  margin-bottom: 4px;
}

/* Objective / Summary */
.tpl-creative .objective-section {
  margin-bottom: 22px;
}

.tpl-creative .summary-text {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  text-align: justify;
}

/* Experience Hierarchy Spacing Fix */
.tpl-creative .main-section {
  margin-bottom: 20px;
}

.tpl-creative .entry-item {
  margin-bottom: 18px;
  break-inside: auto;
  page-break-inside: auto;
}

.tpl-creative .entry-header {
  margin-bottom: 8px;
  break-inside: avoid;
  page-break-inside: avoid;
  break-after: avoid;
  page-break-after: avoid;
}

/* Clear gap between designation and company */
.tpl-creative .entry-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}

.tpl-creative .entry-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.4;
}

/* Relaxed readable text lines */
.tpl-creative .entry-description {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-top: 6px;
  word-break: break-word;
  white-space: pre-line;
}

.tpl-creative .entry-description p,
.tpl-creative .entry-description div {
  margin-bottom: 6px;
}

.tpl-creative .entry-description ul {
  margin: 6px 0 0 16px;
  padding: 0;
}

.tpl-creative .entry-description li {
  margin-bottom: 4px;
  line-height: 1.6;
}

/* Skills Badges */
.tpl-creative .skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tpl-creative .skill-badge {
  font-size: 10.5px;
  background: #fdf2f8;
  color: var(--text-dark);
  padding: 4px 8px;
  border-radius: 3px;
  border-left: 2px solid var(--primary-accent);
  font-weight: 500;
}

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

#creativePreview .photo-container {
  width: 100% !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  aspect-ratio: 4 / 5 !important;
  overflow: hidden !important;
  border-radius: 4px !important;
  border: none !important;
  background: #fdf2f8 !important;
  margin: 0 !important;
}

#creativePreview .photo-container.is-hidden {
  display: none !important;
}

/* =========================================================
   PRINT ENGINE STABILITY
   ========================================================= */
@media print {
  body {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

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

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

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

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

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

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

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

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

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

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

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

  .tpl-creative .creative-hero {
    display: flex !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .tpl-creative .creative-body {
    display: block !important;
  }

  .tpl-creative .creative-sidebar {
    float: left !important;
    width: 32% !important;
  }

  .tpl-creative .creative-main {
    float: right !important;
    width: 64% !important;
  }

  .tpl-creative .creative-body::after {
    content: "";
    display: table;
    clear: both;
  }
}
