/*
 * Cẩm Nang Baccarat — blog styles (single post, archives, search, comments, Posts Grid widget).
 * Built only from the design tokens of site.css (felt green, gold, Noto Serif headings, cards).
 */

/* ---------- Post cards (archives, related posts, Posts Grid widget) ---------- */
.post-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.article .post-cards { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.prose .post-cards { padding-left: 0; }
.post-card { position: relative; transition: box-shadow .2s, transform .2s, border-color .2s; }
.post-card:hover { border-color: var(--gold); box-shadow: 0 8px 22px rgba(15,61,46,.10); transform: translateY(-2px); }
.post-card-thumb { display: block; margin: -18px -18px 14px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: var(--felt); line-height: 0; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.post-card:hover .post-card-thumb img { transform: scale(1.04); }
.post-card h2, .post-card h3, .post-card h4 { margin: 0 0 6px; font-size: 1.12rem; line-height: 1.35; }
.post-card h2 a, .post-card h4 a { text-decoration: none; color: var(--felt); }
.post-card h2 a:hover, .post-card h4 a:hover { color: var(--red); }
.card.post-card .post-card-meta { margin-top: auto; padding-top: 12px; font-size: .84rem; color: var(--muted); }
.card.post-card p + .post-card-meta { padding-top: 12px; }
.card.post-card > p:not(.post-cat):not(.post-card-meta) { margin-bottom: 0; }

/* Category badge */
.post-cat { margin: 0 0 8px; line-height: 1.2; }
.post-cat a { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .02em; background: var(--gold-soft); color: var(--felt); padding: 3px 10px; border-radius: 999px; text-decoration: none; }
.post-cat a:hover { background: var(--gold); color: #1f2421; }
.card.post-card .post-cat { margin: 0 0 8px; }

/* ---------- Archive header & category chips ---------- */
.archive-header { background: linear-gradient(135deg, var(--felt), var(--felt-2)); color: #fff; border-radius: 14px; padding: 32px 36px; margin: 4px 0 24px; box-shadow: 0 8px 24px rgba(15,61,46,.18); position: relative; overflow: hidden; }
.archive-header::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 18px solid rgba(184,134,43,.22); pointer-events: none; }
.archive-header h1 { color: #fff; margin: 0; position: relative; }
.archive-header .archive-page { font-size: .6em; font-weight: 400; color: var(--gold-soft); }
.archive-header .lead { color: #e8efe9; margin-top: 10px; position: relative; max-width: var(--prose); }
.archive-header .lead p { margin: 0 0 .6em; }
.archive-header .lead p:last-child { margin-bottom: 0; }
.archive-header .search-form { margin-top: 16px; max-width: 560px; position: relative; }

.cat-chips ul { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chips a { display: block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--felt); text-decoration: none; font-size: .92rem; font-weight: 600; }
.cat-chips a:hover { border-color: var(--gold); color: var(--red); }
.cat-chips a[aria-current="page"] { background: var(--felt); border-color: var(--felt); color: #fff; }

/* ---------- Pagination ---------- */
.pagination { margin: 8px 0 48px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0; }
.pagination .page-numbers { min-width: 42px; text-align: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--felt); text-decoration: none; font-weight: 600; }
.pagination a.page-numbers:hover { border-color: var(--gold); color: var(--red); }
.pagination .page-numbers.current { background: var(--felt); border-color: var(--felt); color: #fff; }
.pagination .page-numbers.dots { border-color: transparent; background: transparent; }
.bcr-blog-archive .post-cards { margin-bottom: 32px; }

/* ---------- Single post ---------- */
.post-banner img { object-fit: cover; }
.post-article header .post-cat { margin-bottom: 12px; }
.post-tags { margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .9rem; }
.post-tags span { color: var(--muted); margin-right: 4px; }
.post-tags a { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; color: var(--felt); }
.post-tags a:hover { border-color: var(--gold); color: var(--red); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0 0; }
.post-nav a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--felt); font-family: var(--serif); font-weight: 700; line-height: 1.35; }
.post-nav a:hover { border-color: var(--gold); color: var(--red); }
.post-nav span { display: block; font-family: var(--font); font-weight: 400; font-size: .84rem; color: var(--muted); margin-bottom: 4px; }
.post-nav-next { text-align: right; grid-column: 2; }
.page-links { margin: 1.2em 0; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Content written in the block editor ---------- */
.prose img { border-radius: var(--radius); }
.prose figure { margin: 0 0 1.2em; }
.prose figcaption, .prose .wp-element-caption { font-size: .88rem; color: var(--muted); text-align: center; margin-top: 6px; }
.prose h4 { font-family: var(--serif); color: var(--felt); font-size: 1.05rem; line-height: 1.3; margin: 1.3em 0 .4em; }
.prose blockquote, .prose .wp-block-quote { margin: 0 0 1.2em; padding: 12px 18px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote cite { display: block; font-size: .88rem; color: var(--muted); font-style: normal; margin-top: 6px; }
.prose .wp-block-pullquote { border-top: 3px solid var(--gold); border-bottom: 3px solid var(--gold); padding: 1.2em 0; text-align: center; font-family: var(--serif); color: var(--felt); }
.prose hr, .prose .wp-block-separator { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose code { background: var(--gold-soft); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.prose pre { background: #0b2d22; color: #e8efe9; padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; font-size: .9rem; line-height: 1.55; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose .wp-block-table { overflow-x: auto; margin: 0 0 1.2em; }
.prose .wp-block-table table { margin: 0; }
.prose .wp-block-table td, .prose .wp-block-table th { border: 1px solid var(--line); }
.prose .wp-block-table thead { border-bottom: 0; }
.prose .wp-block-buttons { margin: 0 0 1.2em; }
.prose .wp-block-button__link { background: var(--gold); color: #1f2421; border-radius: 8px; padding: 10px 18px; font-weight: 600; text-decoration: none; font-size: 1rem; }
.prose .wp-block-button__link:hover { background: var(--gold-soft); color: var(--felt); }
.prose .is-style-outline .wp-block-button__link { background: transparent; border: 1px solid var(--felt); color: var(--felt); }
.prose iframe, .prose video { max-width: 100%; }
.prose .wp-block-embed { margin: 0 0 1.2em; }
.prose .wp-block-embed__wrapper iframe { width: 100%; }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: 8px; margin: 0 0 24px; }
.search-form input[type="search"] { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--surface); color: var(--text); }
.search-form .btn, .comment-form .btn { margin: 0; border: 0; cursor: pointer; font: inherit; font-weight: 600; }

/* ---------- Comments ---------- */
.comments-area { border-top: 1px solid var(--line); margin-top: 32px; }
.comment-list, .comment-list .children { list-style: none; padding: 0; margin: 0; }
.comment-list .children { padding-left: 24px; }
.comment-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.comment-meta { display: flex; align-items: center; gap: 10px; font-size: .9rem; margin-bottom: 6px; }
.comment-meta img { border-radius: 50%; }
.comment-meta time { color: var(--muted); margin-left: auto; }
.comment-content p:last-child { margin-bottom: 0; }
.comment-reply-link { font-size: .88rem; }
.comment-awaiting { color: var(--red); font-size: .9rem; }
.comment-respond { margin-top: 8px; }
.comment-form label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--surface); color: var(--text); }
.comment-form .comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form .comment-form-cookies-consent label { font-weight: 400; }
.comment-notes, .logged-in-as { font-size: .9rem; color: var(--muted); }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .archive-header { padding: 24px 20px; }
  .archive-header::after { width: 140px; height: 140px; right: -50px; top: -50px; border-width: 12px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-next { grid-column: auto; }
  .comment-list .children { padding-left: 12px; }
}

/* Posts Grid widget */
.posts-more { text-align: center; margin: 0 0 24px; }
.posts-more .btn { margin: 0; }
.elementor .elementor-widget-bcr-posts-grid .post-cat a { text-decoration: none; }

/* Card without featured image: branded placeholder */
.post-card-thumb.is-placeholder { display: grid; place-items: center; background: linear-gradient(135deg, var(--felt), var(--felt-2)); position: relative; }
.post-card-thumb.is-placeholder::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(184,134,43,.45); border-radius: 6px; }
.post-card-thumb.is-placeholder img { width: 46%; height: auto; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
.comment-form .required { color: var(--red); }

/* Posts written with Elementor: align their containers with the article text column. */
.prose > .elementor > .e-con:not(.bcr-flow) { --padding-left: 0px; --padding-right: 0px; }
