body {
  box-sizing: unset !important; /* or initial */
}

#edit-post-title{
  font-size: 2rem;
  color: #0d47a1;
  font-weight: bold;
  margin-top: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.post-container-create {
  max-width: 1200px;
  width: 95%;
  margin: 2rem auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  padding: 1rem;
  overflow-x: hidden;
}
.post-container-create, 
.post-container-create *, 
.post-container-create *::before, 
.post-container-create *::after {
  box-sizing: content-box; /* or initial */
}
.post-layout-flex-create {
  display: flex;
  flex-wrap: wrap;
}

.post-layout-flex-create > * {
  min-width: 0; /* 👈 THIS is crucial to prevent overflow */
  flex-shrink: 1;
}

.post-image-create {
  flex: 1;
  min-width: 50%;
}

.post-image-create img {
  max-width: 100%;
  max-height: 500px;
  width: auto;
  border-radius: 6px;
}

#post_image {
  width: 100%;
  display: block;
  border-radius: 6px;
  position: relative;
  z-index: 1;
}

.image-preview-wrapper {
  position: relative;
  display: inline-block;
}

/* Spinner overlay */
.image-spinner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255,255,255,0.7);
  align-items: center;
  justify-content: center;
  display: none;
  border-radius: 6px;
  z-index: 5;
}

/* Spinner itself */
.spinner {
  width: 40px;
  height: 40px;
  border: 5px solid #ccc;
  border-top-color: #0d47a1;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Progress bar */
#upload-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background-color: rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: none;
  z-index: 6;
}

#upload-progress-bar .bar {
  height: 100%;
  width: 0%;
  background-color: #0d47a1;
  transition: width 0.2s ease;
}

.image-spinner {
  z-index: 1000;
}
#upload-progress-bar {
  z-index: 1001;
}

.post-content-create {
  flex: 2;
  min-width: 300px;
}

.post-title-create {
  font-size: 2rem;
  color: #0d47a1;
  font-weight: bold;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.post-form-group {
  border: 1px solid #ccc;
  padding: 1rem;
  border-radius: 8px;
  background-color: #f9f9f9;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.post-description-create {
  font-size: 1rem;
  color: #333;
  line-height: 1.6;
  /*! margin-bottom: 1rem; */
   display: flex;
  flex-direction: column;
}

.description-label {
  margin-bottom: 0.4rem;
  font-weight: bold;
}

textarea#description {
  min-height: 80px;
  resize: vertical;
  padding: 0.6rem;
  font-size: 1rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-family: inherit;
}

.post-categories-create {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}


.post-categories-create a {
  color: #0d47a1;
  margin-right: 0.4rem;
  text-decoration: none;
}
.post-categories-create a:hover {
  text-decoration: underline;
}

#cats {
    list-style: none;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0;
}

#cats li {
    color: #0d47a1;
    background: #e0ecff;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    text-decoration: none;
}

#cats li:hover {
    background: #c0dafc;
}
.autocomplete {
  position: relative;
  display: inline-block;
  margin-bottom: 3rem;
  gap: 0.5rem;
  width: 100%;
}

input {
  border: 1px solid transparent;
  background-color: #f1f1f1;
  padding: 10px;
  font-size: 16px;
}

input[type=text] {
  background-color: #f1f1f1;
  width: 80%;
  margin-right: 1rem;
}

.autocomplete input[type="text"] {
  flex: 1;
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  background-color: #f1f1f1;
}

.autocomplete button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 4px;
  border: none;
  background-color: #0d47a1;
  color: white;
  cursor: pointer;
  white-space: nowrap;
}

.autocomplete button:hover {
  background-color: #08367a;
}

input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem; /* Optional, modern browser support */
}

input[type=submit] {
  background-color: DodgerBlue;
  color: #fff;
  cursor: pointer;
}

.autocomplete-items {
  position: absolute;
  border: 1px solid #d4d4d4;
  border-bottom: none;
  border-top: none;
  z-index: 99;
  /*position the autocomplete items to be the same width as the container:*/
  top: 100%;
  left: 0;
  right: 0;
}

.autocomplete-items div {
  padding: 10px;
  cursor: pointer;
  background-color: #fff; 
  border-bottom: 1px solid #d4d4d4; 
}

/*when hovering an item:*/
.autocomplete-items div:hover {
  background-color: #e9e9e9; 
}

/*when navigating through the items using the arrow keys:*/
.autocomplete-active {
  background-color: DodgerBlue !important; 
  color: #ffffff; 
}