/**
 * Sermon Print Stylesheet
 *
 * Print-specific styling for sermon pages.
 * Uses design tokens (--ybc-font-size-prose, --ybc-max-width-prose).
 * Optimized for paper output: removes sidebars, adjusts margins, ensures readability.
 *
 * @package YatesBaptist\Theme
 * @since 1.0.0
 */

@media print {

	/**
	 * Container and Layout
	 */
	.ybc-sermon-print {
		max-width: var( --ybc-max-width-prose, 700px );
		margin: 0 auto;
		padding: 0;
		color: #000;
		background: #fff;
		font-family: serif;
	}

	/**
	 * Header Section
	 */
	.ybc-sermon-print__header {
		margin-bottom: 1.5rem;
		border-bottom: 2px solid #000;
		padding-bottom: 1rem;
	}

	.ybc-sermon-print__title {
		font-size: 1.8rem;
		font-weight: bold;
		line-height: 1.2;
		margin: 0 0 1rem 0;
		color: #000;
	}

	.ybc-sermon-print__meta {
		font-size: 0.95rem;
		line-height: 1.6;
	}

	.ybc-sermon-print__meta p {
		margin: 0.5rem 0;
		padding: 0;
	}

	.ybc-sermon-print__meta strong {
		font-weight: bold;
		min-width: 80px;
		display: inline-block;
	}

	/**
	 * Summary Section
	 */
	.ybc-sermon-print__summary {
		font-size: 1rem;
		line-height: 1.6;
		margin-bottom: 1.5rem;
		font-style: italic;
	}

	.ybc-sermon-print__summary p {
		margin: 0;
	}

	/**
	 * Divider
	 */
	.ybc-sermon-print__divider {
		border: none;
		border-top: 1px solid #999;
		margin: 1.5rem 0;
		height: 0;
	}

	/**
	 * Main Content
	 */
	.ybc-sermon-print__content {
		font-size: var( --ybc-font-size-prose, 1rem );
		line-height: 1.8;
		margin-bottom: 2rem;
	}

	.ybc-sermon-print__content p {
		margin: 0 0 1.2rem 0;
		text-align: justify;
	}

	.ybc-sermon-print__content h2,
	.ybc-sermon-print__content h3,
	.ybc-sermon-print__content h4 {
		font-size: 1.2rem;
		font-weight: bold;
		margin: 1.5rem 0 0.5rem 0;
		page-break-after: avoid;
	}

	.ybc-sermon-print__content h2 {
		font-size: 1.3rem;
		border-bottom: 1px solid #ccc;
		padding-bottom: 0.5rem;
	}

	.ybc-sermon-print__content ol,
	.ybc-sermon-print__content ul {
		margin: 1rem 0 1rem 2rem;
		padding: 0;
	}

	.ybc-sermon-print__content li {
		margin-bottom: 0.5rem;
		line-height: 1.6;
	}

	.ybc-sermon-print__content blockquote {
		margin: 1.5rem 0 1.5rem 2rem;
		padding-left: 1rem;
		border-left: 3px solid #999;
		font-style: italic;
		color: #333;
	}

	.ybc-sermon-print__content a {
		color: #000;
		text-decoration: underline;
	}

	.ybc-sermon-print__content img {
		max-width: 100%;
		height: auto;
		margin: 1rem 0;
		page-break-inside: avoid;
	}

	/**
	 * Resources Section
	 */
	.ybc-sermon-print__resources {
		margin-top: 2rem;
		padding: 1rem;
		background: #f5f5f5;
		page-break-inside: avoid;
	}

	.ybc-sermon-print__resources-title {
		font-size: 1.1rem;
		font-weight: bold;
		margin: 0 0 0.8rem 0;
		color: #000;
	}

	.ybc-sermon-print__resources-list {
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.ybc-sermon-print__resource-item {
		margin-bottom: 0.6rem;
	}

	.ybc-sermon-print__resource-link {
		color: #000;
		text-decoration: underline;
		font-weight: normal;
	}

	.ybc-sermon-print__resource-meta {
		font-size: 0.9rem;
		color: #666;
	}

	/**
	 * Footer Section
	 */
	.ybc-sermon-print__footer {
		margin-top: 2rem;
		padding-top: 1rem;
		border-top: 1px solid #ddd;
		font-size: 0.85rem;
		color: #666;
		text-align: center;
	}

	.ybc-sermon-print__footer-text {
		margin: 0;
	}

	.ybc-sermon-print__footer a {
		color: #000;
		text-decoration: none;
	}

	/**
	 * Page Layout and Breaks
	 */
	body {
		margin: 1rem;
		font-size: 11pt;
		line-height: 1.6;
	}

	/* Avoid page breaks within sections */
	.ybc-sermon-print__header,
	.ybc-sermon-print__content h2,
	.ybc-sermon-print__content h3,
	.ybc-sermon-print__resource-item {
		page-break-inside: avoid;
	}

	/* Force page break after header */
	.ybc-sermon-print__divider {
		page-break-after: avoid;
	}

	/* Hide elements that shouldn't print */
	.ybc-sermon-print__footer {
		display: none;
	}

	/* Ensure links are visible in print */
	a[href]:after {
		content: none;
	}

	/* Print-specific colors */
	h1, h2, h3, h4, h5, h6 {
		color: #000;
		page-break-after: avoid;
	}

}

/**
 * Screen Media (fallback, not for print)
 */
@media screen {
	.ybc-sermon-print {
		max-width: var( --ybc-max-width-prose, 700px );
		margin: 0 auto;
		padding: 2rem 1rem;
	}

	.ybc-sermon-print__header {
		margin-bottom: 2rem;
	}

	.ybc-sermon-print__title {
		font-size: 2rem;
		margin-bottom: 1rem;
	}

	.ybc-sermon-print__meta {
		display: grid;
		grid-template-columns: repeat( auto-fit, minmax( 200px, 1fr ) );
		gap: 1rem;
	}

	.ybc-sermon-print__meta p {
		margin: 0;
	}

	.ybc-sermon-print__divider {
		margin: 2rem 0;
	}

	.ybc-sermon-print__content {
		font-size: var( --ybc-font-size-prose, 1rem );
		line-height: 1.8;
		margin-bottom: 2rem;
	}

	.ybc-sermon-print__resources {
		background: #f9f9f9;
		border: 1px solid #ddd;
		border-radius: 4px;
		padding: 1.5rem;
		margin: 2rem 0;
	}

	.ybc-sermon-print__footer {
		text-align: center;
		color: #999;
		font-size: 0.9rem;
		margin-top: 3rem;
	}
}
