/**
 * Public styles for MT Easy Read.
 *
 * Styles for the Easy Read button, overlay, rows, grid,
 * single post template, and navigation.
 *
 * @package MeasureTwice\MT_Easy_Read
 * @since   1.0.0
 */

/* ==========================================================================
	Easy Read Button
	========================================================================== */

.mt-easy-read-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	background-color: #000;
	border: 2px solid #000;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mt-easy-read-button:hover,
.mt-easy-read-button:focus {
	background-color: #005a87;
	border-color: #005a87;
}

.mt-easy-read-button:focus {
	outline: 3px solid #0073aa;
	outline-offset: 2px;
}

.mt-easy-read-button .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

/* ==========================================================================
	Easy Read Content Bar
	========================================================================== */

.mt-easy-read-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	margin-bottom: 24px;
	background-color: #f0f7fb;
	border: 2px solid #0073aa;
	border-radius: 6px;
}

.mt-easy-read-bar__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	font-size: 16px;
	font-weight: 600;
	color: #0073aa;
	text-decoration: none;
	border: 2px solid #0073aa;
	border-radius: 4px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.mt-easy-read-bar__link:hover,
.mt-easy-read-bar__link:focus {
	background-color: #0073aa;
	color: #fff;
}

.mt-easy-read-bar__link:focus {
	outline: 3px solid #0073aa;
	outline-offset: 2px;
}

.mt-easy-read-bar__link .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

.mt-easy-read-bar__button {
	padding: 8px 16px;
	font-size: 16px;
}

/* ==========================================================================
	Easy Read Overlay
	========================================================================== */

.mt-easy-read-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 99999999999;
	display: none;
	align-items: center;
	justify-content: center;
}

.mt-easy-read-overlay[aria-hidden="false"] {
	display: flex;
}

.mt-easy-read-overlay__backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.8);
}

.mt-easy-read-overlay__content {
	position: relative;
	z-index: 1;
	width: 90%;
	max-width: 800px;
	max-height: 90vh;
	overflow-y: auto;
	background-color: #EDEDED;
	border-radius: 8px;
	padding: 32px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.mt-easy-read-overlay__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 2px solid #eee;
}

.mt-easy-read-overlay__title {
	font-size: 36px;
	font-weight: 700;
	margin: 0;
	line-height: 1.3;
}

.mt-easy-read-overlay__close {
	flex-shrink: 0;
	padding: 11px 16px 11px 50px;
	font-size: 16px;
	font-weight: 600;
	color: #333;
	background-color: transparent;
	border: 2px solid #333;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.2s ease;
	position: relative;
	min-width: 140px;
}
.mt-easy-read-overlay__close:before{
	content: '';
	display: block;
	position: absolute;
	left: 25px;
	top: 12px;
	background: url('../../assets/images/close.svg') no-repeat center;
	background-size: contain;
	width: 18px;
	height: 18px;
}

.mt-easy-read-overlay__close:hover,
.mt-easy-read-overlay__close:focus {
	background-color: #ddd;
	outline: none;
}

.mt-easy-read-overlay__close:focus {
	outline: 3px solid #0073aa;
	outline-offset: 2px;
}

/* ==========================================================================
	Easy Read Rows (shared between overlay and single template)
	========================================================================== */

.mt-easy-read-row {
	display: flex;
	align-items: flex-start;
	gap: 24px;
	margin-bottom: 24px;
	padding-bottom: 24px;
	border-bottom: 1px solid #000;
}

.mt-easy-read-row:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.mt-easy-read-row__image {
	flex: 0 0 200px;
	background-color: #fff;
	border-radius: 20px;
	padding: 20px;
}

.mt-easy-read-row__image img {
	width: 100%;
	height: auto;
	border-radius: 8px;
	display: block;
}

.mt-easy-read-row__text {
	flex: 1;
	font-size: 20px;
	line-height: 1.6;
	color: #333;
}

/* ==========================================================================
	Easy Read Grid
	========================================================================== */

.mt-easy-read-grid {
	display: grid;
	gap: 24px;
	margin: 24px 0;
}

.mt-easy-read-grid--cols-2 {
	grid-template-columns: repeat(2, 1fr);
}

.mt-easy-read-grid--cols-3 {
	grid-template-columns: repeat(3, 1fr);
}

.mt-easy-read-grid--cols-4 {
	grid-template-columns: repeat(4, 1fr);
}

.mt-easy-read-grid__item {
	display: flex;
	flex-direction: column;
	padding: 16px;
	background-color: #fff;
	border: 2px solid #eee;
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mt-easy-read-grid__item:hover,
.mt-easy-read-grid__item:focus {
	border-color: #000;
	box-shadow: 0 2px 8px rgba(0, 115, 170, 0.15);
	text-decoration: none;
}

.mt-easy-read-grid__item:focus {
	outline: 3px solid #0073aa;
	outline-offset: 2px;
}

.mt-easy-read-grid__image {
	margin-bottom: 12px;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 4px;
	background-color: #f0f0f0;
}

.mt-easy-read-grid__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mt-easy-read-grid__title {
	font-size: 18px;
	font-weight: 600;
	margin: 0;
	margin-top: auto;
	line-height: 1.3;
	color: #333;
}

/* ==========================================================================
	Single Easy Read Post
	========================================================================== */

.mt-easy-read-single {
	padding: 40px 0;
}

.mt-easy-read-single__container {
	max-width: 800px;
	margin: 0 auto;
	padding: 0 20px;
}

.mt-easy-read-single__header {
	margin-bottom: 32px;
	padding-bottom: 16px;
	border-bottom: 3px solid #000;
}

.mt-easy-read-single__site-name a{
	display: block;
	width: 100%;
	height: 100%;
}

.mt-easy-read-single__header .mt-easy-read-nav{
	position: absolute;
	right: 0;
	top: 0;
	padding-top: 0;
}

.mt-easy-read-single__title {
	font-size: 36px;
	font-weight: 700;
	line-height: 1.2;
	margin: 0;
}

.mt-easy-read-single__rows {
	margin-bottom: 40px;
}

.mt-easy-read-single__children {
	margin-bottom: 40px;
	padding-top: 24px;
	border-top: 2px solid #eee;
}

.mt-easy-read-single__children h2 {
	font-size: 24px;
	margin-bottom: 16px;
}

/* ==========================================================================
	Navigation
	========================================================================== */

.mt-easy-read-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding-top: 24px;
	border-top: 2px solid #eee;
}

.mt-easy-read-nav__link {
	display: inline-block;
	padding: 10px 20px;
	font-size: 16px;
	font-weight: 600;
	color: #000;
	text-decoration: none;
	border: 2px solid #000;
	border-radius: 4px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.mt-easy-read-nav__link:hover,
.mt-easy-read-nav__link:focus {
	background-color: #000;
	color: #fff;
	text-decoration: none;
}

.mt-easy-read-nav__link:focus {
	outline: 3px solid #0073aa;
	outline-offset: 2px;
}

/* ==========================================================================
	Responsive
	========================================================================== */

@media (max-width: 768px) {
	.mt-easy-read-row {
		flex-direction: column;
	}

	.mt-easy-read-row__image {
		flex: none;
		width: 100%;
	}

	.mt-easy-read-row__text {
		font-size: 18px;
	}

	.mt-easy-read-grid--cols-3,
	.mt-easy-read-grid--cols-4 {
		grid-template-columns: repeat(2, 1fr);
	}

	.mt-easy-read-overlay__content {
		width: 95%;
		padding: 20px;
	}

	.mt-easy-read-overlay__title {
		font-size: 22px;
	}

	.mt-easy-read-single__title {
		font-size: 28px;
	}

	.mt-easy-read-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.mt-easy-read-bar__link,
	.mt-easy-read-bar__button {
		justify-content: center;
		text-align: center;
	}

	.mt-easy-read-nav {
		align-items: stretch;
		text-align: center;
		gap: 8px;
	}
	.mt-easy-read-nav__link{
		padding-right: 25px;
		padding-left: 10px;
		font-size: 15px;
		width: 50%;
	}
	.mt-easy-read-nav__link.arrow-left {
	    padding-left: 25px;
	    padding-right: 10px;
	}
	.mt-easy-read-nav__link:after{
		right: 10px;
		width: 14px;
		height: 14px;
		top: 15px;
	}
	.mt-easy-read-nav__link.arrow-left:after{
		left: 10px;
	}
}

@media (max-width: 480px) {
	.mt-easy-read-grid--cols-2,
	.mt-easy-read-grid--cols-3,
	.mt-easy-read-grid--cols-4 {
		grid-template-columns: 1fr;
	}

	.mt-easy-read-button {
		width: 100%;
		justify-content: center;
	}
}
