/*
Theme Name: Spinagel Polaroid
Theme URI: https://www.bkowebdesign.de
Author: BKO Webdesign
Description: Ein minimalistisches Fotoblog-Theme mit einer Startseite aus stilisierten Polaroid-Karten, seitlicher Navigation und einem separaten Menü für Pflichtangaben.
Version: 1.7.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: spinagel-polaroid
*/

:root {
  --sp-paper: #fbfaf7;
  --sp-ink: #1f211e;
  --sp-muted: #76766f;
  --sp-line: #dddcd5;
  --sp-card: #fffefa;
  --sp-accent: #415745;
  --sp-serif: Georgia, "Times New Roman", serif;
  --sp-sans: Arial, Helvetica, sans-serif;
  --sp-side-width: 13rem;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sp-paper);
  color: var(--sp-ink);
  font-family: var(--sp-serif);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--sp-accent); }
img { display: block; max-width: 100%; height: auto; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  z-index: 100000; top: .5rem; left: .5rem; width: auto; height: auto;
  padding: .7rem 1rem; clip: auto; background: #fff; color: #000;
}

.site-shell { min-height: 100vh; padding-right: var(--sp-side-width); }
.site-header { padding: clamp(3rem, 8vw, 7rem) 2rem clamp(2.5rem, 6vw, 5rem); text-align: center; }
.site-branding { display: inline-flex; flex-direction: column; align-items: center; text-decoration: none; }
.site-title {
  margin: 0; font-size: clamp(1.2rem, 2.1vw, 1.8rem); font-weight: 400;
  line-height: 1.15; letter-spacing: .46em; text-transform: uppercase;
}
.site-description {
  margin: .65rem 0 0; color: var(--sp-muted); font-family: var(--sp-sans);
  font-size: .65rem; letter-spacing: .5em; line-height: 1.5; text-transform: uppercase;
}
.custom-logo { width: auto; max-height: 84px; margin: 0 auto 1rem; }

.menu-toggle { display: none; }
.side-navigation {
  position: fixed; z-index: 30; inset: 0 0 0 auto; width: var(--sp-side-width);
  display: flex; align-items: flex-start; padding: clamp(5rem, 16vh, 10rem) 1.4rem 2rem;
  border-left: 1px solid rgba(31, 33, 30, .08); background: rgba(251, 250, 247, .94);
  backdrop-filter: blur(10px); overflow-x: hidden; overflow-y: auto;
}
.side-navigation ul { width: 100%; margin: 0; padding: 0; list-style: none; }
.side-navigation li { position: relative; }
.side-navigation a {
  display: block; padding: .5rem .3rem; font-family: var(--sp-sans); font-size: .68rem;
  letter-spacing: .24em; text-decoration: none; text-transform: uppercase;
}
.side-navigation > div > ul > li { border-bottom: 1px solid transparent; }
.side-navigation .menu-item-has-children > a { padding-right: 1.75rem; }
.submenu-toggle {
  position: absolute; z-index: 2; top: .32rem; right: 0; width: 1.8rem; height: 1.8rem;
  padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer;
}
.submenu-toggle::before, .submenu-toggle::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: .6rem; height: 1px;
  background: currentColor; transform: translate(-50%, -50%);
}
.submenu-toggle::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .2s ease; }
.submenu-toggle[aria-expanded="true"]::after { transform: translate(-50%, -50%) rotate(0); }
.side-navigation .sub-menu {
  display: none; overflow: visible; padding-left: .8rem;
}
.side-navigation .sub-menu.is-open { display: block; padding-bottom: .4rem; }
.side-navigation .sub-menu a { color: var(--sp-muted); font-size: .61rem; letter-spacing: .16em; }
.side-navigation .sub-menu .sub-menu {
  margin-left: .2rem; padding-left: .65rem; border-left: 1px solid rgba(65, 87, 69, .2);
}
.side-navigation .sub-menu .sub-menu a { color: #8a8982; font-size: .57rem; }

/* Beim Berühren der Navigation werden bewusst alle Unterebenen gleichzeitig sichtbar. */
@media (hover: hover) and (pointer: fine) {
  .side-navigation:hover .sub-menu { display: block; }
  .side-navigation:hover .submenu-toggle::after {
    transform: translate(-50%, -50%) rotate(0);
  }
}

.site-main { width: min(1080px, calc(100% - 3rem)); margin: 0 auto; }
.polaroid-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(3.4rem, 6vw, 6.5rem) clamp(2rem, 5vw, 4.5rem); align-items: start;
}
.polaroid-card { position: relative; }
.polaroid-card:nth-child(6n+1) { transform: rotate(-1.25deg); }
.polaroid-card:nth-child(6n+2) { transform: rotate(.8deg) translateY(1rem); }
.polaroid-card:nth-child(6n+3) { transform: rotate(-.35deg) translateY(-.4rem); }
.polaroid-card:nth-child(6n+4) { transform: rotate(.65deg); }
.polaroid-card:nth-child(6n+5) { transform: rotate(-.8deg) translateY(1.1rem); }
.polaroid-card:nth-child(6n+6) { transform: rotate(.35deg) translateY(-.5rem); }
.polaroid-card::before, .polaroid-card::after {
  content: ""; position: absolute; inset: 5px -5px -5px 5px; z-index: -1;
  border: 1px solid #e5e3dc; background: #f5f4ef; box-shadow: 0 5px 11px rgba(31, 33, 30, .09);
  transform: rotate(2.2deg);
}
.polaroid-card::after { inset: -3px 4px 4px -3px; transform: rotate(-1.7deg); }
.polaroid-link {
  display: block; padding: clamp(.65rem, 1.3vw, .9rem) clamp(.65rem, 1.3vw, .9rem) 1.05rem;
  border: 1px solid #e4e2dc; background: var(--sp-card); box-shadow: 0 10px 21px rgba(31, 33, 30, .12);
  text-decoration: none; transition: transform .25s ease, box-shadow .25s ease;
}
.polaroid-link:hover, .polaroid-link:focus-visible {
  color: inherit; transform: translateY(-6px) rotate(.3deg); box-shadow: 0 16px 28px rgba(31, 33, 30, .16);
}
.polaroid-image { aspect-ratio: 4 / 3; overflow: hidden; background: #e8e6de; }
.polaroid-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.polaroid-link:hover img { transform: scale(1.035); }
.polaroid-placeholder {
  width: 100%; height: 100%; background:
    linear-gradient(140deg, rgba(255,255,255,.18), transparent 40%),
    linear-gradient(25deg, #667566, #b5b9a7 52%, #dbd2bb);
}
.polaroid-copy { min-height: 6.6rem; padding: 1rem .15rem .2rem; }
.polaroid-title {
  margin: 0; font-size: clamp(.84rem, 1.2vw, 1rem); font-weight: 400;
  letter-spacing: .14em; line-height: 1.35; text-transform: uppercase;
}
.polaroid-date {
  display: block; margin-top: .6rem; color: var(--sp-muted); font-family: var(--sp-sans);
  font-size: .6rem; letter-spacing: .22em; text-transform: uppercase;
}

.pagination { margin: 6rem auto 1rem; text-align: center; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.pagination a, .pagination .current {
  min-width: 2.1rem; padding: .32rem .65rem; border: 1px solid var(--sp-line);
  font-family: var(--sp-sans); font-size: .7rem; text-decoration: none;
}
.pagination .current { background: var(--sp-ink); color: #fff; }
.empty-state { max-width: 40rem; margin: 0 auto 8rem; text-align: center; }
.search-hero, .error-404 {
  max-width: 700px; margin: 0 auto clamp(4rem, 9vw, 7rem); text-align: center;
}
.search-hero .entry-title, .error-404 .entry-title { margin-bottom: 1rem; }
.search-intro, .error-message { margin: 0 auto 1.8rem; max-width: 34rem; color: var(--sp-muted); }
.search-form { display: flex; width: min(100%, 560px); margin: 1.7rem auto 0; }
.search-form label { flex: 1; }
.search-field {
  width: 100%; height: 3.2rem; padding: 0 1rem; border: 1px solid var(--sp-line);
  border-right: 0; border-radius: 3px 0 0 3px; background: #fffefa; color: var(--sp-ink);
  font: inherit; outline: none;
}
.search-field:focus { border-color: var(--sp-accent); box-shadow: inset 0 0 0 1px var(--sp-accent); }
.search-submit, .home-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3.2rem;
  padding: 0 1.3rem; border: 1px solid var(--sp-ink); border-radius: 0 3px 3px 0;
  background: var(--sp-ink); color: #fff; font-family: var(--sp-sans); font-size: .68rem;
  letter-spacing: .12em; text-decoration: none; text-transform: uppercase; cursor: pointer;
}
.search-submit:hover, .search-submit:focus-visible, .home-link:hover, .home-link:focus-visible {
  background: var(--sp-accent); border-color: var(--sp-accent); color: #fff;
}
.error-code {
  display: block; margin-bottom: .4rem; color: #d9ddd5; font-family: var(--sp-sans);
  font-size: clamp(5rem, 18vw, 11rem); font-weight: 700; letter-spacing: -.08em; line-height: .8;
}
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem; }
.error-actions .search-form { margin: 0; }
.home-link { border-radius: 3px; }

.content-page { max-width: 760px; padding-bottom: 4rem; }
.entry-header { margin-bottom: 2.5rem; text-align: center; }
.entry-title { margin: 0; font-weight: 400; font-size: clamp(2rem, 5vw, 3.8rem); line-height: 1.1; }
.single .content-page { max-width: 1160px; }
.single .entry-header { max-width: 820px; margin: 0 auto clamp(2.5rem, 6vw, 4.5rem); }
.single .entry-title { letter-spacing: -.025em; text-wrap: balance; }
.single .entry-header::after {
  content: ""; display: block; width: 3.2rem; height: 2px; margin: 1.5rem auto 0;
  background: var(--sp-accent); opacity: .55;
}
.entry-layout.has-post-info {
  display: grid; grid-template-columns: minmax(0, 780px) minmax(220px, 270px);
  justify-content: center; align-items: start; gap: clamp(2rem, 5vw, 4.5rem);
}
.single .entry-primary {
  min-width: 0; overflow: hidden; border: 1px solid rgba(31, 33, 30, .08);
  border-radius: 5px; background: rgba(255, 254, 250, .82);
  box-shadow: 0 18px 50px rgba(31, 33, 30, .07);
}
.post-start-block {
  display: flex; flex-wrap: wrap; gap: .8rem clamp(2rem, 6vw, 5rem);
  margin: 0; padding: 1.2rem clamp(1.4rem, 4vw, 3.2rem);
  border-top: 1px solid rgba(65, 87, 69, .28);
  border-bottom: 1px solid rgba(65, 87, 69, .28);
  background: rgba(224, 234, 224, .72); color: #354739;
  font-family: var(--sp-sans); font-size: .78rem; letter-spacing: .06em;
}
.post-start-block p { margin: 0; }
.post-start-label { margin-right: .35rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.post-info-box {
  position: sticky; top: 2rem; margin: .2rem 0 0; padding: 1.5rem; max-width: 100%;
  border: 1px solid rgba(65, 87, 69, .16); border-radius: 5px;
  background: #e5ede4; color: #354739; font-family: var(--sp-serif);
  font-size: .94rem; line-height: 1.7; box-shadow: 0 12px 32px rgba(65, 87, 69, .07);
}
.post-info-box > :first-child { margin-top: 0; }
.post-info-box > :last-child { margin-bottom: 0; }
.entry-thumbnail { margin: 0 auto 3rem; }
.single .entry-thumbnail { margin: 0; background: #f0eee8; }
.single .entry-thumbnail img { width: 100%; height: auto; }
.entry-thumbnail.has-start-block-after { margin-bottom: 0; }
.single .entry-content { padding: clamp(1.8rem, 5vw, 3.8rem); font-size: clamp(1rem, 1.25vw, 1.1rem); line-height: 1.82; }
.entry-content > * { max-width: 100%; }
.entry-content > :first-child { margin-top: 0; }
.entry-content > :last-child { margin-bottom: 0; }
.entry-content p { margin: 0 0 1.45em; }
.entry-content h2, .entry-content h3, .entry-content h4 {
  margin: 2.2em 0 .75em; font-weight: 400; line-height: 1.22; letter-spacing: -.015em;
}
.entry-content h2 { font-size: clamp(1.65rem, 3vw, 2.25rem); }
.entry-content h3 { font-size: clamp(1.3rem, 2vw, 1.65rem); }
.entry-content ul, .entry-content ol { margin: 1.4rem 0 1.8rem; padding-left: 1.35rem; }
.entry-content li { margin-bottom: .48rem; padding-left: .25rem; }
.entry-content a { color: var(--sp-accent); text-decoration-color: rgba(65, 87, 69, .38); }
.entry-content a:hover { text-decoration-color: currentColor; }
.entry-content blockquote {
  position: relative; margin: 2.5rem 0; padding: 1.4rem 1.6rem 1.4rem 2rem;
  border: 0; border-left: 3px solid var(--sp-accent); border-radius: 0 4px 4px 0;
  background: rgba(232, 238, 231, .58); color: #354739; font-size: 1.18rem; font-style: italic;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content figure { margin: 2.4rem 0; }
.entry-content figure img, .entry-content .wp-caption img {
  width: auto; border-radius: 4px; box-shadow: 0 12px 32px rgba(31, 33, 30, .1);
}
.entry-thumbnail figcaption,
.entry-content figcaption,
.entry-content .wp-caption-text,
.entry-content .wp-element-caption,
.entry-content .gallery-caption {
  margin: 0; padding: .75rem 1rem .1rem; color: #777970;
  font-family: var(--sp-sans); font-size: .68rem; font-style: normal;
  letter-spacing: .07em; line-height: 1.55; text-align: center;
}
.entry-thumbnail figcaption { padding: .8rem 1.2rem; border-bottom: 1px solid rgba(31, 33, 30, .07); background: #f5f3ee; }
.entry-content .wp-caption { max-width: 100%; margin: 2.4rem auto; }
.entry-content .gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.entry-content .gallery-item { width: 100% !important; margin: 0; }
.entry-content table { width: 100%; margin: 2rem 0; border-collapse: collapse; font-family: var(--sp-sans); font-size: .9rem; }
.entry-content th, .entry-content td { padding: .75rem .85rem; border-bottom: 1px solid var(--sp-line); text-align: left; }
.entry-content th { background: #edf1eb; color: #354739; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.entry-content pre { overflow-x: auto; padding: 1.2rem; border-radius: 4px; background: #272b28; color: #f2f2ed; font-size: .85rem; }
.entry-content .alignwide { width: min(100vw - var(--sp-side-width) - 3rem, 1040px); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.post-navigation { margin: 5rem auto 1rem; max-width: 920px; padding-top: 2rem; border-top: 1px solid var(--sp-line); }
.post-navigation .nav-links { display: flex; justify-content: space-between; gap: 2rem; }
.post-navigation a { font-family: var(--sp-sans); font-size: .75rem; letter-spacing: .06em; text-decoration: none; }

.site-footer { padding: clamp(5rem, 10vw, 9rem) 2rem 2.5rem; text-align: center; }
.legal-navigation ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.6rem; margin: 0; padding: 0; list-style: none; }
.legal-navigation a {
  color: var(--sp-muted); font-family: var(--sp-sans); font-size: .63rem;
  letter-spacing: .18em; text-decoration: none; text-transform: uppercase;
}
.legal-navigation a:hover { color: var(--sp-ink); }
.site-info { margin-top: 1.5rem; color: #99988f; font-family: var(--sp-sans); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; }

@media (max-width: 980px) {
  :root { --sp-side-width: 0px; }
  .site-shell { padding-right: 0; }
  .menu-toggle {
    position: fixed; z-index: 50; top: 1rem; right: 1rem; display: grid; place-items: center;
    width: 3rem; height: 3rem; border: 1px solid var(--sp-line); border-radius: 50%;
    background: rgba(251, 250, 247, .94); color: var(--sp-ink); cursor: pointer;
  }
  .menu-toggle-lines, .menu-toggle-lines::before, .menu-toggle-lines::after {
    display: block; width: 1rem; height: 1px; background: currentColor;
  }
  .menu-toggle-lines { position: relative; }
  .menu-toggle-lines::before, .menu-toggle-lines::after { content: ""; position: absolute; left: 0; }
  .menu-toggle-lines::before { top: -.32rem; }
  .menu-toggle-lines::after { top: .32rem; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-lines { background: transparent; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-lines::before { top: 0; transform: rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle-lines::after { top: 0; transform: rotate(-45deg); }
  .side-navigation {
    visibility: hidden; opacity: 0; width: min(88vw, 22rem); padding: 6rem 2.2rem 2rem;
    transform: translateX(100%); pointer-events: none;
    transition: transform .3s ease, opacity .2s ease, visibility .3s;
  }
  .side-navigation.is-open { visibility: visible; opacity: 1; transform: translateX(0); pointer-events: auto; }
  .side-navigation a { font-size: .78rem; }
  body.menu-open { overflow: hidden; }
  body.menu-open::before {
    content: ""; position: fixed; z-index: 20; inset: 0;
    background: rgba(31, 33, 30, .28); backdrop-filter: blur(2px);
  }
  .polaroid-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .entry-layout.has-post-info { grid-template-columns: 1fr; gap: 2rem; }
  .post-info-box { position: static; order: 2; width: 100%; }
}

@media (max-width: 600px) {
  .site-header { padding: 4.5rem 3.8rem 3.5rem 1.5rem; }
  .site-title { letter-spacing: .3em; }
  .site-description { letter-spacing: .3em; }
  .site-main { width: min(100% - 2.4rem, 430px); }
  .polaroid-grid { grid-template-columns: 1fr; gap: 4.2rem; }
  .polaroid-card { width: min(88%, 340px); margin-inline: auto; }
  .polaroid-card:nth-child(even) { transform: rotate(.7deg); }
  .polaroid-card:nth-child(odd) { transform: rotate(-.7deg); }
  .polaroid-copy { min-height: 5.6rem; }
  .entry-title { font-size: 2.2rem; }
  .post-start-block { flex-direction: column; gap: .4rem; }
  .single .entry-content { padding: 1.5rem; }
  .entry-content .gallery { grid-template-columns: 1fr; }
  .post-navigation .nav-links { flex-direction: column; }
  .search-form { flex-direction: column; gap: .6rem; }
  .search-field { border-right: 1px solid var(--sp-line); border-radius: 3px; }
  .search-submit { border-radius: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
