/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/

/* ==========================================================================
   新北市舊貨業職業工會 — 全站樣式
   結構在 Bricks template（Bricks > Templates），這裡用 shgtu-* class 上樣式。
   ========================================================================== */
:root {
  --shgtu-brand: #1f5fa8;
  --shgtu-brand-dark: #163f73;
  --shgtu-accent: #f5b400;      /* 取自舊站 header 圖的黃色 */
  --shgtu-text: #1f2933;
  --shgtu-muted: #5b6676;
  --shgtu-line: #e2e6ec;
  --shgtu-bg: #f5f7fa;
  --shgtu-radius: 10px;
  --shgtu-width: 1120px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--shgtu-text);
  background: #fff;
}
a { color: var(--shgtu-brand); }
a:hover { color: var(--shgtu-brand-dark); }
:focus-visible { outline: 3px solid var(--shgtu-accent); outline-offset: 2px; }

.shgtu-wrap.brxe-container { width: 100%; max-width: var(--shgtu-width); padding-left: 20px; padding-right: 20px; }

/* ---------- Header ---------- */
.shgtu-top { background: #fff; padding: 14px 0; }
.shgtu-top__inner.brxe-container { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
.shgtu-brand.brxe-block { flex-direction: row; align-items: center; gap: 12px; width: auto; text-decoration: none; color: var(--shgtu-text); }
.shgtu-brand__mark, .shgtu-brand__mark img { display: block; width: 56px; height: auto; flex: none; }
.shgtu-brand__text.brxe-block { width: auto; }
.shgtu-brand__name { font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: .06em; color: var(--shgtu-brand-dark); }
.shgtu-brand__en { font-size: 12px; line-height: 1.3; letter-spacing: .08em; color: var(--shgtu-muted); }
.shgtu-top__info { font-size: 15px; color: var(--shgtu-muted); text-align: right; }
.shgtu-top__info a { font-size: 20px; font-weight: 700; text-decoration: none; white-space: nowrap; }

.shgtu-nav { background: var(--shgtu-brand); }
.shgtu-nav .bricks-nav-menu { flex-wrap: wrap; }
.shgtu-nav .bricks-nav-menu > li { margin: 0; }
.shgtu-nav .bricks-nav-menu > li > a { display: block; padding: 13px 16px; color: #fff; font-weight: 600; text-decoration: none; line-height: 1.4; }
.shgtu-nav .bricks-nav-menu > li > a:hover,
.shgtu-nav .bricks-nav-menu > li.current-menu-item > a,
.shgtu-nav .bricks-nav-menu > li.current-menu-parent > a,
.shgtu-nav .bricks-nav-menu > li.current-menu-ancestor > a,
.shgtu-nav .bricks-nav-menu > li.current-post-ancestor > a,
.shgtu-nav .bricks-nav-menu > li.current-category-ancestor > a { background: var(--shgtu-brand-dark); box-shadow: inset 0 -3px 0 var(--shgtu-accent); }
.shgtu-nav .bricks-mobile-menu-toggle { color: #fff; margin: 10px 0 10px auto; }
.shgtu-nav .bricks-mobile-menu-wrapper::before { background: var(--shgtu-brand-dark); }
.shgtu-nav .bricks-mobile-menu-wrapper .bricks-mobile-menu > li > a { color: #fff; padding: 0 24px; }

/* ---------- 首頁 ---------- */
.shgtu-hero { background: linear-gradient(120deg, var(--shgtu-brand-dark), var(--shgtu-brand) 60%, #3d86d6); color: #fff; padding: 64px 0; }
.shgtu-hero__title { color: #fff; font-size: clamp(28px, 4.5vw, 44px); line-height: 1.25; margin: 0 0 12px; letter-spacing: .04em; }
.shgtu-hero__text { font-size: clamp(16px, 2vw, 20px); max-width: 34em; opacity: .95; }
.shgtu-hero__actions.brxe-block { flex-direction: row; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.shgtu-btn { display: inline-block; padding: 10px 26px; border: 2px solid #fff; border-radius: 999px; color: #fff; font-weight: 700; text-decoration: none; }
.shgtu-btn:hover { background: #fff; color: var(--shgtu-brand-dark); }
.shgtu-btn--brand { background: var(--shgtu-brand); border-color: var(--shgtu-brand); margin: 20px 0 28px; }
.shgtu-btn--brand:hover { background: var(--shgtu-brand-dark); border-color: var(--shgtu-brand-dark); color: #fff; }
.shgtu-btn--solid { background: var(--shgtu-accent); border-color: var(--shgtu-accent); color: #1b2a3a; }
.shgtu-btn--solid:hover { background: #ffc61a; border-color: #ffc61a; color: #1b2a3a; }

.shgtu-home { padding: 56px 0; }
.shgtu-home--alt { background: var(--shgtu-bg); }
.shgtu-section-title { font-size: 26px; margin: 0 0 24px; }
.shgtu-newsgrid.brxe-block { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.shgtu-news { border: 1px solid var(--shgtu-line); border-radius: var(--shgtu-radius); padding: 24px 24px 8px; background: #fff; }
.shgtu-news__bar.brxe-block { flex-direction: row; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 3px solid var(--shgtu-brand); margin-bottom: 4px; }
.shgtu-news__title { font-size: 22px; margin: 0; }
.shgtu-more { font-size: 15px; text-decoration: none; }
.shgtu-more::after { content: " ›"; }
.shgtu-news__item { padding: 16px 0; border-bottom: 1px solid var(--shgtu-line); }
.shgtu-news__item:last-child { border-bottom: 0; }
.shgtu-news__date, .shgtu-list__date, .shgtu-date { font-size: 14px; color: var(--shgtu-muted); font-variant-numeric: tabular-nums; }
.shgtu-news__head { font-size: 18px; line-height: 1.5; margin: 2px 0 4px; }
.shgtu-news__head a, .shgtu-list__head a { color: var(--shgtu-text); text-decoration: none; }
.shgtu-news__head a:hover, .shgtu-list__head a:hover { color: var(--shgtu-brand); text-decoration: underline; }
.shgtu-news__text { font-size: 15px; color: var(--shgtu-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.shgtu-tiles.brxe-block { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.shgtu-tile.brxe-block { position: relative; background: #fff; border: 1px solid var(--shgtu-line); border-radius: var(--shgtu-radius); padding: 22px 56px 22px 24px; text-decoration: none; color: var(--shgtu-text); transition: border-color .15s, box-shadow .15s; }
.shgtu-tile.brxe-block::after { content: "›"; position: absolute; right: 22px; top: 50%; transform: translateY(-54%); font-size: 28px; line-height: 1; color: #a9b3c1; transition: transform .15s, color .15s; }
.shgtu-tile.brxe-block:hover { border-color: var(--shgtu-brand); box-shadow: 0 6px 18px rgba(22, 63, 115, .10); }
.shgtu-tile.brxe-block:hover::after { color: var(--shgtu-brand); transform: translate(4px, -54%); }
.shgtu-tile__name { font-size: 19px; margin: 0 0 2px; color: var(--shgtu-text); }
.shgtu-tile.brxe-block:hover .shgtu-tile__name { color: var(--shgtu-brand); }
.shgtu-tile__desc { font-size: 15px; color: var(--shgtu-muted); }

/* ---------- 內頁 ---------- */
.shgtu-pagehead { background: var(--shgtu-bg); border-bottom: 1px solid var(--shgtu-line); padding: 28px 0 32px; }
.shgtu-crumbs { font-size: 14px; color: var(--shgtu-muted); gap: 6px; flex-wrap: wrap; }
.shgtu-crumbs a { text-decoration: none; }
.shgtu-title { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.35; margin: 8px 0 0; }
.shgtu-body { padding: 40px 0 64px; }
.shgtu-main.brxe-block { max-width: none; }
.shgtu-content, .shgtu-date, .shgtu-postnav { max-width: 880px; }
.shgtu-content:has(table, .gallery, .shgtu-contact) { max-width: none; }
.shgtu-date { margin-bottom: 16px; }

/* 文章內容：舊站帶過來的 HTML，含行內樣式與表格 */
.shgtu-content { width: 100%; overflow-wrap: anywhere; }
.shgtu-content > * + * { margin-top: 1em; }
.shgtu-content h2, .shgtu-content h3, .shgtu-content h4 { margin-top: 1.6em; line-height: 1.4; color: var(--shgtu-brand-dark); }
.shgtu-content h2 { font-size: 24px; } .shgtu-content h3 { font-size: 21px; } .shgtu-content h4 { font-size: 19px; }
.shgtu-content img { max-width: 100%; height: auto; }
.shgtu-content iframe { max-width: 100%; border: 0; }
.shgtu-content ul, .shgtu-content ol { padding-left: 1.5em; }
.shgtu-content table { max-width: 100%; border-collapse: collapse; overflow-wrap: normal; }
.shgtu-content table p { margin: 0; }
.shgtu-content table p + p { margin-top: .5em; }
.shgtu-content td, .shgtu-content th { border: 1px solid var(--shgtu-line); padding: 8px 10px; vertical-align: top; }
.shgtu-content a[href$=".doc"], .shgtu-content a[href$=".docx"], .shgtu-content a[href$=".pdf"] { font-weight: 600; }
/* [gallery] 短代碼：改用 grid，蓋掉 WordPress 內建的 float 版型 */
.shgtu-content .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 1.5em 0 0 !important; }
.shgtu-content .gallery .gallery-item { width: 100% !important; max-width: none !important; float: none !important; margin: 0 !important; padding: 0 !important; }
.shgtu-content .gallery br { display: none; }
.shgtu-content .gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 0 !important; border-radius: 6px; }
/* 聯絡我們：左聯絡資訊、右地圖、下方表單 */
.shgtu-contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 28px; align-items: stretch; }
.shgtu-contact__info { background: var(--shgtu-bg); border: 1px solid var(--shgtu-line); border-radius: var(--shgtu-radius); padding: 28px; }
.shgtu-contact__info h2 { margin-top: 0; }
.shgtu-contact__info dl { margin: 16px 0 0; }
.shgtu-contact__info dt { font-size: 14px; font-weight: 600; color: var(--shgtu-muted); }
.shgtu-contact__info dd { margin: 0 0 16px; }
.shgtu-contact__info dd:last-child { margin-bottom: 0; }
.shgtu-contact__info a { text-decoration: none; }
.shgtu-contact__map { min-height: 360px; border-radius: var(--shgtu-radius); overflow: hidden; border: 1px solid var(--shgtu-line); }
.shgtu-contact__map iframe { display: block; width: 100%; height: 100%; min-height: 360px; }
.shgtu-content > .shgtu-contact + h2 { margin-top: 48px; }
.shgtu-content .fluentform textarea { min-height: 180px; }
.shgtu-content .ff-btn-submit { background: var(--shgtu-brand) !important; border-radius: 999px; padding: 10px 28px; }

.shgtu-postnav { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--shgtu-line); width: 100%; gap: 16px; }
.shgtu-postnav a { text-decoration: none; }
.shgtu-postnav .title { font-size: 17px; font-weight: 600; line-height: 1.5; margin: 0; }
.shgtu-postnav .label { font-size: 14px; color: var(--shgtu-muted); }

/* ---------- 分類列表 ---------- */
.shgtu-album.brxe-block { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.shgtu-album__item.brxe-block { border: 1px solid var(--shgtu-line); border-radius: var(--shgtu-radius); overflow: hidden; background: #fff; text-decoration: none; color: var(--shgtu-text); transition: border-color .15s, box-shadow .15s; }
.shgtu-album__item.brxe-block:hover { border-color: var(--shgtu-brand); box-shadow: 0 6px 18px rgba(22, 63, 115, .10); }
.shgtu-album__img, .shgtu-album__img img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.shgtu-album__name { font-size: 17px; line-height: 1.5; margin: 0; padding: 14px 16px 16px; }
.shgtu-album__item.brxe-block:hover .shgtu-album__name { color: var(--shgtu-brand); }
.shgtu-list.brxe-block { max-width: 880px; }
.shgtu-subnav.brxe-block { flex-direction: row; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.shgtu-subnav a { padding: 6px 18px; border: 1px solid var(--shgtu-line); border-radius: 999px; text-decoration: none; font-size: 15px; color: var(--shgtu-text); }
.shgtu-subnav a:hover { border-color: var(--shgtu-brand); color: var(--shgtu-brand); }
.shgtu-subnav a[aria-current="page"] { background: var(--shgtu-brand); border-color: var(--shgtu-brand); color: #fff; }
.shgtu-list__item.brxe-block { flex-direction: row; align-items: baseline; gap: 20px; padding: 16px 4px; border-bottom: 1px solid var(--shgtu-line); }
.shgtu-list__date { flex: 0 0 6.5em; }
.shgtu-list__head { font-size: 18px; font-weight: 600; line-height: 1.5; margin: 0; }
.shgtu-pager { margin-top: 32px; }
.shgtu-pager .page-numbers { min-width: 40px; height: 40px; border-radius: 8px; }
.shgtu-pager .page-numbers.current { background: var(--shgtu-brand); color: #fff; }

.shgtu-search { width: 100%; max-width: 480px; margin-bottom: 28px; }
.shgtu-search input[type="search"] { border: 1px solid var(--shgtu-line); border-radius: 999px; padding: 0 18px; line-height: 44px; width: 100%; }

/* ---------- Footer ---------- */
.shgtu-foot { background: #152a45; color: #d5deea; padding: 48px 0 40px; font-size: 15px; }
.shgtu-foot__cols.brxe-container { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; }
.shgtu-foot__title { color: #fff; font-size: 18px; margin: 0 0 12px; }
.shgtu-foot a { color: #d5deea; text-decoration: none; }
.shgtu-foot a:hover { color: #fff; text-decoration: underline; }
.shgtu-foot__links.brxe-block { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; }
.shgtu-copy { background: #0f2036; color: #9fb0c5; font-size: 13px; padding: 14px 0; }
.shgtu-copy__inner.brxe-container { flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.shgtu-copy a { color: #c4d2e3; }

/* ---------- 窄螢幕 ---------- */
/* 桌機窄版：10 個選單項目縮一點才不會折行 */
@media (min-width: 992px) and (max-width: 1140px) {
  .shgtu-nav .bricks-nav-menu > li > a { padding: 13px 10px; font-size: 15px; }
}
@media (max-width: 991px) {
  .shgtu-nav__inner.brxe-container { align-items: flex-end; }
}
@media (max-width: 767px) {
  body { font-size: 16px; }
  .shgtu-top__info { font-size: 0; }                 /* 只留電話 */
  .shgtu-top__info a { font-size: 17px; }
  .shgtu-brand__mark, .shgtu-brand__mark img { width: 44px; }
  .shgtu-brand__name { font-size: 19px; letter-spacing: .02em; }
  .shgtu-brand__en { display: none; }
  .shgtu-hero { padding: 44px 0; }
  .shgtu-home { padding: 36px 0; }
  .shgtu-newsgrid.brxe-block, .shgtu-foot__cols.brxe-container, .shgtu-contact { grid-template-columns: 1fr; }
  .shgtu-tiles.brxe-block { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .shgtu-list__item.brxe-block { flex-direction: column; gap: 2px; }
  .shgtu-list__date { flex: none; }
  .shgtu-content { overflow-x: auto; }               /* 舊文章的寬表格可橫向捲動 */
}
@media (max-width: 480px) {
  .shgtu-top__info { display: none; }                /* 手機放不下站名＋電話；電話在 footer 與聯絡我們 */
}
@media (max-width: 420px) {
  .shgtu-tiles.brxe-block, .shgtu-foot__links.brxe-block { grid-template-columns: 1fr; }
}
