/* ===========================================================
   FONT·STUDIO — flat design
   palette: black #111111 · white #ffffff · yellow #FFD400
   rule: no box-shadow, no text-shadow, no glow, no filter.
   =========================================================== */

:root {
  --black: #111111;
  --white: #ffffff;
  --yellow: #FFD400;
  --yellow-ink: #7a6500;   /* readable yellow-ish for focus borders */
  --line: #111111;
  --muted: #6b6b6b;
  --paper: #fafafa;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--white);
  color: var(--black);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans Thai", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- Header ---------- */
.site-header { border-bottom: 2px solid var(--line); }
.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; cursor: pointer; padding: 0;
}
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--yellow);
  border: 1px solid var(--line);
  font-weight: 900; font-size: 18px; color: var(--black);
}
.brand-name { font-weight: 900; letter-spacing: -0.02em; font-size: 18px; }
.dot { color: var(--yellow-ink); }

.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge {
  border: 1px solid var(--line);
  padding: 7px 12px;
  font-size: 13px;
  white-space: nowrap;
}
.badge b { color: var(--yellow-ink); }

/* ---------- Buttons (flat, no shadow) ---------- */
.btn {
  font: inherit;
  font-weight: 600;
  padding: 9px 16px;
  border: 1px solid var(--line);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color .12s linear, color .12s linear;
  background: var(--white);
  color: var(--black);
  line-height: 1.2;
}
.btn:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
.btn-ghost:hover { background: var(--black); color: var(--white); }
.btn-primary { background: var(--yellow); color: var(--black); }
.btn-primary:hover { background: var(--black); color: var(--yellow); }
.btn.block { width: 100%; }

.link-btn {
  background: none; border: 0; padding: 0; margin-top: 14px;
  color: var(--black); text-decoration: underline; cursor: pointer;
  font: inherit; font-size: 14px;
}

.g-mark {
  width: 20px; height: 20px; display: grid; place-items: center;
  border: 1px solid var(--line); font-weight: 900; font-size: 13px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: 16px; transform: translateX(-50%);
  z-index: 50;
  background: var(--yellow); color: var(--black);
  border: 1px solid var(--line);
  padding: 10px 18px; font-weight: 600;
}

/* ---------- Main ---------- */
.main { padding: 32px 20px 48px; }

/* ---------- Hero ---------- */
.hero {
  border: 2px solid var(--line);
  background: var(--black);
  color: var(--white);
  padding: 40px 32px;
  margin-bottom: 32px;
}
.hero-eyebrow {
  margin: 0 0 12px; letter-spacing: .28em; text-transform: uppercase;
  font-size: 12px; color: var(--yellow);
}
.hero-title { margin: 0; font-size: clamp(30px, 5vw, 48px); font-weight: 900; line-height: 1.05; }
.hero-title .hl { background: var(--yellow); color: var(--black); padding: 0 8px; }
.hero-sub { margin: 16px 0 0; color: #cfcfcf; max-width: 44ch; }

/* ---------- Store grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.font-card {
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: background-color .12s linear;
}
.font-card:hover { background: var(--yellow); }
.font-card:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
.card-specimen {
  height: 150px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  display: grid; place-items: center;
  overflow: hidden;
  font-size: 40px;
  padding: 0 10px;
}
.card-specimen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-meta { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
.card-meta .name { font-weight: 700; }
.card-meta .price { font-size: 14px; }

/* ---------- Detail ---------- */
.back-btn { margin-bottom: 16px; }
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-visual { border: 1px solid var(--line); }
.detail-specimen {
  height: 260px; border-bottom: 1px solid var(--line); background: var(--paper);
  display: grid; place-items: center; overflow: hidden; font-size: 56px;
}
.detail-specimen img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { padding: 24px; }
.detail-info h2 { margin: 0; font-size: 26px; font-weight: 900; }
.detail-info .desc { color: var(--muted); margin: 8px 0 20px; }
.detail-buyrow { display: flex; align-items: center; justify-content: space-between; }
.detail-price { font-size: 24px; font-weight: 800; }

.tester { border: 1px solid var(--line); padding: 24px; }
.tester-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 12px; }
.tester-preview { border: 1px solid var(--line); padding: 18px; margin-top: 16px; }
.tester-line { margin: 0 0 14px; line-height: 1.15; word-break: break-word; }
.tester-line:last-child { margin-bottom: 0; }

/* ---------- Cards / forms ---------- */
.card { border: 2px solid var(--line); padding: 24px; }
.card-title { margin: 0 0 16px; font-size: 20px; font-weight: 900; }
.auth-card { max-width: 440px; margin: 0 auto; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: block; }
.field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }

.input {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--black);
}
.input::placeholder { color: #9a9a9a; }
.input:focus { outline: none; border-color: var(--yellow-ink); }
textarea.input { resize: vertical; }

.file-btn {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color .12s linear, color .12s linear;
}
.file-btn:hover { background: var(--black); color: var(--white); }
.file-preview { margin-top: 12px; width: 100%; height: 130px; object-fit: cover; border: 1px solid var(--line); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.alert { border: 1px solid var(--line); background: var(--yellow); color: var(--black); padding: 10px 12px; font-size: 14px; }

.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Dashboard ---------- */
.dash { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.owner-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.owner-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); padding: 10px 12px; }
.owner-item .oi-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-item .oi-price { font-size: 13px; color: var(--muted); }
.icon-btn { border: 1px solid var(--line); background: var(--white); padding: 8px 10px; cursor: pointer; font: inherit; transition: background-color .12s linear, color .12s linear; }
.icon-btn:hover { background: var(--black); color: var(--white); }

.empty { border: 1px dashed var(--line); padding: 32px; text-align: center; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 2px solid var(--line); }
.footer-inner { padding: 22px 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .detail { grid-template-columns: 1fr; }
  .dash { grid-template-columns: 1fr; }
  .nav .btn-ghost[data-nav="store"] { display: none; }
  .badge { display: none; }
}

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