/*
Theme Name: Binarni (Twenty Twenty-Three child)
Theme URI: https://www.binarni.net/
Description: Child theme of Twenty Twenty-Three. Adds the two banners above the post list on the home page.
Author: Aleksandar Erkalovic
Template: twentytwentythree
Version: 1.1.0
Requires at least: 6.1
License: GNU General Public License v2 or later
Text Domain: binarni
*/

/* ===== Section dividers: ---- Projects ----   /   ---- Posts ---- ===== */
.binarni-divider {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 0 0 1.25rem;
	padding: 0;
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .2em;
	text-transform: uppercase;
	line-height: 1.2;
}
.binarni-divider::before,
.binarni-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: #d5d5d5;
	background: color-mix(in srgb, currentColor 22%, transparent);
}
.binarni-banners + .binarni-divider { margin-top: 2.25rem; margin-bottom: var(--wp--preset--spacing--50, 1.5rem); }

/* ===== Home page banners (two equal banners, same height, responsive) ===== */
.binarni-banners {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem;                         /* <- space between the banners */
	margin: 0;
}
/* narrow screens: one under the other (still the same height, each full width) */
@media (max-width: 520px) {
	.binarni-banners { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
}

.binarni-banner {
	position: relative;
	display: block;
	aspect-ratio: 384 / 198;             /* = the kur.ac GIF, so it is shown 100% */
	overflow: hidden;
	border-radius: 6px;
	background: #1d3b13;
	container-type: inline-size;         /* lets the text scale with the banner width */
	text-decoration: none;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
	transition: transform .15s ease, box-shadow .15s ease;
}
.binarni-banner:hover,
.binarni-banner:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
}
.binarni-banner:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }

.binarni-banner img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;                   /* fills the box; crops only if proportions differ */
	object-position: 50% 65%;            /* which part of the picture stays visible */
	margin: 0;
}

/* --- Gridville banner: picture + dark veil + "Gridville" text --- */
.binarni-banner--gridville::before {     /* veil so the text is readable */
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: rgba(0, 20, 40, .28);
}
.binarni-banner__title {
	position: absolute;
	z-index: 2;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	color: #fff;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
	line-height: 1.05;
	text-shadow: 0 2px 0 rgba(0, 0, 0, .45), 0 0 18px rgba(0, 0, 0, .55);
	font-size: clamp(1.4rem, 5vw, 2.6rem);   /* fallback for old browsers */
	font-size: 11cqw;                        /* scales with banner width */
}
.binarni-banner__title small {
	display: block;
	margin-top: .35em;
	font-size: 4cqw;
	font-weight: 600;
	letter-spacing: .18em;
	opacity: .95;
}

/* --- Variant B (optional): text bottom-left on a gradient. Add class "binarni-banner--bottom" --- */
.binarni-banner--bottom.binarni-banner--gridville::before {
	background: linear-gradient(to top, rgba(0, 15, 30, .8) 0%, rgba(0, 15, 30, 0) 65%);
}
.binarni-banner--bottom .binarni-banner__title {
	align-items: flex-start;
	justify-content: flex-end;
	text-align: left;
	padding: 0 5cqw 5cqw;
	font-size: 10cqw;
}
.binarni-banner--bottom .binarni-banner__title small { font-size: 3.8cqw; letter-spacing: .12em; }

/* ===== Single posts: no featured image at the top ===== */
/* (also removed in templates/single.html; this is a fallback if the template was customised in the Site Editor) */
.single-post .wp-block-post-featured-image { display: none; }

/* ===== About me: "history" cards (moved here from the old Sparkling theme CSS) ===== */
/* In the editor: add a Group block, give it the "history" class (Advanced -> Additional CSS class)
   and pick the background colour in the block's Color settings. */
.history {
	min-height: 200px;
	padding: 1em;
	margin-top: 1em;
	border-radius: 0.8em;
}
.history .year {
	text-align: right;
	font-weight: bold;
	font-size: 3em;
	line-height: 1.1;
	margin: 0 0 .25em;
}
.history > :last-child { margin-bottom: 0; }
.history .alignleft { margin-right: 10px; margin-bottom: 10px; }
.history { overflow: auto; }          /* so the floated picture stays inside the card */

/* ===== My projects: GitHub buttons + tag pills (moved here from the old Sparkling CSS) ===== */
.github-buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5em;
	margin-top: .75em;
}
.github-buttons > * { margin: 0; }
.project-tag-line { margin-top: .75em; }
.project-tag {
	display: inline-block;
	font-size: 80%;
	line-height: 1.2;
	background-color: #a0a0a0;
	color: #fff;
	border-radius: 3px;
	padding: 5px;
	margin: 0 .5em .4em 0;
}
.projects-section { padding-top: 2em; }
