/* ============================================================
   Bytes Yatra – single.css
   Article-specific styles loaded only on singular posts.
   ============================================================ */

/* Progress bar */
.by-progress-bar {
	position: fixed;
	top: 0;
	left: 0;
	width: 0;
	height: 3px;
	background: var(--by-primary);
	z-index: 9999;
	transition: width 0.1s linear;
}

/* Article hero */
.by-article-hero {
	position: relative;
	overflow: hidden;
	margin-bottom: 32px;
}
.by-article-hero__img-wrap {
	position: relative;
	max-height: 520px;
	overflow: hidden;
}
.by-article-hero__img-wrap img {
	width: 100%;
	height: 520px;
	object-fit: cover;
	display: block;
}
.by-article-hero__gradient {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 60%);
}
.by-article-hero__content {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 32px;
}
.by-article-hero__title {
	font-family: var(--by-font-heading);
	font-size: clamp(1.6rem, 3vw, 2.8rem);
	font-weight: 800;
	color: #fff;
	line-height: 1.2;
	margin: 12px 0;
}
.by-article-hero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	color: rgba(255,255,255,.85);
	font-size: .85rem;
}
.by-article-hero__author {
	display: flex;
	align-items: center;
	gap: 8px;
	color: rgba(255,255,255,.9);
	text-decoration: none;
}
.by-article-hero__avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
}

/* Font adjuster */
.by-font-adjuster {
	display: flex;
	gap: 8px;
	margin-bottom: 24px;
}
.by-font-adjuster__btn {
	background: var(--by-surface);
	border: 1px solid var(--by-border);
	border-radius: 6px;
	padding: 4px 12px;
	cursor: pointer;
	font-weight: 600;
	transition: background .2s;
}
.by-font-adjuster__btn:hover {
	background: var(--by-primary);
	color: #fff;
	border-color: var(--by-primary);
}

/* Article layout */
.by-layout--article {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 48px;
	align-items: start;
}
.by-article-sidebar {
	position: sticky;
	top: 100px;
}

/* Article body typography */
.by-article__body {
	font-size: 16px;
	line-height: 1.85;
	color: var(--by-text);
}
.by-article__body h2,
.by-article__body h3,
.by-article__body h4 {
	font-family: var(--by-font-heading);
	font-weight: 700;
	margin: 2em 0 .8em;
	line-height: 1.3;
}
.by-article__body h2 { font-size: 1.65rem; }
.by-article__body h3 { font-size: 1.3rem; }
.by-article__body p  { margin-bottom: 1.4em; }
.by-article__body a  { color: var(--by-primary); text-decoration: underline; }
.by-article__body blockquote {
	border-left: 4px solid var(--by-primary);
	background: #fff1f1;
	padding: 16px 24px;
	margin: 24px 0;
	font-style: italic;
	border-radius: 0 8px 8px 0;
}
.by-dark-mode .by-article__body blockquote { background: rgba(198,40,40,.15); }
.by-article__body table {
	width: 100%;
	border-collapse: collapse;
	margin: 24px 0;
}
.by-article__body table th,
.by-article__body table td {
	padding: 10px 14px;
	border: 1px solid var(--by-border);
	text-align: left;
}
.by-article__body table tr:nth-child(even) td { background: var(--by-surface); }
.by-article__body table th { background: var(--by-primary); color: #fff; }
.by-article__body img { max-width: 100%; height: auto; border-radius: 8px; }
.by-article__body pre {
	background: #1e1e1e;
	color: #d4d4d4;
	padding: 20px;
	border-radius: 8px;
	overflow-x: auto;
	font-size: .9rem;
}
.by-article__body code {
	background: rgba(198,40,40,.1);
	color: var(--by-primary);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: .9em;
}
.by-article__body pre code { background: none; color: inherit; padding: 0; }

/* Spec table */
.by-spec-table-wrap { margin: 32px 0; }
.by-spec-table__heading {
	font-family: var(--by-font-heading);
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: 16px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--by-primary);
}
.by-spec-table {
	width: 100%;
	border-collapse: collapse;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.by-spec-table th,
.by-spec-table td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid var(--by-border);
}
.by-spec-table th {
	background: var(--by-primary);
	color: #fff;
	font-weight: 600;
	width: 40%;
}
.by-spec-table tr:nth-child(even) td { background: var(--by-surface); }
.by-spec-table tr:last-child th,
.by-spec-table tr:last-child td { border-bottom: none; }

/* Ratings */
.by-ratings { margin: 32px 0; }
.by-ratings__heading {
	font-family: var(--by-font-heading);
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: 20px;
}
.by-ratings__overall {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 24px;
}
.by-ratings__score {
	font-size: 3rem;
	font-weight: 800;
	color: var(--by-primary);
	line-height: 1;
}
.by-ratings__stars { font-size: 1.4rem; color: #f5a623; }
.by-ratings__label { color: var(--by-text-muted); font-size: .9rem; }
.by-ratings__row {
	display: grid;
	grid-template-columns: 160px 1fr 50px;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}
.by-ratings__bar-wrap {
	background: var(--by-border);
	border-radius: 8px;
	height: 8px;
	overflow: hidden;
}
.by-ratings__bar {
	height: 100%;
	background: var(--by-primary);
	border-radius: 8px;
	transition: width .5s ease;
}
.by-ratings__row-score {
	font-weight: 600;
	font-size: .9rem;
	text-align: right;
}

/* TOC */
.by-toc {
	background: var(--by-surface);
	border: 1px solid var(--by-border);
	border-radius: 12px;
	padding: 20px;
	margin-bottom: 24px;
}
.by-toc__heading {
	font-family: var(--by-font-heading);
	font-size: 1rem;
	font-weight: 700;
	margin: 0 0 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--by-primary);
}
.by-toc__list {
	margin: 0;
	padding-left: 20px;
}
.by-toc__item { margin-bottom: 6px; }
.by-toc__item--sub { margin-left: 16px; }
.by-toc__link {
	color: var(--by-text);
	text-decoration: none;
	font-size: .85rem;
	transition: color .2s;
}
.by-toc__link:hover,
.by-toc__link--active { color: var(--by-primary); font-weight: 600; }

/* Floating share sidebar */
.by-share-float {
	position: fixed;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	gap: 8px;
	z-index: 100;
}
.by-share-float__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--by-surface);
	border: 1px solid var(--by-border);
	color: var(--by-text);
	text-decoration: none;
	transition: all .2s;
	box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.by-share-float__btn:hover { background: var(--by-primary); color: #fff; border-color: var(--by-primary); }

/* Share bar */
.by-share-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin: 32px 0;
}
.by-share-bar__label { font-weight: 600; }
.by-share-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	border-radius: 8px;
	font-size: .85rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	border: none;
	transition: opacity .2s;
}
.by-share-btn:hover { opacity: .85; }
.by-share-btn--facebook  { background: #1877f2; color: #fff; }
.by-share-btn--whatsapp  { background: #25d366; color: #fff; }
.by-share-btn--twitter   { background: #000; color: #fff; }
.by-share-btn--copy      { background: var(--by-surface); color: var(--by-text); border: 1px solid var(--by-border); }

/* Tags */
.by-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.by-tag-pill {
	display: inline-block;
	padding: 4px 14px;
	background: rgba(198,40,40,.1);
	color: var(--by-primary);
	border-radius: 20px;
	font-size: .8rem;
	font-weight: 600;
	text-decoration: none;
	transition: background .2s;
}
.by-tag-pill:hover { background: var(--by-primary); color: #fff; }

/* Author box */
.by-author-box {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	background: var(--by-surface);
	border: 1px solid var(--by-border);
	border-radius: 12px;
	padding: 24px;
	margin: 32px 0;
}
.by-author-box__avatar img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.by-author-box__role { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--by-primary); font-weight: 600; }
.by-author-box__name { font-family: var(--by-font-heading); font-size: 1.2rem; font-weight: 700; margin: 4px 0 8px; }
.by-author-box__name a { color: inherit; text-decoration: none; }
.by-author-box__bio { color: var(--by-text-muted); font-size: .9rem; margin: 0; }

/* Post navigation */
.by-post-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin: 32px 0;
	border-top: 1px solid var(--by-border);
	padding-top: 24px;
}
.by-post-nav__item { display: flex; flex-direction: column; gap: 4px; }
.by-post-nav__item--next { text-align: right; }
.by-post-nav__label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--by-text-muted); }
.by-post-nav__link { font-weight: 600; color: var(--by-text); text-decoration: none; font-size: .95rem; }
.by-post-nav__link:hover { color: var(--by-primary); }

/* Copy protect notice */
.by-copy-notice {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	background: rgba(0,0,0,.85);
	color: #fff;
	padding: 12px 24px;
	border-radius: 8px;
	font-size: .9rem;
	z-index: 9999;
	opacity: 0;
	transition: opacity .3s, transform .3s;
	pointer-events: none;
}
.by-copy-notice--show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Copy protection CSS */
.by-copy-protect { user-select: none; }
.by-copy-protect img { pointer-events: none; -webkit-user-drag: none; user-drag: none; }

/* Related posts heading */
.by-related { margin-top: 40px; }

/* Comparison table */
.by-comparison { padding: 32px 0; }
.by-comparison__heading { font-family: var(--by-font-heading); font-size: 2rem; font-weight: 800; margin-bottom: 32px; }
.by-comparison__heads { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
.by-comparison__head { text-align: center; background: var(--by-surface); border-radius: 12px; padding: 24px; }
.by-comparison__head img { width: 100%; max-height: 200px; object-fit: contain; border-radius: 8px; margin-bottom: 16px; }
.by-comparison__head h2 { font-family: var(--by-font-heading); font-size: 1.3rem; font-weight: 700; }
.by-comparison__table { width: 100%; border-collapse: collapse; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.by-comparison__table thead th { background: var(--by-primary); color: #fff; padding: 14px 16px; text-align: left; }
.by-comparison__table tbody th,
.by-comparison__table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--by-border); }
.by-comparison__table tbody th { background: var(--by-surface); font-weight: 600; width: 30%; }
.by-comparison__table tbody tr:nth-child(even) td { background: rgba(0,0,0,.02); }
.by-comparison__bar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--by-dark-bg); color: #fff; padding: 16px 24px; display: flex; align-items: center; gap: 16px; z-index: 200; box-shadow: 0 -4px 16px rgba(0,0,0,.2); }
.by-comparison__bar-items { display: flex; gap: 8px; flex: 1; }
.by-compare-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.15); padding: 4px 12px; border-radius: 20px; font-size: .85rem; }
.by-compare-chip__remove { background: none; border: none; color: #fff; cursor: pointer; font-size: 1rem; padding: 0 2px; }

/* Responsive */
@media ( max-width: 768px ) {
	.by-layout--article { grid-template-columns: 1fr; }
	.by-article-sidebar { position: static; }
	.by-share-float { display: none; }
	.by-article-hero__content { position: static; background: var(--by-bg); padding: 20px 16px; }
	.by-article-hero__title { color: var(--by-text); }
	.by-article-hero__meta { color: var(--by-text-muted); }
	.by-comparison__heads { grid-template-columns: 1fr; }
	.by-ratings__row { grid-template-columns: 120px 1fr 40px; }
	.by-post-nav { grid-template-columns: 1fr; }
}
