/* ============================================================
 * 命名書ページ (page-naming-certificate.php)
 * ============================================================ */

/* ─── Layout ─── */
.pmn-cert-page {
	padding-top: 2rem;
	padding-bottom: 4rem;
}

.pmn-cert-bc {
	font-size: 0.78rem;
	color: #8A8A8A;
	margin-bottom: 1.5rem;
}
.pmn-cert-bc a { color: #6FB3D2; text-decoration: none; }
.pmn-cert-bc .sep { margin: 0 0.4em; }

.pmn-cert-hero {
	text-align: center;
	margin-bottom: 2rem;
}
.pmn-cert-hero .eyebrow {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	color: #6FB3D2;
	text-transform: uppercase;
	margin-bottom: 0.4rem;
}
.pmn-cert-hero h1 {
	font-size: 1.5rem;
	font-weight: 700;
	color: #3D3D3D;
	margin: 0 0 0.5rem;
}
.pmn-cert-hero p {
	font-size: 0.85rem;
	color: #8A8A8A;
	margin: 0;
}

/* ─── Main layout (form + preview) ─── */
.pmn-cert-body {
	display: grid;
	grid-template-columns: 320px 1fr;
	gap: 2rem;
	align-items: start;
}
@media (max-width: 900px) {
	.pmn-cert-body {
		grid-template-columns: 1fr;
	}
}

/* ─── Settings panel ─── */
.pmn-cert-form {
	background: #fff;
	border: 1px solid #EDE7DC;
	border-radius: 16px;
	padding: 1.5rem;
	position: sticky;
	top: 80px;
}
.pmn-cert-form h2 {
	font-size: 0.9rem;
	font-weight: 700;
	color: #3D3D3D;
	margin: 0 0 1.25rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #EDE7DC;
}
.pmn-cert-field {
	margin-bottom: 1rem;
}
.pmn-cert-field label {
	display: block;
	font-size: 0.78rem;
	font-weight: 700;
	color: #8A8A8A;
	margin-bottom: 0.35rem;
}
.pmn-cert-field input[type="text"],
.pmn-cert-field input[type="date"],
.pmn-cert-field textarea {
	width: 100%;
	padding: 0.55rem 0.75rem;
	border: 1px solid #EDE7DC;
	border-radius: 10px;
	font-family: inherit;
	font-size: 0.9rem;
	color: #3D3D3D;
	background: #FDFBF7;
	box-sizing: border-box;
	transition: border-color 0.15s;
}
.pmn-cert-field input:focus,
.pmn-cert-field textarea:focus {
	outline: none;
	border-color: #6FB3D2;
	box-shadow: 0 0 0 3px rgba(111,179,210,.15);
}
.pmn-cert-field textarea {
	resize: vertical;
	min-height: 72px;
	line-height: 1.6;
}

/* Gender radio */
.pmn-cert-gender-row {
	display: flex;
	gap: 0.5rem;
}
.pmn-cert-gender-opt {
	flex: 1;
}
.pmn-cert-gender-opt input[type="radio"] {
	display: none;
}
.pmn-cert-gender-opt label {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.45rem 0.25rem;
	border: 1px solid #EDE7DC;
	border-radius: 9px;
	font-size: 0.78rem;
	font-weight: 600;
	color: #8A8A8A;
	cursor: pointer;
	transition: background 0.12s, border-color 0.12s, color 0.12s;
	margin: 0;
}
.pmn-cert-gender-opt input:checked + label {
	border-color: #6FB3D2;
	background: #E3F0F7;
	color: #3D3D3D;
}
.pmn-cert-gender-opt.boy input:checked + label  { background: #E5F0F8; border-color: #A8CDE8; color: #4A7BA0; }
.pmn-cert-gender-opt.girl input:checked + label { background: #FBE7EC; border-color: #F5C2D1; color: #B5708B; }

.pmn-cert-print-btn {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 0.8rem 1rem;
	background: #6FB3D2;
	color: #fff;
	font-family: 'Zen Maru Gothic', sans-serif;
	font-size: 0.95rem;
	font-weight: 700;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	margin-top: 1.25rem;
	transition: background 0.15s, transform 0.1s;
}
.pmn-cert-print-btn:hover { background: #5BA0C2; }
.pmn-cert-print-btn:active { transform: translateY(1px); }
.pmn-cert-print-btn svg { width: 16px; height: 16px; }

.pmn-cert-tip {
	font-size: 0.72rem;
	color: #8A8A8A;
	text-align: center;
	margin-top: 0.5rem;
	line-height: 1.5;
}

/* ─── Certificate preview wrapper ─── */
.pmn-cert-preview-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* ─── The certificate itself ─── */
.pmn-cert {
	width: 100%;
	max-width: 560px;
	aspect-ratio: 1 / 1.414; /* A4 portrait ratio */
	background: #FDFBF7;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2.5rem;
	box-sizing: border-box;
	box-shadow: 0 4px 24px rgba(0,0,0,0.10);

	/* Outer decorative border */
	border: 2px solid #C8B49A;
}

/* Inner border via pseudo-element */
.pmn-cert::before {
	content: '';
	position: absolute;
	inset: 8px;
	border: 1px solid #DDD0BA;
	pointer-events: none;
}

/* Corner ornaments */
.pmn-cert::after {
	content: '';
	position: absolute;
	inset: 4px;
	background:
		radial-gradient(circle at 0 0, transparent 12px, #C8B49A 12px, #C8B49A 13px, transparent 13px),
		radial-gradient(circle at 100% 0, transparent 12px, #C8B49A 12px, #C8B49A 13px, transparent 13px),
		radial-gradient(circle at 0 100%, transparent 12px, #C8B49A 12px, #C8B49A 13px, transparent 13px),
		radial-gradient(circle at 100% 100%, transparent 12px, #C8B49A 12px, #C8B49A 13px, transparent 13px);
	pointer-events: none;
}

/* ─── Certificate stamp ─── */
.pmn-cert__stamp {
	font-family: 'Zen Maru Gothic', serif;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.25em;
	color: #C85A47;
	border: 2px solid #C85A47;
	border-radius: 50%;
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 1.25rem;
	position: relative;
	z-index: 1;
}

/* ─── Name display ─── */
.pmn-cert__kana {
	font-size: 0.75rem;
	letter-spacing: 0.25em;
	color: #8A8A8A;
	margin-bottom: 0.35rem;
	position: relative;
	z-index: 1;
}

.pmn-cert__kanji {
	font-family: 'Zen Maru Gothic', serif;
	font-size: 4rem;
	font-weight: 700;
	color: #3D3D3D;
	line-height: 1.15;
	letter-spacing: 0.08em;
	text-align: center;
	margin-bottom: 0.5rem;
	position: relative;
	z-index: 1;
}
@media (max-width: 600px) {
	.pmn-cert__kanji { font-size: 3rem; }
}

.pmn-cert__divider {
	width: 80px;
	height: 1px;
	background: linear-gradient(to right, transparent, #C8B49A, transparent);
	margin: 0.9rem auto;
	position: relative;
	z-index: 1;
}

/* ─── Birth date ─── */
.pmn-cert__birth {
	font-size: 0.8rem;
	color: #8A8A8A;
	letter-spacing: 0.08em;
	margin-bottom: 0.5rem;
	position: relative;
	z-index: 1;
}
.pmn-cert__birth-val {
	font-family: 'Inter', sans-serif;
	font-size: 0.9rem;
	font-weight: 600;
	color: #3D3D3D;
}

/* ─── Message ─── */
.pmn-cert__message-wrap {
	margin-top: 0.75rem;
	padding: 0.75rem 1rem;
	border-top: 1px dashed #DDD0BA;
	width: 100%;
	text-align: center;
	position: relative;
	z-index: 1;
}
.pmn-cert__message-label {
	font-size: 0.65rem;
	color: #8A8A8A;
	letter-spacing: 0.1em;
	margin-bottom: 0.3rem;
}
.pmn-cert__message-text {
	font-size: 0.82rem;
	color: #3D3D3D;
	line-height: 1.7;
	white-space: pre-wrap;
	word-break: break-all;
}

/* ─── Branding ─── */
.pmn-cert__brand {
	position: absolute;
	bottom: 22px;
	right: 22px;
	font-size: 0.6rem;
	color: #C8B49A;
	letter-spacing: 0.08em;
	z-index: 1;
}

/* ─── Print styles ─── */
@media print {
	/* Hide everything except the certificate */
	header, footer, nav,
	.pmn-cert-bc,
	.pmn-cert-hero,
	.pmn-cert-form,
	.pmn-cert-tip,
	.pmn-cert-print-btn { display: none !important; }

	body, html {
		background: white !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.pmn-cert-page { padding: 0 !important; }
	.pmn-cert-body { display: block !important; }
	.pmn-cert-preview-wrap { display: block !important; }

	.pmn-cert {
		width: 100% !important;
		max-width: 100% !important;
		height: 100vh !important;
		aspect-ratio: unset !important;
		box-shadow: none !important;
		page-break-inside: avoid;
		padding: 3cm !important;
	}
	.pmn-cert__kanji {
		font-size: 5rem !important;
	}
}
