/*
Theme Name: OnsPalazzo
Description: Child theme of Twenty Twenty-Five for the Palazzo residents site. Follows the visitor's device light/dark setting automatically.
Template: twentytwentyfive
Version: 2.1.0
Text Domain: onspalazzo
*/

/* Let the browser render form controls and scrollbars in the matching scheme. */
:root {
	color-scheme: light dark;
}

/* Dark mode: Slate background, white text, Terracotta Light for links and accents (brand rules). */
@media (prefers-color-scheme: dark) {
	:root {
		--wp--preset--color--base: #1F2A2E;
		--wp--preset--color--contrast: #FFFFFF;
		--wp--preset--color--accent-1: #E07A4F;
		--wp--preset--color--accent-2: #E07A4F;
		--wp--preset--color--accent-4: #A9B4B8;
		--wp--preset--color--accent-5: #27353A;
	}
}

/* Clean page template: content aligned to the top of the screen, nothing else. */
.op-clean {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	padding: 2rem 1rem;
	box-sizing: border-box;
}

.admin-bar .op-clean {
	min-height: calc(100vh - 32px);
}

/* Interactive building on the homepage. */
.op-building {
	/* Fit building and login button on one screen (image ratio 2560 x 1553). */
	max-width: min(1340px, calc((100vh - 11rem) * 1.648));
	margin: 0 auto;
	width: 100%;
}

.op-building svg {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
}

.op-floor path {
	fill: rgba(255, 255, 255, 0);
	stroke: rgba(255, 255, 255, 0);
	stroke-width: 2;
	transition: fill 0.15s ease, stroke 0.15s ease;
	cursor: pointer;
}

.op-floor:hover path,
.op-floor:focus path {
	fill: rgba(192, 88, 47, 0.5);
	stroke: rgba(255, 255, 255, 0.9);
}

.op-floor:focus {
	outline: none;
}

/* Not logged in: the building is a plain picture, nothing to hover or click. */
body:not(.logged-in) .op-floor {
	pointer-events: none;
}

body:not(.logged-in) .op-floor path {
	cursor: default;
}

/* Login link below the building. */
.op-login {
	margin-top: 1.5rem;
	text-align: center;
}

.op-login a {
	display: inline-block;
	padding: 0.7rem 1.6rem;
	border-radius: 999px;
	background: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--base);
	text-decoration: none;
	font-weight: 700;
}

.op-login a:hover {
	opacity: 0.85;
}

/* Members menu: bar at the top on larger screens. */
.op-menu {
	padding: 0.9rem 1.5rem;
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 12%, transparent);
	gap: 1rem;
}

.op-brand {
	display: block;
	line-height: 0;
}

.op-brand img {
	height: 32px;
	width: auto;
}

.op-nav {
	gap: 1.6rem;
	font-size: 0.95rem;
	font-weight: 700;
}

.op-nav a {
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
}

.op-nav .current-menu-item a {
	color: var(--wp--preset--color--accent-2);
}

.op-nav .current-menu-item a,
.op-nav a:hover {
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

/* Regular pages and updates. */
.op-main {
	padding: 2rem 1.25rem 3rem;
}

.op-update {
	padding: 1.25rem 0;
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 12%, transparent);
}

.op-update h2 {
	font-size: 1.3rem;
	margin: 0.2rem 0 0.4rem;
}

.op-update h2 a {
	text-decoration: none;
}

.op-update-date {
	font-size: 0.85rem;
	color: var(--wp--preset--color--accent-4);
}

.op-update .wp-block-post-excerpt__more-text {
	display: none;
}

/* Latest updates under the building on the homepage. */
.op-home-updates {
	max-width: min(1340px, calc((100vh - 11rem) * 1.648));
	margin: 2rem auto 0;
	width: 100%;
}

.op-home-updates h2 {
	font-size: 1.2rem;
	margin-bottom: 0.5rem;
}

.op-home-updates .wp-block-latest-posts {
	padding: 0;
}

.op-home-updates .wp-block-latest-posts li {
	padding: 0.9rem 0;
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 12%, transparent);
}

.op-home-updates .wp-block-latest-posts__post-title {
	font-weight: 700;
	text-decoration: none;
}

.op-home-updates .wp-block-latest-posts__post-date {
	font-size: 0.85rem;
	color: var(--wp--preset--color--accent-4);
}

.op-home-updates .wp-block-latest-posts__post-excerpt {
	margin: 0.3rem 0 0;
	font-size: 0.95rem;
}

.op-home-updates .op-all-updates {
	margin-top: 0.8rem;
	font-size: 0.95rem;
}

/* Category label and date above each update title. */
.op-update-meta {
	gap: 0.6rem;
	align-items: center;
	margin-bottom: 0.2rem;
}

.op-update-meta > * {
	margin: 0;
}

.op-update-cat a {
	display: inline-block;
	padding: 0.1rem 0.55rem;
	border-radius: 999px;
	background: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--base);
	font-size: 0.75rem;
	font-weight: 700;
	text-decoration: none;
	line-height: 1.6;
}

/* Category filter on Actueel. */
.op-cat-filter {
	gap: 0.5rem;
	margin: 0.5rem 0 1rem;
}

.op-cat-filter p,
.op-cat-filter ul {
	margin: 0;
}

.op-cat-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 0;
	list-style: none;
}

.op-cat-all a,
.op-cat-list a {
	display: inline-block;
	padding: 0.3rem 0.8rem;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 25%, transparent);
	color: var(--wp--preset--color--contrast);
	font-size: 0.85rem;
	font-weight: 700;
	text-decoration: none;
}

.op-cat-list .current-cat a,
.home .op-cat-all a,
.blog .op-cat-all a {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	border-color: var(--wp--preset--color--contrast);
}

/* Logo above the login button for visitors who are not logged in. */
.op-home-logo {
	display: flex;
	justify-content: center;
	margin-bottom: 1.25rem;
}

.op-home-logo img {
	height: 48px;
	width: auto;
}

/* Small square image in front of each update. */
.op-update {
	gap: 1rem;
}

.op-update-thumb {
	flex: 0 0 72px;
	margin: 0.2rem 0 0;
}

.op-update-thumb,
.op-update-thumb a {
	display: block;
	width: 72px;
	height: 72px;
}

.op-update-thumb img {
	width: 72px !important;
	height: 72px !important;
	object-fit: cover;
	border-radius: 8px;
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--wp--preset--color--contrast) 18%, transparent);
}

/* Update titles in the text colour, the accent stays for labels and buttons. */
.op-update h2 a,
.op-update-title a {
	color: var(--wp--preset--color--contrast);
}

.op-update h2 a:hover {
	color: var(--wp--preset--color--accent-2);
}

.op-update-text {
	flex: 1;
	min-width: 0;
}

.op-home-updates .wp-block-latest-posts li {
	display: flow-root;
}

.op-home-updates .wp-block-latest-posts__featured-image {
	float: left;
	margin: 0.2rem 1rem 0 0;
}

.op-home-updates .wp-block-latest-posts__featured-image img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
}

/* Phones: brand on the first line, the menu as a row of icons with labels below it, sticky at the top. */
@media (max-width: 781px) {
	.op-menu {
		position: sticky;
		top: 0;
		z-index: 100;
		flex-wrap: wrap !important;
		padding: 0.7rem 0.5rem 0.4rem;
		gap: 0.4rem;
		background: var(--wp--preset--color--base);
	}

	.op-brand {
		width: 100%;
		display: flex;
		justify-content: center;
	}

	.op-brand img {
		height: 28px;
	}

	.op-nav {
		width: 100%;
		justify-content: space-around !important;
		gap: 0;
		font-size: 0.75rem;
	}

	.op-nav .wp-block-navigation__container {
		width: 100%;
		justify-content: space-around;
		gap: 0;
	}

	.op-nav .wp-block-navigation-item {
		flex: 1;
		text-align: center;
	}

	.op-nav a {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 0.2rem;
	}

	.op-nav a::before {
		content: "";
		width: 22px;
		height: 22px;
		background: currentColor;
		-webkit-mask: var(--op-icon) center / contain no-repeat;
		mask: var(--op-icon) center / contain no-repeat;
	}

	.op-nav-news { --op-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h13v16H6a2 2 0 0 1-2-2z'/%3E%3Cpath d='M17 8h3v10a2 2 0 0 1-2 2'/%3E%3Cpath d='M8 8h5M8 12h5M8 16h3'/%3E%3C/svg%3E"); }
	.op-nav-forum { --op-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z'/%3E%3C/svg%3E"); }
	.op-nav-ask { --op-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.6V14'/%3E%3Cpath d='M12 17.5h.01'/%3E%3C/svg%3E"); }
	.op-nav-book { --op-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5a2 2 0 0 1 2-2h14v16H6a2 2 0 0 0-2 2z'/%3E%3Cpath d='M4 21V5'/%3E%3C/svg%3E"); }
	.op-nav-tc { --op-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.6 2.6-2.4-.6-.6-2.4z'/%3E%3C/svg%3E"); }
	.op-nav-board { --op-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20a6.5 6.5 0 0 1 13 0'/%3E%3Cpath d='M16 4.5a3.5 3.5 0 0 1 0 7'/%3E%3Cpath d='M18 14.5a6.5 6.5 0 0 1 3.5 5.5'/%3E%3C/svg%3E"); }
	.op-nav-account { --op-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E"); }

	.op-nav .current-menu-item a,
	.op-nav a:hover {
		text-decoration: none;
		font-weight: 600;
	}
}
