/**
 * SWAPNEWS Phase 4 — Polish Styles
 *
 * - Bookmark button + saved state
 * - Recently Viewed widget
 * - Bookmarks widget
 * - Bookmarks/History full pages
 * - Skip link (accessibility)
 */

/* =========================================================================
 * 1. BOOKMARK BUTTON
 * ====================================================================== */
.sn-bookmark-wrap {
	margin: 24px 0;
	text-align: center;
}
.sn-bookmark-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 22px;
	background: var(--bg-color, #fff);
	color: var(--font-color, #111);
	border: 2px solid rgba(0, 0, 0, 0.12);
	border-radius: 999px;
	font-family: 'Heebo', sans-serif;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: all .15s ease;
}
.sn-bookmark-btn:hover {
	border-color: #D13438;
	color: #D13438;
	transform: translateY(-1px);
}
.sn-bookmark-btn.is-saved {
	background: #D13438;
	color: #fff;
	border-color: #D13438;
}
.sn-bookmark-btn__icon {
	display: inline-flex;
	width: 20px;
	height: 20px;
}
.sn-bookmark-btn__on { display: none; }
.sn-bookmark-btn__off { display: inline-block; }
.sn-bookmark-btn.is-saved .sn-bookmark-btn__off { display: none; }
.sn-bookmark-btn.is-saved .sn-bookmark-btn__on { display: inline-block; }

.sn-bookmark-btn__on-text { display: none; }
.sn-bookmark-btn.is-saved .sn-bookmark-btn__off-text { display: none; }
.sn-bookmark-btn.is-saved .sn-bookmark-btn__on-text { display: inline; }


/* =========================================================================
 * 2. RECENTLY VIEWED + BOOKMARKS WIDGETS
 * ====================================================================== */
.sn-recently-viewed,
.sn-bookmarks-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.sn-recently-viewed li,
.sn-bookmarks-list li {
	margin: 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.sn-recently-viewed li:last-child,
.sn-bookmarks-list li:last-child {
	border-bottom: none;
}
.sn-recently-viewed a,
.sn-bookmarks-list a {
	display: flex;
	gap: 10px;
	padding: 10px 0;
	color: var(--font-color, #111);
	text-decoration: none;
	transition: padding-left .15s, color .15s;
}
.sn-recently-viewed a:hover,
.sn-bookmarks-list a:hover {
	color: #D13438;
	padding-left: 4px;
}
.sn-recently-viewed img,
.sn-bookmarks-list img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
}
.sn-recently-viewed__text,
.sn-bookmarks-list__text {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
}
.sn-recently-viewed__cat,
.sn-bookmarks-list__cat {
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #D13438;
	margin-bottom: 2px;
}
.sn-recently-viewed__title,
.sn-bookmarks-list__title {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.sn-recently-viewed__placeholder,
.sn-bookmarks-list__placeholder,
.sn-recently-viewed__empty,
.sn-bookmarks-list__empty {
	padding: 14px 0;
	color: #999;
	font-size: 13px;
	text-align: center;
}
.sn-bookmarks-list__viewall {
	display: block;
	margin-top: 10px;
	font-size: 12px;
	font-weight: 700;
	color: #D13438;
	text-decoration: none;
}

/* =========================================================================
 * 3. BOOKMARKS / HISTORY FULL PAGE
 * ====================================================================== */
.sn-bookmarks-page-wrap {
	max-width: 1200px;
	margin: 30px auto;
	padding: 0 20px;
	font-family: 'Heebo', sans-serif;
}
.sn-bookmarks-page-wrap h1 {
	font-size: 32px;
	font-weight: 800;
	margin: 0 0 6px;
	color: var(--font-color, #111);
}
.sn-bookmarks-page-wrap > p {
	color: #888;
	font-size: 14px;
	margin: 0 0 30px;
}
.sn-bookmarks-page__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
}
.sn-bookmark-card {
	position: relative;
	background: var(--bg-color-dua, #fff);
	border-radius: 12px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	overflow: hidden;
	transition: transform .2s, box-shadow .2s;
}
.sn-bookmark-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.sn-bookmark-card__link {
	display: block;
	color: var(--font-color, #111);
	text-decoration: none;
}
.sn-bookmark-card__thumb img {
	width: 100%;
	height: 160px;
	object-fit: cover;
	display: block;
}
.sn-bookmark-card__body {
	padding: 14px 16px;
}
.sn-bookmark-card__cat {
	display: inline-block;
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: #D13438;
	margin-bottom: 6px;
}
.sn-bookmark-card__title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
	margin: 0 0 6px;
}
.sn-bookmark-card__time {
	font-size: 12px;
	color: #888;
}
.sn-bookmark-card__remove {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	border: none;
	cursor: pointer;
	font-size: 14px;
	font-weight: 800;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur(6px);
	transition: background .15s, transform .15s;
}
.sn-bookmark-card__remove:hover {
	background: #dc2626;
	transform: scale(1.1);
}
.sn-bookmarks-page__empty {
	padding: 60px 20px;
	text-align: center;
	color: #999;
	background: rgba(0, 0, 0, 0.03);
	border-radius: 12px;
}

/* =========================================================================
 * 4. SKIP LINK (Accessibility)
 * ====================================================================== */
.sn-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 99999;
	padding: 12px 20px;
	background: #D13438;
	color: #fff;
	font-family: 'Heebo', sans-serif;
	font-weight: 700;
	text-decoration: none;
	border-radius: 0 0 8px 0;
}
.sn-skip-link:focus {
	left: 0;
}

/* =========================================================================
 * Mobile fine-tuning
 * ====================================================================== */
@media (max-width: 600px) {
	.sn-bookmark-card__thumb img { height: 140px; }
}

/* =========================================================================
 * Dark mode
 * ====================================================================== */
[data-theme="dark"] .sn-bookmark-btn {
	border-color: rgba(255, 255, 255, 0.15);
}
[data-theme="dark"] .sn-bookmark-card {
	background: #1a1a1a;
	border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .sn-recently-viewed li,
[data-theme="dark"] .sn-bookmarks-list li {
	border-bottom-color: rgba(255, 255, 255, 0.06);
}
