/*
Theme Name: Hancas
Description: Two-sided timeline blog theme with infinite scroll. Self-contained: no bundled frameworks, no required plugins.
Version: 1.0.0
Author: Hancas
License: GPL-2.0-or-later
Text Domain: hancas
Requires at least: 5.3
Requires PHP: 7.2
*/

/* ---------------- Self-hosted fonts (SIL Open Font License, see assets/fonts) ----------------
   Two subsets per weight: "latin" and "latin-ext" (Lithuanian letters ą č ę ė į š ų ū ž).
   unicode-range makes the browser download only the subsets a page actually uses. */
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap;
	src: url("assets/fonts/lato-latin-400-normal.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: "Lato"; font-style: normal; font-weight: 400; font-display: swap;
	src: url("assets/fonts/lato-latin-ext-400-normal.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: "Lato"; font-style: normal; font-weight: 700; font-display: swap;
	src: url("assets/fonts/lato-latin-700-normal.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: "Lato"; font-style: normal; font-weight: 700; font-display: swap;
	src: url("assets/fonts/lato-latin-ext-700-normal.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: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap;
	src: url("assets/fonts/montserrat-latin-400-normal.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: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap;
	src: url("assets/fonts/montserrat-latin-ext-400-normal.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: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap;
	src: url("assets/fonts/montserrat-latin-700-normal.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: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap;
	src: url("assets/fonts/montserrat-latin-ext-700-normal.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; }

:root {
	--accent: #DA9D67;
	--accent-text: #A0612A; /* darker accent for small text: contrast 4.9:1 on white */
	--text: #404040;
	--heading: #333;
	--card: #fff;
	--line: #DA9D67;
	--nav-h: 46px;
	--container: 1425px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
	margin: 0;
	font-family: "Lato", sans-serif;
	font-size: 14px;
	line-height: 24px;
	color: var(--text);
	background: #f7f7f7 url("assets/img/bg-small.jpg") no-repeat top center fixed;
	background-image: image-set(url("assets/img/bg.webp") type("image/webp"), url("assets/img/bg-small.jpg") type("image/jpeg"));
	background-size: cover;
	overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
iframe { border: 0; display: block; max-width: 100%; }
a { color: #454545; text-decoration: none; transition: color .2s ease; }
a:hover, a:focus { color: #aaa; }
p { margin: 0 0 15px; }

h1, h2, h3, h4, h5, h6 {
	margin: 10px 0;
	line-height: 1.25;
	font-family: "Montserrat", sans-serif;
	font-weight: 700;
	letter-spacing: 3px;
	color: var(--heading);
}

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

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 15px; }
.center { text-align: center; }

/* ---------------- Navigation ---------------- */
.site-nav {
	position: sticky;
	top: 0;
	z-index: 50;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
.admin-bar .site-nav { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-nav { top: 46px; } }

.home-link { display: inline-flex; align-items: center; padding: 6px 4px; color: #333; line-height: 0; }
.home-link:hover { color: var(--accent); }
.home-link .icon { width: 20px; height: 20px; }

.nav-inner { display: flex; align-items: center; min-height: var(--nav-h); gap: 12px; }
.primary-nav { flex: 1; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.primary-nav li { position: relative; }
.primary-nav a {
	display: block;
	padding: 0 11px 0 0;
	margin-right: 10px;
	line-height: var(--nav-h);
	font-family: "Montserrat", sans-serif;
	font-size: 13px;
	font-weight: 400;
	letter-spacing: 3px;
	text-transform: uppercase;
	color: #333;
	white-space: nowrap;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-cat > a { color: var(--accent); }

/* dropdowns */
.primary-nav ul ul {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	background: #fff;
	box-shadow: 1px 1px 2px rgba(0, 0, 0, .12);
	flex-direction: column;
	padding: 8px 0;
}
.primary-nav li:hover > ul,
.primary-nav li:focus-within > ul { display: flex; }
.primary-nav ul ul a { line-height: 34px; padding: 0 16px; margin: 0; }

.nav-tools { display: flex; align-items: center; gap: 14px; list-style: none; margin: 0; padding: 0; }
.search-trigger { background: none; border: 0; padding: 6px; cursor: pointer; color: #333; line-height: 0; }
.search-trigger:hover { color: var(--accent); }
.follow-btn {
	display: inline-flex; align-items: center; gap: 6px;
	background: #000; color: #fff !important;
	border-radius: 999px; padding: 4px 16px; line-height: 24px;
	font-weight: 700; font-size: 14px;
}
.follow-btn:hover { background: #222; }
.tool-rss .rss-icon { display: block; width: 34px; height: 34px; }
.tool-rss a:hover .rss-icon { filter: brightness(1.1); }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle .bars,
.nav-toggle .bars::before,
.nav-toggle .bars::after {
	display: block; width: 22px; height: 2px; background: #333; content: ""; position: relative;
}
.nav-toggle .bars::before { position: absolute; top: -7px; }
.nav-toggle .bars::after { position: absolute; top: 7px; }

@media (max-width: 900px) {
	.nav-toggle { display: block; }
	.primary-nav {
		display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff;
		box-shadow: 0 3px 6px rgba(0, 0, 0, .12); padding: 8px 15px;
	}
	.primary-nav.is-open { display: block; }
	.primary-nav ul { flex-direction: column; }
	.primary-nav ul ul { display: flex; position: static; box-shadow: none; padding-left: 16px; }
	.nav-inner { justify-content: space-between; }
	.nav-tools { margin-left: auto; }
	.tool-follow { display: none; }
}

/* ---------------- Search overlay ---------------- */
.search-overlay[hidden] { display: none; }
.search-overlay { position: fixed; inset: 0; z-index: 999; }
.search-overlay-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .8); }
.search-box {
	position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
	width: 800px; max-width: calc(100% - 30px); padding: 50px; background: #fff; text-align: center;
}
.search-title { font-family: "Montserrat", sans-serif; letter-spacing: 3px; font-weight: 700; margin: 0 0 20px; }

.searchform { display: flex; max-width: 100%; }
.searchform input[type="search"] {
	flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid #ccc; border-right: 0; font: inherit; border-radius: 0;
}
.searchform button {
	padding: 0 16px; background: var(--accent-text); color: #fff; border: 1px solid var(--accent-text); cursor: pointer;
}

/* ---------------- Timeline ---------------- */
.filter-title {
	text-align: center; margin: 50px 0; padding: 20px 0; background: #fff; font-size: 26px; text-transform: none;
}

.timeline {
	position: relative;
	margin: 50px 0 70px;
	padding-bottom: 50px;
}
.timeline::before {
	content: "";
	position: absolute; top: 0; left: 50%;
	width: 2px; height: 100%; margin-left: -1px;
	background: var(--line);
}
.timeline::after { content: ""; display: table; clear: both; }

.tl-item {
	position: relative;
	width: 50%;
	margin-top: 50px;
	padding: 0 25px;
}
.tl-item:first-of-type { margin-top: 0; }

/* alternate sides: odd = left, even = right (works for appended items too) */
.tl-item:nth-of-type(odd)  { float: left;  clear: left;  padding-left: 0; }
.tl-item:nth-of-type(even) { float: right; clear: right; padding-right: 0; }

/* dot on the line */
.tl-item::after {
	content: "";
	position: absolute; top: 15px;
	width: 20px; height: 20px;
	border: 6px solid #333; border-radius: 50%;
	background: #ddd;
	transition: background .2s ease;
}
.tl-item:nth-of-type(odd)::after  { right: -10px; }
.tl-item:nth-of-type(even)::after { left: -10px; }
.tl-item:hover::after { background: var(--accent); }

/* connector between card and dot */
.tl-item .tl-card::before {
	content: "";
	position: absolute; top: 24px;
	width: 25px; height: 2px;
	background: #ddd;
	transition: background .2s ease;
}
.tl-item:nth-of-type(odd)  .tl-card::before { right: -25px; }
.tl-item:nth-of-type(even) .tl-card::before { left: -25px; }
.tl-item:hover .tl-card::before { background: var(--accent); }

.tl-card {
	position: relative;
	width: 100%;
	padding: 20px;
	background: var(--card);
	transition: box-shadow .2s ease;
}
.tl-item:hover .tl-card { box-shadow: 1px 1px 3px -1px rgba(0, 0, 0, .25); }

.category-list {
	position: relative;
	margin-bottom: 10px; padding-bottom: 10px;
	text-align: center; text-transform: uppercase;
	font-size: 11px; line-height: 1; letter-spacing: 3px;
}
.category-list::after {
	content: ""; position: absolute; left: 50%; bottom: 0; width: 20px;
	border-bottom: 1px solid var(--accent); transform: translateX(-50%);
}
.category-list a { color: var(--accent-text); }

.tl-title { margin: 15px 0; text-align: center; font-size: clamp(22px, 2.3vw, 32px); overflow-wrap: anywhere; }
.tl-title a:hover { color: #aaa; }

.tl-thumb { display: block; margin-bottom: 15px; }
.tl-thumb img { display: block; margin: 0 auto; }

/* embedded video / media */
/* Raw <iframe> YouTube/Vimeo in post content: full width, 16:9 */
iframe[src*="youtube"], iframe[src*="youtu.be"], iframe[src*="vimeo"] {
	width: 100%; height: auto; aspect-ratio: 16 / 9;
}
iframe[src*="soundcloud"] { width: 100%; }

/* oEmbed videos are wrapped in .video-container (16:9 box). It comes after
   the rule above and uses !important so width/height attributes and the
   generic rule can never shrink the iframe inside the box. */
.video-container {
	position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
}
.video-container iframe, .video-container object, .video-container embed {
	position: absolute; top: 0; left: 0;
	width: 100% !important; height: 100% !important; aspect-ratio: auto;
}

/* Lite YouTube: thumbnail + play button, the real player loads on click.
   Without JavaScript it is a normal link to YouTube. */
.yt-lite {
	position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
	overflow: hidden; background: #000; cursor: pointer;
}
.video-container .yt-lite { position: absolute; top: 0; left: 0; height: 100%; aspect-ratio: auto; }
/* ".entry .yt-lite img" has to out-rank ".entry img { height: auto }", otherwise
   the 4:3 thumbnail is not cropped and its black top bar shows. */
.yt-lite img, .entry .yt-lite img {
	position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
	object-fit: cover; object-position: center;   /* crops the black bars of hqdefault.jpg */
	margin: 0; transition: opacity .2s ease;
}
.yt-lite:hover img, .yt-lite:focus-visible img { opacity: .85; }
.yt-lite::before {                   /* red play button */
	content: ""; position: absolute; z-index: 1; left: 50%; top: 50%;
	width: 68px; height: 48px; margin: -24px 0 0 -34px;
	background: #f00; border-radius: 12px; opacity: .9; transition: opacity .2s ease;
}
.yt-lite::after {                    /* white triangle */
	content: ""; position: absolute; z-index: 2; left: 50%; top: 50%;
	margin: -10px 0 0 -6px;
	border-style: solid; border-width: 10px 0 10px 18px;
	border-color: transparent transparent transparent #fff;
}
.yt-lite:hover::before, .yt-lite:focus-visible::before { opacity: 1; }
.yt-lite:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

.entry { overflow-wrap: break-word; }
.entry > :last-child { margin-bottom: 0; }
.entry img { max-width: 100%; height: auto; }
.entry .alignleft { float: left; margin: 0 15px 10px 0; }
.entry .alignright { float: right; margin: 0 0 10px 15px; }
.entry .aligncenter, .entry img.aligncenter { display: block; margin: 0 auto 15px; }
.entry blockquote { margin: 0 0 20px; padding-left: 20px; font-size: 18px; font-style: italic; }
.entry::after { content: ""; display: table; clear: both; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 12px; text-align: center; opacity: .7; }

/* share buttons */
.post-share { display: flex; justify-content: center; gap: 15px; margin-top: 20px; }
.post-share a {
	display: inline-flex; align-items: center; justify-content: center;
	width: 45px; height: 35px;
	border: 1px solid var(--accent);
	transform: skewX(-20deg);
	color: #404040;
}
.post-share a .icon { transform: skewX(20deg); }
.post-share a:hover { background: var(--accent); color: #fff; }

/* meta row */
.blog-meta {
	display: flex; flex-wrap: wrap;
	list-style: none; margin: 20px 0 0; padding: 20px 0 0;
	border-top: 1px solid #ddd;
	font-size: 12px; text-align: center;
}
.blog-meta li { flex: 1 1 33%; opacity: .75; }
.blog-meta li:not(:last-child) { border-right: 1px solid #ddd; }
.blog-meta .icon { margin-right: 8px; vertical-align: -3px; opacity: .6; }

/* infinite scroll trigger */
.timeline-end { position: absolute; left: 0; right: 0; bottom: 0; height: 0; clear: both; }
.load-more {
	position: absolute; left: 50%; bottom: -30px;
	width: 34px; height: 34px; margin-left: -17px;
	border: 2px solid var(--accent); border-radius: 50%;
	background: #fff; cursor: pointer; color: var(--accent);
}
.load-more::before {
	content: ""; position: absolute; left: 50%; top: 50%;
	width: 8px; height: 8px; margin: -7px 0 0 -4px;
	border: solid currentColor; border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.load-more:hover { background: var(--accent); color: #fff; }
.load-more.is-loading::before {
	width: 14px; height: 14px; margin: -7px 0 0 -7px;
	border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
	transform: none; animation: hnc-spin .7s linear infinite;
}
.load-more.is-error { border-color: #c0392b; color: #c0392b; }
@keyframes hnc-spin { to { transform: rotate(360deg); } }

/* new items fade in */
.tl-item.is-new { animation: hnc-fade .5s ease both; }
@keyframes hnc-fade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 600px) {
	.timeline::before { left: 0; margin-left: -1px; }
	.tl-item,
	.tl-item:nth-of-type(odd),
	.tl-item:nth-of-type(even) {
		float: none; clear: both; width: 100%; padding: 0 0 0 28px;
	}
	.tl-item:nth-of-type(odd)::after,
	.tl-item:nth-of-type(even)::after { left: -10px; right: auto; }
	.tl-item:nth-of-type(odd) .tl-card::before,
	.tl-item:nth-of-type(even) .tl-card::before { left: -28px; right: auto; width: 28px; }
	.load-more { left: 0; margin-left: -17px; }
	.blog-meta li { flex-basis: 100%; text-align: left; border: 0 !important; margin: 4px 0; }
}

/* ---------------- Single / page ---------------- */
.single-layout { display: block; margin: 50px auto; max-width: 900px; }
.single-layout.has-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; max-width: none; }
@media (max-width: 900px) { .single-layout.has-sidebar { grid-template-columns: 1fr; } }

.single-card { padding: 30px; margin-bottom: 30px; }
.post-title { text-align: center; margin: 20px 0 5px; font-size: clamp(24px, 3vw, 36px); overflow-wrap: anywhere; }
.single-thumb { margin: 20px 0; }
.single-card .post-share { margin: 20px 0 25px; }
.post-tags { margin-top: 25px; }
.post-tags a { display: inline-block; margin: 2px; padding: 2px 8px; border: 1px solid var(--accent); font-size: 12px; }
.post-tags a:hover { background: var(--accent); color: #fff; }
.page-links { margin-top: 20px; }

.next-prev { display: grid; grid-template-columns: 1fr auto 1fr; gap: 15px; margin-bottom: 30px; align-items: center; }
.next-prev .next-post { text-align: right; }

.widget { margin-bottom: 30px; }
.widget-title {
	margin: 0 0 15px; padding-bottom: 10px; border-bottom: 1px solid #ddd;
	font-size: 12px; letter-spacing: 3px; text-transform: uppercase; text-align: center;
}
.widget ul { margin: 0; padding-left: 18px; }

.comments, .comment-respond-wrap { margin-bottom: 30px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; padding-left: 30px; }
.comment-body { padding: 12px 0; border-bottom: 1px solid #eee; }
.comment-respond input[type="text"], .comment-respond input[type="email"], .comment-respond input[type="url"], .comment-respond textarea {
	width: 100%; padding: 8px 10px; border: 1px solid #ccc; font: inherit;
}
.comment-respond .submit {
	padding: 8px 22px; background: var(--accent-text); color: #fff; border: 0; cursor: pointer; font: inherit;
}
.comment-respond .submit:hover { background: #7f4c20; }
.comment-reply-title {
	margin: 0 0 15px; padding-bottom: 10px; border-bottom: 1px solid #ddd;
	font-size: 12px; letter-spacing: 3px; text-transform: uppercase; text-align: center;
}
.comment-reply-title small { letter-spacing: 0; text-transform: none; margin-left: 10px; }

.no-results, .not-found { text-align: center; margin: 50px auto; max-width: 700px; }

/* ---------------- Footer ---------------- */
.site-footer { padding: 25px 0; text-align: center; font-size: 12px; background: rgba(255, 255, 255, .85); }
.site-footer p { margin: 0; }

.to-top {
	position: fixed; right: 20px; bottom: 20px; width: 40px; height: 40px;
	border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); cursor: pointer; z-index: 40;
}
.to-top[hidden] { display: none; }
.to-top::before {
	content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -2px 0 0 -4.5px;
	border: solid #fff; border-width: 2px 0 0 2px; transform: rotate(45deg);
}

/* "fixed" backgrounds repaint on every scroll frame on phones (and iOS ignores them) */
@media (max-width: 900px) {
	body { background-attachment: scroll; }
}

@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; }
}
