/**
 * Responsive Design
 *
 * @package EGCI_Template
 * @since 1.0.0
 */

/* ============================================
   Responsive Design
   ============================================ */
@media (min-width: 768px) {
	.sidebar {
		margin-top: 0;
	}
}

@media (max-width: 767px) {
	:root {
		--egci-spacing: 0.75rem;
	}

	h1 {
		font-size: 2rem;
	}
	h2 {
		font-size: 1.75rem;
	}
	h3 {
		font-size: 1.5rem;
	}

	.hero-section__title {
		font-size: 1.5rem;
	}

	.section-title {
		font-size: 2rem;
	}

	.menu-toggle {
		display: flex;
	}

	/* Mobile Menu Overlay */
	.mobile-menu-overlay {
		display: none;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: rgba(0, 0, 0, 0.5);
		z-index: 9998;
		opacity: 0;
		transition: opacity 0.3s ease;
	}

	.mobile-menu-overlay.active {
		display: block;
		opacity: 1;
	}

	.primary-menu {
		display: flex;
		position: fixed;
		top: 0;
		right: -100%;
		width: 80%;
		max-width: 320px;
		height: 100vh;
		background-color: var(--egci-bg);
		flex-direction: column;
		padding: 0;
		margin: 0;
		box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
		z-index: 9999;
		overflow-y: auto;
		transition: right 0.3s ease;
		justify-content: flex-start;
	}

	.primary-menu.active {
		right: 0;
		gap: 0;
	}


	.primary-menu .menu-close {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 1rem;
		border-bottom: 1px solid var(--egci-border);

	}

	.primary-menu .menu-close-button {
		background: none;
		border: none;
		font-size: 1.5rem;
		cursor: pointer;
		color: var(--egci-text);
		padding: 0.5rem;
		line-height: 1;
		transition: color 0.3s ease;
	}

	.primary-menu .menu-close-button:hover {
		color: var(--egci-primary);
	}

	.primary-menu li {
		border-bottom: 1px solid var(--egci-border);
		margin: 0;
	}

	.primary-menu li:last-child {
		border-bottom: none;
	}

	.primary-menu a {
		padding: 1rem;
		display: block;
		color: black !important;
	}

	.site-header__inner {
		flex-wrap: nowrap;
		justify-content: space-between;
	}

	.site-branding {
		order: 1;
		flex-shrink: 0;
	}

	.main-navigation {
		order: 2;
		width: auto;
		position: relative;
		flex: 0 0 auto;
	}

	.header-right {
		order: 3;
		flex-shrink: 0;
		gap: 1rem;
		display: none;
	}

	.header-social-links {
		gap: 0.75rem;
	}

	.header-social-icon {
		width: 32px;
		height: 32px;
		font-size: 0.85rem;
	}

	.menu-toggle {
		display: flex;
	}

	.services-grid,
	.expertise-grid,
	.engagements-grid,
	.approach-grid,
	.projects-grid,
	.team-grid,
	.blog-grid {
		grid-template-columns: 1fr;
	}

	.services-main-title,
	.engagements-main-title {
		font-size: 2rem;
	}

	.services-subtitle,
	.engagements-subtitle {
		font-size: 1rem;
	}

	.expertise-card {
		padding: 30px 25px;
		min-height: 315px;
	}

	.engagements-card {
		padding: 30px 25px;

	}

	/* Card Title Responsive */
	.card-title {
		font-size: 1.1rem;
	}

	.expertise-card--has-bg-image .card-title,
	.engagements-card--has-bg-image .card-title {
		font-size: 24px;
	}

	.form-row {
		grid-template-columns: 1fr;
	}

	.site-footer__bottom {
		flex-direction: column;
		text-align: center;
	}

	.footer-content {
		grid-template-columns: repeat(3, 1fr);
	}

	.footer-logo {
		grid-column: 1 / -1;
	}
}

@media (max-width: 768px) {
	.header-social-links {
		gap: 0.5rem;
	}

	.header-social-icon {
		width: 30px;
		height: 30px;
		font-size: 0.8rem;
	}

	.site-footer {
		padding: 40px 30px 30px;
	}

	.footer-content {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.footer-bottom {
		flex-direction: column;
		align-items: flex-start;
	}

	.footer-bottom-left {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}

	.footer-bottom-right {
		justify-content: flex-start;
		width: 100%;
		margin-top: 20px;
	}

	/* Approach Grid Responsive */
	.approach-grid {
		gap: 30px;
		margin-top: 30px;
	}

	.approach-card {
		padding: 30px 20px;
		min-height: 315px;
	}
}

@media (max-width: 480px) {
	.approach-grid {
		gap: 20px;
		margin-top: 20px;
	}

	.approach-card {
		padding: 25px 15px;
		min-height: 315px;
	}

	/* Card Title Mobile */
	.card-title {
		font-size: 1rem;
	}

	.expertise-card--has-bg-image .card-title,
	.engagements-card--has-bg-image .card-title {
		font-size: 20px;
	}
}

/* ============================================
   Project Archive (Responsive fixes)
   ============================================ */
.post-type-archive-project .posts-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1023px) {
	.post-type-archive-project .posts-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.5rem;
	}
}

@media (max-width: 767px) {
	.post-type-archive-project .posts-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}
}
