/* ==========================================================================
   DailyEvolve — page layouts (header, home, single, archive, footer)
   ========================================================================== */

/* Header ----------------------------------------------------------------- */
.de-topbar {
	background: var(--de-ink);
	color: #fff;
	font-size: .82rem;
}
.de-topbar .de-container { display: flex; justify-content: space-between; align-items: center; min-height: 38px; }
.de-topbar a { color: #d1d5db; }
.de-topbar a:hover { color: #fff; }
.de-topbar__actions { display: flex; gap: 18px; align-items: center; }

.de-header { border-bottom: 1px solid var(--de-line); background: var(--de-bg); }
.de-header .de-container { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 66px; }
.de-logo { font-family: var(--de-font-head); font-weight: 800; font-size: 1.55rem; color: var(--de-ink); letter-spacing: -0.02em; line-height: 0; }
.de-logo span { color: var(--de-green); }
/* Cap the custom logo so it never blows up the header height. */
.de-logo--img { display: flex; align-items: center; }
.de-logo img, .de-logo .custom-logo, .de-header .custom-logo { max-height: 46px; width: auto; height: auto; }

/* Top-level menu is a row; submenus are dropdowns. */
.de-nav > ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; align-items: center; }
.de-nav li { position: relative; }
.de-nav a { color: var(--de-ink); font-weight: 600; font-size: .95rem; }
.de-nav a:hover { color: var(--de-green); }
.de-nav .current-menu-item > a, .de-nav .current-menu-parent > a { color: var(--de-green); }
/* Indicate items that have a dropdown. */
.de-nav .menu-item-has-children > a::after { content: "\25BE"; font-size: .7em; margin-left: 5px; color: var(--de-muted); }

/* Dropdown submenus */
.de-nav .sub-menu {
	display: block;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 210px;
	list-style: none;
	margin: 0;
	padding: 8px 0;
	background: #fff;
	border: 1px solid var(--de-line);
	border-radius: 12px;
	box-shadow: var(--de-shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s;
	z-index: 60;
}
.de-nav li:hover > .sub-menu,
.de-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.de-nav .sub-menu li { display: block; }
.de-nav .sub-menu a { display: block; padding: 9px 18px; font-weight: 500; white-space: nowrap; }
.de-nav .sub-menu a:hover { background: var(--de-bg-soft); }

/* Tag bar ---------------------------------------------------------------- */
.de-tagbar { border-bottom: 1px solid var(--de-line); background: var(--de-bg-soft); }
.de-tagbar .de-container { display: flex; gap: 10px; overflow-x: auto; padding-block: 12px; scrollbar-width: thin; }
.de-tagbar a {
	flex: 0 0 auto;
	font-size: .85rem; font-weight: 600;
	color: var(--de-body);
	background: #fff;
	border: 1px solid var(--de-line);
	padding: 6px 14px; border-radius: 999px;
	white-space: nowrap;
}
.de-tagbar a:hover { color: var(--de-green); border-color: var(--de-green); }

/* Home: 3-column grid ---------------------------------------------------- */
.de-home { padding-block: 36px; }
.de-home__grid {
	display: grid;
	grid-template-columns: 1fr 1.6fr 1fr;
	gap: var(--de-gap);
	align-items: start;
}
.de-col-list { display: flex; flex-direction: column; gap: var(--de-gap); }
.de-col-feature { display: flex; flex-direction: column; gap: var(--de-gap); }
.de-col-side { display: flex; flex-direction: column; gap: 16px; }

/* Hero feature ----------------------------------------------------------- */
.de-hero { position: relative; border-radius: var(--de-radius); overflow: hidden; min-height: 440px; display: flex; align-items: flex-end; }
.de-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.de-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.82) 100%); }
.de-hero__body { position: relative; z-index: 2; padding: 28px; color: #fff; }
.de-hero__title { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 10px 0; }
.de-hero__title a { color: #fff; }
.de-hero .de-meta, .de-hero .de-meta a { color: #e5e7eb; }

/* Popular Now ------------------------------------------------------------ */
.de-popular { background: var(--de-bg-soft); border: 1px solid var(--de-line); border-radius: var(--de-radius); padding: 18px; }
.de-popular__item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--de-line); }
.de-popular__item:last-child { border-bottom: 0; }
.de-popular__thumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; }
.de-popular__thumb img { width: 100%; height: 100%; object-fit: cover; }
.de-popular__title { font-size: .92rem; font-weight: 600; }
.de-popular__title a { color: var(--de-ink); }
.de-popular__title a:hover { color: var(--de-green); }

/* Two-column content layout (archive + single) -------------------------- */
.de-layout { padding-block: 36px; }
.de-layout__grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; align-items: start; }

/* Archive grid ----------------------------------------------------------- */
.de-archive-head { margin-bottom: 26px; }
.de-archive-head h1 { margin-bottom: 6px; }
.de-archive-head p { color: var(--de-muted); margin: 0; }
.de-post-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--de-gap); }

/* Pagination ------------------------------------------------------------- */
.de-pagination { margin-top: 36px; display: flex; gap: 8px; flex-wrap: wrap; }
.de-pagination .page-numbers {
	display: inline-flex; min-width: 40px; height: 40px; align-items: center; justify-content: center;
	border: 1px solid var(--de-line); border-radius: 8px; padding: 0 12px; color: var(--de-ink); font-weight: 600;
}
.de-pagination .page-numbers.current { background: var(--de-green); color: #fff; border-color: var(--de-green); }
.de-pagination a.page-numbers:hover { border-color: var(--de-green); color: var(--de-green); }

/* Single post ------------------------------------------------------------ */
.de-single__header { margin-bottom: 22px; }
.de-single__title { margin: 12px 0; }
.de-single__featured { border-radius: var(--de-radius); overflow: hidden; margin-bottom: 28px; }
.de-single__content { font-size: 1.08rem; }
.de-single__content > * { margin-bottom: 1.1em; }
.de-single__content p { margin-bottom: 1.1em; }
/* Headings: clear space above, tight to the text they introduce. */
.de-single__content h2 { font-size: 1.6rem; margin-top: 2em; margin-bottom: .5em; }
.de-single__content h3 { font-size: 1.28rem; margin-top: 1.6em; margin-bottom: .4em; }
.de-single__content h4 { font-size: 1.1rem; margin-top: 1.4em; margin-bottom: .35em; }
.de-single__content h2 + p, .de-single__content h3 + p, .de-single__content h4 + p { margin-top: 0; }
.de-single__content ul, .de-single__content ol { margin-bottom: 1.1em; padding-left: 1.4em; }
.de-single__content li { margin-bottom: .4em; }
.de-single__content img { border-radius: 10px; margin-block: 1.5em; }
.de-single__content blockquote {
	border-left: 4px solid var(--de-green); margin: 1.5em 0; padding: 6px 0 6px 20px;
	font-size: 1.15rem; color: var(--de-ink); font-style: italic;
}
.de-single__content a { text-decoration: underline; }

/* Author box ------------------------------------------------------------- */
.de-authorbox {
	display: flex; gap: 18px; align-items: flex-start;
	background: var(--de-bg-soft); border: 1px solid var(--de-line);
	border-radius: var(--de-radius); padding: 22px; margin: 36px 0;
}
.de-authorbox__avatar { flex: 0 0 76px; }
.de-authorbox__avatar img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; display: block; }
.de-authorbox__name { font-family: var(--de-font-head); font-weight: 700; color: var(--de-ink); font-size: 1.1rem; }
.de-authorbox__role { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--de-blue); margin-left: 8px; }
.de-authorbox__bio { font-size: .92rem; margin: 6px 0 10px; }
.de-authorbox__social a { margin-right: 12px; font-size: .85rem; font-weight: 600; }

/* Sidebar widgets -------------------------------------------------------- */
.de-widget { margin-bottom: 30px; }
.de-widget__title { font-size: 1.05rem; padding-bottom: 8px; border-bottom: 2px solid var(--de-ink); margin-bottom: 14px; }
.de-widget ul { list-style: none; margin: 0; padding: 0; }
.de-widget li { padding: 7px 0; border-bottom: 1px dashed var(--de-line); }

/* Footer ----------------------------------------------------------------- */
.de-footer { background: var(--de-ink); color: #cbd5e1; margin-top: 50px; padding: 48px 0 28px; }
.de-footer a { color: #cbd5e1; }
.de-footer a:hover { color: #fff; }
.de-footer__cols { display: grid; grid-template-columns: 1.5fr repeat(2, 1fr); gap: 36px; margin-bottom: 32px; }
.de-footer__bottom { border-top: 1px solid #374151; padding-top: 20px; font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* Popular-category bar (replaces hashtag bar) ---------------------------- */
.de-catbar .de-container { padding-block: 11px; }
.de-catbar a {
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .02em;
	color: var(--de-ink);
	background: #fff;
	border: 1px solid var(--de-line);
	padding: 6px 15px;
	border-radius: 999px;
}
.de-catbar a:hover { color: #fff; background: var(--de-green); border-color: var(--de-green); }

/* Home: balanced feature row -------------------------------------------- */
.de-home { padding-block: 34px; }
.de-feature-row { display: grid; grid-template-columns: 1.7fr 1fr; gap: var(--de-gap); align-items: start; margin-bottom: var(--de-gap); }
.de-feature { background: var(--de-bg); border: 1px solid var(--de-line); border-radius: var(--de-radius); overflow: hidden; }
.de-feature__media { display: block; position: relative; aspect-ratio: 16 / 9; background: var(--de-bg-soft); }
.de-feature__media img { width: 100%; height: 100%; object-fit: cover; }
.de-feature__badge { position: absolute; top: 14px; left: 14px; }
.de-feature__body { padding: 20px 24px 26px; }
.de-feature__title { font-size: clamp(1.4rem, 2.4vw, 2rem); margin: 4px 0 10px; }
.de-feature__title a { color: var(--de-ink); }
.de-feature__title a:hover { color: var(--de-green); }
.de-feature__excerpt { color: var(--de-body); margin: 0 0 14px; }
.de-feature__side { display: flex; flex-direction: column; gap: 16px; }

/* Uniform card grid ------------------------------------------------------ */
.de-post-grid--3 { grid-template-columns: repeat(3, 1fr); }

/* Related posts row ------------------------------------------------------ */
.de-single .de-post-grid,
.de-layout__content .de-post-grid { grid-template-columns: repeat(3, 1fr); }

/* Mobile menu toggle base ------------------------------------------------ */
.de-menu-toggle { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--de-ink); }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1024px) {
	.de-feature-row { grid-template-columns: 1fr; }
	.de-post-grid--3 { grid-template-columns: repeat(2, 1fr); }
	.de-layout__grid { grid-template-columns: 1fr; }
	.de-layout__sidebar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
	.de-single .de-post-grid, .de-layout__content .de-post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
	body { font-size: 16px; }
	.de-post-grid, .de-post-grid--3 { grid-template-columns: 1fr; }
	.de-single .de-post-grid, .de-layout__content .de-post-grid { grid-template-columns: 1fr; }
	.de-layout__sidebar { grid-template-columns: 1fr; }
	.de-feature__body { padding: 18px 18px 22px; }

	/* Mobile nav: hidden until toggled, submenus inline */
	.de-nav { display: none; }
	.de-nav.is-open { display: block; position: absolute; top: 66px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--de-line); box-shadow: var(--de-shadow); z-index: 50; }
	.de-nav.is-open > ul { flex-direction: column; align-items: stretch; padding: 12px 20px; gap: 2px; }
	.de-nav.is-open li { width: 100%; }
	.de-nav.is-open .menu-item-has-children > a::after { float: right; }
	.de-nav.is-open .sub-menu {
		position: static; opacity: 1; visibility: visible; transform: none;
		box-shadow: none; border: 0; padding: 2px 0 6px 14px; min-width: 0;
	}
	.de-menu-toggle { display: inline-flex; }
	.de-header .de-container { min-height: 58px; }
}
