/* ==========================================================================
   TEEPR Modern — Visual Refinement Layer for TruePixel Theme
   Version: 2.0.0

   Design system: Noto Serif TC (headings) + Noto Sans TC (body)
   Brand color: #E03F00 (TEEPR orange, from theme customizer)
   Approach: Enhance readability and polish, never fight parent layout.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  --tm-font-body: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  --tm-font-heading: "Noto Serif TC", "Noto Sans TC", "Microsoft JhengHei", serif;
  --tm-text: #1a1a1a;
  --tm-text-secondary: #555;
  --tm-text-muted: #888;
  --tm-border: #e8e8e8;
  --tm-border-light: #f2f2f2;
  --tm-bg: #f5f5f5;
  --tm-card: #fff;
  --tm-brand: #E03F00;
  --tm-brand-dark: #c23500;
  --tm-radius: 8px;
  --tm-radius-sm: 5px;
  --tm-radius-lg: 12px;
  --tm-shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --tm-shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --tm-shadow-hover: 0 8px 24px rgba(0,0,0,0.1);
  --tm-ease: 200ms ease;
}

/* --------------------------------------------------------------------------
   2. TYPOGRAPHY
   -------------------------------------------------------------------------- */
/* Override Gilroy/system fonts injected by ad scripts on html/:root */
html, html.js, :root,
body, body.main {
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--tm-text);
}

/* Headings: serif for editorial feel */
h1, h2, h3 {
  font-family: var(--tm-font-heading) !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

h4, h5, h6 {
  font-family: var(--tm-font-body) !important;
  font-weight: 600 !important;
}

/* Force Noto Sans TC on ALL text elements */
.index-right-post-title,
.index-right-video-title,
.original-video-title,
.thetime,
.post-info,
.post-info a,
.thecategory,
.thecategory a,
.footer-text,
.footer-cat-box a,
.company-copyright-text,
.copyrights,
.copyrights a,
.widget,
.widget a,
.widget-title,
.sidebar a,
.sidebar,
#navigation .menu li,
#top-navigation .menu li a,
.secondary-navigation .menu li a,
.alm-load-more-btn,
.responsive-tabs__list__item,
.language-switch-wrapper-index,
.choose-lang,
.author-link,
.author-description,
.cwv3_title,
.warning-box,
.cf-source,
.below-title-container,
.below-title-container-2,
.below-title-container-3,
.total-comments,
.postsby,
.scroll-trigger-text,
.slidertitle-text,
input, button, select, textarea {
  font-family: var(--tm-font-body) !important;
}

/* Article body: generous line height for CJK readability */
.post-single-content p,
.post-single-content div {
  line-height: 1.85 !important;
  font-size: 17px;
}

/* --------------------------------------------------------------------------
   3. NAVIGATION — minimal touch, let theme customizer handle colors
   -------------------------------------------------------------------------- */

/* Underline indicator on top nav links */
#top-navigation .menu > li > a {
  position: relative;
  transition: opacity var(--tm-ease) !important;
}

#top-navigation .menu > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: rgba(255,255,255,0.6);
  transition: width var(--tm-ease), left var(--tm-ease);
}

#top-navigation .menu > li:hover > a::after,
#top-navigation .menu > li.current-menu-item > a::after {
  width: 100%;
  left: 0;
}

/* Secondary nav: subtle shadow on scroll (added by JS) */
.secondary-navigation {
  transition: box-shadow 0.3s ease !important;
}

.secondary-navigation.scrolled {
  box-shadow: var(--tm-shadow-md) !important;
}

/* Mobile horizontal menu: just font upgrade */
.horizontal-scroll-menu-wrapper a {
  font-family: var(--tm-font-body) !important;
}

/* Mobile sticky header */
#mobile-scroll.fixed-header {
  box-shadow: var(--tm-shadow-md) !important;
}

/* --------------------------------------------------------------------------
   3b. HEADER & LOGO AREA — don't override parent sizing, just add polish
   -------------------------------------------------------------------------- */

/* Header social icons — float right on desktop */
@media (min-width: 768px) {
  .header-banner-wrapper {
    float: right !important;
  }
}

.header-banner-wrapper .follow-fb,
.header-banner-wrapper .follow-ig {
  transition: transform 0.2s ease, opacity 0.2s ease !important;
}

.header-banner-wrapper .follow-fb:hover,
.header-banner-wrapper .follow-ig:hover {
  transform: scale(1.05) !important;
  opacity: 0.9 !important;
}

/* Secondary nav — removed sticky/backdrop to avoid breaking mobile menu */

/* Logo: big logo on desktop, small logo on mobile */
@media (min-width: 768px) {
  .top-nav-logo { display: none !important; }
  .logo-wrap { display: block !important; }
}

@media (max-width: 767px) {
  .top-nav-logo { display: inline-block !important; }
  .main-header, .logo-wrap { display: none !important; }
}

/* Old slider styles removed — replaced by hero section */

/* --------------------------------------------------------------------------
   5. HERO SECTION — replaces old flexslider
   -------------------------------------------------------------------------- */

/* Hide the old slider */
.slider-container { display: none !important; }

/* Container: 2-column grid, main left + 3 stacked right */
.tm-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 20px;
  border-radius: var(--tm-radius-lg);
  overflow: hidden;
}

/* Main hero card */
.tm-hero-main {
  display: flex;
  align-items: flex-end;
  min-height: 380px;
  background-size: cover;
  background-position: center center;
  border-radius: var(--tm-radius-lg) 0 0 var(--tm-radius-lg);
  overflow: hidden;
  color: #fff !important;
  text-decoration: none !important;
}

.tm-hero-overlay {
  width: 100%;
  padding: 80px 20px 20px;
  background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
}

.tm-hero-cat {
  display: inline-block;
  font-family: var(--tm-font-body);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 10px;
  background: var(--tm-brand);
}

.tm-hero-title {
  font-family: var(--tm-font-heading) !important;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  color: #fff !important;
  margin: 0 0 8px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.tm-hero-date {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  font-family: var(--tm-font-body);
}

/* 3 side cards stacked vertically */
.tm-hero-sides {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tm-hero-side {
  display: flex;
  align-items: flex-end;
  flex: 1;
  min-height: 140px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  color: #fff !important;
  text-decoration: none !important;
}

.tm-hero-side:first-child { border-radius: 0 var(--tm-radius-lg) 0 0; }
.tm-hero-side:last-child  { border-radius: 0 0 var(--tm-radius-lg) 0; }

.tm-hero-side-overlay {
  width: 100%;
  padding: 30px 14px 12px;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 70%, transparent 100%);
}

.tm-hero-side-title {
  font-family: var(--tm-font-heading) !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: #fff !important;
  margin: 6px 0 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Hero — tablet */
@media (max-width: 979px) {
  .tm-hero-main { min-height: 260px; }
  .tm-hero-title { font-size: 20px; }
}

/* Hero — mobile */
@media (max-width: 767px) {
  .tm-hero {
    margin: 0 8px 16px;
    border-radius: var(--tm-radius);
    gap: 4px;
  }
  .tm-hero {
    grid-template-columns: 1fr;
  }
  .tm-hero-main {
    min-height: 200px;
    border-radius: var(--tm-radius) var(--tm-radius) 0 0;
  }
  .tm-hero-overlay { padding: 40px 14px 14px; }
  .tm-hero-title { font-size: 17px; margin-bottom: 4px; }
  .tm-hero-side {
    min-height: 90px;
    border-radius: 0 !important;
  }
  .tm-hero-side:first-child { border-radius: 0 !important; }
  .tm-hero-side:last-child { border-radius: 0 0 var(--tm-radius) var(--tm-radius) !important; }
  .tm-hero-side-title { font-size: 13px; }
  .tm-hero-cat { font-size: 10px; padding: 2px 6px; margin-bottom: 4px; }
}

/* --------------------------------------------------------------------------
   6. ARTICLE CARDS — the core visual upgrade
   -------------------------------------------------------------------------- */
article.latestPost,
article.latestPost.excerpt {
  background: var(--tm-card) !important;
  border-radius: var(--tm-radius) !important;
  box-shadow: var(--tm-shadow-sm) !important;
  border: 1px solid var(--tm-border-light) !important;
  overflow: hidden !important;
  transition: transform var(--tm-ease), box-shadow var(--tm-ease) !important;
  cursor: pointer;
}

/* Override parent theme's fixed 305px card height */
#content_box article.latestPost {
  height: 325px !important;
}

/* Balanced spacing inside card */
h2.title.front-view-title {
  padding: 10px 12px 0 !important;
  margin-bottom: 0 !important;
}

article.latestPost:hover,
article.latestPost.excerpt:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--tm-shadow-hover) !important;
  border-color: var(--tm-border) !important;
}

/* Thumbnail zoom on hover */
article.latestPost .featured-thumbnail {
  overflow: hidden !important;
  position: relative !important;
}

article.latestPost .featured-thumbnail img {
  transition: transform 0.35s ease !important;
}

article.latestPost:hover .featured-thumbnail img {
  transform: scale(1.04) !important;
}

/* Card titles: serif heading */
h2.title.front-view-title a {
  font-family: var(--tm-font-heading) !important;
  font-weight: 700 !important;
  color: var(--tm-text) !important;
  transition: color var(--tm-ease) !important;
  line-height: 1.4 !important;
  text-decoration: none !important;
}

h2.title.front-view-title a:hover {
  color: var(--tm-brand) !important;
}

/* Card metadata */
.post-info {
  padding: 6px 0px 0px !important;
  font-size: 12.5px !important;
  color: var(--tm-text-muted) !important;
  margin-bottom: 0 !important;
}

.post-info a {
  color: var(--tm-text-muted) !important;
  transition: color var(--tm-ease) !important;
}

.post-info a:hover {
  color: var(--tm-brand) !important;
}

/* --------------------------------------------------------------------------
   6. TABBED CATEGORIES
   -------------------------------------------------------------------------- */
.tabbed-news-wrapper {
  background: var(--tm-card) !important;
  border-radius: var(--tm-radius) !important;
  border: none !important;
  overflow: hidden;
}

ul.responsive-tabs__list li,
.responsive-tabs .responsive-tabs__list__item {
  font-family: var(--tm-font-body) !important;
  font-weight: 500 !important;
  transition: color var(--tm-ease), border-color var(--tm-ease) !important;
}

ul.responsive-tabs__list li.responsive-tabs__list__item--active,
.responsive-tabs .responsive-tabs__list__item--active {
  color: var(--tm-brand) !important;
  border-bottom-color: var(--tm-brand) !important;
  font-weight: 700 !important;
}

/* Tabbed post items: consistent with sidebar */
.tabbed-news-wrapper .index-right-post-wrapper {
  transition: background-color var(--tm-ease) !important;
  cursor: pointer;
}

.tabbed-news-wrapper .index-right-post-wrapper:hover {
  background: #fafafa !important;
}

/* --------------------------------------------------------------------------
   7. SIDEBAR (index-right) — never override float/width
   -------------------------------------------------------------------------- */
.index-right {
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.index-right img {
  max-width: 100% !important;
  height: auto !important;
}

.index-right-post-wrapper {
  transition: background-color var(--tm-ease) !important;
  cursor: pointer;
}

.index-right-post-wrapper:hover {
  background: #f9f9f9 !important;
}

.index-right-post-wrapper a {
  transition: color var(--tm-ease) !important;
}

.index-right-post-wrapper a:hover {
  color: var(--tm-brand) !important;
}

.original-video-title {
  font-family: var(--tm-font-heading) !important;
  font-weight: 700 !important;
}

/* --------------------------------------------------------------------------
   8. BUTTONS — pill "Load More"
   -------------------------------------------------------------------------- */
.alm-load-more-btn,
.alm-btn-wrap .alm-load-more-btn {
  font-family: var(--tm-font-body) !important;
  font-weight: 600 !important;
  border-radius: 24px !important;
  letter-spacing: 0.03em;
  transition: all var(--tm-ease) !important;
  cursor: pointer !important;
}

.alm-load-more-btn:hover,
.alm-btn-wrap .alm-load-more-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(224, 63, 0, 0.2) !important;
}

/* --------------------------------------------------------------------------
   9. FOOTER
   -------------------------------------------------------------------------- */

/* Hide the massive category tag cloud — not useful */
.footer-cats {
  display: none !important;
}

.footer-cat-box a {
  font-family: var(--tm-font-body) !important;
  transition: opacity var(--tm-ease) !important;
}

.footer-cat-box a:hover {
  opacity: 0.75 !important;
}

.company-copyright-text {
  font-family: var(--tm-font-body) !important;
}

/* --------------------------------------------------------------------------
   10. SINGLE ARTICLE PAGE
   -------------------------------------------------------------------------- */

/* Reading progress bar */
.teepr-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--tm-brand), #ff6a33);
  z-index: 99999;
  transition: width 80ms linear;
  border-radius: 0 2px 2px 0;
}

/* Blockquotes */
.post-single-content blockquote {
  border-left: 4px solid var(--tm-brand) !important;
  background: #fff8f5 !important;
  padding: 16px 20px 16px 24px !important;
  margin: 24px 0 !important;
  border-radius: 0 var(--tm-radius-sm) var(--tm-radius-sm) 0 !important;
}

/* Article title */
.single-title {
  font-family: var(--tm-font-heading) !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.01em;
}

/* Author box */
.author-box {
  border-radius: var(--tm-radius) !important;
}

.author-box .avatar {
  border-radius: 50% !important;
}

/* Image captions */
.wp-caption-text {
  font-size: 13px !important;
  color: var(--tm-text-muted) !important;
}

/* --------------------------------------------------------------------------
   11. BACK TO TOP
   -------------------------------------------------------------------------- */
#move-to-top {
  border-radius: 50% !important;
  box-shadow: var(--tm-shadow-md) !important;
  transition: all var(--tm-ease) !important;
}

#move-to-top:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--tm-shadow-hover) !important;
}

/* --------------------------------------------------------------------------
   12. CATEGORY PILL BADGES — overlaid on card thumbnails
   -------------------------------------------------------------------------- */
.tm-cat-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  color: #fff;
  font-family: var(--tm-font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 3px;
  line-height: 1.4;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* --------------------------------------------------------------------------
   13. STICKY GLASS CATEGORY NAV
   -------------------------------------------------------------------------- */
/* Secondary nav — removed sticky/backdrop to avoid breaking fixed sidebar widgets */

/* --------------------------------------------------------------------------
   14-a. HOVER OVERLAY ON ARTICLE CARDS
   -------------------------------------------------------------------------- */
article.latestPost .featured-thumbnail::after {
  content: '繼續閱讀 \203A';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--tm-font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 1;
}

article.latestPost:hover .featured-thumbnail::after {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   14-b. ANIMATIONS — subtle, respects prefers-reduced-motion
   -------------------------------------------------------------------------- */
@keyframes tmFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

article.latestPost {
  animation: tmFadeUp 0.35s ease both;
}

.alm-listing article.latestPost:nth-child(1) { animation-delay: 0s; }
.alm-listing article.latestPost:nth-child(2) { animation-delay: 0.04s; }
.alm-listing article.latestPost:nth-child(3) { animation-delay: 0.08s; }
.alm-listing article.latestPost:nth-child(4) { animation-delay: 0.12s; }

@media (prefers-reduced-motion: reduce) {
  article.latestPost {
    animation: none !important;
  }

  article.latestPost:hover {
    transform: none !important;
  }

  article.latestPost .featured-thumbnail img {
    transition: none !important;
  }
}

/* --------------------------------------------------------------------------
   13. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 979px) {
  .slider-container {
    border-radius: var(--tm-radius) !important;
  }

  article.latestPost {
    border-radius: var(--tm-radius-sm) !important;
  }
}

@media (max-width: 767px) {
  .post-single-content p,
  .post-single-content div {
    font-size: 17px !important;
    line-height: 1.8 !important;
  }

  article.latestPost {
    border-radius: var(--tm-radius-sm) !important;
  }

  /* Cards: auto height on mobile, not fixed 325px */
  #content_box article.latestPost {
    height: auto !important;
  }

  /* Sidebar: stack below content on mobile */
  #page div.article {
    width: 100% !important;
    float: none !important;
  }

  .index-right {
    width: 100% !important;
    float: none !important;
  }
}

@media (max-width: 479px) {
  .alm-load-more-btn {
    width: 100% !important;
    text-align: center !important;
  }
}

/* --------------------------------------------------------------------------
   14. LAYOUT — desktop two-column with gutter, mobile stacks
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  #page div.article {
    width: 63% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .index-right {
    width: 35% !important;
    float: right !important;
  }
}

/* --------------------------------------------------------------------------
   15. MISC
   -------------------------------------------------------------------------- */

/* Focus states for keyboard nav (accessibility) */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--tm-brand) !important;
  outline-offset: 2px !important;
}

/* Search focus ring */
#searchform input[type="text"]:focus,
.search-wrapper input[type="text"]:focus {
  border-color: var(--tm-brand) !important;
  box-shadow: 0 0 0 3px rgba(224, 63, 0, 0.1) !important;
  outline: none !important;
}

/* Comment avatars */
.comment .avatar {
  border-radius: 50% !important;
}

/* Language switcher */
.language-switch-wrapper-index {
  font-family: var(--tm-font-body) !important;
}

/* Scroll trigger popup */
.scroll-trigger-text {
  font-family: var(--tm-font-heading) !important;
  font-weight: 700 !important;
}

/* ==========================================================================
   WIDGETS — Weather, Earthquake, AQI, Trending, Invoice, Dark Mode
   ========================================================================== */

/* --------------------------------------------------------------------------
   W1. SHARED WIDGET STYLES
   -------------------------------------------------------------------------- */
.tm-widget {
  background: var(--tm-card);
  border-radius: var(--tm-radius);
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--tm-border-light);
}

.tm-widget-header {
  font-family: var(--tm-font-heading);
  font-size: 16px;
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 2px solid var(--tm-brand);
  color: var(--tm-text);
}

/* --------------------------------------------------------------------------
   W2. TAIWAN INFO WIDGET (Weather + AQI + Earthquake combined)
   -------------------------------------------------------------------------- */
.tm-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--tm-border-light);
  font-size: 13px;
}

.tm-info-label {
  font-weight: 700;
  color: var(--tm-text-secondary);
  flex-shrink: 0;
}

.tm-aqi-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  padding: 3px 10px;
  border-radius: 3px;
}

.tm-eq-detail {
  font-size: 12px;
  color: var(--tm-text);
  text-align: right;
}

.tm-eq-time {
  color: var(--tm-text-muted);
  font-size: 11px;
}

.tm-weather-section {
  /* no extra wrapper needed */
}

/* --------------------------------------------------------------------------
   W2b. WEATHER TABS (inside Taiwan widget)
   -------------------------------------------------------------------------- */
.tm-weather-tabs {
  display: flex;
  border-bottom: 1px solid var(--tm-border-light);
}

.tm-weather-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: none;
  font-family: var(--tm-font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--tm-text-secondary);
  cursor: pointer;
  transition: all var(--tm-ease);
  border-bottom: 2px solid transparent;
}

.tm-weather-tab.active {
  color: var(--tm-brand);
  border-bottom-color: var(--tm-brand);
  font-weight: 700;
}

.tm-weather-body {
  display: none;
  padding: 14px;
}

.tm-weather-body.active {
  display: block;
}

.tm-weather-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.tm-weather-icon {
  font-size: 32px;
  line-height: 1;
}

.tm-weather-info {
  display: flex;
  flex-direction: column;
}

.tm-weather-temp {
  font-family: var(--tm-font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--tm-text);
  line-height: 1.1;
}

.tm-weather-range {
  font-size: 12px;
  color: var(--tm-text-muted);
}

.tm-weather-extra {
  margin-left: auto;
  text-align: right;
  font-size: 12px;
  color: var(--tm-text-secondary);
  line-height: 1.6;
}

/* (Earthquake + AQI are now inside the combined Taiwan widget) */

/* --------------------------------------------------------------------------
   W5. TRENDING TOP 10
   -------------------------------------------------------------------------- */
.tm-trending-list {
  padding: 0;
}

.tm-trending-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none !important;
  color: var(--tm-text) !important;
  border-bottom: 1px solid var(--tm-border-light);
  transition: background var(--tm-ease);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
}

.tm-trending-item:hover {
  background: #f9f9f9;
  color: var(--tm-brand) !important;
}

.tm-trending-rank {
  font-family: var(--tm-font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--tm-text-muted);
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.3;
}

.tm-trending-hot .tm-trending-rank {
  color: var(--tm-brand);
}

.tm-trending-title {
  flex: 1;
  font-family: var(--tm-font-body);
}

/* --------------------------------------------------------------------------
   W6. INVOICE CHECKER (統一發票)
   -------------------------------------------------------------------------- */
.tm-invoice-body {
  padding: 14px;
}

.tm-invoice-input-wrap {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.tm-invoice-input {
  flex: 1;
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-sm);
  padding: 8px 10px;
  font-size: 16px;
  font-family: var(--tm-font-body);
  letter-spacing: 0.1em;
  text-align: center;
  outline: none;
  transition: border-color var(--tm-ease);
}

.tm-invoice-input:focus {
  border-color: var(--tm-brand);
}

.tm-invoice-btn {
  background: var(--tm-brand);
  color: #fff;
  border: none;
  border-radius: var(--tm-radius-sm);
  padding: 8px 16px;
  font-family: var(--tm-font-body);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background var(--tm-ease);
}

.tm-invoice-btn:hover {
  background: var(--tm-brand-dark);
}

.tm-invoice-result {
  text-align: center;
  min-height: 24px;
  margin-bottom: 8px;
}

.tm-inv-win {
  color: var(--tm-brand);
  font-weight: 700;
  font-size: 15px;
}

.tm-inv-jackpot {
  font-size: 18px;
}

.tm-inv-miss {
  color: var(--tm-text-muted);
  font-size: 13px;
}

.tm-invoice-numbers {
  border-top: 1px solid var(--tm-border-light);
  padding-top: 10px;
}

.tm-inv-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  flex-wrap: wrap;
}

.tm-inv-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--tm-text-secondary);
  min-width: 60px;
}

.tm-inv-num {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--tm-text);
  background: var(--tm-border-light);
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.08em;
}

.tm-inv-extra {
  color: var(--tm-brand);
}

/* --------------------------------------------------------------------------
   W7. DARK MODE
   -------------------------------------------------------------------------- */
/* Dark mode removed */

/* ==========================================================================
   SINGLE ARTICLE PAGE FEATURES
   ========================================================================== */

/* --------------------------------------------------------------------------
   S1. FLOATING SHARE BAR
   -------------------------------------------------------------------------- */
.tm-share-bar {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 998;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tm-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  text-decoration: none !important;
}

.tm-share-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.tm-share-fb {
  background: #1877F2;
  color: #fff !important;
}

.tm-share-line {
  background: #06C755;
  color: #fff !important;
}

.tm-share-copy {
  background: #fff;
  color: #555;
  border: 1px solid #e0e0e0;
  position: relative;
}

.tm-copy-toast {
  position: absolute;
  left: 52px;
  top: 50%;
  transform: translateY(-50%);
  background: #333;
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.tm-copy-toast.show {
  opacity: 1;
}

/* Mobile: bottom bar */
@media (max-width: 767px) {
  .tm-share-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    transform: none;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 0;
    border-top: 1px solid #e8e8e8;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  }

  .tm-share-btn {
    width: 40px;
    height: 40px;
  }

  .tm-copy-toast {
    left: 50%;
    top: -36px;
    transform: translateX(-50%);
  }
}

/* --------------------------------------------------------------------------
   S2. READING TIME BADGE
   -------------------------------------------------------------------------- */
.tm-reading-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--tm-font-body);
  font-size: 13px;
  color: var(--tm-text-muted);
  margin: 4px 0 6px;
}

.tm-reading-time svg {
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   S3. RELATED ARTICLES
   -------------------------------------------------------------------------- */
.tm-related {
  margin: 30px 0;
  padding: 0;
}

.tm-related-header {
  font-family: var(--tm-font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--tm-text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--tm-brand);
}

.tm-related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tm-related-card {
  display: block;
  text-decoration: none !important;
  color: var(--tm-text) !important;
  border-radius: var(--tm-radius);
  overflow: hidden;
  background: var(--tm-card);
  border: 1px solid var(--tm-border-light);
  transition: transform 200ms ease, box-shadow 200ms ease;
  cursor: pointer;
}

.tm-related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--tm-shadow-md);
  color: var(--tm-brand) !important;
}

.tm-related-img {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
}

.tm-related-info {
  padding: 10px 12px 12px;
}

.tm-related-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--tm-brand);
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
}

.tm-related-title {
  font-family: var(--tm-font-heading) !important;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  color: inherit;
}

@media (max-width: 479px) {
  .tm-related-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   S4. PREV/NEXT NAVIGATION WITH THUMBNAILS
   -------------------------------------------------------------------------- */
.tm-postnav {
  display: flex;
  gap: 12px;
  margin: 24px 0;
}

.tm-postnav-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--tm-radius);
  background: var(--tm-card);
  border: 1px solid var(--tm-border-light);
  text-decoration: none !important;
  color: var(--tm-text) !important;
  transition: border-color 200ms ease, box-shadow 200ms ease;
  cursor: pointer;
}

.tm-postnav-item:hover {
  border-color: var(--tm-border);
  box-shadow: var(--tm-shadow-sm);
  color: var(--tm-brand) !important;
}

.tm-postnav-item img {
  width: 64px;
  height: 64px;
  border-radius: var(--tm-radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.tm-postnav-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tm-postnav-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--tm-text-muted);
  letter-spacing: 0.05em;
}

.tm-postnav-title {
  font-family: var(--tm-font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: inherit;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tm-postnav-next {
  text-align: right;
}

.tm-postnav-next .tm-postnav-text {
  align-items: flex-end;
}

@media (max-width: 479px) {
  .tm-postnav {
    flex-direction: column;
  }
}

/* --------------------------------------------------------------------------
   S5. BETTER AUTHOR CARD
   -------------------------------------------------------------------------- */
.tm-author-box {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 14px !important;
  border-radius: var(--tm-radius) !important;
  border: 1px solid var(--tm-border-light) !important;
  background: var(--tm-card) !important;
  box-shadow: none !important;
  margin-bottom: 12px !important;
}

.tm-author-box .author-image img {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  object-fit: cover;
}

.tm-author-box .author-description {
  font-size: 13px;
  color: var(--tm-text-secondary);
  line-height: 1.5;
}

/* Hide old top share button — replaced by floating bar */
.post-info .share-fb.post-top-fb {
  display: none !important;
}

/* --------------------------------------------------------------------------
   S6. ARTICLE TYPE TABS (TEEPR原創/採訪報導/etc)
   -------------------------------------------------------------------------- */
.article-type-wrapper {
  display: flex !important;
  gap: 0 !important;
  margin: 8px 0 8px !important;
  padding: 0 !important;
  border: 1px solid var(--tm-border) !important;
  border-radius: var(--tm-radius-sm) !important;
  overflow: hidden !important;
  line-height: 1 !important;
  width: fit-content !important;
}

.article-type {
  padding: 6px 14px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  font-family: var(--tm-font-body) !important;
  color: var(--tm-text-secondary) !important;
  background: #fafafa !important;
  border-right: 1px solid var(--tm-border) !important;
  text-align: center !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.article-type:last-child {
  border-right: none !important;
}

.article-type.selected-type {
  background: var(--tm-brand) !important;
  color: #fff !important;
  font-weight: 700 !important;
}

/* Move category below article type visually */
.below-title-container-2 {
  display: flex !important;
  flex-direction: column !important;
}

.below-title-container-2 .post-info {
  order: 2 !important;
  margin-top: 0 !important;
}

/* Mobile: article type tabs */
@media (max-width: 767px) {
  .article-type-wrapper {
    width: 100% !important;
  }
  .article-type {
    flex: 1 !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
  }
}

/* --------------------------------------------------------------------------
   S7. POLL SYSTEM
   -------------------------------------------------------------------------- */
/* Don't style the outer wrapper — poll-box-mid inside is display:none by default */
.teepr-poll-system {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}

.teepr-poll-system .q-title {
  font-family: var(--tm-font-heading) !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  text-align: center !important;
  margin-bottom: 14px !important;
}

.teepr-poll-system .choice-btn {
  background: #fff !important;
  border: 3px solid #333 !important;
  border-radius: var(--tm-radius-sm) !important;
  font-family: var(--tm-font-body) !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  cursor: pointer !important;
  transition: all var(--tm-ease) !important;
}

.teepr-poll-system .choice-btn:hover {
  background: var(--tm-brand) !important;
  color: #fff !important;
  border-color: var(--tm-brand) !important;
}

/* --------------------------------------------------------------------------
   S8. BOTTOM SHARE BUTTONS — don't override parent sizing
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   S9. BELOW-TITLE AREA — compact spacing to match mockup
   -------------------------------------------------------------------------- */
.below-title-container,
.below-title-container-2,
.below-title-container-3 {
  margin-bottom: 6px !important;
  margin-top: 0 !important;
  padding: 0 !important;
}

.below-title-container-3 {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-bottom: 8px !important;
}

.below-title-container-3 .thetime {
  font-size: 13px !important;
  color: var(--tm-text-muted) !important;
}

.below-title-container-3 .choose-lang {
  font-size: 12px !important;
  color: var(--tm-text-muted) !important;
}

/* Author box — compact inline layout */
.below-title-container .author-box {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 12px !important;
  margin: 0 !important;
  border-top: 1px solid var(--tm-border-light) !important;
  border-bottom: 1px solid var(--tm-border-light) !important;
}

.below-title-container .author-image {
  flex-shrink: 0 !important;
}

.below-title-container .author-image img,
.below-title-container .author-image .avatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
}

.below-title-container .author-link {
  font-size: 13px !important;
  line-height: 1.4 !important;
}

.below-title-container .author-description {
  font-size: 12px !important;
  color: var(--tm-text-muted) !important;
  margin-top: 2px !important;
}

/* Category tags — inline pills, no commas, no gray bg */
.below-title-container-2 {
  margin-bottom: 0 !important;
  padding: 0 !important;
}

.below-title-container-2 .post-info {
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}

/* Category pills — only the top one inside below-title-container-2 */
.below-title-container-2 .thecategory {
  font-size: 0 !important;
  letter-spacing: -1em !important;
  color: transparent !important;
  display: inline !important;
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
}

.below-title-container-2 .thecategory a {
  display: inline-block !important;
  background: var(--tm-brand) !important;
  color: #fff !important;
  padding: 2px 8px !important;
  border-radius: 3px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  letter-spacing: normal !important;
  margin-right: 4px !important;
  margin-bottom: 0px !important;
  border: 1px solid var(--tm-brand) !important;
}

.below-title-container-2 .thecategory a:hover {
  background: var(--tm-brand-dark) !important;
  border-color: var(--tm-brand-dark) !important;
  text-decoration: none !important;
}

/* Hide the old FB share button in post-info */
.below-title-container-2 .share-fb.post-top-fb {
  display: none !important;
}

/* Collapse the ad wrapper gap between category and article type */
.below-title-ad-wrapper {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
}

.below-title-ad-wrapper .mid-post-ad-text:empty {
  display: none !important;
}

.below-title-ad-wrapper .mid-post-ad-text {
  margin: 0 !important;
  padding: 0 !important;
}

/* Single page mobile fixes */
@media (max-width: 767px) {
  .below-title-container .author-box {
    gap: 8px !important;
  }

  .below-title-container .author-image img,
  .below-title-container .author-image .avatar {
    width: 36px !important;
    height: 36px !important;
  }

  .below-title-container .author-description {
    display: none !important;
  }

  .tm-related-grid {
    grid-template-columns: 1fr !important;
  }

  .tm-postnav {
    flex-direction: column !important;
  }

  .tm-share-bar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    transform: none !important;
    flex-direction: row !important;
    justify-content: center !important;
    gap: 12px !important;
    background: rgba(255,255,255,0.95) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    padding: 10px 0 !important;
    border-top: 1px solid #e8e8e8 !important;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08) !important;
  }

  .tm-share-bar .tm-share-btn {
    width: 40px !important;
    height: 40px !important;
  }

  /* Add bottom padding so floating bar doesn't cover content */
  .single .article {
    padding-bottom: 70px !important;
  }
}

/* --------------------------------------------------------------------------
   S10. WARNING BOX (copyright)
   -------------------------------------------------------------------------- */
.warning-box {
  font-size: 12px !important;
  color: var(--tm-text-muted) !important;
  background: #fafafa !important;
  padding: 14px !important;
  margin-top: 20px !important;
  border-radius: var(--tm-radius-sm) !important;
  line-height: 1.6 !important;
  border: 1px solid var(--tm-border-light) !important;
}

/* --------------------------------------------------------------------------
   S11. FORTUNE WIDGET
   -------------------------------------------------------------------------- */
.fortune-widget-wrapper {
  border-radius: var(--tm-radius) !important;
  overflow: hidden !important;
}

/* --------------------------------------------------------------------------
   S12. FEEDBACK BUTTONS
   -------------------------------------------------------------------------- */
.fb-btn {
  padding: 8px 24px !important;
  border: 2px solid var(--tm-border) !important;
  border-radius: 20px !important;
  background: #fff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  font-family: var(--tm-font-body) !important;
  transition: all var(--tm-ease) !important;
}

.fb-btn:hover {
  border-color: var(--tm-brand) !important;
  color: var(--tm-brand) !important;
}

/* --------------------------------------------------------------------------
   S13. SIDEBAR LATEST POSTS WIDGET
   -------------------------------------------------------------------------- */
.advanced-recent-posts.bigthumbs li {
  padding: 10px 14px !important;
  border-bottom: 1px solid var(--tm-border-light) !important;
  transition: background var(--tm-ease) !important;
}

.advanced-recent-posts.bigthumbs li:hover {
  background: #f9f9f9 !important;
}

.advanced-recent-posts.bigthumbs .big-thumb {
  border-radius: var(--tm-radius-sm) !important;
}

/* --------------------------------------------------------------------------
   S14. SCROLL DEPTH INDICATOR
   -------------------------------------------------------------------------- */
.tm-scroll-depth {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 997;
  background: var(--tm-card);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
  padding: 8px 14px;
  box-shadow: var(--tm-shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.tm-scroll-depth.visible {
  opacity: 1;
  transform: translateY(0);
}

.tm-scroll-pct {
  font-family: var(--tm-font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--tm-brand);
  line-height: 1;
}

.tm-scroll-label {
  font-size: 11px;
  color: var(--tm-text-muted);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   S15. BACK TO TOP BUTTON
   -------------------------------------------------------------------------- */
.tm-back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 997;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tm-brand);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--tm-shadow-md);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  pointer-events: none;
}

.tm-back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.tm-back-to-top:hover {
  background: var(--tm-brand-dark);
  box-shadow: var(--tm-shadow-hover);
}

/* Mobile: adjust positions to not overlap floating share bar */
@media (max-width: 767px) {
  .tm-scroll-depth {
    bottom: 130px;
    right: 12px;
    padding: 6px 10px;
  }

  .tm-scroll-pct {
    font-size: 16px;
  }

  .tm-back-to-top {
    bottom: 70px;
    right: 12px;
    width: 40px;
    height: 40px;
  }
}

