/*
Theme Name: Penny Finder
Theme URI: https://finds.stardewvalleymods.org/
Author: Haripria.AI
Description: A 3-step penny deal finder (store, category, products) built for Facebook traffic and ad revenue. Includes a Penny Item post type, store/category sections, ad slots, a weekly CSV import tool and starter pages.
Version: 1.2.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: penny-finder
*/

:root {
	--pf-ground: #F4F2EE;
	--pf-card: #FFFFFF;
	--pf-ink: #111110;
	--pf-muted: #5C5852;
	--pf-faint: #6E6A63;
	--pf-line: #CFC8BD;
	--pf-copper: #B4532A;
	--pf-copper-ink: #9A3F1C;
	--pf-copper-soft: #F6E3D8;
	--pf-tray: rgba(17, 17, 16, 0.04);
	--pf-shadow: 0 12px 32px rgba(17, 17, 16, 0.06);
	--pf-ease: cubic-bezier(.32, .72, 0, 1);
	--pf-r-tray: 28px;
	--pf-r-card: 22px;
}

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

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

body {
	margin: 0;
	background: var(--pf-ground);
	color: var(--pf-ink);
	font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
	font-size: 16px;
	line-height: 1.55;
}

a { color: var(--pf-copper-ink); }
a:hover { color: #7A2E12; }
img { max-width: 100%; height: auto; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: 8px; left: 8px; z-index: 100;
	width: auto; height: auto; clip: auto;
	padding: 10px 16px; background: var(--pf-ink); color: #fff; border-radius: 999px;
}

:focus-visible { outline: 2px solid var(--pf-copper); outline-offset: 2px; }

.pf-wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Island nav */
.pf-nav {
	margin: 16px auto 0;
	max-width: 1088px;
	padding: 6px 6px 6px 16px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.88);
	box-shadow: 0 8px 30px rgba(17, 17, 16, 0.06);
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.pf-nav-wrap { padding: 0 16px; }
.pf-brand {
	display: flex; align-items: center; gap: 8px;
	text-decoration: none; color: var(--pf-ink);
	font-weight: 800; font-size: 17px; letter-spacing: -0.02em;
}
.pf-brand:hover { color: var(--pf-ink); }
.pf-crumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--pf-muted); min-width: 0; }
.pf-crumb strong { color: var(--pf-ink); }
.pf-round {
	width: 44px; height: 44px; flex-shrink: 0;
	border-radius: 999px; border: 0; background: var(--pf-ground);
	display: inline-flex; align-items: center; justify-content: center;
	color: var(--pf-ink); cursor: pointer;
}
.pf-menu { position: relative; }
.pf-menu-panel {
	position: absolute; right: 0; top: 52px; z-index: 30;
	min-width: 220px; padding: 8px;
	background: #fff; border-radius: 20px; box-shadow: var(--pf-shadow);
	display: none;
}
.pf-menu.is-open .pf-menu-panel { display: block; }
.pf-menu-panel a {
	display: block; padding: 12px 14px; border-radius: 14px;
	text-decoration: none; color: var(--pf-ink); font-weight: 600; font-size: 15px;
}
.pf-menu-panel a:hover { background: var(--pf-ground); }

/* Layout */
.pf-main { padding: 28px 0 120px; }
.pf-stack { display: flex; flex-direction: column; gap: 28px; }

.pf-eyebrow {
	align-self: flex-start;
	display: inline-block;
	padding: 6px 12px; border-radius: 999px;
	background: #E9E4DC; color: var(--pf-muted);
	font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.pf-eyebrow--copper { background: var(--pf-copper-soft); color: var(--pf-copper-ink); }

.pf-hero { display: flex; flex-direction: column; gap: 14px; }
.pf-hero h1 {
	margin: 0; font-weight: 800; letter-spacing: -0.035em; line-height: 1.04;
	font-size: clamp(32px, 7vw, 56px);
}
.pf-hero p { margin: 0; color: var(--pf-muted); font-size: 16px; max-width: 560px; }
.pf-accent { color: var(--pf-copper); }

.pf-section { display: flex; flex-direction: column; gap: 14px; }
.pf-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pf-section h2 { margin: 0; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.pf-step { font-size: 13px; font-weight: 600; color: var(--pf-muted); white-space: nowrap; }

/* Double bezel */
.pf-tray { padding: 6px; border-radius: var(--pf-r-tray); background: var(--pf-tray); }
.pf-core {
	border-radius: var(--pf-r-card); background: var(--pf-card);
	box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), var(--pf-shadow);
}

.pf-tap { display: block; text-decoration: none; color: var(--pf-ink); transition: transform 600ms var(--pf-ease); }
.pf-tap:hover { color: var(--pf-ink); }
.pf-tap:active { transform: scale(.98); }
.pf-arrow {
	width: 32px; height: 32px; flex-shrink: 0;
	border-radius: 999px; background: var(--pf-ground);
	display: inline-flex; align-items: center; justify-content: center;
	transition: transform 600ms var(--pf-ease);
}
.pf-arrow--dark { width: 36px; height: 36px; background: var(--pf-ink); color: var(--pf-ground); }
.pf-arrow--copper { width: 44px; height: 44px; background: var(--pf-copper); color: #fff; }
.pf-tap:hover .pf-arrow { transform: translate(2px, -1px) scale(1.05); }

/* Store grid */
.pf-store-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pf-store .pf-core {
	min-height: 172px; padding: 16px;
	display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
}
.pf-store-top { display: flex; align-items: flex-start; justify-content: space-between; }
.pf-mono {
	width: 40px; height: 40px; border-radius: 14px;
	display: inline-flex; align-items: center; justify-content: center;
	font-weight: 800; font-size: 14px;
}
.pf-store-name { display: block; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; line-height: 1.2; }
.pf-store-deal { display: block; font-size: 13px; color: var(--pf-muted); margin-top: 4px; }

/* Category rows */
.pf-cat .pf-core { padding: 14px; display: flex; align-items: center; gap: 14px; }
.pf-thumb {
	width: 64px; height: 64px; flex-shrink: 0; border-radius: 16px;
	background: var(--pf-copper-soft); color: var(--pf-copper-ink);
	display: inline-flex; align-items: center; justify-content: center;
}
.pf-cat-text { display: flex; flex-direction: column; gap: 3px; flex-grow: 1; min-width: 0; }
.pf-cat-name { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.pf-cat-count { font-size: 14px; color: var(--pf-muted); }
.pf-cat-empty {
	padding: 14px 18px; border-radius: var(--pf-r-card); border: 1px dashed var(--pf-line);
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	font-weight: 600; font-size: 15px; color: var(--pf-muted);
}
.pf-cat-empty span:last-child { font-weight: 500; font-size: 13px; color: var(--pf-faint); }
.pf-cat-list { display: flex; flex-direction: column; gap: 12px; }

/* Items */
.pf-items { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.pf-item .pf-core { padding: 14px; display: flex; flex-direction: column; gap: 12px; height: 100%; }
.pf-item-top { display: flex; gap: 14px; }
.pf-item-thumb {
	width: 76px; height: 76px; flex-shrink: 0; border-radius: 16px;
	background: var(--pf-copper-soft); color: var(--pf-copper-ink); overflow: hidden;
	display: inline-flex; align-items: center; justify-content: center;
}
.pf-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pf-item-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pf-item-name { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.3; letter-spacing: -0.01em; }
.pf-price-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-price {
	display: inline-block; padding: 4px 10px; border-radius: 999px;
	background: var(--pf-copper); color: #fff; font-weight: 800; font-size: 14px;
}
.pf-reg { font-size: 13px; color: var(--pf-faint); text-decoration: line-through; }
.pf-upc {
	margin-top: auto;
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	padding: 8px 8px 8px 14px; border-radius: 999px; background: var(--pf-ground);
}
.pf-upc-num { font-size: 16px; font-weight: 700; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pf-btn-dark {
	min-height: 36px; padding: 0 14px; border-radius: 999px; border: 0;
	background: var(--pf-ink); color: var(--pf-ground);
	font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap;
	transition: transform 600ms var(--pf-ease);
}
.pf-btn-dark:active { transform: scale(.98); }
.pf-btn-dark.is-done { background: var(--pf-copper); color: #fff; }

.pf-note {
	margin: 0; padding: 14px 16px; border-radius: 18px;
	background: var(--pf-ink); color: var(--pf-ground); font-size: 14px; line-height: 1.55;
}
.pf-panel { margin: 0; padding: 16px 18px; border-radius: 20px; background: #fff; font-size: 15px; line-height: 1.6; color: #3A3733; }

/* Dark feature + next cards */
.pf-feature .pf-core-dark {
	padding: 22px 18px; border-radius: var(--pf-r-card); background: var(--pf-ink); color: var(--pf-ground);
	display: flex; flex-direction: column; gap: 16px;
}
.pf-pill-dark {
	align-self: flex-start; padding: 5px 10px; border-radius: 999px;
	background: rgba(255, 255, 255, 0.1); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.pf-feature-name { font-weight: 700; font-size: 20px; line-height: 1.25; letter-spacing: -0.02em; }
.pf-feature-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pf-feature-price { font-weight: 800; font-size: 30px; color: #F2A27A; }
.pf-pill-btn {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 6px 6px 6px 16px; border-radius: 999px;
	background: var(--pf-ground); color: var(--pf-ink); font-weight: 700; font-size: 14px; text-decoration: none;
	min-height: 44px;
}
.pf-pill-btn .pf-arrow { background: #E2DCD2; }
.pf-next .pf-core-dark {
	padding: 20px 18px; border-radius: var(--pf-r-card); background: var(--pf-ink); color: var(--pf-ground);
	display: flex; align-items: center; gap: 14px;
}
.pf-next-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #BDB6AA; }
.pf-next-title { display: block; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; margin-top: 4px; }

.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chip {
	display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
	padding: 6px 16px; border-radius: 999px; background: #fff;
	color: var(--pf-ink); text-decoration: none; font-weight: 600; font-size: 14px;
	transition: transform 600ms var(--pf-ease);
}
.pf-chip:hover { color: var(--pf-ink); }
.pf-chip:active { transform: scale(.98); }

.pf-how { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 20px; background: #fff; }
.pf-how-num {
	width: 28px; height: 28px; flex-shrink: 0; border-radius: 999px;
	background: var(--pf-copper-soft); color: var(--pf-copper-ink);
	font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center;
}
.pf-how strong { display: block; font-size: 15px; }
.pf-how span span { display: block; font-size: 14px; color: var(--pf-muted); }

/* Ads */
.pf-ad { display: flex; flex-direction: column; gap: 6px; align-items: center; margin: 4px 0; min-width: 0; }
.pf-ad-label { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pf-faint); }
.pf-ad-slot { width: 100%; display: flex; justify-content: center; overflow: hidden; }
.pf-ad--top { margin: 16px auto 0; max-width: 1088px; padding: 0 16px; }
.pf-items .pf-ad { grid-column: 1 / -1; }

/* Generic content (pages) */
.pf-content { background: #fff; border-radius: var(--pf-r-card); padding: 24px 20px; }
.pf-content h1 { margin-top: 0; font-size: clamp(28px, 5vw, 40px); letter-spacing: -0.03em; line-height: 1.1; }
.pf-content h2 { font-size: 20px; margin-top: 28px; }

/* Footer */
.pf-footer { border-top: 1px solid #E5DFD5; padding: 24px 0 96px; font-size: 13px; color: var(--pf-muted); }
.pf-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; }

/* Entry animation (transform + opacity only) */
@keyframes pf-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.pf-rise { animation: pf-rise 900ms var(--pf-ease) both; }
@media (prefers-reduced-motion: reduce) {
	.pf-rise { animation: none; }
	.pf-tap, .pf-arrow, .pf-chip, .pf-btn-dark { transition: none; }
}

@media (min-width: 720px) {
	.pf-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pf-cat-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pf-content { padding: 40px; }
}
@media (min-width: 960px) {
	.pf-store-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.pf-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.pf-main { padding-top: 48px; }
}

/* v1.1: logos, deal labels, savings, freshness, guides, disclosure */
.pf-logo {
	display: inline-flex; align-items: center; justify-content: flex-start;
	height: 44px; max-width: 132px;
}
.pf-logo img { max-height: 44px; max-width: 132px; width: auto; height: auto; object-fit: contain; display: block; }
.pf-hero .pf-logo { height: 52px; max-width: 180px; }
.pf-hero .pf-logo img { max-height: 52px; max-width: 180px; }
.pf-hero .pf-mono { width: 52px; height: 52px; border-radius: 16px; font-size: 16px; }
.pf-logo--sm { height: 16px; max-width: 64px; margin-right: 6px; }
.pf-logo--sm img { max-height: 16px; max-width: 64px; }
.pf-item-store { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--pf-muted); }

.pf-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-type {
	padding: 4px 10px; border-radius: 999px;
	font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
	background: var(--pf-copper-soft); color: var(--pf-copper-ink);
}
.pf-type--surprise { background: #F3ECD6; color: #6B5414; }
.pf-type--clearance { background: #E3E8EF; color: #2F4566; }
.pf-new { padding: 4px 10px; border-radius: 999px; background: var(--pf-ink); color: var(--pf-ground); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.pf-ago { margin-left: auto; font-size: 12px; color: var(--pf-faint); }
.pf-reg { text-decoration: line-through; }
.pf-off {
	padding: 3px 9px; border-radius: 999px; border: 1.5px solid var(--pf-copper);
	color: var(--pf-copper-ink); font-weight: 700; font-size: 12px;
}

.pf-disclosure { margin: 0; font-size: 12px; line-height: 1.5; color: var(--pf-faint); max-width: 560px; }

.pf-guides { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.pf-guide {
	display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 20px; background: #fff;
	font-weight: 700; font-size: 15px; line-height: 1.3;
}
.pf-guide img, .pf-guide-icon {
	width: 64px; height: 64px; flex-shrink: 0; border-radius: 14px; object-fit: cover;
	background: var(--pf-copper-soft); color: var(--pf-copper-ink);
	display: inline-flex; align-items: center; justify-content: center;
}
@media (min-width: 720px) { .pf-guides { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pf-hero .pf-disclosure { font-size: 12px; color: var(--pf-faint); }
.pf-store .pf-logo { max-width: 92px; height: 40px; }
.pf-store .pf-logo img { max-width: 92px; max-height: 40px; }
.pf-brand img, .pf-nav .custom-logo { display: block; height: 40px; width: auto; }
.pf-nav .custom-logo-link { display: flex; align-items: center; }
