/* ============================================================
   shared.css
   Rules common to every page (index.html + character.html):
   design tokens, base reset, header/nav, buttons, footer, reveal
   animation. Page-specific layout (hero, cards, detail page, etc.)
   stays in style.css / character.css.
   ============================================================ */

@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("../fonts/LINESeedSansTH_W_Th.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("../fonts/LINESeedSansTH_W_Rg.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("../fonts/LINESeedSansTH_W_He.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("../fonts/LINESeedSansTH_W_Bd.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("../fonts/LINESeedSansTH_W_XBd.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --background: #fff8fb;
  --primary-pink: #f7a8c4;
  --dark-pink: #e56a9c;
  --text: #444444;
  --muted: #7b6f75;
  --card: #ffffff;
  --border: #f4dce8;
  --shadow: 0 18px 48px rgba(229, 106, 156, 0.13);
  --shadow-hover: 0 24px 64px rgba(229, 106, 156, 0.2);
  --radius: 8px;
  --container: 1180px;

  /* Character brand tones — one unique, non-yellow/green color per character */
  --tone-1: #f2bbcb;
  --tone-2: #ee9cb0;
  --tone-3: #fcd8d1;
  --tone-4: #f4c9ab;
  --tone-5: #ceb2ea;
  --tone-6: #f4c3d2;
  --tone-7: #c9a877;
  --tone-8: #bce0e8;
  --tone-9: #f7a8c4;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(
      circle at top left,
      rgba(247, 168, 196, 0.2),
      transparent 32rem
    ),
    linear-gradient(180deg, #fff8fb 0%, #ffffff 45%, #fff8fb 100%),
    repeating-linear-gradient(
      90deg,
      rgba(229, 106, 156, 0.05) 0,
      rgba(229, 106, 156, 0.05) 1px,
      transparent 1px,
      transparent 96px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(229, 106, 156, 0.05) 0,
      rgba(229, 106, 156, 0.05) 1px,
      transparent 1px,
      transparent 96px
    );
  color: var(--text);
  font-family: "LINE Seed Sans TH", "Prompt", "Noto Sans Thai", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(244, 220, 232, 0.8);
  background: #ffffff;
  padding: 8px 0;
}

.navbar {
  width: min(100% - 32px, var(--container));
  height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--dark-pink);
}

.logo-mark {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(229, 106, 156, 0.14);
  color: var(--primary-pink);
  font-size: 1rem;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
  transition:
    color 180ms ease,
    background 180ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: #ffffff;
  color: var(--dark-pink);
  outline: none;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #ffffff;
  color: var(--dark-pink);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: currentColor;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--dark-pink);
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.back-link:hover {
  background: #fff2f7;
  border-color: var(--dark-pink);
}

/* ============ SHARED TEXT / BUTTONS ============ */
.eyebrow {
  margin: 0 0 18px;
  color: var(--dark-pink);
  font-weight: 700;
  font-size: 0.95rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 22px;
  background: var(--dark-pink);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 14px 34px rgba(229, 106, 156, 0.26);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  background: #d94d86;
  box-shadow: 0 18px 42px rgba(229, 106, 156, 0.34);
  outline: none;
}

.text-link {
  color: var(--dark-pink);
  font-weight: 700;
}

/* ============ FOOTER ============ */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 40px 0 44px;
}

.footer-inner {
  position: relative;
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 16px;
}

.footer-bar {
  position: absolute;
  left: 71px;
  right: 0;
  top: 64%;
  height: 17%;
  background: linear-gradient(
    90deg,
    #e56a9c 0%,
    #e56a9c 40%,
    #f1abcc 40%,
    #f1abcc 58%,
    #fcdfea 58%,
    #fcdfea 100%
  );
  z-index: 0;
  pointer-events: none;
}

.footer-banner-wrap {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  /* กัน footer-banner ลอยขึ้นกลาง .footer-inner ตอนแถวสูงกว่าตัวรูป (เช่น
     มือถือที่ .footer-bottom กลายเป็นตัวกำหนดความสูงแถวแทนแบนเนอร์) —
     ยึดขอบล่างของรูปให้ตรงกับขอบล่างของโลโก้เสมอ (ทั้งคู่ชนขอบล่างแถว
     เหมือนกัน) ให้แถบสีลายเส้นที่วาดในรูป footer.png ต่อเนื่องกับแถบสี
     ของ .footer-bar ได้ทุกความกว้างจอ ไม่ใช่แค่ desktop ที่รูปสูงกว่าแถว
     อยู่แล้วพอดี (ทำให้ align ไหนก็ไม่ต่างกัน จึงไม่กระทบ desktop) */
  align-self: flex-end;
}

.footer-banner {
  width: auto;
  max-width: min(100%, 340px);
  height: auto;
}

.footer-bottom {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  margin-left: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  margin-top: 26px;
}

.footer-copyright {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ============ REVEAL ANIMATION ============ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 520ms ease,
    transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 720px) {
  .navbar {
    height: 64px;
  }

  .logo-mark {
    width: 42px;
    height: 42px;
  }

  .logo {
    font-size: 1.2rem;
  }

  .menu-toggle {
    display: inline-block;
  }

  .nav-links {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 72px;
    display: grid;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    padding: 10px;
    transform-origin: top;
    transform: scaleY(0.95);
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 160ms ease,
      transform 160ms ease;
  }

  .nav-links.is-open {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    width: 100%;
  }

  /* กลับมาโชว์ color bar บนมือถือ (เคยซ่อนไว้) — แนวนอนไม่ต้องตั้งใหม่
     เพราะ base rule มี left:71px อยู่แล้ว ซึ่งตรงกับขอบซ้ายของตัว ©
     พอดีเหมือนที่ทำไว้บน desktop */
  .footer-logo {
    margin-top: 16px;
  }

  /* แนวตั้งของ .footer-bar (top/height เป็น % ของ .footer-inner) ใช้ค่า
     เดียวกับ desktop ไม่ได้ — footer-inner บนมือถือเตี้ยกว่ามาก เพราะ
     footer-banner หดตามความกว้างจอจนต่ำกว่าความสูงของ .footer-bottom เอง
     (footer-bottom เลยกลายเป็นตัวกำหนดความสูงแถวแทน) ทำให้ค่า % เดิมพา
     แถบสีไปทับท้ายข้อความ © แทนที่จะอยู่ใต้ — ปรับใหม่ตามสัดส่วนจริงของ
     มือถือ ให้เว้นช่องว่างใต้ข้อความเหมือน desktop แล้วพาดผ่านโลโก้ครึ่งล่าง
     เหมือนเดิม */
  .footer-bar {
    top: 71%;
    height: 20%;
  }
}
