/*
Theme Name: FlirtyStickers Theme
Theme URI: https://flirtystickers.com
Author: FlirtyStickers.com
Author URI: https://flirtystickers.com
Tags: dark, grid-layout, custom-menu, translation-ready
Description: Custom sticker-pack browsing theme for FlirtyStickers.com. Replaces the video-oriented legacy theme with a purpose-built, dense-grid, dark-mode browsing experience. Includes native download CTA architecture, semantic gallery output, image SEO alt-text generation, structured data, and a Phase-2-ready ad zone framework.
Version: 2.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flirtystickers-theme
*/

/* =========================================================
   1. CUSTOM PROPERTIES
   ========================================================= */
:root {
	--bg-base: #141414;
	--bg-card: #1e1e1e;
	--bg-hover: #252525;
	--bg-ad-zone: #111111;
	--border: #2a2a2a;
	--text-primary: #f0f0f0;
	--text-secondary: #aaaaaa;
	--accent-red: #e63946;
	--accent-red-hover: #c1121f;
	--accent-orange: #f4a261;
	--ad-label: #333333;

	--container-max: 1600px;
	--radius-card: 6px;
	--sidebar-width: 260px;
	--header-height: 64px;
}

/* =========================================================
   2. RESET
   ========================================================= */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg-base);
	color: var(--text-primary);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
}

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

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

ul,
ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

h1,
h2,
h3,
h4,
p {
	margin: 0 0 12px;
}

button,
input {
	font-family: inherit;
}

:focus-visible {
	outline: 2px solid var(--accent-orange);
	outline-offset: 2px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* =========================================================
   3. LAYOUT SHELL
   ========================================================= */
.site-container {
	max-width: var(--container-max);
	margin: 0 auto;
	padding: 0 16px;
}

.content-wrap {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	padding: 24px 0 48px;
}

/* =========================================================
   4. HEADER
   ========================================================= */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--bg-base);
	border-bottom: 1px solid var(--border);
	height: var(--header-height);
	transition: box-shadow 0.15s ease;
}

.site-header.is-scrolled {
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.site-header .header-inner {
	display: flex;
	align-items: center;
	gap: 20px;
	height: 100%;
}

.site-branding a {
	font-size: 20px;
	font-weight: 700;
	color: var(--text-primary);
	letter-spacing: -0.02em;
	white-space: nowrap;
}

.site-branding .brand-accent {
	color: var(--accent-red);
}

.main-navigation {
	display: none;
}

.main-navigation ul {
	display: flex;
	gap: 4px;
}

.main-navigation a {
	display: block;
	padding: 8px 12px;
	font-size: 14px;
	color: var(--text-secondary);
	border-radius: 4px;
	transition: background 0.15s ease, color 0.15s ease;
}

.main-navigation a:hover,
.main-navigation a.current-menu-item {
	background: var(--bg-card);
	color: var(--text-primary);
}

.header-search {
	margin-left: auto;
	flex: 1;
	max-width: 360px;
}

.header-search form {
	display: flex;
	align-items: center;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 20px;
	padding: 6px 14px;
	gap: 8px;
}

.header-search input[type="search"] {
	flex: 1;
	background: transparent;
	border: 0;
	color: var(--text-primary);
	font-size: 14px;
}

.header-search input[type="search"]:focus {
	outline: none;
}

.header-search button {
	background: transparent;
	border: 0;
	color: var(--text-secondary);
	cursor: pointer;
	display: flex;
	padding: 0;
}

.menu-toggle {
	background: transparent;
	border: 0;
	color: var(--text-primary);
	cursor: pointer;
	display: flex;
	padding: 4px;
}

.menu-toggle svg {
	width: 24px;
	height: 24px;
}

.main-navigation.is-open {
	display: block;
	position: absolute;
	top: var(--header-height);
	left: 0;
	right: 0;
	background: var(--bg-base);
	border-bottom: 1px solid var(--border);
	padding: 8px 16px 16px;
}

.main-navigation.is-open ul {
	flex-direction: column;
}

/* =========================================================
   5. CATEGORY STRIP (draggable)
   ========================================================= */
.category-strip {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 12px 0;
	cursor: grab;
	scrollbar-width: none;
	-ms-overflow-style: none;
	user-select: none;
}

.category-strip::-webkit-scrollbar {
	display: none;
}

.category-strip.is-dragging {
	cursor: grabbing;
}

.category-strip a {
	flex: 0 0 auto;
	padding: 6px 14px;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 16px;
	font-size: 13px;
	color: var(--text-secondary);
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease;
}

.category-strip a:hover,
.category-strip a.current-cat {
	background: var(--accent-red);
	border-color: var(--accent-red);
	color: #fff;
}

/* =========================================================
   6. BREADCRUMBS
   ========================================================= */
.breadcrumb-nav {
	font-size: 13px;
	color: var(--text-secondary);
	padding: 12px 0 4px;
}

.breadcrumb-nav a {
	color: var(--text-secondary);
}

.breadcrumb-nav a:hover {
	color: var(--text-primary);
}

.breadcrumb-nav .sep {
	margin: 0 6px;
	color: var(--border);
}

/* =========================================================
   7. STICKER GRID + CARDS
   ========================================================= */
.sticker-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}

.sticker-card {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-card);
	overflow: hidden;
	contain: content;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.sticker-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
	background: var(--bg-hover);
}

.sticker-card .card-thumb-wrap {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--radius-card) var(--radius-card) 0 0;
	background: var(--bg-ad-zone);
}

.sticker-card .card-thumb-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sticker-card .card-category-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	background: var(--accent-orange);
	color: #1a1a1a;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 3px 8px;
	border-radius: 3px;
	z-index: 1;
}

.sticker-card .card-body {
	padding: 10px 12px 12px;
}

.sticker-card .card-title {
	font-size: 14px;
	line-height: 1.3;
	color: var(--text-primary);
	margin: 0 0 8px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sticker-card .card-download-label {
	font-size: 12px;
	font-weight: 700;
	color: var(--accent-red);
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

/* =========================================================
   8. DOWNLOAD CTA BUTTON
   ========================================================= */
.flirty-download-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--accent-red);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	padding: 14px 28px;
	border-radius: 6px;
	transition: background 0.15s ease;
}

.flirty-download-btn:hover {
	background: var(--accent-red-hover);
}

.flirty-download-btn svg {
	width: 18px;
	height: 18px;
}

/* =========================================================
   9. SINGLE POST
   ========================================================= */
.single-pack .pack-title {
	font-size: 26px;
	line-height: 1.25;
	margin: 8px 0 16px;
}

.single-pack .pack-featured-image {
	border-radius: var(--radius-card);
	overflow: hidden;
	margin-bottom: 24px;
	background: #000;
	display: flex;
	justify-content: center;
	align-items: center;
	max-height: 520px;
}

.single-pack .pack-featured-image .pack-hero-image {
	width: auto;
	max-width: 100%;
	max-height: 520px;
	object-fit: contain;
	display: block;
	margin: 0 auto;
}

.single-pack .pack-download-wrap {
	margin-bottom: 20px;
}

.single-pack .pack-description {
	color: var(--text-secondary);
	font-size: 15px;
	line-height: 1.7;
	max-width: 70ch;
	margin-bottom: 28px;
}

.sticker-gallery {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
	margin-bottom: 32px;
}

.sticker-gallery li {
	aspect-ratio: 1 / 1;
	border-radius: var(--radius-card);
	overflow: hidden;
	background: #000;
	cursor: pointer;
	position: relative;
	transition: transform 0.15s ease;
}

.sticker-gallery li:hover {
	transform: scale(1.03);
	z-index: 2;
}

.sticker-gallery .sticker-thumb-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #000;
	display: block;
	transition: transform 0.15s ease, opacity 0.2s ease;
	opacity: 0;
}

/* Fade in once the image has loaded */
.sticker-gallery .sticker-thumb-img[src] {
	opacity: 1;
}

/* Scale up slightly on hover — animation plays automatically
   once the WebP file is loaded, no JS swap needed */
.sticker-gallery li:hover .sticker-thumb-img {
	transform: scale(1.05);
}

.related-packs-heading {
	font-size: 18px;
	margin-bottom: 16px;
}

/* Explicit colour reset — prevents red cascade from card styles */
.single-pack {
	color: var(--text-primary);
}

.single-pack .pack-title {
	color: var(--text-primary);
	font-size: 26px;
	font-weight: 700;
	line-height: 1.25;
	margin: 8px 0 16px;
}

.single-pack .pack-description {
	color: var(--text-secondary);
}

.single-pack .breadcrumb-nav,
.single-pack .breadcrumb-nav a {
	color: var(--text-secondary);
}

.single-pack .breadcrumb-nav a:hover {
	color: var(--text-primary);
}

.single-pack .related-packs-heading {
	color: var(--text-primary);
}

/* =========================================================
   9b. STATIC PAGE / ARCHIVE DESCRIPTION TYPOGRAPHY
   ========================================================= */
.page-content,
.archive-description {
	color: var(--text-secondary);
	font-size: 15px;
	line-height: 1.7;
	max-width: 70ch;
	margin-bottom: 24px;
}

.page-content a,
.archive-description a {
	color: var(--accent-orange);
	text-decoration: underline;
}

.archive-title {
	font-size: 22px;
	margin: 16px 0;
}

/* =========================================================
   10. SIDEBAR
   ========================================================= */
.site-sidebar {
	display: none;
}

.sidebar-widget {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-card);
	padding: 16px;
	margin-bottom: 16px;
}

.sidebar-widget h3 {
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--text-secondary);
	margin-bottom: 12px;
}

.sidebar-category-list li {
	display: flex;
	justify-content: space-between;
	padding: 6px 0;
	font-size: 14px;
	border-bottom: 1px solid var(--border);
}

.sidebar-category-list li:last-child {
	border-bottom: 0;
}

.sidebar-category-list .cat-count {
	color: var(--text-secondary);
}

/* =========================================================
   11. FOOTER
   ========================================================= */
.site-footer {
	border-top: 1px solid var(--border);
	padding: 32px 0;
	color: var(--text-secondary);
	font-size: 13px;
}

.site-footer .footer-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 16px;
}

.site-footer .footer-nav a:hover {
	color: var(--text-primary);
}

/* =========================================================
   12. AD ZONES (v1 — empty placeholders)
   ========================================================= */
.flirty-ad-zone {
	background: var(--bg-ad-zone);
	border: 1px dashed var(--border);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 20px auto;
	overflow: hidden;
}

/* Ad label is visually hidden in v1 but present for future GPT insertion */
.flirty-ad-zone::after {
	content: "";
}

.flirty-ad-zone[data-zone="flirty-ad-header"],
.flirty-ad-zone[data-zone="flirty-ad-before-related"],
.flirty-ad-zone[data-zone="flirty-ad-footer"] {
	max-width: 320px;
	height: 50px;
}

.flirty-ad-zone[data-zone="flirty-ad-sidebar-top"],
.flirty-ad-zone[data-zone="flirty-ad-in-content"] {
	max-width: 300px;
	height: 250px;
}

.flirty-ad-zone[data-zone="flirty-ad-sidebar-mid"] {
	max-width: 300px;
	height: 600px;
}

@media (min-width: 768px) {
	.flirty-ad-zone[data-zone="flirty-ad-header"],
	.flirty-ad-zone[data-zone="flirty-ad-before-related"],
	.flirty-ad-zone[data-zone="flirty-ad-footer"] {
		max-width: 728px;
		height: 90px;
	}
}

@media (min-width: 1400px) {
	.flirty-ad-zone[data-zone="flirty-ad-header"] {
		max-width: 970px;
	}
}

/* =========================================================
   13. PAGINATION
   ========================================================= */
.pack-pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	padding: 24px 0;
}

.pack-pagination a,
.pack-pagination span {
	padding: 8px 14px;
	border: 1px solid var(--border);
	border-radius: 4px;
	font-size: 14px;
	color: var(--text-secondary);
}

.pack-pagination .current {
	background: var(--accent-red);
	border-color: var(--accent-red);
	color: #fff;
}

.pack-pagination a:hover {
	background: var(--bg-card);
	color: var(--text-primary);
}

/* =========================================================
   14. NO RESULTS / 404
   ========================================================= */
.no-results,
.error-404-content {
	text-align: center;
	padding: 64px 16px;
	color: var(--text-secondary);
}

.no-results h2,
.error-404-content h1 {
	color: var(--text-primary);
	margin-bottom: 12px;
}

/* =========================================================
   15. RESPONSIVE BREAKPOINTS
   ========================================================= */

/* 480–768px: 2 columns (base already 2 columns; widen gaps slightly) */
@media (min-width: 480px) {
	.sticker-grid {
		gap: 18px;
	}
}

/* 768–1024px: 3 columns */
@media (min-width: 768px) {
	.sticker-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.sticker-gallery {
		grid-template-columns: repeat(3, 1fr);
	}

	.main-navigation {
		display: block;
	}

	.menu-toggle {
		display: none;
	}
}

/* 1024–1400px: 4 columns, sidebar appears at 260px right */
@media (min-width: 1024px) {
	.sticker-grid {
		grid-template-columns: repeat(4, 1fr);
	}

	.content-wrap {
		grid-template-columns: 1fr var(--sidebar-width);
	}

	.site-sidebar {
		display: block;
	}

	.sticker-gallery {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* >1400px: 5 columns */
@media (min-width: 1400px) {
	.sticker-grid {
		grid-template-columns: repeat(5, 1fr);
	}

	.sticker-gallery {
		grid-template-columns: repeat(5, 1fr);
	}
}
