/* TennisLab Theme - Main Stylesheet */

/* CSS Custom Properties */
:root {
    --bg: #FFFFFF;
    --text: #111827;
    --muted: #6B7280;
    --primary: #1B7F3A;
    --primary-dark: #156830;
    --accent: #F5C400;
    --accent-dark: #D4A800;
    --border: #E5E7EB;
    --surface: #F9FAFB;
    --radius: 16px;
    --radius-sm: 8px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --transition: 0.2s ease;
    --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-system);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 1.5rem;
}

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

a:hover, a:focus {
    color: var(--primary-dark);
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: 800px;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    transition: box-shadow var(--transition);
}

.site-header.scrolled {
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.site-title a {
    color: var(--text);
    text-decoration: none;
}

.site-title a:hover {
    color: var(--primary);
}

/* Navigation */
.main-navigation {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-menu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

@media (min-width: 1024px) {
    .nav-menu {
        display: flex;
    }
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a {
    background: var(--surface);
    color: var(--primary);
    text-decoration: none;
}

/* Dropdown */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    list-style: none;
    padding: 0.5rem;
    margin: 0;
}

.nav-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu a {
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

@media (min-width: 1024px) {
    .menu-toggle {
        display: none;
    }
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1rem;
}

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

@media (min-width: 1024px) {
    .mobile-nav {
        display: none !important;
    }
}

.mobile-nav .nav-menu {
    display: flex;
    flex-direction: column;
}

.mobile-nav .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

.btn-accent {
    background: var(--accent);
    color: var(--text);
    border-color: var(--accent);
}

.btn-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    text-decoration: none;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.header-cta {
    display: none;
}

@media (min-width: 768px) {
    .header-cta {
        display: inline-flex;
    }
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
}

@media (min-width: 768px) {
    .hero {
        padding: 6rem 0;
    }
}

.hero-content {
    max-width: 700px;
}

.hero h1 {
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--muted);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Feature Cards */
.features {
    padding: 4rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 2rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    color: var(--primary);
}

.feature-card h3 {
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--muted);
    margin-bottom: 1rem;
}

/* Section Title */
.section-header {
    margin-bottom: 2.5rem;
}

.section-header h2 {
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--muted);
    font-size: 1.125rem;
    margin: 0;
}

.section-header.text-center {
    text-align: center;
}

/* Post Cards Grid */
.posts-section {
    padding: 4rem 0;
    background: var(--surface);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.post-card-image {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--border);
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 1.5rem;
}

.post-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.post-card-category {
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.post-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.post-card h3 a {
    color: var(--text);
}

.post-card h3 a:hover {
    color: var(--primary);
    text-decoration: none;
}

.post-card-excerpt {
    color: var(--muted);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Drills Cards */
.drills-section {
    padding: 4rem 0;
}

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

.drill-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.drill-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.drill-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-radius: 50%;
    font-size: 1.25rem;
}

.drill-info h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.drill-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted);
}

/* Page Content */
.page-header {
    padding: 3rem 0;
    background: var(--surface);
    text-align: center;
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-header .breadcrumb {
    color: var(--muted);
    font-size: 0.875rem;
}

.page-header .breadcrumb a {
    color: var(--primary);
}

.page-content {
    padding: 3rem 0;
}

.content-wrapper {
    display: grid;
    gap: 3rem;
}

@media (min-width: 1024px) {
    .content-wrapper.has-sidebar {
        grid-template-columns: 1fr 300px;
    }
}

/* Single Post */
.single-post-header {
    padding: 3rem 0;
    background: var(--surface);
}

.single-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
}

.post-date, .post-author {
    font-size: 0.875rem;
    color: var(--muted);
}

.single-post-featured {
    margin: -2rem 0 2rem;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

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

/* Entry Content (Gutenberg) */
.entry-content {
    max-width: 100%;
}

.entry-content > *:first-child {
    margin-top: 0;
}

.entry-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.entry-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.entry-content ul, .entry-content ol {
    margin: 0 0 1.5rem;
    padding-left: 1.5rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

.entry-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: var(--surface);
    border-left: 4px solid var(--primary);
    font-style: italic;
    color: var(--muted);
}

.entry-content blockquote cite {
    display: block;
    margin-top: 1rem;
    font-style: normal;
    font-weight: 600;
    color: var(--text);
}

.entry-content pre {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.entry-content code {
    font-family: "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.875em;
    background: var(--surface);
    padding: 0.125em 0.25em;
    border-radius: 3px;
}

.entry-content pre code {
    background: none;
    padding: 0;
}

.entry-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
}

.entry-content th, .entry-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid var(--border);
}

.entry-content th {
    background: var(--surface);
    font-weight: 600;
}

.entry-content figure {
    margin: 2rem 0;
}

.entry-content figcaption {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted);
    text-align: center;
}

/* Gutenberg Blocks */
.wp-block-button .wp-block-button__link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: background var(--transition);
}

.wp-block-button .wp-block-button__link:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.wp-block-button.is-style-outline .wp-block-button__link {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background: var(--primary);
    color: #fff;
}

.alignwide {
    margin-left: calc(-25vw + 50%);
    margin-right: calc(-25vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

.alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    font-size: 0.9375rem;
}

.widget {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
}

.widget-title {
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: var(--text);
}

.widget a:hover {
    color: var(--primary);
}

/* Archive */
.archive-header {
    padding: 3rem 0;
    background: var(--surface);
    text-align: center;
}

.archive-description {
    max-width: 600px;
    margin: 0 auto;
    color: var(--muted);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.pagination a {
    background: var(--surface);
    color: var(--text);
    transition: background var(--transition), color var(--transition);
}

.pagination a:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

.pagination .current {
    background: var(--primary);
    color: #fff;
}

/* Contact Form */
.contact-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 127, 58, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.form-message {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
}

.form-message.success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

.form-message.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

/* Footer */
.site-footer {
    background: var(--text);
    color: #fff;
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-section h4 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-section p {
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--muted);
    transition: color var(--transition);
}

.footer-section a:hover {
    color: #fff;
    text-decoration: none;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
}

/* Search Form */
.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
}

.search-form button {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}

.search-form button:hover {
    background: var(--primary-dark);
}

/* 404 Page */
.error-404 {
    text-align: center;
    padding: 6rem 0;
}

.error-404 h1 {
    font-size: 8rem;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 1rem;
}

.error-404 h2 {
    margin-bottom: 1rem;
}

.error-404 p {
    color: var(--muted);
    margin-bottom: 2rem;
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.post-navigation a {
    display: block;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: background var(--transition);
}

.post-navigation a:hover {
    background: var(--border);
    text-decoration: none;
}

.post-navigation .nav-subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.post-navigation .nav-title {
    font-weight: 600;
}

.post-navigation .nav-next {
    text-align: right;
}

/* Comments */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.comments-title {
    margin-bottom: 2rem;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-author img {
    border-radius: 50%;
}

.comment-author .fn {
    font-weight: 600;
}

.comment-metadata {
    font-size: 0.875rem;
    color: var(--muted);
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-reply-link {
    font-size: 0.875rem;
    font-weight: 600;
}

.comment-respond {
    margin-top: 2rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

/* Tags */
.post-tags {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.post-tags a {
    display: inline-block;
    margin: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: var(--surface);
    color: var(--muted);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: background var(--transition), color var(--transition);
}

.post-tags a:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

/* Accessibility */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    word-wrap: normal !important;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    z-index: 999;
    padding: 1rem 2rem;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    transition: top var(--transition);
}

.skip-link:focus {
    top: 0;
}

/* Print */
@media print {
    .site-header,
    .site-footer,
    .sidebar,
    .post-navigation,
    .comments-area,
    .pagination {
        display: none;
    }
    
    body {
        font-size: 12pt;
        color: #000;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
}
