/*
Theme Name: Tên Hay Cho Bé (Flatsome Child)
Template: flatsome
Description: Giao diện con của Flatsome cho tenhaychobe.vn – giấy dó, mực tàu, con dấu son, hiệu ứng 3D nhẹ.
Version: 1.0.0
Text Domain: tenhaychobe
*/

:root {
  --giay: #F4ECDF; --giay-3: #FBF7F0; --muc: #1E1B18; --muc-2: #4A433C; --muc-3: #847A6F;
  --son: #B23A2B; --son-2: #8E2B1F; --ngoc: #2F5E55; --dong: #A8874E; --vien: #D8CBB4;
}

/* Nền giấy dó: màu kem + thớ giấy rất nhẹ (SVG nhiễu, không cần ảnh) */
body {
  background-color: var(--giay) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .28 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--muc);
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
}
#wrapper, #main, .page-wrapper { background: transparent !important; }

h1, h2, h3, h4, h5, h6, .heading-font, .section-title, .entry-title, .widget-title {
  font-family: 'Cormorant Garamond', Georgia, serif !important;
  color: var(--muc); font-weight: 600; letter-spacing: .005em;
}
.entry-content h2 { font-size: clamp(1.7rem, 3.6vw, 2.3rem); margin-top: 1.6em; }
.entry-content h3 { font-size: clamp(1.35rem, 2.8vw, 1.65rem); }
.entry-content p, .entry-content li { font-size: 1.04rem; line-height: 1.75; }
a { color: var(--son); }
a:hover { color: var(--son-2); }

/* Header: dải giấy sáng, gạch dưới bằng hai nét mảnh như viền sách cũ */
.header-main, .header-wrapper.stuck .header-main { background: rgba(251,247,240,.94) !important; backdrop-filter: saturate(1.2) blur(6px); }
.header-main { border-bottom: 1px solid var(--vien); box-shadow: 0 3px 0 -2px var(--vien); }
.header-nav-main > li > a { font-family: 'Be Vietnam Pro', sans-serif; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muc-2) !important; }
.header-nav-main > li.active > a, .header-nav-main > li > a:hover { color: var(--son) !important; }
.logo a { font-family: 'Cormorant Garamond', serif; font-weight: 700; color: var(--muc); }
.thcb-logo { display: inline-flex; align-items: center; gap: 10px; font-size: 1.6rem; }
.thcb-logo i { font-style: normal; width: 36px; height: 36px; display: inline-grid; place-items: center; background: var(--son); color: #FBEDE0; border-radius: 5px; transform: rotate(-5deg); font-family: 'Noto Serif TC', serif; font-size: 1.25rem; }

/* Nút Flatsome theo tông son */
.button.primary, .button.alt, input[type=submit].button, .button.checkout {
  background-color: var(--son) !important; border-color: var(--son) !important; color: #FFF8F0 !important;
  border-radius: 4px; text-transform: none; letter-spacing: 0; font-weight: 600;
  box-shadow: 0 2px 0 var(--son-2);
}
.button.is-outline.primary { background: transparent !important; color: var(--son) !important; }

/* Thẻ blog: giấy nổi, nghiêng 3D khi rê chuột (JS ở theme.js) */
.box-blog-post, .col-inner.box-shadow-1, .post-item .col-inner {
  background: var(--giay-3); border: 1px solid var(--vien); border-radius: 6px;
  transition: transform .25s ease-out, box-shadow .25s;
}
.box-blog-post:hover, .post-item .col-inner:hover { box-shadow: 0 24px 40px -28px rgba(30,27,24,.55); }
.box-blog-post .box-text { padding: 18px 18px 22px; }
.badge-inner { background: var(--son) !important; }
.blog-single .entry-content { max-width: 720px; margin: 0 auto; }
.blog-single .entry-header-text { text-align: center; }
.entry-content blockquote { border-left: 3px solid var(--son); background: var(--giay-3); font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; font-style: italic; padding: .8em 1.1em; }
.entry-content table { background: #fff; }
.entry-content table th { background: var(--giay-3); }

/* Phân cách kiểu hoa văn: ba chấm son */
.thcb-sep { text-align: center; color: var(--son); letter-spacing: .8em; margin: 2em 0; }
.thcb-sep::before { content: '◆ ◆ ◆'; font-size: .6rem; }

/* Khối hiện dần khi cuộn */
.thcb-reveal { opacity: 0; transform: translateY(18px) rotateX(6deg); transform-origin: top; transition: opacity .7s ease, transform .7s ease; }
.thcb-reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .thcb-reveal { opacity: 1; transform: none; } }

/* Footer: nền mực, chữ giấy */
.footer-wrapper, .absolute-footer, .footer-1, .footer-2 { background: var(--muc) !important; color: #CFC5B6; }
.footer-wrapper a, .absolute-footer a { color: #F4ECDF; }
.footer-wrapper h3, .footer-wrapper .widget-title { color: #F4ECDF !important; }

/* ---------- Trang chủ & trang công cụ (nội dung nhập sẵn) ---------- */
.thcb-intro { font-family: 'Cormorant Garamond', serif; font-size: 1.35rem; font-style: italic; color: var(--muc-2); max-width: 46em; }
.thcb-strip { text-align: center; border-top: 1px solid var(--vien); border-bottom: 1px solid var(--vien); padding: 1.4em 0; margin: 0 0 3em; }
.thcb-strip p { font-family: 'Cormorant Garamond', serif; font-size: clamp(1.2rem, 2.6vw, 1.55rem); max-width: 40em; margin: 0 auto; }
.thcb-why, .thcb-how, .thcb-faq { margin: 3.5em 0; }
.thcb-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 849px) { .thcb-3 { grid-template-columns: 1fr; } }
.thcb-card { background: var(--giay-3); border: 1px solid var(--vien); border-radius: 6px; padding: 24px 22px; position: relative; }
.thcb-card h3 { font-size: 1.4rem; margin: .2em 0 .5em; }
.thcb-num { font-family: 'Cormorant Garamond', serif; font-size: 2.6rem; color: var(--son); line-height: 1; }
.thcb-steps { counter-reset: b; list-style: none; padding: 0; margin: 0 0 1.5em; max-width: 46em; }
.thcb-steps li { counter-increment: b; position: relative; padding: 0 0 1.1em 3.2em; }
.thcb-steps li::before { content: counter(b); position: absolute; left: 0; top: -.15em; width: 2.2em; height: 2.2em; display: grid; place-items: center; border: 1px solid var(--son); color: var(--son); border-radius: 50%; font-family: 'Cormorant Garamond', serif; font-weight: 700; }
.thcb-faq details { border-bottom: 1px solid var(--vien); padding: 1em 0; }
.thcb-faq summary { cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-right: 2em; }
.thcb-faq summary::-webkit-details-marker { display: none; }
.thcb-faq summary::after { content: '+'; position: absolute; right: 0; top: -.1em; font-size: 1.4rem; color: var(--son); }
.thcb-faq details[open] summary::after { content: '–'; }
.thcb-faq details p { margin: .7em 0 0; color: var(--muc-2); }
