/*
Theme Name: RICCT Base Theme
Theme URI: https://deine-domain.de
Author: Dein Name
Author URI: https://deine-domain.de
Description: Ein responsives Basis-Theme mit 3-Spalten-Layout, sauber und sicher.
Version: 1.1
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rwp
Tags: blog, news, responsive, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
    --primary: #0b381b;
    --secondary: #12375e;
    --dropdown-offset: 10px;
    /* 1920px Referenzbreite minus 5% Luft (2.5% je Seite) = 1824px */
    --content-width: 1824px;
    --spacing: 2rem;
    --border-radius: 8px;
    --shadow: 0 2px 10px rgba(0, 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(--header-bg, var(--primary));
    color: var(--header-text, #fff);
    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: var(--header-text, #fff);
}
.branding a:hover {
    text-decoration: none;
}

.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: var(--header-text, #fff);
    padding: 14px 18px;
    transition: 0.3s;
    white-space: nowrap;
}
.header-nav li:hover > a {
    background: #fff;
    color: var(--primary);
    border-radius: 5px;
}

/* Dropdown */
.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;
}

/* 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: var(--header-text, #fff);
    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: var(--header-text, #fff);
    cursor: pointer;
    transition: 0.3s;
}
.header-search button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==========================
   CONTENT AREA – dynamische Breite
========================== */
.content-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 95%;
    max-width: var(--content-width);
    margin: 2rem auto;
    padding: 0 1.5rem;
    align-items: start;
}

/* Sidebar aktiv → 2 Spalten */
.content-area.has-sidebar {
    grid-template-columns: 2.5fr 350px;
}

/* Sidebar deaktiviert → volle Breite */
.content-area.no-sidebar {
    grid-template-columns: 1fr;
    width: 95%;
    max-width: var(--content-width);
}

.site-main {
    background: var(--content-bg, #fff);
    color: var(--content-text, #222);
    border-radius: var(--border-radius);
    padding: 3rem;
    box-shadow: var(--shadow);
}

.widget-area {
    background: var(--content-bg, #fff);
    color: var(--content-text, #222);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    align-self: start;
    height: auto;
}
.widget-area:empty {
    display: none;
}

/* ==========================
   ENTRY CONTENT
========================== */
.entry-title {
    margin: 0 0 0.5em 0;
    line-height: 1.3;
    color: var(--primary);
    font-size: 2.5rem;
}

.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.5rem;
}
.entry-content h2 {
    font-size: 2rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.3em;
}
.entry-content h3 {
    font-size: 1.6rem;
}
.entry-content h4 {
    font-size: 1.3rem;
}
.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;
    font-size: 1.05rem;
}

.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: #fff;
    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(250px, 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
========================== */
.post-meta {
    padding: 15px 0;
    margin-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 0.95rem;
    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;
}

.read-more {
    display: inline-block;
    padding: 10px 25px;
    background: var(--primary);
    color: #fff !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
========================== */
.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: 0.3s;
}
.pagination .page-numbers:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    text-decoration: none;
}
.pagination .current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ==========================
   COMMENTS
========================== */
.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: #fff;
    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);
}

/* ==========================
   LOGIN-SEITE (page-login.php)
========================== */
.content-area.login-page {
    width: 95%;
    max-width: 460px;
    margin: 4rem auto;
}
.login-card {
    background: var(--content-bg, #fff);
    color: var(--content-text, #222);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    max-width: 460px;
    width: 95%;
    margin: 2rem auto;
    text-align: center;
}
.login-page .site-main {
    padding: 2.5rem;
    text-align: center;
}
.login-card-header h1 {
    margin: 0 0 0.4rem;
    font-size: 1.6rem;
}
.login-card-header p {
    margin: 0 0 1.8rem;
    color: #666;
}
.login-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    text-align: left;
    font-size: 0.95rem;
}
.login-notice p {
    margin: 0;
}
.login-notice.login-error {
    background: #fdecea;
    border: 1px solid #f5c2c0;
    color: #a33a34;
}
.login-notice.login-success {
    background: #e9f7ef;
    border: 1px solid #b7e4c7;
    color: #1e7e45;
}
.custom-login-form {
    text-align: left;
}
.login-field {
    margin-bottom: 1.2rem;
}
.login-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.95rem;
}
.login-field input[type="text"],
.login-field input[type="password"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}
.login-field input[type="text"]:focus,
.login-field input[type="password"]:focus {
    border-color: var(--primary);
    outline: none;
}
.login-field-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.login-field-checkbox label {
    margin-bottom: 0;
    font-weight: 400;
}
.login-submit {
    margin-top: 1.6rem;
}
.login-submit input[type="submit"] {
    width: 100%;
    padding: 12px 30px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.login-submit input[type="submit"]:hover {
    filter: brightness(1.12);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}
.login-lost-password {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .content-area.login-page {
        margin: 2rem auto;
    }
    .login-page .site-main {
        padding: 1.8rem;
    }
}

/* ==========================
   WIDGETS
========================== */
.widget {
    margin-bottom: 30px;
}
.widget:last-child {
    margin-bottom: 0;
}
.widget .widget-title,
.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: 0.3s;
}
.widget ul li a:hover {
    color: var(--primary);
    padding-left: 5px;
    text-decoration: none;
}
.widget select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.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: #fff;
    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: #fff;
    text-decoration: none;
    transform: translateY(-2px);
}
.widget_calendar table {
    width: 100%;
    border-collapse: collapse;
}
.widget_calendar table th,
.widget_calendar table td {
    padding: 5px;
    text-align: center;
    border: 1px solid #eee;
}
.widget_calendar table th {
    background: var(--primary);
    color: #fff;
}
.widget_calendar table #today {
    background: #f0f0f0;
    font-weight: bold;
}

/* ==========================
   FOOTER
========================== */
.site-footer {
    background: var(--footer-bg, var(--primary));
    color: var(--footer-text, #fff);
    min-height: 33.3vh;
    display: flex;
    align-items: center;
}
.wrap {
    width: 95%;
    max-width: var(--content-width);
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    text-align: center;
}
.footer-nav ul {
    display: flex;
    gap: 20px;
    list-style: none;
}
.footer-nav a {
    color: var(--footer-text, #fff);
    transition: 0.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;
    }

    .content-area {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    .content-area.has-sidebar {
        grid-template-columns: 1fr !important;
    }

    .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 p {
        font-size: 1rem;
    }
    .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;
    }
    .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;
    }
}

@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 p {
        font-size: 0.95rem;
    }
    .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));
    }
}

/* ==========================
   HEADER WIDGET
========================== */
.header-widget-area {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
    color: var(--header-text, #fff);
}
.header-widget {
    font-size: 0.9rem;
}
.header-widget a {
    color: var(--header-text, #fff);
    text-decoration: none;
}
.header-widget a:hover {
    text-decoration: underline;
}
.header-widget-title {
    display: none; /* oder ausblenden, falls nicht benötigt */
}

/* ==========================
   FOOTER WIDGET
========================== */
.footer-widget-area {
    flex: 1;
    text-align: left;
}
.footer-widget {
    font-size: 0.9rem;
}
.footer-widget a {
    color: var(--footer-text, #fff);
}
.footer-widget a:hover {
    text-decoration: underline;
}
.footer-widget-title {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Mobile Anpassungen */
@media (max-width: 900px) {
    .header-widget-area {
        margin-left: 0;
        flex-wrap: wrap;
        justify-content: center;
    }
    .footer-widget-area {
        text-align: center;
    }
}