/*
Theme Name: Pedro Brinca
Theme URI: https://pedrobrinca.pt/
Author: Pedro Brinca
Description: Midnight & Sky design for pedrobrinca.pt, a child theme of Twenty Twenty-Five. The home page shows the newest entries of the MEDIA page automatically.
Template: twentytwentyfive
Version: 1.0.9
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
Text Domain: pedrobrinca
*/

/* ---------- Header: dark bar that stays on top while scrolling ---------- */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
}
body.admin-bar .wp-site-blocks > header.wp-block-template-part {
	top: var(--wp-admin--admin-bar--height, 32px);
}
@media (max-width: 600px) {
	body.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 0; }
}
.wp-site-blocks > footer.wp-block-template-part { margin-block-start: 0; }

.pb-logo { margin: 0; }
.pb-logo a { text-decoration: none; }
.pb-nav a { text-decoration: none; opacity: .92; }
.pb-nav a:hover,
.pb-nav a:focus { opacity: 1; text-decoration: underline; text-underline-offset: 6px; }

/* ---------- Home: photo with name over the dark table ---------- */
.pb-hero { min-height: calc(100vh - 60px) !important; min-height: calc(100svh - 60px) !important; }
.pb-hero .pb-hero-name { letter-spacing: -.01em; margin-bottom: 0; }
.pb-hero .pb-tagline { margin-top: 14px; }
.pb-hero .is-style-outline .wp-block-button__link { border: 1.5px solid currentColor; background: transparent; }
@media (max-width: 640px) {
	.pb-hero .wp-block-cover__image-background { object-position: 52% 20% !important; }
}

/* ---------- Home: "Latest in the media" cards ---------- */
.pb-latest h2 { margin-bottom: 0; }
.pb-latest .pb-sub { margin-top: 6px; }
.pb-cards {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
	margin-top: 28px;
}
.pb-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 18px rgba(0, 0, 0, .06);
	transition: transform .15s ease, box-shadow .15s ease;
}
.pb-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0, 0, 0, .08), 0 10px 24px rgba(0, 0, 0, .10); }
.pb-thumb {
	aspect-ratio: 16 / 9;
	background: var(--wp--preset--color--deep, #0b1524) center / cover no-repeat;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-weight: 700;
	font-size: 20px;
	letter-spacing: .04em;
}
/* Outlet tiles with the paper's own logo and colours */
.pb-thumb--brand img { width: 58%; max-height: 42%; object-fit: contain; }
.pb-thumb--negocios { background: #fff; box-shadow: inset 0 -4px 0 #ed1c24; }
.pb-thumb--record { background: #ef1401; }
.pb-card-body { padding: 14px 16px 18px; }
.pb-chip {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-3, #2c6ea8);
	margin-bottom: 6px;
}
.pb-card-title { font-size: 16px !important; line-height: 1.3 !important; margin: 0; }
.pb-card-title a { color: var(--wp--preset--color--contrast, #0f1b2d); text-decoration: none; }
.pb-card-title a::after { content: ""; position: absolute; inset: 0; } /* whole card is the link */
.pb-desc {
	font-size: 14px;
	line-height: 1.45;
	color: var(--wp--preset--color--accent-4, #56657a);
	margin-top: 6px;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.pb-meta { color: var(--wp--preset--color--accent-4, #56657a); font-size: 13px; margin-top: 8px; }
.pb-more { margin-top: 26px !important; }
.pb-more a { text-decoration: none; }
@media (max-width: 900px) { .pb-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pb-cards { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.pb-footer h2 { margin-bottom: .4em; }
.pb-footer-links { list-style: none; padding-left: 0; }
.pb-footer a { text-decoration: none; }
.pb-footer a:hover { text-decoration: underline; }

/* ---------- Inner pages: midnight title band + white "paper" card ---------- */
/* The band shows the page's Featured Image under a midnight fade (dark on the left, where the title is). */
.pb-page-hero-wrap { margin: 0 !important; }
.wp-block-cover.pb-page-hero { min-height: 0 !important; margin: 0 !important; align-items: flex-start; }
.wp-block-cover.pb-page-hero .wp-block-cover__image-background { filter: saturate(.85); }
@media (max-width: 640px) {
	.wp-block-cover.pb-page-hero .wp-block-cover__image-background { object-position: 72% 40% !important; }
}
/* About me: the photo is anchored at its top edge, and on phones shifted right so the face stays in view */
.page-id-31 .wp-block-cover.pb-page-hero .wp-block-cover__image-background { object-position: 60% 0% !important; }
@media (max-width: 640px) {
	.page-id-31 .wp-block-cover.pb-page-hero .wp-block-cover__image-background { object-position: 84% 0% !important; }
}
.pb-page-hero .pb-eyebrow {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	margin: 0 0 8px;
}
.pb-page-title {
	font-size: clamp(32px, 4.6vw, 52px) !important;
	line-height: 1.08 !important;
	letter-spacing: -.015em;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	text-transform: none;
}
.pb-page-title::after {
	content: "";
	display: block;
	width: 56px;
	height: 3px;
	margin-top: 20px;
	border-radius: 2px;
	background: var(--wp--preset--color--accent-1, #8cc4f0);
}
.pb-page-body > .pb-paper {
	position: relative;
	z-index: 2;
	margin-top: -64px !important;
	border-radius: 14px;
	box-shadow: 0 1px 2px rgba(10, 20, 40, .05), 0 16px 44px rgba(10, 20, 40, .08);
	padding: clamp(24px, 4.5vw, 60px) clamp(20px, 4.5vw, 60px) !important;
}
.pb-paper .wp-block-post-content { font-size: 17px; line-height: 1.7; }
.pb-paper .wp-block-post-content > * + * { margin-block-start: 1em; }
.pb-paper .wp-block-post-content h2 { font-size: 1.55rem; margin-top: 1.8em; }
.pb-paper .wp-block-post-content h3 { font-size: 1.25rem; margin-top: 1.6em; }
.pb-paper .wp-block-post-content h4 { font-size: 1.05rem; margin-top: 1.4em; }
.pb-paper .wp-block-post-content :is(h2, h3, h4):first-child { margin-top: 0; }
.pb-paper .wp-block-post-content a {
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}
.pb-paper .wp-block-post-content a:hover { text-decoration-color: currentColor; }
.pb-paper .wp-block-post-content ul { padding-left: 1.25em; }
.pb-paper .wp-block-post-content li { margin-bottom: .6em; }
.pb-paper .wp-block-post-content li::marker { color: var(--wp--preset--color--accent-1, #8cc4f0); }
.pb-paper .wp-block-post-content img { border-radius: 8px; }
.pb-paper .wp-block-post-content hr,
.pb-paper .wp-block-post-content .wp-block-separator { border: 0; border-top: 1px solid #e3e8ef; margin: 2em 0; }

/* MEDIA page: the year and month lines are bold paragraphs; give them heading treatment */
.page-id-641 .pb-paper p:has(> strong:only-child):has(+ p > strong:only-child) {
	font-size: 1.7rem;
	font-weight: 700;
	letter-spacing: -.01em;
	margin-top: 1.6em;
	padding-bottom: .35em;
	border-bottom: 1px solid #e3e8ef;
}
.page-id-641 .pb-paper p:has(> strong:only-child):has(+ ul) {
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-3, #2c6ea8);
	margin-top: 2em;
	margin-bottom: .4em;
}
.page-id-641 .pb-paper ul + p:has(> strong:only-child):has(+ p > strong:only-child) { margin-top: 2.4em; }
.page-id-641 .pb-paper li { margin-bottom: .85em; }
/* Justified text leaves big word gaps on narrow screens: left-align it on phones */
@media (max-width: 640px) {
	.pb-paper .wp-block-post-content [style*="justify"],
	.pb-paper .wp-block-post-content .has-text-align-justify { text-align: left !important; }
}

/* ---------- Pages written in the classic editor (MEDIA list etc.) ---------- */
.wp-block-post-content li { margin-bottom: .45em; }

/* Images set to "align right/left" in the classic editor, e.g. the About page portrait */
.wp-block-post-content img.alignright { float: right; margin: .35em 0 1.2em 2em; }
.wp-block-post-content img.alignleft { float: left; margin: .35em 2em 1.2em 0; }
.wp-block-post-content img.pb-portrait {
	width: 300px;
	max-width: 42%;
	height: auto;
	border-radius: 10px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}
@media (max-width: 640px) {
	.wp-block-post-content img.alignright,
	.wp-block-post-content img.alignleft { float: none; display: block; margin: 0 auto 1.5em; }
	.wp-block-post-content img.pb-portrait { width: 100%; max-width: 420px; }
}
