/*
Theme Name: ScienceLab
Theme URI: https://github.com/rpasa/sciencelab
Author: Laboratory of Bioinformatics and Genomics - UFV CRP
Author URI: https://www.biogen.crp.ufv.br
Description: ScienceLab is a modern academic and scientific WordPress theme featuring fluid full-width layout support, responsive sidebar, clean typography, and multiple homepage layout styles.
Version: 3.6
Requires at least: 6.0
Tested up to: 6.7
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: sciencelab
Tags: blog, news, education, custom-menu, custom-logo, custom-header, custom-background, featured-images, full-width-template, translation-ready, right-sidebar, two-columns, grid-layout, block-patterns, block-styles, editor-style
*/

/* --------------------------------------------------
 * 1. NATIVE VARIABLES & RESET
 * -------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  /* Primary Colors */
  --primary-color: #682a2c;
  --primary-hover: #4a1e20;
  --secondary-color: rgba(104, 42, 44, 0.4);
  --tertiary-color: rgba(104, 42, 44, 0.08);
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-main: #2d3748;
  --text-muted: #64748b;
  --accent-gold: #D97706;

  /* Design System */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 30px -10px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Fluid Layout Dimensions */
  --site-padding: 0 3vw;
  --sidebar-width: 320px;
  --grid-gap: 32px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover,
a:focus {
  color: var(--primary-hover);
}

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

/* Accessibility Helpers */
.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,
.skip-link: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: 0.875rem;
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* --------------------------------------------------
 * 2. WordPress Core Required Styles
 * -------------------------------------------------- */
.alignleft {
  float: left;
  margin-right: 1.5em;
  margin-bottom: 1.5em;
}

.alignright {
  float: right;
  margin-left: 1.5em;
  margin-bottom: 1.5em;
}

.aligncenter {
  clear: both;
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5em;
}

.alignnone {
  margin: 0 0 1.5em 0;
}

.alignwide {
  max-width: 100%;
}

.alignfull {
  max-width: 100%;
  width: 100%;
}

.wp-caption {
  margin-bottom: 1.5em;
  max-width: 100%;
}

.wp-caption img[class*="wp-image-"] {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.wp-caption-text,
.gallery-caption {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5em;
  padding: 0.2em 0.5em;
}

.sticky {
  border-left: 4px solid var(--primary-color);
}

.bypostauthor {
  display: block;
}

/* Custom Header Media */
.custom-header-media img {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

/* Custom Block Styles */
.wp-block-quote.is-style-sciencelab-academic-quote {
  border-left: 4px solid var(--primary-color);
  font-style: italic;
  padding-left: 1.2em;
}

.wp-block-group.is-style-sciencelab-card {
  background: var(--card-bg);
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

/* --------------------------------------------------
 * 3. FLUID FULL-WIDTH LAYOUT STRUCTURE
 * -------------------------------------------------- */
.header-container,
.nav-container,
.content-wrapper,
.content-area,
.footer-container {
  width: 100%;
  max-width: 100%;
  padding: var(--site-padding);
  margin-left: auto;
  margin-right: auto;
}

/* Main Layout with Sidebar */
.content-wrapper,
.content-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  gap: var(--grid-gap);
  margin-top: 35px;
  margin-bottom: 50px;
}

.content-wrapper.full-width-layout {
  display: block;
}

main.site-main {
  min-width: 0;
}

/* --------------------------------------------------
 * 4. SITE HEADER (BRANDING & SEARCH)
 * -------------------------------------------------- */
.site-header {
  background-color: #682a2c;
  color: #ffffff;
  padding: 0;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 100;
}

.header-top {
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.header-top .header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 16px;
}

.custom-logo {
  max-height: 80px;
  width: auto;
  object-fit: contain;
}

.site-title {
  margin: 0;
  font-family: 'Lora', serif;
  font-size: clamp(1.8rem, 2.8vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
}

.site-title a {
  color: #ffffff;
}

.site-title a:hover {
  color: #fde68a;
}

.site-description {
  margin: 4px 0 0;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-search .search-form {
  display: flex;
  align-items: center;
  margin: 0;
}

.header-search .search-field {
  height: 40px;
  padding: 0 12px;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  outline: none;
  width: 160px;
  background-color: rgba(255, 255, 255, 0.95);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.header-search .search-field:focus {
  width: 200px;
  background-color: #ffffff;
}

.header-search .search-submit {
  height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-left: none;
  background-color: #ffffff;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  transition: var(--transition);
}

.header-search .search-submit:hover {
  background-color: #fde68a;
}

.header-social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.header-social a:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn-header {
  display: inline-block;
  padding: 8px 16px;
  background: #ffffff;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: var(--transition);
}

.btn-header:hover {
  background: #fde68a;
  color: var(--primary-hover);
}

/* --------------------------------------------------
 * 5. MAIN NAVIGATION (DESKTOP & MOBILE)
 * -------------------------------------------------- */
.main-navigation {
  background-color: transparent;
  padding: 8px 0;
}

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.main-navigation li a {
  display: block;
  padding: 8px 14px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.main-navigation li a:hover,
.main-navigation li.current-menu-item > a {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
}

.menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px auto;
  width: 100%;
  max-width: 280px;
  transition: var(--transition);
}

.menu-toggle-icon {
  display: inline-block;
  width: 20px;
  height: 2px;
  background: #ffffff;
  position: relative;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background: #ffffff;
  left: 0;
}

.menu-toggle-icon::before { top: -6px; }
.menu-toggle-icon::after { top: 6px; }

/* --------------------------------------------------
 * 6. FEATURED POST & SECONDARY GRIDS
 * -------------------------------------------------- */
.post-destaque {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid #f1f5f9;
}

.post-destaque img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.post-destaque .entry-meta {
  margin-top: 15px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.card-post {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #f1f5f9;
  transition: var(--transition);
}

.card-post:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-post img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.meta-category {
  background: var(--tertiary-color);
  color: var(--primary-color);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

/* --------------------------------------------------
 * 7. HORIZONTAL CARDS WITH ZIG-ZAG ALTERNATION
 * -------------------------------------------------- */
.posts-list-horizontal {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card-post-horizontal {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #f1f5f9;
  transition: var(--transition);
}

.card-post-horizontal:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-post-horizontal.odd-post {
  flex-direction: row;
}

.card-post-horizontal.even-post {
  flex-direction: row-reverse;
}

.card-post-horizontal .post-thumb {
  flex: 0 0 280px;
  width: 280px;
  max-width: 280px;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.card-post-horizontal .post-thumb a {
  display: block;
  width: 100%;
}

.card-post-horizontal .post-thumb img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

.card-post-horizontal .post-details {
  flex: 1 1 auto;
  min-width: 0;
}

.card-post-horizontal .entry-title {
  margin: 4px 0 8px 0;
  font-size: 1.2rem;
  line-height: 1.35;
}

.read-more-link {
  display: inline-block;
  margin-top: 10px;
  font-weight: 600;
  color: var(--primary-color);
  transition: var(--transition);
}

.read-more-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* --------------------------------------------------
 * 8. CATEGORIES, FILTERS & THEMED BLOCKS
 * -------------------------------------------------- */
.category-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.filter-btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  border: 1px solid #e2e8f0;
  font-size: 0.85rem;
  color: var(--text-main);
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

.category-block {
  margin-top: 36px;
}

.category-block-title,
.section-title {
  font-family: 'Lora', serif;
  font-size: 1.4rem;
  color: var(--primary-color);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--tertiary-color);
}

/* --------------------------------------------------
 * 9. SIDEBAR & WIDGETS
 * -------------------------------------------------- */
.sidebar .widget,
.widget-area .widget {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #f1f5f9;
}

.sidebar .widget-title,
.widget-area .widget-title {
  font-family: 'Lora', serif;
  font-size: 1.15rem;
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--tertiary-color);
}

.sidebar ul,
.widget-area ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li a,
.widget-area li a {
  display: block;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9rem;
}

.sidebar li a:hover,
.widget-area li a:hover {
  background: var(--primary-color);
  color: #ffffff;
}

/* --------------------------------------------------
 * 10. STATIC PAGES & SINGLE POSTS
 * -------------------------------------------------- */
.page-full-content,
.single-post-card,
article.type-post,
article.type-page {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #f1f5f9;
}

.post-thumbnail-featured,
.post-featured-image {
  margin-bottom: 24px;
}

.post-thumbnail-featured img,
.post-featured-image img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.entry-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.page-links {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
  font-weight: 600;
}

.tags-links {
  margin-top: 20px;
  font-size: 0.9rem;
}

.tags-title {
  font-weight: 600;
  margin-right: 8px;
}

.tags-links a {
  display: inline-block;
  padding: 2px 8px;
  background: var(--tertiary-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-right: 4px;
  margin-bottom: 4px;
}

/* Post Navigation (Single) */
.post-navigation {
  margin: 30px 0;
  padding: 20px 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

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

.post-navigation .nav-subtitle {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.post-navigation .nav-title {
  font-weight: 600;
  color: var(--primary-color);
}

/* --------------------------------------------------
 * 11. COMMENTS
 * -------------------------------------------------- */
.comments-area {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #e2e8f0;
}

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

.comment-list .comment {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-md);
}

.comment-list .children {
  list-style: none;
  padding-left: 24px;
  margin-top: 16px;
}

.comment-body .comment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.comment-body .avatar {
  border-radius: 50%;
}

.comment-body .fn {
  font-weight: 600;
  color: var(--text-main);
}

.comment-respond {
  margin-top: 30px;
}

.comment-form-comment textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  margin-top: 6px;
}

.comment-form input[type="submit"] {
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.comment-form input[type="submit"]:hover {
  background: var(--primary-hover);
}

/* --------------------------------------------------
 * 12. FOOTER
 * -------------------------------------------------- */
.site-footer {
  background-color: #682a2c;
  color: rgba(255, 255, 255, 0.9);
  padding: 30px 0;
  margin-top: 60px;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.site-footer .footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-footer a {
  color: #ffffff;
  font-weight: 500;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------
 * 13. RESPONSIVE DESIGN (TABLETS & SMARTPHONES)
 * -------------------------------------------------- */
@media (max-width: 992px) {
  .content-wrapper,
  .content-area {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .card-post-horizontal,
  .card-post-horizontal.odd-post,
  .card-post-horizontal.even-post {
    flex-direction: column !important;
    align-items: stretch;
    gap: 16px;
  }

  .card-post-horizontal .post-thumb {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .card-post-horizontal .post-thumb img {
    height: 200px !important;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .header-top .header-container {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }

  .menu-toggle {
    display: flex;
  }

  .main-navigation ul {
    display: none;
    flex-direction: column;
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    padding: 12px 0;
  }

  .main-navigation.toggled ul,
  .main-navigation.nav-open ul {
    display: flex !important;
  }
}
