/* =========================================================================
   Careline - "Careline Obsidian" art direction
   Mobile first. Media queries only widen, never the other way round.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Self-hosted Poppins
   ------------------------------------------------------------------------- */
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/poppins-400-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/poppins-400-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url('../fonts/poppins-500-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url('../fonts/poppins-500-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('../fonts/poppins-600-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('../fonts/poppins-600-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('../fonts/poppins-700-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('../fonts/poppins-700-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* -------------------------------------------------------------------------
   2. Tokens
   ------------------------------------------------------------------------- */
:root {
	--bg: #171717;
	--surface: #1E1B1D;
	--raised: #272227;
	--ink: #F8FAFC;
	--muted: #A39BA0;
	--border: #2E292C;
	--accent: #FF3489;
	--support: #CBF484;
	--forest: #0E534D;

	--font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

	--r-sm: 4px;
	--r-md: 8px;
	--r-pill: 999px;

	--s-xs: 4px;
	--s-sm: 8px;
	--s-md: 16px;
	--s-lg: 24px;
	--s-xl: 40px;
	--s-xxl: 64px;

	--container: 1280px;
	--container-wide: 1600px;
	--gutter: 16px;

	--side-col: 400px;
	--side-gap: 40px;
}

@media (min-width: 640px) {
	:root { --gutter: 24px; }
}

/* -------------------------------------------------------------------------
   3. Reset wrapped in :where() so it never outranks a component rule
   ------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

:where(body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol) {
	margin: 0;
	padding: 0;
}

:where(ul, ol) { list-style: none; }

:where(img, picture, svg, video) {
	display: block;
	max-width: 100%;
}

:where(button, input, select, textarea) {
	font: inherit;
	color: inherit;
}

:where(a) {
	color: inherit;
	text-decoration: none;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	background-color: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.6;
	letter-spacing: -0.01em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

body.drawer-is-open { overflow: hidden; }

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: var(--r-sm);
}

/* -------------------------------------------------------------------------
   4. Utilities
   ------------------------------------------------------------------------- */
.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.container--wide { max-width: var(--container-wide); }

.u-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	top: -100px;
	left: var(--gutter);
	z-index: 200;
	padding: 10px 16px;
	background: var(--support);
	color: var(--bg);
	font-size: 14px;
	font-weight: 600;
	border-radius: var(--r-pill);
}

.skip-link:focus { top: 12px; }

/* -------------------------------------------------------------------------
   5. Buttons and icons
   ------------------------------------------------------------------------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 38px;
	padding-inline: 20px;
	border: 0;
	border-radius: var(--r-pill);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: -0.01em;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.btn--primary {
	background: var(--support);
	color: #171717;
}

/* On mobile the button tightens so the logo stays exactly centered. */
@media (max-width: 699px) {
	.btn {
		height: 34px;
		padding-inline: 14px;
		font-size: 13px;
	}
}

.btn--primary:hover { background: #DBFF9E; }

.btn--ghost {
	background: var(--raised);
	color: var(--ink);
}

.btn--ghost:hover { background: #332C32; }

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	flex: 0 0 auto;
	background: transparent;
	border: 0;
	border-radius: var(--r-pill);
	color: var(--ink);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover { background: var(--raised); }
.icon-btn svg { width: 21px; height: 21px; }

/* -------------------------------------------------------------------------
   6. Header
   ------------------------------------------------------------------------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--bg);
	border-bottom: 1px solid var(--border);
}

.topbar__inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: var(--s-sm);
	min-height: 56px;
}

.topbar__left,
.topbar__right {
	display: flex;
	align-items: center;
	gap: var(--s-xs);
	min-width: 0;
}

.topbar__right { justify-content: flex-end; }

.brand {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
}

.brand img {
	height: 26px;
	width: auto;
}

/* Icons and buttons hidden on small screens, revealed on desktop */
.topbar__tools { display: none; }
.btn--login { display: none; }

/* Search: icon only on mobile, full field on desktop */
.search {
	display: none;
	align-items: center;
	gap: var(--s-sm);
	width: 260px;
	height: 38px;
	padding-inline: 14px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--r-pill);
}

.search svg {
	width: 17px;
	height: 17px;
	flex: 0 0 auto;
	color: var(--muted);
}

.search__field {
	width: 100%;
	min-width: 0;
	background: transparent;
	border: 0;
	color: var(--ink);
	font-size: 14px;
	letter-spacing: -0.01em;
}

.search__field::placeholder { color: var(--muted); }
.search__field:focus { outline: none; }

.site-header.search-is-open .search {
	position: absolute;
	inset-inline: var(--gutter);
	top: 9px;
	z-index: 3;
	display: flex;
	width: auto;
}

/* Section row */
.sections { position: relative; }

/* Functional overflow cue, not decoration: it appears only while there are
   sections left to reach, and disappears at the end of the row. */
.sections::after {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	right: 0;
	width: 56px;
	opacity: 0;
	pointer-events: none;
	background: linear-gradient(to right, rgba(23, 23, 23, 0), var(--bg) 78%);
	transition: opacity 0.2s ease;
}

.sections.is-scrollable:not(.is-end)::after { opacity: 1; }

.sections__list {
	display: flex;
	align-items: stretch;
	gap: 22px;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.sections__list::-webkit-scrollbar { display: none; }

.sections__list a {
	display: inline-flex;
	align-items: center;
	padding-block: 11px;
	border-bottom: 2px solid transparent;
	color: var(--ink);
	font-size: 15px;
	font-weight: 500;
	letter-spacing: -0.01em;
	white-space: nowrap;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.sections__list a:hover { color: var(--accent); }

.sections__list .is-current a,
.sections__list .current-menu-item a {
	color: var(--accent);
	border-bottom-color: var(--accent);
}

/* -------------------------------------------------------------------------
   7. Side drawer (mobile)
   ------------------------------------------------------------------------- */
.drawer {
	position: fixed;
	inset: 0;
	z-index: 150;
	visibility: hidden;
}

.drawer.is-open { visibility: visible; }

.drawer__scrim {
	position: absolute;
	inset: 0;
	background: rgba(23, 23, 23, 0.72);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.drawer.is-open .drawer__scrim { opacity: 1; }

.drawer__panel {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	width: min(340px, 86vw);
	background: var(--surface);
	border-inline-end: 1px solid var(--border);
	padding: var(--s-lg) var(--s-lg) var(--s-xxl);
	overflow-y: auto;
	transform: translateX(-100%);
	transition: transform 0.2s ease;
}

.drawer.is-open .drawer__panel { transform: translateX(0); }

.drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-md);
	padding-bottom: var(--s-lg);
	border-bottom: 1px solid var(--border);
}

.drawer__head img { height: 24px; width: auto; }

.drawer__list { padding-block: var(--s-sm); }

.drawer__list a {
	display: block;
	padding-block: 12px;
	border-bottom: 1px solid var(--border);
	font-size: 16px;
	font-weight: 500;
	letter-spacing: -0.01em;
	transition: color 0.15s ease;
}

.drawer__list a:hover { color: var(--accent); }
.drawer__list .is-current a { color: var(--accent); }

.drawer__actions {
	display: flex;
	flex-direction: column;
	gap: var(--s-sm);
	padding-top: var(--s-lg);
}

.drawer__actions .btn { width: 100%; }

/* -------------------------------------------------------------------------
   8. Home page grid
   ------------------------------------------------------------------------- */
.home {
	padding-block: var(--s-lg) var(--s-xxl);
}

.home__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--s-xl);
}

/* -------------------------------------------------------------------------
   9. Image placeholders
   ------------------------------------------------------------------------- */
.media {
	position: relative;
	overflow: hidden;
	border-radius: var(--r-sm);
	background: var(--surface);
}

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

.media--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px dashed var(--border);
	background: var(--surface);
}

.media__slot {
	color: var(--muted);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-align: center;
	padding: var(--s-sm);
}

.media--16x9 { aspect-ratio: 16 / 9; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--ad { aspect-ratio: 6 / 5; }

/* -------------------------------------------------------------------------
   10. Lead story
   ------------------------------------------------------------------------- */
.lead__media { display: block; }

.lead__title {
	margin-top: var(--s-md);
	font-size: 24px;
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.lead__title a { transition: color 0.15s ease; }
.lead__title a:hover { color: var(--accent); }

.lead__related {
	margin-top: var(--s-lg);
	border-inline-start: 2px solid var(--accent);
	padding-inline-start: var(--s-md);
	display: flex;
	flex-direction: column;
	gap: var(--s-md);
}

.lead__related li {
	position: relative;
	padding-inline-start: 14px;
}

.lead__related li::before {
	content: '';
	position: absolute;
	inset-inline-start: 0;
	top: 0.62em;
	width: 5px;
	height: 5px;
	border-radius: var(--r-pill);
	background: var(--accent);
}

.lead__related a {
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
	transition: color 0.15s ease;
}

.lead__related a:hover { color: var(--accent); }

.kicker {
	display: block;
	margin-bottom: 2px;
	color: var(--accent);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.badge {
	display: inline-block;
	margin-inline-start: 6px;
	padding: 1px 7px;
	border-radius: var(--r-sm);
	background: var(--support);
	color: #171717;
	font-size: 10px;
	font-weight: 600;
	line-height: 1.6;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	vertical-align: 2px;
}

.lead__foot {
	display: flex;
	align-items: center;
	gap: var(--s-md);
	margin-top: var(--s-lg);
}

.bookmark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex: 0 0 auto;
	background: transparent;
	border: 1px solid var(--border);
	border-radius: var(--r-pill);
	color: var(--ink);
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.bookmark:hover { background: var(--raised); border-color: var(--raised); }
.bookmark svg { width: 16px; height: 16px; }

.tag {
	display: inline-flex;
	align-items: center;
	height: 30px;
	padding-inline: 14px;
	border-radius: var(--r-pill);
	background: var(--forest);
	color: var(--ink);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: -0.01em;
	transition: background-color 0.15s ease;
}

.tag:hover { background: #14655E; }

/* -------------------------------------------------------------------------
   11. Sidebar
   ------------------------------------------------------------------------- */
.side {
	display: flex;
	flex-direction: column;
	gap: var(--s-lg);
}

.ad__label {
	display: block;
	margin-bottom: 6px;
	color: var(--muted);
	font-size: 10px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.block-title {
	font-size: 22px;
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.block-title::after {
	content: '';
	display: block;
	width: 52px;
	height: 3px;
	margin-top: 10px;
	background: var(--accent);
}

.feed { padding-top: var(--s-lg); border-top: 1px solid var(--border); }
.feed__list { margin-top: var(--s-md); }

.feed__item {
	display: flex;
	gap: 12px;
	padding-block: var(--s-md);
	border-bottom: 1px solid var(--border);
}

.feed__time {
	flex: 0 0 auto;
	color: var(--accent);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.35;
	font-variant-numeric: tabular-nums;
}

.feed__title {
	font-size: 17px;
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: -0.01em;
	transition: color 0.15s ease;
}

.feed__title:hover { color: var(--accent); }

/* -------------------------------------------------------------------------
   12. Footer (provisional)
   ------------------------------------------------------------------------- */
.site-footer {
	border-top: 1px solid var(--border);
	padding-block: var(--s-xl);
}

.site-footer__inner {
	display: flex;
	flex-direction: column;
	gap: var(--s-md);
	align-items: flex-start;
}

.site-footer img { height: 24px; width: auto; }

.site-footer p {
	color: var(--muted);
	font-size: 14px;
}

/* -------------------------------------------------------------------------
   13. Trending Deals
   ------------------------------------------------------------------------- */
.deals {
	margin-top: var(--s-xl);
	padding-top: var(--s-lg);
	border-top: 1px solid var(--ink);
}

.deals__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--s-md);
}

.deals__title {
	font-size: 26px;
	font-weight: 600;
	line-height: 1.05;
	letter-spacing: -0.02em;
}

.deals__more {
	flex: 0 0 auto;
	font-size: 15px;
	font-weight: 500;
	letter-spacing: -0.01em;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.15s ease;
}

.deals__more:hover { color: var(--accent); }

.deals__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-items: start;
	gap: var(--s-xl);
	margin-top: var(--s-lg);
}

.deal {
	padding-block: 18px;
	border-bottom: 1px solid var(--border);
}

.deal:first-child { padding-top: 0; }

.deal__name {
	display: block;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.01em;
	transition: color 0.15s ease;
}

.deal__name:hover { color: var(--accent); }

.deal__offer {
	margin-top: 4px;
	color: var(--muted);
	font-size: 15px;
	line-height: 1.5;
}

.deals__cards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--s-lg) var(--s-md);
}

.deal-card__name {
	margin-top: 12px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.deal-card__name a { transition: color 0.15s ease; }
.deal-card__name a:hover { color: var(--accent); }

.deal-card__offer {
	margin-top: 4px;
	color: var(--muted);
	font-size: 14px;
	line-height: 1.5;
}

/* -------------------------------------------------------------------------
   14. Generic story list (index, archives, search)
   ------------------------------------------------------------------------- */
.stack {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--s-xl);
}

.card__title {
	margin-top: var(--s-sm);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.card__title a:hover { color: var(--accent); }

.card__meta {
	margin-top: 6px;
	color: var(--muted);
	font-size: 13px;
}

.page-title {
	margin-bottom: var(--s-lg);
	font-size: 26px;
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.prose {
	max-width: 65ch;
	font-size: 17px;
	line-height: 1.7;
}

.prose p { margin-bottom: 1.2em; }

/* -------------------------------------------------------------------------
   15. Responsive breakpoints
   ------------------------------------------------------------------------- */
/* Below 1024px the columns stack, so a trailing rule at the end of a list lands
   right next to the next section's own rule and reads as a double line. */
@media (max-width: 1023px) {
	.feed__item:last-child,
	.deal:last-child {
		border-bottom: 0;
	}
}

@media (min-width: 700px) {
	.lead__title { font-size: 27px; }
	.deals__title { font-size: 30px; }
	.deal-card__name { font-size: 19px; }
	.deal-card__offer { font-size: 15px; }
	.topbar__inner { min-height: 60px; }
	.brand img { height: 28px; }
	.btn--login { display: inline-flex; }
	.stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
	:root { --gutter: 24px; }

	.home { padding-block: var(--s-xl) var(--s-xxl); }

	.home__grid {
		grid-template-columns: minmax(0, 1fr) calc(var(--side-col) + var(--side-gap) + 1px);
		gap: 0;
	}

	.side {
		border-inline-start: 1px solid var(--border);
		padding-inline-start: var(--side-gap);
		margin-inline-start: var(--side-gap);
	}

	.js-drawer-toggle { display: inline-flex; }
	.js-search-toggle { display: none; }

	.search { display: flex; }

	.topbar__tools { display: flex; align-items: center; gap: var(--s-xs); }

	.topbar__right { gap: var(--s-sm); }

	.brand img { height: 33px; }

	.lead__title { font-size: 30px; }

	.deals { margin-top: var(--s-xxl); padding-top: 28px; }
	.deals__title { font-size: 32px; }

	.deals__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: var(--side-gap);
	}

	/* The cards come first in the markup so they sit above the list on mobile.
	   Explicit placement puts them back on the right on desktop. */
	.deals__list {
		grid-column: 1;
		grid-row: 1;
	}

	.deals__cards {
		grid-column: 2 / span 2;
		grid-row: 1;
		gap: 32px var(--side-gap);
	}

	.stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
	.sections__list { gap: 26px; }
}

/* -------------------------------------------------------------------------
   16. Reduced motion
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}
