/* ==========================================================================
   responsive.css - 全球人壽｜以客為尊．待客如己
   RWD 斷點：1440 / 1439 / 1024 / 767
   ========================================================================== */

/* Large Desktop 加強留白 */
@media (min-width: 1440px) {
  .container {
    width: min(1280px, calc(100% - 64px));
  }

}

/* Desktop（>=1025px）：十大原則 4 欄置中，第 9/10 張卡片對齊置中 */
@media (min-width: 1025px) {
  .principle-grid {
    grid-template-columns: repeat(4, minmax(0, 300px));
    justify-content: center;
  }

  .principle-grid .principle-card:nth-child(9) {
    grid-column: 2 / 3;
  }

  .principle-grid .principle-card:nth-child(10) {
    grid-column: 3 / 4;
  }
}

@media (max-width: 1439px) {
  .deco-philosophy-smile {
    top: 10%;
    left: 15%;
    width: 3vw;
  }

  .deco-philosophy-yellow {
    top: 4%;
    left: 15%;
    width: 3vw;
  }

  .deco-philosophy-yellow2 {
    top: 6%;
    left: 5%;
    width: 7vw;
  }

  .deco-philosophy-blue {
    top: -5%;
    left: -3%;
    width: 120px;

  }

  .philosophy-butterflies {
    top: 2%;
    right: 5%;
    width: 12vw;
  }

  .deco-team-darkblue {
    top: 35%;
    left: -25%;
    width: 20vw;
  }

  .deco-team-yellow-sm {
    top: 70%;
    left: -5%;
    width: 5vw;
  }

  .deco-team-blue {
    bottom: 60%;
    right: 0;
    width: 6vw;
  }

  .deco-team-blue2 {
    bottom: 20%;
    right: -5%;
    width: 8vw;
  }

  .deco-team-yellow-xs {
    top: 50%;
    right: -4%;
    width: 5vw;
  }

  .deco-action-1 {
    top: 30%;
    left: 0%;
    width: 8vw;
  }

  .deco-action-2 {
    top: 30%;
    right: 2%;
    width: 5vw;
  }

  .deco-action-3 {
    top: 70%;
    left: 2%;
    width: 5vw;
  }

  .deco-action-4 {
    bottom: 15%;
    right: -5%;
    width: 8vw;
  }

  .deco-action-5 {
    top: 10%;
    right: -5%;
    width: 6vw;
  }

  .deco-news-yellow {
    top: 0;
    left: 0%;
    width: 12vw;
  }

  .deco-news-lightblue-1 {
    top: 45%;
    left: -5%;
    width: 6vw;
  }

  .deco-news-gary {
    bottom: 9%;
    left: 0;
    width: 4vw;
  }

  .deco-news-darkblue {
    top: 25%;
    right: -6%;
    width: 8vw;
  }

  .deco-news-lightblue-2 {
    bottom: 18%;
    right: -2%;
    width: 5vw;
  }

  .deco-history-blue {
    top: 12%;
    left: 0;
    width: 6vw;
    z-index: 0;
  }

  .deco-history-yellow {
    bottom: 30%;
    right: 0%;
    width: 4vw;
  }

  .deco-history-gary {
    top: 20%;
    right: 5%;
    width: 3vw;
  }
}

@media (max-width: 1200px) {
  .news-card {
    background: #f8fafe;
    border-radius: var(--radius-md);
    padding: 20px;
  }
}

/* Tablet（<=1024px）*/
@media (max-width: 1024px) {
  .org-block {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .org-copy {
    text-align: center;
    order: 2;
  }

  .org-chart {
    order: 1;
  }

  .principle-section::after {
    bottom: -2%;
  }

  .principle-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 18px;
  }

  .principle-grid .principle-card:nth-child(9),
  .principle-grid .principle-card:nth-child(10) {
    grid-column: auto !important;
    max-width: none;
  }

  .kv-title {
    margin-top: 40px;
  }


  .kv-building-layer {
    width: clamp(120px, 16vw, 260px);
  }

  .service-tabs-track {
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
  }

  .service-tab h3 {
    font-size: 16px;
  }

  .news-section .deco {
    display: none;
  }
}

/* Mobile（<=767px）*/
@media (max-width: 767px) {

  .deco,
  .philosophy-butterflies {
    display: none;
  }

  .container {
    width: calc(100% - 60px);
  }

  .history-section {
    padding: 25px 0 60px;
  }

  .philosophy-section,
  .principle-section,
  .action-section,
  .service-section {
    padding: clamp(20px, 15vw, 72px) 15px;
  }

  /* -------------------- Header：Desktop 導覽隱藏，改用底部 Tabbar -------------------- */
  .site-header {
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 16px rgba(20, 41, 121, 0.08);
  }

  .site-header .header-inner {
    height: 60px;
    justify-content: flex-start;
  }

  section {
    scroll-margin-top: 76px;
  }

  .site-header.is-scrolled .header-inner {
    justify-content: center;
  }

  .site-logo img {
    height: 40px;
  }

  .main-nav {
    display: none;
  }

  .mobile-tabbar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    background: linear-gradient(90deg, var(--c-blue-mid) 0%, var(--c-navy) 100%);
    box-shadow: 0 -4px 16px rgba(20, 41, 121, 0.25);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .mobile-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding-block: 10px;
    min-height: 44px;
    color: var(--c-white);
    font-size: 18px;
    font-weight: 700;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
  }

  .mobile-tabbar li:last-child a {
    border-right: none;
  }

  .mobile-tabbar .tab-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--c-white);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-tabbar .tab-icon img {
    width: 18px;
    height: 18px;
  }

  .block-title {
    letter-spacing: 0.1em;
  }

  .go-top-btn {
    right: 16px;
    bottom: calc(84px + 18px + env(safe-area-inset-bottom, 0px));
    width: 46px;
    height: 46px;
    border: 2px solid var(--c-white);
    box-shadow: 0 6px 16px rgba(20, 41, 121, 0.45);
  }

  main {
    display: block;
  }

  /* -------------------- KV -------------------- */
  .kv-hero {
    padding-top: 60px;
  }

  .kv-visual {
    aspect-ratio: 0.62;
  }

  .kv-title-desktop {
    display: none;
  }

  .kv-title-mobile {
    display: block;
  }

  .kv-building-layer {
    width: 140px;
    top: 50%;
    left: 78%;

  }

  .kv-people-layer {
    top: 48%;
    width: 200%;
    max-width: none;
    left: 40%;
    /* 行動版人物圖範圍變大，會與標題文字重疊，
       故將人物層級提高至文字（.kv-content, z-index:5）之上，
       避免人物被文字遮住 */
    z-index: 6;
  }

  .kv-butterfly {
    width: 36px;
    top: 30%;
    left: 15%;
  }

  .kv-content {
    top: 8%;
  }

  .kv-title {
    width: 92%;
  }

  /* -------------------- 理念 -------------------- */
  .philosophy-lead {
    font-size: 18px;
    line-height: 2;
  }

  .philosophy-butterflies {
    width: 34px;
    top: -1%;
    right: 6%;
  }

  .philosophy-lead br,
  .team-caption br {
    display: none;
  }

  /* -------------------- 組織架構 -------------------- */
  .org-copy {
    font-size: 18px;
    line-height: 2;
    margin-top: 30px;
  }

  /* -------------------- 十大原則：小裝置改為左右滑動（1 張／頁，下方頁碼點） -------------------- */
  .principle-grid {
    display: flex;
    grid-template-columns: unset !important;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 15px;
  }

  .principle-grid::-webkit-scrollbar {
    display: none;
  }

  .principle-grid .principle-card {
    flex: 0 0 100%;
    scroll-snap-align: start;
  }

  .principle-grid .principle-card:nth-child(9),
  .principle-grid .principle-card:nth-child(10) {
    grid-column: auto !important;
    max-width: none;
    width: auto;
    margin-inline: 0;
  }

  .principle-card {
    padding: 22px 14px 18px;
  }

  .principle-card figure {
    width: 150px;
    height: 150px;
  }

  .principle-card:hover,
  .principle-card:focus-within {
    transform: none;
    box-shadow: var(--shadow-card);
  }

  .principle-card:active {
    transform: scale(0.98);
  }

  .principle-card:hover img,
  .principle-card:focus-within img {
    transform: none;
  }

  .principle-section::before {
    top: -2.5%;
  }


  .principle-section::after {
    bottom: -1%;
    height: 60px;
  }

  /* 頁碼點：對應 10 頁（01／02／03／04／05／06／07／08／09／10） */
  .principle-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
  }

  .principle-dot {
    position: relative;
    width: 26px;
    height: 26px;
    padding: 0;
    background: none;
    flex-shrink: 0;
  }

  .principle-dot::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: background 0.25s ease, transform 0.25s ease;
  }

  .principle-dot.is-active::before {
    background: var(--c-white);
    transform: translate(-50%, -50%) scale(1.3);
  }

  /* -------------------- 積極行動 -------------------- */
  .section-head {
    padding: 40px 20px 0;
  }

  .counter-list {
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 280px;
  }

  .counter-item {
    aspect-ratio: 1 / 1;
    padding: 30px;
  }

  /* -------------------- 最新消息 -------------------- */

  .news-item {
    padding: 12px 14px;
    gap: 0;
    flex-wrap: wrap;
    border-radius: 0;
  }

  .news-list {
    gap: 0;
  }

  .news-date {
    min-width: auto;
    font-size: 16px;
    width: 100%;
    color: #999;
    text-align: center;
  }

  .news-arrow {
    width: 35px;
    height: 35px;
  }


  /* -------------------- 五大服務：手機收成單張卡片＋左右箭頭切換 -------------------- */
  .service-tabs {
    gap: 10px;
  }

  .service-tabs-track {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .service-tab {
    display: none;
    padding: 20px 14px 22px;
    border-radius: var(--radius-md);
  }

  .service-tab[aria-selected="true"] {
    display: block;
    animation: panelFadeIn 0.35s var(--ease-out);
  }

  .service-tab h3 {
    font-size: 24px;
    margin-bottom: 8px;
    letter-spacing: 0.1em;
  }

  .service-tab .tab-visual {
    height: 80px;
  }

  .service-tab .tab-num {
    font-size: 100px;
    font-weight: 600;
  }

  .service-tab-arrow {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 15px;
    flex-shrink: 0;
  }

  .service-links {
    grid-template-columns: 1fr;
  }

  .service-links .service-link-item:nth-child(5) {
    max-width: none;
  }

  /* -------------------- Footer -------------------- */
  .footer-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .footer-nav a {
    border-right: none;
    padding-inline: 0;
  }

  .footer-middle {
    flex-direction: column;
    align-items: center;
  }
}

/* 極小尺寸保護（320px）*/
@media (max-width: 360px) {
  .principle-grid {
    gap: 10px;
  }

  .kv-title {
    width: 96%;
  }
}