/* Polsterei Winkelwerkstatt – Josepha Rathke
   Statische Neuumsetzung des Origin-Layouts (ohne WordPress) */

@font-face { font-family: "Ubuntu"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ubuntu-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ubuntu-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/ubuntu-latin-700-normal.woff2") format("woff2"); }

:root {
  --teal: #009cb5;
  --teal-dark: #004a51;
  --teal-line: #0089a0;
  --link: #007a8e;
  --text: #464646;
  --strong: #1c1c1c;
  --bg: #fff;
  --overlay: rgba(255, 150, 0, .94);
  --sidebar-w: 280px;
  --font: "Ubuntu", "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.65; color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--teal-dark); }
strong { color: var(--strong); font-weight: 700; }
:focus-visible { outline: 3px solid #ffb84d; outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: #fff; color: var(--teal-dark); padding: .6em 1em; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }
/* nur fuer Screenreader/Suchmaschinen, nicht sichtbar */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Seitenleiste ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--teal); color: #fff;
  box-shadow: inset 0 0 73px rgba(0,0,0,.15), 4px 0 4px rgba(0,0,0,.08);
  border-right: 1px solid var(--teal-line);
  display: flex; flex-direction: column; overflow-y: auto; z-index: 20;
}
.sidebar-head { padding: 56px 20px 36px; text-align: center; }
.logo { display: inline-block; border-radius: 50%; }
.logo img { width: 180px; height: 180px; margin: 0 auto; border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.site-desc { margin: 14px 0 0; font-size: 14px; letter-spacing: .02em; opacity: .9; }

.menu-toggle { display: none; }

.main-nav ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--teal-line); }
.main-nav li { border-bottom: 1px solid var(--teal-line); }
.main-nav a {
  display: block; padding: 13px 34px; color: #fff; text-decoration: none;
  font-size: 17px; position: relative; overflow: hidden;
}
.main-nav a::before {
  content: ""; position: absolute; inset: 0; background: var(--teal-dark);
  transform: scaleX(0); transform-origin: left; transition: transform .15s ease-in-out; z-index: -1;
}
.main-nav a { z-index: 0; }
.main-nav a:hover::before, .main-nav a:focus-visible::before, .main-nav a[aria-current="page"]::before { transform: scaleX(1); }
.main-nav a:hover { color: #fff; }

.sidebar-foot { margin-top: auto; padding: 28px 34px 30px; font-size: 13px; line-height: 1.6; opacity: .92; }
.sidebar-foot a { color: #fff; }
.sidebar-foot p { margin: 0 0 .4em; }

/* ---------- Inhalt ---------- */
.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.content { max-width: 720px; padding: 64px 60px 80px; }
.content h1, .content h2, .content h3 { color: var(--teal); font-weight: 500; line-height: 1.25; letter-spacing: -.01em; }
.content h1 { font-size: 34px; margin: 0 0 .7em; }
.content h2 { font-size: 23px; margin: 1.8em 0 .5em; }
.content h3 { font-size: 19px; margin: 1.5em 0 .4em; }
.content p { margin: 0 0 1em; }
.content ul { padding-left: 1.3em; }
.lead { font-size: 20px; color: var(--teal); }
.meta { margin: -1.1em 0 1.8em; font-size: 14px; color: #6b7b7e; }

.cv { list-style: none; padding: 0 !important; margin: 1.5em 0; border-left: 3px solid var(--teal); }
.cv li { padding: .3em 0 .3em 1.1em; display: grid; grid-template-columns: 8.5em 1fr; column-gap: .4em; }
.cv b { color: var(--teal-dark); font-weight: 500; }

.callout { background: #eef8fa; border-left: 4px solid var(--teal); padding: 18px 22px; margin: 1.6em 0; border-radius: 0 4px 4px 0; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Beitrag ---------- */
.post-figure { margin: 0 0 18px; }
.post-figure a { display: block; cursor: zoom-in; }
.post-figure img { width: auto; max-width: 100%; max-height: 80vh; }
.content.post { max-width: 980px; }
.post-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 40px; padding-top: 20px; border-top: 1px solid #e3e3e3; font-size: 15px; }
.post-nav a { text-decoration: none; }
.post-nav a:hover { text-decoration: underline; }
.post-nav .next { text-align: right; margin-left: auto; }
.post-nav span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #8a9a9d; }

/* ---------- Galerie-Raster („Neu“) ---------- */
.grid-intro { padding: 40px 40px 24px; }
.grid-intro h1 { margin: 0; color: var(--teal); font-weight: 500; font-size: 34px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.tile { position: relative; aspect-ratio: 4 / 3; overflow: hidden; margin: 0; background: #ddd; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tile a { position: absolute; inset: 0; color: #fff; text-decoration: none; }
.tile .info {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; text-align: center; background: var(--overlay);
  box-shadow: inset 0 0 0 1px rgba(255,182,78,1), 0 0 20px rgba(0,0,0,.6);
  text-shadow: 1px 1px 0 rgba(0,0,0,.1);
  opacity: 0; transform: scale(.6); transition: opacity .2s ease, transform .25s ease;
}
.tile .info h2 { margin: 0 0 6px; font-size: 21px; line-height: 1.25; font-weight: 500; color: #fff; }
.tile .info time { font-size: 13px; opacity: .9; }
.tile .info .zoom { margin-top: 14px; width: 42px; height: 42px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 0 4px rgba(0,0,0,.1); }
.tile .info .zoom svg { width: 20px; height: 20px; stroke: #ff9600; }
.tile a:hover .info, .tile a:focus-visible .info { opacity: 1; transform: scale(1); }
.tile a:hover img { transform: scale(1.04); }
@media (hover: none) {
  .tile .info { opacity: 1; transform: none; inset: auto 0 0 0; background: linear-gradient(transparent, rgba(0,0,0,.65)); box-shadow: none; padding: 40px 14px 12px; align-items: flex-start; text-align: left; }
  .tile .info h2 { font-size: 17px; }
  .tile .info .zoom { display: none; }
}

/* ---------- Formular ---------- */
.form { margin-top: 1.2em; }
.form h2 { margin-top: 0; }
.field { margin: 0 0 16px; }
.field label { display: block; font-size: 14px; font-weight: 500; color: var(--teal-dark); margin-bottom: 5px; }
.field input[type=text], .field input[type=email], .field textarea {
  width: 100%; font: inherit; color: var(--text); padding: 12px 14px;
  background: #eef3f4; border: 1px solid #d3e0e2; border-radius: 3px;
}
.field textarea { min-height: 170px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(0,156,181,.18); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--teal); flex: none; }
.btn {
  display: inline-block; font: inherit; font-weight: 500; font-size: 16px; cursor: pointer;
  background: var(--teal); color: #fff; border: 0; border-radius: 3px; padding: 12px 26px; text-decoration: none;
}
.btn:hover { background: var(--teal-dark); color: #fff; }
.form-note { font-size: 13px; color: #6b7b7e; margin-top: 12px; }
.form-msg { margin-top: 14px; font-weight: 500; color: var(--teal-dark); }
.form-msg[hidden] { display: none; }

.contact-card { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0 0 2em; padding: 20px 24px; background: #eef8fa; border-radius: 4px; }
.contact-card dt { color: var(--teal-dark); font-weight: 500; }
.contact-card dd { margin: 0; }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; margin: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: rgba(10, 20, 22, .94); color: #fff; }
.lightbox::backdrop { background: rgba(0,0,0,.6); }
.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 70px 24px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lightbox figcaption { margin-top: 12px; font-size: 14px; opacity: .85; }
.lb-btn { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 26px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.lb-btn:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-btn[hidden] { display: none; }

/* ---------- Responsiv ---------- */
@media (max-width: 1279px) { .grid { grid-template-columns: repeat(3, 1fr); } }

@media (max-width: 1023px) {
  .sidebar { position: sticky; top: 0; inset: auto; width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; overflow: visible; box-shadow: 0 4px 4px rgba(0,0,0,.08); border-right: 0; }
  .sidebar-head { padding: 10px 16px; display: flex; align-items: center; gap: 14px; text-align: left; flex: 1; }
  .logo img { width: 64px; height: 64px; }
  .site-desc { margin: 0; font-size: 15px; }
  .site-desc b { display: block; font-weight: 500; font-size: 17px; }
  .menu-toggle { display: grid; place-items: center; margin-right: 16px; width: 46px; height: 46px; background: transparent; border: 1px solid rgba(255,255,255,.5); border-radius: 4px; color: #fff; cursor: pointer; }
  .menu-toggle svg { width: 24px; height: 24px; }
  .main-nav { width: 100%; display: none; }
  .main-nav.open { display: block; }
  .main-nav a { padding: 12px 20px; }
  .sidebar-foot { display: none; }
  .main { margin-left: 0; }
  .content { padding: 36px 24px 60px; margin: 0 auto; }
  .grid-intro { padding: 28px 16px 18px; }
}
@media (min-width: 1024px) { .site-desc b { display: block; font-weight: 500; font-size: 17px; margin-bottom: 2px; } }

@media (max-width: 767px) { .grid { grid-template-columns: repeat(2, 1fr); } .content h1, .grid-intro h1 { font-size: 28px; } }
@media (max-width: 479px) { .grid { grid-template-columns: 1fr; } }
@media (max-width: 479px) {
  .content { padding: 28px 16px 48px; }
  .site-desc { font-size: 13px; }
  .lightbox figure { padding: 60px 8px 20px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; }
  .contact-card { grid-template-columns: 1fr; gap: 0; }
  .contact-card dd { margin-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .sidebar, .post-nav, .form { display: none; } .main { margin: 0; } }

/* ---------- Kopfbild (wie #big_thumbnail im Origin-Theme) ---------- */
.big-thumbnail { height: 320px; background: #ddd url("../img/werkstatt-2000x913.jpg") center / cover no-repeat; }
@media (min-width: 768px) and (max-width: 960px) { .big-thumbnail { height: 276px; } }
@media (max-width: 767px) { .big-thumbnail { height: 180px; background-image: url("../img/werkstatt-1000x457.jpg"); } }
@media (max-width: 479px) { .big-thumbnail { height: 137px; } }
/* Ueberschrift im weissen Kasten, ragt unten ins Kopfbild (wie .main-title im Origin-Theme) */
.big-thumbnail + .content > h1:first-child {
  position: relative; width: fit-content; background: var(--bg);
  margin: -180px 0 50px -60px; padding: 43px 60px 25px;
  font-size: 48px; font-weight: 700; line-height: 1; letter-spacing: -.03em;
}
@media (max-width: 767px) {
  .big-thumbnail + .content > h1:first-child { width: auto; margin: 0 0 .7em; padding: 0; font-size: 32px; letter-spacing: -.01em; line-height: 1.25; }
}
@media (max-width: 479px) { .big-thumbnail + .content > h1:first-child { font-size: 26px; } }
@media print { .big-thumbnail { display: none; } .big-thumbnail + .content > h1:first-child { margin: 0 0 .7em; padding: 0; } }

/* ---------- 404: antike Naehmaschine sucht mit der Lupe ----------
   Die Buehne fuellt den Platz unter dem Text bis zum Fensterrand; waagerecht
   faehrt die Maschine von Rand zu Rand, senkrecht pendelt sie schneller von
   oben nach unten - zusammen ergibt das Schlangenlinien. */
.error404 .main { display: flex; flex-direction: column; }
.search-stage {
  --w: 298px; --h: 142px; position: relative; flex: 1 1 auto; min-height: 340px; margin: 0 40px 40px; overflow: hidden;
  /* Steppnaht als Boden */
  background: repeating-linear-gradient(90deg, var(--teal) 0 14px, transparent 14px 24px) left bottom / 100% 2px no-repeat;
}
.search-stage .walker { position: absolute; left: 0; top: 0; width: var(--w); animation: nm-quer 24s linear infinite, nm-schlange 3s ease-in-out infinite alternate; }
.search-stage .flip { animation: nm-flip 24s linear infinite; }
.search-stage .hop { animation: nm-hop .45s ease-in-out infinite alternate; }
.naehmaschine { display: block; width: 100%; height: auto; overflow: visible; }
.nm-wheel { transform-box: fill-box; transform-origin: center; animation: nm-spin 1.8s linear infinite; }
.nm-lupe { transform-origin: 176px 94px; animation: nm-sway 1.7s ease-in-out infinite alternate; }
.nm-pupil { animation: nm-look 3.7s ease-in-out infinite; }
/* Buchstabensalat: jeder Buchstabe treibt eigen schnell durchs Glas */
.nm-b { font: 700 12px var(--font); text-anchor: middle; fill: #1c1c1c; }
.nm-b2, .nm-b6, .nm-b10, .nm-b13, .nm-b16, .nm-b19, .nm-b24 { fill: var(--teal); font-size: 15px; }
.nm-b4, .nm-b7, .nm-b12, .nm-b18, .nm-b22 { fill: #c0392b; }
.nm-b9, .nm-b14, .nm-b17, .nm-b21 { fill: #7a5230; font-size: 10px; }
.nm-b1 { animation: nm-drift-r 3.1s linear infinite; }
.nm-b2 { animation: nm-drift-l 4.3s linear infinite -1.2s; }
.nm-b3 { animation: nm-drift-r 2.6s linear infinite -.8s; }
.nm-b4 { animation: nm-drift-l 3.7s linear infinite -2.5s; }
.nm-b5 { animation: nm-drift-u 3.3s linear infinite -.4s; }
.nm-b6 { animation: nm-drift-r 4.9s linear infinite -3.1s; }
.nm-b7 { animation: nm-drift-d 2.9s linear infinite -1.7s; }
.nm-b8 { animation: nm-drift-l 2.4s linear infinite -.3s; }
.nm-b9 { animation: nm-drift-d 3.6s linear infinite -2.2s; }
.nm-b10 { animation: nm-drift-r 3.4s linear infinite -2.9s; }
.nm-b11 { animation: nm-drift-u 2.7s linear infinite -1.5s; }
.nm-b12 { animation: nm-drift-l 3.9s linear infinite -.9s; }
.nm-b13 { animation: nm-drift-u 4.1s linear infinite -3.4s; }
.nm-b14 { animation: nm-drift-r 2.8s linear infinite -1.9s; }
.nm-b15 { animation: nm-drift-l 3.2s linear infinite -2.6s; }
.nm-b16 { animation: nm-drift-d 4.4s linear infinite -.6s; }
.nm-b17 { animation: nm-drift-r 3.8s linear infinite -1.1s; }
.nm-b18 { animation: nm-drift-u 3.0s linear infinite -2.3s; }
.nm-b19 { animation: nm-drift-l 4.6s linear infinite -3.8s; }
.nm-b20 { animation: nm-drift-r 2.5s linear infinite -2.1s; }
.nm-b21 { animation: nm-drift-d 3.3s linear infinite -2.8s; }
.nm-b22 { animation: nm-drift-u 3.9s linear infinite -1.3s; }
.nm-b23 { animation: nm-drift-l 2.9s linear infinite -2.0s; }
.nm-b24 { animation: nm-drift-r 4.2s linear infinite -.2s; }

@keyframes nm-quer { 0%, 100% { left: 0; } 50% { left: calc(100% - var(--w)); } }
@keyframes nm-schlange { from { top: 0; } to { top: calc(100% - var(--h)); } }
@keyframes nm-flip { 0%, 48% { transform: scaleX(1); } 52%, 96% { transform: scaleX(-1); } 100% { transform: scaleX(1); } }
@keyframes nm-hop { from { transform: translateY(0); } to { transform: translateY(-4px) rotate(-1.5deg); } }
@keyframes nm-spin { to { transform: rotate(360deg); } }
@keyframes nm-drift-r { from { transform: translate(-30px, 0) rotate(-20deg); } 50% { transform: translate(0, 3px) rotate(10deg); } to { transform: translate(30px, 0) rotate(30deg); } }
@keyframes nm-drift-l { from { transform: translate(30px, 2px) rotate(15deg); } 50% { transform: translate(0, -3px) rotate(-10deg); } to { transform: translate(-30px, 1px) rotate(-35deg); } }
@keyframes nm-drift-u { from { transform: translate(-8px, 30px) rotate(0); } to { transform: translate(10px, -30px) rotate(90deg); } }
@keyframes nm-drift-d { from { transform: translate(9px, -30px) rotate(0); } to { transform: translate(-7px, 30px) rotate(-80deg); } }
@keyframes nm-sway { from { transform: rotate(-5deg); } to { transform: rotate(6deg); } }
@keyframes nm-look { 0%, 40% { transform: translate(0, 0); } 50%, 70% { transform: translate(-1px, 2.5px); } 80%, 100% { transform: translate(0, 0); } }

@media (max-width: 1023px) { .search-stage { min-height: 300px; margin: 0 16px 24px; } }
@media (max-width: 479px) { .search-stage { --w: 228px; --h: 109px; min-height: 260px; } }
@media (prefers-reduced-motion: reduce) {
  .search-stage *, .naehmaschine * { animation: none !important; }
  .search-stage .walker { left: calc(50% - var(--w) / 2); top: calc(50% - var(--h) / 2); }
}
@media print { .search-stage { display: none; } }
