/*
Theme Name: CRS - Theme
Theme URI: https://crs-webdesign.ch
Description: Massgeschneidertes, blitzschnelles WordPress-Theme von CRS-Webdesign – komplett ohne unnötigen Code-Ballast oder externes Tracking. Bietet flexible Navigations-Positionen, freie Farbwahl für Desktop und Smartphone im Customizer, bis zu vier Menü-Positionen, 3 Footer-Widget-Spalten sowie wählbare Seitenvorlagen (Standard & Ganze Seite) – optimal für Classic Editor & SiteOrigin Page Builder.
Version: 1.8.2
Author: CRS-Webdesign
Author URI: https://crs-webdesign.ch
License: GNU General Public License v2 or later
Text Domain: crs-custom
*/

/* =========================================================
   1. GLOBALE DEFAULTS & BASIS-LAYOUT
   ========================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333333;
    background-color: #ffffff;
    line-height: 1.6;
}

a {
    color: #0056b3;
    text-decoration: none;
    transition: color 0.2s;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================================
   2. TOP-BAR (ZUSATZMENÜ 1)
   ========================================================= */
.top-bar {
    background-color: #2b2b2b;
    padding: 6px 0;
    font-size: 13px;
}

.top-bar ul {
    display: flex;
    justify-content: flex-end;
    list-style: none;
    gap: 20px;
}

.top-bar a {
    color: #dddddd;
}

.top-bar a:hover {
    color: #ffffff;
}

/* =========================================================
   3. HEADER, LOGO & FLEXIBLE NAVIGATION
   ========================================================= */
.site-header {
    position: relative;
    background-color: #ffffff;
    border-bottom: 1px solid #eeeeee;
    z-index: 1000;
}

.site-header.is-sticky {
    position: sticky;
    top: 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
}

.site-logo img,
.custom-logo {
    max-height: 60px;
    width: auto;
}

.site-title-link {
    font-size: 24px;
    font-weight: 700;
    color: #333333;
}

/* Layout-Option: Logo links, Navi mittig */
.site-header.layout-inline-center .header-container {
    justify-content: flex-start;
    gap: 40px;
}

.site-header.layout-inline-center .main-navigation {
    margin: 0 auto;
}

/* Layout-Optionen: Logo oben, durchgehende Navi-Leiste darunter */
.site-header.layout-below-left .header-container,
.site-header.layout-below-center .header-container {
    height: auto;
    padding-top: 20px;
    padding-bottom: 20px;
}

.site-header.layout-below-left .site-logo img,
.site-header.layout-below-center .site-logo img,
.site-header.layout-below-left .custom-logo,
.site-header.layout-below-center .custom-logo {
    max-height: 85px;
    width: auto;
}

.nav-bar-wrapper {
    width: 100%;
    padding: 0;
}

.site-header.layout-below-center .nav-bar-wrapper > .container > .main-navigation > ul {
    justify-content: center;
}

/* Burger-Button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1002;
}

.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background-color: #333333;
    transition: 0.3s;
}

/* =========================================================
   4. DESKTOP-NAVIGATION & DROPDOWN-UNTERMENÜS (ab 769px)
   ========================================================= */
@media (min-width: 769px) {
    .main-navigation > ul {
        display: flex;
        list-style: none;
        gap: 0;
        margin: 0;
        padding: 0;
    }

    .main-navigation ul li {
        position: relative;
    }

    .main-navigation > ul > li > a {
        display: block;
        padding: 16px 24px;
        font-size: 16px;
        font-weight: 500;
        transition: background-color 0.2s, color 0.2s;
    }

    .site-header.layout-inline-right .main-navigation > ul > li > a,
    .site-header.layout-inline-center .main-navigation > ul > li > a {
        line-height: 90px;
        padding-top: 0;
        padding-bottom: 0;
    }

    /* Dropdown-Untermenü (1. Ebene) */
    .main-navigation ul ul.sub-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 220px;
        background-color: #d32f2f;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
        z-index: 9999;
        flex-direction: column;
        gap: 0;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .main-navigation ul li:hover > ul.sub-menu,
    .main-navigation ul li:focus-within > ul.sub-menu {
        display: flex;
    }

    .main-navigation ul ul.sub-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .main-navigation ul ul.sub-menu li:last-child {
        border-bottom: none;
    }

    .main-navigation ul ul.sub-menu a {
        display: block;
        padding: 12px 18px;
        color: #ffffff;
        font-size: 15px;
        font-weight: 500;
        white-space: nowrap;
        transition: background-color 0.2s;
    }

    .main-navigation ul ul.sub-menu a:hover {
        background-color: rgba(0, 0, 0, 0.15);
    }

    /* Dropdown-Untermenü (2. Ebene) */
    .main-navigation ul ul.sub-menu ul.sub-menu {
        top: 0;
        left: 100%;
    }
}

/* =========================================================
   5. STARTSEITE (SLIDER, WILLKOMMEN & 4-SPALTEN-KOMPETENZEN)
   ========================================================= */
.hero-slider-section {
    width: 100%;
    overflow: hidden;
    background-color: #f5f5f5;
}

.hero-slider-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
}

.hero-slider-inner .metaslider {
    margin: 0 auto !important;
}

.welcome-section {
    padding: 60px 0;
    text-align: center;
}

.welcome-section h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #111111;
}

.welcome-section p {
    font-size: 18px;
    max-width: 800px;
    margin: 0 auto 15px auto;
    color: #666666;
}

.competences-section {
    padding: 40px 0 80px 0;
}

.competences-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.competence-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.competence-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.competence-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.competence-card h3 {
    margin: 20px 0 10px 0;
    font-size: 20px;
    color: #111111;
    padding: 0 15px;
}

.competence-card p {
    font-size: 14px;
    color: #666666;
    padding: 0 15px;
    margin-bottom: 20px;
    flex-grow: 1;
}

.btn-more {
    display: inline-block;
    padding: 8px 20px;
    background-color: #333333;
    color: #ffffff;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s;
    align-self: center;
}

.btn-more:hover {
    background-color: #d32f2f;
    color: #ffffff;
}

/* =========================================================
   6. SEITENVORLAGEN & SITEORIGIN PAGE BUILDER SUPPORT
   ========================================================= */
.page-standard-section {
    padding: 60px 0;
}

.page-standard-section h1 {
    font-size: 32px;
    margin-bottom: 25px;
    color: #111111;
}

.page-fullwidth-section {
    width: 100%;
    padding: 0;
}

/* Saubere Integration für SiteOrigin Rows */
.panel-grid {
    margin-bottom: 0 !important;
}

/* =========================================================
   7. FOOTER, WIDGET-SPALTEN & ZUSATZMENÜS 2 & 3
   ========================================================= */
.site-footer {
    background-color: #1f2421;
    color: #ffffff;
    padding: 50px 0 20px 0;
    font-size: 15px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-grid.footer-cols-1 {
    grid-template-columns: 1fr;
}

.footer-grid.footer-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.footer-grid.footer-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.footer-col h4,
.footer-widget-title {
    font-size: 18px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 8px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col p {
    margin-bottom: 10px;
}

.footer-col a {
    color: #bbbbbb;
}

.footer-col a:hover {
    color: #ffffff;
}

.btn-download {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0056b3;
    color: #ffffff !important;
    border-radius: 4px;
    margin-top: 10px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 20px;
    color: #888888;
    font-size: 13px;
}

.footer-legal-menu {
    display: flex;
    list-style: none;
    gap: 20px;
}

.footer-legal-menu a {
    color: #888888;
}

.footer-legal-menu a:hover {
    color: #ffffff;
}

/* =========================================================
   8. RESPONSIVE DESIGN (TABLET & SMARTPHONE)
   ========================================================= */
@media (max-width: 992px) {
    .competences-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid,
    .footer-grid.footer-cols-2,
    .footer-grid.footer-cols-3 {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .site-header.layout-below-left .nav-bar-wrapper,
    .site-header.layout-below-center .nav-bar-wrapper {
        padding: 0;
    }

    /* Mobile Navigation: Volle Bildschirmbreite ohne seitliches Padding */
    .main-navigation {
        display: none;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1001;
        background-color: #ffffff;
        border-bottom: 1px solid #eeeeee;
        padding: 10px 0;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    }

    .main-navigation.is-active {
        display: block !important;
    }

    .main-navigation ul {
        display: flex;
        flex-direction: column;
        list-style: none;
        width: 100%;
        margin: 0;
        padding: 0;
        gap: 0;
    }

    .main-navigation ul li {
        width: 100%;
    }

    .main-navigation a {
        display: block;
        width: 100%;
        padding: 12px 20px;
        border-radius: 0;
        font-weight: 600;
        font-size: 16px;
    }

    .main-navigation ul ul.sub-menu {
        display: flex;
        flex-direction: column;
        list-style: none;
        width: 100%;
        padding: 0;
        margin: 0;
        gap: 0;
        border-left: none;
        background: transparent !important;
        box-shadow: none !important;
        position: static !important;
    }

    .main-navigation ul ul.sub-menu a {
        padding-left: 36px;
    }

    /* Burger-Animation zum X */
    .menu-toggle.is-active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.is-active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .menu-toggle.is-active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Kompaktere Seitenabstände auf dem Smartphone */
    .page-standard-section {
        padding: 30px 0;
    }

    .page-standard-section h1 {
        margin-bottom: 15px;
    }

    .welcome-section {
        padding: 30px 0 20px 0;
    }

    .welcome-section h1 {
        margin-bottom: 12px;
    }

    .competences-section {
        padding: 20px 0 50px 0;
    }

    /* Startseiten-Kacheln auf Smartphone sauber zentrieren */
    .competences-grid {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 20px;
    }

    .competence-card {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}
