/*
 * Significo content templates: sidebars, blog cards, single posts, share buttons, portfolio,
 * 404 and the maintenance holding page. Loaded after base.css; option values arrive as --sg-* variables.
 */

/* Content + sidebar */

.sg-content-area {
	display: grid;
	gap: 48px;
	grid-template-columns: minmax(0, 1fr);
}

.sg-content-area.sg-content-area--sidebar-none {
	grid-template-columns: minmax(0, 1fr);
}

.sg-content-area.sg-content-area--sidebar-right {
	grid-template-columns: minmax(0, 1fr) var(--sg-sidebar-width, 300px);
}

.sg-content-area.sg-content-area--sidebar-left {
	grid-template-columns: var(--sg-sidebar-width, 300px) minmax(0, 1fr);
}

.sg-content-area--sidebar-left > .sg-sidebar {
	order: -1;
}

.sg-content-main {
	min-width: 0;
}

.sg-sidebar--sticky .sg-sidebar__inner {
	position: sticky;
	top: calc(var(--sg-sticky-offset, 0px) + 32px);
}

.admin-bar .sg-sidebar--sticky .sg-sidebar__inner {
	top: calc(var(--sg-sticky-offset, 0px) + 64px);
}

.sg-sidebar .widget:last-child {
	margin-bottom: 0;
}

.sg-sidebar h2,
.sg-sidebar .widget-title {
	font-size: 1.15rem;
}

.sg-sidebar .widget ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sg-sidebar .widget li {
	padding-block: 8px;
	border-bottom: 1px solid var(--sg-color-line);
}

.sg-sidebar .widget li:last-child {
	border-bottom: 0;
}

/* Child categories and pages: indented, no second divider. */
.sg-sidebar .widget li ul {
	margin-top: 8px;
	padding-left: 1em;
}

.sg-sidebar .widget li li:last-child {
	padding-bottom: 0;
}

.sg-sidebar .widget a {
	text-decoration: none;
}

@media (max-width: 1024px) {
	.sg-content-area.sg-content-area--sidebar-right,
	.sg-content-area.sg-content-area--sidebar-left {
		grid-template-columns: minmax(0, 1fr);
	}

	.sg-content-area--sidebar-left > .sg-sidebar {
		order: 0;
	}

	.sg-sidebar--sticky .sg-sidebar__inner {
		position: static;
	}
}

/* Inside a sidebar layout the entry sections already sit in a container. */
.sg-content-area .sg-container {
	max-width: none;
	padding-inline: 0;
}

/* Post lists: grid, list, classic, masonry */

.sg-posts {
	--sg-cols: 2;
	--sg-gap: 40px;
	display: grid;
	gap: var(--sg-gap);
	grid-template-columns: minmax(0, 1fr);
}

.sg-posts--grid,
.sg-posts--masonry {
	column-gap: 32px;
	grid-template-columns: repeat(auto-fill, minmax(max(240px, calc((100% - (var(--sg-cols) - 1) * 32px) / var(--sg-cols))), 1fr));
}

.sg-posts--masonry {
	align-items: start;
}

.sg-posts--masonry.is-masonry,
.sg-projects--masonry.is-masonry {
	grid-auto-rows: 2px;
	row-gap: 0;
}

.sg-posts--masonry.is-masonry > *,
.sg-projects--masonry.is-masonry > * {
	margin-bottom: 32px;
}

.sg-card {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

.sg-card__media {
	display: block;
	overflow: hidden;
	border-radius: var(--sg-radius);
}

.sg-card__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--sg-card-ratio, 16 / 9);
	border-radius: var(--sg-radius);
	object-fit: cover;
	transition: transform 0.4s ease;
}

.sg-natural-media .sg-card__media img,
.sg-natural-media .sg-project__media img {
	aspect-ratio: auto;
}

.sg-card:hover .sg-card__media img {
	transform: scale(1.03);
}

.sg-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.sg-card__title {
	margin-bottom: 8px;
	font-size: 1.35rem;
}

.sg-card__title a {
	color: inherit;
	text-decoration: none;
}

.sg-card__title a:hover,
.sg-card__title a:focus-visible {
	color: var(--sg-color-link-hover, var(--sg-color-primary));
	text-decoration: underline;
}

.sg-card__meta {
	margin-bottom: 10px;
}

.sg-card__excerpt {
	margin-bottom: 12px;
}

.sg-card__more {
	font-weight: 600;
}

.sg-card__type {
	display: inline-block;
	padding: 2px 10px;
	border-radius: calc(999px * var(--sg-radius-scale, 1));
	background: var(--sg-color-surface);
	color: var(--sg-color-text);
	font-size: 0.8rem;
}

/* List: image beside the text. */
.sg-posts--list .sg-card {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	align-items: center;
	gap: 32px;
}

.sg-posts--list .sg-card:not(:has(.sg-card__media)) {
	grid-template-columns: minmax(0, 1fr);
}

/* Classic: one big card per row. */
.sg-posts--classic {
	gap: 56px;
}

.sg-posts--classic .sg-card__title {
	font-size: clamp(1.6rem, 3vw, 2.1rem);
}

@media (max-width: 700px) {
	.sg-posts--list .sg-card {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}
}

/* Pagination, load more */

.sg-content-main > .navigation,
.sg-container > .navigation.pagination {
	margin-top: 48px;
}

.sg-posts-navigation .nav-links {
	justify-content: space-between;
}

.sg-posts-navigation .nav-links a {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid var(--sg-color-line);
	border-radius: var(--sg-radius);
	text-decoration: none;
}

.sg-posts-navigation .nav-next {
	margin-left: auto;
}

.sg-load-more {
	margin-top: 48px;
	text-align: center;
}

.sg-load-more__button[disabled] {
	cursor: progress;
	opacity: 0.75;
}

/* Single post */

.sg-entry-meta a {
	color: inherit;
}

.sg-entry-meta a:hover,
.sg-entry-meta a:focus-visible {
	color: var(--sg-color-primary);
}

.sg-entry__header {
	margin-bottom: 32px;
}

.sg-entry__header .sg-entry-meta {
	margin-bottom: 0;
}

.sg-entry__media {
	margin-bottom: 40px;
}

.sg-entry__media--top {
	margin-bottom: 32px;
}

.sg-entry__content::after {
	display: table;
	clear: both;
	content: "";
}

.sg-entry-cover {
	display: grid;
	position: relative;
	align-items: end;
	min-height: clamp(360px, 60vh, 640px);
	margin: -48px 0 48px;
	overflow: hidden;
	background: var(--sg-color-heading);
	color: #fff;
}

.sg-entry-cover__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sg-entry-cover::after {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgb(0 0 0 / 0.78) 0%, rgb(0 0 0 / 0.45) 55%, rgb(0 0 0 / 0.3) 100%);
	content: "";
}

.sg-entry-cover__inner {
	position: relative;
	z-index: 1;
	padding-block: 64px 48px;
}

.sg-entry-cover .sg-entry__title,
.sg-entry-cover .sg-entry-meta,
.sg-entry-cover .sg-entry-meta a {
	color: #fff;
}

.sg-entry-cover .sg-entry-meta {
	margin-bottom: 0;
	text-shadow: 0 1px 2px rgb(0 0 0 / 0.4);
}

.sg-entry-cover .sg-entry-meta a:focus-visible,
.sg-entry-cover .sg-entry-meta a:hover {
	color: #fff;
	text-decoration: underline;
}

.sg-entry-cover a:focus-visible {
	outline-color: #fff;
}

.sg-entry__footer {
	display: grid;
	gap: 32px;
	margin-top: 40px;
}

.sg-entry__footer:empty {
	display: none;
}

.sg-entry__footer .sg-tags {
	margin: 0;
}

.sg-page-links {
	margin-top: 24px;
}

/* Share buttons */

.sg-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.sg-share__label {
	color: var(--sg-color-heading);
	font-weight: 600;
}

.sg-share__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sg-share__link,
:where(button).sg-share__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 40px;
	min-height: 40px;
	padding: 6px 12px;
	border: 1px solid var(--sg-color-line);
	border-radius: calc(999px * var(--sg-radius-scale, 1));
	background: #fff;
	color: var(--sg-color-heading);
	font-size: 0.9rem;
	line-height: 1;
	text-decoration: none;
}

.sg-share__link:has(.sg-share__icon) {
	padding: 0;
	width: 40px;
}

.sg-share__link:hover,
.sg-share__link:focus-visible,
:where(button).sg-share__link:hover {
	border-color: var(--sg-color-primary);
	background: var(--sg-color-primary);
	color: #fff;
}

.sg-share__link.is-copied {
	border-color: #1a7f37;
	background: #1a7f37;
	color: #fff;
}

.sg-share__icon {
	display: inline-flex;
}

.sg-share__icon svg {
	flex: none;
	width: 18px;
	height: 18px;
}

.sg-share__status {
	color: #1a7f37;
	font-size: 0.9rem;
}

.sg-share__status.is-error {
	color: #b32d2e;
}

/* Author box */

.sg-author-box {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 20px;
	padding: 24px;
	border-radius: var(--sg-radius);
	background: var(--sg-color-surface);
}

.sg-author-box__avatar img {
	display: block;
	border-radius: calc(50% * var(--sg-radius-scale, 1));
}

.sg-author-box__name {
	margin-bottom: 6px;
	font-size: 1.2rem;
}

.sg-author-box__bio {
	margin-bottom: 8px;
}

.sg-author-box__link {
	font-weight: 600;
}

@media (max-width: 560px) {
	.sg-author-box {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Previous / next */

.sg-post-nav {
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid var(--sg-color-line);
}

.sg-post-nav .nav-links {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
}

.sg-post-nav .nav-next {
	grid-column: 2;
	text-align: right;
}

.sg-post-nav a {
	display: flex;
	flex-direction: column;
	gap: 4px;
	text-decoration: none;
}

.sg-post-nav .nav-next a {
	align-items: flex-end;
}

.sg-post-nav__label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--sg-color-muted);
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.sg-post-nav__label svg {
	flex: none;
	width: 14px;
	height: 14px;
}

.sg-post-nav__title {
	color: var(--sg-color-heading);
	font-family: var(--sg-font-heading);
	font-size: 1.1rem;
	font-weight: 600;
}

.sg-post-nav a:hover .sg-post-nav__title,
.sg-post-nav a:focus-visible .sg-post-nav__title {
	color: var(--sg-color-primary);
	text-decoration: underline;
}

@media (max-width: 560px) {
	.sg-post-nav .nav-links {
		grid-template-columns: minmax(0, 1fr);
	}

	.sg-post-nav .nav-next {
		grid-column: 1;
	}
}

/* Related posts / projects */

.sg-related {
	margin-top: 72px;
}

/* Section layout after posts (Single post → Section at the end of posts): full width, down to the footer. */
.sg-post-after {
	margin-top: 72px;
}

.sg-main:has(> .sg-post-after:last-child) {
	padding-bottom: 0;
}

.sg-related__title {
	margin-bottom: 24px;
	font-size: 1.6rem;
}

.sg-card--related .sg-card__title {
	font-size: 1.15rem;
}

/* Comments */

.sg-comments__list,
.sg-comments__list .children {
	padding-left: 0;
	list-style: none;
}

.sg-comments__list .children {
	padding-left: 32px;
}

.sg-comments__list .comment-body {
	margin-bottom: 24px;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--sg-color-line);
}

.sg-comments__list .avatar {
	float: left;
	margin-right: 12px;
	border-radius: calc(50% * var(--sg-radius-scale, 1));
}

.sg-comments__list .comment-meta {
	margin-bottom: 8px;
	font-size: 0.9rem;
}

.sg-comments__list .comment-metadata a {
	color: var(--sg-color-muted);
}

.comment-reply-title {
	font-size: 1.4rem;
}

/* Portfolio */

.sg-filters {
	margin-bottom: 32px;
}

.sg-filters__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sg-filters__link {
	display: inline-block;
	padding: 6px 16px;
	border: 1px solid var(--sg-color-line);
	border-radius: calc(999px * var(--sg-radius-scale, 1));
	color: var(--sg-color-heading);
	text-decoration: none;
}

.sg-filters__link:hover,
.sg-filters__link:focus-visible {
	border-color: var(--sg-color-primary);
	color: var(--sg-color-primary);
}

.sg-filters__link[aria-current] {
	border-color: var(--sg-color-primary);
	background: var(--sg-color-primary);
	color: #fff;
}

.sg-projects {
	--sg-cols: 3;
	display: grid;
	gap: 32px;
	grid-template-columns: minmax(0, 1fr);
}

.sg-projects--grid,
.sg-projects--masonry {
	grid-template-columns: repeat(auto-fill, minmax(max(220px, calc((100% - (var(--sg-cols) - 1) * 32px) / var(--sg-cols))), 1fr));
}

.sg-projects--masonry {
	align-items: start;
}

.sg-projects--list {
	gap: 56px;
}

.sg-project__link {
	display: block;
	position: relative;
	color: inherit;
	text-decoration: none;
}

.sg-project__media {
	display: block;
	overflow: hidden;
	border-radius: var(--sg-radius);
	background: var(--sg-color-surface);
}

.sg-project__media img,
.sg-project__placeholder {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--sg-card-ratio, 4 / 3);
	object-fit: cover;
	transition: transform 0.4s ease;
}

.sg-project__link:hover .sg-project__media img,
.sg-project__link:focus-visible .sg-project__media img {
	transform: scale(1.04);
}

.sg-project__body {
	display: block;
	padding-top: 14px;
}

.sg-project__title {
	margin: 0 0 2px;
	font-size: 1.2rem;
}

.sg-projects--list .sg-project__title {
	font-size: clamp(1.5rem, 3vw, 2rem);
}

.sg-project__cats {
	display: block;
	color: var(--sg-color-muted);
	font-size: 0.9rem;
}

.sg-project__link:hover .sg-project__title,
.sg-project__link:focus-visible .sg-project__title {
	color: var(--sg-color-primary);
}

/* Title on hover: the text sits on a dark scrim over the image (always shown on touch screens). */
.sg-projects--overlay .sg-project__link {
	overflow: hidden;
	border-radius: var(--sg-radius);
}

.sg-projects--overlay .sg-project__body {
	display: flex;
	position: absolute;
	inset: 0;
	flex-direction: column;
	justify-content: flex-end;
	padding: 24px;
	border-radius: var(--sg-radius);
	background: linear-gradient(to top, rgb(0 0 0 / 0.82), rgb(0 0 0 / 0.35) 70%, rgb(0 0 0 / 0.15));
	opacity: 0;
	transition: opacity 0.25s ease;
}

.sg-projects--overlay .sg-project__title,
.sg-projects--overlay .sg-project__cats,
.sg-projects--overlay .sg-project__link:hover .sg-project__title,
.sg-projects--overlay .sg-project__link:focus-visible .sg-project__title {
	color: #fff;
}

.sg-projects--overlay .sg-project__link:hover .sg-project__body,
.sg-projects--overlay .sg-project__link:focus-visible .sg-project__body {
	opacity: 1;
}

.sg-projects--overlay .sg-project__link:focus-visible {
	outline: 3px solid var(--sg-color-accent);
	outline-offset: 3px;
}

@media (hover: none) {
	.sg-projects--overlay .sg-project__body {
		opacity: 1;
	}
}

.sg-entry--project .sg-post-nav {
	margin-top: 64px;
}

/* 404 */

.sg-not-found__image {
	display: block;
	max-width: min(420px, 100%);
	height: auto;
	margin: 0 auto 24px;
	border-radius: var(--sg-radius);
}

.sg-not-found__text {
	max-width: 560px;
	margin-inline: auto;
}

.sg-not-found__actions {
	margin-top: 24px;
}

.sg-not-found .search-form + .sg-not-found__actions {
	margin-top: 24px;
}

/* Maintenance / coming soon holding page */

.sg-holding {
	display: grid;
	min-height: 100vh;
	place-items: center;
	padding: 48px min(var(--sg-gutter), 6vw);
	background: var(--sg-color-surface);
	text-align: center;
}

.sg-holding__inner {
	max-width: 640px;
}

.sg-holding__site {
	margin-bottom: 24px;
	color: var(--sg-color-muted);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.sg-holding__title {
	font-size: clamp(2.2rem, 6vw, 3.6rem);
}

.sg-holding__text {
	font-size: 1.15rem;
}

.sg-countdown {
	margin-top: 32px;
}

.sg-countdown__clock {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-bottom: 16px;
}

.sg-countdown__unit {
	display: flex;
	flex-direction: column;
	min-width: 76px;
	padding: 14px 8px;
	border-radius: var(--sg-radius);
	background: #fff;
	box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}

.sg-countdown__num {
	color: var(--sg-color-heading);
	font-family: var(--sg-font-heading);
	font-size: 2rem;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	line-height: 1.1;
}

.sg-countdown__label {
	color: var(--sg-color-muted);
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.sg-countdown__text {
	color: var(--sg-color-muted);
}

/* Motion preferences */

@media (prefers-reduced-motion: reduce) {
	.sg-card__media img,
	.sg-project__media img,
	.sg-projects--overlay .sg-project__body {
		transition: none;
	}

	.sg-card:hover .sg-card__media img,
	.sg-project__link:hover .sg-project__media img,
	.sg-project__link:focus-visible .sg-project__media img {
		transform: none;
	}
}

.sg-motion--reduce .sg-card__media img,
.sg-motion--reduce .sg-project__media img,
.sg-motion--reduce .sg-projects--overlay .sg-project__body {
	transition: none;
}

.sg-motion--reduce .sg-card:hover .sg-card__media img,
.sg-motion--reduce .sg-project__link:hover .sg-project__media img {
	transform: none;
}

/* Tall project and post images stay within the screen. */
.sg-entry--project .sg-entry__media img,
.sg-entry--post .sg-entry__media img {
	max-height: 80vh;
	object-fit: cover;
}

/* Maintenance mode with a page that isn't built with Elementor: room above and below. */
.sg-maintenance-mode .sg-main--full > .sg-entry__title {
	margin-top: clamp(48px, 12vh, 140px);
	margin-bottom: 24px;
}

.sg-maintenance-mode .sg-main--full > .sg-entry__content {
	padding-bottom: clamp(48px, 12vh, 140px);
}

/* Reading columns in Elementor layouts (class sg-reading, e.g. the demos' post text) follow Theme Options →
   Global → Reading width: a full-width column takes it as its width, a boxed one as its content width. */
.e-con-full.sg-reading {
	--width: min(100%, var(--sg-container-narrow, 760px)) !important;
}

.e-con-boxed.sg-reading {
	--content-width: min(100%, var(--sg-container-narrow, 760px)) !important;
}

/* sg-ui-guard: the theme's icon buttons keep their own shape and colors when Elementor's global button
   style (Site Settings → Buttons, or Theme Options → Buttons & forms) targets every <button>. */
:where(button).sg-share__link:not(#sg-ui) {
	padding: 6px 12px;
	border: 1px solid var(--sg-color-line);
	border-radius: calc(999px * var(--sg-radius-scale, 1));
	background: #fff;
	color: var(--sg-color-heading);
	font-size: 0.9rem;
}

:where(button).sg-share__link:hover:not(#sg-ui) {
	border-color: var(--sg-color-primary);
	background: var(--sg-color-primary);
	color: #fff;
}

.sg-share__link.is-copied:not(#sg-ui) {
	border-color: #1a7f37;
	background: #1a7f37;
	color: #fff;
}

/* sg-ui-guard: post card titles keep their own colors when Elementor's kit sets link colors. */
.sg-card__title a:not(#sg-ui) {
	color: inherit;
}

.sg-card__title a:hover:not(#sg-ui),
.sg-card__title a:focus-visible:not(#sg-ui) {
	color: var(--sg-color-link-hover, var(--sg-color-primary));
}
