/*
Theme Name: Schützen Dietersheim
Theme URI: https://www.schuetzen-dietersheim.de
Author: Schützen Dietersheim e.V.
Description: Ruhiges, schnelles Theme für den Schützenverein Dietersheim. Keine externen Schriften oder Skripte (DSGVO-freundlich), Menü mit Untermenüs, Ergebnistabellen und eine Startseite mit Schießscheibe.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.8
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: schuetzen-dietersheim
*/

:root {
  --loden: #27402f;
  --loden-dark: #1a2c21;
  --paper: #f3f5f1;
  --ink: #1d2620;
  --muted: #56635a;
  --line: #d3d9d1;
  --blue: #1f5fa6;
  --treffer: #c23a2b;
  --spiegel: #161a17;
  --focus: #1f5fa6;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--loden); text-underline-offset: 0.18em; }
a:hover { color: var(--blue); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip {
  position: absolute; left: 0.5rem; top: -4rem; z-index: 100;
  background: var(--paper); color: var(--ink); padding: 0.6rem 1rem;
}
.skip:focus { top: 0.5rem; }
.wrap { width: 100%; max-width: 68rem; margin-inline: auto; padding-inline: 1.25rem; }

h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.15; color: var(--loden-dark); }

/* Kopfbereich */
.site-header, .hero, .site-footer { --focus: #f3f5f1; background: var(--loden-dark); color: var(--paper); }
.site-header a, .hero a, .site-footer a { color: inherit; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 0.9rem; }
.brand { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; }
.brand .custom-logo { max-height: 3.2rem; width: auto; display: block; }
.brand-mark { width: 2.6rem; height: 2.6rem; flex: none; }
.brand-name { font: 700 1.3rem/1.1 var(--serif); }
.brand-name small { font: 400 0.95rem var(--sans); opacity: 0.75; margin-left: 0.2rem; }

.nav-toggle {
  display: none; background: none; color: inherit; border: 1px solid rgba(243, 245, 241, 0.5);
  padding: 0.45rem 0.9rem; font: inherit; border-radius: 3px; cursor: pointer;
}
.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav > ul, .primary-nav > div > ul { display: flex; flex-wrap: wrap; gap: 0.1rem; }
.primary-nav li { position: relative; }
.primary-nav a { display: block; padding: 0.55rem 0.8rem; text-decoration: none; border-bottom: 2px solid transparent; }
.primary-nav a:hover, .primary-nav a:focus-visible { border-bottom-color: rgba(243, 245, 241, 0.6); color: var(--paper); }
.primary-nav .current-menu-item > a, .primary-nav .current-menu-ancestor > a, .primary-nav .current_page_item > a { border-bottom-color: var(--paper); }
.primary-nav .sub-menu, .primary-nav .children {
  display: none; position: absolute; left: 0; top: 100%; z-index: 20; min-width: 15rem;
  background: var(--loden); padding: 0.3rem 0; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu,
.primary-nav li:hover > .children, .primary-nav li:focus-within > .children { display: block; }
.primary-nav .sub-menu a, .primary-nav .children a { border: 0; padding: 0.5rem 1rem; }
.primary-nav .sub-menu a:hover, .primary-nav .children a:hover { background: var(--loden-dark); }
.primary-nav .sub-menu .sub-menu, .primary-nav .children .children { left: 100%; top: 0; }

/* Startseite */
.hero { overflow: hidden; border-top: 1px solid rgba(243, 245, 241, 0.12); }
.hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2rem; align-items: center; padding-block: clamp(2.5rem, 6vw, 5rem); }
.hero h1 { color: var(--paper); font-size: clamp(2.5rem, 6.4vw, 4.9rem); line-height: 1.02; margin: 0 0 1rem; letter-spacing: -0.01em; }
.hero .lead { font-size: 1.25rem; margin: 0; max-width: 30ch; opacity: 0.9; }
.times { margin: 2rem 0 0; padding-left: 1rem; border-left: 3px solid var(--paper); max-width: 28rem; }
.times strong { display: block; font: 700 1.1rem var(--serif); }
.hero-target { justify-self: end; width: min(100%, 30rem); transform: translateX(14%); }
.target { display: block; width: 100%; }
.t-out { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }
.t-in { fill: var(--spiegel); stroke: rgba(243, 245, 241, 0.55); stroke-width: 1; }
.t-num-out { fill: var(--ink); } .t-num-in { fill: var(--paper); }
.t-num-out, .t-num-in { font: 600 11px var(--sans); text-anchor: middle; }
.t-hit-halo { fill: none; stroke: var(--treffer); stroke-width: 2.5; }
.t-hit { fill: var(--paper); }
.hit { transform-box: fill-box; transform-origin: center; animation: treffer 0.45s 0.5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes treffer { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Beitragsliste */
.main { padding-block: clamp(2rem, 5vw, 3.5rem); }
.page-title, .section-title { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 1.5rem; }
.row { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1.25rem; padding-block: 1.6rem; border-top: 1px solid var(--line); max-width: 52rem; }
.row-date { display: block; line-height: 1.1; }
.row-date .d { display: block; font: 700 2.6rem/1 var(--serif); color: var(--loden); }
.row-date .m { display: block; margin-top: 0.3rem; font-size: 0.9rem; color: var(--muted); }
.row-title { font-size: 1.5rem; margin: 0 0 0.5rem; }
.row-title a { color: inherit; text-decoration: none; }
.row-title a:hover { color: var(--blue); text-decoration: underline; }
.row-text > :first-child { margin-top: 0; }
.row-text > :last-child { margin-bottom: 0; }
.row-img { margin-top: 1rem; max-width: 28rem; border-radius: 2px; }
.more { margin-top: 1rem; }
.pagination { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pagination .page-numbers { padding: 0.35rem 0.8rem; border: 1px solid var(--line); text-decoration: none; background: #fff; }
.pagination .current { background: var(--loden); color: var(--paper); border-color: var(--loden); }

/* Einzelseiten und Beiträge */
.entry { max-width: 46rem; }
.entry-meta { color: var(--muted); margin: -0.8rem 0 1.5rem; }
.entry-content > * { max-width: 46rem; }
.entry-content > .alignwide, .entry-content > .alignfull { max-width: none; }
.entry-content h2 { font-size: 1.7rem; margin-top: 2.2rem; }
.entry-content h3 { font-size: 1.3rem; margin-top: 1.8rem; }
.entry-content blockquote { margin-inline: 0; padding-left: 1.2rem; border-left: 4px solid var(--blue); color: var(--muted); }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin-block: 2rem; }
.entry-content table { width: 100%; max-width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-block: 1.5rem; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { padding: 0.5rem 0.8rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.entry-content th { background: var(--loden); color: var(--paper); font-weight: 600; }
.entry-content tbody tr:nth-child(even) { background: rgba(39, 64, 47, 0.06); }
.alignleft { float: left; margin: 0.3rem 1.2rem 1rem 0; }
.alignright { float: right; margin: 0.3rem 0 1rem 1.2rem; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption-text, figcaption { font-size: 0.9rem; color: var(--muted); }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); max-width: 46rem; }

/* Fußbereich */
.site-footer { margin-top: 4rem; }
.site-footer::before {
  content: ""; display: block; height: 14px; background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 14'%3E%3Cpath fill='%231f5fa6' d='M0 7L7 0L14 7L7 14Z'/%3E%3C/svg%3E");
  background-size: 28px 14px; background-repeat: repeat-x;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem; padding-block: 2.5rem; }
.footer-grid h2 { font-size: 1.1rem; color: var(--paper); margin: 0 0 0.5rem; }
.footer-grid p, .footer-grid ul { margin: 0; padding: 0; list-style: none; }
.footer-grid li + li { margin-top: 0.3rem; }
.copyright { border-top: 1px solid rgba(243, 245, 241, 0.15); padding-block: 1rem; font-size: 0.9rem; opacity: 0.8; }

/* Mobil */
@media (max-width: 52rem) {
  .js .nav-toggle { display: inline-flex; }
  .js .primary-nav { display: none; width: 100%; }
  .js .primary-nav.is-open { display: block; }
  .primary-nav > ul, .primary-nav > div > ul { flex-direction: column; }
  .primary-nav .sub-menu, .primary-nav .children { display: block; position: static; box-shadow: none; background: none; padding-left: 1rem; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-target { justify-self: center; width: 78%; transform: none; }
  .row { grid-template-columns: 1fr; gap: 0.4rem; }
  .row-date { display: flex; align-items: baseline; gap: 0.5rem; }
  .row-date .d { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) { .hit { animation: none; } }
