/*
Theme Name: Der Kreuznacher
Theme URI: https://derkreuznacher.de
Author: Der Kreuznacher
Author URI: https://derkreuznacher.de
Description: Mobile-first News-Theme für Der Kreuznacher. Optimiert für SEO und schnelle Ladezeiten.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: der-kreuznacher
Tags: news, mobile-first, seo, custom-menu
*/

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #FFF208;
    --color-red: #E30613;
    --color-black: #000000;
    --color-white: #FFFFFF;
    --color-gray-light: #F5F5F5;
    --color-gray: #999999;
    --color-header-bg: #FFF208;
    --font-title: 'Google Sans Flex', 'Impact', 'Arial Black', sans-serif;
    --font-body: 'Arial', 'Helvetica Neue', 'Helvetica', sans-serif;
    --header-height: 120px;
    --max-width: 1080px;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-black);
    background: var(--color-white);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

/* ============================================
   SITE TITLE (Top Bar)
   ============================================ */
.site-title-bar {
    text-align: center;
    padding: 18px 10px 12px;
    background: var(--color-white);
}

.site-title-bar a {
    font-family: var(--font-title);
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 900;
    color: var(--color-black);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1;
}

/* ============================================
   HEADER (Search + Hamburger)
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-header-bg);
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    gap: 12px;
}

@media (min-width: 768px) {
    .site-header {
        height: 50px;
    }
}

/* Search Form */
.header-search {
    flex: 1;
    max-width: 420px;
}

.header-search form {
    display: flex;
    align-items: center;
    gap: 0;
}

.header-search input[type="search"] {
    flex: 1;
    height: 34px;
    border: none;
    border-radius: 20px 0 0 20px;
    padding: 0 16px;
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-black);
}

.header-search input[type="search"]::placeholder {
    color: var(--color-gray);
}

.header-search button {
    height: 34px;
    width: 40px;
    border: none;
    border-radius: 0 20px 20px 0;
    background: var(--color-black);
    color: var(--color-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: opacity 0.2s;
}

.header-search button:hover {
    opacity: 0.8;
}

/* Hamburger Button */
.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-btn span {
    display: block;
    width: 30px;
    height: 3px;
    background: var(--color-black);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================
   MOBILE NAVIGATION OVERLAY
   ============================================ */
.nav-overlay {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    height: 100dvh;
    background: var(--color-white);
    z-index: 200;
    transition: left 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow-y: auto;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.15);
}

.nav-overlay.open {
    left: 0;
}

.nav-overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
}

.nav-overlay-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

.nav-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 2px solid var(--color-black);
}

.nav-overlay-title {
    font-family: var(--font-title);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--color-black);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-black);
    -webkit-tap-highlight-color: transparent;
}

.nav-overlay-menu {
    padding: 30px 25px;
}

.nav-overlay-menu li {
    margin-bottom: 5px;
}

.nav-overlay-menu a {
    display: block;
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-black);
    padding: 12px 0;
    border-bottom: 1px solid var(--color-gray-light);
    transition: color 0.2s;
}

.nav-overlay-menu a:hover,
.nav-overlay-menu a:focus {
    color: var(--color-red);
}

.nav-footer-links {
    padding: 20px 25px 40px;
}

.nav-footer-links a {
    display: block;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-black);
    padding: 8px 0;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.site-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-top: 10px;
}

/* ============================================
   SCHLAGZEILE (Hero / Headline Post)
   ============================================ */
.post-schlagzeile {
    position: relative;
    width: 100%;
    margin-bottom: 5px;
}

.post-schlagzeile a {
    display: block;
    position: relative;
}

.post-schlagzeile .post-thumbnail {
    width: 100%;
    aspect-ratio: 1080 / 600;
    overflow: hidden;
}

.post-schlagzeile .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-schlagzeile .post-title {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-title);
    font-size: clamp(1.4rem, 5.5vw, 3.2rem);
    font-weight: 900;
    color: var(--color-black);
    text-transform: uppercase;
    text-align: center;
    line-height: 1.45;
    padding: 8px 15px;
    width: 95%;
    max-width: 95%;
    margin: 0;
}

.post-schlagzeile .post-title .highlight {
    background: var(--color-primary);
    padding: 4px 14px;
    display: inline;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* ============================================
   NEWS GRID (2 Columns)
   ============================================ */
.news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 0 5px;
    margin-bottom: 20px;
}

.post-news {
    overflow: hidden;
}

.post-news a {
    display: block;
}

.post-news .post-thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.post-news .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-news a:hover .post-thumbnail img,
.post-news a:focus .post-thumbnail img {
    transform: scale(1.03);
}

.post-news .post-meta {
    padding: 8px 5px 2px;
}

.post-news .post-subtitle {
    font-family: var(--font-title);
    font-size: clamp(0.8rem, 3vw, 1rem);
    font-weight: 700;
    color: var(--color-red);
    text-transform: none;
    line-height: 1.3;
    margin: 0 0 3px 0;
}

.post-news .post-title {
    font-family: var(--font-title);
    font-size: clamp(0.9rem, 3.5vw, 1.4rem);
    font-weight: 900;
    color: var(--color-black);
    text-transform: uppercase;
    line-height: 1.2;
    margin: 0;
}

/* ============================================
   SINGLE POST
   ============================================ */
.single-post-content {
    padding: 0 15px 40px;
    max-width: 720px;
    margin: 0 auto;
}

.single-post-header {
    margin-bottom: 20px;
}

.single-post-header .post-category {
    font-family: var(--font-title);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-red);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.single-post-header h1 {
    font-family: var(--font-title);
    font-size: clamp(1.3rem, 4.5vw, 2.5rem);
    font-weight: 900;
    color: var(--color-black);
    text-transform: uppercase;
    line-height: 1.15;
    margin-bottom: 10px;
}

.single-post-header .post-date {
    font-size: 0.85rem;
    color: var(--color-gray);
}

.single-featured-image {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 0;
}

.single-featured-image img {
    width: 100%;
    height: auto;
}

.single-post-body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.75;
    color: #333;
}

.single-post-body p {
    margin-bottom: 1.2em;
}

.single-post-body h2,
.single-post-body h3,
.single-post-body h4 {
    font-family: var(--font-title);
    font-weight: 800;
    color: var(--color-black);
    margin: 1.5em 0 0.5em;
}

.single-post-body h2 {
    font-size: 1.5rem;
}

.single-post-body h3 {
    font-size: 1.25rem;
}

.single-post-body img {
    margin: 1em 0;
    border-radius: 0;
}

.single-post-body blockquote {
    border-left: 4px solid var(--color-primary);
    padding: 15px 20px;
    margin: 1.5em 0;
    background: var(--color-gray-light);
    font-style: italic;
}

.single-post-body ul,
.single-post-body ol {
    margin: 1em 0 1em 25px;
    list-style: disc;
}

.single-post-body ol {
    list-style: decimal;
}

.single-post-body li {
    margin-bottom: 0.5em;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 30px 15px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    border: 2px solid var(--color-black);
    color: var(--color-black);
    background: var(--color-white);
    transition: all 0.2s;
}

.pagination .current,
.pagination a:hover {
    background: var(--color-black);
    color: var(--color-white);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--color-black);
    color: var(--color-white);
    padding: 30px 15px;
    text-align: center;
}

.footer-nav a {
    color: var(--color-white);
    font-family: var(--font-body);
    font-size: 0.9rem;
    margin: 0 10px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-nav a:hover {
    opacity: 1;
}

.footer-copy {
    margin-top: 15px;
    font-size: 0.8rem;
    opacity: 0.5;
}

/* ============================================
   PAGE TEMPLATE
   ============================================ */
.page-content {
    padding: 30px 15px 40px;
    max-width: 720px;
    margin: 0 auto;
}

.page-content h1 {
    font-family: var(--font-title);
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.page-content .entry-content {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.75;
}

.page-content .entry-content p {
    margin-bottom: 1.2em;
}

/* ============================================
   SEARCH RESULTS
   ============================================ */
.search-results-header {
    padding: 25px 15px 15px;
}

.search-results-header h1 {
    font-family: var(--font-title);
    font-size: 1.3rem;
    font-weight: 900;
    text-transform: uppercase;
}

/* ============================================
   404
   ============================================ */
.error-404 {
    text-align: center;
    padding: 60px 15px;
}

.error-404 h1 {
    font-family: var(--font-title);
    font-size: 4rem;
    font-weight: 900;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.error-404 p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.error-404 a {
    display: inline-block;
    background: var(--color-black);
    color: var(--color-white);
    padding: 12px 30px;
    font-weight: 700;
    transition: opacity 0.2s;
}

.error-404 a:hover {
    opacity: 0.8;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background: var(--color-white);
    clip: auto !important;
    display: block;
    font-size: 1rem;
    height: auto;
    left: 5px;
    padding: 15px 23px;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ============================================
   WORDPRESS DEFAULTS
   ============================================ */
.aligncenter {
    display: block;
    margin: 0 auto;
}

.alignleft {
    float: left;
    margin: 0 20px 10px 0;
}

.alignright {
    float: right;
    margin: 0 0 10px 20px;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.85rem;
    color: var(--color-gray);
    padding: 5px 0;
}

/* ============================================
   RESPONSIVE TWEAKS
   ============================================ */
@media (min-width: 768px) {
    /* Header: compact and elegant on desktop */
    .site-header {
        height: 46px;
        padding: 0 20px;
        justify-content: center;
        gap: 20px;
    }

    .header-search {
        max-width: 360px;
    }

    /* Site title: tighter on desktop */
    .site-title-bar {
        padding: 22px 10px 14px;
    }

    .site-title-bar a {
        font-size: 2.8rem;
        letter-spacing: 3px;
    }

    /* Main: centered with generous whitespace */
    .site-main {
        padding-top: 15px;
        max-width: 900px;
    }

    /* Schlagzeile */
    .post-schlagzeile {
        margin-bottom: 15px;
        border-radius: 4px;
        overflow: hidden;
    }

    .post-schlagzeile .post-title {
        bottom: 25px;
        font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    }

    /* News grid: breathing room */
    .news-grid {
        gap: 15px;
        padding: 0;
        margin-bottom: 30px;
    }

    .post-news {
        border-radius: 4px;
        overflow: hidden;
    }

    .post-news .post-meta {
        padding: 12px 8px 8px;
    }

    .post-news .post-subtitle {
        font-size: 0.9rem;
    }

    .post-news .post-title {
        font-size: 1.15rem;
    }
}

@media (min-width: 1080px) {
    .site-main {
        max-width: 860px;
        padding: 20px 0 0;
    }

    .news-grid {
        gap: 20px;
    }
}
