/*
Theme Name: Kaffee & Code V4.1
Theme URI: https://kaffeeundcode.com
Author: Simeon Cirillo
Author URI: https://kaffeeundcode.com
Description: Modern, dark-themed blog with subtle premium enhancements.
Version: 4.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kaffee-code
Tags: dark, minimal, automation
*/

/* =============================================
   0. HERO GRADIENT TEXT & TYPING CURSOR
   ============================================= */
.hero-gradient-text {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 40%, #fbbf24 60%, #f59e0b 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}

.typing-cursor {
    animation: blink 1s step-start infinite;
    font-weight: 300;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* =============================================
   5. DEKORATIVE ELEMENTE (Premium Feel)
   ============================================= */

/* macOS Window Dots for Code Blocks */
pre,
.wp-block-code {
    position: relative;
    padding-top: 2.5rem !important;
    /* Make room for dots */
}

pre::before,
.wp-block-code::before {
    content: "";
    position: absolute;
    top: 0.8rem;
    left: 1rem;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: #ef4444;
    /* Red */
    box-shadow: 1.25rem 0 0 #f59e0b,
        /* Yellow */
        2.5rem 0 0 #10b981;
    /* Green */
    opacity: 0.8;
}

/* Custom Scrollbar Refinement */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #2a2626;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #44403c;
}

/* Link Underline Hover Style */
a:hover {
    text-decoration: underline;
}

/* =============================================
   1. FOUNDATION & RESET
   ============================================= */
body {
    background-color: #0c0a09;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #e7e5e4;
    line-height: 1.5;
    text-align: left;
}

/* Subtle Noise Texture Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.025;
}

#kaffee-app-root {
    font-family: 'Inter', sans-serif;
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background-color: #0c0a09;
}

/* =============================================
   2. ANIMATIONS & KEYFRAMES (WOW Factor)
   ============================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
    }

    50% {
        box-shadow: 0 0 40px rgba(245, 158, 11, 0.3);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Scroll-triggered animation classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-delay-1 {
    transition-delay: 0.1s;
}

.animate-delay-2 {
    transition-delay: 0.2s;
}

.animate-delay-3 {
    transition-delay: 0.3s;
}

/* =============================================
   3. SIDEBAR STYLES
   ============================================= */
.sidebar-legal li a {
    color: #57534e;
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-legal li a:hover {
    color: #a8a29e;
    text-decoration: underline;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #a8a29e;
    transition: all 0.2s;
    text-decoration: none;
}

.sidebar-menu li a:hover,
.sidebar-menu li.current-menu-item a {
    color: #f5f5f4;
    background-color: #292524;
}

.sidebar-menu li.current-menu-item a {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Sidebar Über mich Mini-Profile */
.sidebar-profile {
    padding: 1rem;
    margin: 0 0.5rem 0.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(245, 158, 11, 0.02));
    border: 1px solid rgba(245, 158, 11, 0.1);
}

.sidebar-profile:hover {
    border-color: rgba(245, 158, 11, 0.25);
}

/* =============================================
   4. SEARCH OVERLAY (Cmd+K)
   ============================================= */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

.search-overlay.active {
    display: flex;
}

.search-box {
    width: 90%;
    max-width: 600px;
    background: #1c1917;
    border: 1px solid #44403c;
    border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 60px rgba(245, 158, 11, 0.1);
    overflow: hidden;
    animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-box input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: transparent;
    border: none;
    outline: none;
    color: #f5f5f4;
    font-size: 1.125rem;
    font-family: 'Inter', sans-serif;
}

.search-box input::placeholder {
    color: #57534e;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    border-top: 1px solid #292524;
}

.search-results a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    color: #d6d3d1;
    text-decoration: none;
    transition: all 0.15s;
    border-bottom: 1px solid #1a1a1a;
}

.search-results a:hover {
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
}

.search-results .type-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 0.5rem;
    background: #292524;
    color: #78716c;
    border: 1px solid #44403c;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* =============================================
   5. CARD STYLES (Premium Spotlight Hovers)
   ============================================= */
.kc-card {
    position: relative;
    overflow: hidden;
    background: #1c1917;
    border-radius: 1rem;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s;
}

/* Base border */
.kc-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: #292524;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 10;
}

/* Spotlight Glow */
.kc-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: radial-gradient(400px circle at var(--mouse-x, 0) var(--mouse-y, 0),
            rgba(245, 158, 11, 0.4),
            transparent 40%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 11;
}

.kc-card:hover::after {
    opacity: 1;
}

.kc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(245, 158, 11, 0.05);
}

/* View Count Badge */
.view-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: #78716c;
    font-variant-numeric: tabular-nums;
}

/* =============================================
   6. WP ADMIN BAR FIX
   ============================================= */
body.admin-bar #kaffee-app-root {
    height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar #kaffee-app-root {
        height: calc(100vh - 46px);
    }
}

/* =============================================
   7. SCROLLBARS
   ============================================= */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1c1917;
}

::-webkit-scrollbar-thumb {
    background: #44403c;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #57534e;
}

/* =============================================
   8. PROSE / MARKDOWN CONTENT
   ============================================= */
.prose h2 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1.5rem 0 0.5rem 0;
}

.prose p,
.prose ul,
.prose ol,
.prose li {
    margin-bottom: 1rem;
    color: #d6d3d1;
    line-height: 1.75;
}

.prose strong {
    color: #f5f5f4;
    font-weight: 700;
}

.prose a {
    color: #f59e0b;
    text-decoration: none;
    position: relative;
    transition: color 0.2s ease;
}

/* Cool Underline Slide Effect for links */
.prose a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: #f59e0b;
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.86, 0, 0.07, 1);
}

.prose a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.prose pre {
    background: #1c1917;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    color: #f5f5f4;
    font-family: monospace;
    position: relative;
    border: 1px solid #292524;
}

/* --------------------------------- */
/* macOS Window Dots for Code Blocks */
/* --------------------------------- */
.prose pre,
.wp-block-code {
    position: relative;
    padding-top: 2.5rem !important;
    /* Make room for dots */
}

.prose pre::before,
.wp-block-code::before {
    content: "";
    position: absolute;
    top: 0.8rem;
    left: 1rem;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: #ef4444;
    /* Red */
    box-shadow: 1.25rem 0 0 #f59e0b,
        /* Yellow */
        2.5rem 0 0 #10b981;
    /* Green */
    opacity: 0.8;
}

.prose pre:hover button {
    opacity: 1;
}

/* =============================================
   9. CTA FOOTER
   ============================================= */
.cta-footer {
    background: linear-gradient(135deg, #1c1917 0%, #0a0a0a 50%, #1c1917 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

.cta-glow {
    animation: glowPulse 3s ease-in-out infinite;
}

/* =============================================
   10. RESPONSIVE: TABLET (iPad)
   ============================================= */
@media screen and (min-width: 768px) and (max-width: 1279px) {

    /* Hide desktop sidebar, rely on mobile menu */
    #kaffee-app-root>aside {
        display: none !important;
    }

    /* Show mobile header */
    #kaffee-app-root header.xl\:hidden {
        display: flex !important;
    }

    /* Content adjustments */
    .max-w-4xl {
        max-width: 100%;
    }

    .max-w-6xl {
        max-width: 100%;
    }

    /* Better grid for iPad */
    .grid.md\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

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

    /* Hero text size for iPad */
    .text-\[13vw\] {
        font-size: 8vw;
    }
}

/* =============================================
   11. RESPONSIVE: MOBILE (iPhone)
   ============================================= */
@media screen and (max-width: 767px) {

    /* Sidebar mobile overlay */
    #kaffee-app-root>aside {
        position: fixed;
        top: 0;
        left: 0;
        width: 85vw;
        max-width: 300px;
        height: 100vh;
        z-index: 100;
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.5);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    #kaffee-app-root>aside.mobile-open {
        transform: translateX(0);
        display: flex !important;
    }

    /* Mobile overlay backdrop */
    .mobile-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 99;
        display: none;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .mobile-backdrop.active {
        display: block;
    }

    /* Larger tap targets */
    .sidebar-menu li a {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        min-height: 48px;
    }

    /* Mobile Hero */
    .text-\[13vw\] {
        font-size: 15vw;
    }

    /* Single column grids */
    .grid.md\:grid-cols-2,
    .grid.md\:grid-cols-3,
    .grid.lg\:grid-cols-3 {
        grid-template-columns: 1fr;
    }

    /* Better card spacing */
    .kc-card {
        margin-bottom: 1rem;
    }

    /* Search padding */
    .search-box {
        width: 95%;
        border-radius: 0.75rem;
    }

    .search-box input {
        padding: 1rem;
        font-size: 1rem;
    }

    /* Touch-friendly buttons */
    a,
    button {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Prevent horizontal scroll */
    #main-content {
        overflow-x: hidden;
    }
}

/* =============================================
   12. SAFE AREA (iPhone Notch / Dynamic Island)
   ============================================= */
@supports (padding: env(safe-area-inset-top)) {
    header {
        padding-top: env(safe-area-inset-top);
    }

    .cta-footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* =============================================
   13. PREFERS REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}