/* 
Theme Name: Fleischerei Dettmers (Modern, Responsive & Fluid)
Author: Klaus Oppermann / Modernized
----------------------------------------------------- */

/* =========================================================
1. Global Box-Sizing & Fluide Typografie-Skala
   ========================================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background:#eee;
  font-size: 100%; /* 1rem = 16px Basis */
}

:root {
/* Kleintext (Datum, Footer, Bildunterschriften): 12px bis 13px */
  --font-sm: clamp(0.75rem, 0.71rem + 0.15vw, 0.8125rem);

  /* Navigation / Sidebar: 13px bis 14.5px */
  --font-md: clamp(0.8125rem, 0.77rem + 0.2vw, 0.90625rem);

  /* Fließtext (Body): 14.5px bis 16px */
  --font-base: clamp(0.90625rem, 0.86rem + 0.25vw, 1rem);

  /* H3 / Teaser-Titel: 16px bis 18px */
  --font-h3: clamp(1rem, 0.94rem + 0.35vw, 1.125rem);

  /* H2 (Zwischenüberschriften): 18px bis 21px */
  --font-h2: clamp(1.125rem, 1.04rem + 0.45vw, 1.3125rem);

  /* H1 (Hauptüberschrift): 21px bis 25px */
  --font-h1: clamp(1.3125rem, 1.18rem + 0.65vw, 1.5625rem);

  --mwidth: 68rem;
  --bigwidth: 92rem;
  --biggerwidth: 100rem;
  --fullwidth: 120rem;
}

body {
  background: #fff;
  color: #5f5f5f;
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: var(--font-base);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* =========================================================
2. Typografie & Basiselemente
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  color: #ec1d25;
  font-family: Arial, Verdana, Helvetica, sans-serif;
  font-weight: 700;
  margin: 1rem 0 0.625rem 0;
  line-height: 1.25;
  text-wrap: balance;
}

h1 { font-size: var(--font-h1); margin: 1.5rem auto 1.5rem auto; text-align:center;}
h2 { font-size: var(--font-h2); font-style: italic; }
h3 { font-size: var(--font-h3); margin-top: 1.25rem; }
h4, h5 { font-size: var(--font-base); }

p {
  margin: 0 0 0.75rem 0;
}

a {
  color: #005bac;
  text-decoration: underline;
}

a:hover, 
a:focus {
  color: #ec1d25;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 1.25rem 0;
}

address {
  font-style: normal;
  margin-bottom: 1rem;
}

blockquote {
  background: #f7f7f7;
  border-left: 4px solid #ec1d25;
  margin: 1rem 0;
  padding: 0.625rem 1rem;
}

strong {
  color: #ec1d25;
  font-weight: 700;
}

small {
  font-size: var(--font-sm);
}

/* Definition-Lists: Browser-Einzug neutralisieren */
dl, dt, dd {
  margin: 0;
  padding: 0;
}

/* Barrierefreiheit & unsichtbarer SEO-Text */
.screen-reader-text,
.nix {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Clearfix */
.clearfix::after,
#content::after,
#wrapcontent::after,
.entry::after,
.entry-content::after {
  content: "";
  display: table;
  clear: both;
}

/* Standard-Ausrichtungen (WordPress Core) */
img.alignleft, .alignleft {
  float: left;
  margin: 10px 25px 10px 0;
}

img.alignright, .alignright {
  float: right;
  margin: 10px 0 10px 25px;
}

img.alignnone, .alignnone {
  display: block;
  float: none;
  margin: 20px 0;
}

img.aligncenter, .aligncenter {
  display: block;
  float: none;
  margin: 20px auto;
  text-align: center;
}

/* =========================================================
3. Header & Logo (Flexbox: Zentriert & Vertikal ausgerichtet)
   ========================================================= */
#wrapheader {
  background: #fff;
  width: 100%;
}

#header {
  max-width: var(--mwidth);
  min-height: 90px;
  margin: 0 auto;
  padding: 15px;
  display: flex;
  align-items: center;      /* Vertikale Zentrierung für Logo & Button */
  justify-content: center;  /* Desktop: Logo horizontal zentriert */
  position: relative;
}

#header .logo {
  max-width: 360px;
  z-index: 999;
}

#header .logo a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

#header .logo img {
  max-width: 100%;
  max-height: 80px;
  width: auto;
  height: auto;
  display: block;
}

/* =========================================================
4. Hauptnavigation (Basis & Hamburger-Button)
   ========================================================= */
#navigation {
  background: #a31419 linear-gradient(to bottom, #b4161c 0%, #8e1014 100%);
  display:block;
  margin: 0 auto;
  position: relative;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

#navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

#navigation ul li a,
#navigation ul li strong {
  display: block;
  color: #fff;
  font-weight: 700;
  font-size: var(--font-md);
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

#navigation ul li a:hover,
#navigation ul li a:focus,
#navigation ul li.current-menu-item a,
#navigation ul li.current-menu-ancestor a,
#navigation ul li.current-page-ancestor a,
#navigation ul li a.aktiv,
#navigation ul li strong {
  background-color: #ec1d25;
  color: #fff;
  text-decoration: none;
}

#navigation ul li a span,
#navigation ul li strong span {
  padding: 0;
  display: inline;
  background: none !important;
}

/* Hamburger-Button Standardzustand (auf Desktop ausgeblendet) */
.menu-toggle {
  display: none;
  background: #a31419;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  padding: 8px 12px;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: var(--font-md);
  font-weight: 700;
  flex-shrink: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.menu-toggle:hover,
.menu-toggle:focus {
  background: #ec1d25;
}

.hamburger-box {
  display: inline-block;
  width: 22px;
  height: 16px;
  position: relative;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  width: 22px;
  height: 2px;
  background-color: #fff;
  position: absolute;
  left: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger-inner {
  top: 7px;
}

.hamburger-inner::before {
  content: "";
  top: -7px;
}

.hamburger-inner::after {
  content: "";
  top: 7px;
}

/* Animation zum "X" wenn geöffnet */
.menu-toggle.is-active .hamburger-inner {
  transform: rotate(45deg);
}

.menu-toggle.is-active .hamburger-inner::before {
  top: 0;
  opacity: 0;
}

.menu-toggle.is-active .hamburger-inner::after {
  top: 0;
  transform: rotate(-90deg);
}

/* =========================================================
4a. Desktop Navigation (ab 769px)
   ========================================================= */
@media (min-width: 769px) {
  #navigation ul {
    flex-wrap: wrap;
    justify-content: center;
  }

  #navigation ul li {
    margin: 0 2px;
    padding-top: 6px;
  }

  #navigation ul li a,
  #navigation ul li strong {
    padding: 9px 16px 11px 16px;
    border-radius: 4px 4px 0 0;
  }
}

/* =========================================================
4b. Mobile Header & Navigation (< 768px)
   ========================================================= */
@media (max-width: 768px) {
  #header {
    min-height: 70px;
    justify-content: space-between; /* Logo links, Hamburger rechts */
    gap: 15px;
  }

  #header .logo {
    max-width: calc(100% - 110px);
  }

  #header .logo a {
    justify-content: flex-start;
  }

  #header .logo img {
    max-height: 60px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  /* Navigation standardmäßig eingeklappt */
  #navigation {
    width: 100%;
    display: none;
  }

  #navigation.is-open {
    display: block;
  }

  #navigation ul {
    flex-direction: column;
    padding: 4px 0;
  }

  #navigation ul li {
    width: 100%;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  #navigation ul li:last-child {
    border-bottom: none;
  }

  #navigation ul li a,
  #navigation ul li strong {
    text-align: left;
    background: #a01318;
    padding: 12px 20px;
    border-radius: 0;
  }
}

/* =========================================================
5. Layout & Inhaltsbereich (Flexbox)
   ========================================================= */

#wrapper {
  max-width: var(--mwidth);
  margin: 0 auto;
  padding: 25px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 30px;
  background: #fff;
}

#wrapcontent {
  flex: 1 1 64%;
  min-width: 0;
}

#wrapsidebar {
  flex: 1 1 32%;
  min-width: 260px;
}

#content {
  min-height: auto;
}

/* Startseite & volle Breite ohne Sidebar */
body.home #wrapcontent,
body#start #wrapcontent,
body#post3 #wrapcontent {
  flex: 1 1 100% !important;
  max-width: 100% !important;
  width: 100% !important;
}

body.home #wrapsidebar,
body#start #wrapsidebar,
body#post3 #wrapsidebar {
  display: none;
}

body.home #content,
body#start #content {
  min-height: 0;
}

/* =========================================================
6. Teaser-Boxen (Startseite)
   ========================================================= */
dl.box {
  background: #f7f7f7;
  border: 1px solid #eee;
  padding: 15px 10px;
  box-sizing: border-box;
  margin: 15px 0;
}

dl.box dd {
  text-align: left;
}

dl.box dt img {
  margin: 0 auto 10px auto;
  border: 1px solid #ddd;
}

dl.box h3 {
  margin: 10px 0 5px 0;
  font-size: var(--font-h3);
  text-align: center;
}

dl.box a {
  color: #ec1d25;
  text-decoration: none;
  font-weight: 700;
}

dl.box a:hover {
  color: #005bac;
}

/* =========================================================
7. Beiträge, Artikel & Archive
   ========================================================= */
article.post,
#content div.post {
  background: none;
  border-bottom: 1px dashed #ccc;
  margin-bottom: 2.2rem;
  padding-bottom: 1.25rem;
}

p.datum {
  font-size: var(--font-sm);
  color: #888;
  margin-bottom: 0.625rem;
}

.postmetadata {
  font-size: var(--font-sm);
  margin-top: 1rem;
  color: #777;
}

.navigation-posts,
.navigation-post-nav,
.navigation {
  display: flex;
  justify-content: space-between;
  margin: 1.25rem 0;
  font-weight: 700;
}

#content img.size-full,
#content img.size-medium,
#content img.size-thumbnail,
#content div.gallery img {
  background: #fff;
  border: 1px solid #ddd;
  padding: 5px;
  margin: 5px;
}

#content .wp-caption {
  border: 1px solid #ddd;
  text-align: center;
  background-color: #f7f7f7;
  padding: 5px;
  margin: 10px 0;
  border-radius: 4px;
}

#content .wp-caption p.wp-caption-text {
  font-size: var(--font-sm);
  margin: 5px 0 0 0;
}

/* =========================================================
8. Sidebar & Buttons
   ========================================================= */
#sidebar {
  font-size: var(--font-md);
}

#sidebar .widget,
#sidebar .wp-block-group {
  max-width: 280px;       /* Breite begrenzen, damit Zentrierung sichtbar wird */
  width: 100%;
  margin: 0 auto 2rem auto; /* Zentriert den Block selbst horizontal */
  text-align: left;       /* Hält den gesamten Inhalt linksbündig */
}

/* Falls vorher dl oder p.center global zentriert wurden, hier wieder überschreiben */
#sidebar .widget dl {
  text-align: left;
}

#sidebar ul {
  list-style: none;
  margin: 15px 0;
  padding: 0;
}

#sidebar ul li a {
  background: none;
  display: block;
  font-weight: 700;
  padding: 6px 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

#sidebar ul li a::before {
  content: "▸";
  color: #005bac;
  margin-right: 8px;
  font-size: 1.2em;
}

#sidebar ul li a:hover,
#sidebar ul li.current-page-item a {
  background-color: #f5f5f5;
  color: #ec1d25;
}

#sidebar ul li a:hover::before,
#sidebar ul li.current-page-item a::before {
  color: #ec1d25;
}

#sidebar dl {
  margin: 1.25rem 0;
  text-align: center;
}

#sidebar dl dt img {
  margin: 0 auto 0.625rem auto;
  border: 1px solid #ddd;
}

/* Buttons (Speiseplan & Downloads) */
#sidebar p.button,
p.button {
  margin: 15px auto;
  text-align: center;
}

#sidebar p.button a,
p.button a {
  background: #ec1d25;
  color: #fff;
  display: inline-block;
  font-weight: 700;
  line-height: 1.3;
  padding: 10px 18px;
  border-radius: 4px;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s ease, transform 0.1s ease;
}

#sidebar p.button a:hover,
#sidebar p.button a:focus,
p.button a:hover,
p.button a:focus {
  background: #005bac;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* =========================================================
9. Footer & Footer-Navigation
   ========================================================= */
#wrapfooter {
  background: #eee;
  color: #444;
  font-size: var(--font-md);
  padding: 35px 15px;
}

#footer {
  max-width: var(--mwidth);
  margin: 0 auto;
  text-align: center;
}

#footer ul {
  list-style: none;
  margin: 1rem 0 0 0;
  padding: 0;
  text-align: center;
}

#footer ul li {
  display: inline-block;
}

#footer ul li + li::before {
  content: "|";
  color: #999;
  padding: 0 10px;
}

#footer a {
  color: #555;
  text-decoration: none;
  font-size: var(--font-md);
}

#footer a:hover,
#footer a:focus {
  color: #ec1d25;
  text-decoration: underline;
}

#footer ul li.current-menu-item a {
  color: #ec1d25;
  font-weight: 700;
  text-decoration: none;
}

/* =========================================================
10. Tabellen & Formulare
   ========================================================= */
#content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
}

#content table th,
#content table td {
  padding: 0.625rem;
  border-bottom: 1px solid #eee;
}

#content table tr.rahmen {
  background: #fbfbfb;
}

#content table td.preis {
  color: #ec1d25;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

input[type="text"],
input[type="search"],
input[type="email"],
textarea {
  width: 100%;
  max-width: 450px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  margin-bottom: 10px;
}

input[type="checkbox"], 
input.wpcf7-acceptance { 
  float: left; 
  width: 1.5em; 
  margin-right: 8px;
}

input[type="submit"] {
  background: #ec1d25;
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 10px 25px;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.2s ease;
}

input[type="submit"]:hover {
  background: #005bac;
}

/* =========================================================
11. Desktop Layout (ab 769px)
   ========================================================= */
@media (min-width: 769px) {
  /* 3 Teaser-Boxen nebeneinander */
  dl.box {
    float: left !important;
    width: 31.33% !important;
    margin: 15px 1% !important;
    clear: none !important;
  }

  dl.box:nth-of-type(3n) {
    margin-right: 0 !important;
  }
}

/* =========================================================
12. Mobile Layout & Responsive Breakpoints (< 768px)
   ========================================================= */
@media (max-width: 768px) {
  #wrapper {
    flex-direction: column;
    gap: 20px;
    padding: 1.5rem;
  }

  #wrapcontent,
  #wrapsidebar {
    flex: 1 1 100%;
    width: 100%;
    margin: 0;
  }

  /* Teaser-Boxen gestapelt */
  dl.box {
    float: none !important;
    width: 100% !important;
    margin: 15px 0 !important;
  }

  /* WordPress-Bildausrichtungen mobil zentrieren */
  img.alignleft, .alignleft,
  img.alignright, .alignright {
    float: none;
    margin: 10px auto;
  }

  /* Scrollbare Tabellen */
  #content {
    overflow-x: auto;
  }

  /* Footer-Links untereinander */
  #footer ul li {
    display: block;
    margin: 6px 0;
  }

  #footer ul li + li::before {
    display: none;
  }
}
