/*
Theme Name: Halfticket
Theme URI: https://halfticket.example
Author: Halfticket
Description: Minimal masonry portfolio for data visualisation work. Flip cards show social analytics on the back, tag filters let visitors sort the work, and built-in Contact cards link to an enquiry form.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.1.4
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: halfticket
*/

:root {
	--ht-text: #606060;
	--ht-heading: #404040;
	--ht-ink: #111111;
	--ht-muted: #9a9a9a;
	--ht-line: #ececec;
	--ht-tile: #f0f0f0;
	--ht-bg: #ffffff;
	--ht-gutter: 30px;
	--ht-wrap: 1170px;
	--ht-head-font: "Dosis", "Arial Narrow", Arial, sans-serif;
	--ht-body-font: "Source Sans Pro", "Source Sans 3", Arial, sans-serif;
}

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

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

body {
	margin: 0;
	background: var(--ht-bg);
	color: var(--ht-text);
	font-family: var(--ht-body-font);
	font-size: 15px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--ht-heading); text-decoration: none; transition: color .2s; }
a:hover { color: var(--ht-ink); }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--ht-head-font);
	color: var(--ht-heading);
	text-transform: uppercase;
	letter-spacing: 1px;
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 .6em;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto;
	left: 10px; top: 10px; z-index: 1000;
	background: #fff; padding: 8px 14px;
}

.ht-wrap {
	width: 100%;
	max-width: calc(var(--ht-wrap) + 2 * var(--ht-gutter));
	margin: 0 auto;
	padding: 0 var(--ht-gutter);
}

/* ---------- Header ---------- */
.ht-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: #fff;
	transition: box-shadow .3s;
}
.admin-bar .ht-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ht-header { top: 0; position: relative; } }
.ht-header.is-scrolled { box-shadow: 0 2px 18px rgba(0, 0, 0, .08); }

.ht-header__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 96px;
}
.ht-logo {
	font-family: var(--ht-head-font);
	font-weight: 700;
	font-size: 24px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--ht-heading);
	line-height: 1;
}
.ht-logo img { max-height: 44px; width: auto; }
.ht-tagline {
	margin: 0;
	font-family: var(--ht-head-font);
	font-size: 13px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: #4f4f4f;
	text-align: right;
}

/* ---------- Filters ---------- */
.ht-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 26px;
	margin: 26px 0 50px;
	padding: 0;
	list-style: none;
}
.ht-filter {
	position: relative;
	background: none;
	border: 0;
	padding: 6px 0 14px;
	cursor: pointer;
	font-family: var(--ht-head-font);
	font-size: 13px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--ht-muted);
	transition: color .2s;
}
.ht-filter:hover, .ht-filter.is-active { color: var(--ht-ink); }
.ht-filter::after {
	content: "\2022\2022\2022";
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	font-size: 10px;
	letter-spacing: 1px;
	line-height: 1;
	opacity: 0;
	transition: opacity .2s;
}
.ht-filter.is-active::after { opacity: 1; }
.ht-filter:focus-visible { outline: 1px dotted var(--ht-ink); outline-offset: 4px; }

/* ---------- Masonry grid ---------- */
.ht-grid { position: relative; margin-bottom: 70px; }
.ht-grid::after { content: ""; display: block; clear: both; }
.ht-sizer, .ht-item { width: calc((100% - 2 * var(--ht-gutter)) / 3); }
.ht-gutter { width: var(--ht-gutter); }
.ht-item { margin-bottom: var(--ht-gutter); float: left; }
.ht-item.is-hidden { display: none; }
.no-js .ht-item { margin-right: var(--ht-gutter); }

@media (max-width: 1024px) {
	.ht-sizer, .ht-item { width: calc((100% - var(--ht-gutter)) / 2); }
}
@media (max-width: 640px) {
	:root { --ht-gutter: 20px; }
	.ht-sizer, .ht-item { width: 100%; }
	.ht-header__row { flex-direction: column; justify-content: center; gap: 8px; padding: 18px 0; min-height: 0; }
	.ht-tagline { text-align: center; }
}

/* ---------- Flip card ---------- */
.ht-card {
	display: block;
	perspective: 1400px;
	color: inherit;
	outline: none;
}
.ht-card__inner {
	position: relative;
	display: grid;
	transform-style: preserve-3d;
	transition: transform .8s cubic-bezier(.2, .75, .25, 1);
}
.ht-card:hover .ht-card__inner,
.ht-card:focus-visible .ht-card__inner,
.ht-card.is-flipped .ht-card__inner { transform: rotateY(180deg); }

.ht-card__front,
.ht-card__back {
	grid-area: 1 / 1;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}
/* Both faces share one grid cell: the card is as tall as the taller face,
   so analytics on the back are never cut off. */
.ht-card__front { background: var(--ht-tile); overflow: hidden; }
.ht-card__front { display: flex; align-items: center; }
.ht-card__front img {
	width: 100%;
	height: auto;
}
.ht-card__placeholder {
	min-height: 300px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 30px;
	text-align: center;
	font-family: var(--ht-head-font);
	text-transform: uppercase;
	letter-spacing: 2px;
	color: var(--ht-heading);
}
.ht-card__back {
	transform: rotateY(180deg);
	background: var(--ht-ink);
	color: #cfcfcf;
	padding: 22px 24px 18px;
	display: flex;
	flex-direction: column;
}
.ht-card:focus-visible .ht-card__back { box-shadow: inset 0 0 0 2px #fff; }

.ht-card__tags {
	font-family: var(--ht-head-font);
	font-size: 11px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--ht-muted);
	margin: 0 0 6px;
}
.ht-card__title {
	font-size: 17px;
	color: #fff;
	letter-spacing: 1.5px;
	margin: 0 0 12px;
}
.ht-card__excerpt { font-size: 14px; line-height: 1.6; margin: 0; }
.ht-card__stats { flex: 1 1 auto; }
.ht-card__more {
	margin-top: auto;
	padding-top: 10px;
	font-family: var(--ht-head-font);
	font-size: 12px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: #fff;
}
.ht-card__more span { display: inline-block; transition: transform .25s; }
.ht-card:hover .ht-card__more span { transform: translateX(4px); }

/* Stats block (used on card back and single page) */
.ht-stat-row { padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.ht-stat-row:first-child { border-top: 0; padding-top: 0; }
.ht-stat-row__platform {
	font-family: var(--ht-head-font);
	font-size: 11px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--ht-muted);
	margin-bottom: 2px;
}
.ht-stat-row__nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ht-stat__num {
	display: block;
	font-family: var(--ht-head-font);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
}
.ht-stat__label {
	display: block;
	font-size: 10px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--ht-muted);
	line-height: 1.3;
}

/* Contact card */
.ht-item--contact .ht-card__front {
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 30px;
}
.ht-contact__front-text {
	font-family: var(--ht-head-font);
	font-weight: 700;
	font-size: 34px;
	letter-spacing: 4px;
	text-transform: uppercase;
	color: var(--ht-heading);
	line-height: 1.2;
}
.ht-contact__front-text::after {
	content: "\2022\2022\2022";
	display: block;
	font-size: 12px;
	letter-spacing: 2px;
	margin-top: 10px;
	color: var(--ht-muted);
}
.ht-item--contact .ht-card__back { justify-content: center; align-items: center; text-align: center; }
.ht-contact__back-text { font-size: 16px; color: #ddd; margin: 0 0 20px; max-width: 260px; }
.ht-btn {
	display: inline-block;
	border: 1px solid currentColor;
	padding: 11px 26px;
	font-family: var(--ht-head-font);
	font-size: 12px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: #fff;
	background: transparent;
	cursor: pointer;
	transition: background .2s, color .2s;
}
.ht-card:hover .ht-btn, .ht-btn:hover { background: #fff; color: var(--ht-ink); }

@media (prefers-reduced-motion: reduce) {
	.ht-card__inner { transition: none; transform: none !important; }
	.ht-card__back { transform: none; opacity: 0; transition: opacity .2s; }
	.ht-card:hover .ht-card__back,
	.ht-card:focus-visible .ht-card__back,
	.ht-card.is-flipped .ht-card__back { opacity: 1; }
}

.ht-empty { text-align: center; padding: 60px 0 90px; }

/* ---------- Single + pages ---------- */
.ht-single { padding: 40px 0 80px; }
.ht-single__head { text-align: center; max-width: 780px; margin: 0 auto 40px; }
.ht-single__title { font-size: 34px; letter-spacing: 3px; margin-bottom: 10px; }
.ht-single__tags {
	font-family: var(--ht-head-font);
	font-size: 12px;
	letter-spacing: 2px;
	text-transform: uppercase;
}
.ht-single__tags a { color: var(--ht-muted); }
.ht-single__tags a:hover { color: var(--ht-ink); }
.ht-single__media { margin: 0 auto 50px; background: var(--ht-tile); }
.ht-single__media img { margin: 0 auto; }
.ht-content { max-width: 780px; margin: 0 auto; }
.ht-content > * { margin-top: 0; margin-bottom: 1.3em; }
.ht-content img, .ht-content figure { margin-left: auto; margin-right: auto; }
.ht-content .alignwide { max-width: 1170px; margin-left: 50%; transform: translateX(-50%); width: calc(100vw - 60px); }
.ht-content .alignfull { width: 100vw; max-width: none; margin-left: 50%; transform: translateX(-50%); }

.ht-perf { max-width: 780px; margin: 50px auto 0; background: var(--ht-ink); color: #cfcfcf; padding: 34px 36px; }
.ht-perf__title { color: #fff; font-size: 16px; letter-spacing: 3px; margin-bottom: 18px; }
.ht-perf .ht-stat-row { padding: 16px 0; }
.ht-perf .ht-stat__num { font-size: 26px; }
.ht-perf .ht-stat-row__platform { display: flex; justify-content: space-between; gap: 12px; }
.ht-perf .ht-stat-row__platform a { color: #fff; }
.ht-perf__updated { margin: 14px 0 0; font-size: 12px; color: var(--ht-muted); }

.ht-postnav {
	max-width: 780px;
	margin: 60px auto 0;
	padding-top: 26px;
	border-top: 1px solid var(--ht-line);
	display: flex;
	justify-content: space-between;
	gap: 20px;
	font-family: var(--ht-head-font);
	font-size: 13px;
	letter-spacing: 2px;
	text-transform: uppercase;
}
.ht-postnav a { color: var(--ht-muted); }
.ht-postnav a:hover { color: var(--ht-ink); }

/* ---------- Contact form ---------- */
#ht-form { scroll-margin-top: 130px; }
.ht-form { max-width: 620px; margin: 30px auto 0; }
.ht-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .ht-form__row { grid-template-columns: 1fr; } }
.ht-field { margin-bottom: 20px; }
.ht-field label {
	display: block;
	margin-bottom: 6px;
	font-family: var(--ht-head-font);
	font-size: 12px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--ht-heading);
}
.ht-field input, .ht-field textarea {
	width: 100%;
	border: 1px solid #dcdcdc;
	background: #fff;
	padding: 12px 14px;
	font: inherit;
	color: var(--ht-heading);
	border-radius: 0;
	transition: border-color .2s;
}
.ht-field input:focus, .ht-field textarea:focus { outline: none; border-color: var(--ht-ink); }
.ht-field textarea { min-height: 160px; resize: vertical; }
.ht-hp { position: absolute; left: -9999px; }
.ht-form .ht-btn { background: var(--ht-ink); color: #fff; border-color: var(--ht-ink); }
.ht-form .ht-btn:hover { background: #fff; color: var(--ht-ink); }
.ht-notice { max-width: 620px; margin: 0 auto 20px; padding: 14px 18px; border-left: 3px solid var(--ht-ink); background: var(--ht-tile); color: var(--ht-heading); }
.ht-notice--error { border-color: #b3261e; }

/* ---------- Footer ---------- */
.ht-footer {
	border-top: 1px solid var(--ht-line);
	padding: 28px 0;
	font-family: var(--ht-head-font);
	font-size: 12px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--ht-muted);
}
.ht-footer .ht-wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ht-footer a { color: var(--ht-muted); }
.ht-footer a:hover { color: var(--ht-ink); }
