/* ==========================================================================
   Senso Incomum — Home (index.hbs)
   Primeira iteração visual inspirada no TO_BE.
   Escopo: apenas homepage.
   ========================================================================== */

.home-template {
   --home-hero-height: clamp(340px, 34vw, 462px);
   --home-hero-top-gap: clamp(34px, 5vw, 136px);
   --home-category-card-height: auto;
   /* Moldura palacial (mockup-teste2) — +10% de folga lateral vs. 67.5vw original */
   --home-frame-radius: 28px;
   --home-frame-width: calc(67.5vw * 1.1);
   --home-frame-inset: 8px;
   --home-frame-gold-hi: #eae6df;
   --home-frame-gold: #c4bfb6;
   --home-frame-gold-mid: #a8a49c;
   --home-frame-gold-lo: #6e6a64;
   /* Trilhos verticais infinitos (fora da moldura) */
   --home-rail-gap-from-frame: 5vw;
   --home-rail-bevel-width: clamp(16px, 1.85vw, 26px);
   --home-rail-metal-width: 1px;
   --home-rail-metal-gap: clamp(8px, 0.8vw, 14px);
   --home-rail-metal-hi: rgba(168, 164, 155, 0.44);
   --home-rail-metal-lo: rgba(110, 106, 100, 0.46);
   --home-rail-total-width: calc(var(--home-rail-bevel-width) + var(--home-rail-metal-gap) + var(--home-rail-metal-width));
   --home-rail-offset: calc(var(--home-rail-gap-from-frame) + var(--home-rail-total-width));
}

.home-template .section-content-wrap {
   position: relative;
}

/* Camada externa — moldura dourada esculpida, bevel & emboss (interior transparente) */
.home-template .section-content-wrap::before {
   content: '';
   position: absolute;
   top: 168px;
   bottom: 0;
   left: 50%;
   width: var(--home-frame-width);
   transform: translateX(-50%);
   border-radius: var(--home-frame-radius);
   pointer-events: none;
   z-index: 0;
   background: transparent;
   border: 1px solid rgba(228, 222, 210, 0.54);
   box-shadow:
      0 34px 68px rgba(0, 0, 0, 0.64),
      0 14px 32px rgba(0, 0, 0, 0.44),
      0 0 0 1px rgba(0, 0, 0, 0.58),
      inset 0 1px 0 rgba(168, 165, 152, 0.58),
      inset 1px 0 0 rgba(158, 145, 118, 0.38),
      inset 0 -2px 0 rgba(0, 0, 0, 0.74),
      inset -1px 0 0 rgba(0, 0, 0, 0.5),
      inset 0 0 0 2px rgba(130, 126, 118, 0.5),
      inset 0 0 0 4px rgba(42, 38, 34, 0.58),
      inset 0 0 0 5px rgba(95, 92, 86, 0.36),
      inset 0 0 0 7px rgba(118, 114, 106, 0.42),
      inset 0 0 0 var(--home-frame-inset) transparent,
      inset 0 -1px 0 rgba(196, 182, 148, 0.14);
}

/* Camada interna — floreiras nos cantos + filo dourado (sem vignette opaca) */
.home-template .section-content-wrap::after {
   content: '';
   position: absolute;
   top: 168px;
   bottom: 0;
   left: 50%;
   width: var(--home-frame-width);
   transform: translateX(-50%);
   border-radius: var(--home-frame-radius);
   pointer-events: none;
   z-index: 0;
   background:
      radial-gradient(circle 20px at 16px 16px, rgba(224, 221, 214, 0.52) 0%, rgba(196, 190, 178, 0.22) 38%, transparent 58%),
      radial-gradient(circle 20px at calc(100% - 16px) 16px, rgba(178, 168, 148, 0.5) 0%, rgba(196, 190, 178, 0.22) 38%, transparent 58%),
      radial-gradient(circle 20px at 16px calc(100% - 16px), rgba(218, 206, 178, 0.42) 0%, rgba(196, 190, 178, 0.18) 38%, transparent 58%),
      radial-gradient(circle 20px at calc(100% - 16px) calc(100% - 16px), rgba(218, 206, 178, 0.42) 0%, rgba(196, 190, 178, 0.18) 38%, transparent 58%),
      transparent;
   background-repeat: no-repeat;
   box-shadow: inset 0 0 0 1px rgba(218, 206, 178, 0.24);
}

/*
   Trilhos verticais infinitos — mockup-teste2
   Bevel (ext.): transparente, relevo só via sombra. Metálica (int.): tom da moldura.
*/
.home-template::before,
.home-template::after {
   content: '';
   position: fixed;
   top: 0;
   bottom: 0;
   width: var(--home-rail-total-width);
   pointer-events: none;
   z-index: 2;
   background-color: transparent;
   background-repeat: no-repeat;
   background-size: 100% 100%;
}

/* Esquerda — bevel transparente (ext.) + metálica escura (int.) */
.home-template::before {
   left: calc(50vw - (var(--home-frame-width) / 2) - var(--home-rail-offset));
   background-image: linear-gradient(
      to right,
      transparent 0,
      transparent calc(var(--home-rail-bevel-width) + var(--home-rail-metal-gap)),
      var(--home-rail-metal-hi) calc(var(--home-rail-bevel-width) + var(--home-rail-metal-gap)),
      var(--home-rail-metal-lo) 100%
   );
   box-shadow:
      -8px 0 22px rgba(0, 0, 0, 0.46),
      -18px 0 38px rgba(0, 0, 0, 0.24),
      inset 1px 0 0 rgba(234, 230, 223, 0.16),
      inset 3px 0 10px rgba(0, 0, 0, 0.32),
      inset calc(var(--home-rail-bevel-width) - 1px) 0 0 calc(2px - var(--home-rail-bevel-width)) rgba(0, 0, 0, 0.32);
}

/* Direita — bevel transparente (ext.) + metálica escura (int.) */
.home-template::after {
   right: calc(50vw - (var(--home-frame-width) / 2) - var(--home-rail-offset));
   background-image: linear-gradient(
      to left,
      transparent 0,
      transparent calc(var(--home-rail-bevel-width) + var(--home-rail-metal-gap)),
      var(--home-rail-metal-hi) calc(var(--home-rail-bevel-width) + var(--home-rail-metal-gap)),
      var(--home-rail-metal-lo) 100%
   );
   box-shadow:
      8px 0 22px rgba(0, 0, 0, 0.46),
      18px 0 38px rgba(0, 0, 0, 0.24),
      inset -1px 0 0 rgba(234, 230, 223, 0.16),
      inset -3px 0 10px rgba(0, 0, 0, 0.32),
      inset calc(-1 * var(--home-rail-bevel-width) + 1px) 0 0 calc(2px - var(--home-rail-bevel-width)) rgba(0, 0, 0, 0.32);
}

.home-template .section-content-wrap > * {
   position: relative;
   z-index: 1;
}

/* Header acima do slider/menu mobile: o > * acima empata z-index com o body */
@media (max-width: 1024px) {
   .home-template::before,
   .home-template::after {
      display: none;
   }

   .home-template .home-categories {
      padding-left: 10px;
      padding-right: 10px;
      box-sizing: border-box;
   }

   .home-template .section-content-wrap > .section-header.wrap {
      z-index: 50;
   }
}

.home-template .si-hero-scrollable {
   --home-hero-radius: 26px;
   width: 60vw;
   margin-top: var(--home-hero-top-gap);
   margin-left: auto;
   margin-right: auto;
   border: 0;
   border-radius: var(--home-hero-radius);
   background: transparent;
   box-shadow: none;
   overflow: hidden;
   position: relative;
}

.home-template .si-hero-scrollable:not(.flickity-enabled) {
   height: auto;
}

.home-template .section-featured.si-hero {
   border-radius: var(--home-hero-radius);
   min-height: var(--home-hero-height);
   overflow: hidden;
   isolation: isolate;
}

.home-template .si-hero .featured-image {
   z-index: 0;
   inset: 0;
   left: 0;
   right: 0;
   bottom: 0;
   width: 100%;
   height: 100%;
   border-radius: var(--home-hero-radius);
   background-position: center 30%;
   background-repeat: no-repeat;
   background-size: cover;
   filter: saturate(0.5) brightness(0.89) contrast(1.03);
}

.home-template .si-hero .featured-image::before,
.home-template .si-hero .featured-image::after {
   content: '';
   position: absolute;
   inset: 0;
   pointer-events: none;
}

.home-template .si-hero .featured-wrap {
   position: relative;
   z-index: 1;
   min-height: var(--home-hero-height);
   padding: 0;
   align-items: stretch;
}

.home-template .si-hero-branding {
   display: flex;
   flex-direction: column;
   justify-content: flex-end;
   min-height: var(--home-hero-height);
   max-width: 560px;
   padding: 56px 56px 56px;
}

.home-template .hero-kicker {
   font-size: 1.1rem;
   letter-spacing: 0.38em;
   text-transform: uppercase;
   color: #bbc2cb;
   margin-bottom: 16px;
}

.home-template .si-hero-branding h2,
.home-template .si-hero-branding h2 a {
   font-size: clamp(2.9rem, 4.7vw, 4.6rem);
   font-weight: 600;
   line-height: 1.02;
   letter-spacing: 0.01em;
   color: #ebeff4;
   text-shadow: 0 3px 14px rgba(0, 0, 0, 0.48);
}

.home-template .hero-tagline {
   font-size: 1.8rem;
   color: #c7ced6;
   line-height: 1.35;
   margin-top: 18px;
}

.home-template .hero-buttons {
   display: flex;
   gap: 14px;
   margin-top: 28px;
}

.home-template #slider .si-hero .item-meta {
   display: none;
}

.home-signup-cta {
   
   display: flex;
   justify-content: center;
   margin-top: 54px;
   margin-bottom: 12px;
}

.home-signup-cta-button {
   
   width: 68%;
   min-width: min(100%, 420px);
   max-width: 1100px;
   display: block;
   box-sizing: border-box;
   text-align: center;
   line-height: 1.2;
   font-size: 2rem;
   padding-top: 10px;
   padding-bottom: 10px;
   color: #111 !important;
   border-color: #ece2bf !important;
   text-shadow: none !important;
   -webkit-text-stroke: 0 !important;
   white-space: normal;
   overflow-wrap: anywhere;
}

.home-signup-cta-button:hover {
   color: #f4ead0 !important;
   border-color: rgba(207, 214, 222, 0.44) !important;
   background: rgba(8, 10, 13, 0.56) !important;
}

.home-categories .home-section-title {
   width: 100%;
}

.home-categories .home-section-title::before,
.home-categories .home-section-title::after {
   content: '';
   height: 2px;
   flex: 1;
   background: linear-gradient(to right, rgba(112, 119, 129, 0), rgba(150, 157, 167, 0.6), rgba(112, 119, 129, 0));
}

.home-template .hero-secondary,
.home-template .hero-subscribe {
   transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.home-template .hero-secondary:hover,
.home-template .hero-subscribe:hover {
   transform: translateY(-1px);
}

@media (min-width: 1025px) {

   .home-template .home-categories {
      margin-top: 0;
      /* Queremos que esta seção “encha” o 2º viewport após o hero */
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding-top: clamp(8px, 1.2vh, 16px);
      padding-bottom: clamp(28px, 4vh, 64px);
      margin-bottom:0;
   }

   .home-categories .category-card {
      /*
        Força a altura no desktop.
        (Se houver alguma regra inesperada no tema ou no browser-cache,
        isso garante o efeito visual imediatamente.)
      */
      --_category-card-height: clamp(520px, 70vh, 820px);
      height: var(--_category-card-height) !important;
      min-height: var(--_category-card-height) !important;
   }

   .home-template .home-club {
      margin-top: 0;
   }

   /* Compacta o bloco Clube (~25% menos altura visual no desktop) */
   .home-template .club-panel {
      --_club-panel-height: clamp(300px, 28vw, 420px);
      height: var(--_club-panel-height);
      min-height: var(--_club-panel-height);
   }

   .home-template .club-media {
      height: 100%;
   }

   .home-template .club-media img {
      display: block;
      height: 100%;
   }

   .home-template .club-copy {
      padding: 56px 18px 14px clamp(56px, 8vw, 112px);
      justify-content: flex-start;
   }

   .home-template .club-copy h2 {
      margin-bottom: 10px;
      font-size: clamp(4.2rem, 3.1vw, 5rem);
   }

   .home-template .club-copy ul {
      margin-bottom: 18px;
   }

   .home-template .club-copy li {
      font-size: 2.2rem;
      margin-bottom: 7px;
   }

   .home-template .club-button {
      margin-top: 12px;
   }
   .home-template .club-button {
      padding: 8px 16px;
      font-size: 2.4rem;
   }
}

.home-subscribe-big {
   font-family: var(--font-family-button);
   font-size: 1.8rem;
   font-weight: 600;
   color: #dbe2ea;
   text-decoration: none;
   padding: 12px 16px;
   border-radius: 8px;
   border: 1px solid rgba(167, 173, 182, 0.28);
   background: rgba(17, 20, 24, 0.44);
   display: inline-block;
}

.home-categories {
   margin-top: 8px;
   margin-bottom: 52px;
}

.home-section-title {
   display: flex;
   align-items: center;
   gap: 18px;
   margin-bottom: 20px;
   color: #d7dde5;
}

.home-section-title::before,
.home-section-title::after {
   content: '';
   height: 2px;
   flex: 1;
   background: linear-gradient(to right, rgba(112, 119, 129, 0), rgba(150, 157, 167, 0.6), rgba(112, 119, 129, 0));
}

.home-section-title span {
   font-size: 4rem;
   font-family: var(--font-family-special);
   letter-spacing: 0.01em;
}

.category-grid {
   display: grid;
   grid-template-columns: repeat(4, minmax(0, 1fr));
   gap: 14px;
}

.category-card {
   display: block;
   position: relative;
   min-height: 380px;
   border-radius: 10px;
   overflow: hidden;
   border: 1px solid rgba(166, 173, 183, 0.3);
   background: rgba(7, 9, 12, 0.64);
}

.category-card > img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   filter: saturate(0.39) brightness(0.80) contrast(1.04);
   transition: transform 0.3s ease, filter 0.3s ease;
}

.category-overlay {
   position: absolute;
   inset: auto 0 0;
   padding: 20px 18px;
   background: linear-gradient(to top, rgba(6, 8, 11, 0.95) 0%, rgba(6, 8, 11, 0.74) 52%, rgba(6, 8, 11, 0) 100%);
   color: #e2e8ef;
}

.category-overlay h3 {
   font-size: clamp(2rem, 2vw, 3.2rem);
   line-height: 1.08;
   margin: 0 0 8px;
   color: #f0f4f9;
   white-space: normal;
   overflow: visible;
   text-overflow: clip;
   text-wrap: balance;
}

.category-overlay span {
   font-size: 1.6rem;
   color: #dfe5ec;
}

.category-card:hover > img {
   transform: scale(1.03);
   filter: saturate(0.47) brightness(1.1) contrast(1.08);
}

.home-club {
   margin-top: 0;
   margin-bottom: 26px;
}

.home-readings-title {
   margin-top: 0;
   margin-bottom: 0;
}

.home-readings-title .home-section-title {
   margin-bottom: 20px;
}

.club-panel {
   position: relative;
   display: grid;
   grid-template-columns: 1fr 46%;
   align-items: stretch;
   border-radius: 16px;
   overflow: hidden;
   border: 1px solid rgba(158, 166, 176, 0.32);
   background: rgba(10, 12, 16, 0.6);
   box-shadow: 0 18px 32px rgba(0, 0, 0, 0.33);
}

.club-panel::before {
   content: '';
   position: absolute;
   inset: 0;
   background-image: url('../images/subtle-grunge.png');
   background-repeat: repeat;
   background-position: left top;
   opacity: 0.3;
   pointer-events: none;
   z-index: 0;
}

.club-panel > * {
   position: relative;
   z-index: 1;
}

.club-copy {
   padding: 34px 34px 30px;
   display: flex;
   flex-direction: column;
   justify-content: center;
   align-items: flex-start;
}

.club-copy h2 {
   margin: 0 0 14px;
   font-size: 5.2rem;
   font-family: var(--font-family-special);
   font-weight: 600;
   letter-spacing: 0.01em;
   color: #ebf0f6;
}

.club-copy ul {
   list-style: none;
   margin: 0 0 24px;
   padding: 0;
}

.club-copy li {
   position: relative;
   padding-left: 22px;
   margin: 0 0 10px;
   color: #ccd3dc;
}

.club-copy li::before {
   content: '';
   position: absolute;
   top: 0.3em;
   left: 0;
   width: 9px;
   height: 9px;
   border-radius: 50%;
   border: 1px solid rgba(125, 95, 54, 0.95);
   background: rgba(109, 78, 40, 0.22);
   box-shadow: 0 0 0 1px rgba(16, 12, 7, 0.6);
}

.club-button {
   margin-top: 12px;
}

.club-media img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   filter: saturate(0.32) brightness(0.58) contrast(1.08);
   -webkit-mask-image: linear-gradient(
      to right,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0) 10%,
      rgba(0, 0, 0, 0.08) 20%,
      rgba(0, 0, 0, 0.22) 34%,
      rgba(0, 0, 0, 0.42) 48%,
      rgba(0, 0, 0, 0.64) 62%,
      rgba(0, 0, 0, 0.82) 76%,
      rgba(0, 0, 0, 0.94) 90%,
      rgba(0, 0, 0, 1) 100%
   );
   mask-image: linear-gradient(
      to right,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0) 10%,
      rgba(0, 0, 0, 0.08) 20%,
      rgba(0, 0, 0, 0.22) 34%,
      rgba(0, 0, 0, 0.42) 48%,
      rgba(0, 0, 0, 0.64) 62%,
      rgba(0, 0, 0, 0.82) 76%,
      rgba(0, 0, 0, 0.94) 90%,
      rgba(0, 0, 0, 1) 100%
   );
}

.home-template .section-loop {
   margin-top: 30px;
   border-top: 1px solid rgba(150, 156, 166, 0.35);
   padding-top: 26px;
}

/* Home loop cards — excerpt, date and tag anchored to card bottom */
.home-template .section-loop .item-wrap article {
   display: flex;
   flex-direction: column;
}

.home-template .section-loop .item-wrap h2 {
   flex: 0 0 auto;
}

.home-template .section-loop .item-wrap .card-subtitle {
   margin-top: auto;
   max-width: 90%;
   margin-right: 10%;
   margin-bottom: 10px;
   font-size: 2.405rem;
}

.home-template .section-loop .item-wrap h2 + .item-meta {
   margin-top: auto;
}

.home-template .section-loop .item-wrap .card-subtitle + .item-meta {
   margin-top: 0;
   margin-bottom: 0;
}

.home-template .section-loop .item-wrap .item-meta.is-primary-tag,
.home-template .section-loop .item-wrap .item-meta.is-members-label {
   margin-bottom: 0;
}

.home-template .section-loop .item-wrap .primary-tag {
   position: static;
   margin-top: 8px;
   margin-left: -8px;
   align-self: flex-start;
}

@media (max-width: 479px) {
   .home-template .section-loop .item-wrap .card-subtitle {
      max-width: 100%;
      margin-right: 0;
      margin-bottom: 8px;
      font-size: 1.885rem;
   }
}

@media (min-width: 480px) and (max-width: 767px) {
   .home-template .section-loop .item-wrap .card-subtitle {
      max-width: 100%;
      margin-right: 0;
      font-size: 2.015rem;
   }
}

@media (max-width: 1024px) {
   .home-signup-cta {
      margin-top: 30px;
      margin-bottom: 10px;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
   }

   .home-signup-cta-button {
      width: 90%;
      min-width: 0;
      max-width: none;
      margin: 0 auto;
   }

   .home-template {
      --home-hero-height: clamp(420px, 66vw, 560px);
      --home-frame-radius: 18px;
      --home-frame-width: 100%;
      --home-frame-inset: 6px;
      --home-frame-mobile-gutter: 14px;
   }

   .home-template .section-content-wrap::before,
   .home-template .section-content-wrap::after {
      top: 108px;
      width: 100%;
      left: 0;
      transform: none;
      border-radius: var(--home-frame-radius) var(--home-frame-radius) 0 0;
   }

   .home-template .si-hero-scrollable {
      --home-hero-radius: 16px;
      width: calc(100% - (var(--home-frame-mobile-gutter) * 2));
      max-width: calc(100% - (var(--home-frame-mobile-gutter) * 2));
      margin-top: 22px;
      margin-left: auto;
      margin-right: auto;
      border-radius: var(--home-hero-radius);
      box-sizing: border-box;
   }

   .home-template .home-club.wrap {
      width: calc(100% - (var(--home-frame-mobile-gutter) * 2)) !important;
      max-width: calc(100% - (var(--home-frame-mobile-gutter) * 2)) !important;
      margin-left: auto !important;
      margin-right: auto !important;
      box-sizing: border-box;
   }

   .home-template .home-club .club-panel {
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
   }

   .home-template .si-hero-branding {
      padding: 34px 24px 38px;
   }

   .category-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px 12px;
   }

   .category-card {
      min-height: 0;
      border-radius: 10px;
      overflow: visible;
      background: transparent;
      border: 0;
   }

   .category-card > img {
      display: block;
      width: 100%;
      height: auto;
      aspect-ratio: 1 / 1;
      border-radius: 10px;
      object-fit: cover;
   }

   .category-overlay {
      position: static;
      inset: auto;
      padding: 10px 2px 0;
      background: none;
   }

   .category-overlay h3 {
      margin: 0 0 6px;
      font-size: clamp(2.33rem, 2.85vw, 3.45rem);
      color: #e6ebf1;
   }

   .category-overlay span {
      display: none;
   }

   .category-card:hover > img {
      transform: none;
      filter: saturate(0.39) brightness(1.1) contrast(1.04);
   }

   .club-panel {
      grid-template-columns: 1fr;
   }

   .club-media {
      min-height: 240px;
   }
}

@media (max-width: 640px) {
   .home-template {
      --home-hero-height: clamp(360px, 82vw, 460px);
   }

   .home-categories {
      margin-top: 52px;
   }

   .home-template .si-hero-scrollable {
      --home-hero-top-gap: 22px;
   }

   .home-template .hero-buttons {
      flex-direction: column;
      align-items: flex-start;
   }

   .category-overlay h3 {
      white-space: normal;
      overflow: visible;
      text-overflow: clip;
   }

   .category-overlay {
      text-align: center;
   }

   .category-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
   }

   .club-copy {
      padding: 22px 18px 12px;
      position: relative;
      z-index: 2;
   }

   .club-copy h2 {
      margin-bottom: 10px;
      font-size: clamp(2.6rem, 7.2vw, 3.2rem);
      line-height: 1.05;
      white-space: nowrap;
   }

   .club-copy ul {
      margin-bottom: 14px;
   }

   .club-copy li {
      padding-left: 16px;
      font-size: 1.7rem;
      line-height: 1.25;
      margin-bottom: 6px;
   }

   .club-copy li::before {
      top: 0.6em;
      width: 6px;
      height: 6px;
   }

   .club-button {
      position: static;
      transform: none;
      margin-top: 6px;
      padding: 9px 14px;
      font-size: 1.8rem;
      line-height: 1.2;
   }

   .club-media {
      position: absolute;
      inset: 0;
      min-height: 0;
      z-index: 0;
      pointer-events: none;
   }

   .club-media img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      filter: saturate(0.3) brightness(0.4) contrast(1.06);
      -webkit-mask-image: none;
      mask-image: none;
   }

   .home-section-title span {
      font-size: 3.2rem;
   }
}
