/*
Theme Name: onion.info
Theme URI: https://onion.info
Description: onion.info - single article theme
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: onion-info
*/

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
	font-size: 16px;
}

body {
	background: #fff;
	color: #111;
	font-family: 'Rubik', 'Helvetica Neue', Helvetica, Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
	padding: 24px 0 16px;
	text-align: center;
	position: relative;
}

.live-indicator {
	position: absolute;
	top: 50%;
	right: 0;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border: none;
	background: none;
	padding: 0;
	cursor: pointer;
	color: inherit;
}

.live-dot {
	width: 10px;
	height: 10px;
	background: #c41230;
	border-radius: 50%;
	flex-shrink: 0;
	animation: live-pulse 2.5s ease-in-out infinite;
}

@keyframes live-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50%       { opacity: 0.35; transform: scale(0.8); }
}

.live-mic {
	font-size: 1rem;
	filter: grayscale(1) brightness(0);
}

.site-logo {
	display: inline-block;
	font-size: clamp(3rem, 8vw, 5.5rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	text-transform: uppercase;
	line-height: 1;
	font-style: italic;
}

.site-logo a {
	color: #111;
}

.site-logo-svg-link {
	position: relative;
	display: inline-block;
}

.site-logo-svg-link svg {
	display: block;
	width: 750px;
	max-width: 100%;
	height: auto;
	filter: brightness(0);
}

.site-logo-svg-link:hover {
	text-decoration: none;
}

.site-logo-svg-link::after {
	content: '';
	position: absolute;
	inset: 0;
	background: url('img/rainbow.png') 0 0 / 750px 100%;
	background-repeat: repeat-x;
	-webkit-mask-image: url('img/logo.svg');
	-webkit-mask-size: 100% 100%;
	mask-image: url('img/logo.svg');
	mask-size: 100% 100%;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s;
}

.site-logo-svg-link:hover::after {
	opacity: 1;
	animation: rainbow-cycle 6s linear infinite;
}

@keyframes rainbow-cycle {
	from { background-position: 0 0; }
	to   { background-position: 750px 0; }
}

.site-logo .logo-wars {
	font-style: italic;
}

.site-logo .custom-logo-link {
	display: inline-block;
}

.site-logo .custom-logo {
	max-height: 120px;
	width: auto;
}

/* ==========================================================================
   Banner Ad
   ========================================================================== */

.banner-ad {
	text-align: center;
	padding: 16px 0;
	width: 100%;
}

body > .banner-ad {
	background: #000;
}
body > .banner-ad img {
	width: 100%;
}

.banner-ad-link {
	display: block;
}

.banner-ad img {
	display: block;
	margin: 0 auto;
}

.ad-label {
	font-size: 0.6rem;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #999;
	margin-bottom: 4px;
	text-align: center;
}

/* Top banner: white label on black background */
body > .banner-ad .ad-label {
	color: #fff;
}

/* Non-top banner ads: gray box with padding and bottom margin */
.site-container .banner-ad {
	background: #f3f3f3;
	padding: 8px;
	margin-bottom: 16px;
}

/* ==========================================================================
   Ticker
   ========================================================================== */

.site-ticker {
	border: 1px solid #ccc;
	overflow: hidden;
	padding: 6px 0;
	margin: 12px 0;
}

.ticker-inner {
	display: flex;
	white-space: nowrap;
	width: max-content;
	animation: ticker-scroll linear infinite;
	animation-duration: 30s; /* overridden by JS based on px/sec rate */
	will-change: transform;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

.ticker-inner:hover {
	animation-play-state: paused;
}

.ticker-text {
	font-size: 0.8rem;
	padding-right: 20px;
}

a.ticker-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

@keyframes ticker-scroll {
	0%   { transform: translate3d(0, 0, 0); }
	100% { transform: translate3d(-50%, 0, 0); }
}

/* ==========================================================================
   Article Header
   ========================================================================== */

.article-category {
	display: inline-block;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #c41230;
	margin-bottom: 10px;
}

.article-title {
	font-size: clamp(1.75rem, 4vw, 2.75rem);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.02em;
	margin-bottom: 14px;
}

.article-meta {
	font-size: 0.8rem;
	color: #333;
	margin-bottom: 16px;
}

.article-meta .author {
	font-weight: 700;
}

/* ==========================================================================
   Related Teasers (below headline)
   ========================================================================== */

.article-teasers {
	border-top: 1px solid #ddd;
	margin-bottom: 24px;
}

.teaser-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
	border-bottom: 1px dotted #ccc;
	font-size: 0.85rem;
	font-weight: 500;
}

.teaser-item .arrow {
	width: 0;
	height: 0;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	border-left: 8px solid #111;
	flex-shrink: 0;
}

/* ==========================================================================
   Content Layout (article + sidebar)
   ========================================================================== */

.article-subheads {
	border-top: 1px solid #ddd;
	margin: 8px 0 40px;
	padding-top: 4px;
}

.content-wrapper {
	display: grid;
	grid-template-columns: 1fr 400px;
	gap: 40px;
	align-items: start;
}

/* ==========================================================================
   Article Body
   ========================================================================== */

.article-featured-image {
	margin-bottom: 20px;
}

.article-featured-image img {
	width: 100%;
	height: auto;
}

.article-body {
	font-size: 0.95rem;
	line-height: 1.7;
}

.article-body p {
	font-size: 18px;
	margin-bottom: 1.2em;
}

.article-body strong {
	font-weight: 700;
}

.article-body h2 {
	font-size: 1.3rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 1.8em 0 0.5em;
	line-height: 1.2;
}

.article-body h3 {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 1.5em 0 0.4em;
	line-height: 1.3;
}

.article-closing {
	font-weight: 700;
	margin-top: 1.5em;
}

.page-content-well {
	max-width: 760px;
	margin: 0 auto;
	padding-top: 24px;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

/* Sidebar Section */
.sidebar-section {
	margin-bottom: 16px;
}

.sidebar-section:last-child {
	border-bottom: none;
}

.sidebar-heading {
	border-bottom: 1px solid #ddd;
	border-top: 1px solid #ddd;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	margin-bottom: 16px;
	padding: 16px 0;
}
/* Missed It Articles */
.missed-it-list {
	list-style: none;
}

.missed-it-item {
	margin-bottom: 14px;
	padding-bottom: 14px;
	border-bottom: 1px dotted #ddd;
}

.missed-it-item:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.missed-it-category {
	font-size: 0.7rem;
	color: #666;
	margin-bottom: 3px;
}

.missed-it-title {
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1.3;
}

.missed-it-title a:hover {
	text-decoration: underline;
}

/* Poll */
.poll-question {
	font-size: 0.9rem;
	font-weight: 700;
	margin-bottom: 14px;
	line-height: 1.4;
}

.poll-options {
	list-style: none;
	margin-bottom: 16px;
}

.poll-options li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
	font-size: 0.85rem;
}

.poll-options input[type="radio"] {
	width: 16px;
	height: 16px;
	accent-color: #111;
	flex-shrink: 0;
	cursor: pointer;
}

.poll-submit,
.newsletter-submit {
	border-radius: 10px;
}

.poll-submit {
	display: block;
	width: 100%;
	background: #111;
	color: #fff;
	border: none;
	padding: 12px;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.2s;
}

.poll-submit:hover {
	background: #333;
}

/* Newsletter */
.newsletter-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.newsletter-form input[type="email"] {
	width: 100%;
	border: 1px solid #ccc;
	padding: 10px 12px;
	font-size: 0.85rem;
	font-family: inherit;
	outline: none;
}

.newsletter-form input[type="email"]:focus {
	border-color: #111;
}

.newsletter-form input[type="email"]::placeholder {
	color: #aaa;
}

.newsletter-submit {
	display: block;
	width: 100%;
	background: #111;
	color: #fff;
	border: none;
	padding: 12px;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.2s;
}

.newsletter-submit:hover {
	background: #333;
}

/* ==========================================================================
   Gravity Forms sidebar overrides
   ========================================================================== */

.sidebar-newsletter-gf .gform_wrapper {
	font-family: inherit;
	font-size: 0.85rem;
}

.sidebar-newsletter-gf .gform_title {
	display: none;
}

.sidebar-heading-poll,
.sidebar-newsletter-headline {
	border-top: 1px solid #ddd;
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.2;
	padding: 16px 0;
}

.sidebar-newsletter-tagline {
	color: #676767;
	line-height: 1.2;
	margin-bottom: 16px;
}

/* Inline layout: [email input] [submit] / [checkbox]
   We use flexbox on gform_fields so GF's grid-column:span 6 rules are ignored entirely. */

/* gform_body is transparent */
.sidebar-newsletter-gf .gform_body,
.sidebar-newsletter-gf .gform-body {
	display: contents;
}

/* gform_fields becomes our flex container — overrides GF's 12-col grid */
.sidebar-newsletter-gf .gform_fields,
.sidebar-newsletter-gf [class*="gform_fields"],
.sidebar-newsletter-gf [class*="gform-fields"] {
	display: flex !important;
	flex-wrap: wrap !important;
	align-items: flex-end !important;
	gap: 8px !important;
	grid-template-columns: unset !important;
}

/* gform_footer only has hidden inputs */
.sidebar-newsletter-gf .gform_footer,
.sidebar-newsletter-gf .gform-footer {
	display: none;
}

/* Strip GF's default gfield spacing */
.sidebar-newsletter-gf .gfield {
	margin-bottom: 0 !important;
}

/* Email field: grows to fill available space, row 1 */
.sidebar-newsletter-gf .gfield--type-email {
	flex: 1 1 auto;
	min-width: 0;
	order: 1;
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
}

/* Submit field: beside email, row 1 */
.sidebar-newsletter-gf .gfield--type-submit {
	flex: 0 0 auto;
	order: 2;
	margin-bottom: 0 !important;
}

/* Consent/checkbox: full width on its own line, row 2 */
.sidebar-newsletter-gf .gfield--type-consent,
.sidebar-newsletter-gf .subscribe-disclaimer {
	order: 3;
	flex: 0 0 100% !important;
	width: 100% !important;
	max-width: none !important;
	margin-top: 16px;
	box-sizing: border-box !important;
}

/* Hide email label — placeholder handles it */
.sidebar-newsletter-gf .gfield--type-email .gfield_label {
	display: none;
}

.sidebar-newsletter-gf .gfield label {
	font-size: 0.8rem;
}

.sidebar-newsletter-gf input[type="email"],
.sidebar-newsletter-gf input[type="text"] {
	width: 100%;
	font-family: inherit;
	border: 1px solid #ccc;
	padding: 8px 10px;
}

.sidebar-newsletter-gf .gfield--type-submit input[type="submit"],
.sidebar-newsletter-gf .gfield--type-submit button,
.sidebar-newsletter-gf .gform_footer input[type="submit"],
.sidebar-newsletter-gf .gform_button,
.sidebar-newsletter-gf .gform-button,
.sidebar-newsletter-gf button[type="submit"] {
	width: auto !important;
	background: #111 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 10px !important;
	padding: 9px 16px !important;
	font-family: inherit !important;
	font-size: 0.8rem !important;
	font-weight: 700 !important;
	letter-spacing: 0.1em !important;
	text-transform: uppercase !important;
	cursor: pointer;
	transition: background 0.2s;
	white-space: nowrap;
}

.sidebar-newsletter-gf .gform-body a {
	text-decoration: underline;
}

.sidebar-newsletter-gf .gfield--type-submit input[type="submit"]:hover,
.sidebar-newsletter-gf .gfield--type-submit button:hover,
.sidebar-newsletter-gf .gform_footer input[type="submit"]:hover,
.sidebar-newsletter-gf .gform_button:hover,
.sidebar-newsletter-gf .gform-button:hover,
.sidebar-newsletter-gf button[type="submit"]:hover {
	background: #333 !important;
}

/* ==========================================================================
   Popup Ad
   ========================================================================== */

.popup-ad-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.popup-ad-overlay[hidden] {
	display: none;
}

.popup-ad-box {
	position: relative;
	max-width: min(600px, 90vw);
	max-height: 90vh;
	width: 100%;
	background: #fff;
	box-sizing: border-box;
	padding: 16px;
}

.popup-ad-box img {
	display: block;
	width: 100%;
	height: auto;
	max-height: calc(90vh - 32px - 24px); /* 32px padding + ~24px ad label */
	object-fit: contain;
}

.popup-ad-link {
	display: block;
}

.popup-ad-close {
	position: absolute;
	top: -14px;
	right: -14px;
	width: 28px;
	height: 28px;
	background: #fff;
	color: #111;
	border: 2px solid #111;
	border-radius: 50%;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1;
}

.popup-ad-close:hover {
	background: #111;
	color: #fff;
}

/* ==========================================================================
   Video Popup
   ========================================================================== */

.video-popup {
	position: fixed;
	bottom: -800px;
	right: 0;
	width: 400px;
	z-index: 9999;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
	transition: bottom 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.video-popup.is-visible {
	bottom: 0;
}

.video-popup iframe,
.video-popup video {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 9 / 16;
}

.video-popup.is-minimized iframe,
.video-popup.is-minimized video {
	display: none;
}

.video-popup.is-minimized .video-popup-close {
	display: none;
}

.video-popup-bar {
	display: none;
	width: 100%;
	height: 50px;
	background: #000;
	color: #fff;
	border: none;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
	text-align: center;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0;
}

.video-popup-bar-arrow {
	display: inline-block;
	width: 0;
	height: 0;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	border-left: 10px solid #fff;
	vertical-align: middle;
	margin-bottom: 1px;
}

.video-popup.is-minimized .video-popup-bar {
	display: flex;
}

.video-popup-close {
	position: absolute;
	top: -12px;
	right: 0;
	width: 26px;
	height: 26px;
	background: #111;
	color: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	font-size: 12px;
	line-height: 26px;
	text-align: center;
	z-index: 1;
	padding: 0;
	transition: background 0.2s;
}

.video-popup-close:hover {
	background: #444;
}

@media (max-width: 600px) {
	.video-popup {
		width: 60%;
	}
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
	border-top: 1px dotted #111;
	padding: 24px 0;
	margin-top: 48px;
	font-size: 0.8rem;
	color: #666;
}

.footer-links {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.footer-legal {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0;
}

.footer-legal > * {
	padding: 0 12px;
	border-right: 1px solid #ccc;
}

.footer-legal > *:first-child {
	padding-left: 0;
}

.footer-legal > *:last-child {
	border-right: none;
}

.footer-links a {
	color: #666;
	text-decoration: none;
}

.footer-links a:hover {
	text-decoration: underline;
}

.footer-social {
	display: flex;
	align-items: center;
	gap: 14px;
}

.footer-social a {
	color: #666;
	display: flex;
	align-items: center;
	text-decoration: none;
}

.footer-social a:hover {
	color: #111;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
	.content-wrapper {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	.article-sidebar {
		border-top: 2px solid #111;
	}
}

@media (max-width: 600px) {
	.site-container {
		padding: 0 16px;
	}

	.article-title {
		font-size: 1.75rem;
	}

	.site-logo {
		font-size: 3rem;
	}

	.site-header {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 8px;
	}

	.live-indicator {
		position: static;
		transform: none;
	}
}
