/*
Theme Name: EkoBlov Tennis Hub
Author: EkoBlov Media Group
Description: Элитный теннисный инфо-портал. Глубокая тактика, рейтинги ATP/WTA и аналитика турниров Большого шлема.
Version: 1.0.0
*/

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

:root {
    /* Clay Master Palette (Warm & Sophisticated) */
    --primary: #c2410c;        /* Clay Red */
    --secondary: #134e4a;      /* Grass Green (Deep) */
    --accent: #fefaf6;         /* Chalk White / Cream */
    --black: #0f172a;
    --white: #FFFFFF;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    --container-width: 1200px;
    --content-width: 900px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);

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

/* Global Reset - Rule 15: Sharp edges */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0 !important;
}

html, body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--white);
    color: var(--text-main);
    line-height: 1.8;
}

/* Fluid Typography - Rule 14 */
h1, h2, h3, .logo, .footer-logo {
    overflow-wrap: break-word;
    font-family: 'Prata', serif;
    font-weight: 400;
}

h1 { font-size: clamp(2.5rem, 10vw, 7rem); line-height: 1; color: var(--accent); margin-bottom: 3rem; text-wrap: balance; }
h2 { font-size: clamp(2.2rem, 6vw, 4.5rem); line-height: 1.1; color: var(--primary); }
h3 { font-size: clamp(1.5rem, 4vw, 2.5rem); line-height: 1.2; color: var(--black); }

/* Scoreboard style for stats */
.mono { font-family: 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: 0.1em; }

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

/* Header - Rule 1 */
.site-header {
    background: var(--white);
    padding: 2.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

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

.logo {
    font-size: clamp(1.2rem, 4vw, 2.6rem);
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
    white-space: nowrap;
}
.logo span { font-style: italic; color: var(--secondary); border-bottom: 2px solid var(--primary); }

.main-nav ul { display: flex; gap: 3.5rem; list-style: none; }
.main-nav a { font-weight: 600; font-size: 0.85rem; color: var(--black); text-transform: uppercase; letter-spacing: 0.1em; }
.main-nav a:hover { color: var(--primary); }

/* Hamburger */
.nav-toggle {
    display: none; flex-direction: column; justify-content: center; gap: 7px; width: 30px; height: 30px;
    background: none; border: none; cursor: pointer;
}
.nav-toggle span { width: 100%; height: 1px; background: var(--black); display: block; }

/* Hero Section: Full Width Overlay (Option C - Rule 2 & 21) */
.hero-tennis {
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    background: var(--black);
    overflow: hidden;
    margin-bottom: 0;
}

.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.6; filter: sepia(30%) contrast(110%); }

.hero-content {
    position: relative;
    z-index: 2;
    padding: var(--hero-pad) 0;
    max-width: 900px;
}

.btn-clay {
    display: inline-block;
    padding: 1.5rem 4rem;
    background: var(--primary);
    color: var(--white);
    font-family: 'Inter';
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.9rem;
}
.btn-clay:hover { background: var(--white); color: var(--primary); }

/* Unique Block: Dynamic Ratings (Rule 21: Positioned right after Hero) */
.ratings-bar {
    background: var(--accent);
    padding: 6rem 0;
    border-bottom: 1px solid var(--border);
}

.ratings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 4rem;
}

.rating-item {
    border-left: 4px solid var(--primary);
    padding-left: 2rem;
}
.rating-item strong { display: block; font-size: 3rem; font-family: 'Prata'; color: var(--primary); line-height: 1; margin-bottom: 0.5rem; }
.rating-item span { font-family: 'JetBrains Mono'; font-size: 0.8rem; color: var(--text-muted); }

/* Features: Rule 21 - Shuffled order */
.tennis-advantages {
    padding: var(--section-pad) 0;
    background: var(--white);
}

.adv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 0;
    border: 1px solid var(--border);
}

.adv-card {
    padding: 5rem;
    border-right: 1px solid var(--border);
    transition: var(--transition);
}
.adv-card:last-child { border-right: none; }
.adv-card:hover { background: var(--accent); }
.adv-card h3 { margin-bottom: 2rem; font-size: 2rem; color: var(--secondary); }
.adv-card p { font-size: 1.1rem; color: var(--text-muted); }

/* Posts Grid - Rule 20 */
.posts-section { padding: var(--section-pad) 0; background: var(--accent); }
.section-header { text-align: center; margin-bottom: 8rem; }
.section-header .mono { color: var(--primary); margin-bottom: 2rem; display: block; }

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

.post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.post-card .thumb { height: 400px; overflow: hidden; margin-bottom: 3rem; border: 1px solid var(--border); background: var(--white); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.post-card:hover .thumb img { transform: scale(1.05); }
.post-card h3 { flex-grow: 1; margin-bottom: 2.5rem; font-size: 1.8rem; line-height: 1.3; color: var(--black); }

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

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 1rem; margin-top: 8rem; }
.pagination span, .pagination a {
    padding: 1.2rem 2rem; background: var(--white); border: 1px solid var(--border); font-family: 'JetBrains Mono'; font-weight: 700;
}
.pagination .current, .pagination a:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* Footer */
.site-footer {
    background: var(--black);
    color: var(--white);
    padding: 10rem 0 5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: clamp(2rem, 5vw, 8rem);
    margin-bottom: 10rem;
}

/* Rule 6: footer logo — clamp + overflow-wrap обязательны */
.footer-logo { font-size: clamp(1.5rem, 5vw, 4rem); color: var(--accent); margin-bottom: 3rem; overflow-wrap: anywhere; }
.footer-logo span { color: var(--primary); }

/* Rule 6: footer text overflow protection */
.site-footer p, .site-footer .footer-desc { max-width: 100%; overflow-wrap: break-word; }

.footer-nav ul { list-style: none; }
.footer-nav li { margin-bottom: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 1.5rem; }
.footer-nav a { color: var(--text-muted); font-family: 'JetBrains Mono'; font-size: 0.9rem; }
.footer-nav a:hover { color: var(--primary); padding-left: 1rem; }

.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';
    color: var(--text-muted);
}

/* Single Post - Rule 7 */
.post-main { max-width: var(--content-width); margin: 8rem auto; }
.post-header { margin-bottom: 8rem; text-align: left; }
.post-meta { font-family: 'JetBrains Mono'; font-weight: 700; color: var(--primary); text-transform: uppercase; display: block; margin-bottom: 2.5rem; letter-spacing: 0.2em; }
.post-thumbnail { margin-bottom: 8rem; border: 1px solid var(--border); padding: 15px; background: var(--accent); }

.post-content { font-size: 1.2rem; line-height: 1.9; color: var(--text-main); }
.post-content h2, .post-content h3 { margin: 6rem 0 3rem; color: var(--black); }
.post-content p { margin-bottom: 3rem; }

/* Responsive */
@media (max-width: 1024px) {
    .tennis-grid { grid-template-columns: repeat(2, 1fr); gap: 3rem; }
    .adv-grid { grid-template-columns: 1fr; }
    .adv-card { border-right: none; border-bottom: 1px solid var(--border); }
}

@media (max-width: 768px) {
    .header-inner { gap: 1rem; }
    .nav-toggle { display: flex; }
    .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: 1px solid var(--primary);
    }
    .main-nav ul { flex-direction: column; gap: 2.5rem; }
    
    .hero-content { padding: 4rem 0; }
    .hero-bg img { opacity: 0.4; }
    
    .tennis-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 3rem; text-align: center; }
}
