/* learn.html · tabs + "เริ่มจากคำถาม" FAQ panel (v3: journey path · icon cards · visual answers) */
.lf-tabs { display: flex; gap: .5rem; width: min(1680px, calc(100% - 48px)); margin: 84px auto 0; }
/* the tabs sit under the fixed 64px nav, so the map hero no longer needs its own 112px top gap */
.lf-tabs + #knowledge-map-app .knowledge-page { padding-top: 28px; }
.lf-tabs button { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .55rem 1.1rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; background: rgba(255, 255, 255, .03); color: #b6bbcc; font: 700 .95rem 'Outfit', 'Mitr', sans-serif; cursor: pointer; transition: .15s; }
.lf-tabs button:hover { color: #fff; border-color: rgba(229, 197, 134, .6); }
.lf-tabs button[aria-selected="true"] { border-color: #e5c586; background: rgba(229, 197, 134, .14); color: #f5e3b8; }
.lf-tabs button:focus-visible { outline: 2px solid #e5c586; outline-offset: 2px; }
.lf-badge { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: #e5c586; color: #1a1406; font-size: .75rem; }

.lf-panel { width: min(1120px, calc(100% - 32px)); margin: 0 auto 5rem; padding-top: 12px; color: #cfd4e0; font-family: Sarabun, sans-serif; }

/* hero */
.lf-hero { position: relative; margin: 1rem 0 1.6rem; padding: clamp(1.6rem, 4vw, 2.6rem) clamp(1.3rem, 4vw, 2.8rem); overflow: hidden; border: 1px solid rgba(229, 197, 134, .25); border-radius: 24px; background: radial-gradient(ellipse 50% 90% at 92% 20%, rgba(229, 197, 134, .2), transparent 70%), radial-gradient(ellipse 40% 80% at 0% 100%, rgba(77, 210, 160, .1), transparent 70%), linear-gradient(160deg, #0d1426, #070b16); }
.lf-hero::after { content: '💬'; position: absolute; right: clamp(1rem, 5vw, 3.5rem); top: 50%; transform: translateY(-50%) rotate(-8deg); font-size: clamp(4.5rem, 11vw, 8.5rem); filter: drop-shadow(0 18px 50px rgba(229, 197, 134, .35)); opacity: .9; pointer-events: none; }
.lf-kicker { display: inline-block; margin: 0; padding: .25rem .75rem; border-radius: 999px; background: rgba(229, 197, 134, .14); color: #e5c586; font: 700 .78rem 'Outfit', 'Mitr', sans-serif; letter-spacing: .06em; }
.lf-hero h2 { margin: .7rem 0 .5rem; color: #fff; font: 800 clamp(2rem, 5vw, 3.2rem)/1.15 'Outfit', 'Mitr', sans-serif; max-width: 14ch; }
.lf-hero p { position: relative; z-index: 1; margin: 0; max-width: 34rem; color: #b6bbcc; font-size: 1.03rem; line-height: 1.75; }

/* journey path */
.lf-path { display: flex; align-items: stretch; gap: 0; margin: 0 0 1.4rem; }
.lf-path button { position: relative; flex: 1 1 0; display: grid; justify-items: center; gap: .15rem; min-width: 0; padding: 1rem .6rem .9rem; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); border-radius: 18px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 12%, transparent), rgba(255, 255, 255, .015)); color: #cfd4e0; cursor: pointer; text-align: center; transition: transform .15s, border-color .15s, background .15s; }
.lf-path button:hover { transform: translateY(-3px); border-color: var(--c); }
.lf-path button.is-on { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, #0b1120); box-shadow: 0 10px 30px color-mix(in srgb, var(--c) 25%, transparent); }
.lf-path button:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; }
.lf-step-n { position: absolute; top: .55rem; left: .7rem; font: 800 .75rem 'Outfit', 'Mitr', sans-serif; color: var(--c); opacity: .8; }
.lf-step-ic { font-size: 2rem; line-height: 1.2; }
.lf-path b { color: #fff; font: 700 1rem 'Outfit', 'Mitr', sans-serif; }
.lf-path small { color: #9ba1b3; font-size: .78rem; line-height: 1.4; }
.lf-path em { margin-top: .25rem; padding: .1rem .55rem; border-radius: 999px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); font: 700 .72rem 'Outfit', 'Mitr', sans-serif; font-style: normal; }
.lf-path-line { flex: 0 0 18px; align-self: center; height: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, .05)); }

/* toolbar */
.lf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 1rem; }
.lf-search { flex: 1 1 260px; display: flex; align-items: center; gap: .5rem; min-height: 46px; padding: 0 .9rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; background: rgba(6, 12, 24, .7); }
.lf-search:focus-within { border-color: #e5c586; }
.lf-search input { flex: 1; min-width: 0; border: 0; background: none; color: #fff; font: 500 1rem Sarabun, sans-serif; outline: none; color-scheme: dark; }
.lf-sort { display: flex; gap: .35rem; }
.lf-sort button, .lf-dice, .lf-filter-note button { min-height: 44px; padding: .45rem .9rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; background: rgba(255, 255, 255, .03); color: #b6bbcc; font: 600 .9rem Sarabun, sans-serif; cursor: pointer; }
.lf-sort button.is-on { border-color: #e5c586; color: #f5e3b8; background: rgba(229, 197, 134, .1); }
.lf-dice { border-color: rgba(229, 197, 134, .45); color: #f5e3b8; }
.lf-dice:hover { background: rgba(229, 197, 134, .12); }
.lf-filter-note { display: flex; align-items: center; gap: .6rem; margin: 0 0 1rem; color: #9ba1b3; font-size: .9rem; }
.lf-filter-note button { min-height: 32px; padding: .2rem .7rem; font-size: .82rem; }

/* cards */
.lf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; align-items: start; }
.lf-card { position: relative; overflow: hidden; border: 1px solid rgba(255, 255, 255, .09); border-left: 4px solid var(--c); border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 7%, transparent), rgba(255, 255, 255, .02)); transition: border-color .15s, transform .15s; }
.lf-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.lf-card[open] { grid-column: 1 / -1; transform: none; border-color: color-mix(in srgb, var(--c) 60%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--c) 12%, #0b1120), #0a0f1d); }
.lf-card.is-picked { animation: lf-pop .6s ease; }
@keyframes lf-pop { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 70%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.lf-card summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .9rem; padding: 1rem 1.1rem; list-style: none; cursor: pointer; }
.lf-card summary::-webkit-details-marker { display: none; }
.lf-card summary:focus-visible { outline: 2px solid var(--c); outline-offset: -2px; border-radius: 14px; }
.lf-ic { display: grid; place-items: center; width: 3.1rem; height: 3.1rem; border-radius: 14px; background: color-mix(in srgb, var(--c) 18%, #0b1120); font-size: 1.6rem; }
.lf-qt { display: grid; gap: .15rem; min-width: 0; }
.lf-qt small { color: var(--c); font: 700 .74rem 'Outfit', 'Mitr', sans-serif; letter-spacing: .02em; }
.lf-qt b { color: #fff; font: 600 1.05rem/1.45 'Outfit', 'Mitr', sans-serif; }
.lf-meta { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-style: normal; color: #7d859b; font-size: .78rem; }
.lf-hot { margin-left: .25rem; padding: .05rem .45rem; border-radius: 999px; background: rgba(255, 107, 107, .16); color: #ff9b8a; }
.lf-toggle { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); color: var(--c); font-style: normal; font-size: 1.2rem; transition: transform .2s; }
.lf-card[open] .lf-toggle { transform: rotate(45deg); }

/* answer */
.lf-body { padding: 0 1.3rem 1.3rem 5.1rem; }
.lf-tl { margin: 0 0 1rem; padding: .85rem 1rem; border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, transparent); color: #fff; font: 700 1.1rem/1.6 'Outfit', 'Mitr', sans-serif; }
.lf-steps { display: flex; flex-wrap: wrap; align-items: stretch; gap: .45rem; margin: 0 0 1rem; padding: 0; list-style: none; counter-reset: lfstep; }
.lf-steps li { position: relative; flex: 1 1 140px; padding: .7rem .8rem .7rem 2.2rem; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; background: rgba(6, 12, 24, .55); color: #e3e7f0; font-size: .92rem; line-height: 1.5; counter-increment: lfstep; }
.lf-steps li::before { content: counter(lfstep); position: absolute; left: .7rem; top: .7rem; display: grid; place-items: center; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--c); color: #0b1120; font: 800 .7rem 'Outfit', 'Mitr', sans-serif; }
.lf-a { margin: 0 0 1rem; max-width: 68ch; color: #cfd4e0; font-size: 1rem; line-height: 1.85; }
.lf-a b { color: #fff; }
.lf-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.lf-links a { display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; padding: .45rem .9rem; border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--c) 10%, transparent); color: #fff; font: 600 .9rem Sarabun, sans-serif; text-decoration: none; transition: .15s; }
.lf-links a i { font-style: normal; color: var(--c); transition: transform .15s; }
.lf-links a:hover, .lf-links a:focus-visible { background: color-mix(in srgb, var(--c) 22%, transparent); outline: none; }
.lf-links a:hover i { transform: translateX(3px); }
.lf-vote { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; padding-top: .8rem; border-top: 1px dashed rgba(255, 255, 255, .1); color: #9ba1b3; font-size: .88rem; }
.lf-vote button { min-height: 36px; padding: .3rem .75rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; background: none; color: #cfd4e0; font: 600 .85rem Sarabun, sans-serif; cursor: pointer; }
.lf-vote button:hover { border-color: var(--c); }
.lf-vote em { font-style: normal; color: var(--c); }

.lf-empty { padding: 2rem; border: 1px dashed rgba(255, 255, 255, .15); border-radius: 16px; text-align: center; color: #9ba1b3; }
.lf-note { margin: 1.6rem 0 0; color: #7d859b; font-size: .82rem; }

@media (max-width: 900px) {
  .lf-path { overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .4rem; }
  .lf-path button { flex: 0 0 132px; scroll-snap-align: start; }
  .lf-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .lf-tabs { width: calc(100% - 28px); }
  .lf-tabs button { flex: 1; justify-content: center; padding: .55rem .6rem; font-size: .88rem; }
  .lf-hero::after { top: 1rem; transform: rotate(-8deg); font-size: 3.4rem; opacity: .5; }
  .lf-body { padding: 0 1rem 1.1rem; }
  .lf-card summary { gap: .7rem; padding: .9rem; }
  .lf-ic { width: 2.6rem; height: 2.6rem; font-size: 1.35rem; }
  .lf-sort { width: 100%; }
  .lf-sort button { flex: 1; }
  .lf-dice { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .lf-panel *, .lf-card { transition: none !important; animation: none !important; } }

.lf-panel [hidden] { display: none !important; }
.lf-path { scrollbar-width: none; }
.lf-path::-webkit-scrollbar { display: none; }
