/*
 * Hauptdesign des KGV Walderholung Sonneberg Themes
 *
 * Dieses Stylesheet definiert Farbvariablen, Schriftarten sowie das Layout
 * von Kopfzeile, Seiteninhalten und Fußzeile. Durch die Verwendung von CSS‑
 * Variablen können Elementor-Widgets automatisch die definierten Farben und
 * Schriften übernehmen (siehe :root‑Deklarationen).
 */

/* Schriftdefinitionen */
@font-face {
    font-family: 'Noto Sans';
    src: url('../fonts/NotoSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Noto Sans';
    src: url('../fonts/NotoSans-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Noto Serif';
    src: url('../fonts/NotoSerif-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Noto Serif';
    src: url('../fonts/NotoSerif-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* Farbvariablen und Elementor‑Integration */
:root {
    --color-primary: #2A7F62;
    --color-secondary: #5D9C59;
    --color-accent: #FFC857;
    --color-light: #F5F5F5;
    --color-dark: #333333;

    /* Elementor globale Farbvariablen */
    --e-global-color-primary: var(--color-primary);
    --e-global-color-secondary: var(--color-secondary);
    --e-global-color-accent: var(--color-accent);
    --e-global-color-text: var(--color-dark);

    /* Elementor globale Typografievariablen */
    --e-global-typography-primary-font-family: 'Noto Serif';
    --e-global-typography-primary-font-weight: 700;
    --e-global-typography-secondary-font-family: 'Noto Serif';
    --e-global-typography-secondary-font-weight: 400;
    --e-global-typography-text-font-family: 'Noto Sans';
    --e-global-typography-text-font-weight: 400;
    --e-global-typography-accent-font-family: 'Noto Sans';
    --e-global-typography-accent-font-weight: 700;
}

/* Grundlegendes Box‑Modell */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Noto Sans', sans-serif;
    color: var(--color-dark);
    background-color: var(--color-light);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Noto Serif', serif;
    color: var(--color-primary);
    margin-top: 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-secondary);
}

/* Container für Inhalte */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Kopfzeile */
header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.site-branding {
    display: flex;
    flex-direction: column;
}

.site-title {
    font-size: 1.5rem;
    margin: 0;
    color: var(--color-primary);
}

.site-description {
    font-size: 0.8rem;
    margin: 0;
    color: var(--color-secondary);
}

/* Hamburger‑Icon für mobile Navigation */
.nav-toggle {
    display: none;
    flex-direction: column;
    width: 24px;
    height: 24px;
    justify-content: space-between;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
}

nav {
    margin-left: auto;
    position: relative;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

nav li {
    margin-left: 1.5rem;
}

nav li a {
    font-weight: 600;
    transition: color 0.3s;
}

nav li a:hover {
    color: var(--color-accent);
}

/* Hero‑Bereich */
.hero {
    background-image: url('../images/hero.png');
    background-size: cover;
    background-position: center;
    padding: 4rem 1rem;
    color: #fff;
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
}

.hero .hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    color: #fff;
    font-size: 2.5rem;
}

.hero p {
    color: #eee;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--color-accent);
    color: var(--color-dark);
    border-radius: 4px;
    font-weight: 700;
    transition: background-color 0.3s, color 0.3s;
}

.button:hover {
    background-color: var(--color-secondary);
    color: #fff;
}

/* Kartenraster */
.card-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    margin: 2rem 0;
}

.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: left;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card img {
    width: 100%;
    display: block;
    height: auto;
}

.card-content {
    padding: 1rem;
    flex: 1;
}

.card-content h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
    color: var(--color-primary);
}

.card-content p {
    margin: 0;
    font-size: 0.9rem;
}

/* Fußzeile */
footer {
    background-color: var(--color-primary);
    color: #fff;
    padding: 2rem 1rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
}

.footer-branding h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
    color: #fff;
}

.footer-branding p {
    margin: 0;
    color: var(--color-light);
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav li {
    margin-bottom: 0.5rem;
}

.footer-nav a {
    color: #fff;
    transition: color 0.3s;
}

.footer-nav a:hover {
    color: var(--color-accent);
}

.footer-copy {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--color-light);
    flex-basis: 100%;
}

/* Responsive Navigation */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        position: absolute;
        top: 60px;
        right: 0;
        background-color: #fff;
        width: 200px;
        border-radius: 4px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        padding: 1rem 0;
    }

    nav ul.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    nav li {
        margin: 0;
    }

    nav li a {
        display: block;
        padding: 0.75rem 1rem;
        color: var(--color-dark);
    }

    .nav-toggle {
        display: flex;
    }
}
/* ===== TABLET FIX (<=1200px): тянем шапку/подвал, включаем офф-канвас меню ===== */
@media (max-width: 1200px){

  /* Шапка/подвал тянутся на всю ширину */
  .header-inner,
  .footer-inner{
    max-width: none;
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Кнопка-бургер */
  .nav-toggle{
    display: inline-flex !important;
    align-items: center; justify-content: center;
    width: 48px; height: 48px; border: 0; background: transparent;
    cursor: pointer;
  }
  .nav-toggle span{
    display: block; width: 24px; height: 2px; background: #1E2420; margin: 4px 0;
  }

  /* Off-canvas панель меню: работаем и с <nav><ul>, и с .main-nav */
  header .main-nav,
  header nav:not(.main-nav) > ul{
    position: fixed !important; top: 0; right: 0; bottom: 0; left: auto;
    width: min(340px, 86vw);
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    padding: 16px; margin: 0; border-radius: 0;
    transform: translateX(100%) !important;
    transition: transform .25s ease;
    z-index: 1000; overflow: auto; display: block !important;
  }
  header .main-nav.open,
  header nav:not(.main-nav) > ul.open{
    transform: translateX(0) !important;
  }

  /* Вертикальный список внутри панели */
  header .main-nav ul,
  header nav:not(.main-nav) > ul{
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 8px;
  }

  /* Пункты меню не переносятся */
  header .main-nav a,
  header nav li a{
    display: block; padding: 14px 12px; border-radius: 12px;
    color: #1E2420; text-decoration: none;
    white-space: nowrap; word-break: keep-all; overflow-wrap: normal;
  }
  header .main-nav a:hover,
  header nav li a:hover{ background: #f2efe7; }

  /* Затемнение позади панели */
  .nav-overlay{
    position: fixed; inset: 0; background: rgba(0,0,0,.35);
    opacity: 0; visibility: hidden; transition: opacity .2s ease; z-index: 999;
  }
  .nav-overlay.show{ opacity: 1; visibility: visible; }
}

/* Учитываем админ-бар WordPress */
@media (max-width:1200px){
  body.admin-bar header .main-nav,
  body.admin-bar header nav:not(.main-nav) > ul{ top: 32px; }
}
@media (max-width:782px){
  body.admin-bar header .main-nav,
  body.admin-bar header nav:not(.main-nav) > ul{ top: 46px; }
}

/* На любых ширинах запрещаем перенос слов в шапочном меню */
header .main-nav a, header nav li a{ white-space: nowrap; }
