/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

/* ========================================
   CATEGORY POST GRID – RESPONSIVE 2 COLUMNS
   ======================================== */

/* Mobile: 1 post per row */
body.category .site-main {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
}

/* Keep the category title and pagination full width */
body.category .site-main > .page-header,
body.category .site-main > .paging-navigation,
body.category .site-main > .posts-navigation {
	grid-column: 1 / -1;
}

/* Post card */
body.category .site-main > article {
	margin-bottom: 0;
}

body.category .inside-article {
	padding: 20px !important;
}

/* Category heading */
body.category .page-header {
	padding: 24px 40px !important;
	margin-bottom: 0 !important;
}

/* Post content spacing */
body.category .entry-title {
	font-size: 22px;
	line-height: 1.3;
}

body.category .site-main > article .entry-header {
	margin-bottom: 18px;
}

body.category .site-main > article .post-image {
	margin-bottom: 20px;
}

body.category .site-main > article .entry-summary {
	margin-top: 0;
}
/* Hide archive title, category and comment meta */
body.category .page-header,
body.category .entry-meta {
	display: none;
}
/* Post boxes on category pages */
body.category .inside-article {
	background: #ffffff;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.10);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.category .inside-article:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

body.category .entry-summary a.read-more {
	display: none !important;
}

/* English Speaking category page */
.dse-speaking-directory {
	margin-bottom: 40px;
}

.dse-breadcrumbs {
	margin-bottom: 24px;
	font-size: 14px;
}

.dse-level-section {
	margin-bottom: 42px;
}

.dse-level-section__heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.dse-level-section__heading h2 {
	margin: 0;
	font-size: 26px;
	color: #0000a3;
}

.dse-level-section__heading a {
	font-weight: 600;
	text-decoration: none;
}

.dse-level-section__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.dse-level-card {
	padding: 20px;
	background: #ffffff;
	box-shadow: 0 3px 14px rgba(0, 0, 0, 0.10);
}

.dse-level-card__image img {
	display: block;
	width: 100%;
	height: 230px;
	object-fit: cover;
}

.dse-level-card h3 {
	margin: 16px 0 10px;
	font-size: 22px;
}

.dse-level-card h3 a {
	color: inherit;
	text-decoration: none;
}

.dse-level-card p {
	margin: 0;
}

@media (max-width: 768px) {
	.dse-level-section__grid {
		grid-template-columns: 1fr;
	}

	.dse-level-section__heading {
		align-items: flex-start;
		flex-direction: column;
		gap: 6px;
	}
}
/* End English Speaking category page */


/* Breadcrumbs take the full row on level category pages */
body.category[class*="category-"][class*="level-"] .site-main > .dse-breadcrumbs {
	grid-column: 1 / -1;
	margin: 0 0 16px;
}
/* End Breadcrumbs take the full row on level category pages */

/* English Speaking – Level pagination */
.dse-level-pagination {
	margin-top: 8px;
	margin-bottom: 40px;
}

.dse-level-pagination .page-numbers {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.dse-level-pagination .page-numbers li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dse-level-pagination .page-numbers a,
.dse-level-pagination .page-numbers span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 13px;
	border-radius: 5px;
	background: #f1f3ff;
	color: #0000a3;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.2s ease;
}

.dse-level-pagination .page-numbers .current,
.dse-level-pagination .page-numbers a:hover {
	background: #0000a3;
	color: #ffffff;
}

/* End English Speaking – Level pagination */

/* Level subcategory pagination */
body.category[class*="category-"][class*="level-"] .paging-navigation {
	grid-column: 1 / -1;
	margin: 8px 0 40px;
	padding: 0;
	background: transparent;
}

body.category[class*="category-"][class*="level-"] .paging-navigation .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

body.category[class*="category-"][class*="level-"] .paging-navigation .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 13px;
	border-radius: 5px;
	background: #f1f3ff;
	color: #0000a3;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.2s ease;
}

body.category[class*="category-"][class*="level-"] .paging-navigation .page-numbers.current,
body.category[class*="category-"][class*="level-"] .paging-navigation a.page-numbers:hover {
	background: #0000a3;
	color: #ffffff;
}
/* End Level subcategory pagination */
/* Align breadcrumbs with the lesson content on single lesson pages */
body.archive.category nav.rank-math-breadcrumb a {
    font-weight: 600;
    font-size: 16.5px;
}
@media (min-width: 769px) {
	body.single-speaking_lesson .dse-breadcrumbs,
	body.single-listening_lesson .dse-breadcrumbs,
	body.single-reading_lesson .dse-breadcrumbs,
	body.single-writing_lesson .dse-breadcrumbs {
		margin-left: 40px;
		margin-right: 40px;
	}
}

/* End Align breadcrumbs with the lesson content on single lesson pages */
/* Padding with breadcrumbs with a single lesson pages */
body.single.single-speaking_lesson .inside-article {
    padding-top: 10px !important;
}
body.single-speaking_lesson .dse-breadcrumbs nav.rank-math-breadcrumb span {
    font-weight: 500;
}
body.single-speaking_lesson .dse-breadcrumbs nav.rank-math-breadcrumb a {
    font-weight: 600;
    font-size: 16.5px;
}
body.archive.category nav.rank-math-breadcrumb span {
    font-size: 15px;
    font-weight: 500;
}
body.archive.category div#page {
    padding-left: 40px;
    padding-right: 40px;
}
.site-footer .inside-site-info {
    padding-left: 40px;
    padding-right: 40px;
}

/* End Padding with breadcrumbs with a single lesson pages */
/* Mobile: align lesson breadcrumbs with the article content */
@media (max-width: 768px) {
	body.single-speaking_lesson .dse-breadcrumbs,
	body.single-listening_lesson .dse-breadcrumbs,
	body.single-reading_lesson .dse-breadcrumbs,
	body.single-writing_lesson .dse-breadcrumbs {
		box-sizing: border-box;
		margin: 0 0 16px;
		padding: 0 27px;
		font-size: 14px;
		line-height: 1.6;
	}
	body.single h1.entry-title {
		font-size: 38px !important;
	}
}
/* End Mobile: align lesson breadcrumbs with the article content */
/* Keep audio players inside the content on small screens */
@media (max-width: 576px) {
	.entry-content .wp-block-audio {
		width: 100%;
		max-width: 100%;
		min-width: 0;
	}

	.entry-content .wp-block-audio audio {
		display: block;
		width: 100% !important;
		max-width: 100%;
		min-width: 0;
	}
	body.archive.category div#page {
		padding-left: 20px;
		padding-right: 20px;
	}
	.site-footer .inside-site-info {
		padding-left: 20px;
		padding-right: 20px;
	}
}
/* End Keep audio players inside the content on small screens */
/* Mobile: keep Previous on the left and Next on the right */
@media (max-width: 768px) {
	.dse-lesson-navigation {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.dse-lesson-navigation__next {
		grid-column: 2;
		justify-content: flex-start;
	}

	.dse-lesson-navigation > .dse-lesson-navigation__next:only-child {
		grid-column: 2;
	}
}
@media (max-width: 640px) {
	.dse-lesson-navigation {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.dse-lesson-navigation__previous {
		width: fit-content;
		margin-right: auto;
	}

	.dse-lesson-navigation__next,
	.dse-lesson-navigation > .dse-lesson-navigation__next:only-child {
		grid-column: 1 !important;
		width: fit-content;
		margin-left: auto !important;
	}
	body.single h1.entry-title {
		font-size: 35px !important;
	}
	body.single h2{
		font-size: 31px !important;
	}
}
/* End Mobile: keep Previous on the left and Next on the right */
@media (max-width: 480px)
{
	body.single-speaking_lesson blockquote p {
		font-size: 28px !important;
	}
}


/* Mobile: Logo Mobile */
@media (max-width: 440px)
{
	.site-header .header-image {
		max-width: 220px;
	}	
}
@media (max-width: 350px)
{
	.site-header .header-image {
		max-width: 200px;
	}	
}
/* End Mobile: Logo Mobile */
/* Single lesson: previous and next navigation */
.dse-lesson-navigation {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
	margin: 36px 0 28px;
	padding: 18px 0;
	border-top: 1px solid #e5e7eb;
	border-bottom: 1px solid #e5e7eb;
}

.dse-lesson-navigation a {
	display: flex;
	align-items: center;
	gap: 12px;
	color: #0000a3;
	text-decoration: none;
}

.dse-lesson-navigation__previous {
	justify-content: flex-start;
}

.dse-lesson-navigation__next {
	flex-direction: row-reverse;
	justify-content: flex-start;
	text-align: right;
}

.dse-lesson-navigation span {
	font-size: 0;
	line-height: 1;
	flex: 0 0 auto;
}

.dse-lesson-navigation__previous span::before {
	content: "←";
	font-size: 28px;
}

.dse-lesson-navigation__next span::before {
	content: "→";
	font-size: 28px;
}

.dse-lesson-navigation strong {
	font-size: 16px;
	line-height: 1.45;
}

.dse-lesson-navigation a:hover strong {
	text-decoration: underline;
}

/* Related lessons */
.dse-related-lessons {
	margin-top: 28px;
}

.dse-related-lessons h2 {
	margin-bottom: 14px;
	font-size: 25px;
	color: #0000a3;
}

.dse-related-lessons__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dse-related-lessons__list li {
	margin: 0;
	border-bottom: 1px solid #e5e7eb;
}

.dse-related-lessons__list a {
	display: block;
	padding: 11px 0;
	color: #0000a3;
	text-decoration: none;
}

.dse-related-lessons__list a::before {
	content: "→";
	margin-right: 9px;
	font-weight: 700;
}

.dse-related-lessons__list a:hover {
	text-decoration: underline;
}

/* Mobile */
@media (max-width: 768px) {
	.dse-lesson-navigation {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.dse-lesson-navigation__next {
		justify-content: flex-end;
	}
}
/* End Related lessons */
/* When only Next lesson exists, keep it on the right side */
@media (min-width: 769px) {
	.dse-lesson-navigation > .dse-lesson-navigation__next:only-child {
		grid-column: 2;
	}
}
/* End When only Next lesson exists, keep it on the right side */

/* Lesson sorting dropdown on skill category pages */
.dse-level-section__heading {
	display: grid;
	grid-template-columns: max-content 1fr max-content;
	align-items: center;
	column-gap: 16px;
}

/* Hide the visible label but keep it available for screen readers */
.dse-lesson-sort label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.dse-lesson-sort-toolbar {
	justify-self: start;
}

.dse-lesson-sort select {
	min-width: 170px;
	padding: 8px 32px 8px 12px;
	border: 1px solid #e2e5e9;
	border-radius: 2px;
	background-color: #fff;
	color: #333;
	font: inherit;
	cursor: pointer;
}

/* Mobile */
@media (max-width: 768px) {
	.dse-level-section__heading {
		display: flex;
		flex-wrap: wrap;
		gap: 12px;
	}

	.dse-level-section__heading h2 {
		flex: 1 1 100%;
		margin-bottom: 0;
	}

	.dse-level-section__heading > a {
		margin-left: auto;
	}
}


/* CATEGORY EXCERPT – FIXED 5 LINES */
@media (min-width: 769px) {
	body.category .entry-summary {
		display: block !important;
		height: 7.5em;
		line-height: 1.5;
		overflow: hidden;
	}

	body.category .entry-summary p {
		margin-bottom: 0;
	}
}

/* Keep category post titles on one line */
@media (min-width: 769px) {
	body.category .entry-title,
	body.category .entry-title a {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	body.category .entry-title a {
		display: block;
	}
}
/* Font size the title of category */
/* body.category div#page h2 {
    font-size: 30px !important;
 
} */
/* padding footer */

/* Tablet and desktop: 2 posts per row */
/* @media (min-width: 768px) {
	body.category .site-main {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}
} */
/* Level category archives: show 2 lesson posts per row */
@media (min-width: 768px) {
	body.category[class*="category-"][class*="level-"] .site-main {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}
}
/* End Level category archives: show 2 lesson posts per row */
/* Smaller padding on mobile */
@media (max-width: 767px) {
	body.category .page-header {
		padding: 24px 20px !important;
	}
}
/* White site background */
body {
	background-color: #ffffff !important;
}