/*
Theme Name: Grande Bahia News
Description: Tema minimalista e moderno para portal de notícias da Bahia. Inclui sistema de colunistas, categorias inteligentes, carrosseis de notícias e design responsivo.
Author: Grande Bahia Team
Version: 1.2.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: grande-bahia-news
Tags: news, blog, responsive, clean, minimal, modern, two-columns, journalism, brazilian, bahia
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
Network: false
*/

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #ffffff;
    font-size: 16px;
}

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

/* WordPress Core Classes */
.alignnone {
    margin: 5px 20px 20px 0;
}

.aligncenter,
div.aligncenter {
    display: block;
    margin: 5px auto 5px auto;
}

.alignright {
    float: right;
    margin: 5px 0 20px 20px;
}

.alignleft {
    float: left;
    margin: 5px 20px 20px 0;
}

a img.alignright {
    float: right;
    margin: 5px 0 20px 20px;
}

a img.alignnone {
    margin: 5px 20px 20px 0;
}

a img.alignleft {
    float: left;
    margin: 5px 20px 20px 0;
}

a img.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption {
    background: #fff;
    border: 1px solid #f0f0f0;
    max-width: 96%;
    padding: 5px 3px 10px;
    text-align: center;
}

.wp-caption.alignnone {
    margin: 5px 20px 20px 0;
}

.wp-caption.alignleft {
    margin: 5px 20px 20px 0;
}

.wp-caption.alignright {
    margin: 5px 0 20px 20px;
}

.wp-caption img {
    border: 0 none;
    height: auto;
    margin: 0;
    max-width: 98.5%;
    padding: 0;
    width: auto;
}

.wp-caption p.wp-caption-text {
    font-size: 11px;
    line-height: 17px;
    margin: 0;
    padding: 0 4px 5px;
}

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

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-size: 0.875rem;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Skip Link */
.skip-link {
    left: -9999px;
    position: absolute;
    top: -9999px;
}

.skip-link:focus {
    clip: auto;
    height: auto;
    left: 6px;
    top: 7px;
    width: auto;
    z-index: 999999;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 15px;
    color: #1a1a1a;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 15px;
    line-height: 1.6;
}

a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2563eb;
}

/* Lists */
ul, ol {
    margin-bottom: 15px;
    padding-left: 20px;
}

li {
    margin-bottom: 5px;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background: #f9fafb;
    font-weight: 600;
}

/* Forms */
input, textarea, select {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

button {
    padding: 10px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

button:hover {
    background: #2563eb;
}

/* Blockquotes */
blockquote {
    margin: 20px 0;
    padding: 20px;
    background: #f9fafb;
    border-left: 4px solid #3b82f6;
    font-style: italic;
}

/* Code */
code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 20px;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* WordPress Blocks */
.wp-block-image {
    margin-bottom: 20px;
}

.wp-block-quote {
    margin: 20px 0;
    padding: 20px;
    background: #f9fafb;
    border-left: 4px solid #3b82f6;
}

.wp-block-separator {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 30px auto;
    width: 100px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
}

.pagination a,
.pagination span {
    padding: 10px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pagination .current {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Comments */
.comments-area {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #e5e7eb;
}

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

.comment {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 10px;
}

.comment-meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 15px;
}

/* Widgets */
.widget {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1a1a1a;
}

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

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.widget ul li a {
    color: #374151;
    text-decoration: none;
    transition: color 0.3s ease;
}

.widget ul li a:hover {
    color: #3b82f6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .comment {
        padding: 15px;
    }

    /* Destaques Mobile - Melhorados */
    .featured-highlights {
        margin: 20px 0;
    }

    .featured-carousel {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        padding-bottom: 10px;
    }

    .featured-container {
        display: block !important;
        gap: 15px;
        padding: 0 5px;
        min-width: auto;
    }

    .featured-item {
        flex: 1 1 auto;
        width: 100%;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        overflow: hidden;
        transition: transform 0.3s ease;
    }

    .featured-item:hover {
        transform: translateY(-2px);
    }

    .featured-image {
        position: relative;
        height: 120px;
        overflow: hidden;
    }

    .featured-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .featured-category {
        position: absolute;
        top: 10px;
        left: 10px;
        background: linear-gradient(135deg, #059669, #10b981);
        color: white;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .featured-content {
        padding: 15px;
    }

    .featured-title {
        font-size: 14px;
        font-weight: 700;
        line-height: 1.3;
        margin: 0 0 8px 0;
        color: #1f2937;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .featured-title a {
        text-decoration: none;
        color: inherit;
    }

    .featured-title a:hover {
        color: #059669;
    }

    .featured-excerpt {
        font-size: 12px;
        color: #6b7280;
        line-height: 1.4;
        margin: 0 0 10px 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .featured-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 11px;
        color: #9ca3af;
    }

    .featured-date {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    /* Navegação do carousel mobile */
    .featured-nav {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 15px;
    }

    .nav-btn {
        background: #f3f4f6;
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #6b7280;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .nav-btn:hover {
        background: #059669;
        color: white;
    }

    .nav-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

    /* Header Mobile */
    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Seção título dos destaques */
    .section-title-featured {
        font-size: 18px !important;
        margin-bottom: 15px;
        color: #1f2937;
        font-weight: 700;
    }

    /* Últimas Notícias Mobile */
    .latest-news-section {
        margin: 15px 0;
    }

    .latest-news-carousel {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        padding-bottom: 10px;
    }

    .latest-news-container {
        display: block !important;
        gap: 12px;
        padding: 0 5px;
        min-width: auto;
    }

    .latest-news-item {
        flex: 1 1 auto;
        width: 100%;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
        overflow: hidden;
        transition: transform 0.3s ease;
    }

    .latest-news-item:hover {
        transform: translateY(-1px);
    }

    .latest-news-image {
        position: relative;
        height: 110px;
        overflow: hidden;
    }

    .latest-news-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .latest-news-content {
        padding: 12px;
    }

    .latest-news-title {
        font-size: 13px;
        font-weight: 600;
        line-height: 1.3;
        margin: 0 0 6px 0;
        color: #1f2937;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .latest-news-title a {
        text-decoration: none;
        color: inherit;
    }

    .latest-news-title a:hover {
        color: #059669;
    }

    .latest-news-excerpt {
        font-size: 11px;
        color: #6b7280;
        line-height: 1.3;
        margin: 0 0 8px 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .latest-news-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 10px;
        color: #9ca3af;
    }

    /* Títulos das seções mobile */
    .section-title {
        font-size: 16px !important;
        margin-bottom: 12px !important;
        color: #1f2937;
        font-weight: 700;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    
    .pagination a,
    .pagination span {
        padding: 8px 12px;
        font-size: 14px;
    }

    /* Destaques Mobile Pequeno - Otimizado */
    .featured-item {
        flex: 1 1 auto !important;
        width: 100% !important;
    }

    .featured-image {
        height: 100px !important;
    }

    .featured-content {
        padding: 12px !important;
    }

    .featured-title {
        font-size: 13px !important;
        line-height: 1.25 !important;
        margin-bottom: 6px !important;
    }

    .featured-excerpt {
        font-size: 11px !important;
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
        -webkit-line-clamp: 1 !important;
    }

    .featured-category {
        padding: 3px 6px !important;
        font-size: 10px !important;
    }

    .featured-meta {
        font-size: 10px !important;
    }

    /* Header mobile pequeno */
    .site-header {
        padding: 8px 0;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }

    .site-logo img {
        max-height: 35px;
    }

    /* Seção título dos destaques pequeno */
    .section-title-featured {
        font-size: 16px !important;
        margin-bottom: 12px !important;
    }

    /* Navegação carousel mobile pequeno */
    .nav-btn {
        width: 35px !important;
        height: 35px !important;
    }

    /* Últimas Notícias Mobile Pequeno */
    .latest-news-item {
        flex: 1 1 auto !important;
        width: 100% !important;
    }

    .latest-news-image {
        height: 90px !important;
    }

    .latest-news-content {
        padding: 10px !important;
    }

    .latest-news-title {
        font-size: 12px !important;
        line-height: 1.25 !important;
        margin-bottom: 5px !important;
        -webkit-line-clamp: 2 !important;
    }

    .latest-news-excerpt {
        font-size: 10px !important;
        line-height: 1.3 !important;
        margin-bottom: 6px !important;
        -webkit-line-clamp: 1 !important;
    }

    .latest-news-meta {
        font-size: 9px !important;
    }

    /* Títulos das seções mobile pequeno */
    .section-title {
        font-size: 14px !important;
        margin-bottom: 10px !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print Styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]:after {
        content: " (" attr(title) ")";
    }
    
    .ir a:after,
    a[href^="javascript:"]:after,
    a[href^="#"]:after {
        content: "";
    }
    
    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }
    
    thead {
        display: table-header-group;
    }
    
    tr,
    img {
        page-break-inside: avoid;
    }
    
    img {
        max-width: 100% !important;
    }
    
    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }
    
    h2,
    h3 {
        page-break-after: avoid;
    }
}

/* ==========================================================================
   Placeholder Images
   ========================================================================== */

/* Placeholder Images */
.placeholder-image {
    border-radius: 8px;
    transition: opacity 0.3s ease;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.placeholder-image:hover {
    opacity: 0.8;
}

/* Image Loading States */
img[src*="data:image/svg+xml"] {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

/* Real News Images */
.real-news-image {
    border-radius: 8px;
    transition: transform 0.3s ease, filter 0.3s ease;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.real-news-image:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

/* Image loading animation for Unsplash */
img[src*="unsplash.com"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Image fade in effect */
.real-news-image {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Fallback placeholder styles */
.fallback-placeholder {
    background: #f9fafb !important;
    border: 2px dashed #d1d5db !important;
    filter: none !important;
    transform: none !important;
    opacity: 0.8 !important;
}

/* Image error state */
img[data-attempt] {
    transition: opacity 0.3s ease;
}

/* Loading state for external images */
.real-news-image[src*="picsum.photos"],
.real-news-image[src*="unsplash.com"],
.real-news-image[src*="loremflickr.com"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}