/*
Theme Name:   Head Tale (Hello Elementor child)
Theme URI:    https://headtale.com/
Description:  Recreates the original blog.txt look of Head Tale on Hello Elementor. Header and footer are Elementor templates; posts, archives, sidebar and comments are handled here.
Template:     hello-elementor
Version:      1.0.0
Requires PHP: 7.4
Text Domain:  headtale-child
License:      GNU General Public License v3 or later
*/

/* ---------- Tokens (from blog.txt and its saved theme options) ---------- */
:root {
	--ht-text: #222;
	--ht-ink: #34425b;        /* links, post titles */
	--ht-ink-visited: #677284;
	--ht-ink-hover: #0d1117;
	--ht-muted: #677284;
	--ht-faint: #9aa1ae;
	--ht-rule: #ccd0d6;
	--ht-heading-grey: #4d5663;
	--ht-wash: #f6f7f8;       /* meta bar */
	--ht-quote: #ebedef;
	--ht-title: #f00;         /* site title */
	--ht-title-hover: #600;
	--ht-font-body: arial, helvetica, sans-serif;
	--ht-font-heading: tahoma, geneva, sans-serif;
	--ht-font-title: verdana, geneva, sans-serif;
	--ht-font-misc: verdana, geneva, sans-serif;
	--ht-sidebar: 17.5em;
}

/* ---------- Base ---------- */
body {
	background: #fff;
	color: var(--ht-text);
	font-family: var(--ht-font-body);
	font-size: 100%;
	line-height: 1.45;
	margin: 0;
}

a,
a:link {
	color: var(--ht-ink);
	text-decoration: none;
}
a:hover,
a:focus {
	color: var(--ht-ink-hover);
}

img {
	border: 0;
	height: auto;
	max-width: 100%;
}

/* ---------- Page frame: 90% fluid, centred (blog.txt "layoutwidth") ---------- */
.ht-wrapper {
	margin: 4em auto 2em;
	max-width: 1400px;
	width: 90%;
}

.ht-layout {
	align-items: flex-start;
	display: flex;
	gap: 3em;
}

/* Header + content share the left column; the sidebar runs from the top, as in blog.txt. */
.ht-main-col {
	flex: 1 1 auto;
	min-width: 0;
}

/* Beats Hello's body:not([class*=elementor-page-]) .site-main max-width steps (500/600/800px). */
body .ht-main-col > .site-main {
	flex: 1 1 auto;
	margin: 0;
	max-width: none;
	min-width: 0;
	padding: 0;
	width: auto;
}

/* ---------- Header (Elementor template or fallback) ---------- */
.ht-header,
.elementor .ht-site-header.e-con {
	margin: 0 0 2.5em;
}

/* .ht-site-title is the fallback <div>, or Elementor's widget wrapper around .elementor-heading-title. */
div.ht-header .ht-site-title,
.elementor-widget.ht-site-title .elementor-heading-title {
	border-bottom: 0.1em solid var(--ht-rule);
	font-family: var(--ht-font-title);
	font-size: 4em;
	font-weight: 400;
	letter-spacing: 1px;
	line-height: 1;
	margin: 0;
	padding: 0 0 0.12em;
	text-transform: uppercase;
}
/* Elementor sets the heading link to color: inherit, so colour the heading itself too. */
.elementor-widget.ht-site-title .elementor-heading-title {
	color: var(--ht-title);
}
.ht-site-title a,
.ht-site-title a:link,
.ht-site-title a:visited {
	border: 0;
	color: var(--ht-title);
}
.ht-site-title a:hover,
.elementor-widget.ht-site-title .elementor-heading-title a:hover {
	color: var(--ht-title-hover);
}

.ht-site-description,
.ht-site-description p {
	color: var(--ht-text);
	font-family: var(--ht-font-heading);
	font-size: 1.1em;
	line-height: 1.33;
	margin: 0.4em 0 0;
}

.ht-nav ul,
.ht-site-header .widget_nav_menu ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3em 1.4em;
	list-style: none;
	margin: 0.9em 0 0;
	padding: 0;
}
.ht-nav a,
.ht-site-header .widget_nav_menu a {
	font-family: var(--ht-font-misc);
	font-size: 0.85em;
	letter-spacing: 1px;
	text-transform: uppercase;
}
.ht-site-header .elementor-widget-wp-widget-nav_menu h5 {
	display: none;
}

/* ---------- Post listings & single posts ---------- */
.hfeed .entry-title {
	color: var(--ht-ink);
	font-family: var(--ht-font-heading);
	font-size: 1.6em;
	font-weight: 400;
	line-height: 1.33;
	margin: 0 0 0.3em;
	text-transform: uppercase;
}
.hfeed .entry-title a,
.hfeed .entry-title a:visited {
	color: var(--ht-ink);
}
.hfeed .entry-title a:hover {
	color: var(--ht-ink-hover);
}

.hfeed .page-header {
	margin: 0 0 2.5em;
}
.hfeed .page-title {
	color: var(--ht-heading-grey);
	font-family: var(--ht-font-heading);
	font-size: 1.7em;
	font-weight: 400;
	line-height: 1.33;
	margin: 0;
}
.hfeed .page-title .page-subtitle {
	color: #7a818a;
	font-size: 0.8em;
	padding-left: 0.2em;
}
.hfeed .archive-description {
	color: #555;
	font-style: italic;
	margin: 0.5em 0 0;
}

.entry-content {
	overflow-wrap: break-word;
}
.entry-content a,
.entry-content a:link,
.comments a {
	border-bottom: 1px solid var(--ht-faint);
	color: var(--ht-ink);
}
.entry-content a:visited {
	color: var(--ht-ink-visited);
}
.entry-content a:hover {
	border-bottom-color: var(--ht-ink-hover);
	color: var(--ht-ink-hover);
}
.entry-content a:has(> img) {
	border-bottom: 0;
}

.entry-content p {
	margin: 1em 0;
}
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
	font-family: var(--ht-font-heading);
	font-weight: 400;
	margin: 1.5em 0 0.3em;
}
.entry-content h2,
.entry-content h3 { font-size: 1.5em; }
.entry-content h4 { font-size: 1.4em; }
.entry-content h5 { font-size: 1.3em; }
.entry-content h6 { font-size: 1.2em; }

.entry-content blockquote,
.comments blockquote {
	background: var(--ht-quote);
	color: var(--ht-heading-grey);
	margin: 1em 0;
	padding: 0.1em 1em;
}
.entry-content blockquote blockquote {
	border-left: 5px solid var(--ht-rule);
	font-size: 0.9em;
}
.entry-content code,
.entry-content pre {
	color: #494c5c;
	font: 1em/1.33 "courier new", courier, monospace;
}
.entry-content pre {
	overflow-x: auto;
	white-space: pre-wrap;
}
.entry-content del { background: var(--ht-quote); }
.entry-content ins { background: #f5f5dc; }
.entry-content ul li ul { list-style: square; }
.entry-content ol ol { list-style: lower-alpha; }

.entry-content .more-link {
	font-size: 95%;
	font-weight: 700;
	text-transform: uppercase;
}

/* Image alignment as old posts expect it */
.entry-content .alignleft {
	float: left;
	margin: 0.5em 1em 0.5em 0;
}
.entry-content .alignright {
	float: right;
	margin: 0.5em 0 0.5em 1em;
}
.entry-content .aligncenter,
.entry-content .center {
	display: block;
	margin: 1em auto;
}
.entry-content img.alignleft,
.entry-content img.alignright,
.entry-content img.aligncenter {
	border: 1px solid var(--ht-faint);
}
.entry-content .wp-caption {
	max-width: 100%;
}
.entry-content .wp-caption-text {
	font-style: italic;
	margin: 0.2em auto 1em;
	text-align: center;
}

/* Legacy markup: fixed widths, tables, embeds — keep old posts inside the column */
.entry-content table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
}
.entry-content [style*="width"] {
	max-width: 100%;
}
.entry-content iframe,
.entry-content object,
.entry-content embed,
.entry-content video {
	max-width: 100%;
}
.headtale-video {
	aspect-ratio: 16 / 9;
	display: block;
	margin: 1em 0;
	max-width: 640px;
}
.headtale-video iframe {
	border: 0;
	height: 100%;
	width: 100%;
}

/* blog.txt meta bar: ¶ Posted … § Category ‡ Comments ° Tagged */
.hentry .entry-meta {
	background: var(--ht-wash);
	border-bottom: 1px solid var(--ht-rule);
	border-top: 1px solid var(--ht-rule);
	clear: both;
	color: var(--ht-muted);
	font-family: var(--ht-font-misc);
	font-size: 0.9em;
	margin: 1em 0 5em;
	padding: 0.25em 0.5em;
	text-align: center;
}
.hentry .entry-meta .meta-sep {
	padding: 0 0 0 0.3em;
}

/* Prev/next navigation */
.navigation {
	align-items: baseline;
	display: flex;
	font-size: 0.9em;
	gap: 1em;
	justify-content: space-between;
	margin: 0 0 2em;
	text-transform: uppercase;
}
.navigation .nav-previous,
.navigation .nav-next {
	flex: 1 1 0;
}
.navigation .nav-next {
	text-align: right;
}
.navigation .nav-numbers {
	text-align: center;
	white-space: nowrap;
}
.navigation .page-numbers {
	padding: 0 0.25em;
}
.navigation .page-numbers.current {
	font-weight: 700;
}
.post-navigation {
	margin-top: -3em;
	text-transform: none;
}

/* ---------- Comments ---------- */
.comments .comment-header {
	color: var(--ht-heading-grey);
	font-family: var(--ht-font-heading);
	font-size: 1.4em;
	font-weight: 400;
	margin: 3em 0 0.5em;
}
.comments .comment-count {
	color: #7a818a;
	font-size: 0.8em;
	padding-left: 0.2em;
}
.comments ol.commentlist {
	margin: 0 0 0 2em;
	padding: 0;
}
.comments ol.commentlist ol.children {
	margin: 1.5em 0 0 1.5em;
	padding: 0;
}
.comments ol.commentlist li.comment {
	margin: 1em 0 3em;
}
.comments .comment-author {
	display: flex;
	align-items: center;
	gap: 0.6em;
}
.comments .comment-author .fn {
	font-style: normal;
	font-weight: 700;
}
.comments .comment-author .avatar {
	border-radius: 2px;
}
.comments .comment-metadata {
	color: var(--ht-muted);
	font-size: 0.85em;
	font-style: italic;
	margin: 0.2em 0 0;
}
.comments .comment-metadata a,
.comments .reply a {
	border-bottom: 0;
	color: var(--ht-muted);
}
.comments .comment-content p {
	margin: 0.5em 0;
}
.comments .reply {
	font-size: 0.85em;
}
.comments ol.pinglist {
	list-style: none;
	margin: 1em 0 0 1.5em;
}
.comments ol.pinglist li {
	border: 1px solid var(--ht-rule);
	color: #777;
	font-size: 0.9em;
	margin: 0 0 1em;
	padding: 0.8em 1em;
}
.comments .comment-respond {
	margin: 0 0 0 1.5em;
}
.comments .comment-respond .comment-header {
	margin-left: -1.5em;
}
.comments .comment-form input[type="text"],
.comments .comment-form input[type="email"],
.comments .comment-form input[type="url"],
.comments .comment-form textarea {
	background: #f6f6f7;
	border: 1px solid #7a818a;
	border-radius: 0;
	font-size: 1em;
	max-width: 100%;
	padding: 0.3em;
}
.comments .comment-form input[type="text"],
.comments .comment-form input[type="email"],
.comments .comment-form input[type="url"] {
	width: 20em;
}
.comments .comment-form textarea {
	width: 100%;
	max-width: 32em;
}
.comments .comment-form label {
	display: block;
}
.comments .comment-form-cookies-consent label {
	display: inline;
}

/* ---------- Sidebar ---------- */
.sidebar {
	border-left: 0.1em solid var(--ht-rule);
	flex: 0 0 var(--ht-sidebar);
	font-family: var(--ht-font-misc);
	font-size: 0.9em;
	line-height: 1.5;
	max-width: var(--ht-sidebar);
	padding-left: 2.4em;
}
.sidebar .widget {
	margin: 0 0 2.5em;
}
.sidebar .widget-title,
.sidebar .wp-block-heading {
	font-family: var(--ht-font-title);
	font-size: 1.1em;
	font-weight: 700;
	letter-spacing: 1px;
	line-height: 1.33;
	margin: 0 0 0.3em;
	text-transform: uppercase;
}
.sidebar ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.sidebar ul ul {
	margin: 0 0 0.2em 1.2em;
}
.sidebar ul ul li {
	color: var(--ht-faint);
	list-style: disc;
}
.sidebar a,
.sidebar a:link {
	border-bottom: 1px solid var(--ht-rule);
	color: var(--ht-ink);
}
.sidebar a:hover {
	border-bottom-color: var(--ht-ink-hover);
	color: var(--ht-ink-hover);
}
.sidebar .widget_recent_comments li {
	margin: 0 0 0.6em;
}
.sidebar .tagcloud,
.sidebar .wp-block-tag-cloud {
	line-height: 1.9;
	overflow: hidden;
}
.sidebar .tagcloud a {
	border-bottom: 0;
}
.sidebar select {
	max-width: 100%;
	width: 100%;
}
.sidebar .search-form,
.no-results .search-form {
	display: flex;
	gap: 0.3em;
}
.search-form input[type="search"] {
	background: #f6f6f7;
	border: 1px solid #9ca1a8;
	border-radius: 0;
	flex: 1 1 auto;
	font-size: 1em;
	min-width: 0;
	padding: 0.3em 0.4em;
}
.search-form .search-submit,
.comment-form .submit {
	background: #f6f7f8;
	border: 1px solid #9ca1a8;
	border-radius: 0;
	color: var(--ht-ink);
	cursor: pointer;
	font-size: 0.95em;
	padding: 0.3em 0.8em;
}
.search-form .search-submit:hover,
.search-form .search-submit:focus,
.comment-form .submit:hover,
.comment-form .submit:focus {
	background: var(--ht-ink);
	border-color: var(--ht-ink);
	color: #fff;
}

/* ---------- Footer ---------- */
.ht-footer,
.ht-site-footer {
	border-top: 1px solid var(--ht-rule);
	color: var(--ht-faint);
	font-size: 0.9em;
	margin: 4em 0 0;
	padding: 1.2em 0 0;
}
.ht-footer p,
.ht-site-footer p {
	margin: 0;
}
.ht-footer a,
.ht-site-footer a {
	border-bottom: 1px solid var(--ht-rule);
	color: var(--ht-faint);
}
.ht-footer a:hover,
.ht-site-footer a:hover {
	color: var(--ht-ink);
}

/* Elementor containers inside our header/footer: no extra padding */
.ht-site-header.e-con,
.ht-site-footer.e-con,
.ht-site-header .e-con-inner,
.ht-site-footer .e-con-inner {
	--padding-top: 0;
	--padding-bottom: 0;
	--padding-left: 0;
	--padding-right: 0;
	max-width: none;
}
.ht-site-header .elementor-widget,
.ht-site-footer .elementor-widget {
	margin: 0;
}

/* ---------- Tablet: sidebar moves below content ---------- */
@media (max-width: 960px) {
	.ht-wrapper {
		margin-top: 2.5em;
		width: auto;
		padding: 0 24px;
	}
	.ht-layout {
		display: block;
	}
	.sidebar {
		border-left: 0;
		border-top: 0.1em solid var(--ht-rule);
		column-gap: 2.5em;
		columns: 2 16em;
		max-width: none;
		padding: 2em 0 0;
	}
	.sidebar .widget {
		break-inside: avoid;
	}
	div.ht-header .ht-site-title,
	.elementor-widget.ht-site-title .elementor-heading-title {
		font-size: 3em;
	}
}

/* ---------- Phone ---------- */
@media (max-width: 600px) {
	.ht-wrapper {
		margin-top: 1.5em;
		padding: 0 16px;
	}
	div.ht-header .ht-site-title,
	.elementor-widget.ht-site-title .elementor-heading-title {
		font-size: 2.1em;
	}
	.hfeed .entry-title {
		font-size: 1.35em;
	}
	.entry-content .alignleft,
	.entry-content .alignright {
		float: none;
		margin: 1em auto;
	}
	.hentry .entry-meta {
		margin-bottom: 3.5em;
		text-align: left;
	}
	.navigation {
		flex-wrap: wrap;
	}
	.navigation .nav-numbers {
		order: 3;
		flex-basis: 100%;
	}
	.comments ol.commentlist,
	.comments ol.pinglist,
	.comments .comment-respond {
		margin-left: 0;
	}
	.comments .comment-respond .comment-header {
		margin-left: 0;
	}
	.comments .comment-form input[type="text"],
	.comments .comment-form input[type="email"],
	.comments .comment-form input[type="url"] {
		width: 100%;
	}
	.sidebar {
		columns: 1;
	}
}

/* Print: content only */
@media print {
	.sidebar,
	.navigation,
	.comment-respond,
	.ht-nav {
		display: none;
	}
	.ht-wrapper {
		margin: 0;
		width: auto;
	}
}

/* =====================================================================
 * Elementor Theme Builder layout (header, cards, single post).
 * Colours, fonts and spacing live in the Elementor templates and Site
 * Settings; these rules cover what the editor controls cannot.
 * ===================================================================== */

/* Sticky header shrinks once the page scrolls */
.ht-header-bar .ht-site-title-el .elementor-heading-title,
.ht-header-bar .ht-tagline {
	transition: font-size 0.2s ease, opacity 0.2s ease, max-height 0.2s ease;
}
.ht-header-bar .ht-tagline {
	max-height: 2em;
	overflow: hidden;
}
.ht-header-bar.elementor-sticky--effects {
	box-shadow: 0 2px 14px rgba(13, 17, 23, 0.08);
}
.ht-header-bar.elementor-sticky--effects .ht-site-title-el .elementor-heading-title {
	font-size: 24px;
}
.ht-header-bar.elementor-sticky--effects .ht-tagline {
	max-height: 0;
	opacity: 0;
}
.ht-header-bar .ht-site-title-el a {
	border: 0;
	color: inherit;
}
.ht-brand,
.ht-nav-wrap {
	width: auto;
}

/* Reading progress bar pinned to the top of the window */
.ht-progress-wrap {
	height: 0;
}
.ht-progress {
	left: 0;
	position: fixed;
	right: 0;
	top: 0;
	z-index: 1000;
}
.admin-bar .ht-progress {
	top: 32px;
}

/* Cards */
.ht-card,
.ht-compact {
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.e-loop-item:hover .ht-card,
.e-loop-item:hover .ht-compact {
	box-shadow: 0 6px 20px rgba(13, 17, 23, 0.08);
	transform: translateY(-2px);
}
.e-loop-item:hover .ht-card {
	border-top-color: var(--e-global-color-secondary);
}
.ht-card .elementor-heading-title a,
.ht-compact .elementor-heading-title a,
.ht-featured .elementor-heading-title a {
	border: 0;
	color: inherit;
}
.ht-card .elementor-heading-title a:hover,
.ht-compact .elementor-heading-title a:hover,
.ht-featured .elementor-heading-title a:hover {
	color: var(--e-global-color-secondary);
}
.ht-card .elementor-widget-theme-post-excerpt p,
.ht-featured .elementor-widget-theme-post-excerpt p {
	margin: 0;
}
.ht-card-foot {
	margin-top: auto;
}

/* Loop grid pagination */
.ht-grid .elementor-pagination {
	font-family: verdana, geneva, sans-serif;
	font-size: 13px;
	margin-top: 36px;
	text-align: center;
	text-transform: uppercase;
}
.ht-grid .elementor-pagination .page-numbers {
	border: 1px solid var(--ht-rule);
	display: inline-block;
	margin: 0 2px 6px;
	min-width: 2.4em;
	padding: 6px 10px;
}
.ht-grid .elementor-pagination .page-numbers.current {
	background: var(--e-global-color-primary);
	border-color: var(--e-global-color-primary);
	color: #fff;
}
.ht-grid .elementor-pagination .page-numbers.dots {
	border-color: transparent;
}

/* Sidebar widgets inside the Elementor Sidebar template */
.ht-sidebar ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.ht-sidebar li {
	font-size: 14px;
	line-height: 1.45;
	margin: 0 0 10px;
}
.ht-sidebar a {
	color: var(--e-global-color-primary);
}
.ht-sidebar a:hover {
	color: var(--e-global-color-secondary);
}
.ht-sidebar select {
	background: #fff;
	border: 1px solid var(--ht-rule);
	border-radius: 0;
	font-size: 14px;
	padding: 8px;
	width: 100%;
}
.ht-sidebar .tagcloud a {
	border: 1px solid var(--ht-rule);
	display: inline-block;
	font-size: 12px !important;
	margin: 0 4px 6px 0;
	padding: 3px 8px;
}
.ht-about-card .ht-stats {
	color: var(--ht-muted);
	font-size: 13px;
	font-style: italic;
}

/* Single post: content keeps the legacy-friendly .entry-content rules above */
.ht-post-content .elementor-widget-container > *:first-child {
	margin-top: 0;
}
.ht-metabar .elementor-icon-list-items {
	justify-content: center;
}
.ht-comments .comments .comment-header:first-child {
	margin-top: 1em;
}
.ht-aside {
	position: sticky;
	top: 110px;
}
@media (max-width: 1024px) {
	.ht-aside {
		position: static;
	}
}

/* Footer */
.ht-footer-bar a {
	color: var(--e-global-color-primary);
}
.ht-footer-bar a:hover {
	color: var(--e-global-color-secondary);
}
.ht-footer-bar select {
	background: #fff;
	border: 1px solid var(--ht-rule);
	font-size: 14px;
	padding: 8px;
	width: 100%;
}

/* WordPress widgets print their own default titles; the templates use Heading widgets instead */
.ht-sidebar [class*="elementor-widget-wp-widget-"] h5,
.ht-footer-bar [class*="elementor-widget-wp-widget-"] h5 {
	display: none;
}

/* Header: red accent on top, rule colour underneath (Elementor borders share one colour) */
.ht-header-bar.e-con {
	border-top-color: var(--e-global-color-secondary) !important;
}
