/*
Theme Name: GPL House
Theme URI: https://gpl-house.com
Author: GPL House
Description: FSE theme for the GPL House plugin catalog. Light warm palette, rounded cards, version-pill download system.
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.0
Version: 1.0.25
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gpl-house
Tags: full-site-editing, block-patterns, light, catalog
*/

/* =========================================================================
   GPL House — theme components
   ========================================================================= */

/* ---------- Header: search pill ---------------------------------------- */
.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper {
	border-radius: 999px;
	border: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--base-2);
	overflow: hidden;
}
.wp-block-search__input {
	background: transparent;
	border: none;
}
/* hero search: white capsule with border around input + button */
.gph-hero-search .wp-block-search__input {
	background: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px !important;
	padding: 0.75rem 1.4rem;
	height: auto;
}
.gph-hero-search .wp-block-search__button {
	border: 1px solid var(--wp--preset--color--accent-1);
	height: 100%;
	margin-left: 0.6rem;
}
.header .wp-block-search,
.wp-block-template-part > .wp-block-group .wp-block-search {
	max-width: 420px;
}

/* ---------- Hero badge -------------------------------------------------- */
.gph-hero-badge {
	display: inline-block;
	background: var(--wp--preset--color--base-2);
	color: var(--wp--preset--color--accent-1);
	border: 1px solid var(--wp--preset--color--accent-1);
	border-radius: 999px;
	padding: 0.35rem 1rem;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	font-size: 0.75rem;
}

/* ---------- Plugin cards ------------------------------------------------ */
.gph-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	transition: box-shadow 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
/* inner content wrapper (cat/title/excerpt/meta) — must flex so meta pins to bottom */
.gph-card > .wp-block-group {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}
.gph-card:hover {
	box-shadow: var(--wp--preset--shadow--card-hover);
	transform: translateY(-3px);
	background: var(--wp--preset--color--card-hover);
}
.gph-card .wp-block-post-featured-image {
	margin: 0 0 0.5rem;
}
.gph-card .wp-block-post-featured-image img {
	width: 100%;
	object-fit: cover;
}
.gph-card-cat a {
	display: inline-block;
	background: var(--wp--preset--color--base-2);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	color: var(--wp--preset--color--muted);
	font-size: 0.75rem;
	padding: 0.2rem 0.75rem;
	text-decoration: none;
}
.gph-card-cat a:hover {
	border-color: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--accent-1);
}

/* card meta row (rating/date/version, injected by render_block filter) */
.gph-card-excerpt-meta {
	display: flex;
	flex-wrap: wrap;
	column-gap: 0.9rem;
	row-gap: 0.3rem;
	margin-top: auto;
	padding-top: 0.5rem;
	color: var(--wp--preset--color--muted);
	font-size: 0.85rem;
	align-items: center;
}
/* beat WP auto-generated layout rule (.wp-container-... > * + * margin-block-start) */
.gph-card > .wp-block-group > .gph-card-excerpt-meta {
	margin-top: auto !important;
}
.gph-card-excerpt-meta > span {
	white-space: nowrap;
}
.gph-card-rating {
	color: var(--wp--preset--color--warning);
	font-weight: 600;
}

/* ---------- Buttons / version pills ------------------------------------- */
.gph-download-buttons {
	display: flex;
	flex-wrap: wrap;
	flex-direction: column;
	gap: 0.75rem;
	max-width: 420px;
	width: 100%;
}
.gph-version-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	position: relative;
	border-radius: 999px;
	padding: 0.75rem 1.5rem;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	width: 100%;
	max-width: 420px;
	box-sizing: border-box;
	transition: background 0.2s ease, color 0.2s ease;
}
.gph-btn-latest {
	background: linear-gradient(135deg, #e8632c 0%, #f0854f 100%);
	color: #fff;
}
.gph-btn-latest:hover {
	background: linear-gradient(135deg, #d94f2b 0%, #e8632c 100%);
	color: #fff;
}
.gph-btn-version {
	background: #ececec;
	color: var(--wp--preset--color--contrast);
}
.gph-btn-version:hover {
	background: var(--wp--preset--color--base-2);
	color: var(--wp--preset--color--accent-1);
}
.gph-latest-badge {
	position: absolute;
	top: -0.55rem;
	right: 1rem;
	background: var(--wp--preset--color--contrast);
	color: #fff;
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-radius: 999px;
	padding: 0.15rem 0.55rem;
}

/* outline (ghost) buttons — match filled button height (border inside) */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 2px solid var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--accent-1);
	background: transparent;
	box-sizing: border-box;
	padding-top: calc(0.75rem - 2px);
	padding-bottom: calc(0.75rem - 2px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--accent-1);
	color: #fff;
}

/* ---------- Sidebar meta card ------------------------------------------- */
.gph-meta-card {
	background: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	box-shadow: var(--wp--preset--shadow--card);
	padding: 1.25rem 1.4rem;
}
.gph-meta-row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.55rem 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
	font-size: 0.9rem;
}
.gph-meta-row:last-child {
	border-bottom: none;
}
.gph-meta-label {
	color: var(--wp--preset--color--muted);
}
.gph-meta-value {
	font-weight: 600;
	text-align: right;
}

/* ---------- Meta capsule (single: author + date) ------------------------ */
.gph-meta-capsule .wp-block-post-author-name,
.gph-meta-capsule .wp-block-post-date {
	font-size: 0.9rem;
	color: var(--wp--preset--color--muted);
}

/* ---------- Filter panel (archive / catalog): compact flex pills -------- */
.gph-filter-categories {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.35rem;
}
.gph-filter-categories li {
	margin: 0;
	padding: 0;
	border: none;
}
.gph-filter-categories a {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	background: var(--wp--preset--color--base-2);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	color: var(--wp--preset--color--contrast);
	font-size: 0.8rem;
	padding: 0.3rem 0.8rem;
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.gph-filter-categories a:hover {
	border-color: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--accent-1);
}
.gph-filter-categories .gph-count {
	color: var(--wp--preset--color--muted);
	font-size: 0.6rem;
	background: var(--wp--preset--color--card);
	border-radius: 999px;
	padding: 0.05rem 0.35rem;
	font-weight: 600;
}
.gph-filter-categories .current-cat a {
	background: transparent;
	border-color: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--accent-1);
	font-weight: 600;
}
.gph-filter-categories .current-cat a .gph-count {
	color: var(--wp--preset--color--accent-1);
}
.current-cat a {
	color: var(--wp--preset--color--accent-1);
	font-weight: 600;
}

/* ---------- Category / tag pills (body lists) --------------------------- */
/* note: .gph-filter-card .gph-filter-categories (panel) overrides these by higher specificity */
.gph-post-tags a,
.wp-block-category-list a {
	display: inline-block;
	background: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	color: var(--wp--preset--color--muted);
	font-size: 0.8rem;
	padding: 0.25rem 0.7rem;
	margin: 0 0.4rem 0.5rem 0;
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease;
}
.gph-post-tags a:hover,
.wp-block-category-list a:hover {
	border-color: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--accent-1);
}
.gph-post-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 1.5rem 0;
}

/* ---------- Content tables ---------------------------------------------- */
.gph-post-content table,
.wp-block-post-content table,
.wp-block-table table {
	border-collapse: collapse;
	margin: 1.5rem 0;
	width: 100%;
}
.gph-post-content th,
.gph-post-content td,
.wp-block-post-content th,
.wp-block-post-content td,
.wp-block-table th,
.wp-block-table td {
	border: 1px solid var(--wp--preset--color--border);
	padding: 0.7rem 1rem;
	text-align: left;
	vertical-align: top;
}
.gph-post-content th,
.wp-block-post-content th,
.wp-block-table th {
	background: var(--wp--preset--color--base-2);
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
	font-family: var(--wp--preset--font-family--heading);
}
.gph-post-content td,
.wp-block-post-content td,
.wp-block-table td {
	color: var(--wp--preset--color--muted);
}
.gph-post-content tr:nth-child(even) td,
.wp-block-table tr:nth-child(even) td {
	background: rgba(35, 33, 30, 0.025);
}

/* ---------- Breadcrumbs -------------------------------------------------- */
.wp-block-breadcrumbs,
.gph-breadcrumbs {
	font-size: 0.85rem;
	color: var(--wp--preset--color--muted);
	margin-bottom: 1rem;
}

/* ---------- Pagination --------------------------------------------------- */
.gph-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.4rem;
	height: 2.4rem;
	margin: 0 0.2rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	background: var(--wp--preset--color--card);
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	font-size: 0.9rem;
}
.gph-pagination .page-numbers.current {
	background: var(--wp--preset--color--accent-1);
	border-color: var(--wp--preset--color--accent-1);
	color: #fff;
}
.gph-pagination .page-numbers:hover:not(.current) {
	border-color: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--accent-1);
}

/* ---------- Author card -------------------------------------------------- */
.gph-author-card {
	background: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	padding: 1.25rem;
}
.gph-author-card .wp-block-post-author__avatar img {
	border-radius: 999px;
}

/* ---------- Footer tweaks ------------------------------------------------ */
.site-footer-container a {
	color: var(--wp--preset--color--base-2);
}

/* ---------- 404 page ------------------------------------------------------ */
.gph-404-code {
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(4rem, 10vw, 7rem);
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.05em;
	margin-bottom: 0.5rem;
}
.gph-404-search {
	max-width: 420px;
	margin-left: auto;
	margin-right: auto;
}

/* ---------- Footer: compact category pills (flex row) -------------------- */
.gph-footer-cats-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 0.6rem;
}
.gph-footer-cats-list li {
	margin: 0;
}
.gph-footer-cats-list a {
	display: inline-block;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 999px;
	color: var(--wp--preset--color--base-2);
	font-size: 0.8rem;
	padding: 0.3rem 0.85rem;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
}
.gph-footer-cats-list a:hover {
	background: var(--wp--preset--color--accent-1);
	border-color: var(--wp--preset--color--accent-1);
	color: #fff;
}

/* ---------- Mobile drawer menu (gplchimp-style left slide-in) ------------ */
.gph-menu-toggle {
	display: none;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0.25rem;
	color: var(--wp--preset--color--contrast);
	line-height: 0;
}
@media (max-width: 782px) {
	.gph-menu-toggle {
		display: inline-flex;
		margin-left: 0.75rem;
	}
	/* hide desktop navs on mobile — drawer replaces them */
	.gph-nav-wrap,
	.wp-block-group.has-accent-1-background-color .wp-block-navigation {
		display: none;
	}
}
.gph-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(75vw, 340px);
	background: #2b2b2b;
	z-index: 100000;
	transform: translateX(105%);
	transition: transform 0.3s ease;
	overflow-y: auto;
	padding: 1.25rem 0 2rem;
}
.gph-drawer.is-open {
	transform: translateX(0);
}
.gph-drawer-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
	z-index: 99999;
}
.gph-drawer-overlay.is-open {
	opacity: 1;
	pointer-events: auto;
}
.gph-drawer-close {
	position: absolute;
	top: 0.35rem;
	right: 0.6rem;
	background: transparent;
	border: none;
	color: #ffffff;
	font-size: 1.05rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.35rem;
	z-index: 1;
}
.gph-drawer-search {
	display: flex;
	align-items: center;
	margin: 2.2rem 1.25rem 1.5rem;
	background: rgba(255, 255, 255, 0.12);
	border-radius: 999px;
	padding: 0.55rem 1rem;
	gap: 0.5rem;
}
.gph-drawer-search input {
	flex: 1;
	background: transparent;
	border: none;
	color: #ffffff;
	font-size: 0.95rem;
	outline: none;
	min-width: 0;
}
.gph-drawer-search input::placeholder {
	color: rgba(255, 255, 255, 0.65);
	font-style: italic;
}
.gph-drawer-search button {
	background: transparent;
	border: none;
	color: rgba(255, 255, 255, 0.8);
	cursor: pointer;
	padding: 0;
	line-height: 0;
}
.gph-drawer-nav {
	list-style: none;
	margin: 0;
	padding: 0 1.25rem;
}
.gph-drawer-nav li {
	margin: 0 0 0.35rem;
}
.gph-drawer-nav a {
	display: block;
	color: #ffffff;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 500;
	font-size: 1.05rem;
	padding: 0.65rem 0.5rem;
	border-radius: 8px;
	text-decoration: none;
}
.gph-drawer-nav a:hover,
.gph-drawer-nav .current-menu-item > a {
	background: rgba(255, 255, 255, 0.08);
	color: #ffffff;
}
.gph-drawer-nav .sub-menu {
	list-style: none;
	padding-left: 1rem;
	margin: 0;
}

/* ---------- old nav overlay styles (kept minimal, wp navigation no longer used for overlay) --- */
.wp-block-navigation__responsive-container-close svg,
.wp-block-navigation__responsive-container-open svg {
	fill: var(--wp--preset--color--contrast);
}


/* ---------- Grid cards: equal + responsive min width --------------------- */
.wp-block-post-template.is-layout-grid > .wp-block-post {
	min-width: 0;
}
@media (max-width: 1280px) {
	/* Tablet: 4-col grids collapse to 2 cards per row (user request 16.09.2026) */
	.wp-block-post-template.is-layout-grid.columns-4 > .wp-block-post,
	.wp-block-post-template.is-layout-grid[style*="columnCount:4"] > .wp-block-post {
		grid-column: span 2;
	}
}
/* prevent mid-word breaking in card titles */
.gph-card .wp-block-post-title {
	word-break: normal;
	overflow-wrap: break-word;
}

/* ---------- Mobile -------------------------------------------------------- */
@media (max-width: 782px) {
	.gph-sidebar {
		order: 2;
	}
	.gph-sidebar-inner {
		position: static !important;
	}
	.gph-filter-panel {
		order: 0;
		margin-bottom: 1.5rem;
	}
	.gph-meta-grid {
		grid-template-columns: 1fr !important;
	}
}
/* category archive intro text — 1rem (user request) */
.gph-term-desc {
	font-size: 1rem;
}
