/*
Theme Name: Tech & Tacheles
Theme URI: https://blog.kuhn.or.at/
Author: kuhn.or.at
Author URI: https://kuhn.or.at/
Description: Helles, sachliches Magazin-Theme mit Monospace-Akzenten – entwickelt für KI-, Security- und Crypto-Themen. Featured-Aufmacher, Beitragsliste mit Thumbnails, farbcodierte Kategorien und eine Sidebar mit Suche, Kategorien und neuesten Beiträgen.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tech-tacheles
Tags: blog, news, two-columns, right-sidebar, custom-menu, featured-images, translation-ready
*/

/* ============================================================
   1. Tokens
   ============================================================ */
:root {
  --bg:        #ffffff;
  --bg-soft:   #f4f5f7;
  --bg-page:   #eceef0;
  --ink:       #15181c;
  --ink-2:     #2f3742;
  --ink-3:     #515a65;
  --muted:     #6b7480;
  --muted-2:   #8a93a0;
  --line:      #e6e8eb;
  --line-soft: #f0f1f3;
  --accent:    #1f5fd6;
  --dark:      #13161a;

  --cat-cybersecurity:          #d6453f;
  --cat-kunstliche-intelligenz: #7c5cff;
  --cat-tech-news:              #1f5fd6;
  --cat-crypto:                 #c98a16;

  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --maxw: 1200px;
  --radius: 12px;
}

/* ============================================================
   2. Reset / base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
::selection { background: #cfe0ff; }
h1, h2, h3, h4 { letter-spacing: -.015em; }

.ttx-skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; z-index: 999;
  font-family: var(--mono); font-size: 13px; border-radius: 0 0 6px 0;
}
.ttx-skip-link:focus { left: 0; color: #fff; }

.ttx-container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

/* ============================================================
   3. Header
   ============================================================ */
.ttx-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.ttx-header__bar {
  display: flex; align-items: center; gap: 30px;
  padding-top: 26px; padding-bottom: 26px;
}
.ttx-brand { display: flex; flex-direction: column; gap: 5px; line-height: 1; }
.ttx-brand__title {
  font-size: 25px; font-weight: 700; letter-spacing: -.02em;
  display: inline-flex; align-items: center; gap: 2px; color: var(--ink);
}
.ttx-brand__amp { color: var(--accent); font-family: var(--mono); font-weight: 500; }
.ttx-brand__tag {
  font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .005em;
}
.ttx-brand img.custom-logo { max-height: 52px; width: auto; }

.ttx-search { margin-left: auto; width: 230px; }
.ttx-search__form {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 13px; width: 100%;
}
.ttx-search__form svg { flex: none; }
.ttx-search__form input[type="search"],
.ttx-search__form input.search-field {
  border: none; background: transparent; outline: none;
  font-family: var(--sans); font-size: 13.5px; color: var(--ink); width: 100%;
}
.ttx-search__form button { display: none; }

/* category nav */
.ttx-nav { border-top: 1px solid var(--line-soft); }
.ttx-nav__inner { display: flex; align-items: stretch; flex-wrap: wrap; }
.ttx-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.ttx-nav li { display: flex; }
.ttx-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 16px; margin-bottom: -1px;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  border-bottom: 2px solid transparent;
}
.ttx-nav a:hover { color: var(--ink); }
.ttx-nav .current-menu-item > a,
.ttx-nav .current_page_item > a,
.ttx-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.ttx-nav__home { padding-left: 0 !important; }
.ttx-nav__dot {
  width: 8px; height: 8px; border-radius: 2px; flex: none;
  display: inline-block; background: var(--tag, var(--accent));
}

/* ============================================================
   4. Layout: content + sidebar
   ============================================================ */
.ttx-main { padding-top: 38px; padding-bottom: 64px; }
.ttx-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  align-items: start;
}
.ttx-content { min-width: 0; }

/* ============================================================
   5. Category tag
   ============================================================ */
.ttx-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--tag, var(--accent));
}
.ttx-tag--chip {
  padding: 5px 10px; border-radius: 5px;
  background: color-mix(in srgb, var(--tag, var(--accent)) 11%, #fff);
}
.ttx-tag__dot {
  width: 7px; height: 7px; border-radius: 2px;
  background: var(--tag, var(--accent)); display: inline-block; flex: none;
}

.ttx-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px;
}
.ttx-meta__date { color: var(--muted-2); }
.ttx-meta__flag {
  margin-left: auto; color: #b7bec7;
  text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px;
}

/* ============================================================
   6. Featured (lead) post
   ============================================================ */
.ttx-featured { margin-bottom: 46px; }
.ttx-featured__thumb {
  display: block; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16 / 8; margin-bottom: 20px; background: var(--bg-page);
}
.ttx-featured__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ttx-featured .ttx-meta { margin-bottom: 13px; }
.ttx-featured__title {
  margin: 0 0 13px; font-size: 30px; line-height: 1.18; font-weight: 700;
  letter-spacing: -.02em; max-width: 24ch;
}
.ttx-featured__title a { color: var(--ink); }
.ttx-featured__excerpt {
  margin: 0 0 18px; font-size: 16px; line-height: 1.62; color: var(--ink-3); max-width: 66ch;
}
.ttx-more {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 500;
}
.ttx-more svg { transition: transform .15s ease; }
.ttx-more:hover svg { transform: translateX(3px); }

/* ============================================================
   7. Section label
   ============================================================ */
.ttx-section-label {
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 4px;
}
.ttx-section-label h2, .ttx-section-label h3 {
  margin: 0; font-family: var(--mono); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .16em; color: var(--muted-2);
}
.ttx-section-label .ttx-rule { flex: 1; height: 1px; background: var(--line); }

/* ============================================================
   8. Post list card
   ============================================================ */
.ttx-card {
  display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 22px;
  padding: 24px 0; border-bottom: 1px solid var(--line-soft); align-items: start;
}
.ttx-card__thumb {
  border-radius: 9px; overflow: hidden; aspect-ratio: 16 / 11;
  background: var(--bg-page); display: block;
}
.ttx-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ttx-card .ttx-meta { margin-bottom: 9px; }
.ttx-card__title {
  margin: 0 0 7px; font-size: 20px; line-height: 1.3; font-weight: 600;
  letter-spacing: -.012em;
}
.ttx-card__title a { color: var(--ink); }
.ttx-card__excerpt {
  margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); max-width: 64ch;
}
.ttx-card--no-thumb { grid-template-columns: minmax(0, 1fr); }

/* ============================================================
   9. Pagination
   ============================================================ */
.ttx-pagination {
  margin-top: 32px; font-family: var(--mono); font-size: 13px;
}
.ttx-pagination .nav-links {
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
}
.ttx-pagination .page-numbers {
  min-width: 34px; height: 34px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; color: var(--ink-2); border: 1px solid transparent;
}
.ttx-pagination .page-numbers:hover { background: var(--bg-soft); }
.ttx-pagination .page-numbers.current { background: var(--dark); color: #fff; }
.ttx-pagination .page-numbers.dots { color: var(--muted-2); }
.ttx-pagination .prev, .ttx-pagination .next { color: var(--accent); }

/* ============================================================
   10. Single post
   ============================================================ */
.ttx-back {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted-2); margin-bottom: 22px;
}
.ttx-article .ttx-meta { margin-bottom: 16px; }
.ttx-article__title {
  margin: 0 0 18px; font-size: 39px; line-height: 1.14; font-weight: 700;
  letter-spacing: -.025em; max-width: 20ch;
}
.ttx-article__lead {
  margin: 0 0 26px; font-size: 18px; line-height: 1.6; color: var(--ink-3); max-width: 60ch;
}
.ttx-article__hero {
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 8;
  margin-bottom: 14px; background: var(--bg-page);
}
.ttx-article__hero img { width: 100%; height: 100%; object-fit: cover; }
.ttx-article__hero-caption,
.ttx-article .wp-caption-text {
  font-family: var(--mono); font-size: 11.5px; color: #a7aeb8; margin-bottom: 30px;
}

/* article body (WordPress content) */
.ttx-prose {
  font-size: 17px; line-height: 1.74; color: var(--ink-2); max-width: 66ch;
}
.ttx-prose > * { margin-top: 0; }
.ttx-prose p { margin: 0 0 22px; }
.ttx-prose h2 {
  margin: 36px 0 14px; font-size: 23px; font-weight: 700; line-height: 1.25; color: var(--ink);
}
.ttx-prose h3 {
  margin: 30px 0 12px; font-size: 19px; font-weight: 700; line-height: 1.3; color: var(--ink);
}
.ttx-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.ttx-prose ul, .ttx-prose ol { margin: 0 0 22px; padding-left: 22px; line-height: 1.7; }
.ttx-prose li { margin-bottom: 7px; }
.ttx-prose img, .ttx-prose figure { border-radius: 10px; margin: 26px 0; }
.ttx-prose figure { max-width: 100%; }
.ttx-prose figcaption { font-family: var(--mono); font-size: 11.5px; color: #a7aeb8; margin-top: 8px; text-align: center; }
.ttx-prose blockquote {
  margin: 0 0 22px; padding: 6px 0 6px 22px;
  border-left: 3px solid var(--accent); color: #41494f; font-style: normal;
}
.ttx-prose code {
  font-family: var(--mono); font-size: .9em;
  background: var(--bg-soft); padding: 2px 6px; border-radius: 4px;
}
.ttx-prose pre {
  font-family: var(--mono); font-size: 13.5px; line-height: 1.6;
  background: var(--dark); color: #e6e8eb; padding: 18px 20px;
  border-radius: 10px; overflow-x: auto; margin: 0 0 22px;
}
.ttx-prose pre code { background: none; padding: 0; color: inherit; }
.ttx-prose hr { border: none; border-top: 1px solid var(--line); margin: 34px 0; }
.ttx-prose table { border-collapse: collapse; width: 100%; margin: 0 0 22px; font-size: 14.5px; }
.ttx-prose th, .ttx-prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.ttx-prose th { background: var(--bg-soft); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

/* "Quellen" heading marker (set by ttx_mark_sources_box) */
.ttx-prose h2.ttx-sources-heading {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line);
  width: 100%;
}
.ttx-prose h2.ttx-sources-heading::before {
  content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--accent);
}
.ttx-prose h2.ttx-sources-heading + ul {
  font-family: var(--mono); font-size: 13.5px; list-style: none; padding-left: 0;
}
.ttx-prose h2.ttx-sources-heading + ul li {
  padding: 11px 0; border-bottom: 1px solid var(--line-soft); margin-bottom: 0;
}
.ttx-prose h2.ttx-sources-heading + ul a { text-decoration: none; }
.ttx-prose h2.ttx-sources-heading + ul a:hover { text-decoration: underline; }

/* tags below content */
.ttx-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.ttx-tags a {
  font-family: var(--mono); font-size: 12px; color: var(--ink-2);
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 11px;
}
.ttx-tags a:hover { border-color: var(--accent); color: var(--accent); }

/* prev / next */
.ttx-postnav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px;
}
.ttx-postnav a {
  border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: block;
}
.ttx-postnav a:hover { border-color: var(--accent); }
.ttx-postnav__label { font-family: var(--mono); font-size: 11px; color: var(--muted-2); margin-bottom: 6px; }
.ttx-postnav__title { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink-2); }
.ttx-postnav__next { text-align: right; }

/* author / comments minimal */
.ttx-comments { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); }
.ttx-comments h2 { font-size: 20px; margin: 0 0 18px; }
.ttx-comments ol.comment-list { list-style: none; margin: 0; padding: 0; }
.ttx-comments .comment-body { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.ttx-comments .comment-author { font-weight: 600; font-size: 14px; }
.ttx-comments .comment-meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); margin-bottom: 6px; }
.ttx-comments .comment-respond input[type="text"],
.ttx-comments .comment-respond input[type="email"],
.ttx-comments .comment-respond input[type="url"],
.ttx-comments .comment-respond textarea {
  width: 100%; max-width: 480px; font-family: var(--sans); font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px;
}
.ttx-comments .comment-respond textarea { display: block; }

/* ============================================================
   11. Quellen box (auto-detected source list in content) — see functions.php
   ============================================================ */
.ttx-sources {
  margin-top: 36px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.ttx-sources__head {
  display: flex; align-items: center; gap: 9px; padding: 13px 18px;
  background: #f7f8fa; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
}

/* ============================================================
   12. Sidebar
   ============================================================ */
.ttx-sidebar {
  display: flex; flex-direction: column; gap: 34px;
  position: sticky; top: 24px;
}
.ttx-widget h2, .ttx-widget h3, .ttx-widget .widget-title, .ttx-widget__title {
  margin: 0 0 15px; font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .14em; color: var(--muted-2);
}
.ttx-widget ul { list-style: none; margin: 0; padding: 0; }
.ttx-widget li { font-size: 14.5px; }

/* sidebar search */
.ttx-widget .search-form,
.ttx-widget__search {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px 13px;
}
.ttx-widget .search-form input.search-field,
.ttx-widget__search input {
  border: none; background: transparent; outline: none;
  font-family: var(--sans); font-size: 13.5px; width: 100%;
}
.ttx-widget .search-form .search-submit { display: none; }

/* categories list */
.ttx-cats a, .ttx-widget_categories li > a, .widget_categories li > a {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--line-soft); font-size: 14.5px; color: var(--ink-2);
}
.ttx-cats__dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: none; background: var(--tag, var(--accent)); }
.ttx-cats__count, .ttx-count { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted-2); }

/* recent posts */
.ttx-recent li { margin-bottom: 15px; }
.ttx-recent a { display: flex; gap: 11px; align-items: start; }
.ttx-recent__num { font-family: var(--mono); font-size: 12px; margin-top: 2px; flex: none; color: var(--tag, var(--accent)); }
.ttx-recent__title { font-size: 13.5px; line-height: 1.4; color: var(--ink-2); font-weight: 500; }
.ttx-recent a:hover .ttx-recent__title { color: var(--accent); }

/* archive list */
.ttx-archive ul, .widget_archive ul { list-style: none; margin: 0; padding: 0; }
.ttx-archive li, .widget_archive li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 12px; color: var(--muted-2);
}
.ttx-archive li:last-child, .widget_archive li:last-child { border-bottom: none; }
.ttx-archive li > a, .widget_archive li > a {
  font-family: var(--sans); font-size: 14px; color: var(--ink-2);
  padding: 0; border: none;
}
.ttx-archive li > a:hover, .widget_archive li > a:hover { color: var(--accent); }

/* generic widget list fallback */
.ttx-widget.widget ul li {
  padding: 9px 0; border-bottom: 1px solid var(--line-soft);
}
.ttx-widget.widget ul li:last-child { border-bottom: none; }

/* RSS button */
.ttx-rss-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--dark); color: #fff; border-radius: 9px; padding: 13px;
  font-family: var(--mono); font-size: 13px; font-weight: 500;
}
.ttx-rss-btn:hover { color: #fff; background: #1d2127; }

/* ============================================================
   13. Page title (archive / search / 404)
   ============================================================ */
.ttx-pagehead { margin-bottom: 30px; }
.ttx-pagehead__kicker {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--muted-2); margin-bottom: 10px;
  display: inline-flex; align-items: center; gap: 8px;
}
.ttx-pagehead__title { margin: 0 0 8px; font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.ttx-pagehead__desc { margin: 0; font-size: 16px; color: var(--ink-3); max-width: 64ch; }

.ttx-empty { padding: 40px 0; color: var(--muted); font-size: 16px; }

/* ============================================================
   14. Footer
   ============================================================ */
.ttx-footer { background: var(--dark); color: #aeb6c0; }
.ttx-footer__top {
  display: flex; flex-wrap: wrap; gap: 40px; align-items: start; justify-content: space-between;
  padding-top: 44px; padding-bottom: 44px;
}
.ttx-footer__brand { max-width: 320px; }
.ttx-footer__brand-title { font-size: 19px; font-weight: 700; color: #fff; letter-spacing: -.02em; margin-bottom: 8px; }
.ttx-footer__brand-title span { color: #4f8cf0; font-family: var(--mono); font-weight: 500; }
.ttx-footer__brand p { margin: 0; font-size: 13.5px; line-height: 1.6; color: #8b94a0; }
.ttx-footer__cols { display: flex; gap: 56px; flex-wrap: wrap; }
.ttx-footer__col-title {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .14em; color: #6f7986; margin-bottom: 14px;
}
.ttx-footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ttx-footer__col a { font-size: 13.5px; color: #aeb6c0; }
.ttx-footer__col a:hover { color: #fff; }
.ttx-footer__col .ttx-cats__dot { margin-right: 9px; }
.ttx-footer__bottom { border-top: 1px solid #23272d; }
.ttx-footer__bottom-inner {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
  font-family: var(--mono); font-size: 11.5px; color: #6f7986;
}
.ttx-footer__bottom-inner a { color: #8b94a0; }

/* ============================================================
   15. WordPress core classes
   ============================================================ */
.alignleft  { float: left; margin: 6px 24px 16px 0; }
.alignright { float: right; margin: 6px 0 16px 24px; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.sticky .ttx-card__title::after,
.sticky .ttx-featured__title::after { content: ''; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.bypostauthor { }

/* ============================================================
   16. Responsive
   ============================================================ */
@media (max-width: 920px) {
  .ttx-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .ttx-sidebar { position: static; }
}
@media (max-width: 640px) {
  .ttx-container { padding-left: 20px; padding-right: 20px; }
  .ttx-header__bar { flex-wrap: wrap; gap: 18px; }
  .ttx-search { margin-left: 0; width: 100%; }
  .ttx-search__form { width: 100%; }
  .ttx-nav__inner { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ttx-nav ul { flex-wrap: nowrap; }
  .ttx-nav a { white-space: nowrap; }
  .ttx-featured__title { font-size: 25px; }
  .ttx-article__title { font-size: 29px; }
  .ttx-card { grid-template-columns: 110px minmax(0, 1fr); gap: 16px; }
  .ttx-postnav { grid-template-columns: 1fr; }
  .ttx-prose { font-size: 16px; }
}
