/* ==========================================================
   QUERYY（/blog）追従CTA
   components/queryy/follow-cta.php ／ js/follow-cta/index.js
   - SP（〜768px）：画面下部の固定バー
   - PC（769px〜）：右下の控えめな追従ボタン（記事ページのみ）
   表示はスクロール後（.is-show）。閉じた状態はセッション中保持（.is-closed）
   ========================================================== */
.queryy-follow-cta {
  --qfc-blue: #1b75de;
  --qfc-bar-h: 56px;
}

/* ---- SP：下部固定バー ---- */
.queryy-follow-cta__bar {
  display: none;
}

@media (max-width: 768px) {
  .queryy-follow-cta__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    height: calc(var(--qfc-bar-h, 56px) + env(safe-area-inset-bottom, 0px));
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) 12px;
    background-color: rgba(255, 255, 255, 0.97);
    border-top: 1px solid #ccc;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(110%);
    transition: transform 0.3s ease;
  }

  .queryy-follow-cta.is-show .queryy-follow-cta__bar {
    transform: translateY(0);
  }

  .queryy-follow-cta.is-closed .queryy-follow-cta__bar {
    display: none;
  }

  /* フッター最下部がバーに隠れないよう余白を確保 */
  body.has-queryy-follow-bar {
    padding-bottom: calc(var(--qfc-bar-h, 56px) + env(safe-area-inset-bottom, 0px));
  }

  /* 既存のポップアップバナー（左下固定）とバーが重ならないよう持ち上げる */
  body.has-queryy-follow-bar .popup-banner {
    bottom: calc(var(--qfc-bar-h, 56px) + 10px + env(safe-area-inset-bottom, 0px));
  }
}

.queryy-follow-cta__bar-link {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 14px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background-color: var(--qfc-blue);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
}

.queryy-follow-cta__bar-text {
  font-size: 14px;
  font-weight: bold;
  line-height: 1.3;
  letter-spacing: 0.05em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.queryy-follow-cta__bar-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.queryy-follow-cta__close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 50%;
  color: #333;
  cursor: pointer;
}

/* グローバルの svg 指定に引っ張られないようアイコンサイズを固定 */
.queryy-follow-cta__close svg {
  width: 12px;
  height: 12px;
}

.queryy-follow-cta__bar-icon svg,
.queryy-follow-cta__pc-icon svg {
  width: 8px;
  height: 8px;
}

/* ---- PC：右下の追従ボタン ---- */
.queryy-follow-cta__pc {
  display: none;
}

@media (min-width: 769px) {
  .queryy-follow-cta__pc {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 80;
    max-width: 260px;
    padding: 12px 52px 12px 18px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    color: #000;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  }

  .queryy-follow-cta.is-show:not(.is-footer) .queryy-follow-cta__pc {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

.queryy-follow-cta__pc-en {
  color: var(--qfc-blue);
  font-family: "Verdana", sans-serif;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.queryy-follow-cta__pc-text {
  font-size: 13px;
  font-weight: bold;
  line-height: 1.5;
  letter-spacing: 0.05em;
}

.queryy-follow-cta__pc-icon {
  --size: 28px;
  width: var(--size);
  height: var(--size);
  position: absolute;
  right: 14px;
  top: 50%;
  margin-top: calc(var(--size) / -2);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--qfc-blue);
  border-radius: 50%;
  transition: scale 0.4s cubic-bezier(0.26, 0.16, 0.1, 1);
}

@media (hover: hover) and (pointer: fine) {
  .queryy-follow-cta__pc:hover .queryy-follow-cta__pc-icon {
    scale: 1.2;
  }
}
