/*
Theme Name: Klartext Ratgeber
Theme URI: https://example.com/klartext-ratgeber
Author: Klartext Studio
Author URI: https://example.com
Description: A polished, fast WordPress theme for articles, news, insights, and practical tutorials.
Version: 1.0.17
Requires at least: 6.2
Tested up to: 6.6
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: klartext-ratgeber
Tags: blog, education, news, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
  --ink: #152238;
  --muted: #607086;
  --line: #dfe5ec;
  --paper: #ffffff;
  --wash: #f4f7fa;
  --navy: #17365d;
  --navy-dark: #0f2847;
  --accent: #e36d46;
  --accent-soft: #fff0e9;
  --link: #0867c5;
  --link-hover: #c94f2d;
  --success: #26725a;
  --max: 1180px;
  --reading: 760px;
  --radius: 14px;
  --shadow: 0 12px 35px rgba(21, 34, 56, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent); }
.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; }
.skip-link:focus { position: fixed; z-index: 9999; top: 10px; left: 10px; width: auto; height: auto; padding: 10px 14px; margin: 0; clip: auto; background: var(--paper); }

.site-header { position: sticky; z-index: 100; top: 0; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.header-inner { position: relative; max-width: var(--max); min-height: 76px; margin: auto; padding: 0 24px; display: flex; align-items: center; gap: 32px; }
.site-branding { margin-right: auto; display: flex; align-items: center; gap: 12px; }
.custom-logo { max-height: 42px; width: auto; }
.site-title { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.site-title a { color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; color: #fff; background: var(--navy); font: 700 20px/1 Georgia, serif; }
.main-nav ul { display: flex; align-items: center; gap: 26px; padding: 0; margin: 0; list-style: none; }
.main-nav a { color: var(--ink); font-size: .92rem; font-weight: 650; text-decoration: none; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--accent); }
.header-search { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: #fff; cursor: pointer; transition: color .2s ease, border-color .2s ease, background .2s ease; }
.header-search:hover, .header-search[aria-expanded="true"] { color: #fff; border-color: var(--navy); background: var(--navy); }
.header-search-panel { position: absolute; z-index: 20; top: calc(100% + 12px); right: 24px; width: min(470px, calc(100vw - 40px)); padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 18px 45px rgba(21,34,56,.16); }
.header-search-panel[hidden] { display: none; }
.header-search-panel form { display: flex; gap: 8px; }
.header-search-panel label { flex: 1; }
.header-search-panel input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid #cbd5df; border-radius: 8px; color: var(--ink); background: #fff; font: inherit; font-size: .9rem; outline: 0; }
.header-search-panel input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(23,54,93,.1); }
.header-search-panel button { min-width: 96px; padding: 0 18px; border: 0; border-radius: 8px; color: #fff; background: var(--navy); font: 700 .84rem/1 Inter, sans-serif; cursor: pointer; }
.header-search-panel button:hover { background: var(--navy-dark); }
.menu-toggle { display: none; padding: 10px; border: 0; background: transparent; color: var(--ink); font: inherit; }

.hero { background: var(--wash); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-inner { position: relative; max-width: var(--max); margin: auto; padding: 82px 24px 76px; }
.hero-inner::after { content: ""; position: absolute; right: -100px; top: -170px; width: 430px; height: 430px; border: 90px solid rgba(23,54,93,.045); border-radius: 50%; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { max-width: 780px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.55rem, 6vw, 4.9rem); line-height: 1.02; letter-spacing: -.045em; }
.hero-copy { max-width: 670px; margin: 24px 0 30px; color: var(--muted); font-size: 1.15rem; }
.hero-search { position: relative; z-index: 1; display: flex; max-width: 650px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.hero-search label { flex: 1; }
.hero-search input { width: 100%; height: 50px; padding: 0 16px; border: 0; outline: 0; background: transparent; font: inherit; }
.hero-search button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 0; border-radius: 9px; color: #fff; background: var(--navy); font: 700 .92rem/1 Inter, sans-serif; text-decoration: none; cursor: pointer; }
.hero-search button:hover, .button:hover { color: #fff; background: var(--navy-dark); }

.container { max-width: var(--max); margin: auto; padding: 64px 24px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-head h2, .archive-title { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.9rem, 4vw, 2.65rem); line-height: 1.12; letter-spacing: -.03em; }
.section-head a { font-size: .88rem; font-weight: 700; text-decoration: none; }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 68px; }
.category-card { min-height: 132px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: #fff; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.category-card:hover { transform: translateY(-3px); color: var(--ink); border-color: #c9d3df; box-shadow: var(--shadow); }
.category-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 18px; border-radius: 8px; color: var(--navy); background: #e8eef5; font-weight: 800; }
.category-card strong { display: block; font-family: Georgia, serif; font-size: 1.1rem; }
.category-card span { color: var(--muted); font-size: .82rem; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.post-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: transform .2s ease, box-shadow .2s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card-image { display: block; aspect-ratio: 16/10; overflow: hidden; background: #e9eef3; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post-card:hover img { transform: scale(1.025); }
.post-card-content { padding: 23px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-bottom: 11px; color: var(--muted); font-size: .75rem; font-weight: 650; }
.post-meta .category { color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }
.post-card h2, .post-card h3 { margin: 0 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 1.38rem; line-height: 1.23; letter-spacing: -.015em; }
.post-card h2 a, .post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--navy); }
.post-card p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.58; }
.placeholder-image { width: 100%; height: 100%; background: linear-gradient(135deg, #d9e3ec, #f2f5f8); }

.single { background: #f1f4f7; }
.single .site-header { background: rgba(255,255,255,.97); }
.single main.container { max-width: 1060px; padding: 46px 42px 64px; margin-top: 34px; margin-bottom: 72px; border: 1px solid #e2e7ed; border-radius: 18px; background: #fff; box-shadow: 0 18px 50px rgba(21,34,56,.07); }
.article-shell { width: 100%; max-width: 976px; margin: 0 auto; }
.article-header { width: 100%; max-width: 820px; margin: 0 auto 28px; }
.breadcrumbs { margin-bottom: 18px; color: var(--muted); font-size: .76rem; font-weight: 550; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.single .article-header .eyebrow { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; margin-bottom: 14px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: .68rem; letter-spacing: .1em; }
.entry-title { max-width: 820px; margin: 0 0 18px; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: clamp(2.25rem, 4.7vw, 3.55rem); font-weight: 780; line-height: 1.08; letter-spacing: -.045em; }
.entry-lead { max-width: 760px; margin: 0 0 26px; color: var(--muted); font-size: 1.16rem; line-height: 1.65; }
.author-row { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: .78rem; font-weight: 550; }
.author-row .avatar { width: 38px; height: 38px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.author-row .comments-jump { color: var(--navy); font-weight: 700; text-decoration: none; }
.author-row .comments-jump:hover { color: var(--accent); text-decoration: underline; }
.featured-image { width: 100%; margin: 0 0 40px; overflow: hidden; border-radius: 16px; box-shadow: 0 16px 40px rgba(21, 34, 56, .09); }
.featured-image img { width: 100%; }
.entry-content { width: 100%; max-width: 760px; margin-right: auto; margin-left: auto; font-family: Arial, Helvetica, sans-serif; font-size: 1.08rem; line-height: 1.72; letter-spacing: 0; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2, .entry-content h3, .entry-content h4 { scroll-margin-top: 105px; color: var(--ink); font-family: Inter, sans-serif; line-height: 1.25; letter-spacing: -.025em; }
.entry-content h2 { margin: 2.35em 0 .7em; font-size: 1.85rem; font-weight: 760; }
.entry-content h3 { margin: 1.9em 0 .6em; font-size: 1.35rem; font-weight: 740; }
.entry-content p, .entry-content ul, .entry-content ol { margin: 0 0 1.35em; }
.entry-content a:not(.wp-block-button__link) { color: var(--link); font-weight: 650; text-decoration-color: rgba(8,103,197,.42); text-decoration-thickness: 1.5px; text-underline-offset: .18em; }
.entry-content a:not(.wp-block-button__link):hover { color: var(--link-hover); text-decoration-color: currentColor; }
.entry-content a[target="_blank"]:not(.wp-block-button__link):not(:has(img))::after { content: "↗"; display: inline-block; margin-left: .24em; font-family: Arial, Helvetica, sans-serif; font-size: .78em; font-weight: 700; line-height: 1; text-decoration: none; vertical-align: .18em; }
.entry-content .alignwide,
.entry-content .alignfull,
.entry-content .wide-block { width: calc(100% + 216px); max-width: 976px; margin-right: 0; margin-left: -108px; transform: none; }
.entry-content .wp-block-group.alignwide,
.entry-content .wp-block-group.alignfull,
.entry-content .wide-block { padding: 28px 32px; border-radius: 14px; }
.entry-content .wide-block > *,
.entry-content .wp-block-group.alignwide > *,
.entry-content .wp-block-group.alignfull > * { width: 100%; max-width: none !important; margin-right: 0; margin-left: 0; }
.entry-content blockquote { margin: 2em 0; padding: 20px 26px; border-left: 4px solid var(--accent); background: var(--accent-soft); font-size: 1.12rem; }
.entry-content .wp-block-image img { border-radius: 10px; }
.entry-content .wp-block-table { overflow-x: auto; margin: 2em 0; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 8px 24px rgba(21, 34, 56, .04); -webkit-overflow-scrolling: touch; }
.entry-content > table { display: block; max-width: 100%; overflow-x: auto; margin: 2em 0; border: 1px solid #dbe5ee; border-radius: 12px; background: #fff; -webkit-overflow-scrolling: touch; }
.entry-content table { width: 100%; min-width: 620px; border: 1px solid #bdcad6; border-radius: 11px; border-spacing: 0; border-collapse: separate; overflow: hidden; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 1rem; line-height: 1.55; }
.entry-content table th, .entry-content table td { padding: 15px 17px; border: 0; border-right: 1px solid #dbe5ee; border-bottom: 1px solid #dbe5ee; text-align: left; vertical-align: middle; }
.entry-content table th:last-child, .entry-content table td:last-child { border-right: 0; }
.entry-content table tr:last-child td { border-bottom: 0; }
.entry-content table thead th { color: var(--navy-dark); border-color: #d4e0eb; background: #eaf2f8; font-size: .96rem; font-weight: 750; letter-spacing: 0; text-transform: none; }
.entry-content table thead th:first-child { border-radius: 11px 0 0 0; }
.entry-content table thead th:last-child { border-radius: 0 11px 0 0; }
.entry-content table tbody td { background: #fff; }
.entry-content .wp-block-table figcaption { padding: 10px 14px; margin: 0; border-top: 1px solid var(--line); color: var(--muted); background: #fff; font-size: .76rem; text-align: left; }
.entry-content .wp-block-group.has-background { padding: 24px; border-radius: 12px; }
.entry-content code { padding: .15em .35em; border-radius: 4px; background: #edf1f5; font-size: .88em; }
.entry-content pre { overflow-x: auto; padding: 20px; border-radius: 10px; color: #e8edf2; background: #152238; }
.entry-content pre code { padding: 0; background: none; }
.wp-block-button__link { border-radius: 8px; background: var(--navy); }
.step-list { counter-reset: steps; padding: 0; list-style: none; }
.step-list li { position: relative; min-height: 52px; padding: 0 0 26px 66px; counter-increment: steps; }
.step-list li::before { content: counter(steps); position: absolute; left: 0; top: -4px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; background: var(--navy); font: 700 1rem/1 Inter, sans-serif; }
.article-footer { width: 100%; max-width: 820px; padding-top: 26px; margin: 48px auto 0; border-top: 1px solid var(--line); }
.tag-list a { display: inline-block; padding: 5px 10px; margin: 0 5px 6px 0; border-radius: 5px; color: var(--muted); background: var(--wash); font-size: .78rem; text-decoration: none; }

.search-form { display: flex; }
.search-form label { flex: 1; }
.search-field { width: 100%; height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px 0 0 7px; font: inherit; font-size: .86rem; }
.search-submit { padding: 0 14px; border: 0; border-radius: 0 7px 7px 0; color: #fff; background: var(--navy); cursor: pointer; }

.archive-header { padding: 62px 0 34px; border-bottom: 1px solid var(--line); }
.archive-description { max-width: 680px; margin-top: 12px; color: var(--muted); }
.pagination { margin-top: 42px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; text-decoration: none; }
.page-numbers.current { color: #fff; border-color: var(--navy); background: var(--navy); }
.empty-state { max-width: 680px; padding: 72px 0; }
.comments-area { width: 100%; max-width: 820px; margin: 58px auto 0; padding: 30px; border: 1px solid var(--line); border-radius: 14px; background: var(--wash); }
.comments-area > h2, .comment-reply-title { margin: 0 0 8px; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 1.45rem; line-height: 1.3; letter-spacing: -.025em; }
.comment-form { margin-top: 22px; }
.comment-form p { margin: 0 0 17px; }
.comment-form .logged-in-as, .comment-notes { color: var(--muted); font-size: .82rem; }
.comment-form label { display: block; margin-bottom: 7px; color: var(--ink); font-size: .82rem; font-weight: 700; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { display: block; width: 100%; padding: 12px 14px; border: 1px solid #cbd5df; border-radius: 8px; color: var(--ink); background: #fff; font: inherit; font-size: .94rem; transition: border-color .2s ease, box-shadow .2s ease; }
.comment-form textarea { min-height: 160px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--navy); outline: 0; box-shadow: 0 0 0 3px rgba(23,54,93,.1); }
.comment-form .submit { min-height: 46px; padding: 0 20px; border: 0; border-radius: 8px; color: #fff; background: var(--navy); font: 700 .88rem/1 Inter, sans-serif; cursor: pointer; }
.comment-form .submit:hover { background: var(--navy-dark); }
.comment-list { padding: 0; margin: 24px 0; list-style: none; }
.comment-list .comment { padding: 20px; margin-bottom: 14px; border-radius: 10px; background: #fff; }
.comment-list .children { padding-left: 26px; list-style: none; }
.comment-author { display: flex; align-items: center; gap: 10px; }
.comment-author .avatar { border-radius: 50%; }
.comment-metadata { margin: 5px 0 12px 54px; font-size: .74rem; }

.site-footer { position: relative; margin-top: 80px; color: #d8e1eb; background: #0d1c2e; }
.single .site-footer { margin-top: 0; }
.site-footer::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, var(--accent), #f0a15e 42%, var(--navy) 42%); }
.footer-grid { max-width: var(--max); margin: auto; padding: 62px 24px 48px; display: grid; grid-template-columns: minmax(280px, 1.7fr) 1fr 1fr; gap: 72px; }
.footer-brand-row { display: flex; align-items: center; gap: 11px; margin-bottom: 17px; }
.footer-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; color: var(--navy); background: #fff; font: 700 20px/1 Georgia, serif; }
.footer-brand { color: #fff; font-family: Inter, ui-sans-serif, sans-serif; font-size: 1.2rem; font-weight: 750; letter-spacing: -.02em; }
.footer-copy { max-width: 440px; margin: 0; color: #9fb0c3; font-size: .86rem; line-height: 1.7; }
.footer-promise { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.footer-promise span { padding: 5px 9px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; color: #c6d1dc; font-size: .7rem; }
.footer-title { margin: 7px 0 17px; color: #fff; font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; }
.site-footer ul, .footer-nav { padding: 0; margin: 0; list-style: none; }
.site-footer li, .footer-nav li { margin: 0; padding: 7px 0; border: 0; }
.site-footer a, .footer-nav a { color: #b8c5d3; font-size: .84rem; text-decoration: none; transition: color .2s ease; }
.site-footer a:hover, .footer-nav a:hover { color: #fff; }
.footer-bottom { max-width: var(--max); margin: auto; padding: 22px 24px; border-top: 1px solid rgba(255,255,255,.09); color: #7f91a5; font-size: .73rem; }
.reading-progress { position: fixed; z-index: 200; top: 0; left: 0; width: 0; height: 3px; background: var(--accent); }

@media (max-width: 960px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .menu-toggle { display: block; }
  .main-nav { position: absolute; top: 76px; left: 0; right: 0; display: none; padding: 18px 24px 25px; border-bottom: 1px solid var(--line); background: #fff; }
  .main-nav.is-open { display: block; }
  .main-nav ul { align-items: stretch; flex-direction: column; gap: 0; }
  .main-nav li { padding: 10px 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .header-inner { min-height: 66px; padding: 0 18px; gap: 8px; }
  .main-nav { top: 66px; }
  .site-title { font-size: 1.2rem; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .header-search { width: 38px; height: 38px; }
  .header-search-panel { right: 18px; }
  .hero-inner { padding: 56px 20px 52px; }
  .hero-search { display: block; }
  .hero-search button { width: 100%; }
  .container { padding: 46px 20px; }
  .category-grid, .post-grid, .footer-grid { grid-template-columns: 1fr; }
  .category-grid { margin-bottom: 52px; }
  .section-head { align-items: start; flex-direction: column; }
  .footer-grid { gap: 32px; padding: 46px 20px 34px; }
  .article-shell { max-width: 100%; }
  .single main.container { width: calc(100% - 24px); padding: 30px 18px 44px; margin-top: 12px; margin-bottom: 36px; border-radius: 12px; }
  .entry-content .alignwide,
  .entry-content .alignfull,
  .entry-content .wide-block { width: 100%; max-width: 100%; margin-right: 0; margin-left: 0; transform: none; }
  .entry-content .wp-block-group.alignwide,
  .entry-content .wp-block-group.alignfull,
  .entry-content .wide-block { padding: 22px 18px; }
  .entry-title { font-size: 2.35rem; }
  .author-row { align-items: flex-start; }
  .comments-area { padding: 22px 18px; }
}

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