/*
Theme Name: SGW
Theme URI: https://sgw.wroc.pl/
Description: Motyw blokowy Sekcji Grotołazów Wrocław. Odświeżona wersja dawnego wyglądu (Office Space): grafitowy nagłówek, szare tło, biała karta treści i niebieskie linki SGW, z większą typografią i układem responsywnym.
Version: 1.0.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Author: Sekcja Grotołazów Wrocław
Text Domain: sgw
*/

/* -------------------------------------------------------------------------
   Base
   ------------------------------------------------------------------------- */

body {
	background-image: linear-gradient(180deg, #9a9a98 0, var(--wp--preset--color--canvas) 520px);
	background-repeat: no-repeat;
	-webkit-font-smoothing: antialiased;
}

/* Template parts sit flush; spacing is handled by the card. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

:where(.wp-site-blocks) :focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* Blue focus ring is too dark on the charcoal header/footer */
.sgw-header :focus-visible,
.sgw-header__bar :focus-visible,
.sgw-footer :focus-visible,
.sgw-nav-mobile :focus-visible {
	outline-color: var(--wp--preset--color--base);
}

/* -------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------- */

.sgw-header {
	background: var(--wp--preset--gradient--header);
	color: var(--wp--preset--color--base);
	padding-top: var(--wp--preset--spacing--30);
	padding-bottom: var(--wp--preset--spacing--30);
}

.sgw-header__top {
	gap: var(--wp--preset--spacing--40);
}

.sgw-brand {
	gap: var(--wp--preset--spacing--30);
	min-width: 0;
}

.sgw-brand__logo {
	display: block;
	flex: none;
	line-height: 0;
}

.sgw-brand__logo img {
	width: clamp(76px, 5vw + 50px, 112px);
	height: auto;
}

.sgw-brand__text {
	gap: 0.15rem;
}

.sgw-brand .sgw-brand__title {
	margin: 0;
	font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem);
	line-height: 1;
	letter-spacing: 0.04em;
}

.sgw-brand .sgw-brand__title a {
	color: var(--wp--preset--color--base);
	text-decoration: none;
}

.sgw-brand .sgw-brand__tagline {
	margin: 0;
	color: #c9c9c6;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.02em;
}

/* Utility (top) menu */
.sgw-nav-top {
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	gap: 0.25rem 1.25rem;
}

.sgw-nav-top a,
.sgw-nav-top .wp-block-navigation-submenu__toggle {
	color: #e8e8e6;
}

.sgw-nav-top .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--base);
	text-decoration: none;
}

.sgw-nav-top .wp-block-navigation-item > a[href$="/feed/"]::after {
	content: "";
	display: inline-block;
	width: 0.85em;
	height: 0.85em;
	margin-left: 0.4em;
	vertical-align: -0.05em;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4a16 16 0 0 1 16 16h-3A13 13 0 0 0 4 7V4zm0 6a10 10 0 0 1 10 10h-3a7 7 0 0 0-7-7v-3zm2 6a2 2 0 1 1 0 4 2 2 0 0 1 0-4z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4a16 16 0 0 1 16 16h-3A13 13 0 0 0 4 7V4zm0 6a10 10 0 0 1 10 10h-3a7 7 0 0 0-7-7v-3zm2 6a2 2 0 1 1 0 4 2 2 0 0 1 0-4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Main menu bar */
.sgw-header__bar {
	background: var(--wp--preset--color--charcoal-deep);
	border-top: 1px solid #444;
	border-bottom: 3px solid var(--wp--preset--color--accent);
}

.sgw-header__bar-inner {
	gap: var(--wp--preset--spacing--40);
	min-height: 3.25rem;
}

.sgw-nav-main {
	gap: 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.sgw-nav-main > .wp-block-navigation__container {
	gap: 0;
}

.sgw-nav-main > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	display: block;
	padding: 0.95rem 1.1rem;
	color: #f0f0ee;
}

.sgw-nav-main > .wp-block-navigation__container > .wp-block-navigation-item:hover > .wp-block-navigation-item__content,
.sgw-nav-main > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content[aria-current="page"],
.sgw-nav-main > .wp-block-navigation__container > .current-menu-item > .wp-block-navigation-item__content {
	background: #3a3a3a;
	color: var(--wp--preset--color--base);
	text-decoration: none;
}

.sgw-nav-main .wp-block-navigation__submenu-icon {
	color: #f0f0ee;
	margin-right: 0.6rem;
}

/* Dropdowns (both desktop menus) */
.sgw-nav-top .wp-block-navigation__submenu-container,
.sgw-nav-main .wp-block-navigation__submenu-container {
	min-width: 15rem;
	padding: 0.4rem 0;
	background: var(--wp--preset--color--base);
	border: 0;
	border-radius: var(--wp--custom--radius--small);
	box-shadow: var(--wp--preset--shadow--card);
	text-transform: none;
	letter-spacing: 0;
	font-weight: 500;
	font-size: var(--wp--preset--font-size--small);
	z-index: 30;
}

.sgw-nav-top .wp-block-navigation__submenu-container a,
.sgw-nav-main .wp-block-navigation__submenu-container a {
	color: var(--wp--preset--color--contrast);
	padding: 0.5rem 1rem;
}

.sgw-nav-top .wp-block-navigation__submenu-container a:hover,
.sgw-nav-main .wp-block-navigation__submenu-container a:hover {
	background: var(--wp--preset--color--accent-soft);
	color: var(--wp--preset--color--accent-dark);
	text-decoration: none;
}

/* Header search */
.sgw-header-search {
	flex: 0 1 18rem;
	margin: 0;
}

.sgw-header-search .wp-block-search__inside-wrapper {
	background: #fff;
	border: 0;
	border-radius: 999px;
	padding: 2px;
}

.sgw-header-search .wp-block-search__input {
	border: 0;
	background: transparent;
	padding: 0.45rem 0.9rem;
	font-size: var(--wp--preset--font-size--small);
}

.sgw-header-search .wp-block-search__button {
	border-radius: 999px;
	padding: 0.35rem 0.6rem;
	margin: 0;
}

/* Mobile overlay menu */
.sgw-nav-mobile .wp-block-navigation__responsive-container-open {
	color: var(--wp--preset--color--base);
	padding: 0.4rem;
}

.sgw-nav-mobile .wp-block-navigation__responsive-container-open svg {
	width: 32px;
	height: 32px;
}

.sgw-nav-mobile .wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
}

.sgw-nav-mobile .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: flex-start;
	gap: 0.9rem;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
}

.sgw-nav-mobile .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	padding-left: 1rem;
	padding-top: 0.5rem;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
	gap: 0.5rem;
}

.sgw-nav-mobile a {
	color: inherit;
}

/* Responsive visibility */
@media (max-width: 899px) {
	.sgw-desktop-only {
		display: none !important;
	}

	.sgw-header__bar-inner {
		min-height: 0;
		padding-top: 0.6rem;
		padding-bottom: 0.6rem;
	}

	.sgw-header-search {
		flex: 1 1 auto;
	}
}

@media (min-width: 900px) {
	.sgw-mobile-only {
		display: none !important;
	}
}

/* -------------------------------------------------------------------------
   Content card
   ------------------------------------------------------------------------- */

.sgw-main {
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--60);
}

.sgw-card {
	background: var(--wp--preset--color--base);
	border-radius: var(--wp--custom--radius--card);
	box-shadow: var(--wp--preset--shadow--card);
	padding: var(--wp--preset--spacing--50);
}

.sgw-card > * + * {
	margin-block-start: var(--wp--preset--spacing--50);
}

@media (max-width: 599px) {
	.sgw-main {
		padding-left: 0.5rem !important;
		padding-right: 0.5rem !important;
		padding-top: 0.5rem;
	}

	.sgw-card {
		padding: 1.25rem 1rem 2rem;
		border-radius: 8px;
	}
}

.sgw-with-sidebar {
	gap: var(--wp--preset--spacing--60);
}

.sgw-content-col > .wp-block-post-title {
	margin-top: 0;
}

/* Meta line: author · date · categories */
.sgw-meta {
	gap: 0.25rem 0;
	margin-top: 0.5rem;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--x-small);
}

.sgw-meta > * {
	margin: 0;
}

.sgw-meta > * + *::before {
	content: "·";
	margin: 0 0.5em;
	color: #aaa;
}

.sgw-meta__author::before {
	content: "Dodał: ";
}

.sgw-content-col > .sgw-meta {
	padding-bottom: var(--wp--preset--spacing--30);
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.sgw-tags {
	color: var(--wp--preset--color--muted);
}

.sgw-post-nav {
	margin-top: var(--wp--preset--spacing--50);
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--border);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

.sgw-post-nav > * {
	max-width: 48%;
}

@media (max-width: 599px) {
	.sgw-post-nav > * {
		max-width: 100%;
	}
}

/* -------------------------------------------------------------------------
   Section headings, lists, sidebar widgets
   ------------------------------------------------------------------------- */

.sgw-section-title {
	margin: 0 0 0.9rem;
	padding-bottom: 0.45rem;
	border-bottom: 2px solid var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--medium);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.sgw-section-title a {
	color: var(--wp--preset--color--charcoal);
}

.sgw-section-title a:hover {
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}

.sgw-widget + .sgw-widget {
	margin-top: var(--wp--preset--spacing--50);
}

.sgw-sidebar > * + * {
	margin-top: var(--wp--preset--spacing--50);
}

/* Post lists in home columns + "Latest posts" in sidebar */
.sgw-link-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sgw-link-list > li {
	position: relative;
	margin: 0;
	padding: 0.55rem 0 0.55rem 1rem;
	border-bottom: 1px solid var(--wp--preset--color--subtle);
}

.sgw-link-list > li:last-child {
	border-bottom: 0;
}

.sgw-link-list > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 1.05rem;
	width: 6px;
	height: 6px;
	background: var(--wp--preset--color--accent);
}

.sgw-link-list .wp-block-post-title,
.sgw-link-list > li > a {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0;
}

.sgw-link-list > li > a {
	display: block;
}

.sgw-link-list .wp-block-post-title a,
.sgw-link-list > li > a {
	color: var(--wp--preset--color--accent);
}

.sgw-link-list .wp-block-post-title a:hover,
.sgw-link-list > li > a:hover {
	color: var(--wp--preset--color--accent-dark);
	text-decoration: underline;
}

.sgw-link-list .wp-block-post-date,
.sgw-link-list .wp-block-latest-posts__post-date {
	display: block;
	margin: 0.15rem 0 0;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--x-small);
}

.sgw-link-list > li > * + * {
	margin-block-start: 0;
}

/* NextGEN recent photos */
.sgw-recent-photos .ngg-widget {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
	overflow: visible;
}

.sgw-recent-photos .ngg-widget a {
	display: block;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 0;
	border-radius: 4px;
	overflow: hidden;
	aspect-ratio: 3 / 2;
	background: var(--wp--preset--color--subtle);
}

.sgw-recent-photos .ngg-widget img {
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	object-fit: cover;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.sgw-recent-photos .ngg-widget a:hover img {
	transform: scale(1.06);
	opacity: 0.9;
}

/* PZA */
.sgw-pza__body {
	gap: 1rem;
}

.sgw-pza .sgw-pza__logo {
	flex: none;
	margin: 0;
}

.sgw-pza__logo img {
	height: auto;
}

.sgw-pza .sgw-pza__ktj {
	margin: 0;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.25;
}

/* -------------------------------------------------------------------------
   Front page
   ------------------------------------------------------------------------- */

.sgw-featured {
	gap: var(--wp--preset--spacing--50);
	margin-bottom: 0;
}

.sgw-featured .wp-block-post-template {
	margin: 0;
}

.sgw-lead {
	position: relative;
}

.sgw-lead .wp-block-post-featured-image {
	margin: 0;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--card);
	box-shadow: var(--wp--preset--shadow--soft);
}

.sgw-lead .wp-block-post-featured-image img {
	transition: transform 0.4s ease;
}

.sgw-lead:hover .wp-block-post-featured-image img {
	transform: scale(1.03);
}

.sgw-lead__body {
	margin-top: var(--wp--preset--spacing--30);
}

.sgw-lead__body > * {
	margin-top: 0.4rem;
	margin-bottom: 0;
}

.sgw-lead .wp-block-post-title {
	line-height: 1.15;
}

.sgw-mini-list {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.sgw-mini-list > li {
	margin: 0;
	padding: 0.9rem 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.sgw-mini-list > li:first-child {
	padding-top: 0;
}

.sgw-mini-list > li:last-child {
	border-bottom: 0;
}

.sgw-mini {
	gap: 1rem;
}

.sgw-mini .wp-block-post-featured-image {
	flex: none;
	margin: 0;
	border-radius: var(--wp--custom--radius--small);
	overflow: hidden;
}

.sgw-mini__body {
	min-width: 0;
}

.sgw-mini__body > * {
	margin: 0;
}

.sgw-mini .wp-block-post-title {
	line-height: 1.35;
	letter-spacing: 0;
}

.sgw-mini .wp-block-post-date {
	margin-top: 0.3rem;
}

/* Welcome banner (old #home_announce) */
.sgw-announce {
	background: var(--wp--preset--color--announce);
	border: 1px solid var(--wp--preset--color--announce-border);
	border-radius: var(--wp--custom--radius--small);
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
}

.sgw-announce p {
	margin: 0;
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--large);
	letter-spacing: 0.01em;
}

.sgw-home-columns {
	gap: var(--wp--preset--spacing--60);
}

/* Columns: 3 → 2 → 1 (core stacks at 781px; add an in-between step) */
@media (min-width: 782px) and (max-width: 1099px) {
	.sgw-home-columns {
		flex-wrap: wrap !important;
	}

	.sgw-home-columns > .wp-block-column {
		flex-basis: calc(50% - var(--wp--preset--spacing--60)) !important;
	}

	.sgw-home-columns > .wp-block-column:last-child {
		flex-basis: 100% !important;
	}
}

/* -------------------------------------------------------------------------
   Archive lists
   ------------------------------------------------------------------------- */

.sgw-post-list {
	margin: 0;
}

.sgw-post-list > li {
	margin: 0;
	padding: var(--wp--preset--spacing--40) 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.sgw-post-list > li:first-child {
	padding-top: 0;
}

.sgw-post-item {
	gap: var(--wp--preset--spacing--40);
}

.sgw-post-item .wp-block-post-featured-image {
	flex: none;
	margin: 0;
	overflow: hidden;
}

.sgw-post-item__body {
	flex: 1 1 auto;
	min-width: 0;
}

.sgw-post-item__body > * {
	margin-top: 0;
	margin-bottom: 0.4rem;
}

.sgw-post-item .sgw-meta {
	margin-top: 0;
}

@media (max-width: 599px) {
	.sgw-post-item {
		flex-direction: column;
	}

	.sgw-post-item .wp-block-post-featured-image {
		width: 100% !important;
	}
}

.wp-block-query-pagination {
	margin-top: var(--wp--preset--spacing--50);
}

.wp-block-query-pagination-numbers .page-numbers {
	display: inline-block;
	min-width: 2.2em;
	padding: 0.3em 0.5em;
	border-radius: var(--wp--custom--radius--small);
	text-align: center;
}

.wp-block-query-pagination-numbers .page-numbers.current {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

.wp-block-query-title,
.sgw-content-col > h1.wp-block-heading {
	margin-top: 0;
}

/* -------------------------------------------------------------------------
   Post content – including old classic-editor posts
   ------------------------------------------------------------------------- */

.sgw-entry {
	overflow-wrap: break-word;
}

.sgw-entry img {
	max-width: 100%;
	height: auto;
}

.sgw-entry .wp-caption {
	max-width: 100%;
}

.sgw-entry .wp-caption-text {
	margin: 0.4rem 0 0;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--x-small);
}

.sgw-entry .alignleft {
	float: left;
	margin: 0.3rem 1.5rem 1rem 0;
}

.sgw-entry .alignright {
	float: right;
	margin: 0.3rem 0 1rem 1.5rem;
}

.sgw-entry .aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.sgw-entry::after {
	content: "";
	display: table;
	clear: both;
}

@media (max-width: 599px) {
	.sgw-entry .alignleft,
	.sgw-entry .alignright {
		float: none;
		display: block;
		margin: 1rem auto;
	}
}

.sgw-entry iframe {
	max-width: 100%;
}

.sgw-entry table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
}

.sgw-entry table td,
.sgw-entry table th {
	padding: 0.45rem 0.65rem;
	border: 1px solid var(--wp--preset--color--border);
}

/* Table blocks scroll in their figure, so the table itself can fill the column. */
.sgw-entry .wp-block-table table {
	display: table;
	width: 100%;
}

.sgw-entry .wp-block-table th {
	text-align: left;
}

.sgw-entry .wp-block-table td,
.sgw-entry .wp-block-table th {
	overflow-wrap: normal;
}

@media (max-width: 600px) {
	.sgw-entry .wp-block-table {
		font-size: 0.9rem;
	}

	.sgw-entry .wp-block-table td,
	.sgw-entry .wp-block-table th {
		padding: 0.4rem 0.5rem;
	}
}

.sgw-entry .wp-block-table a[href^="tel:"] {
	white-space: nowrap;
}

/* List block style "Dwie kolumny" (registered in functions.php). */
.wp-block-list.is-style-two-columns {
	columns: 2;
	column-gap: var(--wp--preset--spacing--50);
}

.wp-block-list.is-style-two-columns > li {
	break-inside: avoid;
}

@media (max-width: 480px) {
	.wp-block-list.is-style-two-columns {
		columns: 1;
	}
}

/* List block style "Numeracja 1)" for statutes and regulations. */
ol.wp-block-list.is-style-paren-numbers > li::marker {
	content: counter(list-item) ") ";
}

/* NextGEN galleries inside content */
.sgw-entry .ngg-galleryoverview,
.sgw-entry .ngg-albumoverview {
	margin-top: var(--wp--preset--spacing--40);
}

/* Thumbnail galleries: a fluid grid of uniform 4:3 tiles. */
.sgw-entry .ngg-galleryoverview.default-view {
	/* NextGEN forces display: block !important on the overview. */
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
	gap: 0.5rem;
}

.sgw-entry .ngg-galleryoverview.default-view > :not(.ngg-gallery-thumbnail-box) {
	grid-column: 1 / -1;
}

.sgw-entry .ngg-galleryoverview.default-view > .ngg-clear {
	display: none;
}

.sgw-entry .ngg-galleryoverview .ngg-gallery-thumbnail-box {
	display: block;
	float: none;
	width: auto;
	margin: 0;
}

.sgw-entry .ngg-galleryoverview .ngg-gallery-thumbnail {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	text-align: initial;
}

.sgw-entry .ngg-galleryoverview .ngg-gallery-thumbnail a {
	display: block;
	overflow: hidden;
	margin: 0;
	border-radius: 6px;
	background: var(--wp--preset--color--subtle);
}

.sgw-entry .ngg-galleryoverview .ngg-gallery-thumbnail img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	transition: transform 0.3s ease, filter 0.3s ease;
}

.sgw-entry .ngg-galleryoverview .ngg-gallery-thumbnail a:hover img,
.sgw-entry .ngg-galleryoverview .ngg-gallery-thumbnail a:focus-visible img {
	transform: scale(1.04);
	filter: brightness(1.06);
}

.sgw-entry .ngg-galleryoverview .ngg-gallery-thumbnail a:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* Compact albums: three large stacked covers per row. */
.sgw-entry .ngg-albumoverview {
	/* NextGEN forces display: block !important on the overview. */
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40) 1rem;
}

@media (max-width: 600px) {
	.sgw-entry .ngg-albumoverview {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.25rem 0.75rem;
	}

	.sgw-entry .ngg-album-compact h4 {
		font-size: var(--wp--preset--font-size--small);
	}
}

.sgw-entry .ngg-albumoverview > :not(.ngg-album-compact) {
	grid-column: 1 / -1;
}

.sgw-entry .ngg-albumoverview > .ngg-clear {
	display: none;
}

.sgw-entry .ngg-album-compact {
	float: none;
	min-width: 0;
	padding: 0 !important;
}

.sgw-entry .ngg-album-compactbox {
	padding: 0.375rem !important;
	border-color: var(--wp--preset--color--border);
	background: var(--wp--preset--color--base);
}

.sgw-entry .ngg-album-compactbox::before,
.sgw-entry .ngg-album-compactbox::after {
	border-bottom-color: var(--wp--preset--color--border);
}

.sgw-entry .ngg-album-link a {
	display: block;
	overflow: hidden;
	border-radius: 4px;
	background: var(--wp--preset--color--subtle);
}

.sgw-entry .ngg-album-compactbox .Thumb {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border: 0 !important;
	transition: transform 0.3s ease, filter 0.3s ease;
}

.sgw-entry .ngg-album-link a:hover .Thumb,
.sgw-entry .ngg-album-link a:focus-visible .Thumb {
	transform: scale(1.04);
	filter: brightness(1.06);
}

.sgw-entry .ngg-album-compact h4 {
	margin-top: 0.85rem;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.3;
}

.sgw-entry .ngg-album-compact h4 .ngg-album-desc {
	/* Two lines keep the cards aligned (NextGEN's shave() is dequeued in functions.php). */
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	max-width: none !important;
	height: auto;
	min-height: 2.6em;
	text-decoration: none;
}

.sgw-entry .ngg-album-compact .ngg-album-gallery-image-counter {
	margin-top: 0.3rem;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--x-small);
}

@media (prefers-reduced-motion: reduce) {
	.sgw-entry .ngg-galleryoverview .ngg-gallery-thumbnail img,
	.sgw-entry .ngg-album-compactbox .Thumb {
		transition: none;
	}
}

/* -------------------------------------------------------------------------
   Comments
   ------------------------------------------------------------------------- */

.sgw-comments {
	margin-top: var(--wp--preset--spacing--50);
}

.sgw-comment {
	padding: var(--wp--preset--spacing--30) 0;
	border-bottom: 1px solid var(--wp--preset--color--subtle);
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */

.sgw-footer {
	background: var(--wp--preset--color--charcoal);
	color: #cfcfcc;
	padding-top: var(--wp--preset--spacing--40);
	padding-bottom: var(--wp--preset--spacing--40);
	font-size: var(--wp--preset--font-size--small);
}

.sgw-footer__inner {
	gap: 0.5rem var(--wp--preset--spacing--40);
}

.sgw-footer p {
	margin: 0;
}

.sgw-footer a {
	color: #f0f0ee;
}

.sgw-footer a:hover {
	color: var(--wp--preset--color--base);
}

/* 404 */
.sgw-404 {
	padding: var(--wp--preset--spacing--60) 0;
}

/* Placeholder for posts without a featured image */
.sgw-placeholder {
	margin: 0;
	background: var(--wp--preset--gradient--header);
	border-radius: var(--wp--custom--radius--small);
	overflow: hidden;
}

.sgw-placeholder a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.sgw-placeholder img {
	width: 38%;
	max-width: 160px;
	height: auto;
	opacity: 0.55;
}

.sgw-lead .sgw-placeholder {
	border-radius: var(--wp--custom--radius--card);
}

/* Keep the submenu arrow next to its label */
.sgw-nav-main > .wp-block-navigation__container > .has-child > .wp-block-navigation-item__content {
	padding-right: 0.3rem;
}

.sgw-nav-main > .wp-block-navigation__container > .has-child > .wp-block-navigation__submenu-icon {
	margin-right: 1.1rem;
	margin-left: 0;
}

/* Mobile overlay: left-aligned items (colours come from the block's overlay settings) */
.sgw-nav-mobile.items-justified-right .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.sgw-nav-mobile.items-justified-right .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
.sgw-nav-mobile.items-justified-right .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item,
.sgw-nav-mobile.items-justified-right .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	align-items: flex-start !important;
	text-align: left;
	--navigation-layout-justification-setting: flex-start;
	--navigation-layout-justify: flex-start;
}

.sgw-nav-mobile .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	color: #cfcfcc;
}

.sgw-nav-mobile .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item {
	width: 100%;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid #333;
}

.sgw-brand .sgw-brand__tagline {
	line-height: 1.3;
}

.sgw-nav-mobile .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	background: transparent !important;
	border: 0 !important;
}

.sgw-nav-mobile .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container a {
	color: #d5d5d2;
}

.sgw-content-col .sgw-tags,
.sgw-content-col .sgw-post-nav {
	clear: both;
}

/* Hide the separator dot when a meta item wraps to a new line start */
.sgw-meta .wp-block-post-terms::before {
	content: none;
}

.sgw-meta .wp-block-post-terms {
	flex-basis: 100%;
}

/* Keep the footer at the bottom on short pages */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.wp-site-blocks > main,
.wp-site-blocks > .sgw-main {
	flex: 1 0 auto;
}

/* NextGEN containers use overflow:hidden; start them below the float. */
.sgw-entry .ngg-galleryoverview,
.sgw-entry .ngg-albumoverview,
.sgw-entry .ngg-imagebrowser,
.sgw-entry .ngg-slideshow {
	clear: both;
}
