/*
Theme Name:  Hild Child
Description: Child theme für hild.plus – gwern-inspiriertes Layout
Author:      Andreas Hild
Template:    twentytwentyfour
Version:     1.1
*/

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

:root {
  --bg:     #F7F5F0;
  --text:   #1A1A18;
  --muted:  #7A7570;
  --rule:   #C8C2B8;
  --accent: #2B4A3F;
  --serif:  "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:   "Helvetica Neue", Helvetica, Arial, sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg) !important;
  color: var(--text);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wp-site-blocks, #page, .site, body > div:first-child {
  background: var(--bg) !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ── Layout ── */
.hild-wrap {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

/* ── Sidebar ── */
.hild-sidebar {
  width: 260px;
  flex-shrink: 0;
  padding: 3.5rem 1.4rem 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.hild-site-name {
  font-variant: small-caps;
  font-size: 1.15rem;
  letter-spacing: 0.07em;
  color: var(--accent);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  margin-bottom: 1.2rem;
}

.hild-tagline {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.hild-nav-groups { margin-top: 6rem; }

.hild-sidebar .widget { 
  margin-bottom: 1rem; 
}

.hild-sidebar .widget-title,
.hild-sidebar .widgettitle {
  font-family: var(--sans);
  font-size: 0.50rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  padding-bottom: 0.10rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0.1rem;
}

.hild-sidebar .widget ul { list-style: none; padding: 0; margin: 0; }
.hild-sidebar .widget ul li { margin-bottom: 0; line-height: 1.5; }
.hild-sidebar .widget ul li a { font-size: 0.8rem; color: var(--text); text-decoration: none; }
.hild-sidebar .widget ul li a:hover { color: var(--accent); }

.hild-sidebar .widget .sub-menu {
  padding-left: 1rem;
}

/* Untermenüs: standardmäßig geschlossen */
.sub-menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

/* Geöffnet via JS-Klasse */
.menu-item-has-children.is-open > .sub-menu {
  max-height: 20rem;
  opacity: 1;
}

.current-menu-item {
  text-decoration: underline;
}

/* ── Main ── */
.hild-main {
  flex: 1;
  min-width: 0;
  padding: 3.5rem 2.5rem 4rem;
  display: flex;
  flex-direction: column;
  min-height: 80vh;
}

/* ── Intro ── */
.hild-intro {
  margin-top: auto;
  margin-bottom: 2rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--rule);
  width: 100%;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.65;
}

.hild-intro em { font-style: normal; color: var(--text); }
.hild-intro p { margin: 0; }

/* ── Zwei Spalten ── */
.hild-streams {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  align-items: start;
  width: 100%;
}

.hild-stream-written { 
  padding-right: 0.5rem; 
}

.hild-stream-spoken  { 
  padding-left:  0.5rem; 
}

.hild-stream-heading {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 0.9rem;
  padding-bottom: 0.28rem;
  border-bottom: 1px solid var(--rule);
}

/* ── Jahr-Gruppe ── */
.hild-year-group { margin-bottom: 0.5rem; }

.hild-year-label {
  font-family: var(--sans);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
  display: block;
}

/* ── Eintrag ── */
.hild-entry {
  display: grid;
  grid-template-columns: 48px 1fr;
  column-gap: 0.6rem;
  margin-bottom: 0.3rem;
  line-height: 1.35;
  align-items: center;
}

.hild-entry-month {
  font-family: var(--sans);
  font-size: 0.55rem;
  color: var(--muted);
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hild-entry-month.no-date { 
  color: var(--rule); 
}

.hild-entry-title {
  font-size: 1rem;
  font-weight: 400;
  padding: 0.04rem 0;
  margin: 0;
}

.hild-entry-title a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.1s, border-color 0.1s;
}

.hild-entry-title a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hild-spoken .hild-entry-title {
  font-family: var(--sans);
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

/* Hover-Excerpt */
.hild-entry-title a::after {
  content: attr(data-excerpt);
  display: block;
  max-height: 0;
  overflow: hidden;
  font-size: 0.7rem;
  color: var(--muted);
  font-family: inherit;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  border-bottom: none;
  transition: max-height 0.25s ease, opacity 0.25s ease;
  opacity: 0;
  padding-top: 5px;
  width: 80%;
}

.hild-entry-title a:hover::after {
  max-height: 3.5rem;
  opacity: 1;
}

/* ── Einzelartikel ── */
.hild-article { max-width: 66ch; }

.hild-article-meta {
  font-family: var(--sans);
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.hild-article h1.entry-title {
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.hild-article .entry-content { 
  font-size: 1rem; line-height: 1.75; 
}

.hild-article .entry-content p { 
  margin-bottom: 1.2em; 
}

.hild-article .entry-content a { 
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.hild-article .entry-content a:hover { 
  border-bottom-color: var(--accent); 
}

.hild-article.is-spoken h1.entry-title,
.hild-article.is-spoken .entry-content {
  font-family: var(--sans);
}

.hild-back {
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: inline-block;
  margin-bottom: 2rem;
}

.hild-back:hover { 
  color: var(--accent); 
}

/* ── Admin-Bar ── */
.admin-bar .hild-sidebar { 
  top: 32px; height: calc(100vh - 32px); 
}

/* ── Tablet ── */
@media (max-width: 1024px) and (min-width: 768px) {
  body { font-size: 17px; }
  .hild-sidebar { width: 150px; padding: 2.5rem 1.2rem 2rem; }
  .hild-nav-groups { margin-top: 4.5rem; }
  .hild-main { padding: 2.5rem 1.8rem 3rem; }
  .hild-entry-title { font-size: 0.95rem; }
  .hild-spoken .hild-entry-title { font-size: 0.87rem; }
}

/* ── Mobil ── */
@media (max-width: 767px) {
  body { font-size: 16px; }
  .hild-wrap { flex-direction: column; }
  .hild-sidebar {
    width: 100%; height: auto; position: static;
    padding: 1.2rem 1rem 0.8rem;
    border-bottom: 1px solid var(--rule);
    display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; align-items: baseline;
  }
  .hild-tagline { display: none; }
  .hild-nav-groups { margin-top: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; }
  .hild-sidebar .widget-title { display: none; }
  .hild-sidebar .widget ul { display: flex; flex-wrap: wrap; gap: 0.15rem 0.7rem; }
  .hild-main { padding: 1.5rem 1rem 2.5rem; min-height: 0; }
  .hild-intro { margin-top: 0; }
  .hild-streams { grid-template-columns: 1fr; gap: 1.5rem 0; }
  .hild-stream-written { padding-right: 0; }
  .hild-stream-spoken  { padding-left: 0; }
}
