/* Goodnews theme — ส่วนที่ theme.json ทำไม่ได้ */

/* ---------- Header แบบลอยติดด้านบน ---------- */
.gn-header-wrap { position: sticky; top: 0; z-index: 50; }
.admin-bar .gn-header-wrap { top: 32px; }
@media (max-width: 782px) { .admin-bar .gn-header-wrap { top: 0; } }
.gn-header {
	background: rgb(255 255 255 / .82);
	backdrop-filter: saturate(180%) blur(14px);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 1px solid rgb(11 18 32 / .06);
	transition: box-shadow .2s ease;
}
.gn-scrolled .gn-header { box-shadow: 0 6px 24px -12px rgb(11 18 32 / .25); }
.gn-header .wp-block-site-title a { text-decoration: none; }
.gn-header .wp-block-navigation a { text-decoration: none; }
.gn-header .wp-block-navigation-item__content { position: relative; padding: .25em 0; }
.gn-header .wp-block-navigation-item__content::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px;
	background: var(--wp--preset--color--accent); transform: scaleX(0); transition: transform .2s ease;
}
.gn-header .wp-block-navigation-item__content:hover::after,
.gn-header .current-menu-item > .wp-block-navigation-item__content::after { transform: scaleX(1); }
@media (max-width: 600px) {
	.gn-brand__en, .gn-header__cta { display: none !important; }
}

/* ---------- ปุ่ม ---------- */
.wp-element-button, .wp-block-button__link { transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.wp-block-button__link:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -12px rgb(37 70 201 / .7); }
.is-style-gn-accent .wp-block-button__link { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--contrast); }
.is-style-gn-accent .wp-block-button__link:hover { background: #ffc14d; box-shadow: 0 10px 24px -12px rgb(255 176 32 / .9); }
.is-style-outline .wp-block-button__link { border: 2px solid currentColor; background: transparent; }
.gn-hero .is-style-outline .wp-block-button__link { color: #fff; }

/* ---------- Hero ---------- */
.gn-hero { overflow: hidden; }
.gn-hero::before, .gn-hero::after {
	content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none;
}
.gn-hero::before { width: 520px; height: 520px; right: -120px; top: -140px; background: #ff9f43; animation: gn-float 14s ease-in-out infinite; }
.gn-hero::after { width: 420px; height: 420px; left: -140px; bottom: -160px; background: #5b7cff; animation: gn-float 18s ease-in-out infinite reverse; }
@keyframes gn-float { 50% { transform: translate(30px, 40px) scale(1.08); } }
.gn-hero__title { letter-spacing: -.01em; }
.gn-hero__title mark { background: none; }
.gn-hero__lead { opacity: .9; max-width: 620px; }
.gn-eyebrow {
	display: inline-block; margin: 0; padding: .3em .9em; border-radius: 999px;
	font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
	color: #fff; background: rgb(255 255 255 / .14); border: 1px solid rgb(255 255 255 / .25);
}
.gn-eyebrow--dark { color: var(--wp--preset--color--primary); background: rgb(37 70 201 / .08); border-color: rgb(37 70 201 / .15); }
.has-text-align-center.gn-eyebrow { display: table; margin-inline: auto; }

/* ---------- หัวหน้าเพจย่อย ---------- */
.gn-page-hero { position: relative; overflow: hidden; }
.gn-page-hero::after { content: ""; position: absolute; width: 380px; height: 380px; right: -100px; top: -120px; border-radius: 50%; background: #ff9f43; filter: blur(70px); opacity: .45; pointer-events: none; }
.gn-on-dark { color: rgb(255 255 255 / .82); }

/* ---------- การ์ด / กล่อง ---------- */
.is-style-gn-card {
	background: var(--wp--preset--color--base); border-radius: var(--wp--custom--radius);
	padding: clamp(1.25rem, 3vw, 2rem);
	box-shadow: 0 1px 2px rgb(11 18 32 / .05), 0 12px 32px -16px rgb(11 18 32 / .2);
	transition: transform .2s ease, box-shadow .2s ease;
}
.gn-feature:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgb(11 18 32 / .05), 0 22px 44px -18px rgb(11 18 32 / .3); }
.gn-feature__icon {
	display: grid; place-items: center; width: 56px; height: 56px; margin: 0 0 .5rem; border-radius: 16px;
	font-size: 28px; line-height: 1; background: var(--wp--preset--color--accent-soft);
}
.is-style-gn-glass {
	background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .2); border-radius: var(--wp--custom--radius);
	backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.gn-donate, .gn-bank {
	position: relative; overflow: hidden; border-radius: calc(var(--wp--custom--radius) * 1.4);
	background: var(--wp--preset--gradient--dawn); color: #fff;
}
.gn-donate::after { content: ""; position: absolute; width: 300px; height: 300px; right: -80px; bottom: -120px; border-radius: 50%; background: #ffb020; filter: blur(80px); opacity: .5; pointer-events: none; }
.gn-donate > *, .gn-bank > * { position: relative; z-index: 1; }
.gn-account {
	margin: .25rem 0 !important; font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 700; letter-spacing: .03em; white-space: nowrap; flex-wrap: nowrap;
	cursor: pointer; display: inline-flex; align-items: center; gap: .5rem;
}
.gn-account::after { flex-shrink: 0; white-space: nowrap; content: "คัดลอก"; font-size: .75rem; font-weight: 600; letter-spacing: 0; padding: .25em .7em; border-radius: 999px; background: rgb(255 255 255 / .18); }
.gn-account.is-copied::after { content: "คัดลอกแล้ว ✓"; background: var(--wp--preset--color--accent); color: var(--wp--preset--color--contrast); }

/* ---------- รายการโพสต์ (Query Loop) แบบการ์ด ---------- */
.gn-query-cards > li {
	display: flex; flex-direction: column; overflow: hidden; background: var(--wp--preset--color--base);
	border-radius: var(--wp--custom--radius);
	box-shadow: 0 1px 2px rgb(11 18 32 / .05), 0 10px 28px -14px rgb(11 18 32 / .2);
	transition: transform .2s ease, box-shadow .2s ease;
}
.gn-query-cards > li:hover { transform: translateY(-4px); }
.gn-query-cards .wp-block-post-featured-image { margin: 0; }
.gn-query-cards .wp-block-post-featured-image img { transition: transform .4s ease; }
.gn-query-cards > li:hover .wp-block-post-featured-image img { transform: scale(1.04); }
.gn-query-cards__body { padding: 1.1rem 1.25rem 1.4rem; }
.gn-query-cards .wp-block-post-title a { color: var(--wp--preset--color--contrast); text-decoration: none; }
.gn-query-cards .wp-block-post-title a:hover { color: var(--wp--preset--color--primary); }
.gn-query-cards .wp-block-post-excerpt__more-link { font-weight: 600; text-decoration: none; }
@media (max-width: 900px) { .gn-query-cards.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 600px) { .gn-query-cards.is-layout-grid { grid-template-columns: 1fr !important; } }

.gn-chip-terms a {
	display: inline-block; padding: .15em .75em; border-radius: 999px; font-size: .8rem; font-weight: 600;
	text-decoration: none; color: var(--wp--preset--color--primary); background: rgb(37 70 201 / .09);
}
.gn-chip-terms .wp-block-post-terms__separator { display: none; }

.wp-block-query-pagination a, .wp-block-query-pagination .page-numbers { padding: .4em .85em; border-radius: 999px; text-decoration: none; }
.wp-block-query-pagination .current { background: var(--wp--preset--color--primary); color: #fff; }

/* ---------- เนื้อหาบทความ ---------- */
.gn-prose img { border-radius: 12px; }
.gn-single .wp-block-post-featured-image img { border-radius: var(--wp--custom--radius); }
.gn-share { border-top: 1px solid #e6e9f2; margin-top: var(--wp--preset--spacing--50) !important; }
.gn-share a { text-decoration: none; font-weight: 600; }

/* ---------- Footer ---------- */
.gn-footer .gn-footer__soft { color: rgb(255 255 255 / .72); }
.gn-footer a { text-decoration: none; }
.gn-footer a:hover { text-decoration: underline; }
.gn-footer__line { border-color: rgb(255 255 255 / .14) !important; opacity: 1; margin-block: var(--wp--preset--spacing--50) var(--wp--preset--spacing--30) !important; }

/* ---------- เคลื่อนไหวตอนเลื่อนถึง ---------- */
.gn-js .gn-reveal > *, .gn-js .gn-posts > * { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.gn-js .gn-reveal.is-in > *, .gn-js .gn-posts.is-in > * { opacity: 1; transform: none; }
.gn-js .is-in > *:nth-child(2) { transition-delay: .1s; }
.gn-js .is-in > *:nth-child(3) { transition-delay: .2s; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.gn-js .gn-reveal > *, .gn-js .gn-posts > * { opacity: 1; transform: none; }
}

:focus-visible { outline: 3px solid var(--wp--preset--color--accent); outline-offset: 2px; }

/* ระยะขอบซ้ายขวาของ section เต็มจอ บนมือถือ */
.alignfull.gn-page-hero, .alignfull.gn-section, .alignfull.gn-hero {
	padding-left: var(--wp--style--root--padding-left, clamp(16px, 4vw, 32px)) !important;
	padding-right: var(--wp--style--root--padding-right, clamp(16px, 4vw, 32px)) !important;
}
