/* SCU — Frontend Forms */

.scu-form-container {
  max-width: 720px; /* Я також зменшив ширину для кращого вигляду форм */
  margin: 2rem auto; /* Цей рядок центрує блок по горизонталі */
  padding: 1.5rem;
  background: #f1f1f1;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,.05);
}

.page-template-page-scu-form .scu-form-container h1,
.page-template-page-scu-form .scu-form-container h2,
.page-template-page-scu-form .scu-form-container h3 {
  margin-top: 0;
}

.page-template-page-scu-form .scu-alert,
.page-template-page-scu-form .scu-notice {
  margin: 1rem 0 1.25rem;
  padding: .9rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.35;
}
.page-template-page-scu-form .scu-alert {
  background: #fff5f5;
  border: 1px solid #ffd2d2;
}
.page-template-page-scu-form .scu-notice {
  background: #f4fff5;
  border: 1px solid #cfead4;
}

.page-template-page-scu-form .acf-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 720px) {
  .page-template-page-scu-form .acf-fields {
    grid-template-columns: 1fr 1fr;
  }
  .page-template-page-scu-form .acf-field.acf-field-wysiwyg,
  .page-template-page-scu-form .acf-field.acf-field-gallery,
  .page-template-page-scu-form .acf-field.acf-field-repeater,
  .page-template-page-scu-form .acf-field[data-width="100"] {
    grid-column: 1 / -1;
  }
}

.page-template-page-scu-form .acf-field {
  background: #fafafa;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  padding: 12px 14px;
}

.page-template-page-scu-form .acf-field .acf-label label {
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: .35rem;
  display: inline-block;
}

.page-template-page-scu-form .acf-field .description {
  color: #666;
  font-size: .85rem;
}

.page-template-page-scu-form .acf-input input[type="text"],
.page-template-page-scu-form .acf-input input[type="number"],
.page-template-page-scu-form .acf-input input[type="url"],
.page-template-page-scu-form .acf-input input[type="email"],
.page-template-page-scu-form .acf-input input[type="date"],
.page-template-page-scu-form .acf-input input[type="datetime-local"],
.page-template-page-scu-form .acf-input select,
.page-template-page-scu-form .acf-input textarea {
  width: 100%;
  padding: .7rem .8rem;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 10px;
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.page-template-page-scu-form .acf-input input:focus,
.page-template-page-scu-form .acf-input select:focus,
.page-template-page-scu-form .acf-input textarea:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13,110,253,.12);
}

.page-template-page-scu-form .acf-form-submit {
  grid-column: 1 / -1;
  margin-top: .75rem;
  display: flex;
  gap: 12px;
  align-items: center;
}

.page-template-page-scu-form .acf-form-submit input[type="submit"] {
  appearance: none;
  border: none;
  background: #0d6efd;
  color: #fff;
  padding: .8rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .05s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 0 6px 16px rgba(13,110,253,.25);
}
.page-template-page-scu-form .acf-form-submit input[type="submit"]:hover {
  transform: translateY(-1px);
}
.page-template-page-scu-form .acf-form-submit input[type="submit"]:active {
  transform: translateY(0);
}

.page-template-page-scu-form .acf-field.required > .acf-label label:after {
  content: " *";
  color: #dc3545;
  font-weight: 700;
}

.page-template-page-scu-form .acf-error-message {
  background: #fff2f2;
  border: 1px solid #f3c0c0;
  color: #8a1f1f;
  padding: .5rem .7rem;
  border-radius: 8px;
  margin-top: .5rem;
  font-size: .85rem;
}

.page-template-page-scu-form .acf-spinner {
  margin-left: 10px;
}

/* Compact tweaks for media fields */
.page-template-page-scu-form .acf-image-uploader .acf-button,
.page-template-page-scu-form .acf-gallery .acf-hl .acf-button {
  border-radius: 10px;
}
/* --- Compact ACF Media Buttons --- */

/* Стилізуємо кнопки всередині полів "Зображення" та "Галерея" */
.scu-form .acf-image-uploader .acf-button,
.scu-form .acf-gallery .acf-button {
    font-size: 13px;      /* Зменшуємо розмір шрифту */
    padding: 6px 12px;    /* Зменшуємо внутрішні відступи */
    height: auto;         /* Дозволяємо висоті бути автоматичною */
    line-height: 1.5;
}
/* Повна ширина: Заголовок (core post_title) + Обкладинка (ACF) */
.page-template-page-scu-form .acf-field[data-name="post_title"],
.page-template-page-scu-form .acf-field[data-key="field_log_cover"]{
  grid-column: 1 / -1 !important; /* якщо форма на grid — розтягнутись на всі колонки */
  width: 100% !important;          /* якщо форма на flex — зайняти весь рядок */
  max-width: none !important;
  flex: 0 0 100% !important;
}
/* Подія: обкладинка full-width, один елемент у рядку */
.page-template-page-scu-form .acf-field[data-key="field_event_cover"]{
  grid-column: 1 / -1 !important; /* якщо сітка — тягнемось на всі колонки */
  width: 100% !important;          /* якщо flex — займаємо 100% ширини */
  max-width: none !important;
  flex: 0 0 100% !important;
}

/* щоб аплоадер реально розтягувався */
.page-template-page-scu-form .acf-field[data-key="field_event_cover"] .acf-image-uploader{
  width: 100%;
}

/* опційно: щоб аплоадер справді розтягувався */
.page-template-page-scu-form .acf-field[data-key="field_log_cover"] .acf-image-uploader{
  width: 100%;
}

/* Стилізуємо іконки-хрестики для видалення */
.scu-form .acf-gallery .acf-gallery-attachment .acf-icon.-cancel {
    width: 24px;
    height: 24px;
    font-size: 14px;
}
