/*
Theme Name: STOPWATERS 防水工程
Theme URI: https://www.stopwaters.com/
Author: STOPWATERS
Description: STOPWATERS 專業防水工程品牌主題，針對桃園與台中以北服務區域建立快速、可讀、可擴充的內容架構。
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: stopwaters
*/

:root {
  --sw-navy: #0b2f52;
  --sw-navy-deep: #071f38;
  --sw-blue: #1b77b7;
  --sw-sky: #49b4dc;
  --sw-ice: #eef7fb;
  --sw-mist: #f7fbfd;
  --sw-ink: #102a43;
  --sw-muted: #5d7185;
  --sw-line: #d9e6ee;
  --sw-white: #fff;
  --sw-radius: 18px;
  --sw-shadow: 0 18px 45px rgba(7, 31, 56, .12);
  --sw-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--sw-ink);
  background: var(--sw-white);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sw-blue); text-decoration: none; }
a:hover { color: var(--sw-navy); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--sw-sky);
  outline-offset: 3px;
}
img { display: block; max-width: 100%; height: auto; }
svg { max-width: 100%; }
.container { width: min(calc(100% - 40px), var(--sw-width)); margin-inline: auto; }
.narrow { width: min(calc(100% - 40px), 820px); margin-inline: auto; }
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px;
  overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(217,230,238,.9); backdrop-filter: blur(12px);
}
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--sw-navy); font-weight: 800; letter-spacing: .06em; }
.brand:hover { color: var(--sw-blue); }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; color: var(--sw-white); background: var(--sw-navy);
  border-radius: 12px; font-size: 18px; font-weight: 900; box-shadow: 0 6px 16px rgba(11,47,82,.2);
}
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: 17px; }
.brand-copy small { margin-top: 4px; color: var(--sw-muted); font-size: 11px; letter-spacing: .08em; font-weight: 600; }
.primary-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.primary-nav a { display: inline-flex; padding: 10px 12px; color: var(--sw-ink); font-size: 14px; font-weight: 650; border-radius: 10px; }
.primary-nav a:hover { color: var(--sw-blue); background: var(--sw-ice); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 19px;
  border: 1px solid transparent; border-radius: 999px; background: var(--sw-blue); color: var(--sw-white);
  font-size: 14px; font-weight: 750; line-height: 1.3; text-align: center; transition: .2s ease;
}
.button:hover { color: var(--sw-white); background: var(--sw-navy); transform: translateY(-1px); }
.button.secondary { color: var(--sw-navy); background: var(--sw-white); border-color: rgba(11,47,82,.25); }
.button.secondary:hover { color: var(--sw-navy); background: var(--sw-ice); border-color: var(--sw-blue); }
.button.light { color: var(--sw-navy); background: var(--sw-white); }
.button.light:hover { color: var(--sw-navy); background: #dff3fb; }
.menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--sw-line); border-radius: 12px; background: var(--sw-white); color: var(--sw-navy); }
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after { display: block; width: 20px; height: 2px; margin: auto; background: currentColor; content: ""; transition: .2s ease; }
.menu-toggle span::before { transform: translateY(-6px); }
.menu-toggle span::after { transform: translateY(4px); }

/* Hero */
.hero { position: relative; isolation: isolate; min-height: 610px; overflow: hidden; background: var(--sw-navy-deep); color: var(--sw-white); }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media::after { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,31,56,.94) 0%, rgba(7,31,56,.76) 42%, rgba(7,31,56,.16) 78%, rgba(7,31,56,.38) 100%); content: ""; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 73% center; }
.hero-inner { display: grid; align-items: center; min-height: 610px; padding-block: 82px; }
.hero-copy { max-width: 640px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--sw-sky); font-size: 13px; font-weight: 800; letter-spacing: .14em; }
.eyebrow::before { width: 28px; height: 2px; background: currentColor; content: ""; }
.hero h1 { max-width: 610px; margin: 0; color: var(--sw-white); font-size: clamp(2.25rem, 5vw, 4.65rem); line-height: 1.14; letter-spacing: -.035em; }
.hero h1 span { display: block; color: #b8e7f6; }
.hero-lead { max-width: 560px; margin: 20px 0 28px; color: rgba(255,255,255,.88); font-size: clamp(1rem, 1.8vw, 1.2rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { margin: 18px 0 0; color: rgba(255,255,255,.72); font-size: 13px; }

/* Global sections */
.section { padding: 92px 0; }
.section.mist { background: var(--sw-mist); }
.section.ice { background: var(--sw-ice); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 34px; }
.section-head > div:first-child { max-width: 700px; }
.section-kicker { margin: 0 0 8px; color: var(--sw-blue); font-size: 13px; font-weight: 800; letter-spacing: .12em; }
.section h2 { margin: 0; color: var(--sw-navy); font-size: clamp(1.85rem, 3.4vw, 2.8rem); line-height: 1.25; letter-spacing: -.02em; }
.section-intro { margin: 12px 0 0; color: var(--sw-muted); }
.section-head > .text-link { flex: 0 0 auto; font-weight: 750; }
.text-link { color: var(--sw-blue); font-size: 14px; font-weight: 700; }
.text-link::after { margin-left: 5px; content: "→"; transition: .2s ease; }
.text-link:hover::after { margin-left: 9px; }

/* Trust */
.trust-strip { position: relative; z-index: 2; margin-top: -42px; }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--sw-line); border-radius: var(--sw-radius); background: var(--sw-line); box-shadow: var(--sw-shadow); }
.trust-item { min-height: 142px; padding: 24px; background: var(--sw-white); }
.trust-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 14px; color: var(--sw-white); background: var(--sw-blue); border-radius: 12px; font-weight: 800; }
.trust-item h3 { margin: 0; color: var(--sw-navy); font-size: 17px; line-height: 1.35; }
.trust-item p { margin: 6px 0 0; color: var(--sw-muted); font-size: 13px; line-height: 1.6; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service-card, .area-card, .project-card, .info-card { overflow: hidden; border: 1px solid var(--sw-line); border-radius: var(--sw-radius); background: var(--sw-white); box-shadow: 0 10px 28px rgba(7,31,56,.05); transition: .22s ease; }
.service-card:hover, .area-card:hover, .project-card:hover, .info-card:hover { border-color: rgba(27,119,183,.48); box-shadow: var(--sw-shadow); transform: translateY(-3px); }
.card-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--sw-ice); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 22px 22px 24px; }
.card-label { margin: 0 0 7px; color: var(--sw-blue); font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.card-body h3 { margin: 0; color: var(--sw-navy); font-size: 1.35rem; line-height: 1.4; }
.card-body p { margin: 9px 0 16px; color: var(--sw-muted); font-size: 14px; line-height: 1.75; }
.card-arrow { color: var(--sw-blue); font-size: 14px; font-weight: 750; }
.card-arrow::after { margin-left: 5px; content: "→"; }

/* Split / process */
.split { display: grid; grid-template-columns: 1.02fr .98fr; gap: clamp(34px, 6vw, 90px); align-items: center; }
.split-media { overflow: hidden; border-radius: 26px; box-shadow: var(--sw-shadow); }
.split-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.check-list, .bullet-list { display: grid; gap: 12px; list-style: none; margin: 24px 0 0; padding: 0; }
.check-list li, .bullet-list li { position: relative; padding-left: 30px; color: var(--sw-muted); }
.check-list li::before { position: absolute; top: .42em; left: 0; display: grid; place-items: center; width: 20px; height: 20px; color: var(--sw-white); background: var(--sw-blue); border-radius: 50%; content: "✓"; font-size: 12px; line-height: 1; }
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: process; }
.process-step { position: relative; padding: 25px 22px 22px; border: 1px solid var(--sw-line); border-radius: var(--sw-radius); background: var(--sw-white); }
.process-step::before { counter-increment: process; display: block; margin-bottom: 20px; color: var(--sw-sky); content: "0" counter(process); font-size: 28px; font-weight: 850; line-height: 1; }
.process-step h3 { margin: 0; color: var(--sw-navy); font-size: 17px; }
.process-step p { margin: 8px 0 0; color: var(--sw-muted); font-size: 14px; line-height: 1.7; }

/* FAQ */
.faq-list { display: grid; gap: 10px; max-width: 900px; margin-inline: auto; }
.faq-list details { border: 1px solid var(--sw-line); border-radius: 14px; background: var(--sw-white); }
.faq-list summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; color: var(--sw-navy); cursor: pointer; font-weight: 750; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { color: var(--sw-blue); content: "+"; font-size: 24px; font-weight: 400; }
.faq-list details[open] summary::after { content: "−"; }
.faq-answer { padding: 0 20px 20px; color: var(--sw-muted); }
.faq-answer p { margin: 0; }

/* CTA */
.cta-band { position: relative; overflow: hidden; padding: 58px 0; background: var(--sw-navy); color: var(--sw-white); }
.cta-band::after { position: absolute; top: -140px; right: -70px; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; box-shadow: 0 0 0 50px rgba(255,255,255,.035), 0 0 0 100px rgba(255,255,255,.025); content: ""; }
.cta-inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.cta-band h2 { margin: 0; color: var(--sw-white); font-size: clamp(1.8rem, 3.5vw, 2.7rem); }
.cta-band p { margin: 8px 0 0; color: rgba(255,255,255,.78); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; flex: 0 0 auto; }

/* Generic pages */
.page-hero { padding: 76px 0 62px; background: linear-gradient(135deg, var(--sw-ice), #fff 62%); border-bottom: 1px solid var(--sw-line); }
.page-hero h1 { max-width: 820px; margin: 0; color: var(--sw-navy); font-size: clamp(2.1rem, 4.8vw, 3.7rem); line-height: 1.18; letter-spacing: -.03em; }
.page-hero .lead { max-width: 760px; margin: 16px 0 0; color: var(--sw-muted); font-size: 1.1rem; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 18px; color: var(--sw-muted); font-size: 13px; }
.breadcrumbs a { color: var(--sw-blue); }
.breadcrumbs .sep { color: #9db2c1; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 54px; align-items: start; }
.entry-content { min-width: 0; }
.entry-content h2 { margin: 42px 0 13px; color: var(--sw-navy); font-size: clamp(1.55rem, 2.8vw, 2rem); line-height: 1.35; }
.entry-content h3 { margin: 28px 0 8px; color: var(--sw-navy); font-size: 1.25rem; }
.entry-content p { margin: 0 0 16px; }
.entry-content ul, .entry-content ol { margin: 0 0 20px; padding-left: 24px; }
.entry-content li { margin: 5px 0; }
.entry-content .callout { margin: 26px 0; padding: 20px 22px; border-left: 4px solid var(--sw-blue); border-radius: 0 14px 14px 0; background: var(--sw-ice); }
.entry-content .callout p:last-child { margin-bottom: 0; }
.sidebar-card { position: sticky; top: 104px; padding: 24px; border: 1px solid var(--sw-line); border-radius: var(--sw-radius); background: var(--sw-mist); }
.sidebar-card h2 { margin: 0 0 10px; color: var(--sw-navy); font-size: 1.2rem; }
.sidebar-card p { margin: 0 0 16px; color: var(--sw-muted); font-size: 14px; }
.sidebar-links { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sidebar-links a { display: block; padding: 8px 0; border-bottom: 1px solid var(--sw-line); font-size: 14px; font-weight: 700; }
.sidebar-links li:last-child a { border-bottom: 0; }

/* Projects / blog */
.archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.project-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 10px; }
.project-meta span { padding: 3px 9px; border-radius: 999px; color: var(--sw-blue); background: var(--sw-ice); font-size: 12px; font-weight: 700; }
.post-list { display: grid; gap: 18px; }
.post-card { padding: 24px; border: 1px solid var(--sw-line); border-radius: var(--sw-radius); background: var(--sw-white); }
.post-card h2 { margin: 0; font-size: 1.4rem; }
.post-card .post-excerpt { margin: 8px 0 14px; color: var(--sw-muted); }
.post-date { color: var(--sw-muted); font-size: 13px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; }
.contact-card { padding: 30px; border: 1px solid var(--sw-line); border-radius: var(--sw-radius); background: var(--sw-white); }
.contact-card h2 { margin: 0 0 12px; color: var(--sw-navy); font-size: 1.55rem; }
.contact-card p { margin: 0 0 14px; color: var(--sw-muted); }
.contact-list { display: grid; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; }
.contact-list strong { min-width: 56px; color: var(--sw-navy); }
.contact-form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form label { display: grid; gap: 5px; color: var(--sw-navy); font-size: 14px; font-weight: 700; }
.contact-form input, .contact-form textarea, .contact-form select { width: 100%; padding: 12px 14px; border: 1px solid var(--sw-line); border-radius: 10px; color: var(--sw-ink); background: #fff; font: inherit; }
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-form small { color: var(--sw-muted); font-weight: 400; }

/* Footer / mobile bar */
.site-footer { padding: 52px 0 92px; color: rgba(255,255,255,.75); background: var(--sw-navy-deep); }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 40px; }
.site-footer .brand { color: var(--sw-white); }
.site-footer .brand-copy small { color: rgba(255,255,255,.56); }
.footer-title { margin: 0 0 12px; color: var(--sw-white); font-size: 15px; }
.footer-links { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: rgba(255,255,255,.75); font-size: 14px; }
.footer-links a:hover { color: var(--sw-white); }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.16); font-size: 12px; }
.mobile-bar { display: none; }

@media (max-width: 1040px) {
  .primary-nav a { padding-inline: 8px; font-size: 13px; }
  .header-actions .button { padding-inline: 14px; }
  .card-grid, .archive-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 840px) {
  .header-inner { min-height: 70px; }
  .menu-toggle { display: block; }
  .primary-nav { position: absolute; top: 70px; left: 20px; right: 20px; display: none; padding: 12px; border: 1px solid var(--sw-line); border-radius: 16px; background: var(--sw-white); box-shadow: var(--sw-shadow); }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { display: grid; gap: 3px; }
  .primary-nav a { display: block; padding: 11px 12px; }
  .header-actions { margin-left: auto; }
  .hero, .hero-inner { min-height: 570px; }
  .hero-media img { object-position: 72% center; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .split, .content-layout, .contact-grid { grid-template-columns: 1fr; gap: 34px; }
  .sidebar-card { position: static; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-inner { display: grid; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .container, .narrow { width: min(calc(100% - 30px), var(--sw-width)); }
  .header-actions .button { display: none; }
  .brand-copy strong { font-size: 15px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .hero, .hero-inner { min-height: 620px; }
  .hero-media::after { background: linear-gradient(180deg, rgba(7,31,56,.68) 0%, rgba(7,31,56,.83) 70%, rgba(7,31,56,.96) 100%); }
  .hero-media img { object-position: 71% center; }
  .hero-inner { align-items: end; padding-block: 58px 78px; }
  .section { padding: 66px 0; }
  .section-head { display: block; }
  .section-head > .text-link { display: inline-block; margin-top: 12px; }
  .trust-strip { margin-top: -30px; }
  .trust-grid, .card-grid, .archive-grid, .process-grid, .form-row, .footer-grid { grid-template-columns: 1fr; }
  .trust-item { min-height: auto; padding: 20px; }
  .card-body { padding: 19px 19px 21px; }
  .page-hero { padding: 55px 0 44px; }
  .page-hero .lead { font-size: 1rem; }
  .cta-band { padding: 44px 0 86px; }
  .mobile-bar { position: fixed; right: 0; bottom: 0; left: 0; z-index: 60; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.14); background: var(--sw-navy-deep); box-shadow: 0 -8px 24px rgba(7,31,56,.16); }
  .mobile-bar a { display: grid; place-items: center; min-height: 56px; color: var(--sw-white); font-size: 13px; font-weight: 750; }
  .mobile-bar a:nth-child(2) { background: var(--sw-blue); }
  .mobile-bar a span { display: block; font-size: 10px; opacity: .72; }
  .site-footer { padding-bottom: 78px; }
}


/* Compact, accessible service and area navigation */
.primary-nav { min-width: 0; }
.primary-nav > ul { flex-wrap: nowrap; }
.primary-nav .nav-group { position: relative; }
.primary-nav details { position: relative; }
.primary-nav summary { display: inline-flex; align-items: center; padding: 10px 12px; color: var(--sw-ink); border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 650; list-style: none; }
.primary-nav summary::-webkit-details-marker { display: none; }
.primary-nav summary::after { margin-left: 5px; color: var(--sw-muted); content: '⌄'; font-size: 11px; }
.primary-nav details[open] summary, .primary-nav summary:hover { color: var(--sw-blue); background: var(--sw-ice); }
.primary-nav .nav-submenu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; display: grid; min-width: 230px; padding: 8px; border: 1px solid var(--sw-line); border-radius: 14px; background: var(--sw-white); box-shadow: var(--sw-shadow); }
.primary-nav details:not([open]) .nav-submenu { display: none; }
.primary-nav .nav-submenu a { display: block; padding: 8px 10px; color: var(--sw-ink); border-radius: 8px; font-size: 14px; font-weight: 650; white-space: nowrap; }
.primary-nav .nav-submenu a:hover { color: var(--sw-blue); background: var(--sw-ice); }
@media (max-width: 1040px) {
  .header-inner { gap: 16px; }
  .header-actions { display: none; }
  .primary-nav a, .primary-nav summary { padding-inline: 8px; font-size: 13px; }
}
@media (max-width: 840px) {
  .primary-nav > ul { display: grid; }
  .primary-nav summary { display: flex; justify-content: space-between; width: 100%; padding: 11px 12px; font-size: 15px; }
  .primary-nav .nav-submenu { position: static; min-width: 0; margin: 2px 0 4px; padding: 4px 0 4px 12px; border: 0; border-top: 1px solid var(--sw-line); border-radius: 0; box-shadow: none; }
  .primary-nav .nav-submenu a { padding: 8px 12px; white-space: normal; }
}
