/*
Theme Name: FG News
Description: Lightweight news theme for ngxhng. Green navigation bar, "Hot news" front page, most-viewed posts. No page builder, no external dependencies.
Author: ngxhng
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fgnews
*/

/* ---------- Base ---------- */
:root {
	--fg-primary: #03a84e;
	--fg-primary-dark: #028a40;
	--fg-text: #222;
	--fg-heading: #333;
	--fg-muted: #777;
	--fg-border: #ececec;
	--fg-soft: #e6f7f0;
	--fg-footer: #f5f5f5;
	--fg-container: 1260px;
	--fg-gutter: 15px;
	--fg-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--fg-font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--fg-text);
	background: #fff;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--fg-primary); text-decoration: none; }
a:hover, a:focus { color: var(--fg-primary-dark); }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--fg-font);
	font-weight: 700;
	color: var(--fg-heading);
	line-height: 1.3;
	margin: 0 0 .5em;
}

p { margin: 0 0 1.3em; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.screen-reader-text:focus {
	clip: auto; width: auto; height: auto;
	background: #fff; padding: 10px 15px; z-index: 100000; left: 5px; top: 5px;
}

.container {
	width: 100%;
	max-width: var(--fg-container);
	margin: 0 auto;
	padding: 0 var(--fg-gutter);
}

/* ---------- Grid ---------- */
.row {
	display: flex;
	flex-wrap: wrap;
	margin: 0 calc(var(--fg-gutter) * -1);
}
.row > .col { padding: 0 var(--fg-gutter) 30px; width: 100%; }
.row.row-small { margin: 0 -10px; }
.row.row-small > .col { padding: 0 10px 20px; }

@media (min-width: 850px) {
	.col-3 { width: 25% !important; }
	.col-4 { width: 33.3333% !important; }
	.col-6 { width: 50% !important; }
	.col-8 { width: 66.6666% !important; }
	.col-9 { width: 75% !important; }
	.row-divided > .col + .col { border-left: 1px solid var(--fg-border); }
}

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 849px) {
	.grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.grid-2.grid-stack-md { grid-template-columns: 1fr; }
}
@media (max-width: 549px) {
	.grid { gap: 15px; }
	.grid-3.grid-stack-sm, .grid-4.grid-stack-sm { grid-template-columns: 1fr; }
}

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 30; background: #fff; }
@media (min-width: 850px) {
	.site-header { position: sticky; top: -60px; }
	.admin-bar .site-header { top: -28px; }
	.site-header.is-stuck .header-bottom { box-shadow: 0 2px 10px rgba(0,0,0,.15); }
}
@media (max-width: 849px) {
	.site-header { position: sticky; top: 0; box-shadow: 0 1px 0 var(--fg-border); }
	.admin-bar .site-header { top: 46px; }
}
@media (max-width: 600px) { .admin-bar .site-header { top: 0; position: relative; } }

.header-main { height: 60px; border-bottom: 1px solid transparent; }
.header-main .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.site-logo { display: flex; align-items: center; }
.site-logo img { max-width: 166px; max-height: 50px; width: auto; }
.site-logo .site-title { font-size: 26px; font-weight: 800; color: var(--fg-primary); margin: 0; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.button {
	display: inline-block;
	border: 2px solid var(--fg-primary);
	color: #fff;
	background: var(--fg-primary);
	border-radius: 99px;
	padding: 2px 14px;
	font-size: 14px;
	line-height: 1.6;
	font-weight: 600;
	cursor: pointer;
	transition: background .2s, color .2s;
}
.button:hover, .button:focus { background: var(--fg-primary-dark); border-color: var(--fg-primary-dark); color: #fff; }
.button-solid { background: var(--fg-primary); color: #fff; text-transform: none; }
.button-solid:hover { background: var(--fg-primary-dark); border-color: var(--fg-primary-dark); }

.header-bottom { background: var(--fg-primary); height: 50px; }
.header-bottom .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; }
.main-nav li { position: relative; }
.main-nav a {
	display: block;
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: .02em;
	padding: 13px 12px;
	line-height: 24px;
	opacity: .95;
}
.main-nav > ul > li:first-child > a { padding-left: 0; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current-menu-ancestor > a, .main-nav .current-post-ancestor > a { color: #fff; opacity: 1; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.main-nav .sub-menu {
	display: none;
	position: absolute; top: 100%; left: 0;
	min-width: 220px; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.12);
	flex-direction: column; align-items: stretch; padding: 8px 0;
}
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { display: flex; }
.main-nav .sub-menu a { color: var(--fg-text); padding: 8px 18px; text-transform: none; font-weight: 600; }
.main-nav .sub-menu a:hover { color: var(--fg-primary); text-decoration: none; }

.search-form { display: flex; align-items: center; position: relative; margin: 0; }
.search-form .search-field {
	width: 100%;
	border: 0;
	border-radius: 99px;
	padding: 6px 40px 6px 16px;
	font: inherit;
	font-size: 14px;
	background: rgba(255,255,255,.2);
	color: #fff;
	outline: none;
	transition: background .2s;
}
.search-form .search-field::placeholder { color: rgba(255,255,255,.85); }
.search-form .search-field:focus { background: rgba(255,255,255,.3); }
.search-form .search-submit {
	position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
	border: 0; background: transparent; color: #fff; cursor: pointer; padding: 6px 10px; line-height: 0;
}
.header-bottom .search-form { width: 300px; max-width: 40%; }

/* Search form on light backgrounds (sidebar, 404, mobile drawer) */
.search-form.is-light .search-field { background: #f1f1f1; color: var(--fg-text); }
.search-form.is-light .search-field::placeholder { color: var(--fg-muted); }
.search-form.is-light .search-submit { color: var(--fg-muted); }

.menu-toggle {
	display: none;
	border: 0; background: transparent; padding: 8px; cursor: pointer; color: var(--fg-text);
}
.menu-toggle svg { display: block; }

/* Mobile drawer */
.mobile-drawer {
	position: fixed; inset: 0;
	z-index: 1000;
	visibility: hidden;
}
.mobile-drawer .drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .25s; }
.mobile-drawer .drawer-panel {
	position: absolute; top: 0; bottom: 0; left: 0;
	width: 280px; max-width: 85%;
	background: #fff; overflow-y: auto; padding: 20px;
	transform: translateX(-100%); transition: transform .25s;
}
.mobile-drawer.is-open { visibility: visible; }
.mobile-drawer.is-open .drawer-backdrop { opacity: 1; }
.mobile-drawer.is-open .drawer-panel { transform: none; }
.mobile-drawer .drawer-close { position: absolute; top: 8px; right: 8px; border: 0; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; color: var(--fg-muted); }
.mobile-drawer .search-form { margin: 30px 0 15px; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav li { border-top: 1px solid var(--fg-border); }
.mobile-nav a { display: block; padding: 12px 0; color: var(--fg-text); font-weight: 700; text-transform: uppercase; font-size: 15px; }
.mobile-nav .sub-menu a { padding-left: 15px; font-weight: 600; text-transform: none; }

body.drawer-open { overflow: hidden; }

@media (max-width: 849px) {
	.header-main { border-bottom-color: var(--fg-border); }
	.header-bottom { display: none; }
	.menu-toggle { display: block; }
	.header-actions .button { display: none; }
}

/* ---------- Section titles ---------- */
.section { padding: 30px 0 10px; }
.section-soft { background: var(--fg-soft); padding-top: 35px; padding-bottom: 15px; margin-bottom: 30px; }

.section-title {
	display: flex;
	align-items: flex-end;
	border-bottom: 2px solid var(--fg-border);
	margin: 0 0 20px;
	font-size: 1.6em;
	text-transform: uppercase;
	line-height: 1.6;
}
.section-title span {
	display: inline-block;
	border-bottom: 2px solid rgba(0,0,0,.15);
	margin-bottom: -2px;
	padding-bottom: 7.5px;
}
.section-title a { color: inherit; }
.section-title a:hover { color: var(--fg-primary); }

/* ---------- Post cards ---------- */
.post-card { display: flex; flex-direction: column; min-width: 0; }
.post-card .card-image {
	position: relative;
	display: block;
	overflow: hidden;
	background: #f1f1f1;
	padding-top: 56.25%;
	margin-bottom: 10px;
}
.post-card .card-image.ratio-75 { padding-top: 75%; }
.post-card .card-image img {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	object-fit: cover;
	transition: transform .3s;
}
.post-card:hover .card-image img { transform: scale(1.04); }

.post-card .card-title {
	font-size: 1.05em;
	line-height: 1.35;
	margin: 0 0 5px;
}
.post-card .card-title a {
	color: var(--fg-heading);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.post-card .card-title a:hover { color: var(--fg-primary); }
.post-card.is-large .card-title { font-size: 1.32em; }
.post-card .card-meta { font-size: .8em; color: var(--fg-muted); margin: 0 0 5px; }
.post-card .card-cat { font-size: .7em; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-primary); margin: 0 0 4px; }
.post-card .card-cat a { color: inherit; }
.post-card .card-excerpt { font-size: .92em; line-height: 1.6; color: #555; margin: 0; padding-top: .2em; }
.post-card.is-large .card-excerpt { font-size: 1em; }

/* Horizontal card (Recent Posts, archives on mobile) */
.post-card.is-horizontal { flex-direction: row; gap: 20px; align-items: flex-start; }
.post-card.is-horizontal .card-image { flex: 0 0 28%; padding-top: 0; aspect-ratio: 16 / 9; margin: 0; }
.post-card.is-horizontal .card-body { flex: 1 1 auto; min-width: 0; }
.post-card.is-horizontal .card-title { font-size: 1.2em; }
.post-list > .post-card { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--fg-border); }
.post-list > .post-card:last-child { border-bottom: 0; }

@media (max-width: 549px) {
	.post-card.is-horizontal { gap: 10px; align-items: center; }
	.post-card.is-horizontal .card-image { flex-basis: 45%; }
	.post-card.is-horizontal .card-title { font-size: 15px; }
	.post-card.is-horizontal .card-excerpt, .post-card.is-horizontal .card-meta { display: none; }
	.grid-2 .post-card .card-title, .grid-3 .post-card .card-title, .grid-4 .post-card .card-title { font-size: 15px; }
}

/* ---------- Layout with sidebar ---------- */
.page-wrapper { padding: 30px 0; }
.content-area { min-width: 0; }

.sidebar .widget { margin-bottom: 35px; }
.widget-title {
	font-size: 1em;
	text-transform: uppercase;
	letter-spacing: .03em;
	margin: 0 0 12px;
	padding-bottom: 8px;
	position: relative;
}
.widget-title::after { content: ""; display: block; width: 30px; height: 3px; background: rgba(0,0,0,.1); margin-top: 8px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 6px 0; border-top: 1px solid var(--fg-border); }
.widget li:first-child { border-top: 0; }
.widget li a { color: var(--fg-text); }
.widget li a:hover { color: var(--fg-primary); }
.widget select { width: 100%; padding: 8px; font: inherit; border: 1px solid #ddd; }

.most-viewed li { display: flex; gap: 10px; align-items: flex-start; }
.most-viewed .mv-rank {
	flex: 0 0 26px; height: 26px; border-radius: 50%;
	background: var(--fg-primary); color: #fff; font-size: 13px; font-weight: 700;
	display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.most-viewed a { color: var(--fg-primary); font-size: .92em; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.most-viewed a:hover { color: var(--fg-primary-dark); }
.sidebar .widget li a { font-size: .92em; }

@media (min-width: 850px) {
	.sidebar-sticky { position: sticky; top: 20px; }
}

/* ---------- Single post ---------- */
.entry-header { text-align: left; margin-bottom: 20px; }
.entry-category { font-size: .75em; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.entry-category a { color: var(--fg-primary); }
.entry-category a:hover { color: var(--fg-primary); }
.entry-title { font-size: 1.9em; line-height: 1.3; margin: 0 0 10px; }
.entry-divider { width: 30px; height: 3px; background: rgba(0,0,0,.1); margin: 12px 0; }
.entry-meta { font-size: .8em; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-muted); }
.entry-meta a { color: var(--fg-primary); }

.entry-content { font-size: 1.06em; line-height: 1.8; overflow-wrap: break-word; color: #2b2b2b; }
.entry-content p { margin-bottom: 1.1em; }
.entry-content img { margin: 1em auto; }
.entry-content h2 { font-size: 1.5em; margin-top: 1.2em; }
.entry-content h3 { font-size: 1.25em; margin-top: 1.2em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; margin: 0 0 1.3em; }
.entry-content li { margin-bottom: .4em; }
.entry-content blockquote { margin: 1.5em 0; padding: .5em 1.2em; border-left: 4px solid var(--fg-primary); background: #f8f8f8; font-style: italic; }
.entry-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.3em; }
.entry-content td, .entry-content th { border: 1px solid var(--fg-border); padding: 8px; }
.entry-content figure { margin: 1em 0; max-width: 100%; }
.entry-content figcaption, .wp-caption-text { font-size: .85em; color: var(--fg-muted); text-align: center; }
.entry-content iframe { max-width: 100%; }
.aligncenter { margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }

.entry-share { display: flex; justify-content: center; gap: 8px; padding: 20px 0; border-top: 1px solid var(--fg-border); margin-top: 20px; }
.entry-share a {
	width: 36px; height: 36px; border-radius: 6px;
	background: #555; color: #fff;
	display: flex; align-items: center; justify-content: center;
	transition: transform .15s, opacity .15s;
}
.entry-share a:hover { color: #fff; transform: translateY(-2px); opacity: .9; }
.entry-share .share-facebook { background: #3a589d; }
.entry-share .share-x { background: #111; }
.entry-share .share-pinterest { background: #cb2320; }
.entry-share .share-email { background: #6c757d; }
.entry-share .share-tumblr { background: #32506d; }
.entry-share .share-telegram { background: #2aabee; }
.entry-share .share-whatsapp { background: #25d366; }
.entry-share svg { width: 16px; height: 16px; fill: currentColor; }

.related-posts { margin-top: 30px; }

.post-views-hidden { display: none; }

/* ---------- Archive ---------- */
.archive-header { margin-bottom: 25px; text-align: center; }
.archive-header h1 { font-size: 1.05em; letter-spacing: .06em; text-transform: uppercase; margin: 0; }
.archive-header h1 span { color: var(--fg-primary); }
.archive-header .archive-description { color: var(--fg-muted); margin-top: 8px; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 20px 0; }
.pagination .page-numbers {
	min-width: 38px; height: 38px; padding: 0 10px;
	border: 2px solid var(--fg-border); border-radius: 99px;
	display: flex; align-items: center; justify-content: center;
	font-weight: 700; color: var(--fg-muted);
}
.pagination .page-numbers.current, .pagination a.page-numbers:hover { background: var(--fg-primary); border-color: var(--fg-primary); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--fg-footer); color: #000; padding: 25px 0; font-size: .9em; text-align: center; margin-top: 20px; }
.footer-nav ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; }
.footer-nav li { margin: 0 10px; }
.footer-nav a { color: #555; text-transform: uppercase; font-size: .8em; letter-spacing: .05em; }
.footer-nav a:hover { color: var(--fg-primary); }
.copyright { margin: 0; }

@media (max-width: 549px) {
	.footer-nav { display: none; }
}

.back-to-top {
	position: fixed; right: 20px; bottom: 20px; z-index: 50;
	width: 40px; height: 40px; border: 2px solid currentColor; background: #fff; color: var(--fg-muted);
	display: flex; align-items: center; justify-content: center; cursor: pointer;
	opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; }
.back-to-top:hover { color: var(--fg-primary); }
@media (max-width: 549px) { .back-to-top { display: none; } }

/* ---------- Misc ---------- */
.not-found { text-align: center; padding: 60px 0; }
.not-found h1 { font-size: 4em; color: var(--fg-primary); margin: 0; }
.not-found .search-form { max-width: 420px; margin: 20px auto; }

.comments-area { margin-top: 30px; }
.comment-respond { background: #f5f5f5; padding: 20px 25px; border-radius: 4px; }
.comment-respond textarea, .comment-respond input[type=text], .comment-respond input[type=email], .comment-respond input[type=url] { width: 100%; padding: 10px; border: 1px solid #ddd; font: inherit; border-radius: 3px; }
.comment-respond .submit { background: var(--fg-primary); color: #fff; border: 0; padding: 10px 20px; font-weight: 700; text-transform: uppercase; cursor: pointer; border-radius: 3px; }
.comment-respond .submit:hover { background: var(--fg-primary-dark); }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment-body { padding: 15px 0; border-bottom: 1px solid var(--fg-border); }
