/* ===================================================================
   6. FORMS
================================================================== */

form {
	margin: 3rem 0;
	/* fallback for var(--space-xl) */
	margin: var(--space-xl) 0;
	padding: 1.5rem;
	/* fallback for var(--space-lg) */
	padding: var(--space-lg);
	background: #f2e5bc;
	/* fallback */
	background: var(--panel);
	border: 1px solid #7c6f64;
	/* fallback */
	border: 1px solid var(--border);
	border-radius: 4px;
}

.form-group {
	margin-bottom: 1rem;
	/* fallback for var(--space-md) */
	margin-bottom: var(--space-md);
}

label {
	display: block;
	margin-bottom: 0.5rem;
	/* fallback for var(--space-xs) */
	margin-bottom: var(--space-xs);
	font-weight: 600;
	color: #3c3836;
	/* fallback */
	color: var(--fg);
}

input[type="text"],
input[type="email"],
textarea {
	width: 100%;
	padding: 0.75rem;
	/* fallback for var(--space-sm) */
	padding: var(--space-sm);
	border: 1px solid #7c6f64;
	/* fallback */
	border: 1px solid var(--border);
	border-radius: 4px;
	background: #fbf1c7;
	/* fallback */
	background: var(--bg);
	color: #3c3836;
	/* fallback */
	color: var(--fg);
	font-family: inherit;
	font-size: 0.9rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
	outline: none;
	border-color: #cc241d;
	/* fallback */
	border-color: var(--accent-primary);
	box-shadow: 0 0 0 2px rgba(204, 36, 29, 0.2);
}

textarea {
	resize: vertical;
	min-height: 120px;
}

/* Enhanced button animations */
button {
	background: #cc241d;
	/* fallback */
	background: var(--accent-primary);
	color: #fbf1c7;
	/* fallback */
	color: var(--bg);
	border: none;
	padding: 0.75rem 2rem;
	/* fallback for var(--space-sm) var(--space-lg) */
	padding: var(--space-sm) var(--space-lg);
	border-radius: 4px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 150ms ease, box-shadow 200ms ease;
	position: relative;
	overflow: hidden;
	will-change: transform, box-shadow;
}

button::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.3);
	transform: translate(-50%, -50%);
	transition: width 0.6s ease, height 0.6s ease;
}

button:hover {
	background: #9d0006;
	/* fallback */
	background: var(--link-hover);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(204, 36, 29, 0.3);
}

button:active {
	transform: translateY(0) scale(0.98);
	transition: transform 100ms ease;
}

button:active::before {
	width: 300px;
	height: 300px;
}

/* Newsletter signup */
.newsletter-signup {
	background: #f9f5d7;
	/* fallback */
	background: var(--bg-alt);
	border: 2px solid #7c6f64;
	/* fallback */
	border: 2px solid var(--border);
	border-radius: 8px;
	padding: 0.9rem 1rem;
	margin: 1rem auto 0;
	max-width: 70rem;
}

.newsletter-signup h3 {
	margin: 0 0 0.25rem;
	font-family: 'Public Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
	font-size: 1.05rem;
}

.newsletter-signup p {
	color: #665c54;
	/* fallback */
	color: var(--muted);
}

.embeddable-buttondown-form {
	background: none;
	margin: 0;
	padding: 0;
	border: 0px;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.5rem;
	align-items: end;
}

.embeddable-buttondown-form label:not(.visually-hidden) {
	grid-column: 1 / -1;
	font-size: 0.9rem;
	color: #3c3836;
	/* fallback */
	color: var(--fg);
}

.embeddable-buttondown-form input[type="email"] {
	width: 100%;
	padding: 0.55rem 0.75rem;
	border-radius: 8px;
	border: 2px solid #7c6f64;
	/* fallback */
	border: 2px solid var(--border);
	background: #fbf1c7;
	/* fallback */
	background: var(--bg);
	color: #3c3836;
	/* fallback */
	color: var(--fg);
	font-family: inherit;
}

.embeddable-buttondown-form input[type="email"]:focus {
	outline: 2px solid transparent;
	border-color: #cc241d;
	/* fallback */
	border-color: var(--accent-primary);
}

.embeddable-buttondown-form input[type="submit"] {
	padding: 0.55rem 0.85rem;
	border-radius: 8px;
	border: 2px solid #cc241d;
	/* fallback */
	border: 2px solid var(--accent-primary);
	background: #cc241d;
	/* fallback */
	background: var(--accent-primary);
	color: #fbf1c7;
	/* fallback */
	color: var(--selection-fg);
	font-weight: 700;
	cursor: pointer;
}

.embeddable-buttondown-form input[type="submit"]:hover {
	filter: brightness(1.05);
}

.embeddable-buttondown-form p {
	margin: 0.5rem 0 0;
	grid-column: 1 / -1;
}

.embeddable-buttondown-form p a {
	color: #cc241d;
	/* fallback */
	color: var(--link);
}

/* Sidebar newsletter overrides */
.sidebar .newsletter-signup {
	background: transparent;
	border: 0;
	border-radius: 0;
	padding: 0;
	margin: 0;
	max-width: none;
}

.sidebar .newsletter-signup h3 {
	display: none;
}

.newsletter-copy {
	margin-bottom: -0.5lh;
}

/* Guestbook */
.guestbook-form {
	margin-bottom: 3rem;
	padding: 2rem;
	background: #f2e5bc;
	/* fallback */
	background: var(--panel);
	border-radius: 8px;
}

.guestbook-form .form-group {
	margin-bottom: 1.5rem;
}

.guestbook-form label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 600;
}

.guestbook-form input,
.guestbook-form textarea {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid #7c6f64;
	/* fallback */
	border: 1px solid var(--border);
	border-radius: 4px;
	background: #fbf1c7;
	/* fallback */
	background: var(--bg);
	color: #3c3836;
	/* fallback */
	color: var(--fg);
	font-family: inherit;
	font-size: 1rem;
}

.guestbook-form input:focus,
.guestbook-form textarea:focus {
	outline: none;
	border-color: #cc241d;
	/* fallback */
	border-color: var(--accent-primary);
}

.guestbook-form small {
	display: block;
	margin-top: 0.25rem;
	opacity: 0.7;
	font-size: 0.875rem;
}

.guestbook-form .btn {
	background: #cc241d;
	/* fallback */
	background: var(--accent-primary);
	color: #fbf1c7;
	/* fallback */
	color: var(--bg);
	border: none;
	padding: 0.75rem 1.5rem;
	border-radius: 4px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s;
}

.guestbook-form .btn:hover {
	opacity: 0.9;
}

.guestbook-entries {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.guestbook-entry {
	padding: 1rem;
	background: #f2e5bc;
	/* fallback */
	background: var(--panel);
	border-radius: 8px;
	margin-top: -2rem !important;
	margin-bottom: -1rem;
}

.guestbook-entry .entry-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.5rem;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: -1rem;
}

.guestbook-entry .entry-header h3 {
	margin: 0;
	font-size: 1.1rem;
}

.guestbook-entry .entry-header h3 a {
	color: inherit;
	text-decoration: none;
}

.guestbook-entry .entry-header h3 a:hover {
	text-decoration: underline;
}

.guestbook-entry .entry-header time {
	opacity: 0.7;
	font-size: 0.875rem;
}

.guestbook-entry .entry-content p {
	margin: 0;
	line-height: 1.5;
}

@media (max-width: 768px) {
	.guestbook-form {
		padding: 1rem;
	}

	.guestbook-entry {
		padding: 0.75rem;
	}

	.guestbook-entry .entry-header {
		flex-direction: column;
		align-items: flex-start;
	}
}
