/*
Theme Name: ibytheme
Theme URI: https://folhadigital.rd5.com.br
Author: Daniel Oliveira da Paixão
Author URI: https://folhadigital.rd5.com.br
Description: Um tema moderno e responsivo para sites de notícias. Oferece cabeçalho e rodapé totalmente personalizáveis via plugin, além de suporte a shortcodes para exibir blocos de postagens, vídeos e anúncios. O layout apresenta opções full-width ou boxed e permite controlar a largura máxima da página. Compatível com traduções e blocos. Otimizado para performance, SEO e acessibilidade.
Version: 3.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ibytheme
Tags: news, magazine, full-width, boxed, custom-background, custom-header, custom-logo, custom-menu, responsive-layout, two-columns, one-column, accessibility-ready, seo-ready
*/

/* CSS Reset & Global Styles */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Open Sans', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

a {
  color: #0073aa;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

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

/* Skip to content - Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100000;
  font-weight: bold;
}

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

/* Screen reader text */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  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;
  color: #21759b;
  display: block;
  font-size: 14px;
  font-weight: bold;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* Root CSS variables */
:root {
  --primary-color: #005cbf;
  --secondary-color: #e0e0e0;
  --max-width: 1660px;
  --text-color: #333;
  --bg-color: #ffffff;
  --border-color: #e5e5e5;
}

/* Layout container */
.site-container {
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
}

/* Full-width vs boxed layouts */
body.site-boxed {
  background-color: #e9e9e9;
}

body.site-boxed .site-container {
  max-width: var(--max-width);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

body.site-fullwidth .site-container {
  max-width: 100%;
}

/* Header */
.site-header {
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 20px 0;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.site-branding {
  display: flex;
  flex-direction: column;
}

.site-title {
  font-family: 'Roboto Slab', Georgia, serif;
  font-size: 2rem;
  margin: 0;
  font-weight: 700;
  color: #222;
}

.site-title a {
  color: inherit;
}

.site-description {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
}

/* Navigation */
.main-navigation {
  margin-top: 10px;
}

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.main-navigation li {
  position: relative;
}

.main-navigation a {
  color: var(--text-color);
  font-weight: 600;
  padding: 8px 12px;
  display: block;
  transition: color 0.3s ease, background-color 0.3s ease;
}

.main-navigation a:hover,
.main-navigation a:focus {
  color: var(--primary-color);
  text-decoration: none;
}

/* Header widget columns */
.header-widgets {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.header-widgets .header-widget-col {
  padding: 0;
}

.header-widgets .widget {
  margin: 0;
}

/* Breadcrumbs */
.breadcrumbs {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 15px 20px;
  font-size: 0.9rem;
  background-color: #fafafa;
  border-bottom: 1px solid var(--border-color);
}

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

.breadcrumbs span {
  margin: 0 5px;
  color: #999;
}

/* Sidebar */
.sidebar {
  padding: 20px;
  background-color: #fafafa;
  border-left: 1px solid #eee;
}

.widget {
  margin-bottom: 30px;
}

.widget-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
  font-weight: 600;
  border-bottom: 2px solid var(--secondary-color);
  display: inline-block;
  padding-bottom: 5px;
}

/* Main content area */
.content-area {
  flex: 1 1 auto;
  padding: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  gap: 30px;
  width: 100%;
}

.content-area > .posts-grid {
  flex: 1 1 auto;
}

/* Posts grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.post-item {
  border-bottom: 1px solid #eee;
  padding-bottom: 20px;
}

.post-item:last-child {
  border-bottom: none;
}

.post-item .post-thumbnail {
  position: relative;
  overflow: hidden;
  margin-bottom: 15px;
}

.post-item .post-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.post-item .post-thumbnail:hover img {
  transform: scale(1.05);
}

.post-item .post-title {
  font-family: 'Roboto Slab', Georgia, serif;
  font-size: 1.4rem;
  margin: 10px 0;
  color: #222;
  line-height: 1.3;
}

.post-item .post-title a {
  color: inherit;
}

.post-item .post-meta {
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.post-item .post-excerpt {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 10px;
  line-height: 1.6;
}

.post-item .read-more {
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
  display: inline-block;
  padding: 5px 0;
}

.post-item .read-more:hover,
.post-item .read-more:focus {
  text-decoration: underline;
}

/* Single post */
.single-post .single-title {
  font-family: 'Roboto Slab', Georgia, serif;
  font-size: 2rem;
  margin: 20px 0;
  line-height: 1.3;
}

.single-post .single-meta {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.single-post .post-content {
  font-size: 1rem;
  color: var(--text-color);
  line-height: 1.8;
}

.single-post .post-content p {
  margin-bottom: 1.2em;
}

.single-post .post-content h2,
.single-post .post-content h3,
.single-post .post-content h4 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

/* Page content */
.page-content .page-title {
  font-family: 'Roboto Slab', Georgia, serif;
  font-size: 2rem;
  margin: 20px 0;
  line-height: 1.3;
}

.page-content .entry-content {
  font-size: 1rem;
  color: var(--text-color);
  line-height: 1.8;
}

/* Footer */
.site-footer {
  background-color: #222;
  color: #fff;
  padding: 40px 20px;
  margin-top: auto;
}

/* Footer widget columns */
.footer-widgets {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto 20px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.footer-widgets .footer-widget-col {
  padding: 0;
}

.site-footer .widget-title {
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}

.site-info {
  font-size: 0.8rem;
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.site-footer a {
  color: #ccc;
}

.site-footer a:hover,
.site-footer a:focus {
  color: #fff;
}

/* Pagination */
.pagination {
  margin-top: 30px;
  text-align: center;
}

.pagination .page-numbers {
  display: inline-block;
  margin: 0 5px;
  padding: 8px 12px;
  background-color: #f0f0f0;
  color: var(--text-color);
  border-radius: 4px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

.pagination .page-numbers:hover,
.pagination .page-numbers:focus {
  background-color: var(--primary-color);
  color: #fff;
  text-decoration: none;
}

/* Single post layout */
.single-container {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  max-width: var(--max-width);
  margin: 40px auto;
  padding: 0 20px;
}

.single-main {
  flex: 1 1 65%;
  min-width: 0;
}

.single-sidebar {
  flex: 1 1 30%;
  min-width: 0;
}

/* Single post components */
.single-main .single-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.3;
}

.single-main .single-meta {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 20px;
}

.single-main .post-thumbnail {
  margin-bottom: 20px;
}

.single-main .post-content {
  font-size: 1rem;
  line-height: 1.8;
  color: #444;
}

.single-main .post-tags {
  margin-top: 30px;
  font-size: 0.9rem;
  color: #777;
}

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

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

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

/* Responsive layout for single posts */
@media (max-width: 992px) {
  .single-container {
    flex-direction: column;
  }
  
  .single-main,
  .single-sidebar {
    flex: 1 1 100%;
  }
  
  .single-main {
    margin-bottom: 40px;
  }
  
  .footer-widgets {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .content-area {
    flex-direction: column;
    gap: 0;
  }
  
  .sidebar {
    border-left: none;
    border-top: 1px solid #eee;
  }
  
  .header-widgets,
  .footer-widgets {
    grid-template-columns: 1fr;
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
  }
}

/* Print styles */
@media print {
  .site-header,
  .site-footer,
  .sidebar,
  .breadcrumbs,
  .navigation {
    display: none;
  }
  
  .single-main {
    flex: 1 1 100%;
  }
}
