/* ============================================================
   BLOG — peeawoodmai child theme
   ============================================================ */

/* --- Design tokens --- */
.pa-blog-wrap,
.pa-single-wrap {
  --ebony:        #1E1610;
  --ebony-deep:   #140E09;
  --brass:        #C8A86E;
  --parchment:    #F2EBE0;
  --card:         #FBF7F0;
  --sand:         #E9E0D1;
  --line-color:   #E0D5C3;
  --chip-border:  #CDBFA8;
  --wood:         #8B5A2B;
  --walnut:       #5C3A21;
  --text:         #1E1610;
  --text-soft:    #4A3A2C;
  --meta:         #6B5A48;
  --on-dark-soft: #D9CFBF;
  --on-dark-muted:#A89A86;
  --radius:       6px;
  --radius-btn:   4px;
  --double-line:  3px double var(--brass);
}

/* --- Shared layout wrappers --- */
.pa-blog-wrap,
.pa-single-wrap {
  background: var(--parchment);
  color: var(--text);
  font-family: 'IBM Plex Sans Thai', sans-serif;
}

/* ---- Hero header ---- */
.pa-blog-hero {
  background: var(--ebony);
  padding: 48px 0 40px;
}
.pa-blog-hero__inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-left, 0px));
}
.pa-blog-hero__title {
  font-family: 'Bai Jamjuree', sans-serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  color: var(--parchment);
  margin: 12px 0 8px;
  text-wrap: balance;
}
.pa-blog-hero__sub {
  color: var(--on-dark-soft);
  font-size: 16px;
  margin: 0 0 20px;
}
.pa-blog-hero__search { max-width: 480px; }
.pa-blog-hero__search .search-form { display: flex; gap: 8px; }
.pa-blog-hero__search input[type="search"] {
  flex: 1;
  height: 48px;
  background: #2A2018;
  border: 1px solid #3A2E22;
  border-radius: var(--radius-btn);
  color: var(--parchment);
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  min-width: 0;
}
.pa-blog-hero__search input[type="search"]::placeholder { color: var(--on-dark-muted); }
.pa-blog-hero__search input[type="submit"] {
  height: 48px;
  min-width: 80px;
  background: var(--brass);
  color: var(--ebony);
  border: none;
  border-radius: var(--radius-btn);
  font-weight: 600;
  cursor: pointer;
}

/* ---- Breadcrumb ---- */
.pa-bc { margin-bottom: 10px; }
.pa-bc__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}
.pa-bc__link { color: var(--brass); text-decoration: none; }
.pa-bc__link:hover { text-decoration: underline; }
.pa-bc__sep { color: var(--on-dark-muted); margin: 0 2px; }
.pa-bc__current { color: var(--on-dark-muted); }

/* ---- Chip bar ---- */
.pa-chip-bar {
  background: var(--card);
  border-bottom: 1px solid var(--line-color);
  padding: 12px 0;
}
.pa-chip-bar__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pa-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  background: var(--card);
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 14px;
  text-decoration: none;
  transition: background 0.15s;
}
.pa-chip:hover { background: var(--sand); }
.pa-chip--active {
  background: var(--ebony);
  color: var(--parchment);
  border-color: var(--ebony);
}
.pa-chip--tag { font-size: 13px; min-height: 32px; padding: 0 10px; }

/* ---- Main 2-col layout ---- */
.pa-blog-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px max(16px, env(safe-area-inset-left, 0px));
}
.pa-blog-main {
  flex: 999 1 640px;
  min-width: 0;
}
.pa-blog-sidebar {
  flex: 1 1 280px;
  min-width: 0;
}

/* ---- Featured post ---- */
.pa-featured-post {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 36px;
  border: 1px solid var(--line-color);
}
.pa-featured-post__img-wrap { flex: 1 1 320px; min-width: 0; }
.pa-featured-post__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pa-featured-post__body {
  flex: 1 1 240px;
  min-width: 0;
  padding: 24px 24px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pa-featured-post__label { font-size: 13px; color: var(--wood); }
.pa-featured-post__label a { color: var(--wood); text-decoration: none; }
.pa-featured-post__title {
  font-family: 'Bai Jamjuree', sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}
.pa-featured-post__title a { color: var(--text); text-decoration: none; }
.pa-featured-post__title a:hover { color: var(--wood); }
.pa-featured-post__excerpt { color: var(--text-soft); font-size: 15px; margin: 0; }
.pa-featured-post__meta { font-size: 13px; color: var(--meta); margin: auto 0 0; }

/* ---- Card grid ---- */
.pa-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 28px;
}
.pa-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-color);
  transition: box-shadow 0.15s;
}
.pa-card:hover { box-shadow: 0 4px 16px rgba(30,22,16,0.10); }
.pa-card__img-wrap { display: block; aspect-ratio: 16/10; overflow: hidden; }
.pa-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.pa-card:hover .pa-card__img { transform: scale(1.03); }
.pa-card__img--placeholder {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(135deg, #E6DCCB 0 12px, #EDE4D5 12px 24px);
}
.pa-card__body { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.pa-card__cat {
  font-size: 13px;
  color: var(--wood);
  text-decoration: none;
  font-weight: 600;
}
.pa-card__title {
  font-family: 'Bai Jamjuree', sans-serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}
.pa-card__title a { color: var(--text); text-decoration: none; }
.pa-card__title a:hover { color: var(--wood); }
.pa-card__meta { font-size: 13px; color: var(--meta); margin: 4px 0 0; }

/* ---- Pagination ---- */
.pa-pagination { margin-top: 40px; }
.pa-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-btn);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 15px;
  margin: 2px;
}
.pa-pagination .page-numbers.current {
  background: var(--ebony);
  color: var(--parchment);
  border-color: var(--ebony);
}
.pa-pagination .page-numbers:hover:not(.current) { background: var(--sand); }
.pa-no-posts { color: var(--text-soft); font-size: 16px; }

/* ---- Sidebar boxes ---- */
.pa-sidebar-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--line-color);
}
.pa-sidebar-box--author {
  background: var(--walnut);
  border-color: var(--walnut);
  color: var(--parchment);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.pa-sidebar__avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(200,168,110,0.5);
}
.pa-sidebar__name { font-family: 'Bai Jamjuree', sans-serif; font-size: 18px; font-weight: 700; }
.pa-sidebar__bio { font-size: 14px; color: var(--on-dark-soft); margin: 0; line-height: 1.6; }
.pa-sidebar__link { color: var(--brass); text-decoration: none; font-size: 14px; font-weight: 600; }
.pa-sidebar__link:hover { text-decoration: underline; }

.pa-sidebar__heading {
  font-family: 'Bai Jamjuree', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--wood);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: var(--double-line);
}
.pa-popular-list { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 8px; }
.pa-popular-list a { color: var(--text); text-decoration: none; font-size: 14px; }
.pa-popular-list a:hover { color: var(--wood); }
.pa-sidebar__empty { font-size: 14px; color: var(--meta); }

.pa-sidebar-box--line { text-align: center; }
.pa-sidebar__line-desc { font-size: 14px; color: var(--text-soft); margin: 0 0 14px; }
.pa-sidebar__line-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  background: var(--ebony);
  color: var(--parchment);
  border-radius: var(--radius-btn);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.pa-sidebar__line-btn:hover { background: var(--walnut); }

/* ============================================================
   SINGLE POST
   ============================================================ */

/* ---- Single header ---- */
.pa-single-header {
  max-width: 820px;
  margin: 40px auto 0;
  padding: 0 max(16px, env(safe-area-inset-left, 0px));
}
.pa-single__cat {
  display: inline-block;
  font-size: 13px;
  color: var(--wood);
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 8px;
}
.pa-single__title {
  font-family: 'Bai Jamjuree', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 16px;
  text-wrap: balance;
}
.pa-single__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 14px;
  color: var(--meta);
}
.pa-single__avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.pa-single__author { color: var(--text-soft); font-weight: 600; }

/* ---- Cover image ---- */
.pa-single__cover-wrap {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 max(16px, env(safe-area-inset-left, 0px));
}
.pa-single__cover {
  width: 100%;
  aspect-ratio: 16/8;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

/* ---- Single 2-col layout ---- */
.pa-single-layout {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-left, 0px)) 40px;
}

/* TOC */
.pa-toc {
  flex: 1 1 240px;
  min-width: 0;
  position: sticky;
  top: 24px;
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--line-color);
  border-radius: var(--radius);
  padding: 20px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.pa-toc__heading {
  font-family: 'Bai Jamjuree', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--wood);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: var(--double-line);
}
.pa-toc__list { margin: 0; padding: 0 0 0 16px; display: flex; flex-direction: column; gap: 6px; }
.pa-toc__list a { color: var(--text-soft); font-size: 14px; text-decoration: none; }
.pa-toc__list a:hover { color: var(--wood); }

/* ---- Article content ---- */
.pa-single__content {
  flex: 999 1 560px;
  min-width: 0;
}
.pa-content { font-size: 18px; line-height: 1.75; color: var(--text); }
.pa-content h2 {
  font-family: 'Bai Jamjuree', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin: 40px 0 16px;
  scroll-margin-top: 24px;
}
.pa-content h3 {
  font-family: 'Bai Jamjuree', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin: 28px 0 12px;
}
.pa-content p { margin: 0 0 20px; }
.pa-content img,
.pa-content iframe,
.pa-content video {
  max-width: 100%;
  border-radius: var(--radius);
  display: block;
  margin: 24px 0;
}
.pa-content .wp-block-embed { aspect-ratio: 16/9; overflow: hidden; border-radius: var(--radius); }
.pa-content .wp-block-embed iframe { width: 100%; height: 100%; }
.pa-content blockquote {
  background: var(--card);
  border-top: var(--double-line);
  border-bottom: var(--double-line);
  padding: 24px 28px;
  margin: 32px 0;
  font-family: 'Bai Jamjuree', sans-serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}
.pa-content ul, .pa-content ol { padding-left: 24px; margin-bottom: 20px; }
.pa-content li { margin-bottom: 6px; }
.pa-content a { color: var(--wood); }
.pa-content a:hover { text-decoration: none; }
.pa-content table { width: 100%; border-collapse: collapse; overflow-x: auto; display: block; }
.pa-content td, .pa-content th {
  border: 1px solid var(--line-color);
  padding: 10px 14px;
  font-size: 15px;
}
.pa-content th { background: var(--sand); font-weight: 700; }

/* ---- Tools box ---- */
.pa-tools-box {
  background: var(--card);
  border: 1px solid var(--line-color);
  border-radius: var(--radius);
  padding: 24px;
  margin: 32px 0;
}
.pa-tools-box__heading {
  font-family: 'Bai Jamjuree', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: var(--double-line);
}
.pa-tools-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pa-tools-list__item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pa-tools-list__item img { border-radius: 4px; flex-shrink: 0; }
.pa-tools-list__item span { flex: 1; font-weight: 600; }
.pa-tools-list__item a {
  font-size: 14px;
  color: var(--wood);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.pa-tools-box__disclaimer { font-size: 12px; color: var(--meta); margin: 14px 0 0; }

/* ---- Sign-off ---- */
.pa-single__sign-off {
  font-family: 'Bai Jamjuree', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--wood);
  margin: 32px 0 24px;
  border-top: 1px solid var(--line-color);
  padding-top: 24px;
}

/* ---- Tags + share ---- */
.pa-single__footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 24px;
}
.pa-single__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.pa-share { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.pa-share__btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  background: var(--card);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-btn);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.pa-share__btn:hover { background: var(--sand); }
.pa-share__btn--copy[data-copied="true"] { border-color: var(--wood); color: var(--wood); }

/* ---- Author box ---- */
.pa-author-box {
  display: flex;
  gap: 20px;
  background: var(--walnut);
  color: var(--parchment);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 1100px;
  margin: 40px auto;
  box-sizing: border-box;
  padding-left: max(28px, env(safe-area-inset-left, 0px));
  padding-right: max(28px, env(safe-area-inset-right, 0px));
}
.pa-author-box__avatar { border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.pa-author-box__body { display: flex; flex-direction: column; gap: 8px; }
.pa-author-box__name { font-family: 'Bai Jamjuree', sans-serif; font-size: 20px; }
.pa-author-box__bio { font-size: 15px; color: var(--on-dark-soft); margin: 0; line-height: 1.6; }
.pa-author-box__link { color: var(--brass); text-decoration: none; font-size: 14px; font-weight: 600; margin-top: auto; }
.pa-author-box__link:hover { text-decoration: underline; }

/* ---- Comments ---- */
.pa-comments-wrap {
  max-width: 820px;
  margin: 0 auto 40px;
  padding: 0 max(16px, env(safe-area-inset-left, 0px));
}
.pa-comments-wrap input[type="text"],
.pa-comments-wrap input[type="email"],
.pa-comments-wrap input[type="url"],
.pa-comments-wrap textarea {
  background: var(--card);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-btn);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 15px;
  min-height: 44px;
  width: 100%;
  box-sizing: border-box;
  color: var(--text);
}
.pa-comments-wrap input[type="submit"] {
  min-height: 44px;
  padding: 0 24px;
  background: var(--ebony);
  color: var(--parchment);
  border: none;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

/* ---- Related posts ---- */
.pa-related {
  background: var(--sand);
  padding: 40px 0;
  margin-top: 40px;
}
.pa-related__heading {
  font-family: 'Bai Jamjuree', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--ebony);
  max-width: 1160px;
  margin: 0 auto 24px;
  padding: 0 max(16px, env(safe-area-inset-left, 0px));
}
.pa-related .pa-card-grid {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-left, 0px));
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .pa-blog-layout,
  .pa-single-layout {
    flex-direction: column;
    padding-top: 24px;
    padding-bottom: 24px;
    gap: 24px;
  }
  .pa-toc { position: static; max-height: none; }
  .pa-featured-post__body { padding: 16px; }
  .pa-single-header { margin-top: 24px; }
  .pa-author-box { flex-direction: column; }
  .pa-single__footer-row { flex-direction: column; align-items: flex-start; }
  .pa-share { margin-left: 0; }
}
