/* セラログをもっと使いやすく（theralog-plus.js）
   今の見た目（custom-common.css の .ct-*）の上にかぶせる。色はセラミィの紫とピンク */

:root {
  --tlp-purple: #7D40A0;
  --tlp-pink: #E9528E;
  --tlp-text: #535353;
  --tlp-sub: #8A8A90;
  --tlp-weak: #B3B3B8;
  --tlp-line: #ECECF0;
}

/* ---------- 時刻・名前・店舗名 ---------- */
.ct-theralog-card-content-header { flex-wrap: wrap; row-gap: 0; }
.tlp-name { cursor: pointer; }
.tlp-name:hover { text-decoration: underline; text-underline-offset: 2px; }
.tlp-sub {
  order: 3;
  flex-basis: 100%;
  overflow: hidden;
  color: var(--tlp-sub);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}
.tlp-time { color: var(--tlp-sub); font-variant-numeric: tabular-nums; }

/* ---------- 長い文を畳む ---------- */
.ct-theralog-card-main-contents.tlp-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
  overflow: hidden;
}
.tlp-more {
  display: inline-block;
  margin: 2px 0 0;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--tlp-purple);
  font-size: 14px;
  cursor: pointer;
}

/* ---------- #ハッシュタグ ---------- */
.ct-theralog-card-main-contents a.tlp-tag,
.ct-view-text a.tlp-tag {
  color: var(--tlp-purple);
  text-decoration: none;
}
.ct-theralog-card-main-contents a.tlp-tag:hover,
.ct-view-text a.tlp-tag:hover { text-decoration: underline; }

/* ---------- 写真：1枚は高さを抑える（Instagram と同じく、縦は横の1.25倍まで。押すと全体） ---------- */
.ct-theralog-card .ct-theralog-card-images.ct-images-1 .ct-theralog-card-image {
  max-height: min(calc((100vw - 76px) * 1.25), 560px);
  object-fit: cover;
  background: #F3F0F7;
}
.ct-theralog-card .ct-theralog-card-image,
.ct-view-image { cursor: zoom-in; touch-action: manipulation; }

/* ダブルタップのハート */
.tlp-burst {
  position: absolute;
  z-index: 3;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  pointer-events: none;
  animation: tlp-burst .85s cubic-bezier(.2, .9, .3, 1.2) forwards;
}
.tlp-burst svg { width: 100%; height: 100%; fill: #fff; filter: drop-shadow(0 4px 14px rgba(233, 82, 142, .55)); }
@keyframes tlp-burst {
  0% { transform: scale(.2); opacity: 0; }
  18% { transform: scale(1.15); opacity: 1; }
  32% { transform: scale(.95); }
  70% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1) translateY(-30px); opacity: 0; }
}

/* いいね・保存を押したときに、はねる */
.tlp-pop { animation: tlp-pop .42s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes tlp-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); }
  70% { transform: scale(.92); }
  100% { transform: scale(1); }
}

/* ---------- 全画面の写真 ---------- */
html.tlp-lock, html.tlp-lock body { overflow: hidden; }
.tlp-viewer {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #000;
  opacity: 0;
  transition: opacity .18s ease;
}
.tlp-viewer.is-in { opacity: 1; }
.tlp-viewer__track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  transition: transform .2s ease;
}
.tlp-viewer__track::-webkit-scrollbar { display: none; }
.tlp-viewer__track.is-zoomed { overflow-x: hidden; scroll-snap-type: none; }
.tlp-viewer__slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  scroll-snap-align: center;
}
.tlp-viewer__slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
}
.tlp-viewer__slide.is-zoomed { display: block; overflow: auto; }
.tlp-viewer__slide.is-zoomed img { max-width: none; max-height: none; width: 220%; height: auto; }
.tlp-viewer__count {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 13px;
}
.tlp-viewer__close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  right: 8px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  cursor: pointer;
}
.tlp-viewer__close svg { width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }

/* ---------- タイムラインの上：すべて・フォロー中・保存・検索 ---------- */
.tlp-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 16px 0 20px;
}
.tlp-views {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 6px;
}
.tlp-view {
  padding: 7px 14px;
  border: 1px solid var(--tlp-line);
  border-radius: 999px;
  background: #fff;
  color: var(--tlp-text);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.tlp-view.is-on {
  border-color: var(--tlp-purple);
  background: var(--tlp-purple);
  color: #fff;
}
.tlp-search-open {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 7px;
  border: 1px solid var(--tlp-line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
.tlp-search-open svg,
.tlp-search__icon { fill: none; stroke: var(--tlp-text); stroke-width: 2; stroke-linecap: round; }
.tlp-search-open[aria-expanded="true"] { border-color: var(--tlp-purple); }
.tlp-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 16px 0 20px;
  padding: 0 4px 0 12px;
  border: 1px solid var(--tlp-purple);
  border-radius: 999px;
  background: #fff;
}
.tlp-search[hidden] { display: none; }
.tlp-search__icon { flex: none; width: 18px; height: 18px; }
.tlp-search__input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--tlp-text);
  font-size: 16px; /* iPhone で拡大しない大きさ */
}
.tlp-search__cancel {
  flex: none;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: var(--tlp-sub);
  font-size: 13px;
  cursor: pointer;
}
.tlp-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 16px 0 20px;
  padding: 8px 8px 8px 14px;
  border-radius: 12px;
  background: #F6F0FA;
  color: var(--tlp-purple);
  font-size: 13px;
}
.tlp-filter[hidden] { display: none; }
.tlp-filter__text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tlp-filter__clear {
  flex: none;
  padding: 4px 12px;
  border: 1px solid var(--tlp-purple);
  border-radius: 999px;
  background: #fff;
  color: var(--tlp-purple);
  font-size: 12px;
  cursor: pointer;
}
.ct-no-timeline.tlp-empty { padding: 0 24px; font-size: 14px; line-height: 1.7; }

/* ---------- 保存（ブックマーク） ---------- */
.tlp-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 5px;
  border: 0;
  background: none;
  cursor: pointer;
}
.tlp-save svg { width: 100%; height: 100%; fill: none; stroke: var(--tlp-pink); stroke-width: 1.8; stroke-linejoin: round; }
.tlp-save.is-on svg { fill: var(--tlp-pink); }

/* ---------- 新しい投稿 N件 ---------- */
.tlp-pill {
  position: fixed;
  top: calc(5rem + 12px);
  left: 50%;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px 9px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--tlp-purple);
  box-shadow: 0 8px 24px rgba(125, 64, 160, .35);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -16px);
  transition: opacity .2s ease, transform .25s cubic-bezier(.2, .9, .3, 1.2);
  cursor: pointer;
}
.tlp-pill.is-in { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.tlp-pill svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 読み込み中のカードの形 ---------- */
.ct-inline-loader.tlp-skel-wrap { display: block; padding: 0; height: auto; background: none; }
.tlp-skel {
  display: flex;
  gap: 12px;
  padding: 16px 16px 16px 20px;
  border-bottom: 1px solid var(--tlp-line);
}
.tlp-skel__av,
.tlp-skel__lines i,
.tlp-skel__lines b {
  background: linear-gradient(90deg, #EFEDF2 25%, #F8F7FA 50%, #EFEDF2 75%);
  background-size: 200% 100%;
  animation: tlp-shimmer 1.3s ease-in-out infinite;
}
.tlp-skel__av { flex: none; width: 44px; height: 44px; border-radius: 50%; }
.tlp-skel__lines { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.tlp-skel__lines i { display: block; height: 12px; border-radius: 6px; }
.tlp-skel__lines i:nth-child(1) { width: 38%; }
.tlp-skel__lines i:nth-child(2) { width: 92%; }
.tlp-skel__lines i:nth-child(3) { width: 70%; }
.tlp-skel__lines b { display: block; height: 180px; margin-top: 4px; border-radius: 10px; }
@keyframes tlp-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ---------- 投稿画面：残りの字数の円 ---------- */
.tlp-gauge { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; }
.tlp-gauge svg { width: 28px; height: 28px; transform: rotate(-90deg); }
.tlp-gauge__bg { fill: none; stroke: var(--tlp-line); stroke-width: 2.4; }
.tlp-gauge__fg { fill: none; stroke: var(--tlp-purple); stroke-width: 2.4; stroke-linecap: round; transition: stroke-dashoffset .15s ease; }
.tlp-gauge.is-near .tlp-gauge__fg { stroke: #E3A12F; }
.tlp-gauge.is-over .tlp-gauge__fg { stroke: #D84A6A; }
.tlp-gauge__n { position: absolute; color: var(--tlp-sub); font-size: 11px; }
.tlp-gauge.is-over .tlp-gauge__n { color: #D84A6A; }

/* ---------- 通知のベル（外のサイトの画像をやめて線のアイコンに） ---------- */
.ct-reaction-mylog-button .tlp-bell {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
  .tlp-burst, .tlp-pop, .tlp-skel__av, .tlp-skel__lines i, .tlp-skel__lines b { animation: none; }
  .tlp-viewer, .tlp-viewer__track, .tlp-pill, .tlp-view { transition: none; }
}
