/* IWISH THAILAND — Five Elements & deities page.
   Cream base, soft pastel gradients and glass cards for this page only; the site header,
   logo and footer keep the main red & white theme. */
.fe-page {
  --fe-cream: #FBF8F2;
  --fe-ink: #2F2A26;
  --fe-ink-2: #6A625B;
  --fe-line: rgba(47, 42, 38, .10);
  --fe-glass: rgba(255, 255, 255, .58);
  --fe-glass-line: rgba(255, 255, 255, .85);
  --fe-accent: #9B1C24;
  --fe-wood: #7E9C68; --fe-fire: #C2703F; --fe-earth: #A88A5E; --fe-metal: #A8935F; --fe-water: #5E86A6;
  background: var(--fe-cream);
  color: var(--fe-ink);
  font-weight: 300;
}
.fe-page h1, .fe-page h2, .fe-page h3, .fe-page h4 { font-family: "IWISH Latin", "Kanit", sans-serif; font-weight: 500; color: var(--fe-ink); }
.fe-page:lang(zh-Hant), .fe-page :lang(zh-Hant) { font-family: "IWISH Latin", "Noto Serif TC", "PingFang TC", "Heiti TC", serif; }
html[lang="zh-Hant"] .fe-page h1, html[lang="zh-Hant"] .fe-page h2, html[lang="zh-Hant"] .fe-page h3, html[lang="zh-Hant"] .fe-page h4 { font-family: "IWISH Latin", "Noto Serif TC", "PingFang TC", serif; }
html[lang="zh-Hant"] body.fe-page { font-family: "IWISH Latin", "Noto Serif TC", "PingFang TC", "Kanit", sans-serif; }

.fe-glass {
  background: var(--fe-glass);
  border: 1px solid var(--fe-glass-line);
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(80, 60, 40, .10), inset 0 1px 0 rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
}

/* Language switcher (in the logo header) */
.fe-page .header-inner { position: relative; }
.fe-lang { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: #F4F1EC; }
@media (min-width: 720px) { .fe-lang { right: 32px; } }
.fe-lang button { border: 0; background: none; font: inherit; font-size: 13px; color: var(--fe-ink-2); padding: 5px 11px; border-radius: 999px; cursor: pointer; min-height: 30px; }
.fe-lang button[aria-pressed="true"] { background: #fff; color: var(--fe-ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); font-weight: 500; }
.fe-lang button:focus-visible { outline: 2px solid var(--fe-accent); outline-offset: 1px; }
@media (max-width: 420px) { .fe-lang button { padding: 5px 8px; font-size: 12px; } .fe-page .logo-img { height: 28px; } .fe-page .header-inner { justify-content: flex-start !important; } }

/* Intro */
.fe-intro { text-align: center; padding-top: 44px; padding-bottom: 28px; }
.fe-kicker { font-family: "IWISH Latin", "Aboreto", "Kanit", sans-serif; letter-spacing: .28em; font-size: 13px; color: var(--fe-ink-2); margin-bottom: 10px; }
.fe-intro h1 { font-size: clamp(28px, 5.4vw, 44px); font-weight: 400; }
.fe-sub { max-width: 40em; margin: 10px auto 0; color: var(--fe-ink-2); font-size: 16px; }
.fe-notice { display: inline-flex; align-items: flex-start; gap: 8px; margin-top: 20px; padding: 10px 16px; border-radius: 14px; background: #FFF4E5; color: #7A5A1E; font-size: 14px; text-align: left; max-width: 42em; }
.fe-notice svg { flex: none; width: 18px; height: 18px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* Stage */
.fe-stage { position: relative; overflow: hidden; min-height: 520px; background: linear-gradient(180deg, var(--g0, #F7F1E6), var(--g1, #E6D6BB)); transition: background .8s ease; }
.fe-canvas, .fe-video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: opacity .45s ease; }
.fe-video { object-fit: cover; }
.fe-stage.is-switching .fe-canvas, .fe-stage.is-switching .fe-video { opacity: 0; }
.fe-stage-inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 22px; padding-top: 48px; padding-bottom: 32px; min-height: 520px; justify-content: space-between; }
.fe-panel { display: flex; gap: 24px; align-items: center; padding: 26px 28px; max-width: 640px; transition: opacity .35s ease, transform .35s ease; }
.fe-stage.is-switching .fe-panel { opacity: .2; transform: translateY(6px); }
.fe-han { flex: none; font-family: "IWISH Latin", "Noto Serif TC", serif; font-weight: 400; font-size: clamp(72px, 14vw, 120px); line-height: 1; color: var(--el-color, var(--fe-ink)); }
.fe-en { font-family: "IWISH Latin", "Aboreto", "Kanit", sans-serif; letter-spacing: .3em; font-size: 15px; color: var(--el-color, var(--fe-ink-2)); }
.fe-panel h2 { font-size: clamp(26px, 4.6vw, 34px); font-weight: 400; margin: 2px 0 6px; }
.fe-hongfan { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 20px; }
.fe-hongfan small { font-size: 12.5px; color: var(--fe-ink-2); font-family: "IWISH Latin", "Kanit", sans-serif; }
.fe-meaning { color: var(--fe-ink-2); margin-top: 4px; font-size: 15.5px; }
.fe-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.fe-chips div { display: flex; gap: 6px; align-items: baseline; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.7); border: 1px solid var(--fe-line); font-size: 13.5px; }
.fe-chips dt { color: var(--fe-ink-2); } .fe-chips dd { margin: 0; font-weight: 500; }
@media (max-width: 560px) { .fe-panel { flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px; } }

/* Selector */
.fe-selector { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; max-width: 640px; }
.fe-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 18px; cursor: pointer; font: inherit; color: var(--fe-ink);
  background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.8); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background .25s, transform .25s, box-shadow .25s; }
.fe-tab:hover { background: rgba(255,255,255,.75); transform: translateY(-2px); }
.fe-tab[aria-selected="true"] { background: #fff; box-shadow: 0 10px 26px rgba(80,60,40,.16); border-color: var(--tab-color); }
.fe-tab:focus-visible { outline: 2px solid var(--fe-accent); outline-offset: 2px; }
.fe-tab-han { font-family: "IWISH Latin", "Noto Serif TC", serif; font-size: 28px; line-height: 1.2; color: var(--tab-color); }
.fe-tab-label { font-size: 12.5px; color: var(--fe-ink-2); white-space: nowrap; }

/* Deity groups & cards */
.fe-deities { padding-top: 48px; padding-bottom: 24px; }
.fe-group { margin-bottom: 40px; }
.fe-group h3 { font-size: clamp(20px, 3.4vw, 24px); font-weight: 500; }
.fe-group-sub { color: var(--fe-ink-2); font-size: 14.5px; margin-top: 4px; }
.fe-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.fe-card { position: relative; text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 18px 18px 16px; border-radius: 20px;
  background: linear-gradient(160deg, rgba(255,255,255,.85), rgba(255,255,255,.55)); border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 10px 28px rgba(80,60,40,.08); transition: transform .25s, box-shadow .25s; display: flex; flex-direction: column; gap: 6px; min-height: 196px; overflow: hidden; }
.fe-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--card-color, #C9C2B8); opacity: .8; }
.fe-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(80,60,40,.14); }
.fe-card:focus-visible { outline: 2px solid var(--fe-accent); outline-offset: 3px; }
.fe-card-han { font-family: "IWISH Latin", "Noto Serif TC", serif; font-size: 30px; line-height: 1.25; color: var(--card-color, var(--fe-ink)); }
.fe-card-name { font-weight: 500; font-size: 15.5px; line-height: 1.45; }
.fe-card-pinyin { font-family: "Helvetica Neue", Arial, sans-serif; font-size: 12px; letter-spacing: .06em; color: var(--fe-ink-2); }
.fe-card-role { font-size: 13.5px; color: var(--fe-ink-2); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fe-card .fe-badge { margin-top: auto; }
.fe-empty { padding: 22px; border-radius: 18px; border: 1px dashed rgba(47,42,38,.2); background: rgba(255,255,255,.45); }
.fe-empty strong { display: block; font-weight: 500; }
.fe-empty span { color: var(--fe-ink-2); font-size: 14px; }

/* Evidence indicator */
.fe-badge { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 4px 11px 4px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 500; }
.fe-dots { display: inline-flex; gap: 3px; }
.fe-dots i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; }
.fe-dots i.on { background: currentColor; }
.fe-badge.DIRECT { background: #E4F1E9; color: #2E6E4C; }
.fe-badge.SYMBOLIC { background: #F6EDD9; color: #855F17; }
.fe-badge.UNASSIGNED { background: #EEECEA; color: #6B6560; }
.fe-legend { padding: 20px 22px; margin-top: 8px; }
.fe-legend h4 { font-size: 16px; margin-bottom: 10px; }
.fe-legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 820px) { .fe-legend ul { grid-template-columns: repeat(3, 1fr); } }
.fe-legend li { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--fe-ink-2); }

/* BaZi panel */
.fe-bazi { padding: 26px; margin: 8px 0 18px; }
.fe-bazi h3 { font-size: 22px; }
.fe-bazi-status { margin-top: 8px; color: #7A5A1E; background: #FFF4E5; padding: 10px 14px; border-radius: 12px; font-size: 14.5px; }
.fe-bazi-data { margin-top: 10px; font-size: 14.5px; color: var(--fe-ink-2); }
.fe-bazi-fields { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fe-bazi-fields li { padding: 6px 12px; border-radius: 999px; border: 1px dashed rgba(47,42,38,.25); color: #9A928A; font-size: 13px; }
.fe-bazi-cta { display: inline-flex; margin-top: 16px; padding: 10px 22px; border-radius: 999px; background: var(--fe-accent); color: #fff; text-decoration: none; font-weight: 500; font-size: 15px; }
.fe-bazi-cta:hover { background: #7A141B; }
.fe-disclaimer { text-align: center; font-size: 12.5px; color: #9A928A; padding-bottom: 40px; }

/* Deity modal */
.fe-modal { position: relative; width: min(100%, 560px); max-height: calc(100vh - 32px); overflow-y: auto; padding: 30px 28px 26px; border-color: rgba(255,255,255,.9); background: #FFFDF9; }
.fe-modal-x { position: absolute; right: 12px; top: 12px; }
.fe-dm-han { font-family: "IWISH Latin", "Noto Serif TC", serif; font-size: 44px; line-height: 1.2; color: var(--card-color, var(--fe-ink)); }
.fe-modal h3 { font-size: 22px; margin-top: 4px; }
.fe-dm-pinyin { font-family: "Helvetica Neue", Arial, sans-serif; letter-spacing: .06em; font-size: 13px; color: var(--fe-ink-2); margin: 2px 0 12px; }
.fe-dm-list { margin: 18px 0 8px; }
.fe-dm-list div { padding: 10px 0; border-top: 1px solid var(--fe-line); }
.fe-dm-list dt { font-size: 13px; color: var(--fe-ink-2); }
.fe-dm-list dd { margin: 2px 0 0; font-size: 15px; }
.fe-modal h4 { font-size: 15px; margin-top: 12px; }
.fe-dm-sources { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 12px; font-size: 14px; }
.fe-dm-sources a { color: var(--fe-accent); word-break: break-word; }
.fe-dm-sources blockquote { margin: 4px 0 0; padding: 6px 10px; border-left: 3px solid #E7DCCB; background: #FAF6EF; color: #4F4842; font-size: 13.5px; }
.fe-src-kind { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #F1ECE4; color: #6A625B; margin-left: 6px; vertical-align: 1px; }

/* Footer on this page uses the same red footer as the rest of the site */
@media (prefers-reduced-motion: reduce) {
  .fe-canvas, .fe-video, .fe-panel, .fe-tab, .fe-card, .fe-stage { transition: none; }
}

/* pinyin carries tone marks that Aboreto lacks, so it uses a full-Latin font */
.fe-quote-th { font-size: 13.5px; color: #4F4842; margin: 4px 0 0; }

/* ===== responsive pass (2026-11-13): language switch buttons big enough to tap ===== */
@media (pointer: coarse) { .fe-lang button { min-height: 36px; min-width: 40px; } }
