/*
Theme Name: BitNote
Theme URI: https://gamebitnote.com/
Author: GameBit Note
Description: Mobile gaming magazine theme for GameBit Note: dark tone, article cards, category sections and a comfortable reading layout.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bitnote
Domain Path: /languages
*/

:root {
	--bn-radius: 14px;
	--bn-line: var(--wp--preset--color--line);
	--bn-glow: 0 16px 34px -18px rgba(61, 227, 130, .35);
}

body { -webkit-font-smoothing: antialiased; }
::selection { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--on-accent); }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
img { height: auto; }

/* ---------- Header ---------- */
.bn-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(13, 16, 21, .88);
	-webkit-backdrop-filter: saturate(140%) blur(10px);
	backdrop-filter: saturate(140%) blur(10px);
	border-bottom: 1px solid var(--bn-line);
}
.admin-bar .bn-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .bn-header { top: 0; position: relative; } }

.bn-brand .wp-block-site-title { margin: 0; line-height: 1; }
.bn-brand .wp-block-site-title a {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700; letter-spacing: -.01em; color: var(--wp--preset--color--contrast);
}
.bn-brand .wp-block-site-title a::before {
	content: ""; display: inline-block; width: .7em; height: .7em; margin-right: .45em;
	background: var(--wp--preset--color--accent); border-radius: 3px;
	box-shadow: .22em .22em 0 var(--wp--preset--color--accent-2);
	vertical-align: .05em;
}
.bn-brand .wp-block-site-title a:hover { color: var(--wp--preset--color--accent); }

.bn-nav .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600; color: var(--wp--preset--color--contrast);
	padding: .35rem 0; border-bottom: 2px solid transparent;
}
.bn-nav .wp-block-navigation-item__content:hover,
.bn-nav .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--accent); border-bottom-color: var(--wp--preset--color--accent);
}
.bn-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--base); padding: 1.5rem;
}
.bn-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: 1.15rem; }

.bn-search .wp-block-search__input {
	background: var(--wp--preset--color--surface); color: var(--wp--preset--color--contrast);
	border: 1px solid var(--bn-line); border-radius: 999px; padding: .45rem .9rem;
}
.bn-search .wp-block-search__button {
	background: var(--wp--preset--color--surface-2); color: var(--wp--preset--color--contrast);
	border: 1px solid var(--bn-line); border-radius: 999px; padding: .45rem .7rem; margin-left: .4rem;
}
.bn-search .wp-block-search__button svg { fill: currentColor; }

/* ---------- Section heading ---------- */
.bn-sec-head { border-bottom: 1px solid var(--bn-line); padding-bottom: .6rem; margin-bottom: 1.25rem !important; }
.bn-sec-head h2 {
	margin: 0; font-size: var(--wp--preset--font-size--large);
	display: flex; align-items: center; gap: .55rem;
}
.bn-sec-head h2::before {
	content: ""; width: 10px; height: 10px; border-radius: 2px;
	background: var(--wp--preset--color--accent); transform: rotate(45deg);
}
.bn-sec-head a.bn-more {
	font-family: var(--wp--preset--font-family--heading); font-weight: 600;
	font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted);
}
.bn-sec-head a.bn-more:hover { color: var(--wp--preset--color--accent); }

/* ---------- Category badge ---------- */
.bn-badge a {
	display: inline-block; padding: .18rem .6rem; border-radius: 999px;
	background: rgba(61, 227, 130, .12); color: var(--wp--preset--color--accent);
	border: 1px solid rgba(61, 227, 130, .28); line-height: 1.5;
}
.bn-badge a:hover { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--on-accent); }
.bn-badge .wp-block-post-terms__separator { display: none; }
.bn-badge a + a { margin-left: .3rem; }

/* ---------- Cards (scoped to .bn-grid only — P28) ---------- */
.bn-grid > .wp-block-post { margin: 0 !important; } /* P14 */
.bn-card {
	height: 100%; display: flex; flex-direction: column;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--bn-line); border-radius: var(--bn-radius); overflow: hidden;
	transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.bn-card:hover { transform: translateY(-3px); border-color: rgba(61, 227, 130, .55); box-shadow: var(--bn-glow); }
.bn-card .wp-block-post-featured-image { margin: 0 !important; overflow: hidden; }
.bn-card .wp-block-post-featured-image img { width: 100%; object-fit: cover; transition: transform .35s ease; }
.bn-card:hover .wp-block-post-featured-image img { transform: scale(1.04); }
.bn-card-body { padding: .9rem 1rem 1rem !important; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.bn-card-body > * { margin: 0 !important; }
.bn-card .wp-block-post-title { font-size: 1.05rem; line-height: 1.6; }
.bn-card .wp-block-post-title a {
	color: var(--wp--preset--color--contrast);
	display: block; max-height: 3.2em; overflow: hidden; word-break: keep-all; overflow-wrap: anywhere; /* P22: no line-clamp for Thai */
}
.bn-card .wp-block-post-title a:hover { color: var(--wp--preset--color--accent); }
.bn-card .wp-block-post-excerpt { color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); line-height: 1.75; }
.bn-card .wp-block-post-excerpt__excerpt { margin: 0; max-height: 5.25em; overflow: hidden; }
.bn-card .wp-block-post-date { margin-top: auto !important; }

/* ---------- Hero ---------- */
.bn-hero-main { position: relative; border-radius: var(--bn-radius); overflow: hidden; border: 1px solid var(--bn-line); }
.bn-hero-main .wp-block-post-featured-image { margin: 0 !important; }
.bn-hero-main .wp-block-post-featured-image img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.bn-hero-main .bn-hero-text {
	position: absolute; inset: auto 0 0 0; padding: 4rem 1.5rem 1.4rem !important;
	background: linear-gradient(180deg, rgba(13,16,21,0) 0%, rgba(13,16,21,.82) 45%, rgba(13,16,21,.96) 100%);
}
.bn-hero-main .bn-hero-text > * { margin: 0 0 .45rem !important; }
.bn-hero-main .wp-block-post-title { font-size: var(--wp--preset--font-size--x-large); line-height: 1.45; }
.bn-hero-main .wp-block-post-title a { color: #fff; }
.bn-hero-main .wp-block-post-excerpt { color: #c9d2db; }
.bn-hero-main .wp-block-post-excerpt__excerpt { margin: 0; max-height: 3.6em; overflow: hidden; }

.bn-hero-side > .wp-block-post { margin: 0 !important; }
.bn-mini { display: flex; gap: .9rem; align-items: center; padding: .7rem; border-radius: 12px; border: 1px solid transparent; transition: background .18s, border-color .18s; }
.bn-mini:hover { background: var(--wp--preset--color--surface); border-color: var(--bn-line); }
.bn-mini .wp-block-post-featured-image { flex: 0 0 38%; margin: 0 !important; border-radius: 10px; overflow: hidden; }
.bn-mini .wp-block-post-featured-image img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.bn-mini-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.bn-mini-body > * { margin: 0 !important; }
.bn-mini .wp-block-post-title { font-size: 1rem; line-height: 1.55; }
.bn-mini .wp-block-post-title a { color: var(--wp--preset--color--contrast); display: block; max-height: 3.1em; overflow: hidden; word-break: keep-all; overflow-wrap: anywhere; }
.bn-mini .wp-block-post-title a:hover { color: var(--wp--preset--color--accent); }

@media (max-width: 781px) {
	.bn-hero-main .bn-hero-text { position: static; background: var(--wp--preset--color--surface); padding: 1rem 1.1rem 1.2rem !important; }
	.bn-hero-main .wp-block-post-title { font-size: var(--wp--preset--font-size--large); }
}

/* ---------- Category chips ---------- */
.bn-chips { gap: .55rem !important; }
.bn-chips a {
	display: inline-flex; align-items: center; gap: .4rem;
	padding: .5rem 1rem; border-radius: 999px; background: var(--wp--preset--color--surface);
	border: 1px solid var(--bn-line); color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--heading); font-weight: 600; font-size: var(--wp--preset--font-size--small);
}
.bn-chips a span { color: var(--wp--preset--color--muted); font-weight: 400; }
.bn-chips a:hover { border-color: var(--wp--preset--color--accent); color: var(--wp--preset--color--accent); }
.bn-chips p { margin: 0; }

/* ---------- Archive header ---------- */
.bn-archive-head { border-bottom: 1px solid var(--bn-line); }
.bn-archive-head .wp-block-query-title { margin: 0; }
.bn-archive-head .wp-block-term-description { color: var(--wp--preset--color--muted); }
.bn-kicker {
	font-family: var(--wp--preset--font-family--heading); font-weight: 600; letter-spacing: .08em;
	text-transform: uppercase; color: var(--wp--preset--color--accent); font-size: var(--wp--preset--font-size--x-small);
}

/* ---------- Pagination ---------- */
.wp-block-query-pagination { gap: .4rem; }
.wp-block-query-pagination a, .wp-block-query-pagination .page-numbers {
	display: inline-flex; min-width: 2.4rem; height: 2.4rem; align-items: center; justify-content: center;
	padding: 0 .7rem; border-radius: 10px; border: 1px solid var(--bn-line); color: var(--wp--preset--color--contrast);
}
.wp-block-query-pagination .page-numbers.current { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--on-accent); border-color: transparent; }
.wp-block-query-pagination a:hover { border-color: var(--wp--preset--color--accent); color: var(--wp--preset--color--accent); }

/* ---------- Single ---------- */
.bn-single-head .wp-block-post-title { font-size: var(--wp--preset--font-size--xx-large); line-height: 1.4; }
.bn-meta { color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--x-small); gap: .4rem .9rem !important; }
.bn-meta > * { margin: 0 !important; }
.bn-meta p { margin: 0; }
.bn-single-img img { border-radius: var(--bn-radius); width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.bn-article { font-size: 1.08rem; }
.bn-article h2 {
	margin-top: 2.2em; padding-left: .8rem; border-left: 4px solid var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--large);
}
.bn-article h3 { margin-top: 1.8em; font-size: 1.15rem; color: var(--wp--preset--color--accent); }
.bn-article ul, .bn-article ol { padding-left: 1.3rem; }
.bn-article li { margin-bottom: .35em; }
.bn-article li::marker { color: var(--wp--preset--color--accent); }
.bn-article strong { color: #fff; }
.bn-article a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.bn-article table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.bn-article th, .bn-article td { border: 1px solid var(--bn-line); padding: .55rem .75rem; text-align: left; }
.bn-article th { background: var(--wp--preset--color--surface); }
.bn-article blockquote { background: var(--wp--preset--color--surface); border-radius: 0 12px 12px 0; padding: 1rem 1.25rem; }
.bn-article img { border-radius: 12px; }

.bn-tags a {
	display: inline-block; margin: 0 .35rem .4rem 0; padding: .2rem .7rem; border-radius: 999px;
	background: var(--wp--preset--color--surface); border: 1px solid var(--bn-line);
	color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--x-small);
}
.bn-tags a::before { content: "#"; }
.bn-tags a:hover { color: var(--wp--preset--color--accent); border-color: var(--wp--preset--color--accent); }
.bn-tags .wp-block-post-terms__separator { display: none; }

.bn-postnav { border-top: 1px solid var(--bn-line); border-bottom: 1px solid var(--bn-line); }
.bn-postnav a { color: var(--wp--preset--color--contrast); font-weight: 600; }
.bn-postnav a:hover { color: var(--wp--preset--color--accent); }

/* ---------- Page ---------- */
.bn-page .wp-block-post-content { font-size: 1.02rem; }
.bn-page .wp-block-image { max-width: 640px; margin-left: auto !important; margin-right: auto !important; }
.bn-page .wp-block-image img { border-radius: 12px; }

/* ---------- Footer ---------- */
.bn-footer { border-top: 1px solid var(--bn-line); background: var(--wp--preset--color--surface); }
.bn-footer h3 { font-size: var(--wp--preset--font-size--small); letter-spacing: .06em; color: var(--wp--preset--color--muted); margin: 0 0 .6rem; }
.bn-footer ul { list-style: none; padding: 0; margin: 0; }
.bn-footer li { margin: .25rem 0; }
.bn-footer li a, .bn-footer .bn-foot-about a { color: var(--wp--preset--color--contrast); }
.bn-footer li a:hover { color: var(--wp--preset--color--accent); }
.bn-footer .bn-foot-about { color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); }
.bn-copy { border-top: 1px solid var(--bn-line); color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--x-small); }

/* ---------- 404 / search ---------- */
.bn-404 .bn-big { font-family: var(--wp--preset--font-family--heading); font-size: clamp(4rem, 14vw, 8rem); line-height: 1; color: var(--wp--preset--color--accent); margin: 0; }

@media (prefers-reduced-motion: reduce) {
	.bn-card, .bn-card .wp-block-post-featured-image img, .bn-mini { transition: none; }
	.bn-card:hover, .bn-card:hover .wp-block-post-featured-image img { transform: none; }
}

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px;
	overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
}
