/* ======================================================
   大肚山產業創新基金會 - 官網前台自訂樣式 (vnstyle.css)
   WCAG 2.1 AA compliant / Bootstrap 5 / Swiper 11
   ====================================================== */

/* ============ CSS Variables ============ */
:root {
  --dadu-primary:       #1e4d8c;
  --dadu-primary-dark:  #14366a;
  /*--dadu-accent:        #e07b39;*/
  --dadu-text:          #2b2b2b;
  --dadu-text-muted:    #5c5c5c;
  --dadu-bg-section:    #f4f6f9;
  --dadu-border:        #d8e0ec;
  --dadu-footer-bg:     #1a2942;
  --dadu-footer-text:   #999;
  --dadu-focus-ring:    #e07b39;
}

/* ============ General Reset & Body ============ */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
  color: var(--dadu-text);
  font-size: 16px;
  line-height: 1.75;
  background: #fff;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--dadu-primary); text-decoration: none; }
a:hover { color: var(--dadu-accent); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--dadu-primary-dark);
  line-height: 1.4;
}

/* ============ Accessibility ============ */

/* Skip link – WCAG 2.4.1 */
.skip-link {
  position: absolute;
  left: -9999px;
  top: -9999px;
  z-index: 10000;
  padding: .5rem 1.25rem;
  background: var(--dadu-primary);
  color: #fff;
  border-radius: 4px;
  font-size: .95rem;
  font-weight: 600;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  outline: 3px solid var(--dadu-focus-ring);
  outline-offset: 2px;
}

/* Focus visible – WCAG 2.4.7 (never remove outline) */
:focus-visible {
  outline: 3px solid var(--dadu-focus-ring) !important;
  outline-offset: 2px !important;
}
:focus:not(:focus-visible) { outline: none; }

/* ============ Preloader ============ */
.loader-wrapper {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .45s ease;
}
.loader-wrapper.hidden { opacity: 0; pointer-events: none; }

.loader {
  width: 52px;
  height: 52px;
  border: 5px solid var(--dadu-border);
  border-top-color: var(--dadu-primary);
  border-radius: 50%;
  animation: spin .85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Header / Navbar ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: #fff;
}
.header::after {
  content: "";
  background: linear-gradient(to right, rgba(208,100,235,1) 0%, rgba(26,19,69,1) 100%);
  width: 100%;
  height: 3px;
  position: absolute;
  bottom: -3px;
  left: 0;
  z-index: 1;
}

.header .navbar { padding: 0; }

.header .navbar-brand {
  width: 250px;
  display: flex;
  align-items: center;
}
.header .navbar-brand img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

.header .navbar-toggler { border: 0; }

.header .navbar-nav { font-size: 1.2rem; }

.header .navbar-nav .nav-link {
  padding: 16px 24px;
  color: #2c3162;
  font-weight: 600;
  transition: color .18s, background .18s;
  text-decoration: none;
}
.header .navbar-nav .nav-link:hover,
.header .navbar-nav .nav-link:focus,
.header .navbar-nav .nav-link.active {
  color: #ffc85a !important;
  background-color: #2c3162;
}

.header .dropdown-menu {
  background-color: #2c3162;
  color: #fff;
  border-radius: 0;
  border: 0;
  padding: 0 8px;
  margin-top: 0;
}
.header .dropdown-item {
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .3);
  padding: 10px 0;
  font-size: .95rem;
  background: transparent;
  text-decoration: none;
}
.header .dropdown-item:hover,
.header .dropdown-item:focus {
  background-color: transparent !important;
  color: #ffc85a;
}
.header .dropdown-menu li:last-child .dropdown-item { border-bottom: 0; }
.header .dropdown-toggle::after { display: none; }

@media (min-width: 992px) {
  .header .navbar-brand { width: 350px; }
  .header .navbar-nav {
    justify-content: flex-end;
    width: 100%;
  }
}

/* ============ Banner / Hero Carousel ============ */
.banner-swiper {
  width: 100%;
  overflow: hidden;
  background: var(--dadu-primary-dark);
}
.banner-swiper .swiper-slide { line-height: 0; }
.banner-swiper .swiper-slide img {
  width: 100%;
  height: auto;
  display: block;
}

.banner-swiper .swiper-button-prev,
.banner-swiper .swiper-button-next {
  color: #fff;
  background: rgba(0, 0, 0, .35);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: background .2s;
}
.banner-swiper .swiper-button-prev:hover,
.banner-swiper .swiper-button-next:hover {
  background: rgba(0, 0, 0, .6);
}
.banner-swiper .swiper-button-prev::after,
.banner-swiper .swiper-button-next::after { font-size: 1rem; }

.banner-swiper .swiper-pagination-bullet-active {
  background: var(--dadu-accent);
}

@media (max-width: 767.98px) {
  .banner-swiper .swiper-slide img {
    width: 100%;
    height: auto;
  }
}

/* ============ Section Headings ============ */
.main-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: .18em;
  /*color: var(--dadu-primary-dark);*/
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
  padding-bottom: .75rem;
}
.main-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 3px;
  /*background: var(--dadu-accent);*/
  border-radius: 2px;
}

/* ============ Content Sections ============ */
.content {
  padding: 3rem 0;
}
.content.bg-section {
  background: var(--dadu-bg-section);
}

/* ============ Home – News Card ============ */
.card {
  border: 0;
  margin-bottom: 30px;
}

.card-img {
  border-radius: 8px;
  overflow: hidden;
}

.card-body {
  padding-left: 0;
  padding-right: 0;
}

.card-time {
  font-size: 0.85rem;
  color: #b0b0b0;
  margin-bottom: 8px;
}

.card-title {
  font-weight: bold;
}

.card-text {
  font-size: 1rem;
  color: #767d8c;
}
.news-card {
  border: 1px solid var(--dadu-border);
  border-radius: 12px;
  overflow: hidden;
  height: 100%;
  background: #fff;
  transition: transform .22s, box-shadow .22s;
  display: flex;
  flex-direction: column;
}
.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
}
.news-card .card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.news-card .card-date {
  font-size: .825rem;
  color: var(--dadu-text-muted);
  margin-bottom: .3rem;
}
.news-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dadu-primary-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.news-card .card-link {
  align-self: flex-start;
  margin-top: .75rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--dadu-primary);
}
/*.news-card .card-link:hover { color: var(--dadu-accent); }*/

/* ============ Home – Video Section ============ */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 6px 30px rgba(0, 0, 0, .14);
}
.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.about-preview {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--dadu-text);
}
.about-preview p:last-child { margin-bottom: 0; }

/* ============ Home – About / Movie Section ============ */
#movie { background-color: #e2ceed; }

.downbtn {
  position: absolute;
  top: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #e2ceed;
  transform: translate(-50%, -50%);
  left: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #8a6da7;
  font-size: 2rem;
  text-decoration: none;
  z-index: 1;
}
.downbtn:hover { color: #6a4d87; text-decoration: none; }
@media (min-width: 992px) {
  .downbtn { width: 95px; height: 95px; font-size: 3rem; }
}

/* ============ Home – Highlight Swiper ============ */
.highlight-swiper { padding-bottom: 3rem; }

.highlight-card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .09);
  background: #fff;
  height: 100%;
}
.highlight-card-body {
  padding: 1rem 1.1rem 1.25rem;
}
.highlight-card-body .card-date {
  font-size: .8rem;
  color: var(--dadu-text-muted);
  margin-bottom: .25rem;
}
.highlight-card-body .card-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--dadu-primary-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* ============ Home – Activity Swiper Navigation ============ */
.swiper-slide-txt {
  font-weight: bold;
  font-size: 1.4rem;
  margin-top: 30px;
  margin-bottom: 16px;
  color: var(--dadu-primary-dark);
  text-align: center;
}

#activity-Swiper {
  padding-bottom: 0;
}

#activity-Swiper .activity-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 30px;
}

#activity-Swiper .activity-nav .swiper-button-prev,
#activity-Swiper .activity-nav .swiper-button-next {
  position: static !important;
  top: auto !important;
  margin-top: 0 !important;
  flex-shrink: 0;
  --swiper-navigation-size: 20px;
}

#activity-Swiper .activity-nav .swiper-pagination {
  position: static !important;
  width: auto;
  flex-shrink: 0;
}

#activity-Swiper .activity-nav .swiper-button-next::after,
#activity-Swiper .activity-nav .swiper-button-prev::after {
  font-family: bootstrap-icons !important;
  font-weight: 400 !important;
  font-size: 1.4rem;
  color: #000;
}

#activity-Swiper .activity-nav .swiper-button-next::after {
  content: "\f135";
}

#activity-Swiper .activity-nav .swiper-button-prev::after {
  content: "\f12c";
}

@media (min-width: 992px) {
  .swiper-slide-txt { display: none; }
  .swiper-slide-next .swiper-slide-txt { display: block; }
}

/* ============ Breadcrumb ============ */
.breadcrumb-section {
  padding: .875rem 0;
}
.breadcrumb {
  margin-bottom: 30px;
  background: none;
  padding: 0;
  font-size: .875rem;
  color: #2c3162;
}
.breadcrumb-item a { color: #2c3162; }
.breadcrumb-item.active { color: #2c3162; }

/* ============ Sub-page Layout ============ */
.s-menu-title {
  font-size: 2rem;
  color: #2c3162;
  display: flex;
  align-items: center;
  font-weight: bold;
  margin-bottom: 30px;
}
.s-menu-title::before {
  content: "";
  width: 10px;
  height: 30px;
  background-color: #2c3162;
  position: relative;
  display: inline-block;
  margin-right: 8px;
}
.title {
  color: #3588a4;
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 30px;
  margin-top: 6px;
}
.read-more {
  color: #b49fcb;
}

/* ============ Card Flexbox (Activity / News List) ============ */
.card-flexbox {
  display: flex;
  align-items: center;
  margin-bottom: 50px;
}

.card-flexbox .card-img {
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.card-flexbox .card-img img {
  width: 100%;
  height: auto;
}

.card-flexbox .title {
  font-size: 1.2rem;
  color: #494949;
  border-bottom: 1px solid #dcdcdc;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  padding-bottom: 8px;
}

.card-flexbox p {
  color: #7d7c7f;
  font-size: 1rem;
  line-height: 1.5rem;
}

.card-flexbox .card-txt {
  padding: 20px 0;
  width: 100%;
  display: flex;
  flex-flow: column;
  justify-content: space-between;
  height: 100%;
}

.text-time {
  text-align: right;
  color: #c6c6c6;
}

@media (min-width: 992px) {
  .card-flexbox {
    flex-flow: nowrap;
    gap: 16px;
  }
  .card-flexbox .card-img {
    width: 40%;
  }
  .card-flexbox .card-txt {
    width: 60%;
  }
}

/* ============ List Page – Article Cards ============ */
.list-article {
  display: block;
  border: 1px solid var(--dadu-border);
  border-radius: 12px;
  padding: 1.4rem 1.5rem;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: box-shadow .2s, border-color .2s;
  margin-bottom: 1.25rem;
}
.list-article:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, .1);
  border-color: var(--dadu-primary);
  color: inherit;
  text-decoration: none;
}
.list-article .a-date {
  font-size: .82rem;
  color: var(--dadu-text-muted);
  margin-bottom: .2rem;
}
.list-article .a-badge { margin-bottom: .4rem; }
.list-article .a-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dadu-primary-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 .4rem;
}
.list-article .a-summary {
  font-size: .9rem;
  color: var(--dadu-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ Category Filter ============ */
.cat-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}
.cat-filter .btn {
  border-radius: 20px;
  font-size: .875rem;
  padding: .3rem 1rem;
  border-color: var(--dadu-primary);
  color: var(--dadu-primary);
  background: transparent;
}
.cat-filter .btn:hover,
.cat-filter .btn.active {
  background: var(--dadu-primary);
  color: #fff;
  border-color: var(--dadu-primary);
}

/* ============ Detail Page ============ */
.detail-header {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--dadu-border);
  margin-bottom: 2rem;
}
.detail-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dadu-primary-dark);
  line-height: 1.4;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin-top: .75rem;
  font-size: .9rem;
  color: var(--dadu-text-muted);
}

/* CMS – page-content HTML output */
.page-content {
  font-size: 1rem;
  line-height: 1.85;
}
.page-content h1, .page-content h2, .page-content h3 { margin-top: 1.75rem; margin-bottom: .875rem; }
.page-content img { max-width: 100%; border-radius: 6px; margin: 1rem 0; }
.page-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.page-content table th,
.page-content table td { border: 1px solid var(--dadu-border); padding: .5rem .75rem; }
.page-content table th { background: var(--dadu-bg-section); }
.page-content a { color: var(--dadu-primary); }

/* ============ Side Menu (sub-pages) ============ */
.side-menu {
  border: 1px solid var(--dadu-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.side-menu-heading {
  background: var(--dadu-primary);
  color: #fff;
  font-weight: 700;
  padding: .875rem 1.25rem;
  font-size: .95rem;
}
.side-menu .list-group-item {
  border-left: none;
  border-right: none;
  border-radius: 0;
  padding: .65rem 1.25rem;
  color: var(--dadu-text);
  font-size: .9rem;
  transition: background .15s;
}
.side-menu .list-group-item:hover,
.side-menu .list-group-item.active {
  background: var(--dadu-bg-section);
  color: var(--dadu-primary);
  border-color: var(--dadu-border);
}

/* ============ Pagination ============ */
.pagination-wrap {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}
.pagination .page-link {
  color: var(--dadu-primary);
  border-color: var(--dadu-border);
  padding: .5rem .875rem;
  font-size: .9rem;
}
.pagination .page-link:hover { background: var(--dadu-bg-section); }
.pagination .page-item.active .page-link {
  background: var(--dadu-primary);
  border-color: var(--dadu-primary);
  color: #fff;
}
.pagination .page-item.disabled .page-link { color: #adb5bd; }

/* ============ Contact / Message Board Form ============ */
.contact-info {
  background: var(--dadu-bg-section);
  border-radius: 12px;
  padding: 2rem;
  height: 100%;
}
.contact-info h3 { color: var(--dadu-primary-dark); margin-bottom: 1rem; }
.contact-info p { margin-bottom: .5rem; font-size: .95rem; }

.form-label .req { color: #dc3545; }

.captcha-group {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.captcha-group img {
  border: 1px solid var(--dadu-border);
  border-radius: 6px;
  height: 44px;
  width: auto;
  display: inline-block;
}
.field-validation-error { color: #dc3545; font-size: .85rem; display: block; margin-top: .25rem; }

/* ============ Buttons ============ */
/* .btn-primary {
  background: var(--dadu-primary);
  border-color: var(--dadu-primary);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--dadu-primary-dark);
  border-color: var(--dadu-primary-dark);
} */
.btn {
  border-radius: 15px;
}

.btn-primary {
  background-color: #8a6da7;
  border-color:  #8a6da7;
}

.btn-primary:hover {
  background-color: #6a4d87;
  border-color: #6a4d87;
}

/* ============ Footer ============ */
.footer-1 {
  background: #222;
  color: var(--dadu-footer-text);
  padding: 40px 0 0;
}
.footer-1 h2,
.footer-1 .footer-head {
  color: #fff;
  font-size: 1rem;
  font-weight: 300;
  margin-bottom: 1rem;
}
/* .footer-1 p,
.footer-1 address {
  font-size: .875rem;
  line-height: 1.8;
  color: var(--dadu-footer-text);
  font-style: normal;
} */
 .footer-1 p {
    font-size: 14px;
    line-height: 1.7;
    font-weight: 500;
    margin-bottom: 0px;
}
.footer-1 ul { padding: 0; }
.footer-1 ul li { list-style: none; margin-bottom: .3rem; }
.footer-1 a {
  color: var(--dadu-footer-text);
  text-decoration: none;
  transition: color .15s;
}
.footer-1 a:hover { color: #fff; text-decoration: underline; }

.footer-logo { display: flex; align-items: center; gap: 6px; margin-bottom: 1rem; }
.footer-logo img { margin-top: -8px; width: 70px; height: auto; display: inline-block; }
.footer-logo span { font-weight: 700; font-size: 1.2rem; color: #fff; }

.footer-social { display: flex; gap: .5rem; margin-top: .75rem; }
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 1.05rem;
  transition: background .2s;
  text-decoration: none;
}
.footer-social a:hover { background: var(--dadu-accent); color: #fff; }

.footer-1-bar {
  border-top: 1px solid #444;
  margin-top: 20px;
  padding: 15px 0;
  text-align: center;
  font-size: .82rem;
  color: #fff;
}

/* ============ Responsive ============ */
@media (max-width: 991.98px) {
  .main-title { font-size: 1.5rem; }
  .content { padding: 3rem 0; }
}
@media (max-width: 575.98px) {
  .main-title { font-size: 1.25rem; }
  .content { padding: 2.25rem 0; }
  .detail-title { font-size: 1.35rem; }
  .news-card .card-title { font-size: .95rem; }
}

/* ============ Utility ============ */

/* Banner placeholder（DB 無資料時版面佔位） */
.banner-placeholder {
  width: 100%;
  height: 260px;
  background: linear-gradient(135deg, var(--dadu-primary-dark) 0%, var(--dadu-primary) 100%);
}
@media (min-width: 768px) { .banner-placeholder { height: 400px; } }
@media (min-width: 992px) { .banner-placeholder { height: 540px; } }

/* 卡片圖片預留佔位（DB 增加圖片欄位後替換 .card-img-placeholder 為 <img>） */
.card-img-wrap {
  height: 220px;
  overflow: hidden;
  background: var(--dadu-bg-section);
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e0e8f4 0%, #c8d5e8 100%);
}
.text-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.badge-category { font-size: .75rem; font-weight: 500; }
