/* =========================================================
   สไตล์หลักของเว็บไซต์ผลงานนักศึกษา
   ธีม: "บัตร/ตั๋วนักศึกษา" — โทนหมึกน้ำเงินเข้ม + กระดาษ + ทอง
   ========================================================= */

:root {
  --ink:        #17233d;   /* น้ำเงินเข้ม (นำทาง/หัวข้อ) */
  --ink-soft:   #223457;
  --paper:      #f7f3e8;   /* พื้นหลังกระดาษ */
  --paper-card: #fffdf7;
  --gold:       #c99a3b;   /* สีเน้นหลัก */
  --gold-soft:  #e7c878;
  --teal:       #2f6e68;   /* สีเน้นรอง / ลิงก์ */
  --ink-text:   #262420;
  --muted:      #6b675e;
  --line:       #d9d2bf;
  --radius:     14px;
  --shadow:     0 10px 30px rgba(23, 35, 61, 0.12);
  --font-display: "Kanit", "Sarabun", sans-serif;
  --font-body:    "Sarabun", sans-serif;
  --font-mono:    "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-text);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 0.5em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  display: inline-block;
  margin-bottom: 0.6em;
}

.container {
  width: min(1080px, 92%);
  margin-inline: auto;
}

/* ---------- Skip link (accessibility) ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--gold);
  color: var(--ink);
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Navigation ---------- */
.site-header {
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 14px rgba(0,0,0,0.18);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  font-family: var(--font-display);
  color: #fff;
  font-weight: 600;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,154,59,0.25);
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-menu a {
  color: #d9def0;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
  display: inline-block;
}

.nav-menu a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.nav-menu a.active {
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 60px;
  background:
    radial-gradient(circle at 85% 0%, rgba(201,154,59,0.12), transparent 55%),
    var(--paper);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
}

.hero .lede {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 46ch;
}

.btn-row { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }

.btn-primary {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(201,154,59,0.35);
}
.btn-outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-teal {
  background: var(--teal);
  color: #fff;
}
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Student ID card (signature element) ---------- */
.id-card {
  background: var(--ink);
  color: #f2ecda;
  border-radius: 18px;
  padding: 26px;
  position: relative;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.id-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.035) 0 2px, transparent 2px 22px);
  pointer-events: none;
}
.id-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-soft);
  border-bottom: 1px dashed rgba(255,255,255,0.25);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.id-card-body { display: flex; gap: 18px; align-items: center; }
.id-photo {
  width: 92px;
  height: 92px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--gold);
  flex-shrink: 0;
  background: #0f1830;
}
.id-photo img { width: 100%; height: 100%; object-fit: cover; }
.id-name { font-family: var(--font-display); font-size: 1.25rem; margin: 0 0 4px; color: #fff; }
.id-role { color: var(--gold-soft); font-size: 0.9rem; margin-bottom: 8px; }
.id-meta { font-family: var(--font-mono); font-size: 0.78rem; color: #b9c0d6; }
.id-card-notch {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  background: var(--paper);
  border-radius: 50%;
}

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-alt { background: #f0ead8; }
.section-head { max-width: 62ch; margin-bottom: 36px; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

/* generic content card */
.card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* ---------- Ticket-stub card (homework / portfolio items) ---------- */
.stub {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  position: relative;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stub::before,
.stub::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--paper);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
}
.stub::before { left: -9px; }
.stub::after { right: -9px; }
.stub-tear {
  border-top: 2px dashed var(--line);
  margin: 6px 0 4px;
}
.stub-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(47,110,104,0.1);
  border-radius: 999px;
  padding: 4px 10px;
  width: fit-content;
}
.stub h3 { font-size: 1.15rem; margin-bottom: 2px; }
.stub p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.stub-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- Timeline (CV) ---------- */
.timeline { border-left: 2px dashed var(--line); padding-left: 26px; display: flex; flex-direction: column; gap: 26px; }
.timeline-item { position: relative; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 2px var(--ink);
}
.timeline-item .when {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--teal);
}

/* skills */
.skill-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.skill-list li {
  background: var(--ink);
  color: var(--gold-soft);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 7px 14px;
  border-radius: 999px;
}

/* ---------- Forms ---------- */
.form-card { max-width: 620px; }
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.92rem;
  color: var(--ink);
}
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: #fff;
  color: var(--ink-text);
  transition: border-color 0.15s;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--teal);
}
.field textarea { resize: vertical; min-height: 130px; }
.field .hint { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.form-status {
  margin-top: 14px;
  font-size: 0.92rem;
  padding: 10px 14px;
  border-radius: 10px;
  display: none;
}
.form-status.show { display: block; }
.form-status.ok { background: rgba(47,110,104,0.12); color: var(--teal); }

/* ---------- Contact info row ---------- */
.contact-info { display: flex; flex-direction: column; gap: 14px; }
.contact-info .item { display: flex; gap: 12px; align-items: flex-start; }
.contact-info .icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--ink); color: var(--gold-soft);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.85rem; flex-shrink: 0;
}

/* ---------- Detail page (hw pages) ---------- */
.detail-hero {
  background: var(--ink);
  color: #eee6cf;
  padding: 46px 0;
}
.detail-hero .eyebrow { color: var(--gold-soft); }
.detail-hero h1 { color: #fff; }
.detail-meta { display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.82rem; color: #b9c0d6; margin-top: 10px; }
.breadcrumb { font-size: 0.85rem; margin-bottom: 14px; }
.breadcrumb a { color: var(--gold-soft); }

figure.shot { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
figure.shot figcaption { padding: 10px 14px; font-size: 0.85rem; color: var(--muted); background: var(--paper-card); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #b9c0d6;
  padding: 34px 0;
  margin-top: 40px;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
}
.footer-row a { color: var(--gold-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid-3 { grid-template-columns: 1fr; }
  .nav { flex-direction: column; align-items: flex-start; }
  .nav-menu { gap: 2px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}

/* Visible keyboard focus */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}
