/* =========================================================
   5asia.net - common stylesheet
   1-column card design / Core Web Vitals & speed optimized
   ========================================================= */

:root {
  --accent: #2563eb;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #333333;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --h2-bg: #f1f5f9;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header / Nav ---------- */

.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

.site-logo span {
  color: var(--accent);
}

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 199;
}

.drawer-overlay.open {
  display: block;
}

.drawer {
  position: fixed;
  top: 0;
  right: -280px;
  width: 260px;
  height: 100%;
  background: #ffffff;
  z-index: 200;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
  transition: right 0.25s ease;
  padding: 20px;
  overflow-y: auto;
}

.drawer.open {
  right: 0;
}

.drawer-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  margin-bottom: 12px;
  display: block;
  margin-left: auto;
}

.drawer nav a {
  display: block;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
}

.drawer nav a:hover {
  color: var(--accent);
}

/* ---------- Main layout ---------- */

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--text-light);
}

/* ---------- Cards (index list) ---------- */

.card {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 20px;
  display: block;
  color: var(--text);
}

.card:hover {
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0;
}

.card-body {
  padding: 16px;
}

.card-category {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  background: var(--h2-bg);
  padding: 2px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
  font-weight: 600;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.5;
  color: var(--text);
}

.card-excerpt {
  font-size: 14px;
  color: var(--text-light);
  margin: 0;
  line-height: 1.7;
}

/* ---------- Article page ---------- */

.article-card {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  padding: 24px 20px 32px;
}

.article-category {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  background: var(--h2-bg);
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  font-weight: 600;
}

.article-title {
  font-size: 26px;
  line-height: 1.5;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--text);
}

.article-meta {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.article-eyecatch {
  width: 100%;
  margin-bottom: 24px;
}

.article-body {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: break-word;
}

.article-body p {
  margin: 0 0 22px;
}

.article-body h2 {
  font-size: 21px;
  font-weight: 700;
  border-left: 5px solid var(--accent);
  background: var(--h2-bg);
  padding: 10px 14px;
  margin: 36px 0 20px;
  line-height: 1.5;
}

.article-body h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 30px 0 16px;
  padding-left: 12px;
  border-left: 4px solid #93c5fd;
}

.article-body h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 26px 0 14px;
  color: var(--accent);
}

.article-body img {
  margin: 20px auto;
}

.article-body a {
  word-break: break-all;
}

.article-body strong {
  color: #111827;
}

.article-body table {
  max-width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
}

.article-body iframe {
  max-width: 100%;
  margin: 16px 0;
}

/* Amazon product card (converted from [amazonjs] shortcode) */
.amazon-product-card {
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.amazon-product-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fefce8;
  color: var(--text);
}

.amazon-product-link:hover {
  background: #fef9c3;
  text-decoration: none;
}

.amazon-product-icon {
  font-size: 22px;
}

.amazon-product-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.amazon-product-cta {
  font-size: 13px;
  color: #b45309;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- Related articles ---------- */

.related-section {
  margin-top: 40px;
}

.related-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
}

.related-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.related-item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--h2-bg);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
}

.related-item:hover {
  background: #e2e8f0;
  text-decoration: none;
}

.related-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.related-item-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

/* ---------- Ad slots ---------- */

.ad-slot {
  margin: 24px 0;
  text-align: center;
  overflow: hidden;
}

.ad-slot-label {
  font-size: 10px;
  color: #9ca3af;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 28px 16px 40px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
}

.site-footer a {
  color: var(--text-light);
}

/* ---------- 404 page ---------- */

.error-page {
  text-align: center;
  padding: 80px 16px;
}

.error-page h1 {
  font-size: 64px;
  margin: 0;
  color: var(--accent);
}

.error-page p {
  font-size: 16px;
  color: var(--text-light);
  margin: 16px 0 28px;
}

.error-page .btn {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
  padding: 12px 28px;
  border-radius: 6px;
  font-weight: 600;
}

.error-page .btn:hover {
  background: #1d4ed8;
  text-decoration: none;
}

@media (max-width: 480px) {
  .article-title {
    font-size: 22px;
  }
  .site-logo {
    font-size: 19px;
  }
}
