/*
Theme Name: 332Craft Handball Hub
Author: 332Craft Media
Description: Das ultimative Handball-Portal. Taktische Meisterschaft, Live-Ticker und tiefgehende Analysen der Bundesliga und internationaler Turniere.
Version: 1.0.0
*/

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;700;800&family=Inter:wght@300;400;600&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    /* Court Blue & Sport Orange Palette (High Energy) */
    --primary: #FF5722;        /* Handball Orange */
    --secondary: #1A237E;      /* Deep Court Blue */
    --accent: #00BFA5;         /* Tactical Teal */
    --black: #0D1117;
    --white: #FFFFFF;
    --bg-main: #F8FAFC;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border: rgba(26, 35, 126, 0.1);
    
    --container-width: 1300px;
    --content-width: 900px;
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);

    /* Adaptive Design Variables */
    --section-pad: clamp(5rem, 12vw, 10rem);
    --hero-pad: clamp(8rem, 20vw, 15rem);
}

/* Global Reset - Axis V-A: Soft Minimalism / Glassmorphism */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
    max-width: 100%;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
}

/* Fluid Typography - Rule 14 & Rule 22 */
h1, h2, h3, .logo, .footer-logo {
    overflow-wrap: break-word;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    letter-spacing: -0.01em; /* Relaxed from -0.03em */
    text-wrap: balance; /* Modern text balancing */
    hyphens: auto; /* Handle long German words */
    word-break: normal;
}

/* Rule 14: Safe h1 threshold 1.8rem */
h1 { font-size: clamp(1.8rem, 12vw, 9rem); line-height: 1.0; color: var(--secondary); margin-bottom: 3rem; }
h2 { font-size: clamp(1.6rem, 7vw, 5rem); line-height: 1.1; color: var(--secondary); margin-bottom: 4rem; }
h3 { font-size: clamp(1.2rem, 3.5vw, 2.2rem); line-height: 1.2; color: var(--secondary); }

.mono { font-family: 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.8rem; }

img { max-width: 100%; height: auto; display: block; border-radius: 24px; }

a { text-decoration: none; color: inherit; transition: var(--transition); }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2.5rem;
}

/* DNA N-C: Always Hamburger Architecture */
.site-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 2rem 0;
    z-index: 2000;
    transition: var(--transition);
}
.site-header.scrolled { background: rgba(255,255,255,0.8); backdrop-filter: blur(10px); padding: 1.5rem 0; }

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    color: var(--secondary);
    z-index: 2100;
}
.logo span { color: var(--primary); }

.nav-toggle {
    width: 60px; height: 60px;
    background: var(--secondary);
    border-radius: 50% !important;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    z-index: 2100;
    transition: var(--transition);
}
.nav-toggle span { width: 24px; height: 2px; background: var(--white); transition: var(--transition); }
.nav-toggle:hover { transform: scale(1.1) rotate(90deg); background: var(--primary); }

.main-nav {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background: var(--secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    /* Pull extra 2px beyond viewport to kill subpixel bleed */
    transform: translateY(calc(-100% - 2px));
    /* visibility delay matches transform duration so nav hides after slide-up */
    visibility: hidden;
    transition: transform 0.6s cubic-bezier(0.85, 0, 0.15, 1),
                visibility 0s linear 0.6s;
    z-index: 1990;
}
.main-nav.is-active {
    transform: translateY(0);
    visibility: visible;
    /* On open: show immediately, then animate transform */
    transition: transform 0.6s cubic-bezier(0.85, 0, 0.15, 1),
                visibility 0s linear 0s;
}

.main-nav ul { list-style: none; text-align: center; }
.main-nav li { margin-bottom: 2rem; overflow: hidden; }
.main-nav a { 
    font-family: 'Syne', sans-serif;
    font-size: clamp(2rem, 8vw, 6rem);
    font-weight: 800;
    color: var(--white);
    text-transform: uppercase;
    display: block;
}
.main-nav a:hover { color: var(--primary); transform: skewX(-10deg); }

/* DNA H-C: Type-Only Hero (Typography focus) */
.hero-332craft {
    padding-top: var(--hero-pad);
    padding-bottom: var(--section-pad);
    background: radial-gradient(circle at top right, rgba(255, 87, 34, 0.05), transparent);
    text-align: center;
}
.hero-332craft h1 span { color: var(--primary); -webkit-text-stroke: 1px var(--secondary); color: transparent; }

/* DNA U-C: Horizontal Scroll Strip (Live Ticker) */
.ticker-wrap {
    background: var(--secondary);
    padding: 1.5rem 0;
    overflow: hidden;
    white-space: nowrap;
    border-top: 4px solid var(--primary);
}
.ticker-content {
    display: inline-block;
    animation: ticker 30s linear infinite;
    color: var(--white);
    font-family: 'JetBrains Mono';
    font-weight: 700;
}
.ticker-item { display: inline-block; margin-right: 6rem; }
.ticker-item span { color: var(--primary); }

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* DNA F-B: Icon Grid (Tactical Features) */
.handball-features { padding: var(--section-pad) 0; }
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}
.feature-card {
    background: var(--white);
    padding: 3rem; /* More space for text */
    border-radius: 40px !important;
    border: 1px solid var(--border);
    transition: var(--transition);
    text-align: left;
    display: flex;
    flex-direction: column;
}
.feature-card h3 { margin-bottom: 1.5rem; word-break: break-word; }
.feature-card:hover { transform: translateY(-15px); box-shadow: 0 30px 60px rgba(26, 35, 126, 0.1); }
.feature-icon { font-size: 3.5rem; margin-bottom: 2rem; display: block; }
.feature-card p { color: var(--text-muted); }

/* DNA C-B: Horizontal Cards (News Flow) */
.posts-section { padding: var(--section-pad) 0; background: var(--white); }

.handball-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 6rem;
}

.post-card-horiz {
    display: grid;
    grid-template-columns: 400px 1fr;
    background: var(--bg-main);
    border-radius: 32px !important;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
}
.post-card-horiz:hover { transform: scale(1.02); background: var(--white); box-shadow: 0 20px 40px rgba(0,0,0,0.05); }

.post-card-horiz .thumb { height: 300px; overflow: hidden; }
.post-card-horiz .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0 !important; }

.post-card-horiz .content { padding: 3rem; display: flex; flex-direction: column; justify-content: center; }
.post-card-horiz h3 { margin-bottom: 1.5rem; font-size: 2.2rem; }

.btn-tactics {
    display: inline-flex;
    padding: 1rem 3rem;
    background: var(--secondary);
    color: var(--white);
    border-radius: 50px !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    width: fit-content;
}
.btn-tactics:hover { background: var(--primary); }

/* Pagination - Minimalist Circles */
.pagination { display: flex; justify-content: center; gap: 1rem; margin-top: 6rem; }
.pagination .page-numbers {
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
    background: var(--white);
    border-radius: 50% !important;
    font-weight: 700;
    border: 1px solid var(--border);
}
.pagination span.current, .pagination a:hover { background: var(--secondary); color: var(--white); }

/* DNA FT-C: Three-column Footer */
.site-footer {
    background: var(--secondary);
    color: var(--white);
    padding: 10rem 0 5rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 6rem;
    margin-bottom: 8rem;
}
.footer-logo { font-size: 3rem; color: var(--white); margin-bottom: 3rem; overflow-wrap: anywhere; }
.footer-logo span { color: var(--primary); }
.footer-desc { color: rgba(255,255,255,0.5); font-size: 1.1rem; max-width: 500px; overflow-wrap: break-word; }

.footer-title { color: var(--primary); text-transform: uppercase; font-family: 'JetBrains Mono'; margin-bottom: 2.5rem; }
.footer-nav ul { list-style: none; }
.footer-nav li { margin-bottom: 1rem; }
.footer-nav a:hover { color: var(--primary); }

.footer-bottom {
    padding-top: 4rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: space-between; font-size: 0.8rem; font-family: 'JetBrains Mono'; opacity: 0.4;
}

/* Rule 22: Content Protocol */
.post-main { max-width: var(--content-width); margin: 12rem auto; padding: 0 2rem; }
.post-header { margin-bottom: 6rem; text-align: left; border-left: 20px solid var(--primary); padding-left: 4rem; }
.post-meta { color: var(--primary); font-weight: 800; margin-bottom: 2rem; display: block; font-family: 'Syne'; text-transform: uppercase; }
.post-content h2, .post-content h3 { margin: 6rem 0 3rem; color: var(--secondary); }
.post-content p { font-size: 1.2rem; margin-bottom: 2.5rem; color: var(--text-main); }
.post-content table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: 24px !important; overflow: hidden; margin: 5rem 0; }
.post-content th { background: var(--bg-main); color: var(--secondary); padding: 2rem; text-align: left; }
.post-content td { padding: 2rem; border-top: 1px solid var(--border); }

/* Responsive */
@media (max-width: 1024px) {
    .post-card-horiz { grid-template-columns: 300px 1fr; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .post-card-horiz { grid-template-columns: 1fr; }
    .post-card-horiz .thumb { height: 250px; }
    .feature-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 2rem; text-align: center; }
}
