/*!
 * Theme Name: Autonomie FSE
 * Theme URI: https://github.com/pfefferle/Autonomie
 * Author: Matthias Pfefferle
 * Author URI: https://notiz.blog/
 * Description: Autonomie is a highly semantic, responsive, accessible and SEO-optimized Full Site Editing (FSE) WordPress theme. It provides HTML5 templates refined with microformats, microformats v2 and microdata (Schema.org). Autonomie supports the IndieWeb and is fully compatible with modern block-based editing.
 * Version: 2.0.2
 * License: MIT
 * License URI: https://opensource.org/licenses/MIT
 * Tags: block-templates, block-patterns, full-site-editing, microformats, rtl-language-support, translation-ready, post-formats, threaded-comments, one-column, editor-style, featured-images, blog, accessibility-ready, indieweb, semantic-html, wide-blocks
 * Text Domain: autonomie
 * Requires at least: 6.4
 * Tested up to: 6.7
 * Requires PHP: 7.4
 *
 * GitHub Theme URI: pfefferle/autonomie
 * GitHub Theme URI: https://github.com/pfefferle/autonomie
 *
 * Use it to make something cool, have fun, and share what you've learned with others.
 */

/*
 * This file contains only styles that cannot be expressed in theme.json.
 * Most styling is handled through theme.json settings and block styles.
 */

/* ==========================================================================
   Base / Typography
   ========================================================================== */

body {
	word-wrap: break-word;
}

.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.wp-site-blocks > main {
	flex-grow: 1;
}

h1, h2, h3, h4, h5, h6, caption, figcaption {
	text-wrap: balance;
}

p, ul, ol, blockquote {
	text-wrap: pretty;
}

::selection {
	background: light-dark(#b3d4fc, #3a6fa0);
	color: light-dark(#000, #fff);
}

abbr {
	font-variant: small-caps;
}

abbr[title] {
	border-bottom: 1px dotted var(--wp--preset--color--gray);
	cursor: help;
}

ins {
	background: light-dark(var(--wp--preset--color--yellow), rgba(255, 249, 192, 0.15));
	text-decoration: none;
}

address {
	font-style: normal;
}

blockquote cite::before,
blockquote small::before {
	content: "\2014 \00A0";
}

blockquote cite,
blockquote small {
	text-align: left;
}

/* Caption text-align can't be set in theme.json */
figure figcaption {
	text-align: right;
}

.avatar {
	border-radius: 50%;
}

/* ==========================================================================
   Section Headings
   Comment titles, reply form title
   ========================================================================== */

#comments,
#reply-title {
	padding: 0;
	font-size: 1.75rem;
	font-weight: 300;
	line-height: 1.25;
}

#comments {
	margin: 0 0 var(--wp--preset--spacing--60) 0;
}

#reply-title {
	margin: 0 0 var(--wp--preset--spacing--40) 0;
}

#reply-title small {
	font-size: 0.5em;
	margin-left: 0.5em;
}

/* ==========================================================================
   Site Header
   ========================================================================== */

.site-header .site-branding {
	min-width: 0;
	flex: 1 1 auto;
	gap: var(--wp--custom--header--branding-gap);
}

.site-header .wp-block-site-title {
	min-width: 0;
}

.site-header .site-navigation {
	min-width: 0;
}

.site-header .site-header-search {
	min-width: 0;
}

@media (min-width: 783px) {
	.site-header .site-navigation .wp-block-navigation__container {
		flex-wrap: nowrap;
	}

	.site-header .site-navigation .wp-block-navigation-item__content {
		white-space: nowrap;
	}
}

.site-header-search.wp-block-search .wp-block-search__inside-wrapper {
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border-gray);
	border-radius: 50px;
	overflow: hidden;
}

.site-header-search.wp-block-search .wp-block-search__input {
	-webkit-appearance: none;
	appearance: none;
	border: none;
	padding: 5px 12px;
	max-width: 100%;
	background-color: transparent;
	font-size: 0.85rem;
}

.site-header-search.wp-block-search .wp-block-search__button {
	border: none;
	background: transparent;
	color: var(--wp--preset--color--light-gray);
	padding: 4px 8px;
	line-height: 0;
}


/* ==========================================================================
   Entry Meta (post-meta template part)
   ========================================================================== */

.wp-block-group.entry-meta {
	align-items: center;
	gap: 0;
	row-gap: var(--wp--custom--meta--row-gap);
}

.wp-block-group.entry-meta > * {
	display: inline-flex;
	align-items: center;
}

.wp-block-group.entry-meta > *:not(:first-child)::before {
	content: "\00B7";
	color: var(--wp--preset--color--lighter-gray);
	margin: 0 var(--wp--custom--meta--separator-gap);
}

.wp-block-group.entry-meta .wp-block-post-author {
	display: inline-flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: var(--wp--custom--meta--avatar-gap);
}

.wp-block-group.entry-meta .wp-block-post-author__avatar {
	margin-right: 0;
}

.wp-block-group.entry-meta .wp-block-post-author__content {
	display: inline-flex;
	align-items: center;
}

.wp-block-group.entry-meta .wp-block-post-author__byline,
.wp-block-group.entry-meta .wp-block-post-author__name {
	font-size: inherit;
	line-height: inherit;
	font-weight: inherit;
	color: var(--wp--preset--color--light-gray);
}

.wp-block-group.entry-meta .wp-block-post-author__byline {
	display: inline-block;
	flex: 0 0 auto;
	width: auto;
	margin: 0 var(--wp--custom--meta--byline-gap) 0 0;
}

/* ==========================================================================
   Post Format: Video
   YouTube/Vimeo-inspired — video first, title + meta below
   ========================================================================== */

/* Video hero — extracted first embed, displayed above the title */
.video-hero {
	background-color: #0f0f0f;
	padding: var(--wp--preset--spacing--40) 0;
	overflow: hidden;
}

.video-hero .wp-block-embed {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.video-hero .alignfull {
	max-width: none;
}

.video-hero .alignwide {
	max-width: var(--wp--style--global--wide-size, 900px);
	margin-left: auto;
	margin-right: auto;
}

.video-hero .wp-block-embed:not(.alignfull):not(.alignwide) {
	max-width: var(--wp--style--global--wide-size, 900px);
	margin-left: auto;
	margin-right: auto;
}

/* Video hero caption — outside the dark area, right-aligned */
.video-hero-caption {
	max-width: var(--wp--style--global--wide-size, 900px);
	margin-left: auto;
	margin-right: auto;
}

.video-hero-caption figcaption {
	font-family: var(--wp--preset--font-family--sans-serif);
	font-size: 0.8em;
	color: var(--wp--preset--color--light-gray);
	text-align: right;
	padding: 0.5em 0;
}

/* ==========================================================================
   Post Reactions Link (archive/homepage)
   ========================================================================== */

.post-reactions {
	margin-top: var(--wp--preset--spacing--40);
}

.post-reactions a::before {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-right: 0.4em;
	vertical-align: -0.15em;
	background-color: currentColor;
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
	mask-size: contain;
	mask-repeat: no-repeat;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	-webkit-mask-repeat: no-repeat;
}

/* Keep consistent singular spacing even when templates are customized in Site Editor. */
.post-navigation {
	margin-top: var(--wp--preset--spacing--80);
	margin-bottom: var(--wp--preset--spacing--80);
}

/* ==========================================================================
   Tables
   ========================================================================== */

table {
	border-collapse: separate;
	border-spacing: 0;
	table-layout: fixed;
	width: 100%;
}

table th {
	font-weight: bold;
}

table thead th {
	vertical-align: bottom;
}

table th,
table td {
	border-top: 1px solid var(--wp--preset--color--border-gray);
	padding: 10px;
	text-align: left;
	vertical-align: top;
}

table caption + thead tr:first-child th,
table caption + thead tr:first-child td,
table colgroup + thead tr:first-child th,
table colgroup + thead tr:first-child td,
table thead:first-child tr:first-child th,
table thead:first-child tr:first-child td {
	border-top: 0;
}

table tbody + tbody {
	border-top: 2px solid var(--wp--preset--color--border-gray);
}

table tbody tr:nth-child(odd) td,
table tbody tr:nth-child(odd) th {
	background-color: var(--wp--preset--color--background-gray);
}

/* ==========================================================================
   Forms
   ========================================================================== */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
textarea {
	border: 1px solid var(--wp--preset--color--border-gray);
	border-radius: 5px;
	padding: 0.5em;
}

input,
textarea {
	max-width: 90%;
	background-color: var(--wp--preset--color--base);
}

input[type="search"]:not(.wp-block-search__input) {
	border: 1px solid var(--wp--preset--color--border-gray);
	border-radius: 50px;
	padding: 5px 15px;
	width: 80%;
}

.search-form .search-submit {
	display: none;
}

/* ==========================================================================
   Float Alignment
   WordPress core doesn't constrain floats within the content area in
   constrained layouts, so we position them with calculated margins.
   ========================================================================== */

.entry-content .alignleft {
	float: left;
	margin-left: max(16px, calc((100% - var(--wp--style--global--content-size)) / 2));
	margin-right: var(--wp--preset--spacing--50);
	margin-bottom: var(--wp--preset--spacing--30);
}

.entry-content .alignright {
	float: right;
	margin-right: max(16px, calc((100% - var(--wp--style--global--content-size)) / 2));
	margin-left: var(--wp--preset--spacing--50);
	margin-bottom: var(--wp--preset--spacing--30);
}

/* ==========================================================================
   Post Format: Status
   ========================================================================== */

.format-status .wp-block-post-title {
	display: none;
}

.format-status .entry-content,
.format-status .wp-block-post-content {
	font-size: 1.5em;
	line-height: 1.6;
}

/* ==========================================================================
   Post Format: Aside
   ========================================================================== */

.format-aside .wp-block-post-title {
	display: none;
}

.format-aside .entry-content,
.format-aside .wp-block-post-content {
	font-size: 1.5em;
	line-height: 1.5;
}

/* On archive: hide title */
.wp-block-post-template .format-aside .wp-block-post-title {
	display: none;
}

/* ==========================================================================
   Dark Mode — colors are handled via light-dark() in theme.json.
   Only non-color overrides that cannot use light-dark() remain here.
   ========================================================================== */

@media (prefers-color-scheme: dark) {

	img:not(.avatar):not([class*="wp-block-site-logo"]) {
		filter: brightness(0.8) contrast(1.2);
	}
}
