/*
Theme Name: A Terapia Literária — Editorial v4
Theme URI: https://example.com/
Author: A Terapia Literária
Description: Tema editorial para A Terapia Literária, com homepage configurável, header avançado, Gutenberg, artigos em destaque, blog, newsletter e controles de tipografia.
Version: 4.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: a-terapia-literaria
*/

:root{
  --tl4-bronze:#3D2E24;
  --tl4-sepia:#8C7355;
  --tl4-gold:#B89966;
  --tl4-gray:#2B2E33;
  --tl4-white:#FFFFFF;
  --tl4-paper:#F7F1E8;
  --tl4-line:rgba(61,46,36,.16);
  --tl4-shadow:0 18px 55px rgba(43,46,51,.10);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  color:var(--tl4-gray);
  background:var(--tl4-paper);
  font-family:Georgia,"Times New Roman",serif;
  line-height:1.7;
}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto;display:block}
button,input,textarea,select{font:inherit}

.tl4-site-header{
  position:relative;
  min-height:680px;
  display:flex;
  flex-direction:column;
  color:var(--tl4-white);
  background:
    linear-gradient(180deg,rgba(20,15,12,.40),rgba(20,15,12,.68)),
    var(--tl4-hero) center/cover no-repeat;
  overflow:hidden;
}
.tl4-header-inner{
  width:min(1320px,calc(100% - 56px));
  margin:0 auto;
  padding:30px 0 36px;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:start;
  gap:32px;
  position:relative;
  z-index:2;
}
.tl4-brand{
  display:flex;
  align-items:center;
  gap:13px;
  min-width:0;
}
.tl4-brand img{
  width:46px;height:46px;object-fit:contain;border-radius:2px;
}
.tl4-brand-name{
  font-size:var(--tl4-brand-size,24px);
  font-family:var(--tl4-brand-font,Georgia),serif;
  line-height:1.05;
  letter-spacing:.02em;
  white-space:nowrap;
}
.tl4-menu{
  transform:translateY(var(--tl4-nav-offset,0px));
  justify-self:center;
}
.tl4-menu ul{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:34px;
  list-style:none;
  margin:0;
  padding:0;
}
.tl4-menu a{
  font-size:var(--tl4-nav-size,15px);
  font-family:var(--tl4-nav-font,Georgia),serif;
  letter-spacing:.09em;
  text-transform:uppercase;
  position:relative;
  padding:7px 0;
}
.tl4-menu a:after{
  content:"";
  position:absolute;
  left:0;bottom:0;width:0;height:1px;
  background:var(--tl4-white);
  transition:width .3s ease;
}
.tl4-menu a:hover:after,.tl4-menu .current-menu-item a:after{width:100%}

.tl4-header-actions{
  justify-self:end;
  display:flex;
  align-items:center;
  gap:14px;
}
.tl4-social{
  display:flex;
  align-items:center;
  gap:10px;
}
.tl4-social a,.tl4-search-toggle{
  width:34px;height:34px;
  display:grid;place-items:center;
  color:var(--tl4-white);
  border:0;background:transparent;
  cursor:pointer;
  padding:0;
  opacity:.94;
  transition:transform .2s ease,opacity .2s ease;
}
.tl4-social a:hover,.tl4-search-toggle:hover{
  transform:translateY(-2px);
  opacity:1;
}
.tl4-social svg{
  width:20px;height:20px;
  fill:none;stroke:currentColor;stroke-width:1.8;
}
.tl4-social img{
  width:20px;height:20px;object-fit:contain;
}
.tl4-search-toggle svg{
  width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;
}
.tl4-search-panel{
  display:none;
  position:absolute;
  top:84px;right:28px;
  z-index:5;
  width:min(420px,calc(100% - 56px));
  padding:15px;
  background:rgba(247,241,232,.98);
  box-shadow:var(--tl4-shadow);
}
.tl4-search-panel.is-open{display:block}
.tl4-search-form{display:flex;gap:8px}
.tl4-search-form input{
  flex:1;
  min-width:0;
  border:1px solid var(--tl4-line);
  background:white;
  padding:11px 13px;
  color:var(--tl4-gray);
}
.tl4-search-form button{
  border:0;
  padding:11px 16px;
  background:var(--tl4-bronze);
  color:white;
  cursor:pointer;
}

.tl4-hero-copy{
  margin:auto auto 0;
  width:min(980px,calc(100% - 56px));
  padding:100px 0 76px;
  text-align:center;
  position:relative;
  z-index:2;
}
.tl4-hero-copy h2{
  margin:0;
  font-size:clamp(28px,4vw,58px);
  line-height:1.05;
  font-weight:500;
  letter-spacing:.01em;
}
.tl4-section{padding:88px 0}
.tl4-container{width:min(1180px,calc(100% - 56px));margin:0 auto}
.tl4-intro{text-align:center}
.tl4-intro h1{
  margin:0 auto 22px;
  max-width:850px;
  color:var(--tl4-bronze);
  font-size:clamp(30px,4vw,52px);
  line-height:1.12;
  font-weight:500;
}
.tl4-intro p{
  max-width:800px;
  margin:0 auto;
  font-size:18px;
  color:#555;
}
.tl4-kicker{
  color:var(--tl4-sepia);
  font-size:12px;
  letter-spacing:.18em;
  text-transform:uppercase;
  margin-bottom:12px;
}

.tl4-featured-grid,.tl4-blog-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:30px;
}
.tl4-featured-grid{margin-top:48px}
.tl4-card{
  background:rgba(255,255,255,.55);
  border:1px solid var(--tl4-line);
  transition:transform .35s ease,box-shadow .35s ease;
}
.tl4-card:hover{
  transform:translateY(-6px);
  box-shadow:var(--tl4-shadow);
}
.tl4-card-image{
  aspect-ratio:16/10;
  overflow:hidden;
  background:#ddd;
}
.tl4-card-image img{width:100%;height:100%;object-fit:cover}
.tl4-card-body{padding:25px}
.tl4-card h3{
  margin:7px 0 10px;
  color:var(--tl4-bronze);
  font-size:25px;
  line-height:1.18;
}
.tl4-card p{margin:0;color:#666}
.tl4-meta{
  color:var(--tl4-sepia);
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.tl4-author{
  margin-top:17px;
  color:var(--tl4-bronze);
  font-size:13px;
}

.tl4-blog-section{background:#EFE7DB}
.tl4-blog-header{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:20px;
  margin-bottom:38px;
}
.tl4-blog-header h2,.tl4-newsletter h2{
  margin:0;
  color:var(--tl4-bronze);
  font-size:clamp(30px,4vw,46px);
  font-weight:500;
  line-height:1.1;
}
.tl4-blog-grid{row-gap:30px}
.tl4-blog-grid .tl4-card{background:rgba(255,255,255,.38)}

.tl4-newsletter{
  background:var(--tl4-bronze);
  color:white;
  text-align:center;
}
.tl4-newsletter h2{color:white}
.tl4-newsletter p{
  max-width:650px;
  margin:18px auto 28px;
  opacity:.86;
}
.tl4-newsletter-form{
  width:min(620px,100%);
  margin:0 auto;
  display:flex;
  gap:10px;
}
.tl4-newsletter-form input{
  flex:1;
  min-width:0;
  padding:14px 16px;
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.08);
  color:white;
}
.tl4-newsletter-form input::placeholder{color:rgba(255,255,255,.72)}
.tl4-newsletter-form button{
  padding:14px 24px;
  border:1px solid var(--tl4-gold);
  background:var(--tl4-gold);
  color:var(--tl4-bronze);
  cursor:pointer;
}

.tl4-site-footer{
  background:#211A16;
  color:#ddd;
  padding:55px 0;
}
.tl4-footer-inner{
  display:flex;
  justify-content:space-between;
  gap:30px;
  align-items:center;
}
.tl4-footer-brand{color:white;font-size:20px}
.tl4-footer-social{display:flex;gap:14px}
.tl4-footer-social a{opacity:.8}
.tl4-footer-social a:hover{opacity:1}

.tl4-single,.tl4-page{
  padding:90px 0;
}
.tl4-content{
  width:min(820px,calc(100% - 56px));
  margin:0 auto;
}
.tl4-content h1{
  color:var(--tl4-bronze);
  font-size:clamp(36px,5vw,62px);
  line-height:1.1;
  font-weight:500;
}
.tl4-content h2,.tl4-content h3{color:var(--tl4-bronze)}
.tl4-content p,.tl4-content li{font-size:18px}
.tl4-content img{margin:28px auto}
.tl4-post-meta{color:var(--tl4-sepia);font-size:13px;text-transform:uppercase;letter-spacing:.08em}

.fade-up{
  opacity:0;
  transform:translateY(22px);
  transition:opacity .75s ease,transform .75s ease;
}
.fade-up.is-visible{opacity:1;transform:translateY(0)}

@media (max-width:900px){
  .tl4-site-header{min-height:620px}
  .tl4-header-inner{
    grid-template-columns:1fr auto;
    gap:18px;
  }
  .tl4-menu{
    grid-column:1/-1;
    grid-row:2;
    justify-self:start;
  }
  .tl4-menu ul{justify-content:flex-start;flex-wrap:wrap;gap:18px 25px}
  .tl4-featured-grid,.tl4-blog-grid{grid-template-columns:1fr 1fr}
}
@media (max-width:640px){
  .tl4-header-inner,.tl4-container,.tl4-hero-copy,.tl4-content{width:min(100% - 34px,1180px)}
  .tl4-header-inner{padding-top:20px}
  .tl4-brand-name{font-size:min(var(--tl4-brand-size,24px),22px)}
  .tl4-menu a{font-size:min(var(--tl4-nav-size,15px),13px)}
  .tl4-header-actions{gap:5px}
  .tl4-social{gap:2px}
  .tl4-social a,.tl4-search-toggle{width:30px;height:30px}
  .tl4-hero-copy{padding:80px 0 55px}
  .tl4-section{padding:64px 0}
  .tl4-featured-grid,.tl4-blog-grid{grid-template-columns:1fr}
  .tl4-blog-header,.tl4-footer-inner{align-items:flex-start;flex-direction:column}
  .tl4-newsletter-form{flex-direction:column}
}
/* A Terapia Literária v4 — Blog 3x3 / 9 artigos */
.tl4-blog-page{padding-top:72px;padding-bottom:90px}
.tl4-blog-page .tl4-blog-header{margin-bottom:44px}
.tl4-blog-page .tl4-blog-header h1{margin:0;color:var(--tl4-bronze);font-size:clamp(42px,6vw,68px);line-height:1.05;font-weight:500}
.tl4-blog-grid-9{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:30px}
.tl4-blog-grid-9 .tl4-card{height:100%}
.tl4-blog-grid-9 .tl4-card-image{aspect-ratio:16/10}
.tl4-pagination{margin-top:54px;display:flex;justify-content:center}
.tl4-pagination ul{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;list-style:none;margin:0;padding:0}
.tl4-pagination a,.tl4-pagination span{display:inline-flex;min-width:40px;min-height:40px;padding:8px 12px;align-items:center;justify-content:center;border:1px solid var(--tl4-line);background:rgba(255,255,255,.55);color:var(--tl4-bronze)}
.tl4-pagination a:hover,.tl4-pagination .current{background:var(--tl4-bronze);color:#fff}
@media (max-width:900px){.tl4-blog-grid-9{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:640px){.tl4-blog-grid-9{grid-template-columns:1fr}.tl4-blog-page{padding-top:54px}}
/* v4.0 — Home editável como página */
.tl4-home-hero-page{
  min-height:560px;
  position:relative;
  display:flex;
  align-items:flex-end;
  color:#fff;
  background:
    linear-gradient(180deg,rgba(20,15,12,.28),rgba(20,15,12,.72)),
    var(--tl4-page-hero,linear-gradient(135deg,#8C7355,#3D2E24));
  background-position:center;
  background-size:cover;
}
.tl4-home-hero-content{
  position:relative;
  z-index:1;
  padding-top:110px;
  padding-bottom:70px;
}
.tl4-home-hero-content h1{
  max-width:980px;
  margin:0;
  font-size:clamp(42px,6vw,76px);
  line-height:1.02;
  font-weight:500;
}
.tl4-home-editorial{padding-top:76px}
.tl4-home-editorial .tl4-content{width:min(980px,calc(100% - 56px))}
.tl4-home-editorial .tl4-content > :first-child{margin-top:0}
.tl4-home-blog-link{
  color:var(--tl4-bronze);
  font-size:14px;
  letter-spacing:.05em;
}
@media (max-width:640px){
  .tl4-home-hero-page{min-height:500px}
  .tl4-home-hero-content{padding-top:90px;padding-bottom:54px}
  .tl4-home-editorial .tl4-content{width:min(100% - 34px,980px)}
}
/* v4.0 — Home editável como página */
.tl4-home-hero-page{
  min-height:560px;
  position:relative;
  display:flex;
  align-items:flex-end;
  color:#fff;
  background:
    linear-gradient(180deg,rgba(20,15,12,.28),rgba(20,15,12,.72)),
    var(--tl4-page-hero,linear-gradient(135deg,#8C7355,#3D2E24));
  background-position:center;
  background-size:cover;
}
.tl4-home-hero-content{
  position:relative;
  z-index:1;
  padding-top:110px;
  padding-bottom:70px;
}
.tl4-home-hero-content h1{
  max-width:980px;
  margin:0;
  font-size:clamp(42px,6vw,76px);
  line-height:1.02;
  font-weight:500;
}
.tl4-home-editorial{padding-top:76px}
.tl4-home-editorial .tl4-content{width:min(980px,calc(100% - 56px))}
.tl4-home-editorial .tl4-content > :first-child{margin-top:0}
.tl4-home-blog-link{
  color:var(--tl4-bronze);
  font-size:14px;
  letter-spacing:.05em;
}
@media (max-width:640px){
  .tl4-home-hero-page{min-height:500px}
  .tl4-home-hero-content{padding-top:90px;padding-bottom:54px}
  .tl4-home-editorial .tl4-content{width:min(100% - 34px,980px)}
}
/* v4.0 — Home editável como página */
.tl4-home-hero-page{
  min-height:560px;
  position:relative;
  display:flex;
  align-items:flex-end;
  color:#fff;
  background:
    linear-gradient(180deg,rgba(20,15,12,.28),rgba(20,15,12,.72)),
    var(--tl4-page-hero,linear-gradient(135deg,#8C7355,#3D2E24));
  background-position:center;
  background-size:cover;
}
.tl4-home-hero-content{
  position:relative;
  z-index:1;
  padding-top:110px;
  padding-bottom:70px;
}
.tl4-home-hero-content h1{
  max-width:980px;
  margin:0;
  font-size:clamp(42px,6vw,76px);
  line-height:1.02;
  font-weight:500;
}
.tl4-home-editorial{padding-top:76px}
.tl4-home-editorial .tl4-content{width:min(980px,calc(100% - 56px))}
.tl4-home-editorial .tl4-content > :first-child{margin-top:0}
.tl4-home-blog-link{
  color:var(--tl4-bronze);
  font-size:14px;
  letter-spacing:.05em;
}
@media (max-width:640px){
  .tl4-home-hero-page{min-height:500px}
  .tl4-home-hero-content{padding-top:90px;padding-bottom:54px}
  .tl4-home-editorial .tl4-content{width:min(100% - 34px,980px)}
}
/* v4 — ordem dos metadados dos posts */
.tl4-single-post > h1{
  margin-bottom:14px;
}

.tl4-post-subtitle{
  color:#5F5146;
  font-size:clamp(19px,2.2vw,25px);
  line-height:1.42;
  margin:0 0 20px;
  max-width:760px;
}

.tl4-post-date-only{
  color:var(--tl4-sepia);
  font-size:13px;
  letter-spacing:.08em;
  text-transform:uppercase;
  margin-bottom:18px;
}

.tl4-post-byline{
  display:flex;
  align-items:center;
  gap:13px;
  margin:0 0 38px;
  color:var(--tl4-bronze);
}

.tl4-author-avatar{
  width:50px;
  height:50px;
  flex:0 0 50px;
  overflow:hidden;
  border-radius:50%;
  background:#D7C7B3;
}

.tl4-author-avatar img,
.tl4-author-photo{
  width:50px !important;
  height:50px !important;
  object-fit:cover;
  border-radius:50%;
  display:block;
}

.tl4-post-author{
  font-size:14px;
  letter-spacing:.05em;
  text-transform:uppercase;
  line-height:1.25;
}

.tl4-single-featured-image{
  margin:0 0 38px;
}

.tl4-single-featured-image img{
  width:100%;
  height:auto;
}

.tl4-single-content > :first-child{
  margin-top:0;
}

@media (max-width:640px){
  .tl4-post-subtitle{
    font-size:18px;
  }
  .tl4-post-byline{
    margin-bottom:28px;
  }
}
/* A Terapia Literária v4 — ordem segura dos metadados */
.tl4-single-post > h1{
  margin-bottom:14px;
}

.tl4-post-subtitle{
  color:#5F5146;
  font-size:clamp(19px,2.2vw,25px);
  line-height:1.42;
  margin:0 0 20px;
  max-width:800px;
}

.tl4-post-date-only{
  color:var(--tl4-sepia);
  font-size:13px;
  letter-spacing:.08em;
  text-transform:uppercase;
  margin-bottom:18px;
}

.tl4-post-byline{
  display:flex;
  align-items:center;
  gap:13px;
  margin:0 0 38px;
  color:var(--tl4-bronze);
}

.tl4-author-avatar{
  width:50px;
  height:50px;
  flex:0 0 50px;
  overflow:hidden;
  border-radius:50%;
  background:#D7C7B3;
}

.tl4-author-avatar img,
.tl4-author-photo{
  width:50px !important;
  height:50px !important;
  object-fit:cover;
  border-radius:50%;
  display:block;
}

.tl4-post-author{
  font-size:14px;
  letter-spacing:.05em;
  text-transform:uppercase;
  line-height:1.25;
}

.tl4-single-featured-image{
  margin:0 0 38px;
}

.tl4-single-featured-image img{
  width:100%;
  height:auto;
}

.tl4-single-content > :first-child{
  margin-top:0;
}

@media (max-width:640px){
  .tl4-post-subtitle{font-size:18px}
  .tl4-post-byline{margin-bottom:28px}
}





/* Ordem final dos elementos do post */

.tl4-single-post > h1{
  margin-bottom:14px;
}

.tl4-post-subtitle{
  color:#5F5146;
  font-size:clamp(19px,2.2vw,25px);
  line-height:1.42;
  margin:0 0 20px;
  max-width:800px;
}

.tl4-post-date-only{
  color:var(--tl4-sepia);
  font-size:13px;
  letter-spacing:.08em;
  text-transform:uppercase;
  margin-bottom:18px;
}

.tl4-post-byline{
  display:flex;
  align-items:center;
  gap:13px;
  margin:0 0 38px;
  color:var(--tl4-bronze);
}

.tl4-author-avatar{
  width:50px;
  height:50px;
  flex:0 0 50px;
  overflow:hidden;
  border-radius:50%;
  background:#D7C7B3;
}

.tl4-author-avatar img,
.tl4-author-photo{
  width:50px !important;
  height:50px !important;
  object-fit:cover;
  border-radius:50%;
  display:block;
}

.tl4-post-author{
  font-size:14px;
  letter-spacing:.05em;
  text-transform:uppercase;
  line-height:1.25;
}

.tl4-single-featured-image{
  margin:0 0 38px;
}

.tl4-single-featured-image img{
  width:100%;
  height:auto;
}

.tl4-single-content > :first-child{
  margin-top:0;
}

@media (max-width:640px){
  .tl4-post-subtitle{
    font-size:18px;
  }

  .tl4-post-byline{
    margin-bottom:28px;
  }
}