/*
 Theme Name: ScienceLab
 Theme URI: https://www.ufv.br
 Author: Laboratório de Bioinformática e Genômica - UFV CRP
 Author URI: https://www.ufv.br
 Description: Modern academic WordPress theme with fluid typography, block editor support, and responsive layout.
 Version: 3.0
 Requires at least: 6.0
 Tested up to: 6.7
 Requires PHP: 7.4
 License: GNU General Public License v2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: sciencelab
 Tags: news, education, custom-menu, featured-images, full-width-template, theme-options, translation-ready
 */

/* -------------------------------
 * RESET & CSS CUSTOM PROPERTIES
 * ------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --primary-color: #750300;
  --primary-hover: #590200;
  --secondary-color: rgba(117,3,0,0.4);
  --tertiary-color: rgba(117,3,0,0.08);
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-main: #2d3748;
  --text-muted: #64748b;
  --accent-gold: #D97706;
  --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), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 30px -10px rgba(0,0,0,0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-height: auto;
  --max-width: 1280px;
}

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

/* -------------------------------
 * SITE HEADER
 * ------------------------------- */
.site-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #4a0200 100%);
  color: #ffffff;
  padding: 20px 0;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 100;
}

.header-inner,
.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  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.4rem, 2.5vw, 2.1rem);
  font-weight: 700;
  line-height: 1.2;
}

.site-title a {
  color: #ffffff;
  letter-spacing: -0.5px;
}

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

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

/* Header Actions & Social Links */
.header-right,
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Search Field */
.header-top form.search-form {
  position: relative;
}

.header-top input.search-field {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border-radius: 30px;
  padding: 8px 18px;
  font-size: 0.88rem;
  color: #ffffff;
  outline: none;
  transition: var(--transition);
  width: 180px;
}

.header-top input.search-field::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.header-top input.search-field:focus {
  width: 240px;
  background: #ffffff;
  color: var(--text-main);
  border-color: #ffffff;
}

.header-top input.search-submit {
  display: none;
}

/* Header Social Media Icons */
.header-social {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  transition: var(--transition);
}

.header-social a:hover {
  background: #ffffff;
  transform: translateY(-2px);
}

.header-social a img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
  transition: var(--transition);
}

.header-social a:hover img {
  filter: none;
}

/* Header CTA Button */
.btn-header {
  display: inline-block;
  padding: 8px 18px;
  background: #ffffff;
  color: var(--primary-color);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

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

/* -------------------------------
 * MAIN NAVIGATION & MOBILE MENU
 * ------------------------------- */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
}

.main-navigation {
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 90;
}

.main-navigation ul {
  list-style: none;
  margin: 0 auto;
  padding: 0 24px;
  max-width: var(--max-width);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.main-navigation li a {
  display: block;
  padding: 16px 20px;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
}

.main-navigation li a:hover,
.main-navigation li.current-menu-item > a {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: var(--tertiary-color);
}

/* -------------------------------
 * LAYOUT STRUCTURE
 * ------------------------------- */
.content-area,
.content-wrapper {
  max-width: var(--max-width);
  margin: 40px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
}

main.site-main,
.main-content-area {
  min-width: 0;
}

/* -------------------------------
 * POSTS & CARDS (INDEX / ARCHIVE)
 * ------------------------------- */

/* Meta Information (Category, Date, Reading Time) */
.entry-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.meta-category {
  background: var(--tertiary-color);
  color: var(--primary-color);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-category:hover {
  background: var(--primary-color);
  color: #ffffff;
}

.meta-reading-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Featured Post */
.post-destaque {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 35px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid #f1f5f9;
}

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

.post-destaque .post-thumbnail-link {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.post-destaque img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-destaque:hover img {
  transform: scale(1.02);
}

.post-destaque h2.entry-title {
  font-family: 'Lora', serif;
  font-size: clamp(1.5rem, 2.2vw, 2.2rem);
  margin: 12px 0;
  line-height: 1.3;
}

.post-destaque h2.entry-title a {
  color: var(--text-main);
}

.post-destaque h2.entry-title a:hover {
  color: var(--primary-color);
}

/* Posts Grid */
.grid-posts,
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.grid-item,
.card-post {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

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

.grid-item .post-thumbnail-link,
.card-post .post-thumbnail {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.grid-item img,
.card-post .post-thumbnail img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.grid-item:hover img,
.card-post:hover .post-thumbnail img {
  transform: scale(1.04);
}

.grid-item h2.entry-title,
.card-post .post-title {
  font-family: 'Lora', serif;
  font-size: 1.25rem;
  margin: 8px 0;
  line-height: 1.4;
}

.grid-item h2.entry-title a,
.card-post .post-title a {
  color: var(--text-main);
}

.grid-item h2.entry-title a:hover,
.card-post .post-title a:hover {
  color: var(--primary-color);
}

/* Read More Link */
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-color);
}

.read-more:hover {
  color: var(--primary-hover);
  transform: translateX(4px);
}

/* Pagination Navigation */
.post-navigation,
.navigation.posts-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.post-navigation a,
.navigation.posts-navigation a {
  display: inline-block;
  padding: 10px 18px;
  background: var(--card-bg);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.9rem;
}

.post-navigation a:hover,
.navigation.posts-navigation a:hover {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

/* -------------------------------
 * SIDEBAR & WIDGETS
 * ------------------------------- */
.sidebar,
.widget-area {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar .widget,
.widget-area .widget {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #f1f5f9;
}

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

.sidebar ul,
.widget-area ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

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

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

.single-featured-image,
.post-featured-image {
  margin: -36px -36px 30px -36px;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.single-featured-image img,
.post-featured-image img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

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

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-family: 'Lora', serif;
  color: var(--text-main);
  margin-top: 1.8em;
  margin-bottom: 0.6em;
}

.entry-content blockquote {
  border-left: 4px solid var(--primary-color);
  background: var(--tertiary-color);
  margin: 24px 0;
  padding: 16px 24px;
  font-style: italic;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* -------------------------------
 * COMMENTS SECTION
 * ------------------------------- */
.comments-area {
  margin-top: 40px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #f1f5f9;
}

.comments-title {
  font-family: 'Lora', serif;
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 24px;
}

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

.comment-list li {
  padding: 16px 0;
  border-bottom: 1px solid #e2e8f0;
}

/* -------------------------------
 * SITE FOOTER
 * ------------------------------- */
footer.site-footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 40px 0;
  margin-top: 60px;
  font-size: 0.9rem;
}

.footer-inner,
.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.footer-inner a,
.footer-container a {
  color: #f1f5f9;
}

.footer-inner a:hover,
.footer-container a:hover {
  color: #fde68a;
}

.back-to-top {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #ffffff;
  transition: var(--transition);
}

.back-to-top:hover {
  background: var(--primary-color);
  color: #ffffff;
}

/* -------------------------------
 * RESPONSIVE MEDIA QUERIES
 * ------------------------------- */
@media (max-width: 992px) {
  .content-area,
  .content-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-inner,
  .header-container,
  .footer-container {
    flex-direction: column;
    text-align: center;
  }

  .header-right,
  .header-actions {
    flex-direction: column;
    width: 100%;
  }

  .header-top input.search-field {
    width: 100%;
  }

  .header-top input.search-field:focus {
    width: 100%;
  }

  .menu-toggle {
    display: block;
  }

  .main-navigation ul {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 10px 0;
  }

  .main-navigation.nav-open ul {
    display: flex;
  }

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

  article.type-post,
  article.type-page,
  .single-post-card,
  .page-card {
    padding: 20px;
  }

  .single-featured-image,
  .post-featured-image {
    margin: -20px -20px 20px -20px;
  }
}
