/* ===== 嵌入內容樣式 ===== */

/* 響應式 iframe 容器 */
.post-content iframe {
  max-width: 100%;
  border: none;
  border-radius: 8px;
  margin: 20px 0;
}

/* YouTube / Vimeo 影片嵌入 */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 比例 */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin: 20px 0;
  border-radius: 8px;
  background: #000;
}

.video-container iframe,
.video-container object,
.video-container embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* 自動包裝 YouTube iframe */
.post-content iframe[src*="youtube"],
.post-content iframe[src*="youtu.be"],
.post-content iframe[src*="vimeo"] {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
}

/* CodePen 嵌入 */
.post-content iframe[src*="codepen"] {
  width: 100%;
  min-height: 400px;
  border: 1px solid var(--border-color);
}

/* JSFiddle 嵌入 */
.post-content iframe[src*="jsfiddle"] {
  width: 100%;
  min-height: 400px;
  border: 1px solid var(--border-color);
}

/* GitHub Gist 嵌入 */
.gist {
  margin: 20px 0;
}

.gist .gist-file {
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  overflow: hidden;
}

.gist .gist-data {
  background: var(--code-bg) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.gist .gist-meta {
  background: var(--bg-color) !important;
  padding: 10px !important;
}

/* Twitter/X 嵌入 */
.twitter-tweet {
  margin: 20px auto !important;
}

/* Instagram 嵌入 */
.instagram-media {
  margin: 20px auto !important;
  max-width: 100% !important;
}

/* Spotify 嵌入 */
.post-content iframe[src*="spotify"] {
  width: 100%;
  min-height: 152px;
  border-radius: 12px;
}

/* SoundCloud 嵌入 */
.post-content iframe[src*="soundcloud"] {
  width: 100%;
}

/* Google Maps 嵌入 */
.post-content iframe[src*="google.com/maps"],
.post-content iframe[src*="maps.google"] {
  width: 100%;
  height: 400px;
  border-radius: 8px;
}

/* Figma 嵌入 */
.post-content iframe[src*="figma"] {
  width: 100%;
  min-height: 500px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

/* Notion 嵌入 */
.post-content iframe[src*="notion"] {
  width: 100%;
  min-height: 500px;
}

/* 通用嵌入容器 */
.embed-container {
  position: relative;
  margin: 20px 0;
  padding: 0;
  max-width: 100%;
  overflow: hidden;
  border-radius: 8px;
}

/* 程式碼區塊增強 */
.post-content pre {
  position: relative;
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.6;
}

.post-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

/* 行號樣式 */
.post-content pre .line-number {
  color: #858585;
  user-select: none;
  padding-right: 15px;
  border-right: 1px solid #404040;
  margin-right: 15px;
}

/* 內聯程式碼 */
.post-content code:not(pre code) {
  background: rgba(0, 102, 204, 0.1);
  color: #0066cc;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.9em;
}

/* 引用區塊增強 */
.post-content blockquote {
  position: relative;
  margin: 25px 0;
  padding: 20px 25px;
  background: linear-gradient(135deg, rgba(0,102,204,0.05) 0%, rgba(0,168,255,0.05) 100%);
  border-left: 4px solid #0066cc;
  border-radius: 0 8px 8px 0;
  font-style: normal;
  color: var(--text-color);
}

.post-content blockquote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 15px;
  font-size: 60px;
  color: rgba(0,102,204,0.2);
  font-family: Georgia, serif;
  line-height: 1;
}

.post-content blockquote p {
  margin: 0;
  position: relative;
  z-index: 1;
}

/* 表格增強 */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.post-content table thead {
  background: linear-gradient(135deg, #0066cc 0%, #00a8ff 100%);
  color: white;
}

.post-content table th,
.post-content table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.post-content table tbody tr:hover {
  background: rgba(0,102,204,0.05);
}

.post-content table tbody tr:last-child td {
  border-bottom: none;
}

/* 圖片增強 */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  margin: 20px auto;
  display: block;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-content img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* 圖片說明 */
.post-content img + em,
.post-content figure figcaption {
  display: block;
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-top: -10px;
  margin-bottom: 20px;
}

/* 水平線 */
.post-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  margin: 40px 0;
}

/* 任務列表 */
.post-content ul li input[type="checkbox"] {
  margin-right: 8px;
  transform: scale(1.2);
}

/* 腳註 */
.post-content .footnote-ref {
  font-size: 12px;
  vertical-align: super;
  color: #0066cc;
}

.post-content .footnotes {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 14px;
  color: #666;
}

/* 響應式調整 */
@media (max-width: 768px) {
  .post-content pre {
    padding: 15px;
    font-size: 13px;
    border-radius: 0;
    margin-left: -15px;
    margin-right: -15px;
  }
  
  .post-content table {
    font-size: 13px;
  }
  
  .post-content table th,
  .post-content table td {
    padding: 8px 10px;
  }
  
  .post-content blockquote {
    padding: 15px 20px;
    margin-left: 0;
    margin-right: 0;
  }
}
