/*
Theme Name: Devocional Hoje - Biblioteca
Theme URI: https://devocionalhoje.com
Author: Devocional Hoje Edições
Author URI: https://devocionalhoje.com
Description: Tema para o Devocional Hoje com a Biblioteca Digital Cristã como página principal. Catálogo de ebooks via WooCommerce, com busca, filtros por categoria, carrinho e página de login customizada, no padrão visual cream + azul-marinho do site.
Version: 1.1.0
Requires at least: 6.0
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: devocionalhoje-biblioteca
*/

/* ==========================================================================
   RESET E BASE
   ========================================================================== */

:root {
  --dh-cream: #FBF7EF;
  --dh-white: #FFFFFF;
  --dh-blue: #1B356D;
  --dh-blue-dark: #1B3050;
  --dh-navy: #16213E;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--dh-cream);
  color: var(--dh-navy);
  font-family: 'Lora', Georgia, serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

button { font-family: inherit; }

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

/* ==========================================================================
   CABEÇALHO DO SITE
   ========================================================================== */

.dh-site-header {
  background: var(--dh-cream);
  border-bottom: 1px solid rgba(27, 53, 109, 0.12);
}

.dh-site-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.dh-logo {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 22px;
  color: var(--dh-blue);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dh-logo .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dh-blue);
  display: inline-block;
}

.dh-header-right {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.dh-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin: 0;
  padding: 0;
}
.dh-nav a {
  font-size: 15px;
  color: var(--dh-blue-dark);
  text-decoration: none;
}
.dh-nav a:hover { color: var(--dh-blue); }

/* Carrinho */
.dh-cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(27, 53, 109, 0.22);
  color: var(--dh-blue-dark);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.dh-cart-link:hover { border-color: var(--dh-blue); color: var(--dh-blue); }
.dh-cart-link svg { width: 18px; height: 18px; }
.dh-cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--dh-blue);
  color: var(--dh-cream);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

/* Login */
.dh-login-link {
  font-size: 15px;
  color: var(--dh-blue-dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(27, 53, 109, 0.3);
}
.dh-login-link:hover { color: var(--dh-blue); border-color: var(--dh-blue); }

/* ==========================================================================
   RODAPÉ DO SITE
   ========================================================================== */

.dh-site-footer {
  background: var(--dh-navy);
  color: rgba(251, 247, 239, 0.85);
  margin-top: 64px;
}
.dh-site-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 24px;
  text-align: center;
}
.dh-site-footer-inner p {
  font-size: 14px;
  margin: 0 0 6px;
}
.dh-site-footer-inner a {
  color: var(--dh-cream);
  text-decoration: underline;
  text-decoration-color: rgba(251, 247, 239, 0.4);
}
.dh-site-footer-inner a:hover { text-decoration-color: var(--dh-cream); }

/* ==========================================================================
   CONTEÚDO GENÉRICO DE PÁGINA (page.php)
   ========================================================================== */

.dh-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}
.dh-page h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.15;
  color: var(--dh-navy);
  margin: 0 0 28px;
}
.dh-page-content {
  font-size: 17px;
  color: var(--dh-navy);
}
.dh-page-content p { margin: 0 0 22px; }

/* ==========================================================================
   BIBLIOTECA DIGITAL CRISTÃ (página principal)
   ========================================================================== */

.dh-store {
  font-family: 'Lora', Georgia, serif;
  line-height: 1.7;
}

.dh-store-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

.dh-store-hero {
  max-width: 620px;
  margin: 0 auto 52px;
  text-align: center;
}

.dh-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Lora', serif;
  font-size: 14px;
  color: var(--dh-blue);
  background: var(--dh-white);
  border: 1px solid rgba(27, 53, 109, 0.18);
  border-radius: 999px;
  padding: 6px 16px;
  margin-bottom: 24px;
}
.dh-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dh-blue);
  display: inline-block;
}

.dh-store-title {
  font-family: 'Cormorant Garamond', 'Lora', serif;
  font-weight: 600;
  font-size: clamp(36px, 5.5vw, 54px);
  line-height: 1.1;
  color: var(--dh-navy);
  margin: 0 0 18px;
}

.dh-store-lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--dh-blue-dark);
  margin: 0;
}

/* ---------- BUSCA E FILTROS ---------- */
.dh-controls {
  max-width: 760px;
  margin: 0 auto 48px;
}

.dh-search {
  display: block;
  width: 100%;
  background: var(--dh-white);
  border: 1px solid rgba(27, 53, 109, 0.18);
  border-radius: 4px;
  padding: 13px 18px;
  font-family: 'Lora', serif;
  font-size: 15.5px;
  color: var(--dh-navy);
  margin-bottom: 18px;
}
.dh-search::placeholder { color: rgba(27, 53, 109, 0.45); }
.dh-search:focus {
  outline: none;
  border-color: var(--dh-blue);
}

.dh-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.dh-tab {
  font-family: 'Lora', serif;
  font-size: 14px;
  color: var(--dh-blue-dark);
  background: transparent;
  border: 1px solid rgba(27, 53, 109, 0.22);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.dh-tab:hover { border-color: var(--dh-blue); }
.dh-tab.is-active {
  background: var(--dh-blue);
  border-color: var(--dh-blue);
  color: var(--dh-white);
}

/* ---------- GRADE DE LIVROS ---------- */
.dh-books {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 24px;
}

.dh-book { display: block; }
.dh-book.is-hidden { display: none; }

.dh-cover-link { display: block; }

.dh-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 3px 4px 0 rgba(22, 33, 62, 0.10);
}

.dh-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dh-cover-icon {
  width: 26px;
  height: 26px;
  margin-bottom: 14px;
  opacity: 0.85;
}

.dh-cover-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.28;
}

.dh-cover-rule {
  width: 28px;
  height: 1px;
  margin-top: 14px;
  opacity: 0.55;
}

.dh-cover.tone-a { background: var(--dh-navy); color: var(--dh-cream); }
.dh-cover.tone-a .dh-cover-rule { background: var(--dh-cream); }

.dh-cover.tone-b { background: var(--dh-blue); color: var(--dh-cream); }
.dh-cover.tone-b .dh-cover-rule { background: var(--dh-cream); }

.dh-cover.tone-c { background: var(--dh-cream); color: var(--dh-navy); border: 1px solid rgba(27, 53, 109, 0.25); }
.dh-cover.tone-c .dh-cover-rule { background: var(--dh-blue); }

.dh-book-info { padding: 14px 2px 0; }

.dh-book-category {
  font-size: 12.5px;
  color: var(--dh-blue);
  margin: 0 0 4px;
}

.dh-book-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  margin: 0 0 8px;
}
.dh-book-title a {
  color: var(--dh-navy);
  text-decoration: none;
}
.dh-book-title a:hover { color: var(--dh-blue); }

.dh-book-row {
  margin-bottom: 12px;
}

.dh-book-price {
  font-size: 15px;
  color: var(--dh-navy);
  font-weight: 600;
}
.dh-book-price del { opacity: 0.5; font-weight: 400; margin-right: 6px; }
.dh-book-price ins { text-decoration: none; }

.dh-book-cta a.dh-add-to-cart {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: var(--dh-blue);
  color: var(--dh-white) !important;
  font-family: 'Lora', serif;
  font-size: 13.5px;
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 4px;
  transition: background 0.2s ease;
}
.dh-book-cta a.dh-add-to-cart:hover { background: var(--dh-blue-dark); }
.dh-book-cta a.dh-add-to-cart.added::after {
  content: " ✓";
}

.dh-empty {
  display: none;
  text-align: center;
  padding: 40px 0;
  color: var(--dh-blue-dark);
  font-size: 15.5px;
}
.dh-empty.is-visible { display: block; }

/* ---------- RODAPÉ DA SEÇÃO ---------- */
.dh-store-footer {
  text-align: center;
  margin-top: 64px;
  padding-top: 36px;
  border-top: 1px solid rgba(27, 53, 109, 0.14);
}
.dh-store-footer p {
  font-size: 15px;
  color: var(--dh-blue-dark);
  margin: 0 0 16px;
}
.dh-store-footer a {
  display: inline-block;
  background: var(--dh-blue);
  color: var(--dh-white);
  font-family: 'Lora', serif;
  font-size: 15px;
  text-decoration: none;
  padding: 12px 30px;
  border-radius: 4px;
  transition: background 0.2s ease;
}
.dh-store-footer a:hover { background: var(--dh-blue-dark); }

@media (max-width: 900px) {
  .dh-books { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .dh-store-wrap { padding: 44px 18px 72px; }
  .dh-books { grid-template-columns: repeat(2, 1fr); gap: 22px 16px; }
  .dh-cover-title { font-size: 16px; }
  .dh-site-header-inner { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   PÁGINA DE LOGIN CUSTOMIZADA
   ========================================================================== */

.dh-login-wrap {
  max-width: 460px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}

.dh-login-card {
  background: var(--dh-white);
  border: 1px solid rgba(27, 53, 109, 0.14);
  border-radius: 8px;
  padding: 44px 36px;
}

.dh-login-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 30px;
  color: var(--dh-navy);
  margin: 0 0 12px;
}

.dh-login-lead {
  font-size: 15.5px;
  color: var(--dh-blue-dark);
  margin: 0 0 28px;
}

.dh-login-notice {
  background: rgba(27, 53, 109, 0.08);
  border-left: 3px solid var(--dh-blue);
  border-radius: 2px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--dh-blue-dark);
  margin: 0 0 24px;
}

.dh-field {
  display: block;
  margin-bottom: 18px;
}
.dh-field span {
  display: block;
  font-size: 13.5px;
  color: var(--dh-blue-dark);
  margin-bottom: 6px;
}
.dh-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(27, 53, 109, 0.22);
  border-radius: 4px;
  font-family: 'Lora', serif;
  font-size: 15px;
  color: var(--dh-navy);
  background: var(--dh-cream);
}
.dh-field input:focus {
  outline: none;
  border-color: var(--dh-blue);
}

.dh-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 10px;
}

.dh-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--dh-blue-dark);
  cursor: pointer;
}

.dh-forgot-link {
  font-size: 13.5px;
  color: var(--dh-blue);
  text-decoration: none;
  border-bottom: 1px solid rgba(27, 53, 109, 0.3);
}
.dh-forgot-link:hover { border-color: var(--dh-blue); }

.dh-login-button {
  display: block;
  width: 100%;
  background: var(--dh-blue);
  color: var(--dh-white);
  border: none;
  font-family: 'Lora', serif;
  font-size: 15.5px;
  padding: 13px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.dh-login-button:hover { background: var(--dh-blue-dark); }

.dh-login-footer {
  text-align: center;
  font-size: 14px;
  color: var(--dh-blue-dark);
  margin: 22px 0 0;
}
.dh-login-footer a {
  color: var(--dh-blue);
  text-decoration: underline;
}

@media (max-width: 480px) {
  .dh-login-card { padding: 32px 24px; }
}
