/*
Theme Name: MagurapexTennis Tennis Hub
Author: MagurapexTennis Media Group
Description: Il portale d'eccellenza per il tennis mondiale. Analisi tattiche, classifiche ATP/WTA e storie dai campi dello Slam.
Version: 1.0.0
*/

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;700;900&family=Urbanist:wght@300;400;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    /* Wimbledon Grass Palette (Prestigious & Natural) */
    --primary: #006633;        /* Wimbledon Green */
    --secondary: #FFFFFF;      /* Classic White */
    --accent: #C4A006;         /* Trophy Gold */
    --black: #1A1A1A;          /* Grip Black */
    --white: #FFFFFF;
    --bg-soft: #F4F7F2;        /* Court Mist */
    --text-main: #2D3436;
    --text-muted: #636E72;
    --border: #E0E7E1;
    --shadow-soft: 0 20px 40px -15px rgba(0, 102, 51, 0.08);
    
    --container-width: 1200px;
    --content-width: 850px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);

    /* Adaptive Design Variables */
    --section-pad: clamp(4rem, 10vw, 12rem);
    --hero-pad: clamp(6rem, 15vw, 18rem);
}

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

article, section, .feature-card, .post-card-overlay, .btn-tennis, .acc-item {
    border-radius: 20px !important; /* Elegant rounded corners */
}

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

/* Fluid Typography - Rule 14 & Rule 22 */
h1, h2, h3, .logo, .footer-logo {
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
    font-family: 'Fraunces', serif;
    font-weight: 900;
}

/* Rule 14: Safe h1 threshold 1.8rem */
h1 { font-size: clamp(1.8rem, 10vw, 7.5rem); line-height: 1; color: var(--black); margin-bottom: 2rem; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 7vw, 4.5rem); line-height: 1.1; color: var(--primary); margin-bottom: 3.5rem; text-align: center; }
h3 { font-size: clamp(1.3rem, 4vw, 2.5rem); line-height: 1.2; color: var(--black); }

.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; }

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

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

/* DNA D-D: Background SVG Pattern (Subtle grass texture) */
.pattern-bg {
    background-color: var(--bg-soft);
    background-image: radial-gradient(var(--primary) 0.5px, transparent 0.5px);
    background-size: 30px 30px;
    background-attachment: fixed;
}

/* DNA N-D: Centered Header Architecture */
.site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 3rem 0;
    position: relative;
    z-index: 1000;
}

.header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.logo {
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--primary);
    text-align: center;
    line-height: 0.9;
}
.logo span { color: var(--accent); display: block; font-size: 0.4em; letter-spacing: 0.5em; margin-top: 0.5rem; }

.main-nav ul { 
    display: flex; 
    gap: 4rem; 
    list-style: none; 
    padding: 1.5rem 4rem;
    background: var(--white);
    box-shadow: var(--shadow-soft);
    border-radius: 100px !important;
}
.main-nav a { 
    font-weight: 700; 
    font-size: 0.9rem; 
    color: var(--black); 
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.main-nav a:hover { color: var(--primary); transform: translateY(-2px); }

.nav-toggle { display: none; }

/* DNA H-A: Full Bleed Hero */
.hero-magurapex {
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    background: var(--black);
    overflow: hidden;
    color: var(--white);
    text-align: center;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}
.hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.4; }
.hero-bg::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle, transparent 20%, var(--black) 100%); }

.hero-content { position: relative; z-index: 2; padding: var(--hero-pad) 0; width: 100%; }
.hero-content h1 { color: var(--white); }
.hero-content p { font-size: 1.5rem; color: var(--accent); margin-bottom: 4rem; font-family: 'Fraunces'; font-style: italic; }

.btn-tennis {
    display: inline-block;
    padding: 1.5rem 5rem;
    background: var(--white);
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.btn-tennis:hover { background: var(--primary); color: var(--white); transform: scale(1.05); }

/* DNA F-B: Cards in Grid (Vantaggi) */
.tennis-features {
    padding: var(--section-pad) 0;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
}
.feature-card {
    padding: 5rem 4rem;
    background: var(--white);
    box-shadow: var(--shadow-soft);
    text-align: center;
    transition: var(--transition);
}
.feature-card:hover { transform: translateY(-15px); }
.feature-card h3 { color: var(--primary); margin-bottom: 2rem; }
.feature-card p { font-size: 1.1rem; color: var(--text-muted); }

/* DNA U-A: Quote / Expert Block */
.tennis-quote {
    padding: var(--section-pad) 0;
    background: var(--primary);
    color: var(--white);
    text-align: center;
}
.quote-text {
    font-family: 'Fraunces';
    font-size: clamp(2rem, 6vw, 4.5rem);
    line-height: 1.2;
    max-width: 1000px;
    margin: 0 auto;
    font-weight: 900;
    font-style: italic;
}
.quote-author { margin-top: 4rem; color: var(--accent); font-weight: 700; letter-spacing: 0.3em; }

/* Posts Grid - DNA C-C: Overlay Cards */
.posts-section { padding: var(--section-pad) 0; }
.section-header { margin-bottom: 8rem; text-align: center; }

.magurapex-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 10rem;
}

.post-card-overlay {
    position: relative;
    height: 550px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: var(--shadow-soft);
}
.post-card-overlay .thumb { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.post-card-overlay .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-overlay::after { 
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; 
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 70%); z-index: 2; 
}
.post-card-overlay .content { position: relative; z-index: 3; padding: 4rem 3rem; color: var(--white); }
.post-card-overlay h3 { color: var(--white); margin-bottom: 2rem; font-size: 2rem; }

.btn-read {
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}
.btn-read::after { content: '→'; font-size: 1.2rem; }

/* Pagination - Mediterranean Style */
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 10rem; }
.pagination .page-numbers {
    width: 60px; height: 60px;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: 'Fraunces'; font-weight: 900; font-size: 1.5rem;
    color: var(--primary); background: var(--bg-soft);
    border-radius: 50% !important;
}
.pagination a.page-numbers:hover { background: var(--primary); color: var(--white); }
.pagination span.current { background: var(--primary); color: var(--white); box-shadow: 0 10px 20px rgba(0, 102, 51, 0.2); }

/* DNA FT-B: Two-column Footer */
.site-footer {
    background: var(--black);
    color: var(--white);
    padding: 12rem 0 6rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: clamp(2rem, 5vw, 8rem); /* Rule 6: safe gap */
    margin-bottom: 10rem;
}
.footer-logo { font-size: clamp(2rem, 6vw, 5rem); color: var(--secondary); margin-bottom: 3rem; overflow-wrap: anywhere; }
.footer-logo span { color: var(--accent); }
.footer-desc { color: rgba(255,255,255,0.5); font-size: 1.1rem; max-width: 600px; overflow-wrap: break-word; }

.footer-nav ul { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.footer-nav a { font-weight: 600; color: var(--white); text-transform: uppercase; font-size: 0.95rem; }
.footer-nav a:hover { color: var(--accent); transform: translateX(10px); }

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

/* Rule 22: Content Protocol */
.post-main { max-width: var(--content-width); margin: 8rem auto; padding: 0 2rem; }
.post-header { margin-bottom: 8rem; text-align: center; }
.post-meta { color: var(--accent); font-weight: 700; margin-bottom: 2rem; display: block; font-family: 'Fraunces'; letter-spacing: 0.2em; }
.post-content h2, .post-content h3 { margin: 6rem 0 3rem; color: var(--primary); text-align: left; }
.post-content table { width: 100%; border-collapse: collapse; margin: 4rem 0; box-shadow: var(--shadow-soft); background: var(--white); border-radius: 20px !important; overflow: hidden; }
.post-content th { background: var(--primary); color: var(--white); padding: 2rem; text-align: left; font-family: 'Fraunces'; }
.post-content td { padding: 2rem; border-bottom: 1px solid var(--border); }

/* Responsive */
@media (max-width: 1024px) {
    .site-header { padding: 2rem 0; }
    .header-inner { gap: 2rem; }
    .main-nav ul { padding: 1rem 2rem; gap: 2rem; }
    .magurapex-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .header-inner { flex-direction: row; justify-content: space-between; }
    .main-nav { display: none; }
    .main-nav.is-active {
        display: block; position: absolute; top: 100%; left: 0; width: 100%; background: var(--white); padding: 4rem 2rem; border-bottom: 4px solid var(--primary);
    }
    .main-nav ul { flex-direction: column; background: none; box-shadow: none; border-radius: 0 !important; align-items: center; }
    .nav-toggle { display: flex; flex-direction: column; gap: 6px; width: 35px; background: none; border: none; cursor: pointer; }
    .nav-toggle span { width: 100%; height: 3px; background: var(--primary); }
    
    .magurapex-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 3rem; text-align: center; }
}
