/* public/css/style.css — Estilos Globais do Site (Versão Responsiva Robusta) */

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout principal com container fluido */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header e Footer */
header, footer {
    background-color: #059669;
    color: white;
    padding: 20px 0;
    text-align: center;
    width: 100%;
}

header h1 {
    font-size: 2rem;
    margin: 0;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* Navegação */
nav {
    background-color: #10b981;
    padding: 15px 0;
    text-align: center;
    width: 100%;
}

nav a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
    display: inline-block;
}

/* Main content */
main {
    background-color: #fff;
    min-height: 60vh;
    padding: 40px 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    width: 100%;
}

/* Slideshow */
.slideshow-container {
    max-width: 1200px;
    position: relative;
    margin: 0 auto 30px;
    overflow: hidden;
}
.mySlides {
    display: none;
}
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.3);
}
.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}
.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.8);
}
.dot {
    cursor: pointer;
    height: 15px;
    width: 15px;
    margin: 0 2px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}
.active, .dot:hover {
    background-color: #717171;
}
.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}
@keyframes fade {
    from { opacity: 0.4 }
    to { opacity: 1 }
}

/* Cards de posts (para home.php e blog/index.php) */
.post-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}
.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.post-image-container {
    display: block;
}
.post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.post-card:hover .post-image {
    transform: scale(1.05);
}
.post-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.post-category {
    background-color: #10b981;
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
}
.post-title {
    font-size: 1.25rem;
    margin: 0 0 10px 0;
}
.post-title a {
    text-decoration: none;
    color: #222;
    transition: color 0.2s ease;
}
.post-title a:hover {
    color: #10b981;
}
.post-excerpt {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #888;
}
.read-more {
    color: #10b981;
    text-decoration: none;
    font-weight: bold;
}

/* Página única de post (post.php) */
.single-post {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 30px;
    margin-bottom: 30px;
}
.post-breadcrumb {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #777;
}
.post-breadcrumb a {
    color: #10b981;
    text-decoration: none;
}
.post-breadcrumb span {
    font-weight: bold;
}
.single-post h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    line-height: 1.3;
    color: #222;
}
.post-meta-single {
    color: #888;
    margin-bottom: 20px;
    font-size: 0.9rem;
}
.post-image-single {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.post-content-single {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 30px;
}
.read-original {
    text-align: center;
    margin: 40px 0;
}
.btn-original {
    display: inline-block;
    background-color: #10b981;
    color: white;
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
}
.btn-original:hover {
    background-color: #047857;
}
.back-to-blog {
    margin-top: 30px;
    text-align: center;
}
.back-to-blog a {
    color: #555;
    text-decoration: none;
    font-weight: 600;
}

/* Media Queries — Mobile First */

/* Para telas até 768px (celulares e tablets pequenos) */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    header, footer {
        padding: 15px 0;
    }

    nav {
        padding: 10px 0;
    }

    nav a {
        display: block;
        margin: 10px 0;
        padding: 10px;
        text-align: center;
    }

    main {
        padding: 30px 15px;
    }

    .slideshow-container {
        margin: 0 auto 20px;
    }

    .post-card {
        margin-bottom: 20px;
    }

    .single-post {
        padding: 20px;
    }

    .post-breadcrumb {
        font-size: 0.8rem;
    }

    .single-post h1 {
        font-size: 1.8rem;
    }

    .post-meta-single {
        font-size: 0.8rem;
    }

    .post-image-single {
        height: auto;
        margin-bottom: 20px;
    }

    .read-original {
        margin: 30px 0;
    }

    .btn-original {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .back-to-blog a {
        font-size: 0.95rem;
    }
}

/* Para telas até 480px (celulares muito pequenos) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    nav a {
        font-size: 0.9rem;
        padding: 8px;
    }

    main {
        padding: 20px 10px;
    }

    .post-card {
        margin-bottom: 15px;
    }

    .single-post {
        padding: 15px;
    }

    .single-post h1 {
        font-size: 1.5rem;
    }

    .post-meta-single {
        font-size: 0.8rem;
    }

    .btn-original {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .back-to-blog a {
        font-size: 0.9rem;
    }
}

/* Para telas grandes (desktop) */
@media (min-width: 769px) {
    .container {
        padding: 0 20px;
    }

    .posts-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 30px;
    }

    .categories-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 30px;
    }
}

/* Estilos adicionais para evitar problemas de layout */
html {
    scroll-behavior: smooth;
}

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

a {
    text-decoration: none;
    color: inherit;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}

button:focus, input:focus, select:focus, textarea:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 128, 0.2);
}

/* Para garantir que o conteúdo não ultrapasse a tela em qualquer dispositivo */
body {
    overflow-x: hidden;
}

/* Ajuste para telas muito pequenas */
@media (max-width: 320px) {
    .container {
        padding: 0 5px;
    }

    .post-card {
        margin-bottom: 10px;
    }

    .single-post {
        padding: 10px;
    }

    .single-post h1 {
        font-size: 1.3rem;
    }

    .btn-original {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}