/* Daily Offer and Advent Calendar — frontend.
   Clean black-and-white scheme. Colors come from CSS variables (pushed inline by the
   renderer) so the modal, moved to <body>, inherits the same values. */

.pn-calendar {
	--pn-bg: #ffffff;
	--pn-card: #ffffff;
	--pn-border: #111111;
	--pn-ink: #111111;
	--pn-muted: #555555;
	--pn-cta: #111111;
	--pn-coupon-bg: #f2f2f2;
	background: var(--pn-bg);
	border-radius: 22px;
	padding: 40px 28px 48px;
	max-width: 1000px;
	margin: 0 auto;
	box-sizing: border-box;
}

.pn-title {
	text-align: center;
	color: var(--pn-ink);
	margin: 0 0 6px;
	font-size: 26px;
	line-height: 1.2;
	font-weight: 700;
}
.pn-subtitle {
	text-align: center;
	color: var(--pn-muted);
	margin: 0 0 10px;
	font-size: 15px;
}
.pn-intro {
	text-align: center;
	color: var(--pn-muted);
	margin: 0 0 10px;
	font-size: 15px;
	line-height: 1.55;
}
.pn-intro p { margin: 0 0 8px; }
.pn-intro p:last-child { margin-bottom: 0; }
.pn-intro a { color: var(--pn-cta); text-decoration: underline; }
.pn-startinfo {
	text-align: center;
	color: var(--pn-ink);
	margin: 0 0 30px;
	font-size: 14px;
	font-weight: 600;
	opacity: .85;
}

.pn-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(110px, 144px));
	justify-content: center;
	gap: 16px;
}

.pn-card {
	position: relative;
	aspect-ratio: 3 / 4;
	background: var(--pn-card);
	border: 2px solid var(--pn-border);
	border-radius: 10px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 10px;
	box-sizing: border-box;
	overflow: hidden;
	width: 100%;
	font: inherit;
	cursor: default;
}

/* THEME-PROOF: open cards are <button>s. Some themes bleed their button styling through.
   Hard-reset it so cards look like cards, not buttons. */
.pn-calendar button.pn-card {
	-webkit-appearance: none;
	appearance: none;
	font: inherit;
	color: var(--pn-ink);
	text-transform: none;
	letter-spacing: normal;
	line-height: normal;
	text-shadow: none;
	box-shadow: none;
	min-height: 0;
	background: var(--pn-card) !important;
}
button.pn-card.is-open {
	cursor: pointer;
	transition: transform .12s ease, box-shadow .12s ease;
}
.pn-calendar button.pn-card.is-open:hover,
.pn-calendar button.pn-card.is-open:focus {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0,0,0,.12);
	background: var(--pn-card) !important;
	color: var(--pn-ink);
	outline: none;
}
.pn-open-hint {
	font-size: 12px;
	color: var(--pn-cta);
	font-weight: 600;
}

/* Festive icon (advent mode): fills the card; the number and lock sit above it. */
.pn-cover {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 12px;
	box-sizing: border-box;
	z-index: 0;
	border-radius: inherit;
}

.pn-num {
	position: absolute;
	top: 8px;
	right: 10px;
	z-index: 2;
	font-size: 13px;
	color: var(--pn-ink);
	font-weight: 600;
	background: rgba(255, 255, 255, 0.82);
	border-radius: 10px;
	padding: 1px 7px;
	line-height: 1.5;
}

.pn-lock {
	position: relative;
	z-index: 2;
	color: var(--pn-ink);
	opacity: 0.6;
}

.pn-card.is-locked {
	background: #ffffff;
}
/* When a locked card carries a festive icon, a subtle dimmer keeps the lock readable. */
.pn-card.is-locked:has(.pn-cover)::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	background: rgba(255, 255, 255, 0.35);
	border-radius: inherit;
}

/* ---- Modal ---- */
body.pn-modal-open { overflow: hidden; }

.pn-modal[hidden] { display: none; }
.pn-modal {
	--pn-bg: #ffffff;
	--pn-border: #111111;
	--pn-ink: #111111;
	--pn-muted: #555555;
	--pn-cta: #111111;
	--pn-coupon-bg: #f2f2f2;
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.pn-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 24, 40, 0.55);
}
.pn-modal-box {
	position: relative;
	z-index: 1;
	background: var(--pn-bg);
	border: 3px solid var(--pn-border);
	border-radius: 16px;
	max-width: 620px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	padding: 40px 34px 32px;
	text-align: center;
	box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.pn-modal-close {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	top: 12px;
	right: 12px;
	width: 34px;
	height: 34px;
	min-height: 0;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: var(--pn-ink) !important;
	color: #fff !important;
	font-size: 20px;
	line-height: 34px;
	text-align: center;
	box-shadow: none;
	cursor: pointer;
}
.pn-full .pn-img {
	background: transparent;
	border: 0;
	box-shadow: none;
	border-radius: 10px;
}
/* Keep the opened image inside the modal for BOTH portrait and landscape, even when a
   theme's global img rules (e.g. forced width/height) would otherwise defeat the cap.
   Higher specificity + !important wins over a theme that loads after this stylesheet;
   a landscape image stays short via max-width, a portrait one via max-height. The modal
   is moved to <body>, so the selectors cover it both inside .pn-modal and standalone. */
.pn-modal .pn-modal-box .pn-full img.pn-img,
.pn-modal-body .pn-full img.pn-img,
.pn-full img.pn-img {
	max-width: 100% !important;
	width: auto !important;
	height: auto !important;
	max-height: 38vh !important;
	object-fit: contain !important;
	display: block !important;
	margin: 0 auto 10px !important;
}
.pn-vendor {
	font-size: 13px;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--pn-cta);
	font-weight: 700;
	margin-top: 6px;
}
.pn-full-title {
	font-size: 22px;
	color: var(--pn-ink);
	margin: 6px 0 12px;
	line-height: 1.25;
}
.pn-full-body {
	font-size: 15px;
	line-height: 1.55;
	color: #3a4256;
	text-align: left;
}
.pn-full-body p { margin: 0 0 10px; }
.pn-coupon-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 16px;
	flex-wrap: wrap;
}
.pn-coupon {
	display: inline-block;
	font-weight: 700;
	letter-spacing: 0.06em;
	background: var(--pn-coupon-bg, #f2f2f2);
	color: var(--pn-ink);
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 13px;
}
.pn-copy {
	-webkit-appearance: none;
	appearance: none;
	border: 0;
	background: var(--pn-ink) !important;
	color: #fff !important;
	font-size: 12px;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 6px;
	box-shadow: none;
	cursor: pointer;
}
.pn-cta {
	display: inline-block;
	margin-top: 16px;
	background: var(--pn-cta) !important;
	color: #fff !important;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 22px;
	border-radius: 40px;
	box-shadow: none;
}

@media (max-width: 640px) {
	.pn-grid { gap: 10px; }
	.pn-calendar { padding: 28px 16px 34px; }
}
