/* 全体 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  padding-bottom: 80px;
  background-color: #f5f5f5;
}

/* テロップ本体 */
.fixed-telop {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #4D7168;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  animation: slideUp 0.4s ease-out;
  overflow: hidden;
}

#fixedTelop {
  position: fixed;
  left: 0;
  width: 100%;
  z-index: 9999;
}
/* Web版:画面下部に配置 */
body:not(.is-app) #fixedTelop {
  bottom: 0;
  top: auto;
}
/* アプリ版:画面上部に配置 */
body.is-app #fixedTelop {
  top: 0;
  bottom: auto;
  padding-top: env(safe-area-inset-top);
}

/* テロップルート(予備) */
#telop-root {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 20000;
  pointer-events: none;
}

/* アプリ版のみのスタイル調整 */
/* テロップ */
.is-app #fixedTelop {
  font-size: 16px;
}
/* 「×(閉じる)ボタン」→現在は非表示 */
.is-app .telop-close {
  font-size: 20px; 
  align-self: center; 
}
/* 「投稿はこちらから」 */
body.is-app .telop-button {
  font-size: 12px;
}
/* サムネイル画像 */
body.is-app .telop-thumbnail img {
  object-fit: contain;
  transform: translateY(-5%);
}
/* メッセージ */
.is-app .telop-text {
  font-size: 16px;
  line-height: 1.6;
}
/* 「投稿はこちらから」のリンク */
.is-app .telop-post-link {
  font-size: 16px;
  padding: 12px 18px;
  border-radius: 10px;
}
/* コンテナ */
.is-app #telopContainer {
  padding-top: 10px;
}
/* 再表示ボタン→現在は非表示 */
.telop-reopen-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #4D7168;
  color: #ffffff;
  border: 3px solid #4D7168;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(95, 136, 123, 0.4);
  transition: all 0.3s ease;
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
}
/* 再表示ボタンの位置 */
.telop-reopen-button i{
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 再表示ボタン:表示状態 */
.telop-reopen-button.show {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

/* アプリ版:再表示ボタン→現在は非表示 */
body.is-app .telop-reopen-button {
  top: calc(env(safe-area-inset-top) + 12px);
  right: 12px;
  bottom: auto !important;
  left: auto !important;

  width: 52px;
  height: 52px;
  font-size: 24px;
  line-height: 52px;

  z-index: 10001;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
/* テロップコンテナ */
.telop-container {
  display: flex;
  align-items: center;
  min-height: 80px;
  height: 80px;
  position: relative;
  overflow: hidden;
}

/* サムネイル画像 */
.telop-thumbnail {
  min-width: 150px;
  max-width: 150px;
  width: 150px;
  height: 80px;
  background-color: #4D7168;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.telop-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* プレースホルダーを非表示 */
.telop-thumbnail-placeholder {
  display: none !important; 
}

/* サムネイル画像無しの時:サムネイルエリアを非表示 */
.telop-container.no-thumbnail .telop-thumbnail {
  display: none;
}
/* タイトル */
.telop-title {
  position: absolute;
  top: 8px;
  left: 160px;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  z-index: 10;
  transition: left 0.3s ease;
}

/* 画像無しの時:タイトル位置を左寄せ */
.telop-container.no-thumbnail .telop-title {
  left: 20px;
}
/* アクションボタン(投稿リンク・閉じる) */
.telop-action {
  position: absolute;
  top: 5px;
  right: 20px;
  display: flex;
  gap: 15px;
  z-index: 10;
}

.telop-button {
  color: #fff;
  font-size: 16px;
  text-decoration: none;
}

.telop-button:hover {
  color: #E8E8D5;
  text-decoration: underline;
}

.telop-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.telop-close:hover {
  color: #E8E8D5;
}

/* メッセージエリア */
.telop-message {
  flex: 1;
  padding: 0 20px 0 170px;
  height: 80px;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  z-index: 1; 
  transition: padding-left 0.3s ease;
}

/* 画像無しの時:メッセージパディング調整 */
.telop-container.no-thumbnail .telop-message {
  padding-left: 20px;
}

.telop-message-wrapper {
  white-space: nowrap;
  position: absolute;
  top: 55%;
  transform: translateY(-50%);
  z-index: 1; 
}

.telop-text {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
/* アニメーション */
/* スライドアップ(表示) */
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
/* 非表示クラス */
.telop-hidden {
  animation: slideDown 0.4s ease-out forwards;
}

/* アプリ版: 上方向にスライドアウト */
body.is-app .telop-hidden {
  animation-name: slideUpOut;
}
/* スライドダウン */
@keyframes slideDown {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}
/* アプリ版:スライドアップアウト */
@keyframes slideUpOut {
  from { transform: translateY(0); }
  to { transform: translateY(-100%); }
}
/* フェードイン */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* レスポンシブ対応 */

/* タブレット用(1024px以下) */
@media (max-width: 1024px) {
  body {
    padding-bottom: 70px;
  }

  .telop-container {
    min-height: 70px;
    height: 70px;
  }

  .telop-thumbnail {
    min-width: 130px;
    max-width: 130px;
    width: 130px;
    height: 70px;
  }

  .telop-title {
    left: 145px;
    font-size: 14px;
    top: 6px;
  }

  .telop-button {
    font-size: 14px;
  }

  .telop-message {
    padding-left: 145px;
    height: 70px;
  }

  .telop-text {
    font-size: 16px;
  }

/* 画像無しの時 */
  .telop-container.no-thumbnail .telop-title {
    left: 20px;
  }

  .telop-container.no-thumbnail .telop-message {
    padding-left: 20px;
  }
}

/* タブレット小(768px以下) */
@media (max-width: 768px) {
  body {
    padding-bottom: 60px;
  }

  .telop-container {
    min-height: 60px;
    height: 60px;
  }

  .telop-thumbnail {
    min-width: 110px;
    max-width: 110px;
    width: 110px;
    height: 60px;
  }

  .telop-title {
    left: 125px;
    font-size: 13px;
    top: 5px;
  }

  .telop-action {
    right: 15px;
    gap: 10px;
    top: 3px;
  }

  .telop-button {
    font-size: 13px;
  }

  .telop-close {
    font-size: 20px;
  }

  .telop-message {
    padding-left: 125px;
    padding-right: 15px;
    height: 60px;
  }

  .telop-text {
    font-size: 15px;
  }

/* 画像無しの時 */
  .telop-container.no-thumbnail .telop-title {
    left: 15px;
  }

  .telop-container.no-thumbnail .telop-message {
    padding-left: 15px;
  }
}
/* スマートフォン(480px以下) */
@media (max-width: 480px) {
  body {
    padding-bottom: 50px;
  }

  .telop-container {
    min-height: 50px;
    height: 50px;
  }

  .telop-thumbnail {
    min-width: 70px;
    max-width: 70px;
    width: 70px;
    height: 50px;
  }

  .telop-title {
    left: 78px;
    font-size: 11px;
    top: 4px;
  }

  .telop-action {
    right: 10px;
    gap: 8px;
    top: 2px;
  }

  .telop-button {
    font-size: 11px;
  }

  .telop-close {
    font-size: 18px;
  }

  .telop-message {
    padding-left: 78px;
    padding-right: 10px;
    height: 50px;
  }

  .telop-text {
    font-size: 13px;
  }

/* 画像無しの時 */
  .telop-container.no-thumbnail .telop-title {
    left: 10px;
  }

  .telop-container.no-thumbnail .telop-message {
    padding-left: 10px;
  }
}