/*
Theme Name: Responsive WP Theme Final 3 Column
Version: 1.0
*/

:root{
    --primary:#07203b;
    --secondary:#12375e;
    --dropdown-offset: 10px;
    --content-width: 1200px;
    --spacing: 2rem;
    --border-radius: 8px;
    --shadow: 0 2px 10px rgba(0,0,0,.08);
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    color:#222;
    background:#f5f5f5;
    line-height: 1.7;
}

a{
    text-decoration:none;
    color: var(--primary);
    transition: color 0.3s;
}

a:hover {
    color: #0a3b6a;
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================
   HEADER
========================== */

.site-header{
    background:var(--primary);
    min-height:16.6vh;
    display:flex;
    justify-content:center;
    align-items:center;
    position:relative;
    padding:0 40px;
    flex-wrap: wrap;
}

.branding{
    position:absolute;
    left:40px;
    font-size:1.6rem;
    font-weight:bold;
}

.branding a{
    color:white;
}

.header-nav-wrapper {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.header-nav{
    display:flex;
    justify-content:center;
}

.header-nav ul{
    list-style:none;
    margin:0;
    padding:0;
}

.header-nav > ul{
    display:flex;
    gap:20px;
    align-items:center;
}

.header-nav li{
    position:relative;
}

.header-nav li a{
    display:block;
    color:white;
    padding:14px 18px;
    transition:.3s;
    white-space: nowrap;
}

.header-nav li:hover > a{
    background:white;
    color:var(--primary);
    border-radius:5px;
}

/* ==========================
   DROPDOWN - Versetzte Untermenüs
========================== */

.header-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--primary);
    min-width: 220px;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    z-index: 999;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.header-nav .sub-menu .sub-menu {
    left: 100%;
    top: 0;
    margin-left: var(--dropdown-offset);
    border-radius: 0 8px 8px 8px;
}

.header-nav .sub-menu .sub-menu .sub-menu {
    left: 100%;
    top: 0;
    margin-left: calc(var(--dropdown-offset) * 1.5);
    border-radius: 0 8px 8px 8px;
}

.header-nav .sub-menu li {
    width: 100%;
}

.header-nav .sub-menu a {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.header-nav .sub-menu li:last-child > a {
    border-bottom: none;
}

.header-nav li:hover > .sub-menu {
    display: block;
}

/* ==========================
   SUBMENU BAR
========================== */

.submenu-bar {
    background: var(--secondary);
    padding: 0 20px;
    border-bottom: 3px solid rgba(255,255,255,0.1);
}

.submenu-container {
    max-width: var(--content-width);
    margin: 0 auto;
}

.submenu-list {
    display: flex;
    list-style: none;
    gap: 0;
    padding: 0;
    margin: 0;
}

.submenu-list li {
    position: relative;
}

.submenu-list li a {
    display: block;
    padding: 15px 25px;
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.submenu-list li a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.submenu-list li a.active {
    color: white;
    border-bottom-color: white;
    background: rgba(255,255,255,0.05);
}

.submenu-list li .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--secondary);
    min-width: 200px;
    list-style: none;
    padding: 0;
    margin: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    z-index: 999;
}

.submenu-list li:hover > .sub-menu {
    display: block;
}

.submenu-list li .sub-menu li a {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.submenu-list li .sub-menu li:last-child a {
    border-bottom: none;
}

.submenu-list li .sub-menu .sub-menu {
    left: 100%;
    top: 0;
}

/* ==========================
   HEADER SEARCH
========================== */

.header-search {
    margin-left: 20px;
}

.header-search form {
    display: flex;
    align-items: center;
}

.header-search input[type="search"] {
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px 0 0 4px;
    background: rgba(255,255,255,0.1);
    color: white;
    outline: none;
    width: 200px;
}

.header-search input[type="search"]::placeholder {
    color: rgba(255,255,255,0.6);
}

.header-search input[type="search"]:focus {
    background: rgba(255,255,255,0.2);
}

.header-search button {
    padding: 8px 15px;
    border: 1px solid rgba(255,255,255,0.3);
    border-left: none;
    border-radius: 0 4px 4px 0;
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    transition: .3s;
}

.header-search button:hover {
    background: rgba(255,255,255,0.3);
}

/* ==========================
   CONTENT - Hauptbereich
   WICHTIG: Sidebar dehnt sich nicht mehr
========================== */

.content-area{
    display:grid;
    grid-template-columns:2fr 300px;
    gap:2rem;
    max-width:var(--content-width);
    margin:2rem auto;
    padding:0 1rem;
    align-items: start; /* Verhindert Dehnung der Sidebar */
}

.site-main{
    background:white;
    border-radius:var(--border-radius);
    padding:2.5rem;
    box-shadow:var(--shadow);
}

.widget-area{
    background:white;
    border-radius:var(--border-radius);
    padding:1.5rem;
    box-shadow:var(--shadow);
    align-self: start; /* Sidebar startet oben, dehnt sich nicht */
    height: auto; /* Nur so hoch wie Inhalt */
}

/* Sidebar ausblenden wenn leer */
.widget-area:empty {
    display: none;
}

/* ==========================
   ENTRY CONTENT - ALLE FORMATIERUNGEN
========================== */

.entry-title {
    margin: 0 0 0.5em 0;
    line-height: 1.3;
    color: var(--primary);
    font-size: 2.2rem;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    margin: 1.5em 0 0.5em 0;
    line-height: 1.3;
    color: var(--primary);
}

.entry-content h1 { font-size: 2.2rem; }
.entry-content h2 { font-size: 1.8rem; border-bottom: 2px solid #eee; padding-bottom: 0.3em; }
.entry-content h3 { font-size: 1.4rem; }
.entry-content h4 { font-size: 1.2rem; }
.entry-content h5 { font-size: 1.1rem; }
.entry-content h6 { font-size: 1rem; }

.entry-content h1:first-child,
.entry-content h2:first-child,
.entry-content h3:first-child,
.entry-content h4:first-child,
.entry-content h5:first-child,
.entry-content h6:first-child {
    margin-top: 0;
}

.entry-content p {
    margin: 0 0 1.5em 0;
    line-height: 1.8;
}

.entry-content ul,
.entry-content ol {
    margin: 0 0 1.5em 2em;
    padding: 0;
}

.entry-content ul {
    list-style: disc !important;
}

.entry-content ol {
    list-style: decimal !important;
}

.entry-content ul ul {
    list-style: circle !important;
    margin-bottom: 0;
}

.entry-content ul ul ul {
    list-style: square !important;
    margin-bottom: 0;
}

.entry-content ol ol {
    list-style: lower-alpha !important;
    margin-bottom: 0;
}

.entry-content ol ol ol {
    list-style: lower-roman !important;
    margin-bottom: 0;
}

.entry-content li {
    margin: 0 0 0.3em 0;
    line-height: 1.7;
}

.entry-content li > ul,
.entry-content li > ol {
    margin-top: 0.3em;
    margin-bottom: 0;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 1.5em 0;
}

.entry-content .alignleft {
    float: left;
    margin: 0.5em 1.5em 1.5em 0;
}

.entry-content .alignright {
    float: right;
    margin: 0.5em 0 1.5em 1.5em;
}

.entry-content .aligncenter {
    display: block;
    margin: 1.5em auto;
}

.entry-content .wp-caption {
    max-width: 100%;
    background: #f9f9f9;
    padding: 10px;
    border-radius: var(--border-radius);
    margin: 1.5em 0;
}

.entry-content .wp-caption img {
    margin: 0;
    border-radius: 4px;
}

.entry-content .wp-caption-text {
    margin: 0.5em 0 0 0;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95rem;
}

.entry-content table th {
    background: var(--primary);
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
}

.entry-content table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.entry-content table tr:nth-child(even) {
    background: #f9f9f9;
}

.entry-content table tr:hover {
    background: #f0f0f0;
}

.entry-content blockquote {
    margin: 1.5em 0;
    padding: 1.5em 2em;
    background: #f9f9f9;
    border-left: 5px solid var(--primary);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

.entry-content blockquote cite {
    display: block;
    margin-top: 0.5em;
    font-style: normal;
    font-weight: bold;
    color: var(--primary);
}

.entry-content code {
    padding: 2px 6px;
    background: #f4f4f4;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: "Courier New", Courier, monospace;
}

.entry-content pre {
    margin: 1.5em 0;
    padding: 1.5em;
    background: #2d2d2d;
    color: #f8f8f2;
    border-radius: var(--border-radius);
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
}

.entry-content pre code {
    padding: 0;
    background: transparent;
    border: none;
    color: inherit;
}

.entry-content hr {
    margin: 2em 0;
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--primary), transparent);
}

.entry-content .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 1.5em 0;
}

.entry-content .gallery-item {
    margin: 0;
}

.entry-content .gallery-caption {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    margin-top: 0.3em;
}

.post-meta {
    padding: 15px 0;
    margin-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 0.9rem;
    color: #666;
}

.post-meta span {
    display: inline-block;
    margin-right: 20px;
}

.post-meta strong {
    color: #333;
}

.post-meta a {
    color: var(--primary);
}

.post-meta a:hover {
    text-decoration: underline;
}

.entry-excerpt {
    margin: 0.5em 0 1.5em 0;
}

.read-more {
    display: inline-block;
    padding: 8px 20px;
    background: var(--primary);
    color: white !important;
    border-radius: 4px;
    transition: all 0.3s;
    font-weight: 500;
}

.read-more:hover {
    background: #0a3b6a;
    text-decoration: none !important;
    transform: translateX(5px);
}

.post-archive-link {
    margin: 30px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 5px;
    text-align: center;
}

.post-archive-link a {
    color: var(--primary);
    font-weight: bold;
}

.post-archive-link a:hover {
    text-decoration: underline;
}

.pagination {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    transition: .3s;
}

.pagination .page-numbers:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    text-decoration: none;
}

.pagination .current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.comments-area {
    margin-top: 2em;
    padding-top: 2em;
    border-top: 2px solid #f0f0f0;
}

.comment-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 1.5em 0 !important;
}

.comment-list li {
    list-style: none !important;
}

.comment {
    padding: 1.5em;
    margin-bottom: 1.5em;
    background: #f9f9f9;
    border-radius: var(--border-radius);
}

.comment .comment-author {
    font-weight: bold;
    color: var(--primary);
}

.comment .comment-meta {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.5em;
}

.comment .reply a {
    font-size: 0.85rem;
    color: var(--primary);
}

.comment .children {
    list-style: none !important;
    margin-left: 2em !important;
    padding-left: 1em !important;
    border-left: 3px solid #e0e0e0;
}

.comment .children li {
    list-style: none !important;
}

.comment-respond {
    margin-top: 2em;
}

.comment-respond label {
    display: block;
    margin-bottom: 0.3em;
    font-weight: 600;
}

.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.comment-respond input[type="text"]:focus,
.comment-respond input[type="email"]:focus,
.comment-respond input[type="url"]:focus,
.comment-respond textarea:focus {
    border-color: var(--primary);
    outline: none;
}

.comment-respond .form-submit input[type="submit"] {
    padding: 10px 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.comment-respond .form-submit input[type="submit"]:hover {
    background: #0a3b6a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(7, 32, 59, 0.3);
}

/* ==========================
   WIDGETS
========================== */

.widget {
    margin-bottom: 30px;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
    font-size: 1.2rem;
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: #333;
    transition: .3s;
}

.widget ul li a:hover {
    color: var(--primary);
    padding-left: 5px;
    text-decoration: none;
}

.categories-widget ul li,
.archive-widget ul li {
    display: flex;
    justify-content: space-between;
}

.categories-widget ul li a,
.archive-widget ul li a {
    flex: 1;
}

.widget_search input[type="search"] {
    width: 70%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

.widget_search button {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.widget_search button:hover {
    background: #0a3b6a;
}

.widget_tag_cloud .tag-cloud-link {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 3px 5px 0;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.85rem !important;
    color: #333;
    transition: all 0.3s;
}

.widget_tag_cloud .tag-cloud-link:hover {
    background: var(--primary);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

/* ==========================
   FOOTER
========================== */

.site-footer{
    background:var(--primary);
    color:white;
    min-height:33.3vh;
    display:flex;
    align-items:center;
}

.wrap{
    max-width:var(--content-width);
    width:100%;
    margin:auto;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:0 20px;
}

.footer-nav ul {
    display: flex;
    gap: 20px;
    list-style: none;
}

.footer-nav a {
    color: white;
    transition: .3s;
}

.footer-nav a:hover {
    opacity: 0.7;
    text-decoration: none;
}

/* ==========================
   MOBILE
========================== */

@media(max-width:900px){
    .site-header {
        min-height:auto;
        flex-direction:column;
        padding:20px;
    }

    .branding {
        position:static;
        margin-bottom:20px;
    }
    
    .header-nav-wrapper {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .header-nav {
        width:100%;
    }

    .header-nav > ul {
        width:100%;
        flex-direction:column;
        gap:0;
    }

    .header-nav li {
        width:100%;
    }

    .header-nav li a {
        padding:12px 15px;
        text-align:center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .header-nav .sub-menu {
        position:static;
        display:block !important;
        background:var(--secondary);
        border-radius:0;
        box-shadow: none;
        margin-left: 15px !important;
    }
    
    .header-nav .sub-menu .sub-menu {
        margin-left: 25px !important;
    }
    
    .header-nav .sub-menu .sub-menu .sub-menu {
        margin-left: 35px !important;
    }

    .header-search {
        margin: 10px 0;
        width: 100%;
    }
    
    .header-search form {
        width: 100%;
    }
    
    .header-search input[type="search"] {
        flex: 1;
    }
    
    .submenu-bar {
        padding: 10px 15px;
    }
    
    .submenu-list {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .submenu-list li a {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .submenu-list li .sub-menu {
        position: static;
        display: block !important;
        background: rgba(0,0,0,0.2);
        border-radius: 0;
        box-shadow: none;
        margin-left: 15px;
    }
    
    .submenu-list li .sub-menu .sub-menu {
        margin-left: 25px;
    }

    .content-area{
        grid-template-columns:1fr;
        gap: 1.5rem;
    }
    
    .site-main {
        padding: 1.5rem;
    }
    
    .widget-area {
        padding: 1.5rem;
    }
    
    .entry-content h1 { font-size: 1.8rem; }
    .entry-content h2 { font-size: 1.5rem; }
    .entry-content h3 { font-size: 1.2rem; }
    
    .entry-content ul,
    .entry-content ol {
        margin-left: 1.2em;
    }
    
    .entry-content .alignleft,
    .entry-content .alignright {
        float: none;
        display: block;
        margin: 1em auto;
    }
    
    .entry-content .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .site-footer{
        min-height:auto;
        padding:30px 0;
    }

    .wrap{
        flex-direction:column;
        gap:20px;
        text-align: center;
    }
    
    .footer-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .post-meta span {
        display: block;
        margin-bottom: 5px;
    }
    
    .comment .children {
        margin-left: 0 !important;
        padding-left: 0 !important;
        border-left: none;
    }
}

/* ==========================
   KLEINE MOBILE
========================== */

@media(max-width:480px){
    .site-main {
        padding: 1rem;
    }
    
    .widget-area {
        padding: 1rem;
    }
    
    .entry-content h1 { font-size: 1.5rem; }
    .entry-content h2 { font-size: 1.3rem; }
    
    .entry-content table {
        font-size: 0.8rem;
    }
    
    .entry-content table th,
    .entry-content table td {
        padding: 6px 10px;
    }
    
    .entry-content blockquote {
        padding: 1em;
    }
    
    .entry-content .gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}