/*
Theme Name: OpinionPulse Custom
Theme URI: https://example.com/
Author: Theme Author
Description: Lightweight classic/hybrid theme for opinion, survey and rewards sites. No page builders, no CSS frameworks, minimal vanilla JS. Includes an editable ads/ snippet folder.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: opinionpulse-custom
*/

/* ---------- Tokens ---------- */
:root {
	--op-green: #18a568;
	--op-green-2: #0f9d58;
	--op-green-ink: #0b7a44;
	--op-green-soft: #e7f6ee;
	--op-yellow: #ffcc00;
	--op-yellow-2: #e0b400;
	--op-ink: #1f2937;
	--op-muted: #5b6776;
	--op-line: #e4e9ee;
	--op-bg: #f4f7f6;
	--op-card: #fff;
	--op-radius: 14px;
	--op-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 18px rgba(15, 23, 42, .06);
	--op-shadow-lg: 0 10px 30px rgba(15, 23, 42, .16);
	--op-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--op-bar-h: 56px;
	--op-max: 1120px;
	--op-gap: 16px;
}

/* ---------- Base (mobile-first) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.6 var(--op-font); color: var(--op-ink); background: var(--op-bg); }
img, video, iframe { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--op-green-ink); }
h1, h2, h3, h4 { line-height: 1.25; }
:focus-visible { outline: 3px solid var(--op-ink); outline-offset: 2px; }
.screen-reader-text, .op-skip:not(:focus) {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.op-skip:focus { position: fixed; top: 8px; left: 8px; z-index: 200; background: #fff; padding: 10px 14px; border-radius: 8px; }
.op-wrap { width: 100%; max-width: var(--op-max); margin: 0 auto; padding: 0 var(--op-gap); }
.op-wrap--read { max-width: 760px; }
html.is-drawer-open { overflow: hidden; }

/* ---------- Buttons ---------- */
.op-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 26px;
	border-radius: 999px; border: 2px solid transparent; font: 800 1rem var(--op-font); text-decoration: none; cursor: pointer;
}
.op-btn--cta { background: var(--op-yellow); color: #1b1b1b; box-shadow: 0 4px 0 var(--op-yellow-2); }
.op-btn--cta:hover { background: #ffd633; }
.op-btn--ghost { border-color: var(--op-green); color: var(--op-green-ink); background: transparent; }
.op-btn--block { width: 100%; }

/* ---------- Top bar ---------- */
.op-bar { position: sticky; top: 0; z-index: 80; height: var(--op-bar-h); background: #fff; border-bottom: 1px solid var(--op-line); }
.op-bar__in { display: flex; align-items: center; gap: 10px; height: 100%; max-width: var(--op-max); margin: 0 auto; padding: 0 var(--op-gap); }
.op-burger {
	width: 44px; height: 44px; margin-left: -10px; border: 0; background: transparent; border-radius: 10px; cursor: pointer;
	display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.op-burger span { width: 22px; height: 2px; background: var(--op-ink); border-radius: 2px; }
.op-brand { font-weight: 800; font-size: 1.15rem; line-height: 1; }
.op-brand a { color: var(--op-green-ink); text-decoration: none; }
.custom-logo { max-height: 36px; width: auto; }

/* Country / language selector */
.op-country { position: relative; margin-left: auto; }
.op-country__btn {
	display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border: 1px solid var(--op-line);
	background: #fff; border-radius: 999px; font: 600 .875rem var(--op-font); color: var(--op-ink); cursor: pointer;
}
.op-flag { font-size: 1.2rem; line-height: 1; }
.op-caret { border: 4px solid transparent; border-top-color: currentColor; margin-top: 4px; }
.op-country__list {
	display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; margin: 0; padding: 6px; list-style: none;
	background: #fff; border: 1px solid var(--op-line); border-radius: 12px; box-shadow: var(--op-shadow-lg); z-index: 95;
}
.op-country.is-open .op-country__list { display: block; }
.op-country__list button {
	display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: transparent;
	border-radius: 8px; font: inherit; color: var(--op-ink); text-align: left; cursor: pointer;
}
.op-country__list button:hover { background: var(--op-green-soft); }

/* ---------- Drawer ---------- */
.op-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); opacity: 0; visibility: hidden; transition: opacity .2s; z-index: 90; }
.op-drawer {
	position: fixed; top: 0; left: 0; bottom: 0; width: min(86vw, 320px); z-index: 100; background: #fff; overflow-y: auto;
	display: flex; flex-direction: column; box-shadow: var(--op-shadow-lg);
	transform: translateX(-100%); visibility: hidden; transition: transform .25s, visibility .25s;
}
.is-drawer-open .op-drawer { transform: none; visibility: visible; }
.is-drawer-open .op-overlay { opacity: 1; visibility: visible; }
.op-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--op-line); }
.op-user { display: flex; align-items: center; gap: 10px; }
.op-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--op-green); color: #fff; display: grid; place-items: center; font-weight: 800; }
.op-close { width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--op-ink); border-radius: 10px; }
.op-drawer__label { margin: 16px 16px 0; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--op-muted); }
.op-drawer__cta { display: grid; gap: 10px; padding: 16px; margin-top: auto; }
.op-menu { list-style: none; margin: 0; padding: 8px 12px; }
.op-menu a {
	display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 999px;
	color: var(--op-ink); font-weight: 600; text-decoration: none;
}
.op-menu a:hover { background: var(--op-green-soft); }
.op-menu .current-menu-item > a, .op-menu .current_page_item > a, .op-menu .is-active > a { background: var(--op-green); color: #fff; }
.op-ico { width: 1.5em; text-align: center; flex: none; }

/* ---------- Hero ---------- */
.op-hero { background: linear-gradient(135deg, var(--op-green) 0%, var(--op-green-2) 100%); color: #fff; padding: 40px 0 48px; }
.op-hero h1 { margin: 0 0 16px; font-size: clamp(1.9rem, 6vw, 3rem); font-weight: 900; line-height: 1.1; letter-spacing: -.02em; max-width: 18em; }
.op-perks { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; font-size: 1.05rem; font-weight: 600; }
.op-perks li { display: flex; gap: 10px; align-items: flex-start; }
.op-perks li::before {
	content: "\2713"; flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%;
	background: var(--op-yellow); color: #1b1b1b; font-size: .8rem; font-weight: 900; display: grid; place-items: center;
}

/* ---------- Sections & grid ---------- */
.op-section { padding: 32px 0; }
.op-section__title, .op-archive-head h1, .op-member-head h1 { margin: 0 0 16px; font-size: 1.5rem; }
.op-archive-head { padding: 28px 0 8px; }
.op-archive-desc { color: var(--op-muted); margin-bottom: 8px; }
.op-grid { display: grid; gap: var(--op-gap); grid-template-columns: 1fr; padding-bottom: 24px; }

/* ---------- Cards ---------- */
.op-card { display: flex; flex-direction: column; background: var(--op-card); border-radius: var(--op-radius); box-shadow: var(--op-shadow); overflow: hidden; }
.op-card__img { display: block; aspect-ratio: 16 / 9; background: var(--op-green-soft); }
.op-card__img img { width: 100%; height: 100%; object-fit: cover; }
.op-card__body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 16px; }
.op-badge {
	align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: var(--op-green-soft); color: var(--op-green-ink);
	font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
}
.op-card__title { margin: 0; font-size: 1.15rem; }
.op-card__title a { color: inherit; text-decoration: none; }
.op-card__title a:hover { text-decoration: underline; }
.op-card__excerpt { margin: 0; color: var(--op-muted); font-size: .95rem; }
.op-card__more { margin-top: auto; font-weight: 700; text-decoration: none; }
.op-card__more:hover { text-decoration: underline; }

/* ---------- Ads ---------- */
.op-ad { padding: 12px 0; text-align: center; min-height: 112px; }
.op-ad__label { display: block; margin-bottom: 4px; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--op-muted); }
.op-card--ad { padding: 16px; min-height: 250px; justify-content: center; text-align: center; }

/* ---------- Single post ---------- */
.op-single { margin: 20px 0; padding: 20px; background: #fff; border-radius: var(--op-radius); box-shadow: var(--op-shadow); }
.op-single__title { margin: 12px 0 8px; font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.15; letter-spacing: -.01em; }
.op-meta { color: var(--op-muted); font-size: .9rem; }
.op-single__img { margin: 16px -20px; }
.op-single__img img { width: 100%; }
.entry { font-size: 1.125rem; line-height: 1.75; overflow-wrap: anywhere; }
.entry > * + * { margin-top: 1.1em; }
.entry h2 { font-size: 1.5rem; margin-top: 1.8em; }
.entry h3 { font-size: 1.25rem; margin-top: 1.5em; }
.entry blockquote { margin-left: 0; padding: 4px 0 4px 16px; border-left: 4px solid var(--op-green); color: var(--op-muted); }
.entry pre { overflow-x: auto; padding: 14px; background: #f1f5f4; border-radius: 10px; font-size: .9rem; }
.entry table { display: block; overflow-x: auto; border-collapse: collapse; }
.entry th, .entry td { padding: 8px 12px; border: 1px solid var(--op-line); }
.op-tags { margin-top: 24px; font-size: .9rem; color: var(--op-muted); }
.post-navigation .nav-links { display: grid; gap: 12px; margin: 24px 0; }
.post-navigation a { display: block; padding: 14px; background: #fff; border-radius: var(--op-radius); box-shadow: var(--op-shadow); text-decoration: none; font-weight: 700; }

/* ---------- Pagination ---------- */
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 8px 0 32px; }
.page-numbers { min-width: 40px; padding: 8px 12px; border-radius: 999px; background: #fff; box-shadow: var(--op-shadow); text-align: center; text-decoration: none; font-weight: 700; }
.page-numbers.current { background: var(--op-green); color: #fff; }

/* ---------- Member area ---------- */
.op-member-head { padding: 24px 0 8px; }
.op-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; }
.op-tab { flex: none; padding: 10px 18px; border-radius: 999px; background: #fff; box-shadow: var(--op-shadow); color: var(--op-ink); font-weight: 700; text-decoration: none; }
.op-tab.is-active { background: var(--op-green); color: #fff; }
.op-panel { margin-bottom: 32px; padding: 20px; background: #fff; border-radius: var(--op-radius); box-shadow: var(--op-shadow); }

/* ---------- Footer ---------- */
.op-footer { margin-top: 24px; padding: 32px 0; background: #17212b; color: #cbd5e1; font-size: .9rem; }
.op-footer a { color: #fff; }
.op-footer__links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 16px; padding: 0; list-style: none; }

/* ---------- Larger screens ---------- */
@media (min-width: 640px) {
	.op-grid { grid-template-columns: repeat(2, 1fr); }
	.op-single { padding: 36px; }
	.op-single__img { margin: 20px -36px; }
	.post-navigation .nav-links { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
	.op-grid { grid-template-columns: repeat(3, 1fr); }
	.op-hero { padding: 72px 0 80px; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.op-drawer, .op-overlay { transition: none; }
}
