/*
Theme Name: Medical Japan
Theme URI: https://wordpress.org/themes/medical-japan/
Author: the WordPress team
Author URI: https://wordpress.org
Version: 1.0
*/

/* === ユーザー側 === */
body {
  font-family: "Inter", sans-serif;
}

.overview-arrow-shape {
  clip-path: polygon(0 0, 92% 0, 100% 50%, 92% 100%, 0 100%, 8% 50%);
}

.required::after {
  content: " *";
  color: #ef4444;
  font-weight: 700;
}

.wp-login-logo {
  display: none;
}

.cf7-buttons-wrap {
  position: relative;
}

.cf7-buttons-wrap .wpcf7-spinner {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
}

.wpcf7-list-item.first {
  margin: 0;
}

.wpcf7-form-control:has(.wpcf7-list-item) {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.wpcf7-list-item {
  margin: 0 !important;
}

.wysiwyg h1 {
  font-weight: 700;
  font-size: 1.875rem;
  line-height: 2.25rem;
  line-height: 2rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.wysiwyg h2 {
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 2rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.wysiwyg h3 {
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.75rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.wysiwyg h4,
.wysiwyg h5,
.wysiwyg h6 {
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.wysiwyg p {
  margin-bottom: 1rem;
}

.wysiwyg ul {
  padding-left: 1.25rem;
  list-style-type: disc;
  margin-bottom: 1rem;
}

.wysiwyg ol {
  padding-left: 1.25rem;
  list-style-type: decimal;
  margin-bottom: 1rem;
}

.wysiwyg ul li + li,
.wysiwyg ol li + li {
  margin-top: 8px;
}

.wysiwyg a {
  text-decoration: underline;
  overflow-wrap: anywhere;
}
.wysiwyg img {
  --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
  box-shadow:
    var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000),
    var(--tw-shadow);
  border-radius: 0.5rem;
}

/*
 * CF7 確認画面（Norick Confirm）
 * .wpcf7c-conf は確認時のみ付与。is-cf7-confirm は JS が同期する。
 * autofill / プラグイン既定スタイルは #f7f7f8（bg-brand-panel）で上書きする。
 * checkbox / radio は appearance リセット対象外（ネイティブ表示を維持）。
 */
.wpcf7
  .wpcf7-form:is(.is-cf7-confirm, :has(.wpcf7c-conf))
  .wpcf7c-conf:is(
    input:not([type="hidden"]):not([type="submit"]):not([type="button"]):not(
        [type="checkbox"]
      ):not([type="radio"]),
    select,
    textarea
  ) {
  border: none !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  -webkit-box-shadow: 0 0 0 1000px #f7f7f8 inset !important;
  -webkit-appearance: none;
  appearance: none;
}

.wpcf7 .wpcf7-form:is(.is-cf7-confirm, :has(.wpcf7c-conf)) .wpcf7c-conf div {
  background-color: transparent !important;
  border: none !important;
}

.wpcf7
  .wpcf7-form:is(.is-cf7-confirm, :has(.wpcf7c-conf))
  .wpcf7c-conf:is(:autofill, :-webkit-autofill, :-internal-autofill-selected),
.wpcf7
  .wpcf7-form:is(.is-cf7-confirm, :has(.wpcf7c-conf))
  .wpcf7c-conf:is(
    :autofill,
    :-webkit-autofill,
    :-internal-autofill-selected
  ):hover,
.wpcf7
  .wpcf7-form:is(.is-cf7-confirm, :has(.wpcf7c-conf))
  .wpcf7c-conf:is(
    :autofill,
    :-webkit-autofill,
    :-internal-autofill-selected
  ):focus,
.wpcf7
  .wpcf7-form:is(.is-cf7-confirm, :has(.wpcf7c-conf))
  .wpcf7c-conf:is(
    :autofill,
    :-webkit-autofill,
    :-internal-autofill-selected
  ):active {
  -webkit-box-shadow: 0 0 0 1000px #f7f7f8 inset !important;
  box-shadow: 0 0 0 1000px #f7f7f8 inset !important;
  background-color: transparent !important;
  -webkit-text-fill-color: #1e293b !important;
  caret-color: #1e293b;
  transition: background-color 99999s ease-out;
}

.wpcf7-form:is(.is-cf7-confirm, :has(.wpcf7c-conf)) .cf7-policy {
  display: none;
}

.wpcf7-form:is(.is-cf7-confirm, :has(.wpcf7c-conf))
  .relative
  > .pointer-events-none {
  display: none;
}

/* === 管理側 === */

/* author の投稿確認モード */
body.mj-admin-role-author.edit-php .wp-list-table .locked-info,
body.mj-admin-role-author.edit-php .wp-list-table .locked-indicator {
  display: none !important;
}

body.mj-admin-role-author.post-php #publish:disabled,
body.mj-admin-role-author.post-php #save-post:disabled {
  cursor: not-allowed !important;
  opacity: 0.5;
}

.u-opacity-50 {
  opacity: 0.5;
}

.u-pointer-events-none {
  pointer-events: none;
}

.u-cursor-not-allowed {
  cursor: not-allowed;
}

.acf-row .acf-icon.-plus {
  display: none !important;
}

/*
 * disabled 入力を直接持つ .acf-field だけ薄くする。
 * 入れ子の祖先 .acf-field には付けないので透明度が重ならない。
 * 一部だけ disabled のフィールド（有効な入力が残る場合）は対象外。
 */
.acf-field:not(:has(.acf-field)):has(
    :is(input, select, textarea):disabled,
    select.disabled
  ):not(:has(:is(input:not([type="hidden"]), select, textarea):enabled)) {
  opacity: 0.5;
  pointer-events: none;

  :is(input, select, textarea):disabled,
  select.disabled {
    opacity: 1;
    border-color: #ccc;
    box-shadow: none;
    color: #949494;
  }
}

body.mj-admin-role-author.post-type-medical
  [data-name="manager_user"]
  .select2-selection {
  pointer-events: none;
  background: #f0f0f0;
}

body:is(.post-type-contact, .mj-admin-role-author) .page-title-action,
body.post-type-medical #prefectures-0,
body.mj-admin-role-restricted
  :is(
    #update-nag,
    .update-nag,
    .update-message,
    #dashboard_php_nag,
    #dashboard_browser_nag,
    #wp-admin-bar-updates,
    .update-plugins
  ),
body.mj-admin-role-author
  :is(
    #delete-action,
    #minor-publishing,
    #misc-publishing-actions,
    .editor-post-status,
    .editor-post-trash
  ) {
  display: none !important;
}

/* クラシックエディター: 公開メタボックスの「公開範囲」 */
body:is(.post-type-post, .post-type-medical) #visibility {
  display: none !important;
}

/* クラシックエディター: AIOSEO「修正日を更新しない」（公開メタボックス） */
body:is(.post-type-post, .post-type-medical)
  .misc-pub-section:has(#aioseo-limit-modified-date) {
  display: none !important;
}

body:is(.post-type-post, .post-type-medical)
  #post-body.columns-2
  #postbox-container-1 {
  float: right;
}

body:is(.post-type-post, .post-type-medical) #postimagediv .inside {
  padding-top: 8px;
}

body:is(.post-type-post, .post-type-medical) #postimagediv img {
  max-width: 100%;
  height: auto;
}

body:is(.post-type-post, .post-type-medical) #post-body-content {
  margin-bottom: 20px;
}

body:is(.post-type-post, .post-type-medical) .acf-postbox {
  margin-top: 0;
}

/* author プロフィール画面（profile.php） */
/* 名前 */
body.mj-admin-role-author.profile-php .user-user-login-wrap,
body.mj-admin-role-author.profile-php .user-first-name-wrap,
body.mj-admin-role-author.profile-php .user-last-name-wrap,
body.mj-admin-role-author.profile-php .user-nickname-wrap,
body.mj-admin-role-author.profile-php .user-display-name-wrap,
/* プロフィール情報 */
body.mj-admin-role-author.profile-php .user-description-wrap,
/* サイト */
body.mj-admin-role-author.profile-php #your-profile .user-url-wrap,
/* SEOタブ */
body.mj-admin-role-author.profile-php .nav-tab[href*="social-profiles"],
/* 無限スクロール（WP 7.1+） */
body.mj-admin-role-author.profile-php .user-infinite-scrolling-wrap,
/* ACF Extended UI：Permalink（author アーカイブ URL） */
body.mj-admin-role-author.profile-php #edit-slug-box {
  display: none !important;
}

.visa-step-arrow {
  clip-path: polygon(0 0, 100% 0, 100% 76%, 50% 100%, 0 76%);
}