/* ============================================================
   PO3Trader Optin — main stylesheet
   Mobile-first. HARD RULE: zero horizontal overflow at 375px.
   Users scroll ONLY up/down, never left/right.
   ============================================================ */

/* --- Reset-ish / safety net --- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
	overflow-x: hidden;           /* safety net */
	width: 100%;
	max-width: 100%;
}

body {
	margin: 0;
	padding: 0;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.65;
	color: #1a1a1a;
	background: #fff;
	-webkit-text-size-adjust: 100%;
}

/* --- Images: never wider than their container --- */
img {
	max-width: 100%;
	height: auto;
	display: block;
}

figure { margin: 0 0 1.5em; max-width: 100%; }
.wp-caption { max-width: 100%; }

/* Gutenberg image/figure blocks */
.wp-block-image img { max-width: 100%; height: auto; }
.wp-block-image { margin: 0 0 1.5em; }

/* Embedded content (iframes, videos, embeds) */
iframe, embed, object, video {
	max-width: 100%;
}
.entry-content iframe {
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
}

/* --- Tables: scroll container on mobile, never push page wider --- */
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content th, .entry-content td {
	border: 1px solid #ddd;
	padding: 8px 10px;
	text-align: left;
	font-size: 0.95rem;
}
.po3-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	max-width: 100%;
	margin: 0 0 1.5em;
}

/* --- Typography --- */
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.6em; overflow-wrap: break-word; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.2em; overflow-wrap: break-word; }
a { color: var(--po3-accent, #008254); overflow-wrap: break-word; }

/* Long URLs / code never break layout */
.entry-content { overflow-wrap: break-word; word-wrap: break-word; }
pre, code { overflow-x: auto; max-width: 100%; }

/* --- Layout containers --- */
.po3-container {
	width: 100%;
	max-width: 1140px;
	margin: 0 auto;
	padding-left: 16px;
	padding-right: 16px;
}

.po3-site-main { padding: 24px 0 48px; }

/* Two-column (content + sidebar) on desktop only */
.po3-layout { display: block; }
@media (min-width: 900px) {
	.po3-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; }
}

/* --- Header --- */
.po3-header {
	border-bottom: 1px solid #eee;
	background: #fff;
	/* Not sticky — the opt-in top bar already holds the sticky slot.
	   Keeps the header from sliding under / overlapping the top bar. */
}
.po3-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 10px;
	padding-bottom: 10px;
	max-width: 100%;
}
.po3-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #111; min-width: 0; }
.po3-brand img { max-height: 44px; width: auto; }
.po3-brand__badge {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; flex: 0 0 44px;
	background: #008254; color: #fff;
	font-weight: 800; font-size: 1.15rem; letter-spacing: -0.5px;
	border-radius: 12px;
}
.po3-brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.po3-brand__name { font-weight: 800; font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #111; }
.po3-brand__tagline { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: #008254; white-space: nowrap; }

.po3-nav ul { list-style: none; margin: 0; padding: 0; display: none; }
@media (min-width: 900px) {
	.po3-nav ul { display: flex; gap: 22px; }
	.po3-nav a { text-decoration: none; color: #222; font-weight: 600; font-size: 0.95rem; }
	.po3-nav a:hover { color: var(--po3-accent, #008254); }
}
.po3-menu-toggle {
	background: none; border: 1px solid #ddd; border-radius: 6px;
	padding: 8px 12px; font-size: 1.1rem; cursor: pointer;
}
@media (min-width: 900px) { .po3-menu-toggle { display: none; } }
.po3-nav--open ul {
	display: block;
	position: absolute; top: 100%; left: 0; right: 0;
	background: #fff; border-bottom: 1px solid #eee;
	padding: 8px 16px 16px; z-index: 300;
}
.po3-nav--open ul li { padding: 8px 0; border-top: 1px solid #f2f2f2; }
.po3-nav--open ul a { text-decoration: none; color: #222; font-weight: 600; display: block; }

/* --- Sticky top-bar opt-in --- */
.po3-topbar {
	background: var(--po3-accent, #008254);
	color: #fff;
	position: sticky;
	top: 0;
	z-index: 400;
	width: 100%;
	max-width: 100%;
}
.po3-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding-top: 8px;
	padding-bottom: 8px;
	max-width: 1000px;
	margin: 0 auto;
}
.po3-topbar .po3-optin { flex: 0 1 auto; min-width: 0; }
.po3-topbar .po3-optin--topbar { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.po3-topbar .po3-optin__headline--inline {
	font-weight: 700; font-size: 0.85rem; color: #fff;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	display: none;
}
@media (min-width: 700px) {
	.po3-topbar .po3-optin__headline--inline { display: inline; }
}
.po3-topbar .po3-optin__form { display: flex; flex-direction: row; gap: 8px; align-items: center; }
.po3-topbar .po3-optin__form input[type="text"],
.po3-topbar .po3-optin__form input[type="email"] {
	width: 170px; max-width: 170px; flex: 0 0 auto;
	padding: 8px 10px; border: none; border-radius: 6px; font-size: 0.85rem;
}
.po3-topbar .po3-optin__btn {
	white-space: nowrap; flex: 0 0 auto;
	padding: 8px 18px; border: none; border-radius: 6px;
	background: #111; color: #fff; font-weight: 700; font-size: 0.85rem; cursor: pointer;
}
.po3-topbar__close {
	background: none; border: none; color: #fff; font-size: 1.3rem;
	cursor: pointer; padding: 4px 8px; flex: 0 0 auto;
}
@media (max-width: 699px) {
	.po3-topbar__inner { flex-wrap: wrap; justify-content: center; }
	.po3-topbar .po3-optin__form { flex-wrap: wrap; justify-content: center; }
	.po3-topbar .po3-optin__form input[type="text"],
	.po3-topbar .po3-optin__form input[type="email"] { width: 140px; max-width: 140px; }
}

/* --- Generic opt-in form styles --- */
.po3-optin { max-width: 100%; }
.po3-optin__headline { font-size: 1.35rem; margin-bottom: 0.4em; }
.po3-optin__subhead { color: #555; margin-bottom: 1em; }
.po3-optin__form { display: flex; flex-direction: column; gap: 10px; max-width: 100%; }
.po3-optin__form input[type="text"],
.po3-optin__form input[type="email"] {
	width: 100%; max-width: 100%;
	padding: 12px 14px;
	border: 1px solid #ccc; border-radius: 8px;
	font-size: 1rem;
}
.po3-optin__form input:focus { outline: 2px solid var(--po3-accent, #008254); border-color: var(--po3-accent, #008254); }
.po3-optin__btn {
	background: var(--po3-accent, #008254);
	color: #fff; border: none; border-radius: 8px;
	padding: 13px 20px; font-size: 1rem; font-weight: 700;
	cursor: pointer; width: 100%;
}
.po3-optin__btn:hover { filter: brightness(0.92); }
.po3-optin__privacy { font-size: 0.8rem; color: #888; margin-top: 8px; }
.po3-optin__msg { font-size: 0.9rem; margin-top: 8px; min-height: 1.2em; }
.po3-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.po3-visually-hidden {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Below-post opt-in box */
.po3-optin--below {
	background: #f4faf7;
	border: 2px solid var(--po3-accent, #008254);
	border-radius: 12px;
	padding: 24px 20px;
	margin: 32px 0;
	max-width: 100%;
}

/* Popup / slide-in */
.po3-popup {
	position: fixed; inset: 0; z-index: 1000;
	display: none; align-items: center; justify-content: center;
	padding: 16px;
}
.po3-popup--show { display: flex; }
.po3-popup__overlay {
	position: absolute; inset: 0; background: rgba(0,0,0,0.55);
}
.po3-popup__box {
	position: relative; background: #fff; border-radius: 14px;
	padding: 28px 24px; width: 100%; max-width: 440px; max-height: 92vh;
	overflow-y: auto;
}
.po3-popup__close {
	position: absolute; top: 10px; right: 14px;
	background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #999;
}
/* Mobile: slide-in from bottom instead of centered modal */
@media (max-width: 699px) {
	.po3-popup { align-items: flex-end; padding: 0; }
	.po3-popup__box { border-radius: 14px 14px 0 0; max-width: 100%; }
}

/* --- Homepage: hero + grids --- */
.po3-hero {
	background: #0f1f18;
	color: #fff;
	border-radius: 12px;
	overflow: hidden;
	margin-bottom: 32px;
	max-width: 100%;
}
.po3-hero a { color: #fff; text-decoration: none; }
.po3-hero__img img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }
.po3-hero__body { padding: 20px; }
.po3-hero__kicker {
	color: #7be3ae; font-size: 0.75rem; font-weight: 700;
	text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.po3-hero__title { font-size: 1.6rem; margin-bottom: 8px; }
.po3-hero__excerpt { color: #cfe3d6; font-size: 0.95rem; }

.po3-section { margin-bottom: 36px; max-width: 100%; }
.po3-section__title {
	font-size: 1.3rem; border-bottom: 3px solid var(--po3-accent, #008254);
	padding-bottom: 8px; margin-bottom: 18px;
}
.po3-grid {
	display: grid; gap: 20px;
	grid-template-columns: 1fr;   /* single column on mobile */
	max-width: 100%;
}
@media (min-width: 600px) { .po3-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .po3-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.po3-card { max-width: 100%; }
.po3-card a { text-decoration: none; color: inherit; display: block; }
.po3-card__thumb img {
	width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px;
}
.po3-card__cat {
	color: #c0392b; font-size: 0.72rem; font-weight: 700;
	text-transform: uppercase; letter-spacing: 0.5px; margin: 10px 0 4px;
}
.po3-card__title { font-weight: 700; font-size: 1.05rem; line-height: 1.35; margin: 0 0 4px; }
.po3-card__date { color: #888; font-size: 0.83rem; }
.po3-card__excerpt { color: #555; font-size: 0.92rem; }

/* --- Single post --- */
.po3-breadcrumbs { font-size: 0.82rem; color: #888; margin-bottom: 12px; max-width: 100%; }
.po3-breadcrumbs a { color: #888; text-decoration: none; }
.po3-entry-title { font-size: 2rem; margin-bottom: 12px; }
.po3-entry-meta { color: #888; font-size: 0.88rem; margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 12px; }
.po3-featured { margin-bottom: 24px; max-width: 100%; }
.po3-featured img { width: 100%; height: auto; border-radius: 10px; }
.entry-content { max-width: 100%; }
.entry-content > * { max-width: 100%; }

/* Author box */
.po3-author {
	display: flex; gap: 16px; align-items: flex-start;
	background: #f7f7f7; border-radius: 10px; padding: 20px; margin: 32px 0;
	max-width: 100%;
}
.po3-author__avatar img { border-radius: 50%; width: 72px; height: 72px; flex: 0 0 auto; }
.po3-author__name { font-weight: 700; margin-bottom: 4px; }
.po3-author__bio { font-size: 0.92rem; color: #555; }

/* Share buttons */
.po3-share { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; max-width: 100%; }
.po3-share a {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 8px 14px; border-radius: 6px; font-size: 0.85rem; font-weight: 600;
	text-decoration: none; color: #fff;
}
.po3-share__x { background: #000; }
.po3-share__fb { background: #1877f2; }
.po3-share__mail { background: #666; }

/* Banner ad above related posts */
.po3-related-banner { text-align: center; margin: 32px 0 8px; max-width: 100%; }
.po3-related-banner img { max-width: 100%; height: auto; margin: 0 auto; }

/* "You Might Also Like" */
.po3-related { margin: 24px 0 40px; max-width: 100%; }
.po3-related h2 { font-size: 1.4rem; margin-bottom: 18px; }
.po3-related__grid {
	display: grid; gap: 20px;
	grid-template-columns: 1fr;   /* single column on mobile — no h-scroll */
	max-width: 100%;
}
@media (min-width: 600px) { .po3-related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .po3-related__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* "You May Also Like" — Code Snippets version (.mht-related) */
.mht-related { margin: 24px 0 40px; max-width: 100%; }
.mht-related h3 { font-size: 1.4rem; margin-bottom: 18px; }
.mht-related-grid {
	display: grid; gap: 24px;
	grid-template-columns: 1fr;
	max-width: 100%;
}
@media (min-width: 600px) { .mht-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .mht-related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mht-related-card { max-width: 100%; }
.mht-related-card img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; max-width: 100%; }
.mht-card-cat { color: #c0392b; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin: 10px 0 4px; }
.mht-card-title { font-weight: 700; font-size: 1rem; line-height: 1.4; margin-bottom: 4px; }
.mht-card-title a { color: #111; text-decoration: none; }
.mht-card-date { color: #888; font-size: 0.82rem; }
.mht-related-banner { text-align: center; margin: 32px 0 8px; max-width: 100%; }
.mht-related-banner img { max-width: 100%; height: auto; margin: 0 auto; }

/* "You May Also Like" — theme built-in (.po3-ymal) */
.po3-ymal { margin: 32px 0 40px; max-width: 100%; }
.po3-ymal__banner { text-align: center; margin-bottom: 24px; }
.po3-ymal__banner img { max-width: 100%; height: auto; }
.po3-ymal__heading { font-size: 1.4rem; margin: 0 0 20px; }
.po3-ymal__grid { display: grid; gap: 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 100%; }
.po3-ymal__card { max-width: 100%; min-width: 0; }
.po3-ymal__thumb { display: block; overflow: hidden; border-radius: 8px; }
.po3-ymal__thumb img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; display: block; }
.po3-ymal__cat { color: #c0392b; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin: 12px 0 6px; }
.po3-ymal__title { font-size: 1rem; font-weight: 700; line-height: 1.4; margin: 0 0 6px; }
.po3-ymal__title a { color: #111; text-decoration: none; }
.po3-ymal__title a:hover { color: #008254; }
.po3-ymal__date { color: #888; font-size: 0.82rem; }
@media (max-width: 900px) { .po3-ymal__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .po3-ymal__grid { grid-template-columns: 1fr; } }

/* --- Sidebar --- */
.po3-sidebar .widget {
	background: #f9f9f9; border-radius: 10px; padding: 20px; margin-bottom: 24px;
	max-width: 100%;
}
.widget-title { font-size: 1.1rem; margin-bottom: 12px; }
.po3-sidebar ul { list-style: none; margin: 0; padding: 0; }
.po3-sidebar li { padding: 6px 0; border-top: 1px solid #eee; font-size: 0.93rem; }

/* --- Footer --- */
.po3-footer { background: #111; color: #bbb; padding: 56px 0 0; margin-top: 40px; overflow-x: hidden; }
.po3-footer a { color: #ddd; text-decoration: none; }
.po3-footer a:hover { color: #fff; }
.po3-footer__cta { background: linear-gradient(135deg, #008254 0%, #006b45 100%); border-radius: 16px; padding: 40px; display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-bottom: 48px; flex-wrap: wrap; }
.po3-footer__cta-text h3 { color: #fff; font-size: 1.6rem; margin: 0 0 8px; }
.po3-footer__cta-text p { color: rgba(255,255,255,0.85); font-size: 1rem; max-width: 500px; line-height: 1.5; margin: 0; }
.po3-footer__cta-formwrap { min-width: 280px; }
.po3-footer__cta-note { color: rgba(255,255,255,0.7); font-size: 0.8rem; margin: 10px 0 0; }
.po3-footer__top { display: grid; grid-template-columns: 1.2fr 2fr; gap: 48px; padding-bottom: 40px; margin-bottom: 40px; border-bottom: 1px solid #2a2a2a; }
.po3-footer__logo { font-size: 1.8rem; font-weight: 800; color: #fff; }
.po3-footer__logo span { color: #008254; }
.po3-footer__tagline { font-size: 0.95rem; color: #999; margin: 14px 0 20px; line-height: 1.6; max-width: 380px; }
.po3-footer__social { display: flex; gap: 10px; }
.po3-footer__social a { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid #333; border-radius: 50%; color: #ddd; font-size: 0.8rem; font-weight: 700; }
.po3-footer__social a:hover { border-color: #008254; color: #008254; }
.po3-footer__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.po3-stat { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 10px; padding: 20px; text-align: center; }
.po3-stat__num { font-size: 1.8rem; font-weight: 800; color: #fff; }
.po3-stat__label { font-size: 0.78rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.po3-footer__cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.po3-footer__col h4 { color: #fff; margin: 0 0 18px; text-transform: uppercase; letter-spacing: 1px; font-size: 0.85rem; }
.po3-footer__col p { font-size: 0.9rem; line-height: 1.7; color: #999; }
.po3-footer__col ul { list-style: none; margin: 0; padding: 0; }
.po3-footer__col li { margin-bottom: 12px; font-size: 0.9rem; }
.po3-footer__col li a { color: #bbb; }
.po3-footer__col li a:hover { color: #008254; }
.po3-footer__post { display: flex; gap: 12px; margin-bottom: 16px; align-items: flex-start; }
.po3-footer__post img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.po3-footer__post a { color: #ddd; font-size: 0.88rem; line-height: 1.4; }
.po3-footer__post a:hover { color: #008254; }
.po3-footer__post-date { font-size: 0.75rem; color: #666; margin-top: 4px; }
.po3-footer__bottom { border-top: 1px solid #2a2a2a; padding: 22px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.po3-footer__copy { font-size: 0.82rem; color: #888; margin: 0; }
.po3-footer__legal { display: flex; gap: 20px; }
.po3-footer__legal a { font-size: 0.82rem; color: #888; }
.po3-footer__disclaimer { font-size: 0.75rem; color: #555; max-width: 700px; line-height: 1.5; padding-bottom: 24px; margin: 0; }
@media (max-width: 900px) {
	.po3-footer__top { grid-template-columns: 1fr; gap: 28px; }
	.po3-footer__cols { grid-template-columns: 1fr 1fr; }
	.po3-footer__cta { padding: 28px 20px; }
}
@media (max-width: 560px) {
	.po3-footer__cols { grid-template-columns: 1fr; }
	.po3-footer__stats { grid-template-columns: 1fr 1fr; }
}

/* --- Pagination --- */
.po3-pagination { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0; }
.po3-pagination a, .po3-pagination span {
	padding: 8px 14px; border: 1px solid #ddd; border-radius: 6px;
	text-decoration: none; color: #333; font-size: 0.9rem;
}
.po3-pagination .current { background: var(--po3-accent, #008254); color: #fff; border-color: var(--po3-accent, #008254); }

/* --- Comments --- */
.po3-comments { margin-top: 40px; max-width: 100%; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment { padding: 16px 0; border-top: 1px solid #eee; max-width: 100%; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"],
.comment-form textarea {
	width: 100%; max-width: 100%; padding: 10px 12px;
	border: 1px solid #ccc; border-radius: 6px; font-size: 1rem; margin-bottom: 10px;
}
.comment-form textarea { min-height: 120px; }
.form-submit input[type="submit"] {
	background: var(--po3-accent, #008254); color: #fff; border: none;
	border-radius: 8px; padding: 12px 24px; font-weight: 700; cursor: pointer;
}

/* --- Search --- */
.po3-search-form { display: flex; gap: 8px; max-width: 100%; }
.po3-search-form input[type="search"] {
	flex: 1 1 auto; min-width: 0; padding: 10px 12px;
	border: 1px solid #ccc; border-radius: 6px; font-size: 1rem;
}
.po3-search-form button {
	flex: 0 0 auto; background: var(--po3-accent, #008254); color: #fff;
	border: none; border-radius: 6px; padding: 10px 16px; font-weight: 700; cursor: pointer;
}

/* --- 404 --- */
.po3-404 { text-align: center; padding: 60px 0; }
.po3-404 h1 { font-size: 3rem; }

/* Screen-reader / skip link */
.skip-link {
	position: absolute; left: -9999px; top: auto;
	background: #000; color: #fff; padding: 8px 16px; z-index: 9999;
}
.skip-link:focus { left: 8px; top: 8px; }
