/* rolfkurath.ch – site-specific styles on top of Pico CSS (red theme) */

:root {
  --rk-red: #e10019;               /* brand red from the logo */
  --rk-grey: #7b9696;              /* muted teal-grey of the old site */
  --rk-page-bg: #e5e5e5;           /* page background of the old site */
  --rk-pad-x: 1rem;                /* inner side padding of the white content column */
  --pico-font-family-sans-serif: "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --pico-border-radius: 0.375rem;
}

@media (min-width: 768px) {
  :root { --rk-pad-x: 2.5rem; }
}

@media (min-width: 1024px) {
  :root { --rk-pad-x: 4rem; }
}

/* Layout like the old site: grey page, white content column of max. 1200px */
body {
  background-color: var(--rk-page-bg);
}

@media (min-width: 1280px) {
  .container {
    max-width: 1200px;
  }
}

/* Navigation: no underline on hover (Pico only suppresses it when not hovered) */
body > header nav a,
body > footer nav a,
body > header nav a:hover,
body > footer nav a:hover {
  text-decoration: none;
}

/* Header ------------------------------------------------------------ */

body > header {
  border-top: 4px solid var(--rk-red);
  background: var(--pico-background-color);
  box-shadow: 0 1px 0 var(--pico-muted-border-color);
  position: sticky;
  top: 0;
  z-index: 10;
  padding-block: 0;   /* height comes from the logo item, so menu links can reach the bottom edge */
}

body > header nav ul:first-child li {
  padding-block: 1.5rem;
}

body > header nav {
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

body > header nav .brand img {
  display: block;
  height: 44px;
  width: auto;
}

body > header nav ul:last-child {
  flex-wrap: wrap;
}

body > header nav ul:last-child a {
  color: var(--pico-muted-color);
  font-weight: 500;
  padding-inline: 0.6rem;
  letter-spacing: 0.04em;
}

body > header nav ul:last-child a:hover,
body > header nav ul:last-child a[aria-current] {
  color: var(--pico-primary);
}

/* Desktop: links stretch to the bottom of the header, the red bar of the
   active/hovered item sits directly on the hero image (like the old site). */
@media (min-width: 769px) {
  body > header nav #main-menu {
    align-self: stretch;
    align-items: stretch;
  }

  body > header nav #main-menu li {
    display: flex;
    padding-block: 0;
  }

  body > header nav #main-menu a {
    position: relative;
    display: flex;
    align-items: center;
    margin-block: 0;
    padding-block: 0.75rem;
    border-radius: 0;
  }

  /* red bar exactly as wide as the link text (excludes the link's side padding) */
  body > header nav #main-menu a::after {
    content: "";
    position: absolute;
    left: 0.6rem;
    right: 0.6rem;
    bottom: 0;
    height: 8px;
    background: var(--pico-primary);
    opacity: 0;
  }

  body > header nav #main-menu a:hover::after,
  body > header nav #main-menu a[aria-current]::after {
    opacity: 1;
  }
}

/* Hamburger toggle (phones only) */
.nav-toggle {
  display: none;
  width: auto;
  margin: 0;
  padding: 0.4rem;
  background: none;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  color: var(--pico-muted-color);
  line-height: 0;
  box-shadow: none;
}

.nav-toggle:hover,
.nav-toggle:focus-visible,
.nav-toggle[aria-expanded="true"] {
  color: var(--pico-primary);
  border-color: var(--pico-primary);
  background: none;
}

.nav-toggle svg path {
  transition: transform 0.2s, opacity 0.2s;
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] .bar-top { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar-mid { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar-bot { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 768px) {
  body > header nav {
    justify-content: space-between;
  }

  .nav-toggle {
    display: inline-flex;
    align-self: center;
  }

  body > header nav #main-menu {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    margin: 0.25rem 0 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--pico-muted-border-color);
  }

  body > header nav #main-menu.is-open {
    display: flex;
  }

  body > header nav #main-menu li {
    padding: 0;
  }

  body > header nav #main-menu a {
    display: block;
    margin: 0;
    padding: 0.7rem 0.75rem;
    border-radius: var(--pico-border-radius);
  }

  body > header nav #main-menu a[aria-current] {
    box-shadow: none;
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
  }
}

/* Hero -------------------------------------------------------------- */

.hero {
  position: relative;
  margin: 0 calc(-1 * var(--rk-pad-x)) 2.5rem;   /* bleed to the edges of the white column */
  border-bottom: 4px solid var(--rk-red);
  overflow: hidden;
  background: linear-gradient(90deg, #c9c9c9, #f2f2f2 45%, #c9c9c9);
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: right center;
}

.hero .hero-text {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem var(--rk-pad-x);   /* title aligned with the content below */
  max-width: 60%;
}

.hero .hero-text h1 {
  margin: 0;
  color: #1f2a2a;
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.hero .hero-text p {
  margin: 0.5rem 0 0;
  color: #3d4a4a;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
}

.hero.hero-home img {
  min-height: 300px;
}

.hero.hero-dark {
  background: #000;
}

.hero.hero-dark .hero-text h1 {
  color: #fff;
}

.hero.hero-dark .hero-text p {
  color: #d0d0d0;
}

@media (max-width: 768px) {
  .hero img {
    height: 200px;
  }
  .hero.hero-home img {
    height: 260px;
    min-height: 0;
  }
  .hero .hero-text {
    position: static;
    max-width: none;
    padding: 1rem var(--rk-pad-x) 1.25rem;
    background: var(--pico-card-background-color);
  }
  .hero.hero-dark .hero-text h1 {
    color: #1f2a2a;
  }
  .hero.hero-dark .hero-text p {
    color: #3d4a4a;
  }
}

/* Content ----------------------------------------------------------- */

main.container {
  background: #fff;
  padding: 0 var(--rk-pad-x) 3rem;
  border-bottom: 4px solid var(--rk-red);   /* red line above the footer, like the old site */
}

main h2 {
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
}

main h3 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

main h4 {
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--pico-primary);
}

main h4:first-child {
  margin-top: 0;
}

.grid > article {
  margin-bottom: 0;
}

article h3 {
  border-bottom: 2px solid var(--rk-red);
  padding-bottom: 0.5rem;
}

aside article {
  background: var(--pico-card-sectioning-background-color);
}

.layout-sidebar {
  grid-template-columns: 1fr;
}

@media (min-width: 992px) {
  .layout-sidebar {
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
  }
}

ul.compact li {
  margin-bottom: 0.4rem;
}

address {
  font-style: normal;
  line-height: 1.7;
}

/* Accordion (details/summary, e.g. Impressum on the Kontakt page): outlined boxes */
main details {
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  padding: 0 1rem;
  margin-bottom: 0.75rem;
}

main details summary {
  padding: 0.75rem 0;
  font-weight: 500;
}

main details summary:hover {
  color: var(--pico-primary);
}

main details[open] > summary,
main details[open] > summary:not([role]):not(:focus) {
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
  color: var(--pico-primary);   /* open item: title in red instead of Pico's muted grey */
}

main details > :last-child:not(summary) {
  margin-bottom: 0.75rem;
}

.notice {
  text-align: center;
  padding: 3rem 1.5rem;
}

.notice svg {
  width: 3rem;
  height: 3rem;
  color: var(--pico-primary);
  margin-bottom: 1rem;
}

/* Footer ------------------------------------------------------------ */

body > footer {
  background: var(--pico-card-sectioning-background-color);
  font-size: 0.9rem;
  color: var(--pico-muted-color);
  padding-top: 0;   /* the Blog/Kontakt tabs hang directly from the red line above */
}

body > footer nav {
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

body > footer nav a {
  letter-spacing: 0.04em;
}

/* Footer links as tabs below the red line (old site's bottom navigation) */
body > footer nav li {
  padding: 0 0 1rem 0.5rem;   /* 0.5rem gap between the tabs, first tab flush with the column edge */
}

body > footer nav ul:last-child li {
  padding: 0 0.5rem 1rem 0;   /* right-hand list: last tab flush with the column edge */
}

body > footer nav a {
  display: block;
  margin: 0;
  padding: 0.45rem 1rem 0.55rem;
  border-radius: 0 0 var(--pico-border-radius) var(--pico-border-radius);
  background: var(--rk-page-bg);
  color: var(--pico-primary);
  font-weight: 500;
}

body > footer nav a:hover,
body > footer nav a[aria-current] {
  background: #d6d6d6;
  color: var(--pico-primary-hover);
}

body > footer .footer-line {
  border-top: 1px solid var(--pico-muted-border-color);
  padding-block: 1rem 1.5rem;
  margin: 0;
}

body > footer .footer-line span {
  white-space: nowrap;
}

/* Blog -------------------------------------------------------------- */

.post-count {
  color: var(--pico-muted-color);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.post-card {
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.5rem;
}

.post-card > header,
.post-card > footer {
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
}

.post-card time,
.post-meta {
  display: block;
  color: var(--pico-muted-color);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.post-card h3 {
  border: 0;
  padding: 0;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.post-card h3 a {
  color: var(--pico-h3-color);
  text-decoration: none;
}

.post-card h3 a:hover {
  color: var(--pico-primary);
}

.post-card > p {
  margin-bottom: 0.75rem;
}

.post-card > footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.post-card .more {
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

/* tag pills */
.tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

a.tag {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--pico-card-sectioning-background-color);
  border: 1px solid var(--pico-muted-border-color);
  color: var(--pico-muted-color);
  font-size: 0.8rem;
  text-decoration: none;
  line-height: 1.6;
}

a.tag:hover,
a.tag.active {
  color: var(--pico-primary);
  border-color: var(--pico-primary);
  background: var(--pico-background-color);
}

a.tag small {
  opacity: 0.7;
}

ul.tag-cloud,
ul.recent {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

ul.tag-cloud li {
  margin: 0;
  padding: 0;
  list-style: none;
}

ul.recent li {
  margin: 0 0 0.6rem;
  padding: 0;
  list-style: none;
  line-height: 1.35;
}

ul.recent a {
  text-decoration: none;
}

ul.recent small {
  display: block;
  color: var(--pico-muted-color);
  font-size: 0.8rem;
}

/* single post */
.post {
  padding: 1.5rem 2rem;
}

.post > header {
  background: none;
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
}

.post > header h2 {
  font-size: 1.9rem;
  line-height: 1.2;
  margin: 0;
}

.post-meta {
  margin-bottom: 0.5rem;
}

.post .lead {
  font-size: 1.1rem;
  color: var(--pico-h4-color);
  border-left: 3px solid var(--rk-red);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}

.post .lead p:last-child {
  margin-bottom: 0;
}

.post-body h3,
.post-body h4 {
  margin-top: 1.5rem;
  color: var(--pico-h3-color);
  border: 0;
  padding: 0;
}

.post-body ul,
.post-body ol {
  padding-left: 1.25rem;
}

.post > footer {
  background: none;
  border: 0;
  border-top: 1px solid var(--pico-muted-border-color);
  margin: 1.5rem 0 0;
  padding: 1rem 0 0;
}

.post > footer .tags {
  margin: 0;
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.post-nav a {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.3;
}

.post-nav a[rel="next"] {
  text-align: right;
}

.post-nav a:hover {
  border-color: var(--pico-primary);
}

.post-nav small {
  color: var(--pico-muted-color);
  font-weight: 400;
}

@media (max-width: 576px) {
  .post {
    padding: 1.25rem 1.25rem;
  }
  .post-nav {
    grid-template-columns: 1fr;
  }
  .post-nav a[rel="next"] {
    text-align: left;
  }
}

/* Blog-Übersicht: Seitennummerierung ---------------------------------------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 2rem 0 0.5rem;
  padding: 0;
  list-style: none;
}

.pagination li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination a,
.pagination span {
  display: inline-block;
  min-width: 2.4rem;
  margin: 0; /* Pico gibt nav a negative Ränder */
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  text-align: center;
  text-decoration: none;
  font-weight: 500;
  line-height: 1.3;
}

.pagination a:hover {
  border-color: var(--pico-primary);
}

.pagination [aria-current="page"] {
  background: var(--pico-primary);
  border-color: var(--pico-primary);
  color: var(--pico-primary-inverse);
}

.pagination .gap {
  border: 0;
  min-width: auto;
  padding: 0.4rem 0.2rem;
  color: var(--pico-muted-color);
}

/* WT Minimalist CMS: Vorschau-Hinweis für unveröffentlichte Inhalte ------- */
.preview-banner {
  background: #fff4e5;
  color: #8a4b00;
  border-bottom: 1px solid #f5cc8f;
  text-align: center;
  font-size: 0.9rem;
  padding: 0.4rem 1rem;
}
