/*
Theme Name:        Politicaly WP
Theme URI:         https://brixoptim.com/
Author:            Brixoptim
Author URI:        https://brixoptim.com/
Description:       Lightweight WordPress conversion of the "Politicly" political campaign HTML template, built for Elementor Pro Theme Builder (header, footer, single and archive locations), ACF (free) and WooCommerce. It loads the template's original Bootstrap 5, AOS, WOW, Swiper, Magnific Popup and GSAP (ScrollSmoother, ScrollTrigger, SplitText) stack in the template's order, wired so it coexists with Elementor's own scripts. Registers the Event, Project, Donation, Campaign and Team post types.
Version:           1.1.1
Requires at least: 6.5
Tested up to:      7.1
Requires PHP:      7.4
License:           GNU General Public License v2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       politicaly-wp
Tags:              custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, e-commerce, one-column, two-columns, right-sidebar
*/

/* --------------------------------------------------------------------------
   The template's own design lives in assets/css/main.css (untouched).
   This file only adds what WordPress, Elementor and WooCommerce need on top.

   1. WordPress core classes
   2. Page shell: header stacking, ScrollSmoother, admin bar
   3. Elementor bridges
   4. Fallback templates (shown when no Elementor template is assigned)
   5. WooCommerce
   -------------------------------------------------------------------------- */

/* ==========================================================================
   1. WordPress core classes
   ========================================================================== */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: hsl(var(--white));
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	clip-path: none;
	color: hsl(var(--heading-color));
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

.alignleft {
	float: left;
	margin: 0.375rem 1.5rem 1rem 0;
}

.alignright {
	float: right;
	margin: 0.375rem 0 1rem 1.5rem;
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

.wp-caption {
	max-width: 100%;
	margin-bottom: 1.5rem;
}

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

.wp-caption-text,
.wp-element-caption {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	text-align: center;
	color: hsl(var(--body-color));
}

.gallery {
	display: grid;
	grid-template-columns: repeat(var(--politicaly-gallery-columns, 3), minmax(0, 1fr));
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.gallery-columns-1 { --politicaly-gallery-columns: 1; }
.gallery-columns-2 { --politicaly-gallery-columns: 2; }
.gallery-columns-4 { --politicaly-gallery-columns: 4; }
.gallery-columns-5 { --politicaly-gallery-columns: 5; }
.gallery-columns-6 { --politicaly-gallery-columns: 6; }

.gallery-item img {
	width: 100%;
	height: auto;
}

.sticky,
.bypostauthor {
	/* Styled by the fallback templates when needed. */
}

/* ==========================================================================
   2. Page shell
   ========================================================================== */

/*
 * The template keeps the header above GSAP ScrollSmoother's fixed #smooth-wrapper
 * because <body> is a flex container and the header carries .tw-z-99.
 * An Elementor Theme Builder header gets the same treatment here.
 */
.elementor-location-header {
	position: relative;
	z-index: 99;
}

.elementor-location-header > .header {
	z-index: 99;
}

/*
 * Elementor header built with the template's ".header" container (Advanced > CSS Classes):
 * let that container behave like the template's own <header> (sticky .fixed-header, z-index).
 */
body:not(.elementor-editor-active) .elementor-location-header:has(> .header) {
	display: contents;
}

/* Logged-in admin bar vs. ScrollSmoother's fixed wrapper and the sticky header. */
.admin-bar #smooth-wrapper {
	top: 32px !important;
	bottom: 0 !important;
	height: auto !important;
}

.admin-bar .header.fixed-header {
	inset-block-start: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar #smooth-wrapper {
		top: 46px !important;
	}

	.admin-bar .header.fixed-header {
		inset-block-start: 46px;
	}
}

/*
 * ScrollSmoother sizes the page as if its wrapper filled the whole window. Moved down by the
 * admin bar, the wrapper is 32px (46px) shorter, so the last 32px (46px) of every page, the
 * footer's copyright row, could never be scrolled into view. Lengthen the content to match
 * (only while ScrollSmoother runs: it is what makes the wrapper fixed).
 */
.admin-bar #smooth-wrapper[style*="fixed"] > #smooth-content {
	padding-bottom: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar #smooth-wrapper[style*="fixed"] > #smooth-content {
		padding-bottom: 46px;
	}
}

/*
 * Without ScrollSmoother (switched off in the Customizer, or inside the Elementor editor)
 * the header would push the page down instead of floating over the hero.
 * Keep the template's overlay layout in both modes.
 */
.politicaly-no-smooth .header,
.politicaly-no-smooth .elementor-location-header {
	position: absolute;
	inset-inline: 0;
	inset-block-start: 0;
	width: 100%;
}

.politicaly-no-smooth .header.fixed-header {
	position: fixed;
}

.admin-bar.politicaly-no-smooth .header,
.admin-bar.politicaly-no-smooth .elementor-location-header {
	inset-block-start: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar.politicaly-no-smooth .header,
	.admin-bar.politicaly-no-smooth .elementor-location-header {
		inset-block-start: 46px;
	}
}

@media screen and (max-width: 600px) {
	.admin-bar.politicaly-no-smooth .header.fixed-header {
		inset-block-start: 0;
	}
}

.site-main {
	display: block;
}

/* Custom logo reused on dark backgrounds when no white logo is set in the Customizer. */
.politicaly-logo-invert {
	filter: brightness(0) invert(1);
}

/* ==========================================================================
   3. Elementor bridges
   ========================================================================== */

/*
 * Hover-dot button for Elementor's Button / Call to Action / Form buttons.
 * Add the CSS class "politicaly-btn" to the widget (Advanced > CSS Classes).
 * Dot colour: white by default, or add "politicaly-btn--dot-dark" / "politicaly-btn--dot-main".
 * assets/js/politicaly-elementor.js feeds the cursor position, as the template's JS does.
 */
.politicaly-btn {
	--politicaly-dot-color: hsl(var(--white));
}

.politicaly-btn--dot-dark {
	--politicaly-dot-color: hsl(var(--heading-color));
}

.politicaly-btn--dot-main {
	--politicaly-dot-color: var(--main-600);
}

.politicaly-btn .elementor-button,
.politicaly-btn .elementor-cta__button {
	position: relative;
	z-index: 1;
	overflow: hidden;
}

.politicaly-btn .elementor-button::after,
.politicaly-btn .elementor-cta__button::after {
	content: "";
	position: absolute;
	top: var(--politicaly-dot-y, 50%);
	left: var(--politicaly-dot-x, 50%);
	width: 0;
	height: 0;
	border-radius: 50%;
	background: var(--politicaly-dot-color);
	transform: translate(-50%, -50%);
	transition: all 0.6s ease-out;
	z-index: -1;
	pointer-events: none;
}

.politicaly-btn .elementor-button:hover::after,
.politicaly-btn .elementor-cta__button:hover::after {
	width: 520px;
	height: 520px;
}

/* Light grey chips of the blog sidebar ([politicaly_categories], [politicaly_tags]); the template's
   hover-bg-main-600 / hover-text-white classes still switch them to red on hover. */
.politicaly-chip {
	background-color: #f5f6f1;
}

/* Template menu placed through the [politicaly_menu] shortcode inside an Elementor header. */
.elementor-widget-shortcode .header-menu .nav-menu {
	margin: 0;
}

/* ==========================================================================
   4. Fallback templates
   ========================================================================== */
.breadcrumb-area {
	background-color: #1d1d1d;
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}

.breadcrumb-area .politicaly-breadcrumb ul {
	flex-wrap: wrap;
}

/* Post / page content written in the WordPress editor. */
.politicaly-entry > * + * {
	margin-top: 1.25rem;
}

.politicaly-entry h1,
.politicaly-entry h2,
.politicaly-entry h3,
.politicaly-entry h4,
.politicaly-entry h5,
.politicaly-entry h6 {
	margin-top: 2rem;
	margin-bottom: 0.75rem;
	font-weight: 400;
}

.politicaly-entry ul,
.politicaly-entry ol {
	padding-inline-start: 1.25rem;
}

.politicaly-entry ul {
	list-style: disc;
}

.politicaly-entry ol {
	list-style: decimal;
}

.politicaly-entry li + li {
	margin-top: 0.375rem;
}

.politicaly-entry a:not(.tw-hover-btn):not(.wp-block-button__link) {
	color: var(--main-600);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.politicaly-entry img {
	max-width: 100%;
	height: auto;
}

.politicaly-entry blockquote {
	padding: 1.5rem 2rem;
	border-radius: 0.5rem;
	background: var(--main-600);
	color: hsl(var(--white));
	font-size: 1.125rem;
	font-weight: 500;
}

.politicaly-entry blockquote p:last-child {
	margin-bottom: 0;
}

.politicaly-entry table {
	width: 100%;
	border-collapse: collapse;
}

.politicaly-entry th,
.politicaly-entry td {
	padding: 0.75rem;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.politicaly-entry .wp-block-button__link {
	background: var(--main-600);
	color: hsl(var(--white));
	border-radius: 0;
	padding: 1rem 2.5rem;
	font-weight: 700;
}

.politicaly-page-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 2rem;
}

.politicaly-post-tags a {
	display: inline-block;
	margin: 0 0.5rem 0.5rem 0;
	padding: 0.375rem 1rem;
	border-radius: 0.375rem;
	background: #f5f6f1;
	color: hsl(var(--heading-color));
	transition: 0.3s;
}

.politicaly-post-tags a:hover {
	background: var(--main-600);
	color: hsl(var(--white));
}

/* Core widgets inside the Blog Sidebar, styled like the template's sidebar cards. */
.blog-details-sideber .widget ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.blog-details-sideber .widget a {
	color: hsl(var(--heading-color));
	transition: 0.3s;
}

.blog-details-sideber .widget a:hover {
	color: var(--main-600);
}

.blog-details-sideber .widget_recent_entries a,
.blog-details-sideber .widget_recent_comments a {
	font-family: var(--heading-font);
	font-size: 1.25rem;
	line-height: 1.3;
}

.blog-details-sideber .widget_recent_entries .post-date {
	display: block;
	margin-top: 0.25rem;
	font-size: 0.875rem;
	color: hsl(var(--body-color));
}

.blog-details-sideber .widget_categories li,
.blog-details-sideber .widget_archive li,
.blog-details-sideber .widget_pages li,
.blog-details-sideber .widget_meta li,
.blog-details-sideber .widget_nav_menu li {
	position: relative;
	margin-bottom: 1.75rem;
}

.blog-details-sideber .widget_categories li:last-child,
.blog-details-sideber .widget_archive li:last-child,
.blog-details-sideber .widget_pages li:last-child,
.blog-details-sideber .widget_meta li:last-child,
.blog-details-sideber .widget_nav_menu li:last-child {
	margin-bottom: 0;
}

.blog-details-sideber .widget_categories li a,
.blog-details-sideber .widget_archive li a,
.blog-details-sideber .widget_pages li a,
.blog-details-sideber .widget_meta li a,
.blog-details-sideber .widget_nav_menu li a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 1rem 1.25rem;
	border-radius: 0.375rem;
	background: #f5f6f1;
	color: hsl(var(--heading-color));
	transition: 0.3s;
}

.blog-details-sideber .widget_categories li a:hover,
.blog-details-sideber .widget_archive li a:hover,
.blog-details-sideber .widget_pages li a:hover,
.blog-details-sideber .widget_meta li a:hover,
.blog-details-sideber .widget_nav_menu li a:hover {
	background: var(--main-600);
	color: hsl(var(--white));
}

.blog-details-sideber .widget_recent_entries li + li,
.blog-details-sideber .widget_recent_comments li + li {
	margin-top: 1rem;
}

.blog-details-sideber .tagcloud a {
	display: inline-block;
	margin: 0 0.5rem 0.5rem 0;
	padding: 0.5rem 1rem;
	border-radius: 0.375rem;
	background: #f5f6f1;
	color: hsl(var(--heading-color));
	font-size: 0.9375rem !important;
	transition: 0.3s;
}

.blog-details-sideber .tagcloud a:hover {
	background: var(--main-600);
	color: hsl(var(--white));
}

/* Comments */
.politicaly-comments .children {
	margin: 0;
	padding: 0;
	list-style: none;
	margin-inline-start: 5rem;
}

.politicaly-comments .comment-reply-link {
	display: inline-flex;
	align-items: center;
	gap: 1rem;
	color: hsl(var(--body-color));
	text-transform: capitalize;
	transition: 0.5s;
}

.politicaly-comments .comment-reply-link:hover {
	color: var(--main-600);
}

.politicaly-comments .comment-awaiting-moderation {
	font-style: italic;
}

.comment-respond .comment-notes,
.comment-respond .logged-in-as {
	margin-bottom: 1.5rem;
}

.comment-respond .comment-form-cookies-consent {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

#cancel-comment-reply-link {
	margin-inline-start: auto;
	font-size: 1rem;
	color: var(--main-600);
}

@media screen and (max-width: 767px) {
	.politicaly-comments .children {
		margin-inline-start: 1.5rem;
	}
}

.politicaly-404-code {
	font-size: clamp(6rem, 20vw, 12rem);
	line-height: 1;
	color: var(--main-600);
}

/* ==========================================================================
   5. WooCommerce
   ========================================================================== */

/* Quantity +/- (added by inc/woocommerce.php), matching the template's .tw-cart-quantity. */
.quantity:has(> .tw-cart-minus) {
	position: relative;
	display: inline-block;
	width: 9.25rem;
	border-top: 1px solid rgba(93, 50, 34, 0.1);
	border-bottom: 1px solid rgba(93, 50, 34, 0.1);
}

.quantity:has(> .tw-cart-minus) .qty {
	width: 100% !important;
	height: 50px;
	padding: 0 0 0 68px;
	border: 0;
	background: transparent;
	font-size: 16px;
	text-align: start;
	-moz-appearance: textfield;
	appearance: textfield;
}

.quantity:has(> .tw-cart-minus) .qty:focus {
	outline: none;
}

.quantity:has(> .tw-cart-minus) .qty::-webkit-outer-spin-button,
.quantity:has(> .tw-cart-minus) .qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

button.tw-cart-minus,
button.tw-cart-plus {
	padding: 0;
	border-top: 0;
	border-bottom: 0;
	border-right: 0;
	background: transparent;
}

.quantity:has(input[type="hidden"], input[readonly]) > .tw-cart-minus,
.quantity:has(input[type="hidden"], input[readonly]) > .tw-cart-plus {
	display: none;
}

.politicaly-woocommerce .woocommerce-products-header__title {
	display: none; /* The page banner already shows the shop title. */
}

/* WordPress toolbar: main.css makes every span inline-block, which pushed
   "Edit with Elementor" below the toolbar. */
#wpadminbar span {
	display: inline;
}
