/*
Theme Name: Swinging Thai
Description: Pink and white community theme with member discovery and three Top 5 lists.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: swinging-thai
*/

:root {
	--bg: #fff6fa;
	--surface: #ffffff;
	--surface-2: #fff0f7;
	--border: #f5dce8;
	--text: #241c26;
	--muted: #776775;
	--accent: #f00675;
	--accent-2: #d90968;
	--danger: #f87171;
	--ok: #34d399;
	--radius: 12px;
	--font: "Noto Sans Thai", Tahoma, system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.7 var(--font); }
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: #c4a8ff; text-decoration: none; }
a:hover, a:focus-visible { color: #fff; text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: min(1180px, 100% - 2rem); margin-inline: auto; }
.site-main { padding: 1.5rem 0 3rem; min-height: 60vh; }

/* ---------- header ---------- */
.site-header { background: rgba(15, 11, 22, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.site-header__bar { display: flex; align-items: center; gap: 1rem; min-height: 60px; }
.site-title { font-size: 1.3rem; font-weight: 800; letter-spacing: .01em; color: #fff; }
.site-title span { color: var(--accent); }
.site-title:hover { text-decoration: none; }
.nav-toggle { display: none; margin-left: auto; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .4rem .8rem; font: inherit; cursor: pointer; }
.site-nav { display: flex; align-items: center; gap: 1rem; flex: 1; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.site-nav li { position: relative; }
.site-nav a { display: block; padding: .5rem .8rem; border-radius: 8px; color: var(--text); }
.site-nav a:hover, .site-nav .current-menu-item > a { background: var(--surface-2); text-decoration: none; }
.site-nav .sub-menu { display: none; position: absolute; left: 0; top: 100%; min-width: 15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .4rem; flex-direction: column; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { display: flex; }
.site-user { margin-left: auto; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.site-search { display: flex; }
.site-search input { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 8px 0 0 8px; padding: .4rem .7rem; width: 9rem; font: inherit; }
.site-search button { background: var(--surface-2); border: 1px solid var(--border); border-left: 0; color: var(--text); border-radius: 0 8px 8px 0; padding: 0 .7rem; cursor: pointer; }

@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--border); padding: 1rem; flex-direction: column; align-items: stretch; }
	.site-nav.is-open { display: flex; }
	.site-nav ul { flex-direction: column; }
	.site-nav .sub-menu { display: flex; position: static; box-shadow: none; border: 0; padding-left: 1rem; background: none; }
	.site-user { margin-left: 0; }
}

/* ---------- buttons / chips ---------- */
.st-btn, .button { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: .6rem 1.2rem; font: inherit; font-weight: 700; cursor: pointer; text-align: center; }
.st-btn:hover, .button:hover { background: #f0338a; color: #fff; text-decoration: none; }
.st-btn--ghost { background: transparent; border: 1px solid var(--accent-2); color: #d9c8ff; }
.st-btn--ghost:hover { background: var(--accent-2); }
.st-btn--small { padding: .35rem .9rem; font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.2rem; padding: 0; list-style: none; }
.chip { display: inline-block; padding: .3rem .9rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: .9rem; }
.chip:hover, .chip.is-active { background: var(--accent-2); border-color: var(--accent-2); color: #fff; text-decoration: none; }

/* ---------- hero / sections ---------- */
.hero { background: radial-gradient(1200px 400px at 20% -20%, rgba(225, 29, 116, .28), transparent), radial-gradient(900px 400px at 100% 0, rgba(139, 92, 246, .25), transparent), var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: clamp(1.5rem, 5vw, 3.5rem); margin-bottom: 2rem; }
.hero p { color: var(--muted); max-width: 40rem; font-size: 1.1rem; }
.hero__cta { display: flex; gap: .75rem; flex-wrap: wrap; }
.section { margin-bottom: 2.5rem; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.section__head h2 { margin: 0; }
.page-head { margin-bottom: 1.2rem; }
.page-head p { color: var(--muted); }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.1rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-2px); border-color: var(--accent-2); }
.card__thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #2a1d44, #1a1230); overflow: hidden; }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__thumb--empty { display: flex; align-items: center; justify-content: center; font-size: 2.2rem; opacity: .5; }
.card__badge { position: absolute; bottom: .4rem; right: .4rem; background: rgba(0, 0, 0, .75); color: #fff; font-size: .78rem; padding: .05rem .5rem; border-radius: 6px; }
.card__badge--type { right: auto; left: .4rem; top: .4rem; bottom: auto; background: var(--accent); }
.card__body { padding: .75rem .9rem 1rem; }
.card__title { margin: 0 0 .3rem; font-size: 1rem; }
.card__title a { color: var(--text); }
.card__meta { color: var(--muted); font-size: .82rem; display: flex; flex-wrap: wrap; gap: .2rem .8rem; }

/* ---------- single ---------- */
.entry { max-width: 860px; margin-inline: auto; }
.entry__meta { color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-bottom: 1rem; }
.entry__content { font-size: 1.05rem; }
.entry__actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; margin: 1.5rem 0; padding-top: 1rem; border-top: 1px solid var(--border); }
.st-player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 1.2rem; }
.st-player iframe, .st-player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.st-linkcard { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.2rem; }
.st-linkcard img { width: 100%; max-height: 420px; object-fit: cover; }
.st-linkcard__body { padding: 1.2rem; }
.st-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; margin-bottom: 1.2rem; }
.st-gallery__img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.st-locked { background: var(--surface); border: 1px dashed var(--accent-2); border-radius: var(--radius); padding: 2rem 1rem; text-align: center; margin-bottom: 1.2rem; }
.related { margin-top: 2.5rem; }

/* ---------- forms ---------- */
.st-form, .comment-form, .st-report form { max-width: 640px; }
.st-form label, .comment-form label { display: block; font-weight: 700; margin-bottom: .25rem; }
.st-form input[type=text], .st-form input[type=url], .st-form textarea, .st-form select,
.comment-form input[type=text], .comment-form textarea, .st-report select, .st-report textarea,
.login input[type=text], .login input[type=password] {
	width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem; font: inherit;
}
.st-form input:focus, .st-form textarea:focus, .st-form select:focus, .comment-form textarea:focus { outline: 2px solid var(--accent-2); border-color: transparent; }
.st-check label { font-weight: 400; }
.st-hint { display: block; color: var(--muted); font-size: .85rem; margin-top: .25rem; font-weight: 400; }
.st-notice { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; }
.st-notice--err { background: rgba(248, 113, 113, .12); border-color: var(--danger); color: #fecaca; }
.st-notice--ok { background: rgba(52, 211, 153, .12); border-color: var(--ok); color: #bbf7d0; }
.st-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.st-inline { display: inline; margin: 0; }
.st-link-danger { color: var(--danger); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.st-link-danger:hover { text-decoration: underline; }
.st-report summary { list-style: none; cursor: pointer; }
.st-report form { display: grid; gap: .5rem; margin-top: .6rem; min-width: min(20rem, 100%); }

/* ---------- comments ---------- */
.comments { max-width: 860px; margin: 2.5rem auto 0; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { margin-left: 1.5rem; padding-left: 1rem; border-left: 2px solid var(--border); }
.comment-body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .8rem; }
.comment-meta { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .85rem; margin-bottom: .4rem; }
.comment-meta img { border-radius: 50%; }
.comment-author .fn { font-weight: 700; color: var(--text); }
.reply a { font-size: .85rem; }

/* ---------- pagination ---------- */
.pagination { margin-top: 2rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.pagination .page-numbers { padding: .4rem .9rem; border-radius: 8px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.pagination .current { background: var(--accent-2); border-color: var(--accent-2); }

/* ---------- topic list (front page) ---------- */
.topic-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.topic-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.topic-list li:last-child { border-bottom: 0; }
.topic-list small { color: var(--muted); white-space: nowrap; }

/* ---------- bbPress (ให้อ่านง่ายบนพื้นมืด) ---------- */
#bbpress-forums { font-size: 1rem; }
#bbpress-forums ul.bbp-forums, #bbpress-forums ul.bbp-topics, #bbpress-forums ul.bbp-replies { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; padding: 0; }
#bbpress-forums li.bbp-header, #bbpress-forums li.bbp-footer { background: var(--surface-2); color: var(--muted); border-color: var(--border); padding: .6rem 1rem; }
#bbpress-forums li.bbp-body ul.forum, #bbpress-forums li.bbp-body ul.topic, #bbpress-forums div.bbp-reply-header { background: transparent; border-color: var(--border); padding: .7rem 1rem; }
#bbpress-forums div.bbp-forum-header, #bbpress-forums div.bbp-topic-header, #bbpress-forums div.bbp-reply-header { background: var(--surface-2); border-color: var(--border); }
#bbpress-forums div.bbp-reply-content, #bbpress-forums div.bbp-topic-content { padding: 1rem; margin: 0; }
#bbpress-forums div.even, #bbpress-forums ul.even { background: rgba(255, 255, 255, .02); }
#bbpress-forums div.odd, #bbpress-forums ul.odd { background: transparent; }
#bbpress-forums fieldset.bbp-form { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
#bbpress-forums input[type=text], #bbpress-forums textarea, #bbpress-forums select { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .7rem; font: inherit; max-width: 100%; }
#bbpress-forums .bbp-submit-wrapper button { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: .6rem 1.2rem; font: inherit; font-weight: 700; cursor: pointer; }
div.bbp-breadcrumb, div.bbp-template-notice { color: var(--muted); }
div.bbp-template-notice { background: var(--surface-2); border-color: var(--border); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; color: var(--muted); font-size: .9rem; background: var(--surface); }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; padding: 0; margin: 0 0 1rem; }
