/*
Theme Name: Hausjournal Pro
Theme URI: https://example.com/hausjournal-pro
Author: Hausjournal
Description: Professionelles, schnelles WordPress Block-Theme für Haus-, Wohn-, Renovierungs-, Energie-, Garten- und Haustechnik-Ratgeber. Ohne externe Frontend-Bibliotheken.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 8.1
Version: 1.0.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hausjournal-ratgeber
Domain Path: /languages
Update URI: false
Tags: blog, news, block-patterns, block-styles, editor-style, full-site-editing, wide-blocks, translation-ready
*/

:root {
  --hj-radius-sm: 10px;
  --hj-radius: 16px;
  --hj-radius-lg: 24px;
  --hj-shadow: 0 18px 50px rgba(18, 31, 24, .08);
  --hj-shadow-hover: 0 22px 55px rgba(18, 31, 24, .14);
  --hj-transition: 180ms ease;
}

html { scroll-behavior: smooth; }
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img { height: auto; }
a { text-underline-offset: .18em; text-decoration-thickness: .08em; }

:where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid #d3a35b;
  outline-offset: 3px;
}

.wp-site-blocks { overflow: clip; }
.hj-shell { position: relative; }
.hj-topbar { font-size: .78rem; }
.hj-header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); }
.admin-bar .hj-header { top: 32px; }
.hj-header .wp-block-site-title a { text-decoration: none; }
.hj-header .wp-block-navigation-item__content { text-decoration: none; }
.hj-header .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--forest); }

.hj-section-title { display: flex; align-items: center; gap: .7rem; }
.hj-section-title::before { content: ""; width: 4px; height: 1.25em; border-radius: 99px; background: var(--wp--preset--color--forest); }
.hj-eyebrow { letter-spacing: .085em; text-transform: uppercase; font-weight: 750; }
.hj-meta { color: var(--wp--preset--color--muted); font-size: .86rem; }

.hj-card {
  height: 100%; overflow: hidden; background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--line); border-radius: var(--hj-radius);
  transition: transform var(--hj-transition), box-shadow var(--hj-transition), border-color var(--hj-transition);
}
.hj-card:hover { transform: translateY(-3px); box-shadow: var(--hj-shadow-hover); border-color: #c8d1cb; }
.hj-card .wp-block-post-featured-image { margin: 0; overflow: hidden; }
.hj-card .wp-block-post-featured-image img { aspect-ratio: 16/10; object-fit: cover; transition: transform 350ms ease; }
.hj-card:hover .wp-block-post-featured-image img { transform: scale(1.025); }
.hj-card-body { padding: 1.15rem 1.2rem 1.25rem; }
.hj-card .wp-block-post-title a { text-decoration: none; }

.hj-hero-grid { align-items: stretch; }
.hj-hero-main { min-height: 500px; position: relative; overflow: hidden; border-radius: var(--hj-radius); }
.hj-hero-main .wp-block-post-featured-image, .hj-hero-main .wp-block-post-featured-image a { height: 100%; min-height: 500px; display: block; }
.hj-hero-main .wp-block-post-featured-image img { width: 100%; height: 100%; min-height: 500px; object-fit: cover; }
.hj-hero-overlay { position: absolute; inset: auto 0 0; padding: clamp(1.4rem, 3vw, 2.8rem); color: white; background: linear-gradient(180deg, transparent 0%, rgba(7,17,11,.78) 68%, rgba(7,17,11,.94) 100%); }
.hj-hero-overlay a { color: inherit; }
.hj-hero-overlay .wp-block-post-title a { text-decoration: none; }
.hj-hero-overlay .wp-block-post-title { max-width: 760px; margin-bottom: 1.15rem; }
.hj-hero-button { display: inline-flex; width: fit-content; padding: .72rem 1rem; border-radius: 8px; background: #fff; color: var(--wp--preset--color--forest) !important; font-weight: 750; text-decoration: none !important; }
.hj-hero-button:hover { background: var(--wp--preset--color--mist); }
.hj-hero-side .wp-block-post-template { display: grid; gap: 1rem; }
.hj-side-story { min-height: 154px; position: relative; overflow: hidden; border-radius: var(--hj-radius-sm); }
.hj-side-story .wp-block-post-featured-image, .hj-side-story .wp-block-post-featured-image a { height: 100%; min-height: 154px; display: block; }
.hj-side-story img { width: 100%; height: 100%; min-height: 154px; object-fit: cover; }
.hj-side-story-content { position:absolute; inset:0; display:flex; flex-direction:column; justify-content:flex-end; padding:1.1rem 1.2rem; color:#fff; background:linear-gradient(90deg,rgba(9,18,12,.82),rgba(9,18,12,.18)); }
.hj-side-story-content a { color: inherit; text-decoration: none; }

.hj-topic { min-height: 105px; border: 1px solid var(--wp--preset--color--line); border-radius: var(--hj-radius-sm); background: var(--wp--preset--color--surface); transition: border-color var(--hj-transition), transform var(--hj-transition); }
.hj-topic:hover { transform: translateY(-2px); border-color: var(--wp--preset--color--sage); }
.hj-topic a { text-decoration: none; }
.hj-topic-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--wp--preset--color--mist); font-size: 1.3rem; }

.hj-value-band { position: relative; overflow: hidden; border-radius: var(--hj-radius-lg); background: linear-gradient(130deg,#102219,#1f4934); color:#fff; }
.hj-value-band::after { content:""; position:absolute; width:360px; height:360px; right:-100px; top:-180px; border-radius:50%; background:rgba(255,255,255,.05); }
.hj-value-card { border-left: 1px solid rgba(255,255,255,.16); padding-left: 1.4rem; }

.hj-prose > * { max-width: 760px; margin-inline: auto; }
.hj-prose > .alignwide { max-width: var(--wp--style--global--wide-size); }
.hj-prose > .alignfull { max-width: none; }
.hj-prose p, .hj-prose li { font-size: clamp(1.02rem,.98rem + .16vw,1.12rem); }
.hj-prose h2 { margin-top: 2.6em; }
.hj-prose h3 { margin-top: 2em; }
.hj-prose :where(img, figure) { border-radius: var(--hj-radius-sm); }
.hj-author { border:1px solid var(--wp--preset--color--line); border-radius:var(--hj-radius); }

.hj-footer a { color: inherit; text-decoration: none; }
.hj-footer a:hover { text-decoration: underline; }

.wp-block-query-pagination { gap: .5rem; }
.wp-block-query-pagination a, .wp-block-query-pagination .current {
  border: 1px solid var(--wp--preset--color--line); border-radius: 999px; min-width: 2.6rem;
  padding: .65rem .9rem; text-align: center; text-decoration: none;
}

@media (max-width: 900px) {
  .hj-topbar { display:none; }
  .hj-hero-main, .hj-hero-main .wp-block-post-featured-image, .hj-hero-main .wp-block-post-featured-image a, .hj-hero-main .wp-block-post-featured-image img { min-height: 420px; }
}
@media (max-width: 781px) {
  .admin-bar .hj-header { top:46px; }
  .wp-block-navigation__responsive-container.is-menu-open { padding: 1.5rem; }
  .hj-hero-main, .hj-hero-main .wp-block-post-featured-image, .hj-hero-main .wp-block-post-featured-image a, .hj-hero-main .wp-block-post-featured-image img { min-height: 380px; }
  .hj-value-card { border-left:0; border-top:1px solid rgba(255,255,255,.16); padding:1rem 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior:auto; }
  *, *::before, *::after { transition-duration:.01ms !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; }
}

/* Article template refinements — v1.0.1 */
.hj-article-page {
  padding-top: clamp(2.5rem, 5vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 6rem);
}
.hj-article-header {
  max-width: 820px;
  margin: 0 0 1.75rem;
}
.hj-article-header .wp-block-post-terms { margin-bottom: .85rem; }
.hj-article-header .wp-block-post-terms a { text-decoration: none; }
.hj-article-title {
  max-width: 820px;
  margin: 0;
  font-size: clamp(1.9rem, 1.45rem + 1.35vw, 2.85rem) !important;
  line-height: 1.08;
  letter-spacing: -.035em;
}
.hj-article-intro {
  max-width: 780px;
  margin: 1.1rem 0 0;
  font-size: clamp(1.05rem, 1rem + .25vw, 1.22rem) !important;
  line-height: 1.65;
}
.hj-article-intro p {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
.hj-article-featured {
  margin-top: 0 !important;
  margin-bottom: clamp(2rem, 4vw, 3.5rem) !important;
  overflow: hidden;
  border-radius: var(--hj-radius);
}
.hj-article-featured img {
  width: 100%;
  max-height: 680px;
  object-fit: cover;
}
.hj-article-layout {
  gap: clamp(2.25rem, 4vw, 4rem);
  align-items: flex-start;
}
.hj-article-main { min-width: 0; }
.hj-prose > * {
  max-width: 780px;
  margin-left: 0;
  margin-right: auto;
}
.hj-prose > :first-child { margin-top: 0; }
.hj-prose p,
.hj-prose li {
  font-size: clamp(1.02rem, .98rem + .12vw, 1.1rem);
  line-height: 1.78;
}
.hj-prose h2 {
  font-size: clamp(1.55rem, 1.35rem + .65vw, 2.05rem);
  margin-top: 2.3em;
  scroll-margin-top: 120px;
}
.hj-prose h3 {
  font-size: clamp(1.25rem, 1.15rem + .4vw, 1.55rem);
  margin-top: 1.9em;
  scroll-margin-top: 120px;
}
.hj-article-sidebar {
  position: sticky;
  top: 110px;
  display: grid;
  gap: 1.25rem;
}
.hj-sidebar-card,
.hj-toc {
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: var(--hj-radius);
  padding: 1.4rem;
}
.hj-sidebar-title,
.hj-toc-title {
  margin: 0 0 1rem;
  color: var(--wp--preset--color--forest);
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.hj-toc-list {
  margin: 0;
  padding-left: 1.25rem;
}
.hj-toc-list li + li { margin-top: .72rem; }
.hj-toc-list a {
  color: var(--wp--preset--color--ink);
  text-decoration: none;
  font-size: .94rem;
  line-height: 1.4;
}
.hj-toc-list a:hover { color: var(--wp--preset--color--forest); }
.hj-toc-item-h3 { margin-left: .85rem; }
.hj-sidebar-query .wp-block-post-template { display: grid; gap: 1rem; }
.hj-sidebar-story {
  gap: .85rem;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--wp--preset--color--line);
}
.hj-sidebar-story:first-child { padding-top: 0; border-top: 0; }
.hj-sidebar-story .wp-block-post-featured-image {
  flex: 0 0 84px;
  margin: 0;
}
.hj-sidebar-story .wp-block-post-featured-image img {
  width: 84px;
  height: 64px;
  object-fit: cover;
}
.hj-sidebar-story .wp-block-post-title { margin: 0; line-height: 1.35; }
.hj-sidebar-story .wp-block-post-title a { color: inherit; text-decoration: none; }
.hj-article-end { margin-top: 3rem; }
.hj-article-tags { color: var(--wp--preset--color--muted); }

@media (max-width: 900px) {
  .hj-article-title { font-size: clamp(1.9rem, 6vw, 2.75rem) !important; }
  .hj-article-layout { display: block; }
  .hj-article-sidebar { position: static; margin-top: 3rem; }
}
@media (max-width: 600px) {
  .hj-article-page { padding-top: 2rem; }
  .hj-article-title { font-size: clamp(1.8rem, 9vw, 2.35rem) !important; }
  .hj-article-intro { font-size: 1.02rem !important; }
  .hj-article-featured { border-radius: 10px; }
  .hj-sidebar-card, .hj-toc { padding: 1.15rem; }
}


/* Layout hardening — v1.0.2 */
.hj-article-layout-top > .wp-block-column { min-width: 0; }
.hj-article-header, .hj-article-intro, .hj-prose { overflow-wrap: anywhere; }
.hj-article-sidebar { align-self: flex-start; }
.hj-article-sidebar .wp-block-shortcode { margin: 0; }
.hj-hero-overlay .wp-block-post-excerpt { display: none !important; }
@media (max-width: 900px) {
  .hj-article-layout-top { display: block; }
}
