/*
Theme Name: Samanvi Technologies
Theme URI: https://samanvis.com
Description: Samanvi Technologies Child Theme
Author: Samanvi
Author URI: https://samanvis.com
Version: 1.0.0
Template: generatepress
Text Domain: samanvi
Domain Path: /languages/
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* Child theme inherits all styles from GeneratePress parent theme */

/* Global horizontal scroll prevention.
   Use `clip` (not `hidden`) so we don't create a scroll container —
   `overflow-x: hidden` implicitly forces `overflow-y: auto`, which breaks
   `position: sticky` and `position: fixed` for any descendant (notably the
   painfix-v4 pinned scrub on the home template). */
html,
body {
  overflow-x: clip;
}

/* ============================================
   SINGLE POST TEMPLATE STYLES
   ============================================ */

/* Body background — subtle separation from nav */
.one-container .container {
	background-color: #f7f8f9;
}

/* Override GeneratePress container constraints */
#primary.single-post-wrapper {
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 2rem !important;
}

#primary.single-post-wrapper .site-main {
	width: 100% !important;
	max-width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
	padding-top: 0.5em !important;
}

/* Main Layout - 2 Column */
.post-wrapper {
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 2rem;
	width: 100%;
	max-width: 100%;
	margin: 0;
}

/* Post Main Column */
.post-main {
	display: flex;
	flex-direction: column;
	gap: 0;
	width: 100%;
}

/* Post Header */
.post-header {
	background: white;
	padding: 0.6rem 2rem;
	border-radius: 8px;
	margin-bottom: 1.5rem;
}

.post-category {
	display: inline-block;
	background: transparent;
	color: #1f4e8a;
	padding: 0.4rem 0.8rem;
	border-radius: 20px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: capitalize;
	margin-bottom: 1rem;
	transition: color 0.2s ease;
}

.post-category:hover {
	color: #00A896;
}

.post-title {
	font-size: 2.2rem;
	font-weight: 400;
	margin-bottom: 1.5rem;
	line-height: 1.3;
	font-family: 'Poppins', sans-serif;
	color: #333;
}

/* Post Meta */
.post-meta {
	display: flex;
	align-items: center;
	gap: 2rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid #f0f0f0;
	flex-wrap: wrap;
}

.meta-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.95rem;
	color: #666;
}

.meta-item strong {
	color: #1f4e8a;
}

.post-author-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Hero Image */
.post-hero {
	background: white;
	padding: 0;
	margin-bottom: 0;
	border-radius: 8px;
	overflow: hidden;
}

.post-hero-image {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.post-hero-image img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
}

/* Post Content */
.post-content {
	background: white;
	padding: 0.75rem 2rem;
	border-radius: 8px;
	margin-bottom: 3rem;
	line-height: 1.8;
}

.post-content p {
	margin-bottom: 1.5rem;
	font-size: 1rem;
	color: #555;
}

.post-content h2 {
	font-size: 1.6rem;
	font-weight: 500;
	margin: 2rem 0 1rem;
	color: #1f4e8a;
}

.post-content h3 {
	font-size: 1.3rem;
	font-weight: 500;
	margin: 1.5rem 0 1rem;
	color: #2c3e50;
}

.post-content a {
	color: #1f4e8a;
	text-decoration: none;
	font-weight: 500;
	transition: color 0.2s ease;
	border-bottom: 1px solid #1f4e8a;
}

.post-content a:hover {
	color: #00A896;
	border-bottom-color: #00A896;
}

.post-content ul, .post-content ol {
	margin-left: 2rem;
	margin-bottom: 1.5rem;
}

.post-content li {
	margin-bottom: 0.5rem;
}

.post-content blockquote {
	border-left: 4px solid #1f4e8a;
	padding-left: 1.5rem;
	margin: 2rem 0;
	font-style: italic;
	color: #666;
}

/* Post Footer */
.post-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: white;
	padding: 2rem;
	border-radius: 8px;
	margin-bottom: 3rem;
	border-top: 1px solid #f0f0f0;
	flex-wrap: wrap;
	gap: 2rem;
}

.post-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.post-tag {
	background: #f0f9f8;
	color: #1f4e8a;
	padding: 0.4rem 0.8rem;
	border-radius: 20px;
	font-size: 0.85rem;
	text-decoration: none;
	transition: all 0.2s ease;
}

.post-tag:hover {
	background: #1f4e8a;
	color: white;
}

.post-share {
	display: flex;
	gap: 1rem;
}

.share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: #f0f9f8;
	color: #1f4e8a;
	border-radius: 50%;
	text-decoration: none;
	font-size: 1.1rem;
	transition: all 0.2s ease;
	border: none;
	cursor: pointer;
}

.share-btn:hover {
	background: #1f4e8a;
	color: white;
	transform: scale(1.1);
}

/* Author Box */
.author-box {
	background: linear-gradient(135deg, #f0f9f8 0%, white 100%);
	padding: 2rem;
	border-radius: 8px;
	border-left: 4px solid #1f4e8a;
	margin-bottom: 3rem;
	display: flex;
	gap: 1.5rem;
}

.author-avatar {
	width: 80px;
	height: 80px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.author-info h4 {
	font-size: 1.1rem;
	font-weight: 600;
	margin-bottom: 0.3rem;
	color: #1f4e8a;
}

.author-info p {
	font-size: 0.95rem;
	color: #666;
	line-height: 1.5;
}

/* Related Posts */
.related-posts {
	background: white;
	padding: 3rem 2rem;
	border-radius: 8px;
	margin-bottom: 3rem;
}

.related-posts h3 {
	font-size: 1.5rem;
	font-weight: 500;
	margin-bottom: 2rem;
	color: #1f4e8a;
}

.related-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 2rem;
}

.related-card {
	border: 1px solid #e0f2f1;
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.2s ease;
}

.related-card:hover {
	box-shadow: 0 4px 12px rgba(31, 78, 138, 0.1);
	transform: translateY(-2px);
}

.related-image {
	width: 100%;
	height: 160px;
	background: linear-gradient(135deg, #1f4e8a 0%, #00A896 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	overflow: hidden;
}

.related-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.related-content {
	padding: 1.5rem;
}

.related-content h4 {
	font-size: 1rem;
	font-weight: 500;
	margin-bottom: 0.5rem;
	color: #2c3e50;
}

.related-content h4 a {
	color: #2c3e50;
	text-decoration: none;
	border: none;
}

.related-content h4 a:hover {
	color: #1f4e8a;
}

.related-content p {
	font-size: 0.9rem;
	color: #666;
}

/* Post Navigation */
.post-navigation {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
	margin-bottom: 3rem;
}

.nav-post {
	background: white;
	padding: 1.5rem;
	border-radius: 8px;
	border-left: 4px solid #1f4e8a;
	transition: all 0.2s ease;
}

.nav-post:hover {
	box-shadow: 0 4px 12px rgba(31, 78, 138, 0.15);
}

.nav-label {
	font-size: 0.85rem;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 0.5rem;
}

.nav-post h4 {
	font-size: 1rem;
	font-weight: 500;
	color: #1f4e8a;
	margin: 0;
}

.nav-post h4 a {
	color: #1f4e8a;
	text-decoration: none;
	border: none;
	transition: color 0.2s ease;
}

.nav-post h4 a:hover {
	color: #00A896;
}

/* Sidebar */
.sidebar {
	display: flex;
	flex-direction: column;
	gap: 2rem;
	position: sticky;
	top: 2rem;
	align-self: start;
}

.sidebar-widget {
	background: white;
	padding: 1.5rem;
	border-radius: 8px;
	border-left: 4px solid #1f4e8a;
}

.sidebar-widget h4 {
	font-size: 1.1rem;
	font-weight: 600;
	margin-bottom: 1.5rem;
	color: #1f4e8a;
}

/* Search Widget */
.search-widget .search-form {
	display: flex;
	border: 1px solid #ddd;
	border-radius: 4px;
	overflow: hidden;
}

.search-widget .search-field {
	flex: 1;
	padding: 0.7rem;
	border: none;
	outline: none;
	font-family: 'Poppins', sans-serif;
	font-size: 0.9rem;
	background: white;
}

.search-widget .search-submit {
	padding: 0.7rem 1rem;
	background: #1f4e8a;
	color: white;
	border: none;
	cursor: pointer;
	font-size: 1rem;
	transition: background 0.2s ease;
	flex-shrink: 0;
}

.search-widget .search-submit:hover {
	background: #00A896;
}

.search-widget .search-form:focus-within {
	border-color: #1f4e8a;
	box-shadow: 0 0 0 3px rgba(31, 78, 138, 0.1);
}

/* Recent Posts Widget */
.recent-posts-list {
	list-style: none;
}

.recent-posts-list li {
	padding: 0.8rem 0;
	border-bottom: 1px solid #f0f0f0;
}

.recent-posts-list li:last-child {
	border-bottom: none;
}

.recent-posts-list a {
	color: #2c3e50;
	text-decoration: none;
	font-size: 0.95rem;
	transition: color 0.2s ease;
	display: block;
	border: none;
}

.recent-posts-list a:hover {
	color: #1f4e8a;
}

.post-date {
	font-size: 0.8rem;
	color: #999;
	margin-top: 0.3rem;
}

/* Categories Widget */
.categories-list {
	list-style: none;
}

.categories-list li {
	margin-bottom: 0.5rem;
}

.categories-list a {
	color: #1f4e8a;
	text-decoration: none;
	font-size: 0.95rem;
	transition: all 0.2s ease;
	display: inline-block;
	padding: 0.4rem 0.8rem;
	background: #f0f9f8;
	border-radius: 20px;
	border: none;
}

.categories-list a:hover {
	background: #1f4e8a;
	color: white;
}

/* Newsletter Widget */
.newsletter-widget {
	background: linear-gradient(135deg, #1f4e8a 0%, #00A896 100%);
	color: white;
	border: none;
}

.newsletter-widget h4 {
	color: white;
}

.newsletter-widget p {
	font-size: 0.9rem;
	margin-bottom: 1rem;
	opacity: 0.95;
	color: white;
}

.newsletter-form input {
	width: 100%;
	padding: 0.7rem;
	border: none;
	border-radius: 4px;
	margin-bottom: 0.8rem;
	font-family: 'Poppins', sans-serif;
	font-size: 0.9rem;
}

.newsletter-form input::placeholder {
	color: #999;
}

.newsletter-form .btn {
	width: 100%;
	background: white;
	color: #1f4e8a !important;
}

.newsletter-form .btn:hover {
	background: #f0f9f8;
	color: #1f4e8a !important;
}

/* Button Styles */
.btn {
	display: inline-block;
	padding: 0.7rem 1.5rem;
	background: #1f4e8a;
	color: white !important;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 600;
	transition: background 0.2s ease;
	border: none;
	cursor: pointer;
	font-size: 0.95rem;
}

.btn:hover {
	background: #00A896;
	color: white !important;
}

/* ============================================
   BLOG ARCHIVE & MASONRY GRID STYLES
   ============================================ */

/* Blog Archive Container */
.blog-archive-wrapper {
	width: 100%;
	max-width: 100%;
}

/* Hide GeneratePress default page/entry title — we use our own header */
.blog-archive-wrapper .entry-header,
.blog-archive-wrapper .page-header {
	display: none;
}

/* Blog Header */
.blog-archive-header {
	background: linear-gradient(135deg, #028090 0%, #00A896 100%);
	color: white;
	padding: 4rem 0;
	margin-bottom: 3rem;
	text-align: center;
}

.blog-archive-header .container {
	max-width: 900px;
	margin: 0 auto;
	padding: 0 2rem;
}

.blog-archive-title {
	font-size: 2.5rem;
	font-weight: 400;
	margin: 0 0 1rem 0;
	font-family: 'Poppins', sans-serif;
}

.blog-archive-description {
	font-size: 1.1rem;
	margin: 0;
	opacity: 0.95;
	max-width: 700px;
	margin: 0 auto;
}

/* Grid Wrapper */
.blog-grid-wrapper {
	width: 100%;
	padding: 2rem 0;
}

.blog-grid-wrapper .container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 2rem;
}

/* Masonry Grid Layout */
.blog-posts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
	gap: 2rem;
	width: 100%;
	margin-bottom: 3rem;
}

/* Blog Card */
.blog-card {
	display: flex;
	flex-direction: column;
	background: white;
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.3s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	border: 1px solid #e0f2f1;
	height: 100%;
}

.blog-card:hover {
	box-shadow: 0 8px 20px rgba(2, 128, 144, 0.15);
	transform: translateY(-4px);
}

/* Featured Image */
.blog-card-image {
	position: relative;
	overflow: hidden;
	background: #f0f9f8;
	aspect-ratio: 16 / 9;
}

.blog-card-image a {
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.blog-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
	transform: scale(1.05);
}

/* Card Content */
.blog-card-content {
	display: flex;
	flex-direction: column;
	padding: 1.5rem;
	flex-grow: 1;
}

/* Category Badge */
.blog-card-category {
	margin-bottom: 0.8rem;
}

.category-badge {
	display: inline-block;
	background: transparent;
	color: #1f4e8a;
	padding: 0.4rem 0.8rem;
	border-radius: 20px;
	font-size: 0.75rem;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.2s ease;
	text-transform: capitalize;
	letter-spacing: 0.5px;
}

.category-badge:hover {
	color: #00A896;
}

/* Title */
.blog-card-title {
	margin: 0 0 0.8rem 0;
	font-family: 'Poppins', sans-serif;
	font-size: 1.3rem;
	font-weight: 400;
	line-height: 1.4;
}

.blog-card-title a {
	color: #2c3e50;
	text-decoration: none;
	transition: color 0.2s ease;
}

.blog-card-title a:hover {
	color: #028090;
}


/* Read More Button */
.read-more-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: #1f4e8a;
	color: white;
	padding: 0.5rem 1rem;
	border-radius: 4px;
	text-decoration: none;
	font-size: 0.85rem;
	font-weight: 600;
	transition: all 0.2s ease;
	border: none;
	cursor: pointer;
	width: auto;
}

.read-more-btn:hover {
	background: #00A896;
	transform: translateX(2px);
}

.read-more-btn svg {
	transition: transform 0.2s ease;
}

.read-more-btn:hover svg {
	transform: translateX(3px);
}

/* Pagination */
.blog-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	margin: 3rem 0;
	flex-wrap: wrap;
	list-style: none;
	padding: 0;
}

.blog-pagination li {
	display: inline-block;
}

.blog-pagination a,
.blog-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	min-height: 2.5rem;
	padding: 0.4rem 0.6rem;
	border: 2px solid #d4f1f4;
	border-radius: 4px;
	text-decoration: none;
	color: #1f4e8a;
	font-weight: 600;
	transition: all 0.2s ease;
	font-size: 0.95rem;
}

.blog-pagination a:hover {
	background: #00A896;
	color: white;
	border-color: #00A896;
}

.blog-pagination .page-number {
	color: #1f4e8a;
}

.blog-pagination span.page-number.current {
	background: #1f4e8a;
	color: white;
	border-color: #1f4e8a;
}

.blog-pagination .page-number.current {
	background: #1f4e8a;
	color: white;
	border-color: #1f4e8a;
}

.blog-pagination a.prev,
.blog-pagination a.next {
	min-width: auto;
}

/* No Posts Message */
.no-posts {
	text-align: center;
	padding: 3rem;
	color: #999;
	font-style: italic;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet (768px and below) */
@media (max-width: 768px) {
	.post-wrapper {
		grid-template-columns: 1fr;
	}

	/* ── Single post mobile: bulletproof symmetric padding ──
	   Use 100vw (exact viewport) + box-sizing:border-box so padding
	   never adds to the width regardless of parent container state. */

	/* Zero GP's content-area container padding only — scoped to .site-content
	   so the header's .inside-header.grid-container is NOT affected */
	body.single .site-content,
	body.single .site-content .site-inner,
	body.single .site-content .grid-container {
		padding-left: 0 !important;
		padding-right: 0 !important;
		max-width: 100% !important;
	}

	/* Pin wrapper to exact viewport width — symmetric 1rem each side */
	#primary.single-post-wrapper {
		width: 100vw !important;
		max-width: 100vw !important;
		box-sizing: border-box !important;
		padding-left: 1rem !important;
		padding-right: 1rem !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		overflow-x: hidden !important;
	}

	/* Post grid and main column — stay inside wrapper */
	.post-wrapper,
	.post-main {
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
		overflow: hidden !important;
	}

	/* Hero image — remove fixed height, fill width */
	.post-hero,
	.post-hero-image {
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}

	.post-hero-image img {
		width: 100% !important;
		height: auto !important;
		max-width: 100% !important;
		display: block !important;
	}

	/* Post content card — reduce padding so text has breathing room */
	.post-content {
		padding-left: 1rem !important;
		padding-right: 1rem !important;
		box-sizing: border-box !important;
		width: 100% !important;
		max-width: 100% !important;
		overflow: hidden !important;
	}

	/* Every content element stays within card */
	.post-content > * {
		max-width: 100% !important;
		overflow-wrap: break-word;
		word-break: break-word;
	}

	.post-content img,
	.post-content figure,
	.post-content iframe,
	.post-content video,
	.post-content embed {
		max-width: 100% !important;
		height: auto !important;
	}

	/* Gutenberg wide/full — neutralise negative margin breakout */
	.post-content .alignfull,
	.post-content .alignwide {
		margin-left: 0 !important;
		margin-right: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
	}

	/* Lists — reduce indent on small screens */
	.post-content ul,
	.post-content ol {
		margin-left: 1rem !important;
	}

	/* Tables and code — scroll rather than overflow */
	.post-content table,
	.post-content pre {
		display: block !important;
		overflow-x: auto !important;
		max-width: 100% !important;
	}

	.blog-posts-grid {
		grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
		gap: 1.5rem;
	}

	.blog-archive-title {
		font-size: 2rem;
	}

	.blog-card-title {
		font-size: 1.1rem;
	}

	.blog-card-excerpt {
		-webkit-line-clamp: 1;
	}

	.blog-card-content {
		padding: 1.2rem;
	}

	.blog-archive-header {
		padding: 2.5rem 0;
		margin-bottom: 2rem;
	}
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
	.blog-posts-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.blog-archive-title {
		font-size: 1.5rem;
	}

	.blog-archive-description {
		font-size: 0.95rem;
	}

	.blog-card-title {
		font-size: 1rem;
	}

	.blog-card-excerpt {
		font-size: 0.9rem;
	}

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

	.read-more-btn {
		width: 100%;
		justify-content: center;
	}

	.engagement-stats {
		font-size: 0.8rem;
		gap: 1rem;
	}

	.blog-grid-wrapper .container {
		padding: 0 1rem;
	}

	.blog-archive-header .container {
		padding: 0 1rem;
	}
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* High contrast for focus states */
.blog-card a:focus,
.category-badge:focus,
.read-more-btn:focus {
	outline: 2px solid #028090;
	outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.blog-card,
	.blog-card-image img,
	.category-badge,
	.read-more-btn,
	.read-more-btn svg {
		transition: none;
	}
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
	.blog-card {
		background: #1a1a1a;
		border-color: #2a2a2a;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	}

	.blog-card:hover {
		box-shadow: 0 8px 20px rgba(2, 128, 144, 0.25);
	}

	.blog-card-title a {
		color: #e0e0e0;
	}

	.blog-card-excerpt {
		color: #b0b0b0;
	}

	.blog-card-meta {
		border-color: #2a2a2a;
	}

	.stat-item {
		color: #a0a0a0;
	}

	.blog-pagination a,
	.blog-pagination span {
		border-color: #2a2a2a;
	}
}
