/*
Theme Name: Fancy Art
Description: Responsives Theme für fancy-art.com. Übernimmt den bisherigen Look (dunkelroter Verlauf, schwarze Seitenleiste, FANCY-Logo) und ergänzt eine mobile Navigation. Kompatibel mit NextGEN Gallery.
Author: Julian Fischer
Version: 1.0.0
Requires at least: 5.6
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: fancy-art
*/

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
	--fa-red-top: #7b2316;
	--fa-red-bottom: #4a0300;
	--fa-sidebar: #111;
	--fa-bar-top: #000;
	--fa-bar-bottom: #111;
	--fa-frame: #222;
	--fa-frame-light: #333;
	--fa-text: #fff;
	--fa-nav: #bbb;
	--fa-link: #aaa;
	--fa-legal: #888;
	--fa-legal-hover: #ccc;

	--fa-font: "Helvetica Neue", Helvetica, Arial, sans-serif;

	--fa-bar-h: 40px;          /* Desktop: schwarzer Balken oben */
	--fa-header-h: 60px;       /* Mobil: Kopfzeile mit Logo und Menü */
	--fa-sidebar-w: 240px;
	--fa-content-w: 740px;
	--fa-gap: 20px;
}

/* ==========================================================================
   Grundlagen
   ========================================================================== */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	background: var(--fa-red-bottom);
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--fa-font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--fa-text);
	background: transparent;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Verlauf als feste Ebene – funktioniert auch auf iOS, wo background-attachment: fixed ignoriert wird */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background: linear-gradient(var(--fa-red-top), var(--fa-red-bottom));
}

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

a {
	color: var(--fa-link);
	text-decoration: none;
	transition: color .15s ease;
}

a:hover,
a:active {
	color: #fff;
}

:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

::selection {
	background: #fff;
	color: var(--fa-red-bottom);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed !important;
	top: 8px;
	left: 8px;
	z-index: 1000;
	width: auto;
	height: auto;
	clip: auto;
	clip-path: none;
	padding: 10px 16px;
	background: #fff;
	color: #000;
	font-size: 15px;
}

/* ==========================================================================
   Kopfbalken
   Desktop: schmaler schwarzer Balken wie bisher.
   Mobil: Kopfzeile mit Logo und Menü-Schalter.
   ========================================================================== */

.topbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 50;
	height: var(--fa-bar-h);
	background: linear-gradient(var(--fa-bar-top), var(--fa-bar-bottom));
}

.admin-bar .topbar {
	top: 32px;
}

.topbar__logo,
.menu-toggle {
	display: none;
}

/* ==========================================================================
   Grundraster: Seitenleiste + Inhalt, mittig wie bisher (1000 px)
   ========================================================================== */

.site {
	display: grid;
	grid-template-columns: var(--fa-sidebar-w) minmax(0, var(--fa-content-w));
	column-gap: var(--fa-gap);
	max-width: calc(var(--fa-sidebar-w) + var(--fa-gap) + var(--fa-content-w));
	margin: 0 auto;
	min-height: 100vh;
}

/* ==========================================================================
   Seitenleiste
   ========================================================================== */

.sidebar {
	background: var(--fa-sidebar);
	min-height: 100vh;
}

.sidebar__inner {
	position: sticky;
	top: var(--fa-bar-h);
	display: flex;
	flex-direction: column;
	height: calc(100vh - var(--fa-bar-h));
	padding: 20px 20px 28px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #333 transparent;
}

.admin-bar .sidebar__inner {
	top: calc(var(--fa-bar-h) + 32px);
	height: calc(100vh - var(--fa-bar-h) - 32px);
}

.site-logo {
	display: block;
	width: 200px;
	line-height: 0;
}

.site-logo img {
	display: block;
	width: 100%;
	height: auto;
}

/* Hauptnavigation */

.main-nav {
	margin-top: 23px;
}

.main-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.main-nav a {
	display: block;
	padding: 0 0 0 0;
	font-size: 15px;
	line-height: 27px;
	color: var(--fa-nav);
}

.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
	color: #fff;
}

/* Unterpunkte (Sammlungen) – wie bisher nur sichtbar, wenn man sich in der Galerie befindet */
.main-nav .sub-menu,
.main-nav .children {
	display: none;
	padding-left: 10px;
}

.main-nav .current-menu-item > .sub-menu,
.main-nav .current-menu-parent > .sub-menu,
.main-nav .current-menu-ancestor > .sub-menu,
.main-nav .current_page_item > .children,
.main-nav .current_page_parent > .children,
.main-nav .current_page_ancestor > .children,
.main-nav .is-open > .sub-menu {
	display: block;
}

/* Portrait auf der Startseite */

.portrait {
	margin: 13px 0 0;
	line-height: 0;
}

.portrait img {
	display: block;
	width: 200px;
	max-width: 100%;
	height: auto;
	border: 1px solid var(--fa-frame-light);
}

.portrait--inline {
	display: none;
}

/* Rechtliches unten in der Seitenleiste */

.legal-nav {
	margin-top: auto;
	padding-top: 32px;
}

.legal-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.legal-nav a {
	display: inline-block;
	font-size: 15px;
	line-height: 27px;
	color: var(--fa-legal);
}

.legal-nav a:hover,
.legal-nav .current-menu-item > a {
	color: var(--fa-legal-hover);
}

/* ==========================================================================
   Inhalt
   ========================================================================== */

.content {
	min-width: 0;
	padding: 92px 0 64px;
}

.entry + .entry {
	margin-top: 64px;
}

.entry-content > :first-child {
	margin-top: 0;
}

.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content dl,
.entry-content blockquote,
.entry-content pre,
.entry-content table {
	margin: 0 0 1em;
}

/* Lange Texte (Impressum, Datenschutz) bleiben gut lesbar.
   Absätze mit Bildern oder Galerien behalten die volle Breite. */
.entry-content li,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
	max-width: 68ch;
}

.entry-content p:not(:has(img, .ngg-galleryoverview, iframe, video)) {
	max-width: 68ch;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
	color: #fff;
	font-weight: 700;
	line-height: 1.3;
	margin: 1.8em 0 .6em;
}

.entry-content h1 { font-size: 24px; }
.entry-content h2 { font-size: 20px; }
.entry-content h3 { font-size: 17px; }
.entry-content h4,
.entry-content h5,
.entry-content h6 { font-size: 16px; }

.entry-content a {
	color: #fff;
	text-decoration: underline;
	text-decoration-color: rgba(255, 255, 255, .4);
	text-underline-offset: 3px;
}

.entry-content a:hover {
	text-decoration-color: #fff;
}

/* Bildlinks und Galerie-Links ohne Unterstreichung (getrennte Regeln, damit ältere Browser die zweite nicht verwerfen) */
.entry-content .ngg-galleryoverview a {
	text-decoration: none;
}

.entry-content a:has(> img) {
	text-decoration: none;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.4em;
}

.entry-content ul {
	list-style: square;
}

.entry-content strong,
.entry-content b {
	font-weight: 700;
}

.entry-content blockquote {
	font-style: italic;
	padding: 0 0 0 1.2em;
	border-left: 2px solid rgba(255, 255, 255, .3);
}

.entry-content hr {
	border: 0;
	border-top: 1px solid rgba(255, 255, 255, .2);
	margin: 2em 0;
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
}

.entry-content th,
.entry-content td {
	padding: 6px 10px;
	border-bottom: 1px solid rgba(255, 255, 255, .2);
	text-align: left;
}

/* Bilder: dunkler Rahmen wie bisher */
.entry-content img {
	display: inline-block;
	max-width: 100%;
	height: auto;
	border: 1px solid var(--fa-frame);
	vertical-align: middle;
}

.entry-content img.emoji,
.entry-content img.wp-smiley {
	border: 0;
	height: 1em;
	width: 1em;
}

.alignleft {
	float: left;
	margin: 4px 24px 12px 0;
}

.alignright {
	float: right;
	margin: 4px 0 12px 24px;
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.wp-caption {
	max-width: 100%;
}

.wp-caption-text,
.entry-content figcaption {
	font-size: 13px;
	color: #ccc;
	margin-top: 6px;
}

.entry-content::after {
	content: "";
	display: table;
	clear: both;
}

/* Bearbeiten-Link (nur für angemeldete Nutzer) */
.edit-link {
	display: block;
	margin-top: 12px;
	font-size: 13px;
}

.edit-link a {
	color: var(--fa-link);
	text-decoration: none;
}

.page-links {
	margin-top: 24px;
	font-size: 14px;
}

.posts-navigation {
	display: flex;
	justify-content: space-between;
	margin-top: 48px;
	font-size: 14px;
}

.not-found h1 {
	font-size: 24px;
	margin: 0 0 .5em;
}

/* ==========================================================================
   NextGEN Gallery (Standard-Ansicht „Thumbnails“)
   ========================================================================== */

.entry-content .ngg-galleryoverview.default-view {
	display: flex !important;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 28px 0 0;
	min-height: 0;
	overflow: visible;
	font-size: inherit !important;
}

.entry-content .ngg-galleryoverview.default-view .ngg-gallery-thumbnail-box {
	display: block;
	float: none;
	width: auto;
	margin: 0;
}

.entry-content .ngg-galleryoverview.default-view .ngg-gallery-thumbnail {
	margin: 0;
	background: none;
	border: 0;
}

.entry-content .ngg-galleryoverview.default-view .ngg-gallery-thumbnail a {
	display: block;
	margin: 0;
}

.entry-content .ngg-galleryoverview.default-view .ngg-gallery-thumbnail img {
	display: block;
	margin: 0;
	border: 1px solid var(--fa-frame);
	transition: opacity .15s ease, border-color .15s ease;
}

.entry-content .ngg-galleryoverview.default-view .ngg-gallery-thumbnail a:hover img,
.entry-content .ngg-galleryoverview.default-view .ngg-gallery-thumbnail a:focus-visible img {
	opacity: 1;
	border-color: #fff;
}

.entry-content .ngg-galleryoverview .ngg-clear {
	display: none;
}

/* Leere Absätze, die der klassische Editor um Galerien herum erzeugt */
.entry-content p:empty {
	display: none;
}

/* ==========================================================================
   Fußzeile (nur mobil sichtbar – auf dem Desktop steht das Rechtliche in der Seitenleiste)
   ========================================================================== */

.site-footer {
	display: none;
}

/* ==========================================================================
   Mobil und Tablet (unter 960 px)
   ========================================================================== */

@media (max-width: 959px) {

	.topbar {
		position: sticky;
		height: var(--fa-header-h);
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 8px 0 16px;
	}

	.admin-bar .topbar {
		top: 32px;
	}

	.topbar__logo {
		display: block;
		width: 80px;
		line-height: 0;
	}

	.topbar__logo img {
		display: block;
		width: 100%;
		height: auto;
	}

	.menu-toggle {
		display: inline-flex;
		align-items: center;
		gap: 10px;
		min-height: 44px;
		padding: 0 12px;
		border: 0;
		background: none;
		color: var(--fa-nav);
		font: inherit;
		font-size: 15px;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}

	.menu-toggle:hover {
		color: #fff;
	}

	.menu-toggle__icon {
		position: relative;
		display: block;
		width: 20px;
		height: 14px;
	}

	.menu-toggle__icon::before,
	.menu-toggle__icon::after,
	.menu-toggle__icon span {
		content: "";
		position: absolute;
		left: 0;
		width: 100%;
		height: 2px;
		background: currentColor;
		transition: transform .2s ease, opacity .2s ease, top .2s ease;
	}

	.menu-toggle__icon::before { top: 0; }
	.menu-toggle__icon span    { top: 6px; }
	.menu-toggle__icon::after  { top: 12px; }

	.nav-open .menu-toggle__icon::before {
		top: 6px;
		transform: rotate(45deg);
	}

	.nav-open .menu-toggle__icon span {
		opacity: 0;
	}

	.nav-open .menu-toggle__icon::after {
		top: 6px;
		transform: rotate(-45deg);
	}

	.site {
		display: block;
		max-width: none;
		min-height: 0;
	}

	/* Seitenleiste wird zum ausklappbaren Menü */
	.sidebar {
		position: fixed;
		top: var(--fa-drawer-top, var(--fa-header-h));
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 40;
		min-height: 0;
		visibility: hidden;
		opacity: 0;
		transform: translateY(-12px);
		transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
	}

	.nav-open .sidebar {
		visibility: visible;
		opacity: 1;
		transform: none;
		transition: opacity .2s ease, transform .2s ease, visibility 0s;
	}

	.nav-open,
	.nav-open body {
		overflow: hidden;
	}

	.sidebar__inner {
		position: static;
		height: 100%;
		padding: 16px 24px 32px;
	}

	.sidebar .site-logo,
	.sidebar .portrait {
		display: none;
	}

	.main-nav {
		margin-top: 0;
	}

	.main-nav a {
		font-size: 21px;
		line-height: 1.25;
		padding: 10px 0;
	}

	/* Im Menü sind alle Sammlungen direkt erreichbar */
	.main-nav .sub-menu,
	.main-nav .children {
		display: block;
		padding-left: 14px;
		margin-bottom: 6px;
	}

	.main-nav .sub-menu a,
	.main-nav .children a {
		font-size: 17px;
		padding: 7px 0;
	}

	.legal-nav a {
		font-size: 15px;
		line-height: 1.4;
		padding: 6px 0;
	}

	.content {
		padding: 24px 16px 0;
	}

	.entry-content img {
		width: 100%;
	}

	.entry-content .ngg-galleryoverview.default-view .ngg-gallery-thumbnail img,
	.entry-content img.emoji,
	.entry-content img.wp-smiley {
		width: auto;
	}

	.entry-content .ngg-galleryoverview.default-view {
		gap: 5px;
		margin-top: 20px;
	}

	.portrait--inline {
		display: block;
		margin: 32px 0 0;
	}

	.site-footer {
		display: block;
		margin-top: 48px;
		padding: 20px 0 32px;
		border-top: 1px solid rgba(255, 255, 255, .15);
	}

	.site-footer ul {
		display: flex;
		flex-wrap: wrap;
		gap: 4px 24px;
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.site-footer a {
		display: inline-block;
		padding: 6px 0;
		font-size: 14px;
		color: rgba(255, 255, 255, .65);
	}

	.site-footer a:hover {
		color: #fff;
	}
}

@media (max-width: 782px) {
	.admin-bar .topbar {
		top: 46px;
	}
}

@media (max-width: 600px) {
	/* WordPress löst die Admin-Leiste hier vom oberen Rand */
	.admin-bar .topbar {
		top: 0;
	}
}

/* ==========================================================================
   Bewegung reduzieren
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0s !important;
		transition-delay: 0s !important;
	}
}

/* ==========================================================================
   Druck
   ========================================================================== */

@media print {
	body::before,
	.topbar,
	.sidebar,
	.site-footer,
	.edit-link {
		display: none !important;
	}

	body {
		color: #000;
		background: #fff;
	}

	.site {
		display: block;
	}

	.content {
		padding: 0;
	}

	.entry-content a {
		color: #000;
	}
}
