/*
 * Hasak Photography Portfolio – front-end styles.
 * Class names match Easy Photography Portfolio, so existing custom CSS keeps working.
 */

/* ---------- Wrapper ---------- */

.PP_Wrapper {
	--pp-cols: 3;
	--pp-gutter: 20px;
	max-width: 1600px;
	min-height: 50vh;
	clear: both;
	margin-left: auto;
	margin-right: auto;
	width: 96%;
	padding-top: 2rem;
	padding-bottom: 3rem;
}

@media screen and (max-width: 1599px) {
	.PP_Wrapper {
		max-width: calc(96vw - 20px);
	}
}

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

.PP_Wrapper--default figure {
	margin: 0;
	padding: 0;
}

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

/* ---------- Title & description ---------- */

.PP_Description {
	width: 75%;
	max-width: 760px;
	margin: 0 auto 2.5rem;
}

@media screen and (max-width: 640px) {
	.PP_Description {
		width: 100%;
	}
}

.PP_Description__title,
.PP_Description__subtitle {
	text-align: center;
	margin-bottom: 1.4rem;
}

.PP_Description__subtitle {
	display: block;
	text-transform: none;
	font-size: 1.125rem;
	font-weight: 400;
}

.PP_Description__content {
	margin-top: 2rem;
}

/* Categories / portfolio home: center the description under the title. */
.PP_Archive .PP_Description__content,
.PP_Archive .PP_Description__content h2,
.PP_Archive .PP_Description__content h3,
.PP_Archive .PP_Description__content p {
	text-align: center;
}

/* ---------- Text above / below the portfolio ---------- */

.PP_Content {
	max-width: 900px;
	margin-left: auto;
	margin-right: auto;
}

.PP_Content--before {
	margin-bottom: 3rem;
}

.PP_Content--after {
	margin-top: 3rem;
}

.PP_Content__inner > :first-child {
	margin-top: 0;
}

.PP_Content__inner > :last-child {
	margin-bottom: 0;
	padding-bottom: 0;
}

.PP_Content__inner h1,
.PP_Content__inner h2,
.PP_Content__inner h3,
.PP_Content__inner h4 {
	padding-bottom: 0.5em;
	margin-top: 1.5em;
}

.PP_Content__inner p:not(:last-child) {
	padding-bottom: 1em;
}

.PP_Content__inner ul,
.PP_Content__inner ol {
	padding-left: 1.4em;
	margin-bottom: 1em;
}

.PP_Content__inner .aligncenter {
	margin-left: auto;
	margin-right: auto;
}

.PP_Content__inner .alignleft {
	float: left;
	margin: 0 1.5em 1em 0;
}

.PP_Content__inner .alignright {
	float: right;
	margin: 0 0 1em 1.5em;
}

.PP_Content__inner::after {
	content: "";
	display: table;
	clear: both;
}

.PP_Empty {
	text-align: center;
	opacity: 0.7;
}

/* ---------- Column count (read by the masonry script) ---------- */

.PP_Masonry,
.PP_Grid {
	--pp-cols-current: var(--pp-cols);
}

@media screen and (max-width: 1024px) {
	.PP_Masonry,
	.PP_Grid {
		--pp-cols-current: 2;
	}
}

@media screen and (max-width: 640px) {
	.PP_Masonry,
	.PP_Grid {
		--pp-cols-current: 1;
	}
}

/* ---------- Masonry ---------- */

/* Without JavaScript: CSS columns. */
.PP_Masonry:not(.PP_Masonry--js) {
	column-count: var(--pp-cols-current);
	column-gap: var(--pp-gutter);
}

.PP_Masonry:not(.PP_Masonry--js) > .PP_Masonry__item {
	break-inside: avoid;
	margin-bottom: var(--pp-gutter);
}

/* With JavaScript: real columns filled in reading order. */
.PP_Masonry--js {
	display: flex;
	align-items: flex-start;
	gap: var(--pp-gutter);
}

.PP_Masonry__col {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--pp-gutter);
}

.PP_Masonry__item {
	position: relative;
	margin: 0;
	outline: 0;
}

.PP_Masonry__item a,
.PP_Masonry__item img {
	display: block;
}

.PP_Masonry__item img {
	width: 100%;
}

/* ---------- Equal grid ---------- */

.PP_Grid {
	display: grid;
	grid-template-columns: repeat(var(--pp-cols-current), minmax(0, 1fr));
	gap: var(--pp-gutter);
}

.PP_Grid .PP_Entry__thumbnail,
.PP_Grid .PP_Entry__thumbnail--replacement {
	aspect-ratio: 3 / 2;
	overflow: hidden;
}

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

/* ---------- Album card (hovercard) ---------- */

.PP_Card {
	position: relative;
	cursor: pointer;
	overflow: hidden;
}

.PP_Card,
.PP_Card a {
	color: #fff;
	text-shadow: 0 0.03em 0.05em rgba(0, 0, 0, 0.33);
}

.PP_Card a:hover {
	text-decoration: none;
	color: #fff;
}

.PP_Card .PP_Entry__thumbnail > img {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
}

.PP_Card.PP_Entry--no-thumbnail {
	min-height: 300px;
}

.PP_Card .PP_Entry__thumbnail--replacement {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 300px;
	background: linear-gradient(to top, #8c8c8c, #b3b3b3);
}

.PP_Card .PP_Entry__header {
	position: absolute;
	bottom: 1.4rem;
	left: 1.4rem;
	right: 1.4rem;
	z-index: 2;
	pointer-events: none;
	transition: transform 0.35s ease-out, opacity 0.3s ease;
}

.PP_Card .PP_Entry__title a {
	pointer-events: auto;
}

.PP_Card .PP_Entry__title,
.PP_Card .PP_Entry__subtitle {
	color: #fff;
	padding: 0;
	margin: 0;
}

.PP_Card .PP_Entry__subtitle {
	font-size: 1rem;
	font-weight: 300;
	text-transform: none;
	margin-top: 0.3rem;
}

.PP_Card .PP_Entry__more {
	display: block;
	position: absolute;
	inset: 0;
	z-index: 1;
	padding: 1.4rem;
	background-color: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.35s ease;
}

.PP_Card .PP_Entry__inner {
	display: block;
	width: 100%;
	height: 100%;
	opacity: 0;
	transform: translateY(15px);
	transition: transform 0.35s ease-out, opacity 0.3s ease;
}

.PP_Card .PP_Entry__view {
	display: block;
	position: absolute;
	bottom: 1rem;
	font-size: 1rem;
	text-transform: uppercase;
}

.PP_Card--hoverable:hover .PP_Entry__header {
	transform: translateY(-3rem);
}

.PP_Card--hoverable:hover .PP_Entry__more,
.PP_Card--hoverable:hover .PP_Entry__inner {
	opacity: 1;
	transform: translateY(0);
}

/* ---------- Album gallery ---------- */

.PP_Gallery__item {
	position: relative;
}

.PP_Gallery__link {
	display: block;
	cursor: zoom-in;
}

.PP_Gallery__caption {
	display: block;
	width: 100%;
	padding: 0.44rem;
	font-size: 1rem;
	text-align: center;
}

.PP_Gallery:not(.PP_Gallery--show-captions) .PP_Gallery__caption {
	display: none;
}

.PP_Caption__title {
	margin: 0;
	padding: 0;
	font-size: 1rem;
}

.PP_Caption__desc {
	margin: 0.2rem 0 0;
	padding: 0;
	opacity: 0.85;
}

.PP_Gallery__item--video .PP_Gallery__link {
	position: relative;
}

.PP_Gallery__item--video .PP_Gallery__link::before,
.PP_Gallery__item--video .PP_Gallery__link::after {
	content: "";
	position: absolute;
	pointer-events: none;
}

.PP_Gallery__item--video .PP_Gallery__link::before {
	inset: 0;
	background-color: rgba(0, 0, 0, 0.22);
}

.PP_Gallery__item--video .PP_Gallery__link::after {
	left: 50%;
	top: 50%;
	border-style: solid;
	border-width: 30px 0 30px 50px;
	border-color: transparent transparent transparent rgba(255, 255, 255, 0.94);
	transform: translate(-40%, -50%);
}

/* Single column */
.PP_Single_Column {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

.PP_Single_Column .PP_Single_Column__item {
	margin-bottom: 2.4em;
}

.PP_Single_Column .PP_Single_Column__item img {
	margin-left: auto;
	margin-right: auto;
}

/* Password protected album */
.PP_Protected {
	max-width: 680px;
	margin: 2rem auto;
}

.PP_Protected__title {
	margin-bottom: 1rem;
}

/* Twenty Seventeen shows featured images in the header of every post type. */
.PP_Single .single-featured-image-header {
	display: none;
}

/* ---------- Lightbox (PhotoSwipe) ---------- */

.pswp {
	--pswp-bg: #000;
	z-index: 1000000;
}

.pswp__hp-caption {
	position: absolute;
	left: 50%;
	bottom: 0;
	width: min(900px, 100%);
	min-height: 56px;
	padding: 10px 20px;
	transform: translateX(-50%);
	color: #fff;
	text-align: center;
	font-size: 15px;
	line-height: 1.4;
	pointer-events: none;
}

.pswp:not(.hp-thumbs-hidden) .pswp__hp-caption {
	bottom: 84px;
}

.pswp__hp-caption .PP_Caption__title,
.pswp__hp-caption .PP_Caption__desc {
	color: #fff;
	margin: 0;
}

.pswp__hp-thumbs {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 84px;
	padding: 10px;
	display: flex;
	gap: 6px;
	overflow-x: auto;
	scrollbar-width: none;
	background: rgba(0, 0, 0, 0.55);
}

.pswp__hp-thumbs::-webkit-scrollbar {
	display: none;
}

.pswp.hp-thumbs-hidden .pswp__hp-thumbs {
	display: none;
}

.hp-thumbs__item {
	position: relative;
	flex: 0 0 auto;
	width: 96px;
	height: 64px;
	margin: 0;
	padding: 0;
	border: 2px solid transparent;
	background: #222;
	opacity: 0.55;
	cursor: pointer;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}

.hp-thumbs__item:hover,
.hp-thumbs__item.is-active {
	opacity: 1;
}

.hp-thumbs__item.is-active {
	border-color: #fff;
}

.hp-thumbs__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hp-thumbs__item--video::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	border-style: solid;
	border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent #fff;
	transform: translate(-40%, -50%);
}

@media screen and (max-width: 639px) {
	.pswp__hp-thumbs {
		height: 64px;
		padding: 6px;
	}

	.pswp:not(.hp-thumbs-hidden) .pswp__hp-caption {
		bottom: 64px;
	}

	.hp-thumbs__item {
		width: 72px;
		height: 48px;
	}
}

/* Video slides */
.hp-video {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 60px 4vw 100px;
}

.hp-video__frame {
	position: relative;
	width: min(100%, calc((100vh - 160px) * 16 / 9));
	aspect-ratio: 16 / 9;
}

.hp-video__frame iframe,
.hp-video__frame video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: #000;
}
