/*
Theme Name:        17minutes
Description:       Schlankes One-Page-Theme für 17minutes.ch. Inhalte werden im Block-Editor mit den Blöcken «17minutes Hero» und «17minutes Abschnitt» gepflegt, Farben im Customizer. Lädt nichts von Drittanbietern (keine Web-Fonts, kein Tracking).
Version:           1.0.0
Requires at least: 6.6
Requires PHP:      8.2
Author:            17minutes AG
Text Domain:       17minutes
License:           GPL-2.0-or-later
*/

/* ==========================================================================
   Design tokens. Colours can be changed in Design → Customizer → 17minutes – Farben
   (inc/customizer.php prints overrides); these are the defaults.
   ========================================================================== */
:root {
	--m17-accent: #a52125;
	--m17-link: #6b1719;
	--m17-text: #6b6764;
	--m17-intro: #800000;
	--m17-section-bg: #f7f7f7;
	--m17-footer-bg: #f0efef;
	--m17-line: #e3e3e3;

	--m17-font: Arial, Helvetica, sans-serif;
	--m17-width: 960px;
	--m17-gutter: 20px;
	--m17-header-h: 53px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	background: #fff;
	color: var(--m17-text);
	font-family: var(--m17-font);
	font-size: 14px;
	line-height: 1.8;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--m17-font);
	color: var(--m17-text);
	line-height: 1.3;
	margin: 0 0 .5em;
}

p { margin: 0 0 1em; }

a { color: var(--m17-link); text-decoration: none; transition: color .2s ease-in; }
a:hover, a:focus { color: var(--m17-accent); }
a:focus-visible { outline: 2px solid var(--m17-accent); outline-offset: 2px; }

img { max-width: 100%; height: auto; }

.m17-sr-only {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.m17-skip-link:focus {
	position: fixed !important;
	top: 8px; left: 8px;
	width: auto; height: auto;
	clip: auto;
	z-index: 1000;
	padding: 8px 16px;
	background: #fff;
	color: var(--m17-link);
}

/* ==========================================================================
   Header: small logo bar. Hidden over the front-page hero, slides in on scroll.
   ========================================================================== */
.m17-header {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 100;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
	transition: transform .35s ease, box-shadow .35s ease;
}
.admin-bar .m17-header { top: var(--wp-admin--admin-bar--height, 32px); }
.m17-header__inner {
	max-width: calc(var(--m17-width) + 2 * var(--m17-gutter));
	margin: 0 auto;
	padding: 12px var(--m17-gutter);
}
.m17-header__logo { display: inline-block; }
.m17-header__logo img { display: block; height: 29px; width: auto; }

.home .m17-header:not(.is-scrolled) { transform: translateY(-110%); box-shadow: none; }

body:not(.home) .m17-main { padding-top: var(--m17-header-h); }

/* ==========================================================================
   Hero block: full-screen photo, logo box + translucent band at the bottom
   ========================================================================== */
.m17-hero {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 100vh;
	background-color: #ddd;
	background-position: center top;
	background-size: cover;
	background-attachment: fixed;
}
.m17-hero__band {
	display: flex;
	min-height: 140px;
}
.m17-hero__logo {
	flex: 0 0 33%;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 0 40px 0 20px;
	background: #fff;
}
.m17-hero__logo img { display: block; height: 100px; width: auto; }
.m17-hero__text {
	flex: 1 1 auto;
	padding: 25px 40px 20px 3%;
	background: color-mix(in srgb, var(--m17-accent) 85%, transparent);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.6;
}
.m17-hero__text p { margin: 0 0 1.6em; color: #fff; }
.m17-hero__text p:last-child { margin-bottom: 0; }
.m17-hero__text a { color: #fff; text-decoration: underline; }

/* ==========================================================================
   Section block
   ========================================================================== */
.m17-section {
	background: #fff;
	padding: 20px var(--m17-gutter) 25px;
	scroll-margin-top: var(--m17-header-h);
}
/* Every second section is light grey, automatically. */
.m17-section:nth-child(even of .m17-section) { background: var(--m17-section-bg); }

.m17-section__inner {
	max-width: var(--m17-width);
	margin: 0 auto;
}

/* Head: title left, intro right, thin dividers */
.m17-head {
	display: grid;
	grid-template-columns: 1fr 1fr;
	border-bottom: 1px solid var(--m17-line);
	margin-bottom: 30px;
}
.m17-head__title {
	font-size: 45px;
	font-weight: 700;
	line-height: 1.2;
	margin: 20px 5% 30px 0;
	color: var(--m17-text);
}
.m17-head__title::after {
	content: ".";
	color: var(--m17-accent);
}
.m17-head__intro {
	border-left: 1px solid var(--m17-line);
	padding: 28px 0 30px 40px;
}
.m17-head__intro.is-highlight { color: var(--m17-intro); }

/* Old site rendered bold as regular weight on the homepage; keep that look. */
.m17-page strong, .m17-page b { font-weight: inherit; }

/* ==========================================================================
   Content inside sections and text pages
   ========================================================================== */
.m17-body::after { content: ""; display: table; clear: both; }
.m17-body > :last-child { margin-bottom: 0; }

.m17-body h3 { font-size: 20px; font-weight: 700; margin: 25px 0 10px; }
.m17-body h4 { font-size: 18px; font-weight: 700; line-height: 1.5; margin: 0 0 10px; }
.m17-page .m17-body h4 strong { font-weight: 700; }

.m17-body .has-text-align-center { text-align: center; }

/* Lists: small outlined triangle, like the original */
.m17-body ul {
	list-style: none;
	margin: 0 0 1em;
	padding: 0;
}
.m17-body ul li {
	position: relative;
	padding-left: 25px;
}
.m17-body ul li::before {
	content: "";
	position: absolute;
	left: 5px;
	top: .55em;
	width: 8px;
	height: 10px;
	background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath d='M.5.9v8.2L7.2 5z' fill='none' stroke='%236b6764'/%3E%3C/svg%3E");
}
.m17-body ul.has-text-align-center li,
.m17-body ul.m17-plain li { padding-left: 0; }
.m17-body ul.has-text-align-center li::before,
.m17-body ul.m17-plain li::before { display: none; }

.m17-body ol { margin: 0 0 1em; padding-left: 25px; }

/* Separators */
.m17-body hr,
.m17-body .wp-block-separator {
	border: 0;
	border-top: 1px solid #999;
	height: 0;
	margin: 10px 0 20px;
	opacity: 1;
}

/* Images */
.m17-body .wp-block-image { margin: 0 0 1em; }
.m17-body .wp-block-image img { display: block; height: auto; max-width: 100%; }
.m17-body .wp-block-image.aligncenter { margin-left: auto; margin-right: auto; display: table; }
.m17-body .wp-block-image.aligncenter img { margin: 0 auto; }
.m17-body .alignright { float: right; margin: 5px 0 15px 40px; }
.m17-body .alignleft { float: left; margin: 5px 40px 15px 0; }

/* Image with caption: light grey card */
.m17-body .wp-block-image:has(figcaption) {
	display: table;
	background: #f3f3f3;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
	padding: 8px 8px 4px;
}
.m17-body .wp-block-image figcaption,
.m17-body .wp-element-caption {
	display: table-caption;
	caption-side: bottom;
	background: #f3f3f3;
	box-shadow: 0 2px 3px -1px rgba(0, 0, 0, .15);
	font-size: 11px;
	line-height: 2.3;
	text-align: center;
	padding: 8px 18px 6px;
	margin: 0;
	color: var(--m17-text);
}

/* ==========================================================================
   Text pages (Impressum, Datenschutz)
   ========================================================================== */
.m17-text-page { padding: 40px var(--m17-gutter) 60px; }
.m17-text-page__inner { max-width: var(--m17-width); margin: 0 auto; }
.m17-text-page__title {
	font-size: 45px;
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 30px;
	padding-bottom: 25px;
	border-bottom: 1px solid var(--m17-line);
}
.m17-text-page__title::after { content: "."; color: var(--m17-accent); }
.m17-text-page__content h2 { font-size: 20px; font-weight: 700; margin: 30px 0 10px; }
.m17-text-page__content h3 { font-size: 16px; font-weight: 700; margin: 20px 0 8px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.m17-footer {
	background: var(--m17-footer-bg);
	border-top: 1px solid #dcdcdc;
	color: #888;
	font-size: 11px;
	line-height: 2.2;
}
.m17-footer__inner {
	max-width: calc(var(--m17-width) + 2 * var(--m17-gutter));
	margin: 0 auto;
	padding: 16px var(--m17-gutter) 14px;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0 30px;
}
.m17-footer__copy { margin: 0; }
.m17-footer-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0 18px;
}
.m17-footer a { color: var(--m17-link); }
.m17-footer a:hover { color: var(--m17-accent); }

/* ==========================================================================
   Small screens
   ========================================================================== */
@media (max-width: 767px) {
	.m17-hero { min-height: 85vh; background-attachment: scroll; }
	.m17-hero__band { flex-direction: column; }
	.m17-hero__logo { justify-content: center; padding: 15px 20px; }
	.m17-hero__logo img { height: 70px; }
	.m17-hero__text { padding: 20px; }

	.m17-head { grid-template-columns: 1fr; }
	.m17-head__title { font-size: 34px; margin: 15px 0 10px; }
	.m17-head__intro { border-left: 0; padding: 0 0 20px; }

	.m17-body .alignright,
	.m17-body .alignleft { float: none; margin: 10px auto 20px; }

	.m17-text-page__title { font-size: 34px; }
	.m17-footer__inner { flex-direction: column; }
}

/* Fixed backgrounds are janky on touch devices. */
@media (hover: none) {
	.m17-hero { background-attachment: scroll; }
}

/* ==========================================================================
   Block editor (this file is also loaded as editor style)
   ========================================================================== */
.editor-styles-wrapper { font-family: var(--m17-font); }
.editor-styles-wrapper .is-root-container > .m17-hero,
.editor-styles-wrapper .is-root-container > .m17-section { max-width: none; margin-left: 0; margin-right: 0; }
.editor-styles-wrapper .m17-hero { min-height: 70vh; background-attachment: scroll; }
.editor-styles-wrapper .m17-hero__placeholder {
	position: absolute;
	top: 40%; left: 50%;
	transform: translate(-50%, -50%);
}
.editor-styles-wrapper .m17-head__title [data-rich-text-placeholder]::after,
.editor-styles-wrapper .m17-head__intro [data-rich-text-placeholder]::after { opacity: .5; }
.editor-styles-wrapper .m17-section.is-selected,
.editor-styles-wrapper .m17-section.has-child-selected { outline: 1px dashed var(--m17-line); }
