/*
 * PMP Helper core front-end styles
 * - teaser mask and CTA
 * - account icon menu item base styles
 */

/* 鎖文摘要遮罩 */
.teaser-mask {
  position: relative;
  max-height: 480px;
  overflow: hidden;
}

.teaser-mask::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 35%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.9)
  );
  pointer-events: none;
}

body.logged-in .teaser-mask {
  max-height: none;
  overflow: visible;
}

body.logged-in .teaser-mask::after {
  display: none;
}

/* 文章內會員 CTA */
.members-only-cta {
  margin: 1.5em 0;
  padding: 1em 1.2em;
  border-radius: 8px;
  background: #f5f5f5;
  font-size: 0.95em;
  text-align: center;
}

.members-only-cta a {
  text-decoration: underline;
}

body.logged-in .members-only-cta {
  display: none;
}

/* PMPro card and form styling (moved from custom CSS) */
.pmpro_card_actions.pmpro_font-medium {
  font-size: 0.8rem;
}

.pmpro_card_title.pmpro_font-large {
  color: #d6986a;
  margin: 0;
}

#pmpro_account-membership-1 .pmpro_card_title.pmpro_font-large {
  font-size: 16px;
}

.pmpro_card_actions,
.pmpro_card_actions a {
  font-size: 13px;
}

/* 強制鎖文卡片底部文案與連結同尺寸（避免被 pmpro_font-medium 放大） */
.pmpro .pmpro_card_actions.pmpro_font-medium,
.pmpro .pmpro_card_actions.pmpro_font-medium a {
  font-size: 13px !important;
  line-height: 1.4;
}

/* 鎖文頁：標題區與精選圖保留距離 */
.single-post.pmpro-body-level-required:not(.pmpro-body-has-access) header.entry-header.sh_single_post_title {
  padding-top: 40px;
}

.pmpro_card_content a.pmpro_btn {
  background-color: #d6986a;
  border-color: #d6986a;
}

.pmpro_card_content a.pmpro_btn:hover {
  background-color: #e0b18e;
  border-color: #e0b18e;
}

.pmpro_card_title svg.feather-lock {
  stroke: #d6986a;
}

.pmpro_form_submit button.pmpro_btn.pmpro_btn-submit-update-profile,
input#pmpro_btn-submit,
input#wp-submit {
  background-color: #d6986a !important;
  border-color: #d6986a !important;
  color: #fff !important;
}

.pmpro_form_submit button.pmpro_btn.pmpro_btn-submit-update-profile:hover,
input#pmpro_btn-submit:hover,
input#wp-submit:hover {
  background-color: #e0b18e !important;
  border-color: #e0b18e !important;
  color: #fff !important;
}

button#pmpro_btn-password-toggle-1,
.pmpro .pmpro_form_field-password-toggle .pmpro_btn[data-toggle]::after {
  color: #d6986a;
}

#pmpro_btn-password-toggle-1 span.pmpro_icon.pmpro_icon-eye svg,
.pmpro_btn-password-toggle span.pmpro_icon.pmpro_icon-eye svg,
.pmpro_btn-password-toggle:focus span.pmpro_icon.pmpro_icon-eye svg {
  stroke: #d6986a;
}

h2.pmpro_section_title.pmpro_font-x-large {
  font-size: 24px;
}

#pmpro_tos_fields .pmpro_form_field.pmpro_form_field-checkbox {
  display: flex;
  align-items: flex-start;
  padding-left: 8px;
}

#pmpro_tos_fields input[type="checkbox"].pmpro_form_input-checkbox {
  -webkit-appearance: checkbox;
  -moz-appearance: checkbox;
  appearance: checkbox;
  width: 20px;
  height: 20px;
  margin: 0 4px 2px 0;
  flex-shrink: 0;
}

#pmpro_tos_fields input[type="checkbox"]#tos {
  width: 20px;
  height: 20px;
}

#pmpro_tos_fields label.pmpro_form_label {
  display: flex;
  align-items: center;
  font-size: 14px;
}

#pmpro_tos_fields,
#pmpro_tos_fields input[type="checkbox"],
#pmpro_tos_fields label.pmpro_form_label {
  pointer-events: auto !important;
}

/* [LUX-014] temporary: hide avatar on PMPro account profile */
#pmpro_account-profile .pmpro_heading-with-avatar img.avatar {
  display: none;
}

/* [LUX-018] PMPro required fields mark */
.pmpro_form_field.pmpro_required > label::after,
#pmpro_member_profile_edit label[for="first_name"]::after,
#pmpro_member_profile_edit label[for="last_name"]::after,
#pmpro_member_profile_edit label[for="user_email"]::after,
#pmpro_member_profile_edit label[for="phone_"]::after,
#pmpro_member_profile_edit label[for="city"]::after {
  content: " *";
  color: #d6986a;
  font-weight: 600;
  margin-left: 2px;
}

/* 會員 icon：支援新舊 class，避免綁定單一主題 class */
.menu-item-pmp-helper-account > a,
.menu-item-lux-account > a {
  display: inline-flex;
  align-items: center;
  padding-left: 6px;
  padding-right: 0;
}

.menu-item-pmp-helper-account svg,
.menu-item-lux-account svg {
  display: block;
}

.pmp-helper-account-in-search-slot {
  list-style: none;
  margin: 0 12px 0 0;
  display: inline-flex !important;
  align-items: center;
  align-self: center;
}

.pmp-helper-account-in-search-slot > a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.pmp-helper-account-in-search-slot .pmp-helper-header-account-icon {
  display: block;
  vertical-align: middle;
}

.menu-item-pmp-helper-account-mobile > a {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px;
  line-height: 1.2;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.menu-item-pmp-helper-account-mobile .pmp-helper-mobile-account-icon {
  display: block;
  flex: 0 0 auto;
  vertical-align: middle;
}

.menu-item-pmp-helper-account-mobile > a > span {
  display: inline-block !important;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 1023px) {
  .menu-item-pmp-helper-account {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .menu-item-pmp-helper-account-mobile {
    display: none !important;
  }
}
