/*
Theme Name: TweakEdgeGeek Dark
Theme URI: https://tweakedgeek.com
Author: TweakEdgeGeek
Author URI: https://tweakedgeek.com
Description: A modern dark theme for TweakEdgeGeek, based on Twenty Twenty-Three.
Requires at least: 6.1
Tested up to: 6.9
Requires PHP: 5.6
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Text Domain: tweakedgeek-dark
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, style-variations, accessibility-ready, blog, portfolio, news, dark
*/

/* Overall page background */
body,
.wp-site-blocks {
background-color: var(--wp--preset--color--secondary);
}

/* Prevent long content from forcing columns to wrap */
.wp-block-columns > .wp-block-column {
min-width: 0;
}

/* Topic/tag archive tweaks */
.tgeg-post-card {
padding: 0;
}

.tgeg-post-card hr.wp-block-separator {
margin: 0;
padding: 0;
height: 1px;
border: 0;
background-color: #2d3e52;
opacity: 1;
}

.tgeg-post-card .wp-block-post-title {
margin: 0;
padding: 3px;
background: #1a2332;
color: #ffffff;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}

.tgeg-post-card .wp-block-post-title a {
color: inherit;
}

.tgeg-post-summary-wrap,
.tgeg-post-meta-wrap {
padding: 3px;
}

.tgeg-post-summary-wrap {
background: #c8d3dc;
color: #1a2332;
}

/* Card summary: excerpt + inline floated thumbnail + clipped overflow + blur + centered pill */
.tgeg-card-summary {
	position: relative;
	overflow: hidden;
	max-height: 16rem;
}

@media (max-width: 700px) {
	.tgeg-card-summary {
		max-height: 12rem;
	}
}

.tgeg-card-summary-text {
	margin: 0;
}

.tgeg-card-thumb-inline {
	float: right;
	width: clamp(110px, 28%, 180px);
	height: auto;
	margin: 0 0 8px 12px;
	border-radius: 12px;
	object-fit: cover;
}

.tgeg-card-summary-blur {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2.8em;
	display: flex;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	background: rgba(201, 207, 213, 0.07);
}

.tgeg-card-readmore {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 9999px;
	text-decoration: none;
	font-weight: 600;
	border: 1px solid rgba(0, 0, 0, 0.15);
	background: rgba(255, 255, 255, 0.55);
}

.tgeg-card-readmore:hover,
.tgeg-card-readmore:focus {
	text-decoration: none;
}

/* Prevent duplicate right-side featured images in summary cards. */
.tgeg-post-summary-wrap .wp-block-post-featured-image {
	display: none;
}

/* If templates still have a 2-column layout for the summary area, hide the image column. */
.tgeg-post-summary-wrap .wp-block-columns > .wp-block-column:nth-child(2) {
	display: none;
}

/* Footer compliance disclosure */
.tgeg-footer-compliance-wrap {
	border-top: 0;
	padding-top: 0;
	margin-top: 0;
	text-align: center;
}

.tgeg-footer-compliance {
	text-align: center;
}

.tgeg-footer-compliance a {
	white-space: nowrap;
}

/* Full-width footer divider */
.wp-block-separator.tgeg-footer-divider {
	border: 0;
	border-top: 1px solid #fff;
	margin: 0;
	max-width: none;
}

/* Fallback: show divider even when footer template is overridden in Site Editor */
footer.wp-block-template-part {
	position: relative;
}

footer.wp-block-template-part::before {
	content: '';
	display: block;
	height: 1px;
	background: #fff;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-top: 10px;
}

/* Header: hide policy links we don't want as top buttons */
header .tgeg-header-buttons a[href*="cookie-policy"],
header .tgeg-header-buttons a[href*="affiliate-disclosure"],
header .tgeg-header-buttons a[href*="advertising-sponsored-content"] {
	display: none !important;
}

/* Cookie preferences form */
.tgeg-cookie-prefs-form {
	max-width: 520px;
	margin: 0 auto;
}

.tgeg-cookie-prefs-form button {
	cursor: pointer;
}

/* Featured image is used as a background on the summary container. */
.tgeg-post-summary-wrap .wp-block-post-featured-image {
display: none;
}

.tgeg-post-summary-wrap a {
color: inherit;
}

.tgeg-post-summary-wrap .wp-block-post-excerpt,
.tgeg-post-summary-wrap .wp-block-post-excerpt p {
margin: 0;
}

/* Listing cards: show the full excerpt, but don't let it expand the card. */
.tgeg-post-summary-wrap .wp-block-post-excerpt {
max-height: 16rem;
overflow: hidden;
}

/* Home/static front page query loops may not use the tgeg wrapper classes. */
body.home .wp-block-post-excerpt.tgeg-excerpt-bg,
body.front-page .wp-block-post-excerpt.tgeg-excerpt-bg {
max-height: 16rem;
overflow: hidden;
}

/* If Home includes featured-image blocks in the loop, hide them (we render it as a background). */
body.home .wp-block-post-template .wp-block-post-featured-image,
body.front-page .wp-block-post-template .wp-block-post-featured-image {
display: none;
}

/* Read-more link lives under the thumbnail (right column). */
.tgeg-post-summary-wrap .wp-block-read-more {
margin: 6px 0 0 0;
text-align: right;
}

/* Fallback: if Home markup differs, keep the link tidy within cards. */
.tgeg-post-card .wp-block-read-more {
margin: 6px 0 0 0;
text-align: right;
}

/* Pill button styling for the read-more link on cards. */
.tgeg-post-card .wp-block-read-more a {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0.25rem 0.6rem;
border: 1px solid var(--wp--preset--color--secondary);
border-radius: 999px;
background: var(--wp--preset--color--tertiary);
color: var(--wp--preset--color--base);
text-decoration: none;
line-height: 1.1;
}

/* Fallback for Home query loops without .tgeg-post-card. */
body.home .wp-block-post-template .wp-block-read-more a,
body.front-page .wp-block-post-template .wp-block-read-more a {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0.25rem 0.6rem;
border: 1px solid var(--wp--preset--color--secondary);
border-radius: 999px;
background: var(--wp--preset--color--tertiary);
color: var(--wp--preset--color--base);
text-decoration: none;
line-height: 1.1;
}

body.home .wp-block-post-template .wp-block-read-more a:hover,
body.front-page .wp-block-post-template .wp-block-read-more a:hover {
background: var(--wp--preset--color--secondary);
}

.tgeg-post-card .wp-block-read-more a:hover {
background: var(--wp--preset--color--secondary);
}

.tgeg-post-meta-wrap {
background: #2d3e52;
color: #e8eef5;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
}

.tgeg-post-meta-wrap a {
color: inherit;
}

/* Posted on (left) + Topics (right) on one row (50/50). */
.tgeg-post-meta-row {
width: 100%;
display: flex;
flex-wrap: nowrap;
align-items: flex-start;
min-width: 0;
}

.tgeg-post-meta-row.is-layout-flex {
flex-wrap: nowrap !important;
}

.tgeg-post-meta-left {
flex: 0 0 50%;
max-width: 50%;
min-width: 0;
display: flex;
flex-wrap: wrap;
align-items: center;
}

.tgeg-post-meta-left > p {
margin: 0;
}

.tgeg-post-meta-row > .wp-block-tweakedgeek-post-popular-tags {
flex: 0 0 50%;
max-width: 50%;
min-width: 0;
margin: 0;
padding-right: 10px;
text-align: right;
white-space: normal;
overflow-wrap: anywhere;
}

/* Pagination alignment */
.wp-block-query-pagination .tgeg-pagination-grid {
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: center;
}

.wp-block-query-pagination .tgeg-pagination-grid > .wp-block-group {
display: flex;
align-items: center;
}

.wp-block-query-pagination .wp-block-query-pagination-previous,
.wp-block-query-pagination .wp-block-query-pagination-next,
.wp-block-query-pagination .page-numbers {
display: inline-flex;
align-items: center;
}
