/*
Theme Name: Massage Blog
Description: Tema WordPress otimizado para blog de massagem com foco em performance e SEO
Version: 1.0
*/

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background-color: #fff;
    font-weight: 400;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.site-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    margin: 0;
}

.site-title:hover {
    color: #3498db;
    transition: color 0.3s ease;
}

.site-description {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin: 5px 0 0 0;
}

/* Navigation */
.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-navigation a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    padding: 10px 0;
    position: relative;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: #3498db;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #3498db;
    transition: width 0.3s ease;
}

.main-navigation a:hover::after {
    width: 100%;
}

/* Main Content */
.site-main {
    padding: 40px 0;
    min-height: 60vh;
}

/* Posts Grid - Inspirado no Chrome Web Store */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.post-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.post-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.post-content {
    padding: 20px;
}

.post-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.post-title a {
    color: #2c3e50;
    text-decoration: none;
}

.post-title a:hover {
    color: #3498db;
}

.post-excerpt {
    color: #7f8c8d;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #95a5a6;
}

.post-date {
    font-weight: 500;
}

.read-more {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* Single Post */
.single-post {
    max-width: 800px;
    margin: 0 auto;
}

.entry-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.entry-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.2;
}

.entry-meta {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.entry-meta a {
    color: #3498db;
    text-decoration: none;
}

.entry-meta a:hover {
    text-decoration: underline;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #2c3e50;
}

.entry-content h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 40px 0 20px 0;
    color: #2c3e50;
}

.entry-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 30px 0 15px 0;
    color: #34495e;
}

.entry-content p {
    margin-bottom: 20px;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 8px;
}

.entry-content ul,
.entry-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.entry-content li {
    margin-bottom: 10px;
}

.entry-content blockquote {
    border-left: 4px solid #3498db;
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: #7f8c8d;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    gap: 10px;
}

.pagination a,
.pagination span {
    padding: 10px 15px;
    background: #f8f9fa;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.pagination a:hover {
    background: #3498db;
    color: #fff;
}

.pagination .current {
    background: #3498db;
    color: #fff;
}

/* Footer */
.site-footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 40px 0;
    text-align: center;
}

.footer-content {
    font-size: 0.9rem;
}

.footer-content a {
    color: #3498db;
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

/* Search Form */
.search-form {
    display: flex;
    max-width: 400px;
    margin: 20px auto;
}

.search-field {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
    outline: none;
}

.search-field:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.search-submit {
    padding: 12px 20px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.search-submit:hover {
    background: #2980b9;
}

/* Video Embeds */
.youtube-embed-wrapper,
.vimeo-embed-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin: 30px 0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.youtube-embed,
.vimeo-embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Melhora os embeds nativos do WordPress */
.wp-block-embed.wp-block-embed-youtube,
.wp-block-embed.wp-block-embed-vimeo {
    margin: 30px 0;
}

.wp-block-embed.wp-block-embed-youtube .wp-block-embed__wrapper,
.wp-block-embed.wp-block-embed-vimeo .wp-block-embed__wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.wp-block-embed.wp-block-embed-youtube iframe,
.wp-block-embed.wp-block-embed-vimeo iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Estilo para figcaption dos vídeos */
.wp-block-embed figcaption {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #7f8c8d;
    text-align: center;
    font-style: italic;
}

/* Video Post Format */
.post-format-video .post-card {
    position: relative;
}

.post-format-video .post-card::before {
    content: '▶';
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 10;
}

.video-youtube .post-card::before {
    background: #ff0000;
}

.video-vimeo .post-card::before {
    background: #1ab7ea;
}

/* Video Thumbnail Enhancement */
.post-format-video .post-thumbnail {
    position: relative;
}

.post-format-video .post-thumbnail::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M8 5v14l11-7z"/></svg>');
    background-size: 24px;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.post-format-video .post-card:hover .post-thumbnail::after {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .youtube-embed-wrapper,
    .vimeo-embed-wrapper {
        margin: 20px 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .main-navigation ul {
        gap: 20px;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .entry-title {
        font-size: 2rem;
    }
    
    .entry-content {
        font-size: 1rem;
    }
    
    .site-main {
        padding: 20px 0;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.5rem;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 10px;
    }
    
    .entry-title {
        font-size: 1.8rem;
    }
    
    .post-content {
        padding: 15px;
    }
    
    .search-form {
        max-width: 100%;
    }
}

/* Single Page */
.single-page {
    max-width: 800px;
    margin: 0 auto;
}

/* Front Page */
.front-page-content {
    max-width: 800px;
    margin: 0 auto 60px auto;
}

.recent-posts-section {
    margin-top: 60px;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 40px;
}

.view-all-posts {
    text-align: center;
    margin-top: 40px;
}

/* Archive pages */
.archive-description {
    font-size: 1rem;
    color: #7f8c8d;
    margin-top: 10px;
    text-align: center;
}

/* Page Links */
.page-links {
    margin-top: 30px;
    text-align: center;
    font-weight: 500;
}

.page-links a {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    background: #f8f9fa;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.page-links a:hover {
    background: #3498db;
    color: #fff;
}

/* Utilities */
.screen-reader-text {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.aligncenter {
    display: block;
    margin: 0 auto;
}

.alignright {
    float: right;
    margin-left: 20px;
}

.alignleft {
    float: left;
    margin-right: 20px;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-align: center;
    margin-top: 10px;
}

/* Performance optimizations */
.post-thumbnail,
.entry-content img {
    will-change: transform;
}

.post-card {
    contain: layout;
}

/* Post Navigation */
.post-navigation {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.nav-previous,
.nav-next {
    flex: 1;
}

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

.nav-links a {
    display: block;
    padding: 15px 20px;
    background: #f8f9fa;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-links a:hover {
    background: #3498db;
    color: #fff;
    transform: translateY(-2px);
}

/* Post Taxonomy */
.post-taxonomy {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9rem;
}

.post-categories,
.post-tags {
    margin-bottom: 10px;
}

.post-taxonomy a {
    color: #3498db;
    text-decoration: none;
    margin-right: 10px;
}

.post-taxonomy a:hover {
    text-decoration: underline;
}

/* Search Results */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.page-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.search-term {
    color: #3498db;
    font-weight: 600;
}

/* 404 Page */
.error-404 {
    text-align: center;
    padding: 60px 20px;
}

.error-404 .page-title {
    font-size: 3rem;
    color: #e74c3c;
    margin-bottom: 20px;
}

.error-actions {
    margin: 30px 0;
}

.button {
    display: inline-block;
    padding: 12px 25px;
    background: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.button:hover {
    background: #2980b9;
}

.recent-posts {
    margin-top: 40px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.recent-posts h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.recent-posts ul {
    list-style: none;
    padding: 0;
}

.recent-posts li {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.recent-posts a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
}

.recent-posts a:hover {
    color: #3498db;
}

/* Featured Image */
.featured-image {
    margin-bottom: 30px;
}

.featured-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .main-navigation,
    .pagination,
    .post-navigation,
    .search-form {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .entry-title {
        font-size: 18pt;
    }
    
    .entry-content {
        font-size: 11pt;
    }
}