/*
Theme Name: Grayling
Description: Ruhiges, werkstattnahes Redaktionstheme für deutschsprachige Ratgeber- und Wissensseiten: tiefe Petroltöne, warmes Off-White, sparsamer Amber-Akzent, klare Leseachse und magazinartige Kartenraster.
Version: 2.4.3
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ---------------------------------------------------------------------------
   Grundlage: Palette, Material, Rhythmus
   Tiefes Petrolblau + warmes Off-White, matter Amber nur an Fugenstellen.
--------------------------------------------------------------------------- */

:root {
  --bg: #f5f0e4;
  --bg-soft: #efe8d6;
  --card: #fbf8f0;
  --fg: #1b3944;
  --head: #0f3a47;
  --muted: #61757b;
  --border: #dcd2ba;
  --border-soft: #e7dfc9;
  --accent: #a87c2a;
  --accent-soft: #f0e4c8;
  --radius: 5px;
  --shadow: 0 1px 2px rgba(15, 58, 71, 0.05), 0 10px 28px rgba(15, 58, 71, 0.07);
  --media-ratio: 16 / 9;
  --thumb-ratio: 16 / 9;
  --max: 1140px;
  --font-head: Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.05rem;
  --step-4: 2.6rem;
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1.125rem;
  --space-4: 1.75rem;
  --space-5: 2.75rem;
  --space-6: 4.25rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.7;
}

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

a {
  color: var(--head);
  text-decoration-color: rgba(168, 124, 42, 0.55);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--head);
  line-height: 1.22;
  font-weight: 700;
  margin: 0 0 var(--space-3);
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-2); margin-top: var(--space-5); }
h3 { font-size: var(--step-1); margin-top: var(--space-4); }
h4 { font-size: var(--step-0); margin-top: var(--space-4); }

h1, h2, h3, h4,
p, li, a {
  overflow-wrap: break-word;
}

p {
  margin: 0 0 var(--space-3);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

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

/* ---------------------------------------------------------------------------
   Kopfbereich und Navigation
--------------------------------------------------------------------------- */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.site-header::after {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(to right, var(--head) 0, var(--head) 62%, var(--accent) 62%, var(--accent) 66%, var(--head) 66%, var(--head) 100%);
  opacity: 0.9;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

.site-name {
  margin: 0;
  font-family: var(--font-head);
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.site-name a {
  color: var(--head);
  text-decoration: none;
}

.site-name a:hover {
  color: var(--accent);
}

.site-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-2);
}

.nav-list > li {
  position: relative;
}

.nav-list a {
  display: block;
  padding: var(--space-1) var(--space-2);
  color: var(--fg);
  text-decoration: none;
  font-size: var(--step-0);
  font-weight: 600;
  border-bottom: 2px solid transparent;
}

.nav-list a:hover {
  color: var(--head);
  border-bottom-color: var(--accent);
}

.nav-list .current-menu-item > a,
.nav-list .current-menu-ancestor > a,
.nav-list .current_page_item > a {
  border-bottom-color: var(--accent);
  color: var(--head);
}

.sub-menu {
  list-style: none;
  margin: 0;
  padding: var(--space-1) 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 270px;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  box-shadow: var(--shadow);
  z-index: 30;
  display: none;
}

.nav-list > li:hover > .sub-menu,
.nav-list > li:focus-within > .sub-menu {
  display: block;
}

.site-nav .sub-menu a {
  font-weight: 400;
  padding: 0.45rem var(--space-3);
  border-bottom: 0;
  border-left: 2px solid transparent;
}

.site-nav .sub-menu a:hover {
  border-left-color: var(--accent);
  background: var(--bg-soft);
}

.sub-toggle {
  display: none;
}

.nav-toggle {
  display: none;
  width: 46px;
  height: 42px;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle:hover {
  border-color: var(--accent);
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--head);
  border-radius: 2px;
  position: relative;
}

.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--head);
  border-radius: 2px;
}

.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }

/* ---------------------------------------------------------------------------
   Brotkrumen
--------------------------------------------------------------------------- */

.breadcrumb {
  font-size: var(--step--1);
  color: var(--muted);
  padding: 1rem 0 0;
  margin: 0.5rem 0;
}

/* Startseite: ohne Brotkrumen etwas mehr Luft unter dem Header. */
.home .layout {
  padding-top: 2rem;
}

.breadcrumb .crumb {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a.crumb:hover {
  color: var(--accent);
}

.breadcrumb .trail {
  margin: 0 0.4em;
  color: var(--accent);
}

.breadcrumb .crumb.is-current {
  color: var(--fg);
}

/* ---------------------------------------------------------------------------
   Layout: Inhalt + Seitenleiste
--------------------------------------------------------------------------- */

.site-main {
  padding-bottom: var(--space-6);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--space-5);
  align-items: start;
  padding-top: 1rem;
}

.layout.no-sidebar {
  grid-template-columns: minmax(0, 1fr);
}

/* ---------------------------------------------------------------------------
   Hero (Startseite, erste Bildschirmhälfte)
--------------------------------------------------------------------------- */

.hero {
  border: 1px solid var(--border);
  border-top: 3px solid var(--head);
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  top: -3px;
  left: var(--space-5);
  width: 64px;
  height: 3px;
  background: var(--accent);
}

.hero-title {
  font-size: var(--step-4);
  margin-bottom: var(--space-2);
}

.hero-lead {
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.55;
  margin: 0;
  max-width: 56ch;
}

/* ---------------------------------------------------------------------------
   Kartenraster (Archive + verwandte Beiträge, immer 3 Spalten)
--------------------------------------------------------------------------- */

.section-title {
  font-size: var(--step-2);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-2);
  margin: var(--space-5) 0 var(--space-4);
}

.section-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  background: var(--accent);
  margin-top: var(--space-2);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: clip;
  display: flex;
  flex-direction: column;
}

.card:hover {
  border-color: var(--accent);
}

.card-media {
  aspect-ratio: var(--thumb-ratio);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1 1 auto;
}

.card-title {
  font-size: var(--step-1);
  margin: 0;
  line-height: 1.35;
}

.card-title a {
  text-decoration: none;
  color: var(--head);
}

.card-title a:hover {
  color: var(--accent);
}

.card-meta {
  font-size: var(--step--1);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em 0.9em;
}

.card-meta a {
  color: var(--muted);
  text-decoration: none;
}

.card-meta a:hover {
  color: var(--accent);
}

.card-excerpt {
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--fg);
  margin: 0;
}

.more-link-line {
  margin-top: auto;
  font-size: var(--step--1);
  font-weight: 600;
}

.more-link-line a {
  color: var(--accent);
  text-decoration: none;
}

.more-link-line a::after {
  content: " →";
}

/* Beitragskarte groß (erster Beitrag auf der Startseite): Bild oben, Text unten */

.lead-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: clip;
  margin-bottom: var(--space-5);
}

.lead-card:hover {
  border-color: var(--accent);
}

.lead-card .card-media {
  aspect-ratio: var(--media-ratio);
  border-bottom: 1px solid var(--border);
}

.lead-card .card-body {
  padding: var(--space-4);
}

.lead-card .card-title {
  font-size: var(--step-2);
}

/* ---------------------------------------------------------------------------
   Archivköpfe
--------------------------------------------------------------------------- */

.archive-head {
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
}

.archive-title {
  margin-bottom: var(--space-1);
}

.archive-desc {
  color: var(--muted);
  max-width: 68ch;
  margin: 0;
}

/* ---------------------------------------------------------------------------
   Seitenleiste (keine Widget-Areas, feste Module)
--------------------------------------------------------------------------- */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.side-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.side-box + .side-box {
  border-top: 1px solid var(--border);
}

.side-title {
  font-size: var(--step-0);
  margin: 0 0 var(--space-2);
  padding-bottom: var(--space-1);
  border-bottom: 1px dashed var(--border);
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.side-list li {
  border-bottom: 1px dashed var(--border);
}

.side-list li:last-child {
  border-bottom: 0;
}

.side-list a {
  display: block;
  padding: 0.4rem 0 0.4rem 1rem;
  position: relative;
  text-decoration: none;
  color: var(--fg);
  font-size: var(--step--1);
}

.side-list a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95em;
  width: 6px;
  height: 2px;
  background: var(--accent);
}

.side-list a:hover {
  color: var(--accent);
}

/* ---------------------------------------------------------------------------
   Einzelbeitrag
--------------------------------------------------------------------------- */

.article {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-5);
}

.article-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
}

.article-title {
  font-size: var(--step-3);
  margin-bottom: var(--space-2);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 1.2em;
  font-size: var(--step--1);
  color: var(--muted);
}

.article-meta .meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
}

.article-meta a {
  color: var(--muted);
  text-decoration: none;
}

.article-meta a:hover {
  color: var(--accent);
}

.article-meta time {
  font-variant-numeric: tabular-nums;
}

.article-media {
  margin: 0 0 var(--space-4);
  aspect-ratio: var(--media-ratio);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: clip;
}

.article-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-media figcaption {
  font-size: var(--step--1);
  color: var(--muted);
  padding: var(--space-1) var(--space-2);
}

/* Werkstatt-Notiz zwischen Beitragsbild und Text */

.article-note {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  font-size: var(--step--1);
}

.article-note .note-label {
  display: block;
  font-weight: 700;
  color: var(--head);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.25em;
}

.article-note p:last-child {
  margin-bottom: 0;
}

/* Fließtext */

.article-body {
  font-size: 1.0625rem;
  line-height: 1.75;
  hyphens: auto;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.table-scroll table {
  margin: 0;
  border: 0;
  min-width: 560px;
}

.table-scroll th,
.table-scroll td {
  white-space: nowrap;
}

.table-scroll td:last-child,
.table-scroll td:first-child {
  white-space: normal;
}

.article-body h2 {
  padding-top: var(--space-2);
  border-top: 1px dashed var(--border);
}

.article-body ul,
.article-body ol {
  margin: 0 0 var(--space-3);
  padding-left: 1.4em;
}

.article-body li {
  margin-bottom: 0.3em;
}

.article-body blockquote {
  margin: var(--space-4) 0;
  padding: var(--space-2) var(--space-4);
  border-left: 3px solid var(--accent);
  background: var(--bg);
  color: var(--head);
  font-family: var(--font-head);
  font-size: var(--step-1);
  line-height: 1.5;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--space-4);
  font-size: var(--step--1);
}

.article-body th,
.article-body td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.article-body th {
  background: var(--bg-soft);
  color: var(--head);
}

.article-body code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}

.article-body pre {
  background: var(--head);
  color: var(--bg);
  padding: var(--space-3);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0 0 var(--space-4);
}

.article-body pre code {
  background: none;
  border: 0;
  color: inherit;
  padding: 0;
}

.article-body figure {
  margin: 0 0 var(--space-4);
}

.article-body figcaption {
  font-size: var(--step--1);
  color: var(--muted);
  padding-top: var(--space-1);
}

/* Schlagwörter */

.article-tags {
  border-top: 1px dashed var(--border);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--step--1);
}

.tags-label {
  color: var(--muted);
  margin-right: 0.25em;
}

.article-tags a {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15em 0.8em;
  text-decoration: none;
  color: var(--fg);
  background: var(--bg);
}

.article-tags a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Autorenkasten */

.author-box {
  border: 1px solid var(--border);
  border-top: 3px solid var(--head);
  border-radius: var(--radius);
  background: var(--bg);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.author-avatar-wrap {
  margin: 0;
  flex: 0 0 auto;
}

.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

.author-text {
  flex: 1 1 auto;
  min-width: 0;
}

.author-box .author-label {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.25em;
}

.author-box .author-name {
  font-family: var(--font-head);
  font-size: var(--step-1);
  font-weight: 700;
  margin: 0 0 var(--space-1);
  color: var(--head);
}

.author-box .author-name a {
  color: inherit;
  text-decoration-color: rgba(168, 124, 42, 0.55);
}

.author-box .author-more {
  display: inline-block;
  margin-top: var(--space-2);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
}

.author-box .author-desc {
  margin: 0;
  font-size: var(--step--1);
  color: var(--fg);
}

/* Verwandte Beiträge */

.related {
  margin-top: var(--space-5);
}

/* ---------------------------------------------------------------------------
   Kommentarbereich
--------------------------------------------------------------------------- */

.comments-area {
  margin-top: var(--space-5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
}

.comments-title {
  font-size: var(--step-2);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-2);
}

.comment-list {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
}

.comment-list .comment {
  border-bottom: 1px dashed var(--border);
  padding: var(--space-3) 0;
}

.comment-list .comment:last-child {
  border-bottom: 0;
}

.comment-list .children {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding-left: var(--space-4);
  border-left: 1px dashed var(--border);
}

.comment-meta {
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: var(--space-1);
}

.comment-meta .fn {
  font-weight: 700;
  color: var(--head);
  font-style: normal;
}

.comment-meta a {
  color: var(--muted);
  text-decoration: none;
}

.comment-content p:last-child {
  margin-bottom: 0;
}

.reply {
  font-size: var(--step--1);
}

.comment-reply-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.comment-form label ,
.fliesen-werkbank-tool .fliesen-werkbank-caption
{
  display: block;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--head);
  margin-bottom: 0.25em;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea ,
.fliesen-werkbank-tool input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=button]):not([type=submit]):not([type=reset]),
.fliesen-werkbank-tool select,
.fliesen-werkbank-tool textarea
{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  padding: 0.55rem 0.75rem;
  font: inherit;
  margin-bottom: var(--space-2);
}

.comment-form .submit ,
.fliesen-werkbank-tool button
{
  background: var(--head);
  color: var(--bg);
  border: 0;
  border-radius: var(--radius);
  padding: 0.6rem 1.4rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.comment-form .submit:hover ,
.fliesen-werkbank-tool button:hover
{
  background: var(--accent);
}

.comment-navigation {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--step--1);
  margin-bottom: var(--space-3);
}

/* ---------------------------------------------------------------------------
   Suchformular
--------------------------------------------------------------------------- */

.search-form {
  display: flex;
  gap: var(--space-1);
  align-items: stretch;
}

.search-field {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  padding: 0.55rem 0.75rem;
  font: inherit;
}

.search-field:focus {
  border-color: var(--accent);
}

.search-submit {
  flex: 0 0 auto;
  background: var(--head);
  color: var(--bg);
  border: 1px solid var(--head);
  border-radius: var(--radius);
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.search-submit:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------------------------------------------------------------------------
   Paginierung
--------------------------------------------------------------------------- */

.pagination {
  margin-top: var(--space-5);
}

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  justify-content: center;
}

.pagination .page-numbers {
  display: inline-block;
  min-width: 2.4em;
  text-align: center;
  padding: 0.35em 0.6em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg);
  text-decoration: none;
  font-size: var(--step--1);
}

.pagination .page-numbers.current {
  background: var(--head);
  border-color: var(--head);
  color: var(--bg);
}

.pagination a.page-numbers:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------------------------------------------------------------------------
   Suche / 404 / schlichte Seiten
--------------------------------------------------------------------------- */

.plain-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}

.plain-panel .search-form {
  max-width: 520px;
  margin-top: var(--space-3);
}

.results-count {
  color: var(--muted);
  font-size: var(--step--1);
  margin-bottom: var(--space-4);
}

.empty-note {
  color: var(--muted);
}

.nf-cats-title {
  margin-top: var(--space-4);
}

/* ---------------------------------------------------------------------------
   Fußzeile
--------------------------------------------------------------------------- */

.site-footer {
  background: var(--head);
  color: #d8e2e4;
  margin-top: var(--space-6);
}

.footer-nav {
  padding: var(--space-5) 0 var(--space-4);
}

.footer-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.f-col > .f-title {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--step-0);
  color: var(--bg);
  padding-bottom: var(--space-1);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid rgba(245, 240, 228, 0.25);
  position: relative;
}

.f-col > .f-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 34px;
  height: 1px;
  background: var(--accent);
}

.f-col .sub-menu {
  position: static;
  display: block;
  min-width: 0;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.f-item {
  margin: 0;
}

.f-link {
  display: block;
  padding: 0.3em 0;
  color: #c3d2d5;
  text-decoration: none;
  font-size: var(--step--1);
  border-left: 0;
}

.f-link:hover {
  color: var(--bg);
  background: none;
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.f-static {
  cursor: default;
}

.f-static:hover {
  color: #c3d2d5;
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid rgba(245, 240, 228, 0.18);
  padding: var(--space-3) 0;
  font-size: var(--step--1);
  color: #a9bcbf;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
}

.footer-note,
.footer-copy {
  margin: 0;
}

/* ---------------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------------- */

@media (max-width: 1020px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 35;
    padding: var(--space-2) var(--space-4) var(--space-3);
  }

  .site-header.nav-open .site-nav {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
  }

  .nav-list > li {
    border-bottom: 1px dashed var(--border);
  }

  .nav-list > li:last-child {
    border-bottom: 0;
  }

  .nav-list a {
    padding: 0.6rem 0.25rem;
    font-size: var(--step-0);
  }

  .sub-menu {
    position: static;
    min-width: 0;
    border: 0;
    border-top: 1px dashed var(--border);
    box-shadow: none;
    background: var(--bg);
    padding: 0 0 var(--space-1) var(--space-3);
  }

  .nav-list > li:hover > .sub-menu,
  .nav-list > li:focus-within > .sub-menu {
    display: none;
  }

  .nav-list > li.open > .sub-menu {
    display: block;
  }

  .sub-toggle {
    display: inline-block;
    position: absolute;
    right: 0;
    top: 0.35rem;
    width: 2.2rem;
    height: 2.2rem;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--head);
    font-size: 1rem;
    line-height: 1;
  }

  .sub-toggle::before {
    content: "+";
  }

  li.open > .sub-toggle::before {
    content: "–";
  }

  .wrap {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .article {
    padding: 1rem;
  }

  .comments-area {
    padding: var(--space-3);
  }

  /* Mobil: Abstand letzte Seitenleiste → Fußzeile zusammenfassen
     (site-main padding-bottom + footer margin-top ≤ ca. 3.5rem) */
  .site-main {
    padding-bottom: 1rem;
  }

  .site-footer {
    margin-top: 1.5rem;
  }
}

@media (max-width: 620px) {
  .card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  h1 { font-size: var(--step-3); }

  .wrap {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero {
    padding: var(--space-3);
  }

  .hero-title {
    font-size: var(--step-3);
  }

  .plain-panel {
    padding: var(--space-3);
  }

  .article-note,
  .author-box {
    padding: var(--space-2) var(--space-3);
  }

  .author-box {
    gap: var(--space-2);
  }

  .author-avatar {
    width: 52px;
    height: 52px;
  }
}

/* Article body internal links · 15 */

.article-body a.article-internal-link {
	color: var(--head);
	text-decoration-line: underline;
	text-decoration-style: solid;
	text-decoration-color: #a67b35;
	text-decoration-thickness: 0.14em;
	text-decoration-skip-ink: none;
	text-underline-offset: 0.2em;
}

.article-body a.article-internal-link:hover,
.article-body a.article-internal-link:focus-visible {
	text-decoration-line: underline;
	text-decoration-color: currentColor;
}

.article-body a.article-internal-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}
