/*
Theme Name:   child_oceanWP
Template:     oceanwp
Description:  child ocean wp theme
Author:       anastasiia
Version:      1.0.0
*/

/* Pull cluster styles from the same theme directory (survives optimizers that drop extra link tags). */
@import url('ecm-cluster.css');

/* -------------------------------------------------------------------------
   News archive: stretch cards, fixed 4-line excerpt, CTA like .btn-primary
   High specificity + !important so OceanWP / Elementor do not flatten buttons.
   ------------------------------------------------------------------------- */

.ecm-custom section.projects.news-archive .projects-grid {
	align-items: stretch;
}

.ecm-custom .news-archive article.project-card {
	display: flex !important;
	flex-direction: column !important;
	height: 100% !important;
	box-sizing: border-box !important;
}

.ecm-custom .news-archive .project-card__link {
	display: flex !important;
	flex-direction: column !important;
	flex: 1 1 auto !important;
	min-height: 0 !important;
	text-decoration: none !important;
	color: inherit !important;
}

.ecm-custom .news-archive .project-card__link:hover,
.ecm-custom .news-archive .project-card__link:focus {
	text-decoration: none !important;
	color: inherit !important;
}

.ecm-custom .news-archive .project-content {
	flex: 1 1 auto !important;
	display: flex !important;
	flex-direction: column !important;
	min-height: 0 !important;
	box-sizing: border-box !important;
}

/* Exact pixel height for 4 lines at 1.875rem / 1.7 (same as .project-description in ecm-cluster). */
.ecm-custom .news-archive .news-archive__excerpt {
	flex: 1 0 auto !important;
	height: calc(1.875rem * 1.7 * 4) !important;
	min-height: calc(1.875rem * 1.7 * 4) !important;
	max-height: calc(1.875rem * 1.7 * 4) !important;
	overflow: hidden !important;
	margin-top: 0.5rem !important;
}

.ecm-custom .news-archive .news-archive__excerpt-text {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 1.875rem !important;
	line-height: 1.7 !important;
	color: #666 !important;
	font-weight: 400 !important;
	overflow: hidden !important;
	display: -webkit-box !important;
	-webkit-box-orient: vertical !important;
	-webkit-line-clamp: 4 !important;
	line-clamp: 4;
	word-break: break-word !important;
	overflow-wrap: anywhere !important;
}

/* CTA: small chip, gray base + red accent on hover (site tokens) */
.ecm-custom .news-archive .news-archive__readmore,
.ecm-custom .news-archive a.project-card__link .news-archive__readmore {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	align-self: flex-start !important;
	flex-shrink: 0 !important;
	margin-top: 0.85rem !important;
	padding: 0.35rem 0.95rem !important;
	font-size: 1.15rem !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-decoration: none !important;
	border-radius: 4px !important;
	border: 1px solid var(--border-gray, #808080) !important;
	box-sizing: border-box !important;
	cursor: pointer !important;
	transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease !important;
	background: var(--light-gray, #e8e8e8) !important;
	color: var(--dark-gray, #666666) !important;
	box-shadow: none !important;
}

.ecm-custom .news-archive .project-card:hover .news-archive__readmore,
.ecm-custom .news-archive a.project-card__link:hover .news-archive__readmore {
	background: #fff !important;
	color: var(--accent-red, #dc3545) !important;
	border-color: var(--accent-red, #dc3545) !important;
	transform: none !important;
	box-shadow: 0 2px 10px rgba(220, 53, 69, 0.18) !important;
}

/* Other pages: full-card link, thumbnails */
.ecm-custom .project-card__link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.ecm-custom .project-card__link:hover,
.ecm-custom .project-card__link:focus {
	text-decoration: none;
	color: inherit;
}

.ecm-custom .project-image.has-thumbnail::after {
	display: none;
}

.ecm-custom .project-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ecm-custom .news-pagination {
	margin-top: 3rem;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem 1rem;
}

.ecm-custom .news-pagination .page-numbers {
	display: inline-block;
	padding: 0.5rem 1rem;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	text-decoration: none;
	color: var(--text-dark, #333);
}

.ecm-custom .news-pagination .page-numbers.current {
	background: var(--accent-red, #dc3545);
	color: #fff;
}

.ecm-custom .news-empty {
	text-align: center;
	padding: 3rem 1rem;
	font-size: 1.25rem;
	color: #666;
}

/* -------------------------------------------------------------------------
   Single post (single-post.php)
   ------------------------------------------------------------------------- */

.ecm-custom .news-single {
	background: #f8f8f8;
}

.ecm-custom .news-single__thumb-wrap {
	background: linear-gradient(135deg, var(--primary-gray, #808080) 0%, var(--dark-gray, #666) 100%);
}

.ecm-custom .news-single__thumb {
	max-width: 1200px;
	margin: 0 auto;
	max-height: 420px;
	overflow: hidden;
}

.ecm-custom .news-single__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	max-height: 420px;
	object-fit: cover;
}

.ecm-custom .news-single__section {
	padding: 3rem 0 5rem;
}

.ecm-custom .news-single__header {
	margin-bottom: 2rem;
}

.ecm-custom .news-single__title {
	margin-bottom: 0.75rem;
}

.ecm-custom .news-single__meta {
	color: #888;
	font-size: 1.3rem;
	font-weight: 500;
	margin: 0;
}

.ecm-custom .news-single__content {
	font-size: 1.875rem;
	line-height: 1.7;
	color: var(--text-dark, #2c2c2c);
}

.ecm-custom .news-single__content > *:first-child {
	margin-top: 0;
}

.ecm-custom .news-single__content p {
	margin-bottom: 1.25rem;
}

.ecm-custom .news-single__content img,
.ecm-custom .news-single__content .wp-block-image img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

.ecm-custom .news-single__content a {
	color: var(--accent-red, #dc3545);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ecm-custom .news-single__content a:hover {
	text-decoration: none;
}

.ecm-custom .news-single__pages {
	margin: 2rem 0;
	font-size: 1.5rem;
}

.ecm-custom .news-single__footer {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid var(--light-gray, #e8e8e8);
}

.ecm-custom .news-single__back {
	display: inline-flex;
	align-items: center;
	padding: 0.35rem 0.95rem;
	font-size: 1.15rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
	border-radius: 4px;
	border: 1px solid var(--border-gray, #808080);
	background: var(--light-gray, #e8e8e8);
	color: var(--dark-gray, #666666) !important;
	transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.ecm-custom .news-single__back:hover {
	background: #fff;
	color: var(--accent-red, #dc3545) !important;
	border-color: var(--accent-red, #dc3545);
	box-shadow: 0 2px 10px rgba(220, 53, 69, 0.18);
}

.ecm-custom .news-single__adjacent {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1.5rem;
	margin-top: 2.5rem;
	padding-top: 2rem;
	border-top: 1px solid var(--light-gray, #e8e8e8);
	font-size: 1.35rem;
}

.ecm-custom .news-single__adjacent a {
	color: var(--accent-red, #dc3545);
	font-weight: 600;
	text-decoration: none;
}

.ecm-custom .news-single__adjacent a:hover {
	text-decoration: underline;
}

.ecm-custom .news-single__adjacent-next {
	margin-left: auto;
	text-align: right;
}

@media (max-width: 768px) {
	.ecm-custom .news-single__section {
		padding: 2rem 0 4rem;
	}

	.ecm-custom .news-single__content {
		font-size: 1.6rem;
	}
}
