/* ==========================================================================
   和易會計師事務所 - UniDynamic
   Faithful replica of Google Sites "Impression" Theme
   ========================================================================== */

:root {
  --bg-page: #ffffff;
  --text-primary: #212121;
  --text-dark: #001020;
  --text-black: #000000;
  --accent-red: #ff5252;
  --accent-red-hover: #d3413f;
  --category-red: #ff0000;
  --nav-height: 56px;
  --nav-text-scrolled: #1f1f1f;
  --nav-active-bg: #1f1f1f;
  --nav-dropdown-bg: #f7f7f7;
  --border-header: #cccccc;
  --container-max: 1180px;
  --font-display: 'Oswald', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  --font-ui: 'Open Sans', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  --font-body: Arial, 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 13pt;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   Fixed Top Header / Navbar
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 24px;
  background-color: transparent;
  color: #ffffff;
  border-bottom: 1px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.scrolled {
  background-color: #ffffff;
  color: var(--nav-text-scrolled);
  border-bottom-color: var(--border-header);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 50%;
}

.mobile-menu-btn:hover {
  background-color: rgba(128, 128, 128, 0.18);
}

.site-title {
  font-family: var(--font-display);
  font-size: 16pt;
  font-weight: 400;
  line-height: 1.26;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: inherit;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Desktop Nav */
.desktop-nav {
  display: flex;
  align-items: center;
}

.nav-item-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-link-main {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 12pt;
  font-weight: 400;
  line-height: 1.88;
  padding: 0 10px;
  color: inherit;
  white-space: nowrap;
  border-radius: 2px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link-main:hover {
  opacity: 0.85;
}

.nav-link-main.is-active {
  background-color: rgba(31, 31, 31, 0.72);
  color: #ffffff;
  font-weight: 600;
}

.site-header.scrolled .nav-link-main.is-active {
  background-color: rgba(31, 31, 31, 0.72);
  color: #ffffff;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 2px;
}

.nav-dropdown-toggle:hover {
  background-color: rgba(128, 128, 128, 0.18);
}

.nav-dropdown-toggle svg {
  transition: transform 0.2s ease;
}

.nav-item-dropdown.open .nav-dropdown-toggle svg {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 240px;
  background-color: var(--nav-dropdown-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  padding: 12px 0 24px;
  margin-top: 4px;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 1010;
}

/* Invisible hover bridge so moving mouse down into menu doesn't close it */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.nav-item-dropdown:hover .nav-dropdown-menu,
.nav-item-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu li {
  margin: 0;
}

.nav-dropdown-menu a {
  display: block;
  padding: 8px 20px;
  font-family: var(--font-ui);
  font-size: 12pt;
  font-weight: 400;
  line-height: 1.6;
  color: var(--nav-text-scrolled);
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-dropdown-menu a:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: var(--accent-red-hover);
}

.nav-dropdown-menu a.is-active {
  font-weight: 700;
  background-color: rgba(31, 31, 31, 0.08);
  color: var(--nav-text-scrolled);
}

/* Search Button */
.search-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 50%;
}

.search-open-btn:hover {
  background-color: rgba(128, 128, 128, 0.18);
}

/* ==========================================================================
   Search Bar Overlay
   ========================================================================== */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  background-color: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
}

.search-overlay.open {
  display: flex;
}

.search-bar-row {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  border-bottom: 1px solid #e0e0e0;
}

.search-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
}

.search-icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--text-primary);
  background: transparent;
  padding: 8px 4px;
}

.search-results-panel {
  max-height: 70vh;
  overflow-y: auto;
  padding: 0 24px;
}

.search-results-panel:not(:empty) {
  padding: 16px 24px 24px;
}

.search-result-meta {
  font-size: 13px;
  color: #666666;
  margin: 0 0 12px;
}

.search-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-result-item a {
  display: block;
  padding: 12px 16px;
  border-radius: 4px;
  border: 1px solid #e5e5e5;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.search-result-item a:hover {
  border-color: var(--accent-red);
  background-color: #fafafa;
}

.search-result-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.search-result-snippet {
  font-size: 14px;
  color: #444444;
  line-height: 1.5;
}

.search-result-snippet mark {
  background-color: #ffe0e0;
  color: #000000;
  padding: 0 2px;
  border-radius: 2px;
}

/* ==========================================================================
   Mobile Drawer Navigation
   ========================================================================== */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.mobile-drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 82vw;
  background-color: #ffffff;
  color: var(--nav-text-scrolled);
  z-index: 1110;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  padding-top: 12px;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25);
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-close {
  align-self: flex-end;
  margin-right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #333333;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.mobile-drawer-nav {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.mobile-drawer-nav a {
  display: block;
  padding: 12px 24px;
  font-size: 15px;
  color: var(--nav-text-scrolled);
}

.mobile-drawer-nav a.is-active {
  font-weight: 700;
  background-color: rgba(31, 31, 31, 0.08);
}

.mobile-drawer-subnav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-drawer-subnav a {
  padding-left: 42px;
  font-size: 14px;
}

/* ==========================================================================
   Hero Banner
   ========================================================================== */
.hero-banner {
  position: relative;
  min-height: 468px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px;
  background-image: url('assets/banner-compass.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.hero-banner--home {
  min-height: 430px;
}

.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(33, 33, 33, 0.5);
  z-index: 1;
}

.hero-banner--home::before {
  background-color: rgba(33, 33, 33, 0.7);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
  width: 100%;
  text-align: center;
  display: flex;
  justify-content: center;
}

.hero-title {
  margin: 0;
  padding-bottom: 20px;
  font-family: var(--font-display);
  font-size: 60pt;
  font-weight: 400;
  line-height: 1.2;
  color: #ffffff;
  border-bottom: 12px solid var(--accent-red);
  display: inline-block;
  max-width: 100%;
}

.hero-title--home {
  font-size: 42pt;
}

/* ==========================================================================
   Main Content & Sections
   ========================================================================== */
.page-main {
  background-color: var(--bg-page);
}

.content-section {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 36px 48px;
}

.divider-section {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 12px 48px;
}

.red-divider {
  border: none;
  height: 3px;
  background-color: var(--accent-red);
  opacity: 0.8;
  margin: 8px 0;
}

/* ==========================================================================
   Page 1: Home
   ========================================================================== */
.cards-grid {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  align-items: start;
}

.card-image-wrap {
  width: 100%;
}

.card-image-wrap img {
  width: 100%;
  height: auto;
}

.specialty-block {
  padding: 8px 0 16px;
}

.specialty-heading {
  font-family: var(--font-body);
  font-size: 22pt;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 2;
  margin: 0 53pt;
}

.specialty-list {
  list-style-type: square;
  margin: 4px 53pt 0 72pt;
  padding: 0;
  font-family: var(--font-body);
  font-size: 18pt;
  font-weight: 400;
  color: var(--text-dark);
}

.specialty-list li {
  line-height: 2;
}

.specialty-list li:last-child {
  line-height: 1.5;
  margin-bottom: 6pt;
}

/* ==========================================================================
   Page 2: 近期資訊安全事件分析
   ========================================================================== */
.two-col {
  display: grid;
  gap: 36px;
  align-items: start;
}

.two-col--equal {
  grid-template-columns: 1fr 1fr;
}

.two-col--5-7 {
  grid-template-columns: 5fr 7fr;
}

.incident-media img {
  width: 100%;
  height: auto;
}

.incident-text {
  font-family: var(--font-body);
  font-size: 11pt;
  line-height: 1.52;
  color: var(--text-black);
}

.incident-list {
  list-style-type: square;
  margin: 0 0 14px 18px;
  padding: 0;
}

.incident-list li {
  margin-bottom: 10px;
  text-align: left;
}

.incident-list u {
  text-underline-offset: 2px;
}

.date-stamp {
  text-align: right;
  font-family: var(--font-body);
  font-size: 11pt;
  color: var(--text-black);
  margin: 12px 0 0;
}

.date-stamp--lg {
  font-size: 14pt;
  color: var(--text-primary);
}

/* Image Carousel (Google Sites style) */
.carousel {
  position: relative;
  width: 100%;
  background-color: #f2f2f2;
  overflow: hidden;
  user-select: none;
}

.carousel-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1.161236 / 1;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f8f8;
}

.carousel-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background-color: rgba(33, 33, 33, 0.55);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.carousel-btn:hover {
  background-color: rgba(33, 33, 33, 0.85);
}

.carousel-btn--prev {
  left: 10px;
}

.carousel-btn--next {
  right: 10px;
}

.carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  background-color: rgba(33, 33, 33, 0.45);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.carousel-dot.is-active {
  background-color: #ffffff;
  transform: scale(1.15);
}

/* ==========================================================================
   Page 3: 資訊安全相關規範
   ========================================================================== */
.reg-heading {
  font-family: var(--font-body);
  font-size: 22pt;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 14px;
  color: var(--text-dark);
}

.reg-heading .cat-red {
  color: var(--category-red);
}

.reg-list {
  list-style-type: square;
  margin: 0 0 12px 24px;
  padding: 0;
  font-family: var(--font-body);
  font-size: 14pt;
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1.45;
}

.reg-list > li {
  margin-bottom: 8pt;
}

.reg-sublist {
  list-style-type: square;
  margin: 6pt 0 4pt 22px;
  padding: 0;
}

.reg-sublist > li {
  margin-bottom: 6pt;
}

/* ==========================================================================
   Page 4: 第三方支付相關
   ========================================================================== */
.payment-text {
  font-family: var(--font-body);
  color: var(--text-primary);
  padding: 0 16px;
}

.payment-heading {
  font-family: var(--font-body);
  font-size: 22pt;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-primary);
  margin: 0 0 16px;
}

.payment-text p {
  font-size: 14pt;
  font-weight: 400;
  line-height: 1.656;
  margin: 0 0 16px;
  text-align: left;
}

.payment-text p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background-color: #ffffff;
  padding: 24px 24px 36px;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 12pt;
  color: var(--text-primary);
}

/* ==========================================================================
   Responsive Breakpoints (matching Google Sites Impression)
   ========================================================================== */
@media (max-width: 960px) {
  .content-section,
  .divider-section {
    padding-left: 28px;
    padding-right: 28px;
  }

  .specialty-heading {
    margin: 0 24px;
  }

  .specialty-list {
    margin: 4px 24px 0 46px;
  }

  .payment-text {
    padding: 0;
  }
}

@media (max-width: 767px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  .desktop-nav {
    display: none;
  }

  .site-header {
    padding: 0 12px;
  }

  .site-title {
    font-size: 15pt;
  }

  .hero-banner {
    min-height: 360px;
    padding: 96px 20px;
  }

  .hero-title {
    font-size: 51pt;
  }

  .hero-title--home {
    font-size: 37pt;
  }

  .specialty-heading,
  .reg-heading,
  .payment-heading {
    font-size: 21pt;
  }

  .specialty-list {
    font-size: 17pt;
  }

  .cards-grid,
  .two-col--equal,
  .two-col--5-7 {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .content-section,
  .divider-section {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 479px) {
  .hero-title {
    font-size: 39pt;
  }

  .hero-title--home {
    font-size: 30pt;
  }

  .specialty-heading,
  .reg-heading,
  .payment-heading {
    font-size: 19pt;
  }
}
