/* =========================
   CFAY - Unified stylesheet
   Desktop-first (mobile rules will be added later)
   ========================= */

/* Base */
html{
  font-size: 16px;   /* rem base */
}

body{
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #6F6F6F;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* Global spacing: keep a little space under header for every page */
.page{
  padding-top: 16px;
}

/* Typography rules requested */
.section-title{
  text-align: center;
  font-size: 3rem;
  color:#003B94;
  margin: 20px 0;
}

.contents-title{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.4rem;
  font-weight: 600;   /* 文字加粗 */
  line-height: 1.4;
  color:#00A438;
}

.inner-text{
  color:#6F6F6F;
  font-size: 1.2rem;
  line-height: 2;
}

/* Common links (keep color behavior, do not force font-size) */
.link-trend,
.text-link{
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}
.link-trend:hover,
.text-link:hover{
  color: #00A438;
}

/* 共用：各頁 hero 圖置中 */
.hero {
  display: flex;
  justify-content: center;  /* 水平置中 */
}

.hero img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

/* 共用：底部分隔線置中 & 對齊內容寬度 */
.divider {
  display: block;
  margin: 24px auto;         /* 上下間距 + 置中 */
  max-width: 1280px;         /* 跟 .container 的 max-width 一致 */
  width: calc(100%);  /* 對齊 .container 左右 padding 20px*2 */
  height: auto;
}

.container{
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}
.site-header{
  padding-top: 20px;
  padding-bottom: 0px;  /*在選單列底下留 0px 的空間*/
}
.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;   
  justify-content: space-between;
  align-items: flex-end;    
}
.brand{
  flex: 0 0 auto;
}
.brand img{
  height: 80px; 
  width: auto;
}
.site-nav{
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}
.site-nav a{
  text-decoration: none; 
  color: #222;
  font-size: 1.2rem;
  transition: color 0.2s ease;
  white-space: nowrap; 
}


.site-nav a:hover{
  color: #00A438;
}
.social-icons{
  display: flex;
  align-items: center;
  gap: 12px;
}
.social-icons img{
  width: 22px;
  height: auto;
}
.site-footer{
  background: #f8f8f8;
  font-size: 1rem;
  padding: 7px 0;   
}
.footer-inner{
  display: flex;
  align-items: center;        
  justify-content: space-between;
  gap: 20px;
  white-space: nowrap;        
}
.footer-left{
  display: flex;
  align-items: center;
  font-size:17px
}
.social-icons img{
  height: 20px;          
  width: auto;
  display: block;
}


/* 全站統一字型：Arial */
html, body{
  font-family: Arial, sans-serif;
}

/* 內文基準：統一大小（桌機先以 16px 為主） */
body{
  font-size: 18px;
  line-height: 1.7;
}

/* 內文常見元素：統一跟著 body */
p, li, a, span, div,
input, textarea, select, button, label,
.contents-text, .contact-text, .service-text, .text-link, .icon-text-line, .content, .font1{
  font-size: inherit;
  line-height: inherit;
}

/* Page layouts (merged) */
.contents-title-img{
  width: 15px;         
  height: auto;
  display: block;
}

.image-row{
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;   
  width: 100%;
}

.image-row img{
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  height: 330px;
  object-fit: contain;   
  display: block;
}

.about-block{
  display: flex;          
  gap: 32px;              
  align-items: flex-start;
}

.about-photo{
  flex: 0 0 280px;        
}

.about-photo img{
  width: 100%;
  height: auto;           
  display: block;
}

.about-text{
  flex: 1;                
}

.about-text p{
  margin-bottom: 1em;
  line-height: 1.8;
}

.profile-block{
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.profile-photo{
  flex: 0 0 370px;     
}

.profile-photo img{
  width: 100%;
  height: auto;
  display: block;
}

.profile-text{
  flex: 1;
}

.contact-text{
}

.contact-text p{
  margin-bottom: 1em;
}

.contact-text a{
  color: inherit;            
  text-decoration: none;     
  transition: color 0.2s ease;
}

.contact-text a:hover{
  color: #00A438;            
}

.contact-text img{
  display: block;        
  margin: 0 auto;        
}

.icon-text-line{
  display: flex;           
  align-items: center;     
  gap: 10px;
margin-bottom: 12px;     
}

.icon-text-line img{
  width: 18px;             
  height: auto;
  display: block;
}

.link-trend{
  color: inherit;            
  text-decoration: none;     
  transition: color 0.2s ease;
}

.link-trend:hover{
  color: #00A438;            
}

.text-link{
  color: inherit;            
  text-decoration: none;     
  transition: color 0.2s ease;
}

.text-link:hover{
  color: #00A438;            
}

.service-item{
  display: flex;
  gap: 24px;
  align-items: center;   
  margin-bottom: 32px;
}

.service-photo{
  flex: 0 0 300px;   
}

.service-photo img{
  width: 100%;
  height: auto;     
  display: block;
}

.service-text{
  flex: 1;
  font-size:20px
}


/* =========================
   Services page layout (safe patch)
   Only affects services blocks
   ========================= */

/* Left image + right text (2 lines), vertically centered */
.service-row{
  display: flex;
  gap: 24px;
  align-items: center;   /* vertical center relative to image */
  margin-bottom: 32px;
}

/* Right side text: stack title + body */
.service-row .service-text{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

/* =========================
   Contact page only styles
   ========================= */

/* Center all inner text on Contact page */
.contact-page .inner-text{
  text-align: center;
}

/* Contact page links: no underline; turn orange on hover */
.contact-page .inner-text a{
  text-decoration: none;
  color: inherit;
}

.contact-page .inner-text a:hover{
  color: #F59E0B; /* orange on hover */
}

/* Contact page: center QR code image (and any images inside inner-text) */
.contact-page .inner-text img{
  display: block;
  margin: 20px auto;
}


/* =========================
   Privacy page: header background (match footer)
   ========================= */
body.privacy-page .site-header{
  background: #f8f8f8;   /* same as footer background */
}


/* =========================
   Privacy page: header spacing tweak
   Extend grey background slightly below logo
   ========================= */
body.privacy-page .site-header{
  padding-bottom: 2px;   /* extra space below logo */
}

/* =========================
   Footer: Privacy & Cookie Policy
   Default green + hover orange + spacing
   ========================= */
.site-footer .footer-left .footer-privacy{
  color: #00A438;            /* default green */
  text-decoration: underline;
  margin-left: 6px;          /* space before 'P' */
  transition: color 0.2s ease;
}

.site-footer .footer-left .footer-privacy:hover{
  color: #F59E0B;            /* hover orange */
}


/* =========================
   Privacy page: content width align with header
   ========================= */
body.privacy-page .privacy-content{
  max-width: 1280px;   /* same as .container */
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}


/* =========================
   Privacy page: email link color
   ========================= */
body.privacy-page .privacy-content a[href^="mailto:"]{
  color: #00A438;              /* green */
  text-decoration: underline;
  transition: color 0.2s ease;
}

body.privacy-page .privacy-content a[href^="mailto:"]:hover{
  color: #F59E0B;              /* hover orange (optional) */
}



/* =========================
   Responsive Design
   ========================= */
@media (max-width: 768px){
  html{font-size:15px;}
  .header-inner{flex-direction:column;align-items:flex-start;}
  .site-nav{justify-content:flex-start;gap:16px;}
  .about-block,.profile-block,.service-row{flex-direction:column;}
  .image-row{flex-direction:column;}
}

@media (max-width: 480px){
  html{font-size:14px;}
  .site-nav a{font-size:1rem;}
}


/* =========================
   Mobile hamburger navigation
   ========================= */
.nav-toggle{
  display: none;
  appearance: none;
  border: 1px solid rgba(0,0,0,0.15);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  line-height: 0;
}

.nav-toggle svg{ width: 22px; height: 22px; display:block; }

@media (max-width: 768px){
  .header-inner{ align-items: stretch; }
  .nav-toggle{ display: inline-flex; align-self: flex-end; }
  .site-nav{
    display: none;                 /* hidden by default on mobile */
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0 4px;
    border-top: 1px solid rgba(0,0,0,0.08);
  }
  body.nav-open .site-nav{ display: flex; }
}


/* =========================
   Mobile footer simplification
   ========================= */
@media (max-width: 480px){
  .site-footer{ padding: 10px 0; }
  .footer-inner{
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    white-space: normal;      /* allow wrapping on mobile */
  }
  .footer-left{
    font-size: 0.95rem;
    line-height: 1.5;
    flex-wrap: wrap;
  }
  .social-icons{ gap: 14px; }
  .social-icons img{ width: 22px; height: auto; }
}


/* =========================
   Cookie banner (global)
   ========================= */
#cookie-banner{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  z-index: 9999;
  display: none;
  box-shadow: 0 -8px 20px rgba(0,0,0,.25);
}
#cookie-banner .cookie-inner{
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
#cookie-banner a{ color: #a7f3d0; text-decoration: underline; }
.cookie-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.cookie-btn{
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
}
.cookie-accept{ background: #34d399; color: #0b1220; }
.cookie-decline{ background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); }
.cookie-settings{ background: transparent; color: #fff; text-decoration: underline; padding: 10px 6px; }

@media (max-width: 480px){
  #cookie-banner .cookie-inner{ justify-content: flex-start; }
}


/* =========================
   Mobile footer: allow wrapping and line breaks
   ========================= */
@media (max-width: 768px){
  .footer-inner{
    flex-direction: column;
    align-items: flex-start;
    white-space: normal;
  }
  .footer-left{
    display: block;
    font-size: 0.95rem;
    line-height: 1.6;
  }
  .footer-left .icon-text-line{
    margin-bottom: 8px;
  }
}


/* =========================
   Mobile hamburger navigation (override)
   Keep logo + hamburger on same row; nav expands below
   ========================= */
@media (max-width: 768px){
  .header-inner{
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;          /* align to bottom of logo */
    justify-content: space-between;
  }
  .brand{ order: 1; }
  .nav-toggle{
    order: 2;
    margin-bottom: 4px;            /* tiny lift to align with logo bottom */
    align-self: flex-end;
  }
  .site-nav{
    order: 3;
    flex-basis: 100%;
    width: 100%;
  }
}


/* =========================
   Mobile header alignment: logo + hamburger on same row, align to logo bottom
   ========================= */
@media (max-width: 768px){
  .header-inner{
    flex-direction: row;
    align-items: flex-end;          /* align to logo bottom */
    justify-content: space-between;
  }
  .nav-toggle{
    align-self: flex-end;
    margin-bottom: 2px;             /* fine-tune baseline */
  }
  /* nav stays below when opened */
  .site-nav{
    width: 100%;
  }
}


/* =========================
   Hamburger icon visibility fix
   Ensure SVG (currentColor) is visible on all pages
   ========================= */
.nav-toggle{
  color: #333333;
}


/* =========================
   Mobile hamburger menu: centered items with light grey rows
   ========================= */
@media (max-width: 768px){
  .site-nav a{
    width: 100%;
    text-align: center;          /* text centered */
    padding: 9px 0;              /* slightly shorter height */
    background: #f2f2f2;         /* light grey row */
    border-radius: 8px;
  }
  .site-nav a + a{
    margin-top: 4px;             /* tighter gap between rows */
  }
}


/* =========================
   Mobile hamburger menu: tighter rows + smaller gaps (override)
   ========================= */
@media (max-width: 768px){
  .site-nav a{
    padding: 6px 0;        /* shorter height */
  }
  .site-nav a + a{
    margin-top: 1px;       /* tighter gap */
  }
}


/* =========================
   Mobile hamburger menu: open/close animation (override)
   ========================= */
@media (max-width: 768px){
  .site-nav{
    display: flex;               /* keep in flow for animation */
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: max-height 0.22s ease, opacity 0.22s ease, transform 0.22s ease;
  }
  body.nav-open .site-nav{
    max-height: 520px;           /* large enough for menu */
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}


/* =========================
   Contact form success modal
   ========================= */
.contact-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}
.contact-modal.is-open{
  display: block;
}
.contact-modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}
.contact-modal-dialog{
  position: relative;
  max-width: 420px;
  margin: 20vh auto 0;
  background: #ffffff;
  border-radius: 12px;
  padding: 22px 24px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}
.contact-modal-dialog h3{
  margin-top: 0;
  color: #00A438;
}
.contact-modal-btn{
  margin-top: 16px;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #00A438;
  color: #ffffff;
  font-size: 1rem;
}
.contact-modal-btn:hover{
  opacity: 0.9;
}
