@charset "UTF-8";

/* ==========================================================================
   1. 全体の共通枠・レイアウト（既存サイトの世界観に準拠）
   ========================================================================== */
.tl-main-wrapper {
  max-width: 900px;
  width: 95%;
  margin: 20px auto;
  background-color: #ffffff;
  border: 1px solid #999999;
  padding: 20px;
  font-family: "MS PGothic", "Osaka", "ヒラギノ角ゴ Pro W3", sans-serif;
  box-sizing: border-box;
}

.tl-main-title {
  font-size: 20px;
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 20px;
  padding: 3px 8px;
  border-left: 8px solid #009999;
  border-bottom: 1px solid #009999;
  color: #333333;
}

.tl-control-panel {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px dotted #009999;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  font-size: 13px;
}
.filter-form input[type="date"] {
  padding: 4px 8px;
  border: 1px solid #999999;
  font-family: monospace;
}

.tl-btn {
  padding: 4px 12px;
  background-color: #f0f0f0;
  border: 1px solid #cccccc;
  color: #0066cc;
  cursor: pointer;
  font-weight: bold;
  font-size: 13px;
}
.tl-btn:hover:not(:disabled) {
  background-color: #bbf1ef;
  border-color: #009999;
}
.tl-btn:disabled {
  color: #aaaaaa;
  background-color: #f9f9f9;
  border-color: #e5e5e5;
  cursor: not-allowed;
}
.filter-clear-btn { color: #666666; }

.tab-container { display: flex; gap: 10px; }
.tab-btn {
  padding: 6px 20px;
  background-color: #f0f0f0;
  border: 1px solid #999999;
  color: #333333;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}
.tab-btn.active {
  background-color: #bbf1ef;
  color: #0066cc;
  border-bottom: 2px solid #009999;
}

#tl-dynamic-content { min-height: 300px; }
.timeline-loading { font-size: 14px; color: #666666; padding: 10px; }

/* ==========================================================================
   2. 各表示モード（つぶやきカード / 画像ギャラリー）の装飾
   ========================================================================== */
.tl-card {
  background-color: #ffffff;
  border: 1px solid #999999;
  padding: 15px;
  margin-bottom: 15px;
}
.tl-content {
  font-size: 14px;
  line-height: 1.6;
  color: #333333;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.tl-time {
  display: block;
  font-size: 12px;
  color: #75818d;
  margin-top: 10px;
  padding-top: 5px;
  border-top: 1px dotted #cccccc;
}

.tl-hashtag {
  color: #0066cc;
  cursor: pointer;
  text-decoration: none;
}
.tl-hashtag:hover {
  text-decoration: underline;
}

.tl-media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, 150px);
  gap: 8px;
  margin-top: 10px;
}

.tl-media-item {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background-color: #f0f0f0;
  display: block;
  border: 1px solid #cccccc;
  box-sizing: border-box;
  cursor: pointer;
  transition: opacity 0.2s;
}
.tl-media-item:hover { opacity: 0.8; }

video.tl-media-item { 
  background: #000000; 
  cursor: auto; 
  object-fit: contain;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.gallery-box { background: #ffffff; border: 1px solid #999999; padding: 6px; }
.gallery-box .tl-media-item {
  height: 140px;
  object-fit: cover;
}

/* ==========================================================================
   3. ページネーション（ページめくり）の装飾
   ========================================================================== */
.pagination-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px dotted #cccccc;
  font-size: 13px;
}
.page-jump-input {
  width: 45px;
  padding: 3px 5px;
  border: 1px solid #999999;
  text-align: center;
  font-family: monospace;
}

/* ==========================================================================
   4. 画像拡大表示用モーダル（方向キー対応）
   ========================================================================== */
.tl-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
}

/* 【何のために書くか】画像と直下のテキストを一元的に管理し、枠組みとして中央に綺麗に並べるため
   【どうなるか】幅や高さが制限内に固定され、スマートフォンのような画面でもテキストがはみ出さずに縦スクロールで読めるようになります */
.tl-modal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 85%;
  max-height: 85%;
  background-color: rgba(0, 0, 0, 0.8);
  border: 2px solid #ffffff;
  padding: 15px;
  box-sizing: border-box;
  overflow-y: auto;
}

/* 【何のために書くか】画像部分のサイズが大きくなりすぎてテキスト領域を押し潰してしまわないよう、縦の上限を明示するため */
.tl-modal-content {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

/* 【何のために書くか】モーダル内の黒背景に対して、読みやすく快適な文字表示を成立させるため
   【どうなるか】上部に境界となる白い点線が引かれ、白文字で改行やはみ出し処理が適切に行われた状態で本文が展開されます */
.tl-modal-text {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.6;
  margin-top: 15px;
  width: 100%;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  border-top: 1px dotted #ffffff;
  padding-top: 10px;
  box-sizing: border-box;
}

/* 【何のために書くか】モーダル内テキストに含まれるハッシュタグが、黒背景と同化して見えなくなるのを防ぐため
   【どうなるか】ハッシュタグのみが明るいレトロポップな水色（#bbf1ef）で表示され、視認性が確保されます */
.tl-modal-text .tl-hashtag {
  color: #bbf1ef;
}

.modal-btn {
  position: absolute;
  top: 0; height: 100%; width: 15%;
  display: flex; align-items: center; justify-content: center;
  color: #ffffff; font-size: 30px; font-weight: bold;
  cursor: pointer; user-select: none; background: transparent;
  transition: background 0.2s;
}
.modal-btn:hover { background: rgba(255,255,255,0.1); }
.modal-prev { left: 0; }
.modal-next { right: 0; }
.modal-close-overlay { position: absolute; top: 0; left: 15%; width: 70%; height: 100%; z-index: -1; cursor: zoom-out; }

/* ==========================================================================
   5. スマホ対応 (メディアクエリ)
   ========================================================================== */
@media (max-width: 600px) {
  .tl-main-wrapper { width: 100%; padding: 10px; border-left: none; border-right: none; }
  
  .tl-media-gallery {
    grid-template-columns: repeat(auto-fill, 100px);
  }
  .tl-media-item { 
    height: 100px; 
  }
  
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .gallery-box { padding: 4px; }
  .gallery-box .tl-media-item { height: 90px; }
  .pagination-container { gap: 10px; flex-direction: column; }

  /* 【何のために書くか】画面の狭いスマートフォン閲覧時に、モーダル全体のサイズ感と画像の高さを再調整するため
     【どうなるか】枠の幅が画面いっぱいに広がり、画像の高さが少し低く抑えられることで、文章を読むための十分なスペースが下部に生まれます */
  .tl-modal-container {
    max-width: 95%;
    max-height: 90%;
    padding: 10px;
  }
  .tl-modal-content {
    max-height: 45vh;
  }
}