/*
Theme Name:   Kadence Child Hiragami
Template:     kadence
Version:      1.0.1
*/

/* =============================================
   VARIÁVEIS — provisórias, aguardando branding oficial
   Logo Hiragami: vermelho + branco
   ============================================= */
:root {
  --color-primary:   #be1622;   /* vermelho Hiragami */
  --color-primary-dark: #97101b; /* vermelho escuro (hover) */
  --color-secondary: #c4a35a;   /* dourado (acento luxo/vinho) */
  --color-accent:    #1a3a0a;   /* verde vinhedo (sutil) */
  --color-dark:      #1a1a1a;
  --color-mid:       #6b6b6b;
  --color-light:     #fafafa;
  --color-border:    #e8e8e8;
  --color-white:     #ffffff;

  --font-heading:    'Playfair Display', serif;
  --font-body:       'Inter', sans-serif;

  --max-content:     1200px;
  --max-reading:     760px;
  --radius:          6px;
  --radius-lg:       12px;
}

/* =============================================
   BASE
   ============================================= */
body {
  font-family: var(--font-body);
  color: var(--color-dark);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
}

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

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

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

/* =============================================
   UTILITÁRIOS
   ============================================= */
.hg-container {
  max-width: var(--max-content);
  margin-inline: auto;
  padding-inline: 2rem;
}

.hg-container--narrow {
  max-width: 700px;
  margin-inline: auto;
  padding-inline: 2rem;
}

.hg-btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
}

.hg-btn--primary {
  background: var(--color-secondary);
  color: var(--color-dark);
  border: 2px solid var(--color-secondary);
}

.hg-btn--primary:hover {
  background: transparent;
  color: var(--color-secondary);
}

.hg-btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.hg-btn--outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* =============================================
   HEADER — transparente na home, sólido no restante
   ============================================= */

/* Header padrão (páginas internas) */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.3s, border-color 0.3s;
}

/* Header transparente: home e posts com imagem de destaque */
.home .site-header,
.home #masthead,
.hg-has-hero .site-header,
.hg-has-hero #masthead {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

/* Esconde site-title text globalmente quando há custom_logo */
.wp-custom-logo .site-title,
.wp-custom-logo .site-description,
.wp-custom-logo .site-title-wrap {
  display: none !important;
}

/* Logo branca */
.home .custom-logo-link img,
.home .site-logo img,
.home .brand img,
.home img.custom-logo,
.hg-has-hero .custom-logo-link img,
.hg-has-hero .site-logo img,
.hg-has-hero .brand img,
.hg-has-hero img.custom-logo {
  max-height: 52px;
  width: auto;
  filter: brightness(0) invert(1);
}

/* Navegação branca */
.home .main-navigation a,
.home .kadence-navigation a,
.home header .nav-link,
.home .header-navigation a,
.hg-has-hero .main-navigation a,
.hg-has-hero .kadence-navigation a,
.hg-has-hero header .nav-link,
.hg-has-hero .header-navigation a {
  color: var(--color-white) !important;
}

.home .main-navigation a:hover,
.home .kadence-navigation a:hover,
.hg-has-hero .main-navigation a:hover,
.hg-has-hero .kadence-navigation a:hover {
  color: var(--color-secondary) !important;
}

/* Header sólido nas demais páginas */
.site-branding .site-title a,
.site-title a {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--color-primary);
  letter-spacing: 0.03em;
  text-decoration: none;
}

/* Logo colorida fora da home */
.custom-logo-link img,
.site-logo img,
.brand img,
img.custom-logo {
  max-height: 48px;
  width: auto;
}

.main-navigation a,
.kadence-navigation a {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-dark);
  text-decoration: none;
}

.main-navigation a:hover,
.kadence-navigation a:hover {
  color: var(--color-primary);
}

/* =============================================
   HERO CARROSSEL — página inicial (estilo SENAI SC)
   ============================================= */
.hg-hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  background: #111;
}

/* Slides */
.hg-carousel__slides {
  position: relative;
  height: 100%;
}

.hg-carousel__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.8s ease;
  /* Fallback: gradiente quando não há imagem */
  background-color: var(--color-accent);
}

.hg-carousel__slide.is-active {
  opacity: 1;
}

.hg-carousel__slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(10, 5, 5, 0.80) 0%,
    rgba(10, 5, 5, 0.45) 60%,
    rgba(10, 5, 5, 0.15) 100%
  );
}

/* Conteúdo do slide — centralizado vertical e horizontal */
.hg-slide__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem 2rem 5rem; /* padding-top compensa o header flutuante */
  max-width: var(--max-content);
  margin-inline: auto;
  left: 0;
  right: 0;
}

.hg-slide__cat {
  display: inline-block;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-white);
  background: var(--color-primary);
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 1.1rem;
}

.hg-slide__title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4.5vw, 3.4rem);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.15;
  margin-bottom: 1rem;
  max-width: 760px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.hg-slide__excerpt {
  font-size: 1rem;
  color: rgba(255,255,255,0.82);
  line-height: 1.65;
  max-width: 560px;
  margin-bottom: 2rem;
}

.hg-slide__link {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--color-primary);
  color: var(--color-white);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.hg-slide__link:hover {
  background: transparent;
  border-color: var(--color-white);
  color: var(--color-white);
}

/* Dots de navegação */
.hg-carousel__dots {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.hg-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.hg-dot.is-active {
  background: var(--color-white);
  transform: scale(1.25);
}

/* Setas laterais */
.hg-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--color-white);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
}

.hg-carousel__arrow:hover {
  background: rgba(255,255,255,0.28);
}
.hg-carousel__arrow:focus,
.hg-carousel__arrow:active,
.hg-dot:focus,
.hg-dot:active {
  outline: none;
  background: rgba(255,255,255,0.28);
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.hg-carousel__arrow--prev { left: 1.5rem; }
.hg-carousel__arrow--next { right: 1.5rem; }

/* =============================================
   SEÇÃO DE POSTS — home
   ============================================= */
.hg-posts-section {
  padding: 5rem 0;
}

.hg-section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.hg-section-title {
  font-size: 2rem;
  color: var(--color-dark);
}

.hg-section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--color-secondary);
  margin: 0.75rem auto 0;
}

.hg-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.hg-posts-section__footer {
  text-align: center;
  margin-top: 3rem;
}

/* =============================================
   POST CARD
   ============================================= */
.hg-post-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.25s;
  display: flex;
  flex-direction: column;
}

.hg-post-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.09);
  transform: translateY(-3px);
}

.hg-post-card__image-wrap {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #f0ede8; /* fundo creme para imagens com fundo branco/transparente */
}

.hg-post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.hg-post-card:hover .hg-post-card__image {
  transform: scale(1.05);
}

.hg-post-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.hg-post-card__cat {
  display: inline-block;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: rgba(190, 22, 34, 0.08);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

.hg-post-card__cat:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.hg-post-card__title {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
  flex: 1;
}

.hg-post-card__title a {
  color: var(--color-dark);
  text-decoration: none;
}

.hg-post-card__title a:hover {
  color: var(--color-primary);
}

.hg-post-card__excerpt {
  font-size: 0.9rem;
  color: var(--color-mid);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.hg-post-card__meta {
  font-size: 0.8rem;
  color: var(--color-mid);
  border-top: 1px solid var(--color-border);
  padding-top: 0.85rem;
  margin-top: auto;
}

/* =============================================
   NEWSLETTER CTA — home
   ============================================= */
.hg-newsletter-cta {
  background: var(--color-light);
  border-top: 1px solid var(--color-border);
  padding: 5rem 0;
  text-align: center;
}

.hg-newsletter-cta__title {
  font-size: 1.9rem;
  margin-bottom: 1rem;
  color: var(--color-dark);
}

.hg-newsletter-cta__text {
  font-size: 1rem;
  color: var(--color-mid);
  line-height: 1.65;
  margin-bottom: 2.5rem;
}

.hg-placeholder {
  color: #aaa;
  font-size: 0.85rem;
  font-style: italic;
}

/* =============================================
   BLOG LISTING — home.php
   ============================================= */
.hg-blog-header {
  background: var(--color-light);
  padding: 4rem 0 3rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.hg-blog-header__title {
  font-size: 2.5rem;
  color: var(--color-dark);
}

.hg-blog-header__desc {
  font-size: 1rem;
  color: var(--color-mid);
  margin-top: 0.75rem;
}

.hg-archive {
  padding: 4rem 0;
}

.hg-archive__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.hg-pagination {
  margin-top: 4rem;
  text-align: center;
}

.hg-pagination .page-numbers {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin: 0 0.2rem;
  color: var(--color-dark);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.hg-pagination .page-numbers.current,
.hg-pagination .page-numbers:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

/* =============================================
   HERO DO POST — imagem de destaque full-width
   ============================================= */
.hg-post-hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  background-color: var(--color-dark);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  overflow: hidden;
}

.hg-post-hero--no-image {
  min-height: 28vh;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-dark));
}

.hg-post-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 5, 5, 0.88) 0%,
    rgba(10, 5, 5, 0.45) 50%,
    rgba(10, 5, 5, 0.15) 100%
  );
}

.hg-post-hero__overlay {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hg-post-hero__content {
  max-width: var(--max-reading);
  margin-inline: auto;
  padding: 5rem 2rem 3.5rem;
}

.hg-post-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.2;
  margin: 0.75rem 0 1rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.hg-post-hero__lead {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  font-style: italic;
}

.hg-post-hero__meta {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.03em;
}

/* Corpo do post */
.hg-single__body {
  padding: 3.5rem 0 5rem;
}

/* =============================================
   FRASE DE DESTAQUE — lead text acima do conteúdo
   ============================================= */
.hg-post-lead {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-mid);
  line-height: 1.65;
  border-left: 3px solid var(--color-primary);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 0 0 2.5rem;
  font-style: italic;
}

/* =============================================
   SINGLE POST — layout de leitura (Kadence native)
   ============================================= */
.single-post .entry-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.single-post .entry-content {
  font-size: 1.05rem;
  line-height: 1.85;
}

.single-post .entry-content p {
  margin-bottom: 1.5rem;
  color: var(--color-dark);
}

.single-post .entry-content h2 {
  font-size: 1.6rem;
  margin: 2.5rem 0 1rem;
  color: var(--color-dark);
}

.single-post .entry-content h3 {
  font-size: 1.3rem;
  margin: 2rem 0 0.75rem;
  color: var(--color-dark);
}

.single-post .entry-content ul,
.single-post .entry-content ol {
  margin: 0 0 1.5rem 1.5rem;
  line-height: 1.8;
}

.single-post .entry-content blockquote {
  border-left: 4px solid var(--color-secondary);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--color-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-mid);
}

.single-post .entry-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.single-post .entry-content img {
  border-radius: var(--radius);
}

/* =============================================
   FORMULÁRIO RD STATION — posts
   ============================================= */
.hiragami-rd-form-wrapper {
  background: var(--color-light);
  border-left: 4px solid var(--color-primary);
  padding: 2.5rem;
  margin: 3rem 0;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.hiragami-rd-form-wrapper h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.hiragami-rd-form-wrapper p {
  font-size: 0.95rem;
  color: var(--color-mid);
  margin-bottom: 1.5rem;
}

/* =============================================
   KADENCE WRAPPERS — overrides
   ============================================= */

/* Remove min-height que gera espaço em branco nas páginas de template */
#inner-wrap.wrap {
  min-height: 0 !important;
}

/* =============================================
   FOOTER — overrides Kadence
   ============================================= */
/* Oculta o hero de título do Kadence em páginas — substituído por .hg-page-header */
.page .entry-hero,
.page .kadence-breadcrumbs {
  display: none !important;
}

/* =============================================
   PÁGINA DE CONTATO
   ============================================= */
.hg-contato-wrap {
  padding: 3rem 0;
}

.hg-contato-info p {
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.hg-contato-info strong {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.15rem;
}

.hg-contato-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 1rem;
  text-decoration: none;
  color: var(--color-primary);
}

.hg-contato-social-link svg {
  flex-shrink: 0;
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer,
.hg-footer {
  background: #110505;
  color: rgba(255, 255, 255, 0.65);
  border-top: 3px solid var(--color-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.hg-footer__main {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  padding: 3.5rem 0;
}

.hg-footer__brand {
  display: flex;
  flex-direction: column;
}

.hg-footer__logo {
  max-height: 120px;
  width: auto;
  filter: brightness(0) invert(1);
  margin-bottom: 1rem;
}

.hg-footer__tagline {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  margin: 0.25rem 0 1rem;
  font-style: italic;
}

.hg-footer__social {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.hg-footer__social a {
  color: rgba(255,255,255,0.5);
  transition: color 0.2s;
}

.hg-footer__social a:hover {
  color: var(--color-primary);
}

.hg-footer__nav,
.hg-footer__contact {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hg-footer__nav h4,
.hg-footer__contact h4 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 0.5rem;
}

.hg-footer__nav a,
.hg-footer__contact a,
.site-footer a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color 0.2s;
}

.hg-footer__nav a:hover,
.hg-footer__contact a:hover,
.site-footer a:hover {
  color: var(--color-secondary);
}

.hg-footer__contact p {
  margin: 0;
  line-height: 1.7;
}

.hg-footer__copy {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.3);
}

.hg-footer__copy p { margin: 0; }

.site-footer .site-info {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.82rem;
}

/* =============================================
   RESPONSIVO
   ============================================= */
@media (max-width: 1024px) {
  .hg-posts-grid,
  .hg-archive__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hg-hero {
    min-height: 72vh;
  }

  .hg-hero__title {
    font-size: 2.2rem;
  }

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

  .hg-container {
    padding-inline: 1.25rem;
  }

  .hg-container--narrow {
    padding-inline: 1.25rem;
  }

  .hiragami-rd-form-wrapper {
    padding: 1.5rem;
  }
}
