/*
 * Theme Name: ScienceLab
 * Theme URI: https://example.com/sciencelab
 * Author: Rubens Pasa
 * Description: Tema acadêmico WordPress com destaque de post, grid 2x2 e layout claro com controle de proporções das imagens.
 * Version: 2.3
 * License: GPLv2 or later
 * Text Domain: sciencelab
 */

/* ==============================
 *   BASE E CORES
 *   ============================== */
html, body {
  margin: 0;
  padding: 0;
  background: #fff;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

:root {
  --primary-color: #750300;   /* Cor principal */
  --secondary-color: #ba817f; /* Tom médio */
  --tertiary-color: #e3cccc;  /* Tom claro */
  --header-gradient: linear-gradient(to left, var(--primary-color) 0%, var(--secondary-color) 100%);
  --header-height: 120px;
}

/* ==============================
 *   HEADER
 *   ============================== */
.site-header {
  background: var(--header-gradient);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px 12px 0 0;
  width: 95vw;
  margin: 0 auto;
  box-sizing: border-box;
  overflow: hidden;
  height: var(--header-height);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 95%;
  margin: 0 auto;
}

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

.custom-logo {
  max-height: calc(var(--header-height) * 0.9);
  width: auto;
  height: auto;
  object-fit: contain;
}

.site-title {
  font-family: 'Georgia', serif;
  font-weight: 700;
  font-size: 2.3em;
  color: #fff;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
  margin: 0;
}

.site-description {
  font-family: 'Open Sans', sans-serif;
  font-size: 1.2em;
  color: #000;
  margin: 0;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.header-social img {
  width: 22px;
  height: 22px;
  margin-left: 8px;
  filter: brightness(0) invert(1);
  transition: opacity 0.3s;
}

.header-social a:hover img {
  opacity: 0.7;
}

/* ==============================
 *   MENU
 *   ============================== */
.main-navigation {
  background: linear-gradient(to bottom, var(--secondary-color) 0%, var(--tertiary-color) 100%);
  width: 95vw;
  margin: 0 auto 20px;
  padding: 10px 0;
}

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

.main-navigation a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

.main-navigation a:hover {
  color: var(--tertiary-color);
}

/* ==============================
 *   CONTEÚDO E SIDEBAR
 *   ============================== */
.content-area {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 0 auto 40px;
  padding: 25px 30px;
  background: var(--tertiary-color);
  border-radius: 0 0 12px 12px;
  width: 95vw;
  box-sizing: border-box;
}

main {
  flex: 3;
  background: #fff;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.sidebar {
  flex: 1;
  min-width: 280px;
  margin-left: 25px;
  background: var(--secondary-color);
  border-radius: 10px;
  padding: 20px;
  color: #fff;
}

.sidebar h3.widget-title {
  background: rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 6px 10px;
  color: #fff;
}

/* ==============================
 *   POST DESTAQUE
 *   ============================== */
.post-destaque {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin: 0 auto 35px;
  box-shadow: 0 0 10px rgba(117, 3, 0, 0.25);
  text-align: center;
  width: 60%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-destaque:hover {
  transform: scale(1.01);
  box-shadow: 0 0 14px rgba(117, 3, 0, 0.35);
}

/* imagem principal ajustada proporcionalmente */
.post-destaque img {
  display: block;
  margin: 0 auto 15px;
  width: 100%;
  max-width: 900px;
  height: auto;
  max-height: 450px;
  object-fit: contain;
  border-radius: 10px;
}

.post-destaque h2.entry-title {
  background: linear-gradient(to right, var(--secondary-color) 0%, var(--tertiary-color) 100%);
  color: #fff;
  padding: 10px 15px;
  border-radius: 8px;
  margin-top: 10px;
}

/* ==============================
 *   GRID DE POSTS (2x2)
 *   ============================== */
.grid-posts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  width: 80%;
  margin: 0 auto 50px;
}

.grid-item {
  background: #fff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

/* imagens do grid proporcionais e centralizadas */
.grid-item img {
  display: block;
  margin: 0 auto 10px;
  width: 100%;
  max-width: 450px;
  height: auto;
  max-height: 250px;
  object-fit: contain;
  border-radius: 10px;
}

/* ==============================
 *   NAVEGAÇÃO DE POSTS
 *   ============================== */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  font-weight: bold;
}

.post-navigation a {
  background: var(--primary-color);
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.3s ease;
}

.post-navigation a:hover {
  background: var(--tertiary-color);
  color: var(--primary-color);
}

/* ==============================
 *   FOOTER
 *   ============================== */
footer {
  background: var(--secondary-color);
  border-radius: 0 0 12px 12px;
  padding: 30px 0;
  color: #fff;
  text-align: center;
  width: 95vw;
  margin: 0 auto;
}

.footer-copy p {
  font-size: 0.9em;
  color: #fff;
  opacity: 0.9;
  margin: 0;
  font-style: italic;
}

/* ==============================
 *   LINKS
 *   ============================== */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--tertiary-color);
}

/* ==============================
 *   RESPONSIVO
 *   ============================== */
@media (max-width: 1000px) {
  .content-area {
    flex-direction: column;
  }

  .post-destaque {
    width: 90%;
  }

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

  .post-destaque img {
    max-width: 100%;
    max-height: 360px;
  }

  .grid-item img {
    max-width: 100%;
    max-height: 220px;
  }

  .sidebar {
    margin-top: 20px;
    width: 100%;
  }
}
