/*
Theme Name: ibytheme
Theme URI: https://example.com/ibytheme
Author: Daniel Oliveira da Paixão
Author URI: https://example.com
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.
Version: 2.1
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
*/

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&family=Roboto+Slab:wght@700&display=swap');

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

body {
  margin: 0;
  padding: 0;
  font-family: '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 {
  text-decoration: underline;
}

/* Root CSS variables. The `--max-width` value is overwritten via
   inline styles generated by functions.php based on the Customiser setting. */
:root {
  --primary-color: #005cbf;
  --secondary-color: #e0e0e0;
  --max-width: 1660px;
}

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

/* 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: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  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', serif;
  font-size: 2rem;
  margin: 0;
  font-weight: 700;
  color: #222;
}
.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: #333;
  font-weight: 600;
  padding: 8px 0;
  display: block;
}
.main-navigation a:hover,
.main-navigation a:focus {
  color: var(--primary-color);
}

/* 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;
}

/* 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 img {
  width: 100%;
  height: auto;
  display: block;
}
.post-item .post-title {
  font-family: 'Roboto Slab', serif;
  font-size: 1.4rem;
  margin: 10px 0;
  color: #222;
}
.post-item .post-title a {
  color: inherit;
}
.post-item .post-meta {
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
}
.post-item .post-excerpt {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 10px;
}
.post-item .read-more {
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
}
.post-item .read-more:hover {
  text-decoration: underline;
}

/* Single post */
.single-post .single-title {
  font-family: 'Roboto Slab', serif;
  font-size: 2rem;
  margin: 20px 0;
}
.single-post .single-meta {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
}
.single-post .post-content {
  font-size: 1rem;
  color: #333;
}
.single-post .post-content p {
  margin-bottom: 1.2em;
}

/* Page content */
.page-content .page-title {
  font-family: 'Roboto Slab', serif;
  font-size: 2rem;
  margin: 20px 0;
}
.page-content .page-content {
  font-size: 1rem;
  color: #333;
}

/* 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;
}
.site-footer a {
  color: #ccc;
}
.site-footer a:hover {
  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: #333;
  border-radius: 4px;
}
.pagination .page-numbers.current {
  background-color: var(--primary-color);
  color: #fff;
}
.pagination .page-numbers:hover {
  background-color: var(--primary-color);
  color: #fff;
}

/*
 * Single post layout
 *
 * The theme defines a two‑column layout for single posts. The main article
 * appears on the left, while a sidebar on the right can display additional
 * content via a shortcode defined in the Visual Code Editor plugin. These
 * rules ensure the columns align nicely on larger screens and stack
 * vertically on mobile devices. The widths can be adjusted by editing
 * these classes or via custom CSS in the plugin.
 */
.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;
}
.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;
}

/* 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;
  }
}

/* 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;
  }
}