/* ===== Resume page: floating "download PDF" button + print layout ===== */
.resume-pdf-btn {
  position: fixed;
  left: 20px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 99999;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #0c1f38;
  color: #fff;
  font: inherit;
  font-size: .9375rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 14px 30px -12px rgba(12, 31, 56, .6);
  transition: transform .25s ease, background-color .2s ease, color .2s ease, padding .25s ease, opacity .2s ease;
  direction: rtl;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.resume-pdf-btn:focus-visible {
  background: #ffc31d;
  color: #0c1f38;
}
@media (hover: hover) {
  .resume-pdf-btn:hover {
    background: #ffc31d;
    color: #0c1f38;
    transform: translateY(-3px);
  }
}
.resume-pdf-btn:focus-visible { outline: 3px solid #0c1f38; outline-offset: 3px; }
.resume-pdf-btn svg { width: 20px; height: 20px; flex: none; }
.resume-pdf-btn__label {
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width .25s ease, opacity .2s ease;
}
/* after scrolling, the button shrinks to just the icon */
.resume-pdf-btn.is-compact { padding: 0 16px; gap: 0; }
.resume-pdf-btn.is-compact .resume-pdf-btn__label { max-width: 0; opacity: 0; }
.resume-pdf-btn.is-compact:focus-visible .resume-pdf-btn__label { max-width: 160px; opacity: 1; }
.resume-pdf-btn.is-compact:focus-visible { padding: 0 20px; gap: 10px; }
@media (hover: hover) {
  .resume-pdf-btn.is-compact:hover .resume-pdf-btn__label { max-width: 160px; opacity: 1; }
  .resume-pdf-btn.is-compact:hover { padding: 0 20px; gap: 10px; }
}
/* while the PDF is being built the label is always shown */
.resume-pdf-btn.is-working { padding: 0 20px; gap: 10px; }
.resume-pdf-btn.is-working .resume-pdf-btn__label { max-width: 220px; opacity: 1; }
.resume-pdf-btn.is-busy { opacity: .75; pointer-events: none; }

@media (max-width: 480px) {
  .resume-pdf-btn { left: 14px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .resume-pdf-btn, .resume-pdf-btn__label { transition: none; }
}

/* ===== Print (applies only while the button is generating the PDF) ===== */
@media print {
  @page { size: A4 landscape; margin: 8mm; }

  html.resume-printing,
  html.resume-printing body {
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  html.resume-printing * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* site chrome that doesn't belong in the resume */
  html.resume-printing #wpadminbar,
  html.resume-printing body > header,
  html.resume-printing body > footer,
  html.resume-printing #masthead,
  html.resume-printing #colophon,
  html.resume-printing #site-header,
  html.resume-printing #site-footer,
  html.resume-printing .site-header,
  html.resume-printing .site-footer,
  html.resume-printing .elementor-location-header,
  html.resume-printing .elementor-location-footer,
  html.resume-printing [data-elementor-type="header"],
  html.resume-printing [data-elementor-type="footer"],
  html.resume-printing .resume-pdf-btn,
  html.resume-printing .resume-projects__tabs,
  html.resume-printing .resume-projects__empty {
    display: none !important;
  }

  /* reveal-on-scroll content must be visible in the PDF */
  html.resume-printing .elementor-invisible {
    visibility: visible !important;
    opacity: 1 !important;
    animation: none !important;
  }
  html.resume-printing * {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition: none !important;
  }

  /* decorative corner marks: keep them on the live site, hide only in this export */
  html.resume-printing .resume-row::after,
  html.resume-printing .resume-row__media::before { display: none !important; }

  /* fixed floating widgets (contact bubble etc.) flagged by the script */
  html.resume-printing [data-resume-hide] { display: none !important; }

  /* always print the desktop row layout: text right, photo left, fixed height */
  html.resume-printing .resume-row {
    display: block !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  html.resume-printing .resume-row__link {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr) !important;
    min-height: 240px !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  html.resume-printing .resume-projects__inner .resume-row__body { order: 0 !important; }
  html.resume-printing .resume-projects__inner .resume-row__media {
    order: 1 !important;
    aspect-ratio: auto !important;
    min-height: 0 !important;
  }

  /* show every project row, never split one across pages */
  html.resume-printing .resume-row.is-hidden { display: block !important; }
  html.resume-printing .resume-row { break-inside: avoid; page-break-inside: avoid; }
  html.resume-printing .resume-row__link {
    transform: none !important;
    box-shadow: none !important;
  }
  html.resume-printing .resume-row__link:hover .resume-row__media img { transform: none !important; }
}
