/*
Theme Name: Touching Ball
Theme URI: https://touchingball.de/
Author: Touching Ball / technische Neubearbeitung
Description: Schlankes klassisches Theme für die Touching-Ball-Website. Bewahrt die Inhaltsstruktur; ohne Alt-Funktionen, Pagebuilder oder Fremdskripte.
Version: 1.3.1
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: touchingball-modern
*/
:root { --tb-red:#a81214; --tb-gold:#d4c75e; --tb-width:1280px; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin:0; background:#0e0e0e url("assets/touchingball/bg.jpg") repeat-x center top; color:#333; font:16px/1.65 Arial,Helvetica,sans-serif; }
a { color:var(--tb-red); text-decoration:none; }
a:hover, a:focus { color:#5b1616; text-decoration:underline; }
#container { width:min(100%,var(--tb-width)); margin:0 auto; background:transparent; min-height:100vh; }
#header { width:100%; background:#fff; }
.brand { text-align:center; min-height:0; }
.brand a { display:block; }
.header-image { display:block; width:100%; height:auto; max-width:var(--tb-width); margin:auto; }
.primary-nav { border-top:3px solid var(--tb-red); border-bottom:2px solid #c5b963; background:#f1efc9 url("assets/touchingball/main_wide.png") repeat-y center top / 100% 27px; }
.primary-nav .menu, .footer-nav .menu { list-style:none; display:flex; flex-wrap:wrap; align-items:center; justify-content:center; margin:0; padding:0; }
.primary-nav .menu>li { position:relative; margin:0; padding:0; }
.primary-nav a { display:block; padding:12px 13px; color:#1c2430; font-size:17px; white-space:normal; }
.primary-nav .current-menu-item>a,.primary-nav .current_page_item>a,.primary-nav a:hover { color:var(--tb-red); }
.primary-nav .sub-menu,.primary-nav .children { display:none; position:absolute; z-index:100; left:0; top:100%; min-width:245px; max-width:320px; background:#f5f1d6; border:1px solid #b5a54d; border-top:3px solid var(--tb-red); box-shadow:0 5px 16px #0003; padding:4px 0; margin:0; list-style:none; }
.primary-nav li:hover>.sub-menu,.primary-nav li:hover>.children,.primary-nav li:focus-within>.sub-menu,.primary-nav li:focus-within>.children { display:block; }
.primary-nav .sub-menu a,.primary-nav .children a { padding:9px 14px; font-size:16px; line-height:1.4; border-bottom:1px solid #ded7af; }
#maincontainer { background:#f1efc9 url("assets/touchingball/main_wide.png") repeat-y center top / 100% 27px; min-height:300px; padding:20px 35px 34px; overflow-wrap:anywhere; }
.entry { min-height:260px; }
.entry img { max-width:100%; height:auto; }
.entry iframe { max-width:100%; }
.entry table { max-width:100%; display:block; overflow-x:auto; }
.post { margin:0 0 28px; }
.entry-title, .archive-header h1 { margin:0 0 20px; }
.site-footer { background:var(--tb-gold) url("assets/touchingball/footer.jpg") repeat; text-align:center; padding:14px 18px; border-top:2px solid #b5a54d; }
.footer-nav a { color:#781413; padding:6px 11px; display:inline-block; font-size:14px; }
.comment-list { padding-left:24px; }
.screen-reader-text { border:0; clip:rect(1px,1px,1px,1px); position:absolute; height:1px; width:1px; overflow:hidden; }
@media(max-width:1280px) {
  body { background-image:none; }
}
@media(max-width:700px) {
  .primary-nav a { padding:10px; font-size:14px; }
  .entry { min-height:0; }
}

/* Native WordPress shortcode galleries (HTML5 and older markup). */
.entry .gallery { display:grid; grid-template-columns:repeat(var(--tb-cols,3),minmax(0,1fr)); --tb-gallery-gap:18px; gap:var(--tb-gallery-gap); margin:24px 0; }
.entry .gallery-columns-1 { --tb-cols:1; }
.entry .gallery-columns-2 { --tb-cols:2; }
.entry .gallery-columns-4 { --tb-cols:4; }
.entry .gallery-columns-5 { --tb-cols:5; }
.entry .gallery-columns-6 { --tb-cols:6; }
.entry .gallery-columns-7 { --tb-cols:7; }
.entry .gallery-columns-8 { --tb-cols:8; }
.entry .gallery-columns-9 { --tb-cols:9; }
.entry .gallery .gallery-item { float:none; width:auto; max-width:none; min-width:0; margin:0; text-align:center; align-self:start; }
.entry .gallery .gallery-icon { margin:0; }
.entry .gallery .gallery-icon a { display:block; }
.entry .gallery img { display:block; width:auto; max-width:100%; height:auto; margin:0 auto; border:0; }
.entry .gallery:not(.gallery-columns-1) img { width:100%; }
.entry .gallery .gallery-caption { margin:6px 0 0; font-size:13px; }
.entry .gallery > br { display:none; }
/* Masonry uses explicit grid positions; without JS the regular grid remains. */
.entry .gallery.tb-masonry { grid-auto-rows:1px; row-gap:0; }

/* Widen the original header without scaling its lettering on desktop. */
.brand-default { background:#fff url("assets/touchingball/header_wide.png") no-repeat center top; }
.brand-default .header-image { width:100%; max-width:970px; }
@media(max-width:970px) { .brand-default { background-image:none; } }

/* Navigation and responsive layout */
.nav-toggle { display:none; }
.primary-nav .menu > li > a { padding:12px 14px; }
.primary-nav .menu-item-has-children > a::after { content:" ▾"; font-size:.8em; }
.primary-nav .sub-menu a:hover,.primary-nav .sub-menu a:focus,.primary-nav .children a:hover,.primary-nav .children a:focus { background:#e9e3b8; }
.primary-nav .menu > li:nth-last-child(-n+2) > .sub-menu { left:auto; right:0; }
.primary-nav .current-menu-ancestor > a { color:var(--tb-red); }
.primary-nav a:focus-visible,.nav-toggle:focus-visible { outline:2px solid #781413; outline-offset:-3px; }
.entry-title,.archive-header h1,.page-content h1,.post h1 { font-size:26px; font-weight:700; line-height:1.3; }
.entry h2 { font-size:21px; line-height:1.35; }
.entry h3 { font-size:18px; line-height:1.4; }
.entry p { margin:0 0 1em; }
.entry figure { max-width:100%; }
@media(max-width:1000px) {
  #maincontainer { padding:20px 24px 30px; }
  .primary-nav .menu { display:block; }
  .primary-nav .menu > li > a { padding:11px 18px; border-bottom:1px solid #d8d2a8; }
  .primary-nav .sub-menu,.primary-nav .children { position:static; display:block; min-width:0; max-width:none; margin:0 12px 6px 24px; border:0; border-left:2px solid #b5a54d; background:transparent; box-shadow:none; }
  .primary-nav .sub-menu a,.primary-nav .children a { padding:8px 14px; }
  .primary-nav .menu-item-has-children > a::after { content:none; }
  .primary-nav.tb-nav-ready .nav-toggle { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; min-height:46px; padding:9px 16px; border:0; background:transparent; color:#1c2430; font:inherit; font-weight:bold; cursor:pointer; }
  .primary-nav.tb-nav-ready:not(.tb-nav-open) .nav-items { display:none; }
  .nav-toggle-icon { font-size:22px; line-height:1; }
  .entry .gallery { --tb-gallery-gap:12px; }
  .entry .gallery:not(.gallery-columns-1):not(.gallery-columns-2) { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:700px) {
  #maincontainer { padding:16px 15px 26px; }
  .primary-nav .menu > li > a { font-size:16px; }
  .entry .gallery:not(.gallery-columns-1):not(.gallery-columns-2) { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .entry-title,.archive-header h1,.page-content h1,.post h1 { font-size:23px; }
  .site-footer { padding:12px 8px; }
}
@media(max-width:360px) { .entry .gallery { grid-template-columns:1fr !important; } }
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } }

/* Contact Form 7: shared, responsive form styling. */
.entry .wpcf7 { width:100%; max-width:640px; }
.entry .wpcf7 :is(.wpcf7-text,.wpcf7-textarea) {
  display:block; width:100%; min-width:0; margin-top:5px;
  padding:10px 12px; min-height:44px; border:1px solid #8b876f;
  border-radius:3px; background:#fff; color:#333; font:inherit;
}
.entry .wpcf7 .wpcf7-textarea { min-height:180px; resize:vertical; }
.entry .wpcf7 .wpcf7-file { display:block; width:100%; min-width:0; max-width:100%; margin-top:5px; font:inherit; color:inherit; }
.entry .wpcf7 .wpcf7-file::file-selector-button {
  min-height:44px; padding:8px 12px; margin-right:8px; border:1px solid #8b876f;
  border-radius:3px; background:#f5f1d6; color:#333; font:inherit; cursor:pointer;
}
.entry .wpcf7 .wpcf7-submit {
  min-height:44px; max-width:100%; padding:10px 22px; border:1px solid var(--tb-red);
  border-radius:3px; background:var(--tb-red); color:#fff; font:inherit; font-weight:700; cursor:pointer;
}
.entry .wpcf7 .wpcf7-submit:hover:not(:disabled) { background:#781413; }
.entry .wpcf7 .wpcf7-submit:disabled { opacity:.65; cursor:default; }
.entry .wpcf7 :is(.wpcf7-text,.wpcf7-textarea,.wpcf7-file,.wpcf7-submit):focus-visible {
  outline:2px solid #781413; outline-offset:2px;
}
.entry .wpcf7 .wpcf7-not-valid { border-color:var(--tb-red); }
.entry .wpcf7 .wpcf7-not-valid-tip { color:#781413; font-size:14px; }
.entry .wpcf7 form .wpcf7-response-output { margin:16px 0 0; padding:10px 12px; border-width:2px; background:#fffdf0; overflow-wrap:anywhere; }

/* Reusable offer listings: content, photographs and optional price. */
.entry .tb-offer { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); gap:16px 28px; padding:24px 0; align-items:start; }
.entry .tb-offer + .tb-offer { border-top:1px solid #b5a54d; }
.entry .tb-offer > h3 { grid-column:1 / -1; margin:0; }
.entry .tb-offer > div { min-width:0; }
.entry .tb-offer-gallery .gallery { margin:0; }
.entry .tb-offer-price { grid-column:1 / -1; text-align:right; }
.entry .tb-offer-price p:last-child { margin-bottom:0; }
.entry .tb-offer-price strong { color:#236322; font-size:21px; }
@media(max-width:700px) {
  .entry .tb-offer { grid-template-columns:minmax(0,1fr); gap:12px; }
  .entry .tb-offer-price { text-align:left; }
}


/* Classic Editor: native WordPress image alignment and captions. */
.entry .aligncenter { display:block; margin:0 auto 1em; }
.entry .alignnone { max-width:100%; }
.entry .alignleft { float:left; margin:0.25em 1.25em 1em 0; }
.entry .alignright { float:right; margin:0.25em 0 1em 1.25em; }
.entry .wp-caption { max-width:100%; margin-top:0; margin-bottom:1.25em; }
.entry .wp-caption.aligncenter { margin-left:auto; margin-right:auto; }
.entry .wp-caption.alignnone { margin-left:0; margin-right:0; }
.entry .wp-caption > a { display:block; }
.entry .wp-caption img { display:block; max-width:100%; height:auto; margin:0 auto; }
.entry .wp-caption .wp-caption-text { display:block; margin:0.45em 0 0; text-align:center; font-size:0.9em; font-style:italic; line-height:1.5; }
.entry::after { content:""; display:block; clear:both; }
@media(max-width:700px) {
  .entry .alignleft, .entry .alignright { float:none; display:block; margin:0 auto 1em; }
}

/* Offer photographs: preserve aspect ratios and limit tall thumbnails. */
.entry .tb-offer-gallery .gallery-columns-2 img {
  width:auto; max-width:100%; height:auto; max-height:240px;
  object-fit:contain; margin:0 auto;
}

/* Responsive data tables: no arbitrary word breaks; scroll only if necessary. */
@media (max-width:700px) {
  .entry table { border-collapse:collapse; font-size:clamp(12px, 3.3vw, 15px); line-height:1.4; overflow-wrap:normal; word-break:normal; }
  .entry table th, .entry table td { padding:7px 4px; white-space:nowrap; overflow-wrap:normal; word-break:normal; }
}

/* Classic markup: preserve useful generic defaults formerly supplied by core block CSS. */
:where(figure) { margin:0 0 1em; }
.aligncenter { clear:both; }
.screen-reader-text { word-wrap:normal!important; word-break:normal!important; padding:0; margin:-1px; clip-path:inset(50%); }
.screen-reader-text:focus { background:#eee; clip:auto!important; clip-path:none; color:#444; display:block; font-size:1em; height:auto; left:5px; line-height:normal; padding:15px 23px 14px; text-decoration:none; top:5px; width:auto; z-index:100000; }
