/*
Theme Name: amel
Theme URI: https://amel.ba/
Description: Child theme of Twenty Twenty-Five for amel's blog. Dark layout, DM Sans, topic-based homepage, guide extras.
Author: Amel
Template: twentytwentyfive
Version: 2.2.3
Requires at least: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: amel
*/

:root {
	--amel-card: var(--wp--preset--color--card);
	--amel-line: var(--wp--preset--color--line);
	--amel-muted: var(--wp--preset--color--accent-4);
	--amel-blue: var(--wp--preset--color--accent-1);
	--amel-topic: #8fb1e6;
}

/* ---------- Page frame: footer always at the bottom, no stray gaps ---------- */
.wp-site-blocks {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}
.wp-site-blocks > main {
	flex: 1 0 auto;
}
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* ---------- Header ---------- */
.amel-header {
	z-index: 50;
}
.amel-header .wp-block-site-title a,
.amel-footer .wp-block-site-title a {
	text-decoration: none;
}
.amel-header .wp-block-navigation a {
	text-decoration: none;
}
.amel-header .wp-block-navigation a:hover {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}
.amel-search .wp-block-search__button {
	background: transparent;
	border: 0;
	color: var(--wp--preset--color--contrast);
	padding: 0.25rem;
}
.amel-search .wp-block-search__button svg {
	fill: currentColor;
	width: 22px;
	height: 22px;
}
.wp-block-search__input {
	background: var(--amel-card);
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--amel-line);
	border-radius: 6px;
	padding: 0.45rem 0.75rem;
}
.amel-search-page {
	margin-top: 1.25rem;
	max-width: 520px;
}

/* ---------- Footer ---------- */
.amel-footer p {
	margin: 0;
}
.amel-footer a {
	text-decoration: none;
}
.amel-footer a:hover {
	text-decoration: underline;
}

/* ---------- Meta row: Guide/Note · language · topic · video ---------- */
.amel-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem 0.6rem;
	font-size: 0.8rem;
	line-height: 1.4;
	position: relative;
	z-index: 2;
}
.amel-meta a {
	text-decoration: none;
}
.amel-tag {
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 0.2rem 0.55rem;
	border-radius: 4px;
}
.amel-tag--guide {
	background: var(--amel-blue);
	color: #fff;
}
.amel-tag--update {
	background: #138a7e;
	color: #fff;
}
.amel-tag--note {
	background: #2a2f39;
	color: var(--wp--preset--color--contrast);
}
.amel-lang {
	border: 1px solid #3a404b;
	color: var(--amel-muted);
	padding: 0.12rem 0.42rem;
	border-radius: 4px;
	font-size: 0.68rem;
	font-weight: 700;
}
.amel-topic {
	color: var(--amel-topic);
	font-weight: 600;
}
.amel-video {
	color: var(--amel-muted);
	font-weight: 600;
}
.amel-meta a:hover {
	text-decoration: underline;
}

/* ---------- Cards ---------- */
.amel-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.5rem;
}
.amel-card {
	position: relative;
	background: var(--amel-card);
	border: 1px solid var(--amel-line);
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: border-color 0.15s ease, transform 0.15s ease;
}
.amel-card:hover {
	border-color: #3a4352;
	transform: translateY(-2px);
}
.amel-card__media img {
	display: block;
	width: 100%;
	height: 180px;
	object-fit: cover;
}
.amel-card__body {
	padding: 1.15rem 1.25rem 1.3rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	flex: 1;
}
.amel-card__title {
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.3;
}
.amel-card.is-text .amel-card__title {
	font-size: 1.2rem;
}
.amel-card__title a {
	text-decoration: none;
}
/* Whole card clickable; meta links stay clickable above it. */
.amel-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
.amel-card__excerpt {
	margin: 0;
	color: var(--amel-muted);
	font-size: 0.92rem;
	line-height: 1.55;
}
.amel-card__foot {
	margin-top: auto;
	font-size: 0.8rem;
	color: var(--amel-muted);
}

/* Featured (newest post) */
.amel-featured {
	margin-bottom: 0.5rem;
}
.amel-card--featured {
	display: grid;
	grid-template-columns: 1.25fr 1fr;
	align-items: stretch;
	border-radius: 14px;
}
.amel-card--featured.is-text {
	grid-template-columns: 1fr;
}
.amel-card--featured .amel-card__media img {
	height: 100%;
	min-height: 340px;
}
.amel-card--featured .amel-card__body {
	padding: 2rem 2.5rem;
	justify-content: center;
	gap: 0.85rem;
}
.amel-card--featured .amel-card__title {
	font-size: 2rem;
	line-height: 1.15;
}
.amel-card--featured .amel-card__excerpt {
	font-size: 1rem;
}
.amel-card--featured .amel-card__foot {
	margin-top: 0;
}
.amel-btn {
	align-self: flex-start;
	margin-top: 0.4rem;
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 50px;
	padding: 0.45rem 1.25rem;
	font-weight: 500;
	font-size: 0.95rem;
}
.amel-card--featured:hover .amel-btn {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* Featured card without image: navy gradient, grid, coloured edge by type */
.amel-card--featured.is-text {
	--amel-edge: var(--amel-blue);
	min-height: 340px;
	border-color: #1d2d4a;
	background: radial-gradient(900px 420px at 88% 10%, #163463 0%, #0b1f41 45%, #0c1730 100%);
}
.amel-card--featured.is-text.amel-type-update {
	--amel-edge: #138a7e;
}
.amel-card--featured.is-text.amel-type-note {
	--amel-edge: #5b6372;
}
.amel-card--featured.is-text::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image: linear-gradient(rgba(143, 177, 230, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(143, 177, 230, 0.07) 1px, transparent 1px);
	background-size: 44px 44px;
}
.amel-card--featured.is-text::after {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 8px;
	background: var(--amel-edge);
}
.amel-card--featured.is-text .amel-card__body {
	position: relative;
	justify-content: flex-end;
	padding: 3rem 4rem 2.9rem 4.5rem;
	max-width: 960px;
}
.amel-card--featured.is-text .amel-card__title {
	font-size: 2.75rem;
	line-height: 1.08;
}
.amel-card--featured.is-text .amel-card__excerpt {
	color: #c9d1dc;
	max-width: 720px;
}
.amel-card--featured.is-text .amel-lang {
	border-color: #4a5568;
	color: #c9d1dc;
}
.amel-card__kicker {
	color: var(--amel-topic);
	font-size: 1.35rem;
	font-weight: 600;
	margin-top: 1rem;
	margin-bottom: -0.4rem;
}

/* Sections on the homepage */
.amel-section__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	margin: 3.5rem 0 1.25rem;
}
.amel-section__head h2 {
	margin: 0;
	font-size: 1.5rem;
}
.amel-section__more {
	color: var(--amel-muted);
	font-size: 0.9rem;
	text-decoration: none;
	white-space: nowrap;
}
.amel-section__more:hover {
	color: var(--wp--preset--color--contrast);
}
.amel-section--topic {
	border-top: 1px solid var(--amel-line);
}
.amel-section--topic .amel-section__head {
	margin-top: 2.5rem;
}
.amel-section--topic .amel-section__head h2::before {
	content: "";
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 2px;
	background: var(--wp--preset--color--accent-2);
	margin-right: 0.6rem;
	vertical-align: middle;
}
.amel-empty {
	color: var(--amel-muted);
	padding: 2rem 0;
}

/* Archive / search headers */
.amel-archive-head {
	margin-bottom: 2rem;
}
.amel-archive-head .wp-block-query-title {
	margin: 0;
}
.amel-archive-head .wp-block-term-description {
	color: var(--amel-muted);
	margin-top: 0.5rem;
}
.amel-pagination {
	margin-top: 2.5rem;
	display: flex;
	gap: 0.75rem;
	justify-content: center;
}
.amel-pagination .page-numbers {
	text-decoration: none;
	padding: 0.3rem 0.7rem;
	border-radius: 6px;
	border: 1px solid var(--amel-line);
}
.amel-pagination .current {
	background: var(--amel-card);
}

/* ---------- Topics page ---------- */
.amel-topic-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.25rem;
}
.amel-topic-tile {
	background: var(--amel-card);
	border: 1px solid var(--amel-line);
	border-radius: 12px;
	padding: 1.25rem 1.4rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.amel-topic-tile h3 {
	margin: 0;
	font-size: 1.25rem;
}
.amel-topic-tile a {
	text-decoration: none;
}
.amel-topic-tile__desc {
	margin: 0;
	color: var(--amel-muted);
	font-size: 0.9rem;
}
.amel-topic-tile ul {
	margin: 0.25rem 0 0;
	padding-left: 1.1rem;
	font-size: 0.9rem;
}
.amel-topic-tile ul a:hover {
	text-decoration: underline;
}
.amel-topic-tile__count {
	margin: auto 0 0;
	padding-top: 0.5rem;
	font-size: 0.85rem;
	color: var(--amel-topic);
}
.amel-year {
	font-size: 1rem;
	color: var(--amel-muted);
	margin: 2rem 0 0.5rem;
}
.amel-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.amel-list li {
	display: grid;
	grid-template-columns: 4.5rem auto 1fr;
	gap: 0.75rem;
	align-items: center;
	padding: 0.65rem 0;
	border-bottom: 1px solid var(--amel-line);
}
.amel-list time {
	color: var(--amel-muted);
	font-size: 0.85rem;
}
.amel-list li > a {
	text-decoration: none;
	font-weight: 500;
}
.amel-list li > a:hover {
	text-decoration: underline;
}

/* ---------- Single post ---------- */
.amel-post-head .wp-block-post-title {
	margin: 0 0 1rem;
	font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
	line-height: 1.15;
}
.amel-post-meta {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.amel-post-meta__line {
	color: var(--amel-muted);
	font-size: 0.875rem;
}
.amel-tested {
	margin-top: 1.25rem;
	border-left: 3px solid var(--amel-blue);
	background: var(--amel-card);
	padding: 0.6rem 1rem;
	border-radius: 0 6px 6px 0;
	font-size: 0.95rem;
}
.amel-tested__label {
	font-weight: 700;
	color: var(--amel-topic);
	margin-right: 0.35rem;
}
.single .wp-block-post-content {
	margin-top: 2rem;
}
.single .wp-block-post-content h2 {
	font-size: 1.6rem;
	margin-top: 2.75rem;
	scroll-margin-top: 90px;
}
.single .wp-block-post-content h3 {
	font-size: 1.2rem;
	margin-top: 2rem;
	scroll-margin-top: 90px;
}
.single .wp-block-post-content a {
	color: var(--amel-topic);
}
.amel-post-nav a {
	text-decoration: none;
	color: var(--amel-muted);
}
.amel-post-nav a:hover {
	color: var(--wp--preset--color--contrast);
}

/* Table of contents */
.amel-toc {
	background: var(--amel-card);
	border: 1px solid var(--amel-line);
	border-radius: 10px;
	padding: 0.9rem 1.25rem;
	margin-bottom: 2rem;
}
.amel-toc summary {
	cursor: pointer;
	font-weight: 700;
}
.amel-toc ol {
	margin: 0.6rem 0 0.2rem;
	padding-left: 0;
	list-style: none;
}
.amel-toc li {
	margin: 0.2rem 0;
}
.amel-toc ol ol {
	margin: 0.2rem 0 0.3rem;
	padding-left: 1.1rem;
	list-style: circle;
	font-size: 0.92rem;
}
.single .wp-block-post-content .amel-toc a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}
.single .wp-block-post-content .amel-toc a:hover {
	text-decoration: underline;
}

/* Tables (dark, subtle lines, scroll on small screens) */
.wp-block-post-content .wp-block-table {
	overflow-x: auto;
	margin-block: 1.5rem;
}
.wp-block-post-content .wp-block-table table {
	border-collapse: collapse;
	width: 100%;
	font-size: 0.95rem;
	line-height: 1.5;
}
.wp-block-post-content .wp-block-table th,
.wp-block-post-content .wp-block-table td {
	border: 1px solid var(--amel-line);
	padding: 0.6rem 0.8rem;
	text-align: left;
	vertical-align: top;
	overflow-wrap: normal;
	word-break: normal;
	hyphens: manual;
}
.wp-block-post-content .wp-block-table thead {
	border-bottom: 0;
}
.wp-block-post-content .wp-block-table thead th {
	background: var(--amel-card);
	color: var(--wp--preset--color--contrast);
	font-weight: 700;
	font-size: 0.85rem;
	letter-spacing: 0.02em;
	white-space: nowrap;
}
.wp-block-post-content .wp-block-table tbody tr:nth-child(even) td {
	background: rgba(255, 255, 255, 0.015);
}
.wp-block-post-content .wp-block-table.has-fixed-layout table,
.wp-block-post-content .wp-block-table table.has-fixed-layout {
	table-layout: auto;
}
@media (max-width: 700px) {
	.wp-block-post-content .wp-block-table table {
		min-width: 560px;
	}
}

/* Code blocks with copy button */
.amel-code {
	position: relative;
}
.amel-code pre {
	overflow-x: auto;
	padding-top: 2.4rem !important;
}
.amel-code__copy {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	background: #1d222b;
	color: var(--amel-muted);
	border: 1px solid var(--amel-line);
	border-radius: 6px;
	font: 600 0.75rem/1 "DM Sans", sans-serif;
	padding: 0.35rem 0.6rem;
	cursor: pointer;
}
.amel-code__copy:hover {
	color: var(--wp--preset--color--contrast);
}
:not(pre) > code {
	background: #1d222b;
	padding: 0.1em 0.35em;
	border-radius: 4px;
	font-size: 0.9em;
}

/* YouTube click-to-play */
.amel-yt__frame {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000 center / cover no-repeat;
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.amel-yt__frame::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
}
.amel-yt__frame.is-playing::before {
	display: none;
}
.amel-yt__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.amel-yt__play {
	position: relative;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	border: 0;
	background: rgba(17, 19, 24, 0.85);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease, background 0.15s ease;
}
.amel-yt__play:hover {
	transform: scale(1.07);
	background: #cc0000;
}
.amel-yt__icon {
	width: 0;
	height: 0;
	border-left: 22px solid #fff;
	border-top: 14px solid transparent;
	border-bottom: 14px solid transparent;
	margin-left: 6px;
}
.amel-yt__note {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	margin: 0;
	padding: 0.5rem 0.9rem;
	font-size: 0.75rem;
	color: #d6dbe3;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
}
.single .wp-block-post-content .amel-yt__note a {
	color: #fff;
}

/* Headings inside pages (About, Impressum, Datenschutz …) */
.page .wp-block-post-content h2 {
	font-size: 1.4rem;
	margin-top: 2.25rem;
}

/* Images in posts */
.single .wp-block-post-featured-image img {
	border-radius: 12px;
}
.single .wp-block-post-content .wp-block-image figcaption {
	color: var(--amel-muted);
	font-size: 0.85rem;
	text-align: center;
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
	.amel-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 700px) {
	.amel-grid {
		grid-template-columns: 1fr;
	}
	.amel-card--featured {
		grid-template-columns: 1fr;
	}
	.amel-card--featured .amel-card__media img {
		min-height: 0;
		height: 210px;
	}
	.amel-card--featured .amel-card__body {
		padding: 1.25rem;
	}
	.amel-card--featured .amel-card__title,
	.amel-card--featured.is-text .amel-card__title {
		font-size: 1.6rem;
	}
	.amel-card--featured.is-text .amel-card__body {
		padding: 1.75rem 1.5rem 1.75rem 1.9rem;
	}
	.amel-card__kicker {
		font-size: 1.1rem;
	}
	.amel-section__head {
		margin-top: 2.5rem;
	}
	.amel-list li {
		grid-template-columns: 1fr;
		gap: 0.3rem;
	}
}
