/* Write page form - BEM methodology with design from post_form_design */

/* Box sizing for the form */
.sbr2-form .sbr2-form--write *, 
.sbr2-form .sbr2-form--write *::before, 
.sbr2-form .sbr2-form--write *::after { 
  box-sizing: border-box; 
}

/* Main form container */
.sbr2-form .sbr2-form--write {
  padding: 60px 15px;
  margin: 0 auto;
  max-width: 1700px;
}

/* Error message */
.sbr2-form .sbr2-error {
  background: #fef2f2;
  color: #dc2626;
  padding: 12px 16px;
  border-radius: 5px;
  margin-bottom: 20px;
  border: 1px solid #fecaca;
}

/* Fields container */
.sbr2-form .sbr2-form__fields {
  border-top: 3px solid #929292;
  border-bottom: 3px solid #FBFBFB;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Individual field */
.sbr2-form .sbr2-form__field {
  display: flex;
  align-items: center;
  border-bottom: 2px solid #F0F0F0;
  height: 85px;
  margin: 0;
  padding: 0;
}

/* Content field - taller */
.sbr2-form .sbr2-form__field--content {
  height: 410px;
}

/* File field - medium height */
.sbr2-form .sbr2-form__field--file {
  min-height: 150px;
  height: auto;
  /* Make children stretch to the row height so the label can match container height */
  align-items: stretch;
}
.sbr2-form .sbr2-form__field--file .sbr2-form__label {
  /* Ensure the label can stretch via flex instead of fixed height */
  height: auto;
}

/* Field label */
.sbr2-form .sbr2-form__label {
  width: 180px;
  background: #F4F7F9;
  padding: 0 20px;
  height: 100%;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 3px;
  color: #333;
  font-weight: 500;
  margin: 0;
}

/* Required asterisk */
.sbr2-form .sbr2-form__required {
  display: block;
  color: #ec2e41;
  font-size: 16px;
  margin-top: 6px;
}

/* Input wrapper */
.sbr2-form .sbr2-form__input-wrap {
  padding: 0 20px;
  width: calc(100% - 180px);
}

/* Regular text inputs */
.sbr2-form .sbr2-form__input {
  padding: 15px;
  border: 1px solid #E6E6E6;
  border-radius: 5px;
  width: 60%;
  font-size: 16px;
}

.sbr2-form .sbr2-form__input:focus {
  outline: none;
  border-color: #3871CC;
}

.sbr2-form .sbr2-form__input::placeholder {
  font-size: 16px;
  color: #999;
}

/* Writer name display */
.sbr2-form .sbr2-form__writer-name {
  font-size: 16px;
  margin: 0;
  color: #333;
}

/* (removed) password help text styles */

/* Content textarea (fallback when no WP editor) */
.sbr2-form .sbr2-form__textarea {
  width: 100%;
  resize: none;
  height: 300px;
  border: 1px solid #E6E6E6;
  border-radius: 5px;
  padding: 15px;
  font-size: 16px;
}

.sbr2-form .sbr2-form__textarea::placeholder {
  font-size: 16px;
  color: #999;
}

.sbr2-form .sbr2-form__textarea:focus {
  outline: none;
  border-color: #3871CC;
}

/* File upload section */
.sbr2-form .sbr2-form__input-wrap--file {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

/* Hide actual file input */
.sbr2-form .sbr2-form__file-input {
  position: absolute;
  width: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
}

/* File button style */
.sbr2-form .sbr2-form__file-button {
  display: block;
  width: 60%;
  max-width: 300px;
  border: 1px solid #E6E6E6;
  border-radius: 5px;
  cursor: pointer;
  padding: 12px 12px;
  font-size: 14px;
  background: white;
  transition: all 0.3s ease;
  text-align: center;
}

.sbr2-form .sbr2-form__file-button:hover {
  background: #f8f9fa;
  border-color: #3871CC;
}

/* Selected file names display */
.sbr2-form .sbr2-form__file-names {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sbr2-form .sbr2-form__file-names span {
  font-size: 14px;
  color: #666;
  padding: 5px 10px;
  background: #f8f9fa;
  border-radius: 3px;
  display: inline-block;
  max-width: fit-content;
}

/* Remove button for each file chip */
.sbr2-form .sbr2-form__file-names .sbr2-file-remove {
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  margin-left: 8px;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
.sbr2-form .sbr2-form__file-names .sbr2-file-remove:hover {
  color: #dc2626;
}

/* File info text */
.sbr2-form .sbr2-form__file-info {
  font-size: 16px;
  color: #5ba3c2;
}

/* Buttons container */
.sbr2-form .sbr2-form__buttons {
  display: flex;
  justify-content: flex-end;
  padding-top: 60px;
  gap: 10px;
}

/* Button styles */
.sbr2-form .sbr2-form__button {
  font-size: 17px;
  text-align: center;
  display: block;
  padding: 18px 10px;
  width: 150px;
  border-radius: 5px;
  font-weight: 500;
  transition: .3s ease-in-out;
  text-decoration: none;
  cursor: pointer;
  border: none;
}

.sbr2-form .sbr2-form__button:hover {
  box-shadow: rgba(0, 0, 0, 0.15) 0px 1px 10px 0px;
}

/* Cancel button */
.sbr2-form .sbr2-form__button--cancel {
  border: 1px solid #D8D8D8;
  background: white;
  color: #333;
}

/* Submit button */
.sbr2-form .sbr2-form__button--submit {
  border: 1px solid #3871CC;
  background: #3871CC;
  color: #fff;
}

/* WordPress Editor specific styles - minimal to respect WP defaults */
.sbr2-form .sbr2-form__input-wrap--content .wp-editor-wrap {
  width: 100%;
}

/* Responsive styles */
@media all and (max-width: 1158px) {
  /* removed password field-specific tweaks */
  
  .sbr2-form .sbr2-form__input {
    width: 100%;
  }
  
  .sbr2-form .sbr2-form__file-button {
    width: 100%;
    max-width: none;
  }
}

@media all and (max-width: 768px) {
  .sbr2-form .sbr2-form__field {
    flex-direction: column;
    height: auto;
    min-height: 100px;
  }
  
  .sbr2-form .sbr2-form__field--content {
    height: auto;
    min-height: 400px;
  }
  
  .sbr2-form .sbr2-form__field--file {
    height: auto;
    min-height: 180px;
  }
  /* Keep label fixed height on mobile, even for file field */
  .sbr2-form .sbr2-form__field--file .sbr2-form__label {
    height: 50px;
  }
  
  .sbr2-form .sbr2-form__label {
    width: 100%;
    height: 50px;
    padding: 0 15px;
  }
  
  .sbr2-form .sbr2-form__input-wrap {
    width: 100%;
    padding: 15px;
  }
  
  .sbr2-form .sbr2-form__buttons {
    padding-top: 30px;
    justify-content: center;
  }
  
  .sbr2-form .sbr2-form__button {
    width: 120px;
    padding: 15px 10px;
    font-size: 15px;
  }
}
