/* =========================================================================
   Ansim Travel link hub — mobile first (390px 기준), 2026-12
   ========================================================================= */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --radius: 18px;
  --radius-sm: 14px;
  --maxw: 460px;
  --tap: 52px;
  --lb: 46px;
}

/* ---- channel palettes ---------------------------------------------------- */
body[data-lang="jp"], body[data-lang="root"] {
  --bg: #FBF6EF;
  --bg2: #F3E7DA;
  --card: #FFFFFF;
  --ink: #2A211B;
  --muted: #7E6C5D;
  --line: #EBDFD1;
  --accent: #BC5F30;
  --accent-ink: #8D3F1C;
  --accent-soft: #F8E8DB;
  --chip: #F2E5D6;
  --feat-a: #FDF3EA;
  --feat-b: #FFFFFF;
  --shadow: 0 6px 18px rgba(92, 57, 33, .07);
}
body[data-lang="tw"] {
  --bg: #FDF7F5;
  --bg2: #F7E7E5;
  --card: #FFFFFF;
  --ink: #2B191A;
  --muted: #7D6365;
  --line: #F0DBD9;
  --accent: #B3323C;
  --accent-ink: #8A1F28;
  --accent-soft: #FBE7E7;
  --chip: #F6E1E1;
  --feat-a: #FDF0F0;
  --feat-b: #FFFFFF;
  --shadow: 0 6px 18px rgba(120, 40, 48, .07);
}
body[data-lang="en"] {
  --bg: #F7F8FB;
  --bg2: #EBEFF7;
  --card: #FFFFFF;
  --ink: #111A2B;
  --muted: #5D6B81;
  --line: #E2E8F1;
  --accent: #1F3A93;
  --accent-ink: #152966;
  --accent-soft: #E8EDFA;
  --chip: #E4EAF7;
  --feat-a: #EFF3FC;
  --feat-b: #FFFFFF;
  --shadow: 0 6px 18px rgba(24, 44, 92, .07);
}
body[data-lang="ar"] {
  --bg: #0B0F0D;
  --bg2: #101714;
  --card: #16201B;
  --ink: #F5F0E6;
  --muted: #A9A294;
  --line: #253029;
  --accent: #C9A227;
  --accent-ink: #EBCF73;
  --accent-soft: #1B2721;
  --chip: #1E2A24;
  --feat-a: #16241D;
  --feat-b: #121A16;
  --shadow: 0 8px 22px rgba(0, 0, 0, .35);
}

html { background: var(--bg); }

body {
  margin: 0;
  background:
    radial-gradient(120% 40% at 50% 0%, var(--bg2) 0%, var(--bg) 58%) no-repeat,
    var(--bg);
  background-size: 100% 420px;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Noto Sans JP", "Noto Sans KR", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}
body[data-lang="ar"] {
  font-family: "Noto Sans Arabic", "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma, system-ui, sans-serif;
  line-height: 1.6;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 18px 40px;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}

a { color: inherit; text-decoration: none; }

/* ---- hero ---------------------------------------------------------------- */
.hero { padding: 0 0 4px; text-align: center; }

.cover {
  position: relative;
  height: 158px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(60, 35, 20, .16);
  background: var(--bg2);
}
.cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 74%;
  display: block;
}
.cover::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 56%, var(--bg) 100%);
}
body[data-lang="ar"] .cover { box-shadow: 0 12px 30px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(201, 162, 39, .18); }

.avatar-wrap { margin-top: -40px; display: grid; place-items: center; position: relative; z-index: 2; }

.avatar {
  width: 80px; height: 80px; margin: 0;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  border: 4px solid var(--bg);
  background: var(--card);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}
body[data-lang="ar"] .avatar { box-shadow: 0 8px 22px rgba(0, 0, 0, .55), 0 0 0 1px rgba(201, 162, 39, .35); }

.eyebrow {
  margin: 12px 0 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--accent);
  text-transform: uppercase;
}
body[data-lang="ar"] .eyebrow { letter-spacing: .08em; }

.hero h1 {
  margin: 0 0 2px;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -.01em;
}

.handle {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .02em;
}

.tagline {
  margin: 0 auto 14px;
  max-width: 322px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* language switcher */
.langbar {
  display: flex; gap: 4px; justify-content: center;
  background: var(--chip);
  border-radius: 999px;
  padding: 4px;
  margin: 0 auto 14px;
  max-width: 330px;
}
.langbar a {
  flex: 1 1 0;
  min-height: 36px;
  display: grid; place-items: center;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 4px;
  transition: background .18s, color .18s;
}
.langbar a.on {
  background: var(--card);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}

.socials { display: flex; gap: 10px; justify-content: center; margin-bottom: 2px; }
.socials a {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--accent);
  transition: transform .15s;
}
.socials a:active { transform: scale(.94); }
.socials svg { width: 18px; height: 18px; display: block; }

/* ---- featured ------------------------------------------------------------ */
.sectitle {
  display: flex; align-items: baseline; gap: 8px;
  margin: 22px 2px 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--ink);
}
.sectitle span.dot {
  color: var(--accent);
}
.sectitle small {
  font-weight: 500; font-size: 11px; color: var(--muted);
}

.featured { display: grid; gap: 9px; }

.feat {
  display: grid;
  grid-template-columns: 44px 1fr 16px;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  padding: 13px 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--feat-a) 0%, var(--feat-b) 78%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.feat:active { transform: scale(.985); }
.feat .ic {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-size: 21px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--line);
}
.feat .tx { min-width: 0; }
.feat .tx b {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.feat .tx i {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}
.feat .go {
  width: 8px; height: 8px;
  border-inline-end: 2px solid var(--accent);
  border-block-start: 2px solid var(--accent);
  transform: rotate(45deg);
  opacity: .9;
}
[dir="rtl"] .feat .go { transform: rotate(-135deg); }

/* ---- category tabs ------------------------------------------------------- */
.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 12px 2px 12px;
  margin: 8px -2px 2px;
  background: linear-gradient(to bottom, var(--bg) 72%, rgba(255, 255, 255, 0));
  backdrop-filter: blur(6px);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .16s, color .16s, border-color .16s;
}
.tab.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
body[data-lang="ar"] .tab.on { color: #10210F; }
.tab .n { font-size: 10.5px; opacity: .75; font-weight: 500; }

.hint {
  margin: 4px 2px 0;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---- accordion sections -------------------------------------------------- */
.sections { display: grid; gap: 9px; margin-top: 12px; }

details.sec {
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
details.sec > summary {
  list-style: none;
  cursor: pointer;
  min-height: var(--tap);
  display: grid;
  grid-template-columns: 32px 1fr auto 15px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 14px;
}
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary .ic { font-size: 18px; text-align: center; }
details.sec > summary .cnt {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--chip);
  border-radius: 999px;
  padding: 2px 8px;
}
details.sec > summary .chev {
  width: 8px; height: 8px;
  border-inline-end: 2px solid var(--muted);
  border-block-end: 2px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .2s ease;
}
details.sec[open] > summary .chev {
  transform: rotate(225deg) translate(-1px, -1px);
}
details.sec[open] > summary { border-bottom: 1px solid var(--line); }

.rows { padding: 9px 9px 10px; display: grid; gap: 7px; }

.link {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: var(--tap);
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid transparent;
  transition: transform .15s ease, border-color .15s;
}
body[data-lang="ar"] .link { background: var(--bg2); }
.link:active { transform: scale(.99); border-color: var(--line); }
.link .ic {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  font-size: 16px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
}
.link .tx { min-width: 0; }
.link .tx b {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.35;
}
.link .tx i {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}
.pchip {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
}
body[data-lang="ar"] .pchip { color: var(--accent-ink); }

details.sec.empty { display: none; }

/* ---- footer -------------------------------------------------------------- */
.pr {
  margin-top: 26px;
  padding: 14px 15px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px dashed var(--line);
}
.pr h2 {
  margin: 0 0 5px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--accent);
  text-transform: uppercase;
}
.pr p { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }

.foot {
  margin-top: 18px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 11px; color: var(--muted);
  text-align: center;
}

.totop {
  position: fixed;
  inset-inline-end: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--accent);
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  z-index: 30;
}
.totop.show { opacity: 1; pointer-events: auto; transform: none; }
.totop::before {
  content: "";
  width: 9px; height: 9px;
  border-inline-start: 2px solid currentColor;
  border-block-start: 2px solid currentColor;
  transform: rotate(45deg) translate(1px, 1px);
}

/* ---- root language chooser ---------------------------------------------- */
.pick { display: grid; gap: 10px; margin-top: 18px; }
.pick a {
  display: grid;
  grid-template-columns: 46px 1fr 16px;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.pick a .ic {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  font-size: 22px; background: var(--bg2);
}
.pick a b { display: block; font-size: 15px; }
.pick a i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); }
.pick a .go {
  width: 9px; height: 9px;
  border-inline-end: 2px solid var(--accent);
  border-block-start: 2px solid var(--accent);
  transform: rotate(45deg);
}

@media (min-width: 520px) {
  .wrap { padding-top: 34px; }
  body { font-size: 15.5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
