/* Non-Critical CSS - Wird asynchron geladen */

/* Layout Shift Optimierungen */
.content-wrapper {
    min-height: 600px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding: 20px;
    box-sizing: border-box;
}

.content-inner {
    min-height: 500px;
    width: 100%;
    padding: 20px 0;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    box-sizing: border-box;
}

/* Font-Loading optimieren */
body {
    font-display: swap;
    font-size: 16px;
    line-height: 1.5;
    /* System-Font-Stack für bessere Performance */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, Arial, sans-serif;
}

/* Stabile Typografie */
h1, h2, h3, h4, h5, h6 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    line-height: 1.2;
    margin: 0 0 1rem 0;
    font-weight: bold;
    min-height: 1.2em;
}

p {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    line-height: 1.6;
    margin: 0 0 1rem 0;
    min-height: 1.6em;
}

/* Content-spezifische Typografie */
.content-inner h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin: 0 0 1.5rem 0;
    font-weight: bold;
    min-height: 3rem;
}

.content-inner p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    min-height: 1.6rem;
}

.content-inner h2 {
    font-size: 2rem;
    line-height: 1.3;
    margin: 0 0 1rem 0;
    font-weight: bold;
    min-height: 2.6rem;
}

.content-inner h3 {
    font-size: 1.5rem;
    line-height: 1.4;
    margin: 0 0 0.8rem 0;
    font-weight: bold;
    min-height: 2.1rem;
}

/* Content-Stabilität */
.content {
    min-height: 400px;
    padding: 20px;
    text-align: center;
    margin: auto;
    max-width: 90%;
}

/* Content-Loading optimiert für SEO */
.content-wrapper {
    min-height: 400px;
}

/* Bildoptimierungen für bessere CLS-Performance */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Explizite Bildgrößen für bessere CLS */
.header img {
    width: 750px;
    height: 225px;
    object-fit: contain;
}

.content img {
    width: 100%;
    max-width: 800px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Responsive Bildgrößen */
@media (max-width: 768px) {
    .header img {
        width: 562px;
        height: 168px;
    }
    
    .content img {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 1 / 1;
    }
}

@media (min-width: 1200px) {
    .content img {
        max-width: 600px;
        width: 600px;
        aspect-ratio: 1 / 1;
    }
}

/* Spezielle Bildgrößen für verschiedene Bildtypen */
img[src*="tiefergelegt_logo"] {
    width: 750px;
    height: 225px;
    object-fit: contain;
}

img[src*="sportwagen-tuning"],
img[src*="classic-cars"],
img[src*="elektroauto"],
img[src*="verbrenner-tuning"],
img[src*="zweirad-tuning"],
img[src*="tuning-merch-shop"] {
    width: 100%;
    max-width: 800px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

@media (max-width: 768px) {
    img[src*="tiefergelegt_logo"] {
        width: 562px;
        height: 168px;
    }
    
    img[src*="sportwagen-tuning"],
    img[src*="classic-cars"],
    img[src*="elektroauto"],
    img[src*="verbrenner-tuning"],
    img[src*="zweirad-tuning"],
    img[src*="tuning-merch-shop"] {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 1 / 1;
    }
}

/* Footer Styles */
.footer {
    background-color: #222;
    color: white;
    text-align: center;
    padding: 10px;
}

.footer a {
    color: white;
    text-decoration: none;
    padding: 0 10px;
}

.footer a:hover {
    text-decoration: underline;
}

/* Content Links */
.content a {
    color: #fd900d;
    text-decoration: none;
    padding: 0 10px;
}

.content a:hover {
    text-decoration: underline;
}

/* Categorie Styles */
.page-categories {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #444;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.categories-label {
    margin-right: 10px;
    color: #aaa;
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-list li {
    background-color: #222;
    padding: 5px 15px;
    border-radius: 20px;
}

.categories-list a {
    color: #fd900d;
    text-decoration: none;
}

.categories-list a:hover {
    text-decoration: underline;
}

.category-description {
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.subcategories-list {
    margin-bottom: 30px;
}

.subcategories-list ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.subcategories-list li {
    background-color: #222;
    padding: 5px 15px;
    border-radius: 20px;
}

.subcategories-list a {
    color: #fd900d;
    text-decoration: none;
}

.category-pages {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.category-page-item {
    background-color: #222;
    border-radius: 4px;
    padding: 20px;
    transition: transform 0.2s;
}

.category-page-item:hover {
    transform: translateY(-5px);
}

.category-page-item h2 {
    margin-top: 0;
    font-size: 1.4em;
}

.category-page-item a {
    color: #fd900d;
    text-decoration: none;
}

.category-page-excerpt {
    margin: 15px 0;
    color: #ccc;
    line-height: 1.6;
}

.category-page-readmore {
    text-align: right;
}

/* Dropdown Navigation */
.main-nav {
    position: relative;
}

.main-nav .dropdown {
    position: relative;
}

.main-nav .dropdown-toggle {
    cursor: pointer;
}

.main-nav .dropdown-icon {
    font-size: 0.8em;
    margin-left: 5px;
}

.main-nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #222;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 0 0 4px 4px;
}

.main-nav .dropdown:hover .dropdown-menu {
    display: block;
}

.main-nav .dropdown-menu li {
    display: block;
    position: relative;
}

.main-nav .dropdown-menu a {
    padding: 10px 15px;
    display: block;
    white-space: nowrap;
}

.main-nav .dropdown-menu a:hover {
    background-color: #333;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .main-nav .dropdown-menu {
        position: static;
        box-shadow: none;
        background-color: #333;
        width: 100%;
        padding-left: 20px;
    }
    
    .main-nav li {
        display: block;
    }
}

/* Touch-Geräte Optimierungen */
@media (hover: none) and (pointer: coarse) {
    .main-nav .dropdown:hover .dropdown-menu {
        display: none;
    }
    
    .main-nav .dropdown.open .dropdown-menu {
        display: block;
    }
}
