/*
Theme Name: pw.is
Theme URI: https://pw.is/
Author: Peter Wilfahrt
Author URI: https://pw.is/
Description: Version 2 für Beiträge und Seiten von pw.is, im Stil der neuen Startseite: Serifen-Titel, Pillen-Menü, helle Karten, dunkler Footer.
Version: 2.0.0
Requires at least: 6.0
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: pw
*/

:root {
    --ink: #0c1620;
    --ink-soft: #3b4754;
    --muted: #6b7785;
    --brand: #12355b;
    --brand-hover: #0b2644;
    --accent: #ff5a36;
    --surface: #f4f5f7;
    --surface-2: #eceef1;
    --line: #dfe3e8;
    --white: #ffffff;
    --radius-xl: 40px;
    --radius-lg: 24px;
    --radius-md: 14px;
    --serif: "Instrument Serif", "Times New Roman", Times, serif;
    --sans: "Sora", Arial, Helvetica, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --gutter: clamp(16px, 4vw, 48px);
    --max: 1280px;
    --measure: 720px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--white);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.wrap {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 1000;
    background: var(--white);
    color: var(--ink);
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    font-weight: 500;
    text-decoration: none;
}

.skip-link:focus {
    left: 16px;
}

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

.eyebrow {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 0.75rem;
}

.eyebrow a {
    color: inherit;
    text-decoration: none;
}

.eyebrow a:hover {
    color: var(--ink);
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    border-radius: 999px;
    padding: 0.7rem 1.25rem;
    font: 500 1rem/1 var(--sans);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.btn-brand {
    background: var(--brand);
    color: var(--white);
}

.btn-brand:hover {
    background: var(--brand-hover);
    color: var(--white);
}

.btn-dark {
    background: var(--ink);
    color: var(--white);
    font-weight: 700;
}

.btn-dark:hover {
    background: #000;
    color: var(--white);
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.site-header.is-scrolled {
    border-bottom-color: var(--line);
}

.admin-bar .site-header {
    top: 32px;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 72px;
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--ink);
}

.brand-mark {
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: -0.04em;
}

.brand-name {
    font-family: var(--serif);
    font-size: 1.35rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-links {
    display: flex;
    gap: 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-links a {
    text-decoration: none;
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.header-links a:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Menü-Overlay */
.menu-panel {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(12, 22, 32, 0.4);
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0s linear 0.2s;
}

.menu-panel.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s, visibility 0s;
}

.menu-sheet {
    width: min(440px, 100%);
    height: 100%;
    background: var(--white);
    padding: 1.5rem clamp(1.25rem, 3vw, 2rem) 2rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transform: translateX(24px);
    transition: transform 0.25s;
}

.menu-panel.is-open .menu-sheet {
    transform: none;
}

.menu-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.menu-close {
    border: 0;
    background: var(--surface);
    border-radius: 999px;
    padding: 0.7rem 1.1rem;
    font: 500 1rem/1 var(--sans);
    cursor: pointer;
}

.menu-list,
.menu-list .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-list > li > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--serif);
    font-size: 2rem;
    line-height: 1.1;
    text-decoration: none;
}

.menu-list > li > a::after {
    content: "\2192";
    font-family: var(--sans);
    font-size: 1.1rem;
    color: var(--muted);
}

.menu-list > .current-menu-item > a,
.menu-list > .current-menu-ancestor > a,
.menu-list > .current-post-ancestor > a {
    color: var(--brand);
}

.menu-list .sub-menu {
    padding: 0.5rem 0 0.75rem 0.25rem;
    border-bottom: 1px solid var(--line);
}

.menu-list .sub-menu a {
    display: block;
    padding: 0.35rem 0;
    color: var(--ink-soft);
    text-decoration: none;
}

.menu-list .sub-menu a:hover,
.menu-list .sub-menu .current-menu-item > a {
    color: var(--ink);
    text-decoration: underline;
}

.menu-list a.is-external::after {
    content: "\2197";
}

.menu-profiles {
    margin-top: auto;
    padding-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
}

.menu-profiles a {
    color: var(--ink-soft);
}

/* Inhalt */
.site-main {
    flex: 1 0 auto;
    padding-bottom: clamp(3rem, 8vw, 6rem);
}

.breadcrumbs {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 1.5rem 0 0;
}

.breadcrumbs a {
    color: var(--ink-soft);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Kopf eines Beitrags / einer Seite */
.entry-hero {
    background: var(--surface);
    border-radius: var(--radius-xl);
    margin-top: 1rem;
    padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 5vw, 4rem);
    text-align: center;
}

.entry-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.6rem, 6.5vw, 5rem);
    line-height: 1;
    letter-spacing: -0.03em;
    max-width: 980px;
    margin: 0 auto;
    text-wrap: balance;
}

.entry-lead {
    max-width: 680px;
    margin: 1.25rem auto 0;
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    color: var(--ink-soft);
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.entry-meta li {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--white);
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    color: var(--ink-soft);
}

.entry-meta a {
    color: var(--ink);
    text-decoration: none;
}

.entry-meta a:hover {
    text-decoration: underline;
}

.entry-thumbnail {
    max-width: 1100px;
    margin: clamp(1.5rem, 4vw, 3rem) auto 0;
}

.entry-thumbnail img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
}

/* Fließtext */
.entry-content {
    max-width: var(--measure);
    margin: clamp(2.5rem, 6vw, 4rem) auto 0;
    font-size: 1.1rem;
    line-height: 1.75;
    color: #1d2833;
}

.entry-content > * {
    margin-top: 0;
    margin-bottom: 0;
}

.entry-content > * + * {
    margin-top: 1.25rem;
}

.entry-content h2 {
    font-weight: 500;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--ink);
    margin-top: 3rem;
}

.entry-content h3 {
    font-weight: 600;
    font-size: 1.3rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-top: 2.25rem;
}

.entry-content h4 {
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 1.75rem;
}

.entry-content h2 + *,
.entry-content h3 + *,
.entry-content h4 + * {
    margin-top: 0.75rem;
}

.entry-content a {
    color: var(--brand);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.entry-content a:hover {
    color: var(--brand-hover);
    text-decoration-thickness: 2px;
}

.entry-content .standfirst {
    font-family: var(--serif);
    font-size: clamp(1.5rem, 3vw, 1.9rem);
    line-height: 1.25;
    color: var(--ink);
    margin-bottom: 2.25rem;
}

.entry-content .standfirst em {
    font-style: italic;
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.3rem;
}

.entry-content li + li {
    margin-top: 0.4rem;
}

.entry-content li::marker {
    color: var(--muted);
}

.entry-content blockquote {
    margin-left: 0;
    margin-right: 0;
    padding: 0.25rem 0 0.25rem 1.5rem;
    border-left: 3px solid var(--accent);
    font-family: var(--serif);
    font-size: 1.6rem;
    line-height: 1.3;
    color: var(--ink);
}

.entry-content blockquote p {
    margin: 0;
}

.entry-content blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-family: var(--sans);
    font-size: 0.9rem;
    font-style: normal;
    color: var(--muted);
}

.entry-content code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--surface);
    padding: 0.12em 0.4em;
    border-radius: 6px;
}

.entry-content pre,
.entry-content pre.wp-block-code {
    background: var(--ink);
    color: #e3e9ef;
    padding: 1.25rem 1.4rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.65;
    overflow-x: auto;
    border: 0;
}

.entry-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.entry-content .wp-block-table {
    overflow-x: auto;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    line-height: 1.5;
}

.entry-content th,
.entry-content td {
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.7rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.entry-content thead th {
    font-weight: 600;
    border-bottom: 2px solid var(--ink);
}

.entry-content hr,
.entry-content .wp-block-separator {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 3rem 0;
    opacity: 1;
}

.entry-content img {
    border-radius: var(--radius-md);
}

.entry-content figure {
    margin-left: 0;
    margin-right: 0;
}

.entry-content figcaption {
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
    margin-top: 0.5rem;
}

.entry-content .alignwide {
    width: min(1100px, calc(100vw - 2 * var(--gutter)));
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}

.entry-content .serien-navigation {
    margin-top: 3rem;
    padding: 1.25rem 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted);
}

.entry-content .serien-navigation a {
    color: var(--ink);
    font-weight: 600;
}

/* Unter dem Artikel */
.entry-footer {
    max-width: var(--measure);
    margin: 3rem auto 0;
}

.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.entry-tags a {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-soft);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    transition: border-color 0.2s;
}

.entry-tags a:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.post-navigation .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 2rem;
}

.post-navigation a {
    display: block;
    height: 100%;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
}

.post-navigation a:hover {
    background: var(--surface-2);
}

.post-navigation .nav-next {
    grid-column: 2;
    text-align: right;
}

.post-navigation .nav-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

/* Autorenbox */
.author-box {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    margin-top: 2rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    background: var(--surface);
    border-radius: var(--radius-lg);
}

.author-photo {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
}

.author-box p {
    margin: 0;
}

.author-kicker {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.author-name {
    font-family: var(--serif);
    font-size: 1.75rem;
    line-height: 1.1;
    margin-top: 0.2rem;
}

.author-name a {
    text-decoration: none;
}

.author-box .author-bio {
    color: var(--ink-soft);
    margin-top: 0.5rem;
}

.author-box .author-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.author-links a {
    color: var(--brand);
}

/* Archiv */
.archive-hero {
    background: var(--surface);
    border-radius: var(--radius-xl);
    margin-top: 1rem;
    padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 5vw, 4rem);
}

.archive-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    line-height: 1;
    letter-spacing: -0.03em;
    margin: 0;
}

.archive-description {
    max-width: 680px;
    margin-top: 1.25rem;
    font-size: 1.15rem;
    color: var(--ink-soft);
}

.archive-description p {
    margin: 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 240px;
    padding: 1.4rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    transition: background-color 0.2s, transform 0.2s;
}

.card:hover {
    background: var(--surface-2);
    transform: translateY(-2px);
}

.card-date {
    align-self: flex-start;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--white);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
}

.card-title {
    font-weight: 500;
    font-size: 1.25rem;
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin: 0;
}

/* Ganze Karte klickbar, Link bleibt ein echter Link im Titel */
.card-title a {
    text-decoration: none;
}

.card-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.card-excerpt {
    color: var(--ink-soft);
    font-size: 0.95rem;
    margin-top: auto;
}

.card-excerpt p {
    margin: 0;
}

.card.is-lead {
    grid-column: span 2;
    background: var(--brand);
    color: var(--white);
}

.card.is-lead:hover {
    background: var(--brand-hover);
}

.card.is-lead .card-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2rem, 3.6vw, 3rem);
    line-height: 1.02;
}

.card.is-lead .card-excerpt {
    color: rgba(255, 255, 255, 0.8);
}

.card.is-lead .card-date {
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
}

.empty-state {
    text-align: center;
    padding: 4rem 0;
    color: var(--ink-soft);
}

.pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 1rem;
    border-radius: 999px;
    background: var(--surface);
    text-decoration: none;
    font-weight: 500;
}

.page-numbers:hover {
    background: var(--surface-2);
}

.page-numbers.current {
    background: var(--ink);
    color: var(--white);
}

.page-numbers.dots {
    background: none;
}

/* 404 */
.not-found {
    text-align: center;
}

.not-found .entry-lead {
    margin-bottom: 2rem;
}

/* Kommentare */
.comments-area {
    max-width: var(--measure);
    margin: 3rem auto 0;
}

.comments-area h2 {
    font-weight: 500;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment-list .children {
    list-style: none;
    padding-left: 1.5rem;
}

.comment-body {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    margin-bottom: 0.75rem;
}

.comment-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 0.7rem 0.9rem;
    font: inherit;
}

.comment-form .submit {
    border: 0;
    border-radius: 999px;
    background: var(--ink);
    color: var(--white);
    font: 700 1rem/1 var(--sans);
    padding: 0.8rem 1.4rem;
    cursor: pointer;
}

/* WordPress-Pflichtklassen */
.alignleft {
    float: left;
    margin: 0.3rem 1.5rem 1rem 0;
}

.alignright {
    float: right;
    margin: 0.3rem 0 1rem 1.5rem;
}

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

/* Footer */
.site-footer {
    background: var(--ink);
    color: #c9d1da;
    padding: clamp(3rem, 7vw, 5rem) 0 2rem;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
    gap: 2rem;
}

.footer-grid h2 {
    font-family: var(--mono);
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8793a0;
    margin: 0 0 1rem;
}

.footer-grid ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-grid li + li {
    margin-top: 0.45rem;
}

.footer-grid a {
    color: #e8edf2;
    text-decoration: none;
}

.footer-grid a:hover {
    text-decoration: underline;
}

.footer-claim {
    font-family: var(--serif);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    line-height: 1.1;
    color: var(--white);
    margin: 0;
}

.footer-word {
    font-weight: 700;
    letter-spacing: -0.06em;
    font-size: clamp(6rem, 24vw, 20rem);
    line-height: 0.8;
    color: #16222e;
    margin: 3rem 0 1.5rem;
    user-select: none;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    font-size: 0.85rem;
    color: #8793a0;
    border-top: 1px solid #22303d;
    padding-top: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 960px) {
    .header-links {
        display: none;
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-grid > :first-child {
        grid-column: 1 / -1;
    }
}

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

@media (max-width: 640px) {
    .site-header-inner {
        min-height: 60px;
    }

    .brand-name {
        display: none;
    }

    .entry-hero,
    .archive-hero {
        border-radius: var(--radius-lg);
        margin-left: calc(-1 * var(--gutter) + 8px);
        margin-right: calc(-1 * var(--gutter) + 8px);
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .card.is-lead {
        grid-column: auto;
    }

    .post-navigation .nav-links {
        grid-template-columns: 1fr;
    }

    .post-navigation .nav-next {
        grid-column: auto;
    }

    .author-box {
        flex-direction: column;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .site-footer {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
}
