/* =========================================================
   Guide V3 - Strategy guide center
   Desktop: fixed left accordion + fixed right parchment
   Mobile : left drawer menu + CMS content
========================================================= */

/* 這頁不用顯示首頁錨點 menu */
/* .guide-v3-body .menu li a {
  display: none;
} */

body.guide-v3-body {
  position: relative;
  min-height: 100vh;
  background-color: #000;
}

body.guide-v3-body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background-color: #000;
  background-image: url('../images/bg_guide.webp');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
}

body.guide-v3-body .wrapper {
  position: relative;
  z-index: 1;

  width: 100%;
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: visible;

  background: transparent;
}

body.guide-v3-body .smooth_content {
  position: relative;
  width: 100%;
  height: auto;

  background: transparent;
  transform: none !important;
  will-change: auto;
}

.news_breadcrumb {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.55rem;
  color: rgba(231, 203, 138, 0.82);
  font-family: 'Noto Serif TC', serif;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.news_breadcrumb a {
  color: rgba(231, 203, 138, 0.82);
  transition:
    color 0.2s ease,
    text-shadow 0.2s ease;
}

.news_breadcrumb a:hover {
  color: #fff0b5;
  text-shadow: 0 0 8px rgba(255, 220, 120, 0.35);
}

#guidePage {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 0 0 5rem;
  color: #fff;
  overflow: visible;
}

#guidePage .fade_bg,
.guide-v3-body .dark_fade_section::after {
  display: none;
}

#guidePage .guide_page_wrap {
  position: relative;
  z-index: 3;
  width: 1200px;
  max-width: calc(100% - 80px);
  margin: 0 auto;
  padding-top: clamp(58px, 8vw, 92px);
  opacity: 1;
  filter: none;
  transform: none;
}

.guide_page_title {
  margin: 0 0 clamp(0rem, 1.8vw, 1rem);
  margin-top: 1rem;
  text-align: center;
  margin: 1rem auto;
}

.guide_page_title img {
  width: min(270px, 34vw);
  margin: 0;
}

.guide_text_title {
  margin: 0;
  color: #f1d892;
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 900;
  letter-spacing: 0.22em;
  text-shadow:
    0 0 16px rgba(255, 207, 96, 0.35),
    0 4px 8px rgba(0, 0, 0, 0.6);
}

.guide_layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 40px;
  width: 100%;
}

/* =========================================================
   Mobile drawer button / mask
========================================================= */

.guide_drawer_btn,
.guide_drawer_mask,
.guide_drawer_close {
  display: none;
}

/* =========================================================
   Sidebar / accordion
========================================================= */

.guide_sidebar {
  flex: 0 0 260px;
  width: 260px;
  position: sticky;
  top: 120px;
  align-self: flex-start;
  min-height: 620px;
  padding: 1.45rem 1.15rem 1.35rem;
  background:
    linear-gradient(rgba(5, 5, 4, 0.86), rgba(5, 5, 4, 0.9)) padding-box,
    linear-gradient(135deg, rgba(204, 170, 94, 0.68), rgba(96, 73, 40, 0.65), rgba(229, 199, 130, 0.7)) border-box;
  border: 1px solid transparent;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 231, 166, 0.08) inset;
}

.guide_sidebar_top {
  position: relative;
}

.guide_sidebar_head {
  margin: 0 0 1rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid rgba(185, 151, 82, 0.32);
  text-align: center;
  color: #f1d892;
  font-family: 'Noto Serif TC', serif;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.28em;
}

.guide_nav_group {
  margin-bottom: 0.65rem;
}

.guide_nav_toggle {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0 0.75rem;
  border: 0;
  background: linear-gradient(90deg, rgba(124, 91, 36, 0.22), rgba(255, 223, 142, 0.05));
  color: #ead394;
  font-family: 'Noto Serif TC', serif;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: 0.25s ease;
}

.guide_nav_toggle:hover,
.guide_nav_group.is-open .guide_nav_toggle {
  color: #fff0b8;
  background: linear-gradient(90deg, rgba(189, 145, 62, 0.32), rgba(255, 223, 142, 0.1));
  text-shadow: 0 0 8px rgba(255, 220, 120, 0.25);
}

.guide_nav_toggle i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}

.guide_nav_group.is-open .guide_nav_toggle i {
  transform: rotate(-135deg);
}

.guide_nav_list {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0.4rem 0 0.15rem !important;
}

.guide_nav_group.is-open .guide_nav_list {
  display: block;
}

.guide_nav_item {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 0 0.8rem 0 1.45rem;
  border: 0;
  background: transparent;
  color: rgba(232, 213, 159, 0.75);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: 0.2s ease;
}

.guide_nav_item::before {
  content: '';
  position: absolute;
  left: 0.65rem;
  top: 50%;
  width: 4px;
  height: 4px;
  transform: translateY(-50%) rotate(45deg);
  background: rgba(211, 178, 99, 0.75);
}

.guide_nav_item:hover,
.guide_nav_item.active {
  color: #fff3bd;
  text-shadow: 0 0 8px rgba(255, 220, 120, 0.25);
  background: linear-gradient(90deg, rgba(255, 217, 128, 0.12), transparent);
}

/* =========================================================
   Content panel
========================================================= */

.guide_content_panel {
  flex: 0 0 900px;
  width: 900px;
  max-width: 900px;
  position: relative;
  min-height: 720px;
  padding: clamp(2.6rem, 4vw, 4rem) clamp(2rem, 4.6vw, 4.6rem);
  color: #3f3123;
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(92, 64, 29, 0.22) inset;
  position: relative;
  min-height: 720px;

  padding: 0;

  background: none;

  box-shadow: none;
}

.guide_paper {
  width: 100%;
}

.guide_paper_body {
  padding: clamp(2.6rem, 4vw, 4rem) clamp(2rem, 4.6vw, 4.6rem);

  background: url('../images/guide_body.webp') repeat-y center top;

  background-size: 100% auto;

  /* box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18); */
  min-height: 542px;
}

.guide_paper_bottom {
  height: 40px;

  background: url('../images/guide_foot.webp') center bottom no-repeat;

  background-size: 100% 100%;
}
.guide_paper_top {
  height: 40px;

  background: url('../images/guide_head.webp') center top no-repeat;

  background-size: 100% 100%;
}

.guide_content_panel:focus {
  outline: none;
}

.guide_content_inner {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.guide_article_header {
  text-align: center;
  margin-bottom: 2.2rem;
}

.guide_article_category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 28px;
  padding: 0 1rem;
  margin-bottom: 0.8rem;
  color: #7e5520;
  border: 1px solid rgba(126, 85, 32, 0.42);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.guide_article_header h1 {
  margin: 0;
  color: #563717;
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(1.85rem, 3vw, 2.8rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.35;
}

.guide_article_header p {
  margin: 0.85rem auto 0;
  max-width: 680px;
  color: #7a5c38;
  font-size: 1rem;
  line-height: 1.8;
  font-weight: 500;
}

.guide_article_header::after {
  content: '';
  display: block;
  width: min(620px, 100%);
  height: 1px;
  margin: 1.6rem auto 0;
  background: linear-gradient(to right, transparent, rgba(126, 85, 32, 0.55), transparent);
}

/* =========================================================
   CMS editor content
========================================================= */

.news_editor {
  width: 100%;
  margin: 0 auto;
  color: #3f3123;
  font-size: clamp(15px, 1.05vw, 18px);
  line-height: 2;
  letter-spacing: 0.04em;
  font-family: 'Noto Sans TC', sans-serif;
  text-align: left;
  word-break: break-word;
}

.news_editor p {
  margin: 1.15em 0;
  font-weight: 500;
}

.news_editor strong,
.news_editor b {
  font-weight: 900;
  color: #6b4210;
}

.news_editor a {
  color: #8a5b17;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  word-break: break-all;
}

.news_editor img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 28px auto;
  border-radius: 4px;
  box-shadow:
    0 6px 16px rgba(68, 42, 18, 0.22),
    0 0 0 1px rgba(120, 83, 36, 0.25);
}

.news_editor iframe {
  display: block;
  width: 100% !important;
  aspect-ratio: 16 / 9;
  height: auto !important;
  margin: 30px auto;
  border: 0;
  box-shadow:
    0 6px 16px rgba(68, 42, 18, 0.22),
    0 0 0 1px rgba(120, 83, 36, 0.25);
}

.news_editor ul,
.news_editor ol {
  margin: 1.2em 0;
  padding-left: 1.6em !important;
}

.news_editor li {
  margin: 0.45em 0;
  line-height: 1.9;
  font-weight: 500;
  /* font-size: 1.1rem; */
}

.news_editor table {
  width: 100%;
  margin: 1.8em 0;
  border-collapse: collapse;
  color: #3f3123;
  font-size: 0.95em;
}

.news_editor th,
.news_editor td {
  border: 1px solid rgba(128, 91, 45, 0.45);
  padding: 12px 14px;
  vertical-align: top;
  font-weight: 500;
}

.news_editor th {
  background: rgba(128, 91, 45, 0.12);
  color: #6b4210;
  font-weight: 900;
}

.guide_step_box {
  margin: 1.4rem 0;
  padding: 1.1rem 1.3rem;
  border-left: 4px solid rgba(126, 85, 32, 0.5);
  background: rgba(126, 85, 32, 0.08);
}

/* =========================================================
   CMS safety styles - for backend editors
   後台上稿防爆版型：標題、表格、圖片、影片、連結都會自動適配
========================================================= */

.news_editor * {
  max-width: 100%;
}

.news_editor h2,
.news_editor h3,
.news_editor h4 {
  margin: 1.8em 0 0.75em;
  color: #6b4210;
  font-family: 'Noto Serif TC', serif;
  font-weight: 900;
  line-height: 1.45;
  letter-spacing: 0.06em;
  font-weight: 900;
}

.news_editor h2 {
  position: relative;
  padding-left: 0.9em;
  font-size: 1.45em;
  border-bottom: 1px solid rgba(128, 91, 45, 0.24);
  padding-bottom: 0.45em;
  font-weight: 800;
}

.news_editor h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.35em;
  height: 0.35em;
  transform: rotate(45deg);
  background: #9a6727;
}

.news_editor h3 {
  font-size: 1.22em;
}

.news_editor h4 {
  font-size: 1.08em;
}

.news_editor p:first-child {
  margin-top: 0;
}

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

.news_editor span {
  max-width: 100%;
}

.news_editor img {
  width: auto;
  max-width: 100% !important;
}

.news_editor p[style*='text-align:center'],
.news_editor p[style*='text-align: center'] {
  text-align: center !important;
}

.news_editor iframe,
.news_editor video {
  max-width: 100% !important;
}

.news_editor table {
  table-layout: fixed;
  word-break: break-word;
}

.news_editor th,
.news_editor td {
  word-break: break-word;
}

.news_editor blockquote {
  margin: 1.6em 0;
  padding: 1em 1.2em;
  border-left: 4px solid rgba(128, 91, 45, 0.55);
  background: rgba(128, 91, 45, 0.08);
  color: #4c3928;
}

.news_editor hr {
  border: 0;
  height: 1px;
  margin: 2.2em 0;
  background: linear-gradient(to right, transparent, rgba(128, 91, 45, 0.55), transparent);
}

.news_editor .cms_note,
.news_editor .guide_note {
  margin: 1.4rem 0;
  padding: 1.1rem 1.3rem;
  border-left: 4px solid rgba(126, 85, 32, 0.5);
  background: rgba(126, 85, 32, 0.08);
}

/* =========================================================
   Tablet
========================================================= */

@media screen and (max-width: 1280px) {
  #guidePage .guide_page_wrap {
    width: 1120px;
    max-width: calc(100% - 60px);
  }

  .guide_layout {
    gap: 32px;
  }

  .guide_sidebar {
    flex-basis: 250px;
    width: 250px;
  }

  .guide_content_panel {
    flex-basis: 820px;
    width: 820px;
    max-width: 820px;
  }
}

/* =========================================================
   Mobile drawer layout
========================================================= */

@media screen and (max-width: 1080px) {
  #guidePage .guide_page_wrap {
    width: 94vw;
    max-width: 94vw;
    padding-top: 88px;
  }

  .guide_page_title img {
    width: min(360px, 70vw);
  }

  .guide_layout {
    display: block;
  }

  #guidePage .guide_page_wrap {
    text-align: center;
  }

  .guide_drawer_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-width: 150px;
    height: 44px;
    /* margin: 0 0 1rem; */
    padding: 0 1.1rem;
    border: 1px solid rgba(206, 174, 102, 0.55);
    background: rgba(0, 0, 0, 0.72);
    color: #f3dc9b;
    font-family: 'Noto Serif TC', serif;
    font-weight: 900;
    letter-spacing: 0.14em;
    position: relative;
    z-index: 40;
    cursor: pointer;
  }

  .guide_drawer_icon,
  .guide_drawer_icon::before,
  .guide_drawer_icon::after {
    content: '';
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    position: relative;
  }

  .guide_drawer_icon::before {
    position: absolute;
    top: -6px;
  }

  .guide_drawer_icon::after {
    position: absolute;
    top: 6px;
  }

  .guide_drawer_mask {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10040;
    background: rgba(0, 0, 0, 0.62);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
  }

  .guide_sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(330px, 84vw);
    height: 100vh;
    min-height: 100vh;
    padding: 5.2rem 1.1rem 1.3rem;
    z-index: 10050;
    transform: translateX(-105%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
  }

  .guide_drawer_close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 0;
    top: -3.55rem;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(206, 174, 102, 0.45);
    background: rgba(0, 0, 0, 0.35);
    color: #f3dc9b;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
  }

  body.guide-drawer-open .guide_sidebar {
    transform: translateX(0);
  }

  body.guide-drawer-open .guide_drawer_mask {
    opacity: 1;
    pointer-events: auto;
  }

  body.guide-drawer-open {
    overflow: hidden;
  }

  .guide_content_panel {
    width: 100%;
    max-width: 100%;
    min-height: 560px;
    padding: 2.6rem 2rem;
  }

  .guide_content_inner {
    max-width: 760px;
  }
}

/* =========================================================
   Mobile
========================================================= */

@media screen and (max-width: 576px) {
  #guidePage {
    padding-bottom: 3rem;
  }

  #guidePage .guide_page_wrap {
    width: 96vw;
    max-width: 96vw;
    padding-top: 74px;
    text-align: center;
  }

  .guide_page_title {
    margin-bottom: 1rem;
  }

  .guide_page_title img {
    width: min(320px, 72vw);
  }

  .guide_drawer_btn {
    height: 42px;
    font-size: 0.92rem;
  }

  .guide_sidebar {
    width: min(310px, 86vw);
    padding: 4.8rem 1rem 1.2rem;
  }

  .guide_sidebar_head {
    font-size: 1.05rem;
    letter-spacing: 0.22em;
  }

  .guide_nav_toggle {
    min-height: 44px;
    font-size: 1rem;
  }

  .guide_nav_item {
    min-height: 38px;
    font-size: 0.86rem;
  }

  .guide_content_panel {
    padding: 2.1rem 1.35rem;
    background-size: 100% 100%;
  }

  .guide_paper_body {
    min-height: auto;
  }

  .guide_article_header {
    margin-bottom: 1.6rem;
  }

  .guide_article_category {
    font-size: 0.78rem;
  }

  .guide_article_header h1 {
    font-size: 1.65rem;
    letter-spacing: 0.06em;
  }

  .guide_article_header p {
    font-size: 1rem;
  }

  .news_editor {
    font-size: 14px;
    line-height: 1.8;
    letter-spacing: 0.02em;
    font-weight: 500;
  }

  .news_editor img,
  .news_editor iframe {
    margin: 18px auto;
  }

  .news_editor table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* =========================================================
   Guide V3 - backend editor helper blocks
   後台可直接套用的提示框，不會爆版
========================================================= */

.news_editor .guide_tip,
.news_editor .guide_warning,
.news_editor .guide_success,
.news_editor .guide_note {
  margin: 1.4rem 0;
  padding: 1.05rem 1.2rem;
  border-radius: 4px;
  line-height: 1.85;
}

.news_editor .guide_tip {
  border-left: 4px solid rgba(151, 105, 34, 0.62);
  background: rgba(151, 105, 34, 0.1);
}

.news_editor .guide_warning {
  border-left: 4px solid rgba(156, 63, 42, 0.62);
  background: rgba(156, 63, 42, 0.09);
}

.news_editor .guide_success {
  border-left: 4px solid rgba(72, 127, 65, 0.58);
  background: rgba(72, 127, 65, 0.09);
}

.news_editor .guide_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 1.35rem;
  margin: 0.4rem 0.35rem 0.4rem 0;
  border: 1px solid rgba(128, 91, 45, 0.48);
  background: linear-gradient(180deg, rgba(151, 105, 34, 0.18), rgba(151, 105, 34, 0.06));
  color: #6b4210;
  font-family: 'Noto Serif TC', serif;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none !important;
  word-break: keep-all;
  transition: 0.22s ease;
}

.news_editor .guide_button:hover {
  color: #8a5b17;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(68, 42, 18, 0.18);
}

.news_editor .guide_img_caption {
  margin-top: -16px;
  color: #7a5c38;
  font-size: 0.88em;
  text-align: center;
}

.news_editor pre,
.news_editor code {
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, 'Courier New', monospace;
}

.news_editor pre {
  margin: 1.4em 0;
  padding: 1em;
  background: rgba(68, 42, 18, 0.08);
  border: 1px solid rgba(128, 91, 45, 0.25);
  color: #4c3928;
  overflow-x: auto;
}

.guide_content_panel {
  opacity: 0;
  transition: opacity 0.25s ease;
}

body.guide-ready .guide_content_panel {
  opacity: 1;
}
