/* pvec/themes/default/css/main.css */

/* ── CSS Variables (เปลี่ยน theme ที่นี่) ── */
:root {
  --clr-primary:     #2563eb;
  --clr-primary-dk:  #1d4ed8;
  --clr-accent:      #0ea5e9;
  --clr-bg:          #f8fafc;
  --clr-surface:     #ffffff;
  --clr-border:      #e2e8f0;
  --clr-text:        #1e293b;
  --clr-text-muted:  #64748b;
  --clr-success:     #16a34a;
  --clr-warning:     #ca8a04;

  --font-sans: 'Sarabun', system-ui, -apple-system, sans-serif;
  --radius:    0.5rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow:    0 4px 16px rgba(0,0,0,.10);
  --transition: 0.2s ease;

  --nav-h: 60px;
  --container-max: 1100px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Thai font via Google Fonts CDN */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--clr-primary);
  font-weight: 700;
  font-size: 1rem;
}

.navbar-logo { height: 38px; width: auto; object-fit: contain; }

.navbar-logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  background: var(--clr-primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 700;
}

.navbar-title {
  font-size: 0.92rem;
  color: var(--clr-text);
  line-height: 1.3;
}

.navbar-menu {
  display: flex;
  list-style: none;
  gap: 0.25rem;
}

.navbar-menu a {
  display: block;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--clr-text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

.navbar-menu a:hover,
.navbar-menu a.active {
  background: var(--clr-primary);
  color: #fff;
}

.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.navbar-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--clr-text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ── Main ── */
.main-content {
  flex: 1;
  padding: 1.5rem 0 2.5rem;
}

/* ── Footer ── */
.footer {
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-border);
  padding: 1rem 0;
}

.footer-inner { text-align: center; }

.footer-text {
  color: var(--clr-text-muted);
  font-size: 0.82rem;
}

/* ── Typography ── */
h1 { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 700; line-height: 1.3; }
h2 { font-size: clamp(1.1rem, 3vw, 1.5rem); font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }

/* ── Utility ── */
.d-none        { display: none !important; }
.d-sm-inline   { display: none; }
.text-muted    { color: var(--clr-text-muted); }
.text-center   { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }

/* ── Responsive ── */
@media (min-width: 480px) {
  .d-sm-inline { display: inline; }
}

@media (max-width: 640px) {
  .navbar-toggle { display: flex; }

  .navbar-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow);
  }

  .navbar-menu.open { display: flex; }
  .navbar-menu a { padding: 0.6rem 1rem; }
}