/* ============================================================
   โปรแกรมโหราศาสตร์พลโชติ – Shared Stylesheet
   ใช้กับทุกหน้า: index.html และหน้าย่อยทั้งหมด
   ============================================================ */

/* ===== CSS VARIABLES ===== */
:root {
  --bg: #f4f2ee;
  --bg2: #ede9e2;
  --card: #faf8f5;
  --orange: #e07b39;
  --orange-light: #f5a96a;
  --orange-pale: #fde8d4;
  --orange-dark: #c4622a;
  --gray: #8a8278;
  --gray-light: #b8b2a8;
  --gray-dark: #4a4540;
  --text: #2e2b28;
  --text-muted: #7a756f;
  --border: #ddd8d0;
  --shadow: 0 2px 12px rgba(100,80,60,.09);
  --shadow-hover: 0 6px 24px rgba(100,80,60,.16);
  --radius: 14px;
}

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

/* ===== BASE ===== */
body {
  font-family: 'Sarabun', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
}

/* ===== HEADER ===== */
header {
  background: linear-gradient(135deg, #3a3530 0%, #5a4e44 60%, #7a6658 100%);
  position: relative;
  overflow: hidden;
}
header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(224,123,57,.18) 0%, transparent 65%);
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 24px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
}
/* index.html ใช้ header icon ใหญ่กว่า (62px) หน้าย่อยใช้ 50px */
.header-icon {
  width: 62px;
  height: 62px;
  background: linear-gradient(145deg, var(--orange), var(--orange-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(224,123,57,.4);
}
.header-icon.sm {
  width: 50px;
  height: 50px;
  font-size: 22px;
}
.header-text h1 {
  font-family: 'Charm', cursive;
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  color: #fff;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.header-text h1.sm {
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
}
.header-text p {
  color: var(--orange-light);
  font-size: .88rem;
  margin-top: 3px;
}

/* ===== NAV ===== */
nav {
  background: var(--orange);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
}
nav a {
  color: #fff;
  text-decoration: none;
  padding: 11px 28px;
  font-size: .92rem;
  font-weight: 600;
  transition: background .2s;
  white-space: nowrap;
}
nav a:hover,
nav a.active {
  background: rgba(255,255,255,.22);
}

/* ===== BREADCRUMB (หน้าย่อย) ===== */
.breadcrumb {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 16px 0;
  font-size: .79rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--orange-dark); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ===== MAIN ===== */
main { max-width: 960px; margin: 0 auto; padding: 26px 16px 48px; }

/* ===== PAGE TITLE (หน้าย่อย) ===== */
.page-title {
  margin-bottom: 20px;
  border-left: 4px solid var(--orange);
  padding-left: 14px;
}
.page-title h2 { font-size: 1.25rem; font-weight: 700; color: var(--gray-dark); }

/* ===== BACK LINK (หน้าย่อย) ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--orange-dark);
  text-decoration: none;
  font-size: .87rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.back-link:hover { text-decoration: underline; }

/* ===== HERO BAND (index.html) ===== */
.hero-band {
  background: linear-gradient(90deg, var(--orange-pale), #fff8f0);
  border: 1px solid #f0d8c0;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-band .star { font-size: 1.8rem; }
.hero-band p { font-size: .93rem; color: var(--text-muted); flex: 1; }

/* ===== SECTION BLOCK (index.html) ===== */
.section-block { margin-bottom: 30px; }
.section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.icon-android    { background: #dff0e0; }
.icon-windows    { background: #dce8f8; }
.icon-windows-old{ background: #ece8f8; }
.icon-faq        { background: var(--orange-pale); }
.section-header h2 { font-size: 1.05rem; font-weight: 700; color: var(--gray-dark); }

/* ===== BADGE (index.html) ===== */
.badge {
  font-size: .73rem;
  background: var(--orange);
  color: #fff;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
}
.badge-gray { background: var(--gray-light) !important; }

/* ===== LINK GRID (index.html) ===== */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.link-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: box-shadow .2s, border-color .2s, transform .18s;
  box-shadow: var(--shadow);
}
.link-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--orange-light);
  transform: translateY(-2px);
}
.link-card .arrow { font-size: .8rem; color: var(--orange); margin-top: 3px; flex-shrink: 0; }
.link-card span { font-size: .9rem; line-height: 1.5; font-weight: 500; }

/* ===== DIVIDER (index.html) ===== */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 8px 0 24px;
}

/* ===== CONTENT CARD (หน้าย่อย) ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--orange-dark);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.card h4 { font-size: .95rem; font-weight: 700; color: var(--gray-dark); margin: 14px 0 6px; }
.card p  { font-size: .92rem; margin-bottom: 8px; }
.card ul,
.card ol { padding-left: 20px; margin-bottom: 10px; }
.card li  { font-size: .92rem; margin-bottom: 4px; }
.card strong { color: var(--gray-dark); }
.card a      { color: var(--orange-dark); }
.card code {
  background: #f0ede8;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .85rem;
  font-family: monospace;
  color: var(--gray-dark);
  word-break: break-all;
}
.card pre {
  background: #2e2b28;
  color: #f0ede8;
  padding: 14px 16px;
  border-radius: 8px;
  font-family: monospace;
  font-size: .85rem;
  margin: 8px 0 12px;
  overflow-x: auto;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===== NOTICE BOX ===== */
.notice {
  background: var(--orange-pale);
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  padding: 11px 15px;
  margin-bottom: 14px;
  font-size: .9rem;
  color: var(--gray-dark);
}
.notice.gray  { background: #f0ede8; border-color: var(--gray-light); }
.notice.blue  { background: #e8f0fa; border-color: #7aabdb; }
.notice.green { background: #e8f5e8; border-color: #6aab6a; }

/* ===== STEP LIST ===== */
.step-list { counter-reset: step; list-style: none; padding: 0; }
.step-list > li {
  counter-increment: step;
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  align-items: flex-start;
}
.step-list > li::before {
  content: counter(step);
  background: var(--orange);
  color: #fff;
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-content { flex: 1; font-size: .92rem; }

/* ===== IMAGE BOX ===== */
.img-box { margin: 12px 0 16px; text-align: center; }
.img-box img {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  cursor: zoom-in;
  transition: transform .2s;
}
.img-box img:hover { transform: scale(1.01); }
.img-box .img-caption { font-size: .79rem; color: var(--text-muted); margin-top: 6px; }
.img-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
  justify-content: center;
}
.img-row .img-box { flex: 1; min-width: 200px; max-width: 340px; margin: 0; }

/* ===== DOWNLOAD BUTTON ===== */
.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--orange);
  color: #fff;
  text-decoration: none;
  padding: 9px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
  margin-top: 6px;
  transition: background .2s, transform .15s;
  box-shadow: 0 2px 8px rgba(224,123,57,.3);
}
.dl-btn:hover { background: var(--orange-dark); transform: translateY(-1px); }

/* ===== DATA TABLE ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .87rem;
  margin-bottom: 10px;
  display: block;
  overflow-x: auto;
}
.data-table th {
  background: var(--orange-pale);
  color: var(--orange-dark);
  padding: 8px 12px;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid var(--orange-light);
  white-space: nowrap;
}
.data-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fdf5ee; }

/* ===== FAQ ===== */
.faq-q { font-weight: 700; color: var(--gray-dark); margin: 14px 0 4px; font-size: .93rem; }
.faq-q::before { content: "Q: "; color: var(--orange-dark); }
.faq-a { color: var(--text); font-size: .9rem; padding-left: 16px; border-left: 3px solid var(--orange-pale); margin-bottom: 10px; }

/* ===== CONTACT ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 10px;
}
.cbox {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}
.cbox .ci  { font-size: 2rem; margin-bottom: 6px; }
.cbox .cl  { font-size: .74rem; color: var(--text-muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .04em; }
.cbox .cv  { font-size: .95rem; font-weight: 700; color: var(--gray-dark); }
.cbox a    { color: var(--orange-dark); text-decoration: none; }
.cbox a:hover { text-decoration: underline; }
.qr-wrap   { text-align: center; margin-top: 10px; }
.qr-wrap img { width: 165px; height: 165px; border-radius: 10px; border: 3px solid var(--orange-pale); }

/* ===== FOOTER ===== */
footer {
  background: var(--gray-dark);
  color: #b8b2a8;
  text-align: center;
  padding: 22px 16px;
  font-size: .83rem;
}
footer a { color: var(--orange-light); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ===== ZOOM OVERLAY ===== */
#zoom-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 9999;
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#zoom-overlay.show { display: flex; }
#zoom-overlay img  { max-width: 92vw; max-height: 92vh; border-radius: 10px; box-shadow: 0 8px 40px rgba(0,0,0,.6); object-fit: contain; }
#zoom-close {
  position: fixed;
  top: 16px;
  right: 20px;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: .8;
  transition: opacity .2s;
  user-select: none;
}
#zoom-close:hover { opacity: 1; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .header-inner  { padding: 18px 14px 14px; gap: 12px; }
  .header-icon   { width: 46px; height: 46px; font-size: 22px; }
  .header-icon.sm{ width: 38px; height: 38px; font-size: 18px; }
  nav a          { padding: 10px 16px; font-size: .84rem; }
  .card          { padding: 16px 14px; }
  .link-grid     { grid-template-columns: 1fr; }
  .hero-band     { flex-direction: column; gap: 8px; text-align: center; }
  .img-row       { flex-direction: column; align-items: center; }
  .img-row .img-box { max-width: 100%; }
  .contact-grid  { grid-template-columns: 1fr; }
}
