/* 3Hope custom overrides - OLMO template + Traditional Chinese */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&family=Rubik:wght@300;400;500;700&display=swap');

/* ========== 全域可讀文字（避免白字白底） ========== */
html {
  color-scheme: light;
}

body,
#page,
.page-content {
  color: #5a6270 !important;
  background-color: #ffffff !important;
}

body,
.font-main,
h1, h2, h3, h4, h5, h6,
.wsmenu-list > li > a.h-link,
.btn {
  font-family: "Noto Sans TC", "Rubik", "Microsoft JhengHei", sans-serif !important;
}

/* 標題預設深色 */
h1, h2, h3, h4, h5, h6,
span.font-main {
  color: #2f353e !important;
}

/* 內文、列表 */
p, li, td, th, label, .field-label {
  color: #5a6270;
}

/* 深色區塊內改回白字 */
.text-white,
.text-white h1,
.text-white h2,
.text-white h3,
.text-white h4,
.text-white h5,
.text-white h6,
.text-white p,
.text-white span,
.text-white li,
.text-white a,
.page-hero,
.page-hero h1,
.page-hero h2,
.page-hero h3,
.page-hero p,
.page-hero span,
#hero .text-white,
#hero .text-white h1,
#hero .text-white h2,
#hero .text-white p,
#hero .text-white span {
  color: #ffffff !important;
}

#hero .text-white .btn-tra-white,
#hero .text-white a.btn-tra-white {
  color: #ffffff !important;
}

/* 頁尾：模板沒有 bg-slate-950，強制深底 + 淺字；並避免被文章側欄蓋住 */
#footer-3,
footer.footer {
  background-color: #161821 !important;
  color: #d7dbe3 !important;
  position: relative;
  z-index: 5;
  clear: both;
  isolation: isolate;
}

#footer-3 h1,
#footer-3 h2,
#footer-3 h3,
#footer-3 h4,
#footer-3 h5,
#footer-3 h6,
#footer-3 p,
#footer-3 li,
#footer-3 span,
#footer-3 a,
#footer-3 .footer-company-line,
footer.footer h1,
footer.footer h2,
footer.footer h3,
footer.footer h4,
footer.footer h5,
footer.footer p,
footer.footer li,
footer.footer a {
  color: #e8eaef !important;
}

#footer-3 a:hover,
footer.footer a:hover {
  color: #ffffff !important;
}

#footer-3 .text-white\/75,
#footer-3 .text-white\/55 {
  color: rgba(232, 234, 239, 0.85) !important;
}

/* 導覽：透明選單在淺色區也要看得到（未捲動時） */
/* 首頁 Hero 為深色底時，仍用白字；捲動後模板 .scroll 會變深色字 */
.tra-menu.navbar-light .wsmainfull:not(.scroll) .wsmenu > .wsmenu-list > li > a.h-link {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* 內頁（無大圖 Hero）導覽改深色字，避免白字 */
body.inner-page .tra-menu.navbar-light .wsmainfull:not(.scroll) .wsmenu > .wsmenu-list > li > a.h-link {
  color: #181d27 !important;
  text-shadow: none;
}

/* WOW / animate 失敗時仍顯示內容（避免整頁空白） */
.wow {
  visibility: visible !important;
  opacity: 1 !important;
}

.animate__animated {
  animation-fill-mode: both;
}

/* JS 未載入時，3 秒後強制關閉 preloader */
#loading {
  animation: forceHideLoader 0s linear 3s forwards;
}

@keyframes forceHideLoader {
  to {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    display: none;
  }
}

/* 缺少的工具色（模板未編譯 slate） */
.bg-slate-900,
.bg-slate-950 {
  background-color: #161821 !important;
}

.bg-snow {
  background-color: #fbfbfd !important;
}

.text-gray-400 {
  color: #9ca3af !important;
}

.text-gray-500 {
  color: #6b7280 !important;
}

.text-slate-900 {
  color: #0f172a !important;
}

/* Brand logo sizing */
.desktoplogo img,
.smllogo img,
.footer-logo img {
  max-height: 42px;
  width: auto;
}

.smllogo img {
  max-height: 36px;
}

/* Hero 雙按鈕：拉開間距，避免重疊 */
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
}

.hero-cta-row .btn {
  flex: 0 0 auto;
}

/* 左按鈕額外右距（對應 .mr-5） */
.hero-cta-row .btn.mr-5 {
  margin-right: 1.25rem !important;
}

@media (max-width: 639px) {
  .hero-cta-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .hero-cta-row .btn {
    width: 100%;
    text-align: center;
  }
}

/* 首頁底部 CTA 區塊（強制深底白字，避免被全域 h2/p 色蓋掉） */
.home-bottom-cta {
  background-color: #161821 !important;
  background-image: linear-gradient(135deg, #161821 0%, #1e2330 55%, #2a2030 100%) !important;
  border-radius: 1.25rem !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  color: #ffffff !important;
  overflow: visible !important;
  /* 依需求：py-5 尺度（本專案 spacing 偏小，改用舒適的上下內距） */
  padding-top: 5rem !important;
  padding-bottom: 5rem !important;
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}

@media (min-width: 768px) {
  .home-bottom-cta {
    padding-top: 5rem !important;
    padding-bottom: 5rem !important;
    padding-left: 3rem !important;
    padding-right: 3rem !important;
  }
}

.home-bottom-cta h2,
.home-bottom-cta h3,
.home-bottom-cta p,
.home-bottom-cta span {
  color: #ffffff !important;
}

.home-bottom-cta-desc {
  color: rgba(255, 255, 255, 0.82) !important;
  line-height: 1.75;
}

.home-bottom-cta-actions {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.25rem !important;
  margin-top: 2rem;
}

.home-bottom-cta-actions .btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  flex: 0 0 auto !important;
  min-width: 10.5rem;
  padding: 0.85rem 1.35rem !important;
  line-height: 1.25 !important;
  text-decoration: none !important;
  box-sizing: border-box;
}

.home-bottom-cta-actions .btn.mr-5 {
  margin-right: 1.25rem !important;
}

/* 深底上的來電按鈕：白框清楚、hover 填白 */
.home-bottom-cta .home-cta-phone,
a.home-cta-phone {
  background-color: transparent !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
}

.home-bottom-cta .home-cta-phone:hover,
a.home-cta-phone:hover {
  background-color: #ffffff !important;
  border-color: #ffffff !important;
  color: #161821 !important;
}

@media (max-width: 639px) {
  .home-bottom-cta-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem !important;
  }

  .home-bottom-cta-actions .btn {
    width: 100%;
    min-width: 0;
    text-align: center;
  }
}

/* 首頁「查看全部案例」：避免 flex 撐成空框、維持緊湊 CTA */
.projects-all-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto !important;
  align-self: flex-start;
  width: auto !important;
  max-width: 100%;
  white-space: nowrap;
  box-sizing: border-box;
  padding: 0.75rem 1.25rem !important;
  line-height: 1.25 !important;
  text-decoration: none;
}

@media (min-width: 768px) {
  .projects-all-btn {
    align-self: flex-end;
  }
}

/* Portfolio cards */
.portfolio-card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background: #fff;
  height: 100%;
  color: #5a6270;
}

.portfolio-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
}

.portfolio-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

a.portfolio-card:hover h3,
a.portfolio-card:hover h4 {
  color: #ff5a3c !important;
}

.portfolio-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center top;
  display: block;
  background: #f3f4f6;
}

.portfolio-card .pc-body {
  padding: 1.1rem 1.25rem 1.35rem;
}

.portfolio-card .pc-body h3,
.portfolio-card .pc-body h4 {
  color: #2f353e !important;
}

.portfolio-card .pc-tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #ff5a3c !important;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

/* Contact form WebForms controls */
.contact-form .form-control,
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea,
.contact-form select {
  width: 100%;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 16px;
  color: #333 !important;
  background: #fff !important;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: "Noto Sans TC", "Rubik", sans-serif;
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-form .form-control:focus,
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #ff5a3c;
  box-shadow: 0 0 0 3px rgba(255, 90, 60, 0.12);
}

.contact-form .field-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: #222 !important;
}

.contact-form .field-wrap {
  margin-bottom: 1.1rem;
}

.contact-form .field-error {
  color: #d32f2f !important;
  font-size: 13px;
  margin-top: 0.25rem;
  display: block;
}

.contact-form .form-success {
  background: #e8f8ef;
  border: 1px solid #a7e3c0;
  color: #1b7a45 !important;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.contact-form .form-fail {
  background: #fdecea;
  border: 1px solid #f5c2c0;
  color: #b42318 !important;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* Inner page hero strip */
.page-hero {
  background: linear-gradient(135deg, #1e2330 0%, #2f3648 55%, #ff5a3c 160%);
  color: #fff;
  padding: 7.5rem 0 3.5rem;
}

.page-hero h1 {
  color: #fff !important;
  font-weight: 700;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* Service icon tiles */
.service-tile {
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  height: 100%;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  color: #5a6270;
}

.service-tile:hover {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
  transform: translateY(-3px);
}

.service-tile h3,
.service-tile h4 {
  color: #2f353e !important;
}

/* Blog cards */
.blog-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
  height: 100%;
  color: #5a6270;
}

a.blog-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

a.blog-card-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
}

a.blog-card-link:hover .bc-body h2 {
  color: #ff5a3c !important;
}

.blog-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.blog-card .bc-body {
  padding: 1.25rem 1.35rem 1.5rem;
}

.blog-card .bc-body h2,
.blog-card .bc-body h3 {
  color: #2f353e !important;
}

/* Blog article detail — 自訂版面，避免模板 grid col-span / height:100% 互撞 */
.blog-post-section {
  position: relative;
  z-index: 1;
  overflow: visible;
  background: #ffffff;
}

.blog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 992px) {
  .blog-layout {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 2.5rem;
  }
}

.blog-main,
.blog-aside {
  min-width: 0;
  max-width: 100%;
}

.blog-aside {
  align-self: start;
}

/* 蓋過全域 .service-tile { height:100% }，避免側欄白底被拉高蓋住 footer */
.blog-post-section .blog-tile,
.blog-post-section .service-tile {
  height: auto !important;
  max-height: none !important;
  transform: none;
}

.blog-post-section .blog-tile:hover,
.blog-post-section .service-tile:hover {
  transform: none;
}

.blog-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.blog-sidebar-btn {
  display: block !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.blog-article-cover {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

/* 案例介紹頁大圖 */
.case-hero-shot {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
  border: 1px solid #eef0f4;
  background: #f8f9fb;
}

.case-hero-shot img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 520px;
  object-fit: cover;
  object-position: top center;
}

.blog-article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

.prose-article {
  font-size: 16px;
  line-height: 1.85;
  color: #5a6270;
}

.prose-article h2 {
  font-size: 1.45rem;
  margin: 2rem 0 0.85rem;
  color: #2f353e !important;
  font-weight: 700;
}

.prose-article h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.65rem;
  color: #2f353e !important;
  font-weight: 600;
}

.prose-article p {
  margin: 0 0 1rem;
}

.prose-article ul,
.prose-article ol {
  margin: 0 0 1.1rem 1.25rem;
  padding: 0;
}

.prose-article li {
  margin-bottom: 0.4rem;
}

.prose-article a {
  color: #ff5a3c;
  text-decoration: underline;
}

.prose-article a:hover {
  color: #e14a2f;
}

.prose-article strong {
  color: #2f353e;
  font-weight: 600;
}

.prose-article blockquote {
  margin: 1.25rem 0;
  padding: 0.9rem 1.1rem;
  border-left: 4px solid #ff5a3c;
  background: #fbfbfd;
  color: #5a6270;
  border-radius: 0 10px 10px 0;
}

.prose-article .callout {
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  background: #fff7f5;
  border: 1px solid #ffe0d8;
  border-radius: 12px;
}

.related-posts li a {
  display: block;
  text-decoration: none;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eef0f4;
  color: inherit;
}

.related-posts li:last-child a {
  border-bottom: 0;
  padding-bottom: 0;
}

.related-posts .rp-cat {
  display: block;
  font-size: 12px;
  color: #ff5a3c !important;
  margin-bottom: 0.2rem;
}

.related-posts .rp-title {
  display: block;
  color: #2f353e !important;
  font-weight: 500;
  line-height: 1.45;
}

.related-posts li a:hover .rp-title {
  color: #ff5a3c !important;
}

/* Stats strip */
.stat-num {
  font-size: 2.25rem;
  font-weight: 700;
  color: #ff5a3c !important;
  line-height: 1.1;
}

/* Footer company text */
.footer-company-line {
  font-size: 13px;
  opacity: 0.9;
  line-height: 1.7;
}

/* Ensure Chinese text line-height comfortable */
p, li, .h-link {
  line-height: 1.7;
}

/* CTA 深色區塊 */
.bg-slate-900 h2,
.bg-slate-900 p,
.bg-slate-950 h2,
.bg-slate-950 p {
  color: #ffffff !important;
}

/* 合作廠商 logos */
.partners-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  align-items: stretch;
}

@media (min-width: 640px) {
  .partners-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .partners-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.partner-logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  padding: 1.25rem 1rem;
  background: #ffffff;
  border: 1px solid #eef0f4;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.partner-logo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.partner-logo-card img {
  max-width: 100%;
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: none;
}

/* 團隊頭像（舊站插畫） */
.team-avatar {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 1;
  margin-left: auto;
  margin-right: auto;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #f3f4f6 0%, #e8eaed 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  display: block;
}

.team-card h4 {
  color: #2f353e !important;
}
