/* ==========================================================================
   Theme Start Pack (HTML) - Main Stylesheet
   Color Scheme: Candy888 Light — White/Cream (#ffffff / #fff8f4) + Pink (#ff5fa2) + Brown (#7a4a2b)
   Text: Chocolate brown (#4a3428) on light backgrounds
   Layout: topbar, WordPress nav menu, hero, SEO content, footer
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff8f4;
    color: #4a3428;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { color: #ff5fa2; text-decoration: none; transition: color 0.2s; }
a:hover { color: #7a4a2b; }
img, amp-img { max-width: 100%; height: auto; }
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.3; margin-top: 0; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
[hidden] { display: none; }

/* --------------------------------------------------------------------------
   2. UTILITIES
   -------------------------------------------------------------------------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; width: 100%; }
.desktop-only { display: none; }
.mobile-only { display: block; }

@media (min-width: 769px) {
    .desktop-only { display: flex; }
    .mobile-only { display: none; }
}

/* --------------------------------------------------------------------------
   3. TOPBAR
   -------------------------------------------------------------------------- */
.topbar {
    background: #fff0e8;
    padding: 6px 0;
    font-size: 0.78rem;
    border-bottom: 1px solid #f0d9cc;
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar-link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #7a4a2b;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 3px;
    transition: all 0.2s;
}
.topbar-link:first-child {
    background: #ff5fa2;
    color: #fff;
    font-weight: 600;
}
.topbar-link:hover { color: #ff5fa2; }
.topbar-icon { display: inline-flex; align-items: center; width: 16px; height: 16px; }
.topbar-icon svg { width: 14px; height: 14px; fill: currentColor; }
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar-btn {
    padding: 5px 16px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-block;
}
.topbar-btn.btn-login {
    border: 1px solid #c9a68f;
    color: #7a4a2b;
    background: transparent;
}
.topbar-btn.btn-login:hover { border-color: #ff5fa2; color: #ff5fa2; background: rgba(255, 95, 162,0.08); }
.topbar-btn.btn-register {
    background: linear-gradient(135deg, #ff5fa2, #7a4a2b);
    color: #fff;
}
.topbar-btn.btn-register:hover { background: linear-gradient(135deg, #e0206f, #7a4a2b); }

/* --------------------------------------------------------------------------
   4. HEADER MAIN (Logo + 8 Nav Icons)
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
}
.header-main {
    background: #ffffff;
    padding: 10px 0;
    border-bottom: 1px solid #f0d9cc;
    box-shadow: 0 1px 8px rgba(122,74,43,0.06);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-logo amp-img { display: block; }
/* Main Navigation (WordPress Menu - location: primary) */
/* Desktop nav hidden by default (mobile-first); shown >=769px below */
.main-nav { display: none; align-items: center; }
.main-nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.main-nav-list li { position: relative; }
.main-nav-list a {
    display: block;
    padding: 8px 14px;
    border-radius: 6px;
    color: #5a4030;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}
.main-nav-list a:hover,
.main-nav-list .current-menu-item > a {
    background: rgba(255, 95, 162, 0.10);
    color: #ff5fa2;
}
.main-nav-list .sub-menu {
    list-style: none;
    margin: 0;
    padding: 6px;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid #f0d9cc;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(122,74,43,0.12);
    display: none;
    z-index: 50;
}
.main-nav-list li:hover > .sub-menu { display: block; }
.main-nav-list .sub-menu a { font-size: 0.85rem; }

/* Mobile Menu Toggle (shown by default; hidden >=769px below) */
.menu-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* Responsive header nav switch (authoritative, overrides utility classes) */
@media (min-width: 769px) {
    .main-nav { display: flex; }
    .menu-toggle { display: none; }
}
@media (max-width: 768px) {
    .main-nav { display: none; }
    .menu-toggle { display: flex; }
}
.hamburger-icon {
    display: block;
    width: 22px;
    height: 2px;
    background: #7a4a2b;
    position: relative;
}
.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background: #7a4a2b;
    left: 0;
}
.hamburger-icon::before { top: -7px; }
.hamburger-icon::after { top: 7px; }

/* --------------------------------------------------------------------------
   5. MOBILE SIDEBAR (HTML — JS off-canvas)
   -------------------------------------------------------------------------- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(74,52,40,0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    z-index: 1099;
}
body.sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 280px;
    max-width: 85vw;
    background: #ffffff;
    padding: 0;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    z-index: 1100;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.mobile-sidebar.is-open { transform: translateX(0); }
body.sidebar-open { overflow: hidden; }
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #f0d9cc;
}
.sidebar-close {
    font-size: 1.4rem;
    color: #7a4a2b;
    padding: 5px;
}
.sidebar-nav { padding: 10px 0; }
.sidebar-menu-list { list-style: none; margin: 0; padding: 0; }
.sidebar-menu-list a {
    display: block;
    padding: 12px 20px;
    color: #5a4030;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(122,74,43,0.06);
    transition: background 0.2s;
}
.sidebar-menu-list a:hover,
.sidebar-menu-list .current-menu-item > a { background: rgba(255, 95, 162, 0.10); color: #ff5fa2; }
.sidebar-menu-list .sub-menu { list-style: none; margin: 0; padding: 0 0 0 16px; }
.sidebar-actions {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid #f0d9cc;
}
.sidebar-btn {
    display: block;
    text-align: center;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
}
.sidebar-btn.btn-login { border: 1px solid #c9a68f; color: #7a4a2b; }
.sidebar-btn.btn-register { background: #ff5fa2; color: #fff; }

/* --------------------------------------------------------------------------
   6. HERO BANNER (responsive via CSS media query)
   -------------------------------------------------------------------------- */
.hero-banner { width: 100%; overflow: hidden; }
.hero-banner a { display: block; }
.hero-banner img { display: block; width: 100%; height: auto; }
/* Default (mobile-first): show mobile image, hide desktop image */
.hero-banner .banner-desktop { display: none; }
.hero-banner .banner-mobile { display: block; }

@media (max-width: 768px) {
    /* Show the full mobile banner so all promo text and the CTA are visible */
    .hero-banner { max-height: none; overflow: visible; }
    .hero-banner a { display: block; max-height: none; overflow: visible; }
}

@media (min-width: 769px) {
    /* Desktop: show desktop image, hide mobile image */
    .hero-banner .banner-desktop { display: block; }
    .hero-banner .banner-mobile { display: none; }
}

/* --------------------------------------------------------------------------
   10. SEO CONTENT SECTION
   -------------------------------------------------------------------------- */
.seo-content-section {
    background: #ffffff;
    padding: 28px 0;
    border-top: 1px solid #f0d9cc;
}
/* .seo-content-inner { max-width: 900px; } */
.breadcrumbs-title {
    font-size: 0.78rem;
    color: #a8836c;
    margin-bottom: 10px;
}
.breadcrumbs-title a,
.breadcrumbs-link {
    color: #ff5fa2;
    text-decoration: underline;
}
.seo-content-inner h1 {
    font-size: 1.2rem;
    color: #ff5fa2;
    margin-bottom: 14px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}
.seo-article {
    font-size: 0.82rem;
    color: #6b5343;
    line-height: 1.7;
}
.seo-article p { margin-bottom: 12px; }
.seo-article a { color: #ff5fa2; text-decoration: underline; }

/* --------------------------------------------------------------------------
   11. FOOTER: BOTTOM BAR
   -------------------------------------------------------------------------- */
.site-footer-body {
    background: #fff0e8;
    padding: 18px 0;
    border-top: 1px solid #f0d9cc;
}
.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}
.footer-copyright p {
    font-size: 0.8rem;
    color: #8a6a54;
}
.footer-copyright strong { color: #7a4a2b; }
.footer-certs {
    display: flex;
    align-items: center;
    gap: 12px;
}
.footer-social {
    display: flex;
    align-items: center;
    gap: 10px;
}
.footer-social-title {
    font-size: 0.78rem;
    color: #8a6a54;
}
.social-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}
.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.social-icons a:hover { opacity: 1; }

@media (max-width: 768px) {
    .footer-bottom-inner { flex-direction: column; text-align: center; }
}

/* --------------------------------------------------------------------------
   12. FIXED MOBILE FOOTER
   -------------------------------------------------------------------------- */
.fixed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #f0d9cc;
    box-shadow: 0 -1px 8px rgba(122,74,43,0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    z-index: 9999;
}
.fixed-footer a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: #a8836c;
    font-size: 0.62rem;
    text-decoration: none;
    transition: color 0.2s;
}
.fixed-footer a[data-active="true"] { color: #ff5fa2; }
.fixed-footer a:hover { color: #ff5fa2; }
.fixed-footer-icon { width: 20px; height: 20px; }
.fixed-footer-icon svg { width: 100%; height: 100%; fill: currentColor; }

@media (max-width: 768px) {
    body { padding-bottom: 58px; }
}

/* --------------------------------------------------------------------------
   13. SINGLE PAGE / POST
   -------------------------------------------------------------------------- */
.page-content,
.post-content { padding: 30px 0; }
.page-content h1,
.post-content h1 { font-size: 1.4rem; color: #ff5fa2; margin-bottom: 15px; }
.page-content .entry-content,
.post-content .entry-content { font-size: 0.88rem; color: #5a4030; line-height: 1.8; }
.page-content .entry-content p,
.post-content .entry-content p { margin-bottom: 15px; }

/* --------------------------------------------------------------------------
   14. 404 PAGE
   -------------------------------------------------------------------------- */
.error-404 { text-align: center; padding: 60px 15px; }
.error-404 h1 { font-size: 4rem; color: #ff5fa2; margin-bottom: 10px; }
.error-404 p { font-size: 1.1rem; color: #8a6a54; margin-bottom: 20px; }
.error-404 a {
    display: inline-block;
    padding: 12px 30px;
    background: #ff5fa2;
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
}

/* ============================================================== *
 * VISIBLE SCHEMA BLOCKS (v1.2.0) - AMP safe (no !important)
 * ============================================================== */
.tsp-schema-blocks{background:#fff0e8;padding:32px 0;margin-top:8px}
.tsp-schema-inner{max-width:1100px;margin:0 auto;padding:0 16px;display:grid;grid-template-columns:1fr;gap:20px}
.tsp-block{background:#fff;border:1px solid #f0d9cc;border-radius:14px;padding:22px;box-shadow:0 2px 10px rgba(122,74,43,.06)}
.tsp-block-head{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.tsp-block-icon{flex:0 0 auto;width:40px;height:40px;border-radius:10px;background:linear-gradient(135deg,#ff5fa2,#7a4a2b);color:#fff;display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:700}
.tsp-block-htext{min-width:0}
.tsp-block-title{margin:0;font-size:18px;line-height:1.3;color:#3a2419;font-weight:700}
.tsp-block-sub{margin:2px 0 0;font-size:13px;color:#a8836c}
.tsp-meta-list{list-style:none;margin:0;padding:0}
.tsp-meta-list li{display:flex;gap:8px;padding:8px 0;border-bottom:1px solid #f6e6dc;font-size:14px;color:#5a4030}
.tsp-meta-list li:last-child{border-bottom:0}
.tsp-meta-k{flex:0 0 96px;color:#a8836c;font-weight:600}
.tsp-btn{display:inline-block;margin-top:12px;background:#ff5fa2;color:#fff;text-decoration:none;padding:9px 18px;border-radius:8px;font-size:14px;font-weight:600}
.tsp-faq-acc{border:0}
.tsp-faq-item{border:1px solid #f0d9cc;border-radius:10px;margin-bottom:10px;overflow:hidden}
.tsp-faq-q{margin:0;padding:14px 16px;background:#fff8f4;font-size:15px;color:#3a2419;font-weight:600;cursor:pointer}
.tsp-faq-a{padding:6px 16px 14px;font-size:14px;color:#6b5343;}
.tsp-faq-a p{margin:8px 0 0}
amp-accordion>section[expanded]>.tsp-faq-q{background:#ffe3ee;color:#e0206f}
.tsp-howto-list{list-style:none;margin:0;padding:0}
.tsp-howto-step{display:flex;gap:14px;padding:12px 0;border-bottom:1px dashed #f0d9cc}
.tsp-howto-step:last-child{border-bottom:0}
.tsp-howto-num{flex:0 0 auto;width:30px;height:30px;border-radius:50%;background:#ff5fa2;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:14px}
.tsp-howto-name{margin:2px 0 4px;font-size:15px;color:#3a2419;font-weight:600}
.tsp-howto-body p{margin:0;font-size:14px;color:#6b5343;line-height:1.6}
.tsp-review-box{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.tsp-review-score{font-size:38px;font-weight:800;color:#3a2419;line-height:1}
.tsp-review-best{font-size:16px;color:#a8836c;font-weight:600}
.tsp-stars{position:relative;display:inline-block;font-size:26px;line-height:1;letter-spacing:2px}
.tsp-stars-bg{color:#f0d9cc}
.tsp-stars-fg{color:#f5a623;position:absolute;top:0;left:0;overflow:hidden;white-space:nowrap}
.tsp-review-count{font-size:13px;color:#a8836c}
.tsp-event-desc,.tsp-article-desc{font-size:14px;color:#6b5343;line-height:1.6;margin:0 0 12px}
.tsp-article-img{border-radius:10px;margin-bottom:12px;overflow:hidden}
.tsp-article-meta{margin-top:10px;font-size:13px;color:#a8836c}
.tsp-org-card{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.tsp-org-logo{border-radius:8px}
.tsp-social{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.tsp-social-link{background:#ffe3ee;color:#e0206f;text-decoration:none;font-size:13px;font-weight:600;padding:6px 12px;border-radius:20px}
.tsp-crumb-list{list-style:none;display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0;font-size:13px}
.tsp-crumb-item:not(:last-child)::after{content:"\203A";margin-left:6px;color:#c9a68f}
.tsp-crumb-item a{color:#ff5fa2;text-decoration:none}
.tsp-crumb-item a:hover{text-decoration:underline}
/* Breadcrumb standalone (เหนือ H1 ทุกหน้า) */
.tsp-breadcrumb-wrap{margin:0 0 12px}
.tsp-breadcrumb-wrap .tsp-block-crumb{padding:0;margin:0;background:none;border:none;box-shadow:none}
@media (min-width:760px){.tsp-schema-inner{grid-template-columns:1fr 1fr}.tsp-block-faq,.tsp-block-howto{grid-column:1 / -1}}
/* FAQ accordion (HTML native details/summary) */
.tsp-faq-item>summary.tsp-faq-q{list-style:none;position:relative;padding-right:40px}
.tsp-faq-item>summary.tsp-faq-q::-webkit-details-marker{display:none}
.tsp-faq-item>summary.tsp-faq-q::after{content:"+";position:absolute;right:16px;top:50%;transform:translateY(-50%);font-size:20px;color:#ff5fa2;font-weight:700}
.tsp-faq-item[open]>summary.tsp-faq-q{background:#ffe3ee;color:#e0206f}
.tsp-faq-item[open]>summary.tsp-faq-q::after{content:"\2212"}
