/* 🎯 Style ONLY the Gutenberg PDF viewer <object> *//* 🎯 Style the Gutenberg PDF viewer <object> */
.wp-block-file__embed[type="application/pdf"],
object.wp-block-file__embed[data-wp-bind--hidden="!state.hasPdfPreview"][type="application/pdf"] {
  border: 1px solid #ccc !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  width: 100% !important;
  height: 600px !important; /* Taller for better viewing */
}

/* 📦 Set fixed width for the file block container (optional, layout-specific) */
.wp-block-file:has(.wp-block-file__embed[type="application/pdf"]),
.wp-block-file:has(object[data-wp-bind--hidden="!state.hasPdfPreview"]) {
  width: 500px !important;
  height: auto !important; /* let the content inside define height */
  text-align: center !important; /* Center the text */
}

/* 🔘 Style the download button - targeting both the button and the text link */
.wp-block-file a.wp-block-file__button,
.wp-block-file a.wp-element-button {
  color: var(--wp--preset--color--ar-color-primary-04) !important;
  font-family: var(--wp--preset--font-family--ar-general-sans) !important;
  padding: 4px 12px !important;
  background-color: var(--wp--preset--color--ar-color-neutral-00) !important;
  border: 2px solid var(--wp--preset--color--ar-color-primary-04) !important;
  border-radius: 3px !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
  font-size: small !important;
  text-align: center !important;
  display: inline-block !important;
  margin-top: 10px !important;
}

/* Style the PDF file link separately */
.wp-block-file a:not(.wp-block-file__button):not(.wp-element-button) {
  display: block !important;
  text-align: center !important;
  margin-top: 10px !important;
  font-family: var(--wp--preset--font-family--ar-general-sans) !important;
  color: var(--wp--preset--color--ar-color-primary-04) !important;
}

/* 🔘 Hover effect for the button */
.wp-block-file a.wp-block-file__button:hover,
.wp-block-file a.wp-element-button:hover {
  color: var(--wp--preset--color--ar-color-neutral-00) !important;
  background-color: var(--wp--preset--color--ar-color-primary-04) !important;
  border-color: var(--wp--preset--color--ar-color-primary-04) !important;
}

/* Responsive adjustments */
@media (max-width: 1150px) {
  .wp-block-file:has(.wp-block-file__embed[type="application/pdf"]),
  .wp-block-file:has(object[data-wp-bind--hidden="!state.hasPdfPreview"]) {
    width: 100% !important; /* Full width on smaller screens */
    height: auto !important;
  }
  
  .wp-block-file__embed[type="application/pdf"],
  object.wp-block-file__embed[data-wp-bind--hidden="!state.hasPdfPreview"][type="application/pdf"] {
    height: 400px !important; /* Slightly smaller height on mobile */
  }
  
  .wp-block-file a.wp-block-file__button,
  .wp-block-file a.wp-element-button,
  .wp-block-file a:not(.wp-block-file__button):not(.wp-element-button) {
    display: block !important;
    width: 80% !important;
    margin: 10px auto !important;
    text-align: center !important;
  }
}

object.wp-block-file__embed[data-wp-bind--hidden="!state.hasPdfPreview"][type="application/pdf"] {
  width: 100% !important;
  height: 600px !important;
  border: 1px solid #ccc !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Responsive adjustments */
@media (max-width: 1150px) {
  object.wp-block-file__embed[data-wp-bind--hidden="!state.hasPdfPreview"][type="application/pdf"] {
    height: 400px !important; /* Smaller height on mobile */
  }
}