/* ============================================================
   MiniPriza — ตลาดงานศิลปะไทย และแกลเลอรี่ผลงานของน้องกัปตัน
   Static site CSS
   ============================================================ */

:root {
  --brand: #E2592E;
  --brand-dark: #C2431F;
  --brand-soft: #FBEAE2;
  --teal: #1B7A78;
  --teal-dark: #135E5C;
  --teal-soft: #E2F0EE;
  --gold: #E9A13B;
  --ink: #33261F;
  --ink-soft: #5C4B40;
  --paper: #FDF8F2;
  --soft: #F6EDE3;
  --card: #FFFFFF;
  --line: #EADFD3;
  --muted: #8A7A6E;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 6px 24px rgba(51, 38, 31, 0.08);
  --shadow-lg: 0 14px 44px rgba(51, 38, 31, 0.14);
  --font-body: 'Noto Sans Thai', 'Prompt', -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Prompt', 'Noto Sans Thai', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--brand); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.35;
  font-weight: 700;
}

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(253, 248, 242, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.5px;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--gold));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  box-shadow: var(--shadow);
}
.brand small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 1.5px; line-height: 1.1; }

.site-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; flex-wrap: wrap; }
.site-nav a {
  display: block;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 15px;
}
.site-nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.site-nav a.active { background: var(--brand); color: #fff; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 24px; height: 2.5px; background: var(--ink); margin: 5px 0; border-radius: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: 0;
  cursor: pointer;
  font-family: var(--font-head);
  transition: transform .15s ease, box-shadow .15s ease, background .18s ease;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--teal); border: 2px solid var(--teal); }
.btn-ghost:hover { background: var(--teal-soft); color: var(--teal-dark); }
.btn-light { background: #fff; color: var(--brand-dark); box-shadow: var(--shadow); }
.btn-light:hover { color: var(--brand); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(233, 161, 59, 0.28), transparent 60%),
    radial-gradient(900px 500px at -5% 110%, rgba(27, 122, 120, 0.16), transparent 60%),
    var(--soft);
  border-bottom: 1px solid var(--line);
  padding: 64px 0 60px;
}
.hero-inner { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(30px, 4.5vw, 46px); margin-bottom: 16px; letter-spacing: -0.5px; }
.hero h1 .accent { color: var(--brand); }
.hero p.lead { font-size: 18px; color: var(--ink-soft); max-width: 34em; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 32px; flex-wrap: wrap; }
.hero-stats .stat strong { display: block; font-family: var(--font-head); font-size: 26px; color: var(--brand-dark); }
.hero-stats .stat span { font-size: 13px; color: var(--muted); }
.hero-art { position: relative; }
.hero-art .polaroid {
  background: #fff; padding: 10px 10px 14px; border-radius: 8px;
  box-shadow: var(--shadow-lg); transform: rotate(2deg); max-width: 360px; margin-inline: auto;
}
.hero-art .polaroid img { border-radius: 4px; }
.hero-art .polaroid figcaption { text-align: center; font-size: 13px; color: var(--ink-soft); padding-top: 8px; font-weight: 500; }
.hero-art .polaroid.rotate-l { transform: rotate(-3deg); }
.hero-art .tilt-back { position: absolute; inset: -14px -14px auto auto; background: var(--teal); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); transform: rotate(4deg); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-soft { background: var(--soft); }
.section-teal { background: var(--teal); color: #fff; }
.section-title { font-size: clamp(24px, 3vw, 32px); margin-bottom: 8px; letter-spacing: -0.3px; }
.section-sub { color: var(--muted); margin-bottom: 28px; max-width: 46em; }
.section-teal .section-sub { color: rgba(255, 255, 255, 0.85); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head .more { font-weight: 600; white-space: nowrap; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-img { aspect-ratio: 4/3; overflow: hidden; background: var(--soft); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-img img { transform: scale(1.05); }
.card-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card-meta {
  font-size: 12.5px; font-weight: 700; color: var(--teal);
  text-transform: uppercase; letter-spacing: 0.8px;
}
.card h3 { font-size: 18px; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--brand); }
.card p { color: var(--ink-soft); font-size: 14.5px; flex: 1; }
.readmore { font-weight: 600; font-size: 14.5px; }

/* ---------- Gallery ---------- */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.filter-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font-head);
  transition: all .18s ease;
}
.filter-btn:hover { border-color: var(--brand); color: var(--brand-dark); }
.filter-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  background: var(--soft);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  aspect-ratio: 4/5;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item .g-cap {
  position: absolute; inset-inline: 0; bottom: 0;
  padding: 34px 14px 12px;
  background: linear-gradient(transparent, rgba(30, 20, 14, 0.82));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}
.gallery-item:hover .g-cap { opacity: 1; transform: none; }
.gallery-empty { display: none; text-align: center; color: var(--muted); padding: 40px 0; }
.gallery-empty.show { display: block; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  background: rgba(20, 13, 9, 0.92);
  align-items: center; justify-content: center;
  padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox-fig { max-width: min(920px, 94vw); width: 100%; text-align: center; }
.lightbox-fig img { max-height: 70vh; margin-inline: auto; border-radius: 10px; box-shadow: var(--shadow-lg); }
.lightbox-info { background: #fff; margin-top: 16px; border-radius: var(--radius); padding: 18px 22px; text-align: left; max-height: 34vh; overflow: auto; }
.lightbox-info h3 { font-size: 20px; margin-bottom: 4px; }
.lightbox-info .lb-tags { font-size: 13px; color: var(--teal); font-weight: 600; margin-bottom: 8px; }
.lightbox-info p { font-size: 14.5px; color: var(--ink-soft); }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: #fff;
  font-size: 26px;
  width: 46px; height: 46px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s ease;
  z-index: 5;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: var(--brand); }
.lightbox-close { top: 18px; right: 18px; }
.lightbox-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; top: 22px; left: 22px; color: rgba(255,255,255,.8); font-size: 14px; }

/* ---------- Article page ---------- */
.article-page { max-width: 780px; margin-inline: auto; padding: 40px 0 64px; }
.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.article-hero { margin-bottom: 24px; }
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.article-hero h1 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 12px; }
.article-hero .excerpt { font-size: 17px; color: var(--ink-soft); }
.article-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-top: 14px; }
.article-meta a { font-weight: 600; }
.article-cover { border-radius: var(--radius-lg); margin: 22px 0; box-shadow: var(--shadow); }
.article-cover figcaption { font-size: 13px; color: var(--muted); padding: 8px 4px 0; text-align: center; }

.fact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 24px 0; }
.fact-grid .fact {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.fact-grid small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.fact-grid strong { font-size: 14.5px; font-family: var(--font-head); }

.article-body section { margin: 26px 0; }
.article-body h2 { font-size: 24px; margin-bottom: 10px; padding-top: 6px; }
.article-body h3 { font-size: 19px; margin-bottom: 8px; }
.article-body p { margin-bottom: 12px; color: var(--ink-soft); }
.article-body ul, .article-body ol { margin: 0 0 14px 22px; color: var(--ink-soft); }
.article-body li { margin-bottom: 6px; }
.article-body blockquote {
  border-left: 4px solid var(--gold);
  background: var(--soft);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 18px 0;
  font-style: normal;
}
.article-body blockquote p { margin: 0; color: var(--ink); font-weight: 500; }
.article-source-box {
  background: var(--teal-soft);
  border: 1px solid #C5E0DE;
  border-radius: var(--radius);
  padding: 20px 22px;
}
.article-source-box h2 { font-size: 20px; margin-bottom: 6px; }
.article-notice { font-size: 13.5px; color: var(--muted); background: var(--soft); padding: 12px 16px; border-radius: 10px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.article-tags span {
  font-size: 13px;
  background: var(--soft);
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 500;
}
.share-box { background: var(--soft); border-radius: var(--radius); padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.share-box h3 { font-size: 17px; }

/* ---------- Knowledge / Learn / Masterpiece ---------- */
.kb-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }
.kb-toc { position: sticky; top: 90px; align-self: start; }
.kb-toc h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 10px; }
.kb-toc ul { list-style: none; }
.kb-toc li { margin-bottom: 6px; }
.kb-toc a { display: block; padding: 7px 12px; border-radius: 9px; font-size: 14.5px; color: var(--ink-soft); border-left: 3px solid transparent; }
.kb-toc a:hover { background: var(--brand-soft); color: var(--brand-dark); border-left-color: var(--brand); }
.kb-content { min-width: 0; }
.kb-content h2 { font-size: 26px; margin: 34px 0 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.kb-content h2:first-child { border-top: 0; margin-top: 0; }
.kb-content h3 { font-size: 20px; margin: 20px 0 8px; }
.kb-content p { color: var(--ink-soft); margin-bottom: 12px; }
.kb-content figure { margin: 18px 0; }
.kb-content figure img { border-radius: var(--radius); box-shadow: var(--shadow); }
.kb-content figure figcaption { font-size: 13px; color: var(--muted); text-align: center; padding-top: 8px; }
.kb-content ul, .kb-content ol { margin: 0 0 14px 22px; color: var(--ink-soft); }
.kb-content li { margin-bottom: 6px; }
.kb-content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14.5px; }
.kb-content th, .kb-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.kb-content th { background: var(--soft); font-family: var(--font-head); }
.kb-content blockquote { border-left: 4px solid var(--gold); background: var(--soft); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 14px 0; }
.kb-content .refs { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 28px; padding-top: 14px; }
.kb-content .refs li { margin-bottom: 4px; }

.infobox {
  float: right;
  width: 260px;
  margin: 0 0 18px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.infobox img { width: 100%; aspect-ratio: 1/1.1; object-fit: cover; }
.infobox .ib-body { padding: 14px 16px; font-size: 13.5px; }
.infobox .ib-body h4 { font-size: 15px; margin-bottom: 6px; }
.infobox .ib-row { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.infobox .ib-row dt { width: 92px; color: var(--muted); font-size: 12.5px; flex-shrink: 0; }
.infobox .ib-row dd { color: var(--ink-soft); font-size: 13px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin: 24px 0 8px; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 3px; background: var(--brand-soft); border-radius: 2px; }
.timeline li { position: relative; margin-bottom: 14px; color: var(--ink-soft); }
.timeline li::before { content: ''; position: absolute; left: -23px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--brand); }

/* ---------- Callouts ---------- */
.callout { border-radius: var(--radius); padding: 18px 20px; margin: 18px 0; border: 1px solid var(--line); background: var(--card); }
.callout-tip { border-left: 5px solid var(--gold); }
.callout-info { border-left: 5px solid var(--teal); }
.callout-warn { border-left: 5px solid var(--brand); }
.callout strong { display: block; margin-bottom: 4px; font-family: var(--font-head); }
.callout p { margin: 0; color: var(--ink-soft); }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(120deg, var(--brand-dark), var(--brand));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
}
.cta-banner h2 { font-size: 26px; margin-bottom: 6px; }
.cta-banner p { color: rgba(255, 255, 255, 0.9); margin-bottom: 0; }

/* ---------- Ad slots (AdSense / affiliate placeholders) ---------- */
.ad-slot {
  background: repeating-linear-gradient(45deg, #f3ece2, #f3ece2 12px, #efe6da 12px, #efe6da 24px);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  min-height: 90px;
  margin: 28px 0;
  text-align: center;
  padding: 12px;
}
.ad-slot.horizontal { min-height: 90px; }
.ad-slot.billboard { min-height: 250px; }

/* ---------- Footer ---------- */
.site-footer { background: #2A2019; color: #D8C9BC; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; padding: 48px 0 30px; }
.site-footer .brand { color: #fff; margin-bottom: 10px; }
.site-footer p { font-size: 14px; color: #BCAB9C; max-width: 36em; }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #BCAB9C; font-size: 14.5px; }
.site-footer a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding: 16px 0; font-size: 13px; color: #948372; text-align: center; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { background: var(--soft); border-bottom: 1px solid var(--line); padding: 44px 0 40px; }
.page-hero h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 8px; }
.page-hero p { color: var(--ink-soft); font-size: 17px; max-width: 42em; }

/* ---------- Misc ---------- */
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
}
.divider { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
.text-center { text-align: center; }
.mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; } .mt-3 { margin-top: 34px; }
.mb-1 { margin-bottom: 10px; } .mb-2 { margin-bottom: 20px; }

.color-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 96px; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); text-align: center; }
.swatch .sw-color { height: 54px; }
.swatch .sw-name { font-size: 12px; padding: 6px 4px; background: #fff; color: var(--ink-soft); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .kb-layout { grid-template-columns: 1fr; }
  .kb-toc { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .infobox { float: none; width: 100%; margin: 0 0 18px; }
}

@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .fact-grid { grid-template-columns: repeat(2, 1fr); }
  .site-nav {
    position: fixed;
    inset: 0;
    background: var(--paper);
    padding: 80px 24px 24px;
    transform: translateX(100%);
    transition: transform .28s ease;
    z-index: 55;
  }
  .site-nav.open { transform: none; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 8px; }
  .site-nav a { font-size: 18px; padding: 12px 16px; }
  .nav-toggle { display: block; position: relative; z-index: 70; }
  .hero { padding: 40px 0; }
  .footer-inner { grid-template-columns: 1fr; }
  .section { padding: 40px 0; }
  .cta-banner { padding: 28px 22px; }
  .lightbox-prev { left: 6px; } .lightbox-next { right: 6px; }
  .lb-count { display: none; }
}
