/*
Theme Name: Notar Brandt
Theme URI: https://www2.notar-brandt.de
Author: Migration
Description: Custom theme for Notar Dr. Andreas Brandt, Hückelhoven – 1:1 migration from original design
Version: 1.0
*/

@import url('https://fonts.googleapis.com/css2?family=Muli:wght@400;600;700&family=Cinzel:wght@400;600&family=Roboto:wght@300;400;500&display=swap');

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    --primary:      #435877;   /* Dunkelblau */
    --primary-dark: #2e3f57;
    --primary-light: #6b82a0;
    --accent:       #8a9bb0;
    --bg:           #ffffff;
    --bg-light:     #f8f9fb;
    --text:         #444444;
    --text-light:   #777777;
    --border:       #dde3ec;
    --sidebar-bg:   #f5f7fa;
    --font-heading: 'Cinzel', serif;
    --font-body:    'Muli', 'Roboto', sans-serif;
    --max-width:    1180px;
    --header-h:     90px;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    color: var(--primary);
    font-weight: 600;
    line-height: 1.25;
}
h1 { font-size: 32px; margin-bottom: 18px; }
h2 { font-size: 24px; margin-bottom: 12px; margin-top: 1.4rem; }
h3 { font-size: 19px; margin-bottom: 10px; margin-top: 1.2rem; }
p  { margin-bottom: 15px; }
ul, ol { margin: 0 0 15px 22px; }
li { margin-bottom: 5px; }
strong { font-weight: 700; }

.centerer { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ============================================
   Header
   ============================================ */
.site-header {
    padding: 14px 0;
    background: var(--bg);
    border-bottom: 3px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
}

.site-logo img { max-height: 95px; width: auto; }

.logo-text-wrap { display: flex; flex-direction: column; flex-shrink: 0; }
.logo-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--primary);
    line-height: 1.2;
    letter-spacing: 0.02em;
}
.logo-subtitle {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 2px;
}

/* ============================================
   Navigation
   ============================================ */
.main-nav {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
    position: relative;
    z-index: 1000;
}

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a {
    display: block;
    padding: 8px 2px;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: color 0.3s;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}
.main-nav > ul > li > a:hover,
.main-nav > ul > li.current-menu-item > a,
.main-nav > ul > li.current-menu-ancestor > a {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
    text-decoration: none;
}

/* Dropdown – robustere Regeln */
.main-nav ul.nav-menu ul.sub-menu,
.main-nav .menu ul,
.main-nav > ul > li > ul {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 240px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 9999;
    border-top: 3px solid var(--primary);
    flex-direction: column;
    list-style: none;
    padding: 4px 0;
    margin: 0;
}
.main-nav > ul > li:hover > ul,
.main-nav > ul > li:focus-within > ul,
.main-nav ul.nav-menu > li:hover > ul.sub-menu {
    display: flex !important;
}

.main-nav ul ul li { width: 100%; border-bottom: 1px solid #eef1f5; }
.main-nav ul ul li:last-child { border-bottom: none; }
.main-nav ul ul a {
    display: block;
    padding: 9px 18px;
    line-height: 1.3;
    font-weight: 500;
    font-size: 14px;
    color: var(--primary);
    transition: background 0.2s;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
}
.main-nav ul ul a:hover { background: var(--bg-light); color: var(--primary-dark); text-decoration: none; }

/* Burger */
.burger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    background: none;
    border: none;
    padding: 4px;
}
.burger span { display: block; width: 26px; height: 2px; background: var(--primary); margin: 5px 0; border-radius: 2px; transition: all 0.3s; }
.burger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================
   Hero / Keyvisual
   ============================================ */
.keyvisual {
    position: relative;
    overflow: hidden;
    background: var(--primary-dark);
    left: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
    margin-bottom: 0;
}
.keyvisual img {
    width: 100%;
    height: 380px;
    min-height: 380px;
    max-height: 380px;
    object-fit: cover;
    object-position: center 40%;
    display: block;
    transition: opacity 0.7s ease;
}
.hero-slide { display: none; }
.hero-slide.active { display: block; }

/* Kein Keyvisual wenn kein Bild – Fallback Gradient */
.keyvisual-fallback {
    height: 280px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 2rem;
    letter-spacing: 0.08em;
}

/* Hero Overlay Text (Startseite) */
.hero-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%);
    padding: 24px 24px 20px;
    pointer-events: none;
}
.hero-text h2 { color: #fff; font-size: 1.8rem; margin: 0 0 4px; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.hero-text p  { color: rgba(255,255,255,0.9); font-size: 1rem; margin: 0; text-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.hero-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.hero-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.5); border: none; cursor: pointer; padding: 0; transition: background 0.2s; }
.hero-dot.active { background: #fff; }

/* ============================================
   Page Layout
   ============================================ */
.content_wrapper {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 40px;
    margin-top: 36px;
    margin-bottom: 60px;
    align-items: start;
}

#content_main {
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
#content_main p { margin-bottom: 15px; }
#content_main ul { padding-left: 20px; }

/* cm_column_wrapper */
.cm_column_wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    width: 100%;
    margin: 20px 0;
}
.cm_column { width: auto !important; min-width: 0; }
.cm_column_gap { display: none !important; }

/* Startseite eigenes Layout (content-wrapper / content-inner) */
.content-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}
.content-inner {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 40px;
    margin-top: 36px;
    margin-bottom: 60px;
    align-items: start;
}
.content-text { min-width: 0; overflow-wrap: break-word; }

/* ============================================
   Sidebar
   ============================================ */
.sidebar-right {
    background: var(--sidebar-bg);
    padding: 24px;
    border-radius: 4px;
    border-top: 4px solid var(--primary);
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    min-width: 0;
}

.sidebar-right h3 {
    font-family: var(--font-heading);
    color: var(--primary);
    font-size: 16px;
    margin-bottom: 10px;
    margin-top: 0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.sidebar-right p { margin-bottom: 8px; font-size: 14px; line-height: 1.6; color: var(--text-light); }
.sidebar-right a { color: var(--primary); }
.sidebar-right a:hover { color: var(--primary-dark); }
.sidebar-sep { height: 1px; background: var(--border); margin: 18px 0; }
.sidebar-right strong { color: var(--text); }

/* Öffnungszeiten-Tabelle in Sidebar */
.oh-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.oh-table td { padding: 2px 0; vertical-align: top; color: var(--text-light); border: none; }
.oh-table td:first-child { font-weight: 600; color: var(--primary); padding-right: 10px; width: 60px; }

/* ============================================
   Impressum Tabelle
   ============================================ */
.impressum-table {
    width: auto;
    border-collapse: collapse;
    margin: 0 0 1.5rem 0;
}
.impressum-table td {
    padding: 3px 14px 3px 0;
    vertical-align: top;
    font-size: 16px;
    line-height: 1.5;
    border: none;
}
.impressum-table td.label {
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-light);
    white-space: nowrap;
    padding-top: 5px;
    min-width: 110px;
}

address {
    font-style: normal;
    margin-bottom: 1.2rem;
    padding: 14px 18px;
    border-left: 3px solid var(--border);
    background: var(--bg-light);
    border-radius: 0 4px 4px 0;
    font-size: 15px;
    line-height: 1.7;
}
address strong { color: var(--primary); display: block; margin-bottom: 4px; }

/* ============================================
   Team Grid
   ============================================ */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    width: 100%;
    margin: 24px 0;
}
.team-card {
    background: var(--bg-light);
    border-radius: 6px;
    border-top: 3px solid var(--primary);
    padding: 20px 16px;
    text-align: center;
}
.team-card h3 { font-size: 16px; margin: 10px 0 4px; }
.team-card p  { font-size: 14px; margin-bottom: 4px; line-height: 1.4; color: var(--text-light); }
.team-card img { width: 120px; height: 120px; margin: 0 auto 12px; border-radius: 50%; object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

/* ============================================
   Service-Liste (Leistungen)
   ============================================ */
.leistungen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}
.leistungen-card {
    padding: 18px 20px;
    background: var(--bg-light);
    border-left: 3px solid var(--primary);
    border-radius: 0 4px 4px 0;
    transition: transform 0.2s, box-shadow 0.2s;
}
.leistungen-card:hover { transform: translateX(4px); box-shadow: 2px 2px 8px rgba(0,0,0,0.08); }
.leistungen-card a { color: var(--primary); font-weight: 600; font-size: 15px; }
.leistungen-card a:hover { text-decoration: none; color: var(--primary-dark); }

/* ============================================
   Kontaktformular
   ============================================ */
.contact-form { margin-top: 1.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-group { display: flex; flex-direction: column; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--primary); margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.04em; }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 1rem;
    background: #fff;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67,88,119,0.1);
}
.contact-form textarea { resize: vertical; min-height: 130px; }
.checkbox-label { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.88rem; cursor: pointer; line-height: 1.5; }
.checkbox-label input { margin-top: 3px; flex-shrink: 0; accent-color: var(--primary); }
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.03em;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.form-success { background: #d4edda; color: #155724; padding: 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: 0.92rem; }
.form-error   { background: #f8d7da; color: #721c24; padding: 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: 0.92rem; }

/* ============================================
   OSM Karte
   ============================================ */
.map-container { margin: 1.5rem 0; border-radius: 4px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
#osm-map { height: 420px; width: 100%; }

/* ============================================
   Online-Formulare Button
   ============================================ */
.btn-formulare {
    display: inline-block;
    background: var(--primary);
    color: #fff !important;
    padding: 14px 28px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    margin: 16px 0;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.04em;
}
.btn-formulare:hover { background: var(--primary-dark); transform: translateY(-1px); text-decoration: none; }

/* ============================================
   Footer
   ============================================ */
.site-footer {
    width: 100%;
    background: var(--primary);
    color: #fff;
    padding: 28px 5%;
    margin-top: 50px;
}
.site-footer .centerer { text-align: center; }
.site-footer a { color: rgba(255,255,255,0.85); margin: 0 8px; transition: color 0.3s; text-decoration: none; font-size: 14px; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.site-footer p { margin-bottom: 6px; font-size: 14px; color: rgba(255,255,255,0.75); }

/* ============================================
   Cookie Banner
   ============================================ */
#cookie-banner {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    background: #fff;
    border-top: 3px solid var(--primary);
    padding: 18px 20px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    display: none;
    text-align: center;
}
#cookie-banner h4 { color: var(--primary); font-family: var(--font-heading); margin-bottom: 6px; }
#cookie-banner p { margin-bottom: 12px; font-size: 13px; max-width: 800px; margin-left: auto; margin-right: auto; line-height: 1.5; }
#cookie-banner button { margin: 0 5px; padding: 9px 18px; border: none; cursor: pointer; border-radius: 4px; font-weight: 600; font-family: var(--font-body); font-size: 14px; }
.btn-cookie-accept { background: var(--primary); color: #fff; }
.btn-cookie-decline { background: #eee; color: #333; }

/* ============================================
   Responsive – Tablet (≤ 900px)
   ============================================ */
@media (max-width: 900px) {
    .content_wrapper { grid-template-columns: 1fr 220px; gap: 28px; }
}

/* ============================================
   Responsive – Mobil (≤ 768px)
   ============================================ */
@media (max-width: 768px) {
    .content_wrapper { grid-template-columns: 1fr; gap: 0; margin-top: 24px; }
    .content-inner   { grid-template-columns: 1fr; gap: 0; margin-top: 24px; }
    .sidebar-right { position: static; margin-top: 28px; }
    .team-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .cm_column_wrapper { grid-template-columns: 1fr; }
    .keyvisual img { height: 220px; min-height: 220px; max-height: 220px; }
    .header-content { padding: 8px 16px; }
    .site-logo img { max-height: 60px; }
    .logo-title { font-size: 1rem; }
    .burger { display: flex; }
    .main-nav {
        display: none;
        position: absolute;
        top: calc(100% + 3px);
        left: 0;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        background: var(--primary);
        padding: 6px 0;
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
        z-index: 1002;
    }
    .main-nav.open { display: block; }
    .main-nav > ul { flex-direction: column; gap: 0; }
    .main-nav > ul > li > a {
        padding: 13px 20px;
        color: #fff;
        font-size: 13px;
        border-bottom: 1px solid rgba(255,255,255,0.12);
        border-bottom-color: rgba(255,255,255,0.12) !important;
    }
    .main-nav > ul > li > a:hover { color: #eee; }

    /* Untermenüs im mobilen Burger: standardmäßig versteckt */
    .main-nav ul ul,
    .main-nav ul.nav-menu ul.sub-menu {
        display: none;
        position: static !important;
        background: rgba(0,0,0,0.22);
        box-shadow: none;
        border: none;
        border-top: none;
        padding: 0;
        margin: 0;
        min-width: 0;
        width: 100%;
        flex-direction: column;
    }
    /* Untermenü sichtbar wenn li.open */
    .main-nav > ul > li.open > ul,
    .main-nav > ul > li.open > ul.sub-menu {
        display: flex !important;
        flex-direction: column;
    }
    .main-nav > ul > li.open > ul > li { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.08); }
    .main-nav ul ul a,
    .main-nav ul ul li a {
        padding: 11px 10px 11px 36px !important;
        color: #fff !important;
        font-size: 13px;
        display: block;
        text-decoration: none;
        font-weight: 400;
    }
    .main-nav ul ul a:hover { color: #dde3ec !important; background: rgba(255,255,255,0.08); }
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 17px; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .team-grid { grid-template-columns: 1fr; }
    .leistungen-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Notar-Portrait (Allgemeines zum Notar)
   ============================================ */
.notar-portrait {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 2rem;
}
.notar-portrait img {
    width: 200px;
    min-width: 200px;
    height: 240px;
    object-fit: cover;
    object-position: center top;
    border-radius: 4px;
    box-shadow: 0 3px 12px rgba(67,88,119,0.18);
    border-top: 3px solid var(--primary);
    display: block;
}
.notar-portrait-text { flex: 1; min-width: 0; }
@media (max-width: 600px) {
    .notar-portrait { flex-direction: column; align-items: center; text-align: center; }
    .notar-portrait img { width: 160px; min-width: 160px; height: 190px; }
}
