.home-tabpanel[hidden]{display:none!important;}


/* HOME tabs: hide panels unless active */
.js-home-tabs .home-tabpanel {
  display: none !important;
}

.js-home-tabs .home-tabpanel.is-active {
  display: block !important;
}

/* На всякий случай: если тема ломает атрибут hidden */
.js-home-tabs .home-tabpanel[hidden] {
  display: none !important;
}

.home-lazy-placeholder{
  min-height: 220px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.02));
}

.js-home-tabs .home-tabpanel .home-lazy-placeholder{
  min-height: 380px;
}

/* =========================
   HOME
========================= */

.home .container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.home-section{
  padding: 28px 0;
}

.home-h2{
  font-size: 22px;
  margin: 0 0 14px;
}

/* HERO */
.home-hero{
  border-radius: 18px;
  overflow: hidden;
  margin: 18px auto 0;
  max-width: 1200px;
  position: relative;
  min-height: 260px;
  background:#151515;
}

.home-hero__media{
  position:absolute;
  inset:0;
  z-index:0;
  display:block;
}

.home-hero__media img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  object-position:center;
}

.home-hero:before{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
  background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.10));
}

.home-hero > .container{
  position:relative;
  z-index:2;
}

.home-hero__inner{
  position: relative;
  z-index: 2;
  padding: 42px 26px;
}

.home-hero__title{
  color:#fff;
  font-size: 40px;
  line-height: 1.08;
  margin: 0 0 10px;
}

.home-hero__subtitle{
  color: rgba(255,255,255,.85);
  margin: 0 0 18px;
}

.home-hero__actions{
  display:flex;
  gap:12px;
  flex-wrap: wrap;
}

/* BUTTONS */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration:none;
  border: 1px solid #e7e7e7;
  background:#fff;
  color:#111;
  font-weight: 600;
}
.btn--primary{
  background:#111;
  color:#fff;
  border-color:#111;
}
.btn--ghost{
  background: transparent;
  color:#fff;
  border-color: rgba(255,255,255,.6);
}

/* TABS */
.home-tabs{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  margin: 12px 0 14px;
}
.home-tabs--small{
  margin: 0 0 16px;
}
.home-tab{
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #ececec;
  text-decoration:none;
  color:#6941c6;
  font-weight: 600;
}
.home-tab.is-active{
  background:#f9f5ff;
  border-color:#6941C6;
  color:#6941c6;
}

/* Works head */
.home-works__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 4px 0 10px;
}
.home-works__more{
  margin-top: 14px;
}

/* PROMO */
.home-promo{
  max-width: 1200px;
  margin: 10px auto 0;
  border-radius: 18px;
  overflow:hidden;
  background-size: cover;
  background-position: center;
  position: relative;
  min-height: 230px;
}
.home-promo:before{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(90deg, rgba(0,0,0,.70), rgba(0,0,0,.20));
}
.home-promo__inner{
  position:relative;
  z-index: 1;
  padding: 34px 26px;
}
.home-promo__title{
  color:#fff;
  margin:0 0 8px;
  font-size: 26px;
}
.home-promo__text{
  color: rgba(255,255,255,.85);
  margin:0 0 12px;
}
.home-promo__list{
  margin:0 0 14px;
  padding-left: 18px;
  color: rgba(255,255,255,.88);
}
.home-promo__form{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
}
.home-promo__input{
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.30);
  background: rgba(255,255,255,.12);
  color:#fff;
  outline:none;
  min-width: 220px;
}

/* AUTHORS cards like in your screenshot */
.top-authors-slider{
  display:flex;
  gap:12px;
  overflow-x:auto;
  padding:6px 2px;
  scroll-snap-type:x mandatory;
}

.author-card{
  position: relative;
  flex: 0 0 auto;
  width: 220px;
  border-radius: 18px;
  background: #f9f5ff;
  border: 1px solid #ece6ff;
  padding: 16px 14px 14px;
  text-decoration:none;
  color:#111;
  scroll-snap-align: start;
  box-shadow: 0 6px 20px rgba(0,0,0,.05);
}

.author-card__tag{
  position:absolute;
  top: 10px;
  left: 10px;
  background:#fff;
  border:1px solid #ececec;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.author-card__avatar{
  display:flex;
  justify-content:center;
  margin: 6px 0 10px;
}
.author-card__avatar img{
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  display:block;
}

.author-card__name{
  text-align:center;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.author-card__meta{
  display:flex;
  justify-content:center;
  gap:12px;
  font-size: 13px;
  opacity: .85;
  margin-bottom: 12px;
}

.author-card__btn{
  height: 36px;
  border-radius: 999px;
  border: 1px solid #6941c6;
  color:#6941c6;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 700;
  background: rgba(255,255,255,.45);
}

/* Mobile */
@media (max-width: 768px){
  .home-hero__title{ font-size: 28px; }
  .home-hero__inner{ padding: 26px 16px; }
  .home-promo__inner{ padding: 22px 16px; }
}

/* ===== Hero modals ===== */
.portal-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.portal-modal.is-open { display: block; }

.portal-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
}

.portal-modal__panel {
  position: relative;
  width: min(980px, calc(100% - 32px));
  margin: 72px auto 0;
  background: #fff;
  border-radius: 20px;
  padding: 28px 28px 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}

.portal-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  font-size: 32px;
  line-height: 44px;
  cursor: pointer;
}

.portal-modal__title {
  margin: 0 56px 22px 0;
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1.1;
  font-weight: 800;
}

.portal-modal__actions {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.portal-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 260px;
  padding: 14px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 22px;
  font-weight: 600;
  background: #efe8ff;
  color: #6a33d6;
  border: 1px solid rgba(106,51,214,.10);
}

.portal-chip:hover { filter: brightness(.98); }

/* ===== Hero modal icons ===== */
.portal-chip__icon {
  width: 20px;
  height: 20px;
  display: inline-block;

  background-color: #6a33d6; /* цвет иконки */
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;

  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

/* Типы работ */
.portal-chip__icon--poem {
  mask-image: url('../img/poem.svg');
  -webkit-mask-image: url('../img/poem.svg');
}

.portal-chip__icon--art {
  mask-image: url('../img/art.svg');
  -webkit-mask-image: url('../img/art.svg');
}

.portal-chip__icon--prose {
  mask-image: url('../img/prose.svg');
  -webkit-mask-image: url('../img/prose.svg');
}

/* мобилка */
@media (max-width: 720px) {
  .portal-modal__panel { margin-top: 16px; }
  .portal-chip { min-width: 100%; }
}

/* Убираем глобальный отступ темы только на главной */
.site-content{
  padding: 0 !important;
}

/* Head: заголовок слева, табы справа */
.home-top-works__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

/* Табы справа, но сами табы слева внутри блока */
.home-top-works__head .home-tabs{
  margin-left:auto;
  display:flex;
  justify-content:flex-start;
  gap:10px;
}

/* Иконка в табе */
.home-tab .portal-chip__icon{
  margin-left:8px;
  display:inline-block;
  vertical-align:middle;
}

/* ===== Slider (authors / works carousels) ===== */
.portal-slider{
  position: relative;
  display:flex;
  align-items:center;
  gap:10px;
}
.portal-slider__btn{
  width:38px;
  height:38px;
  border-radius: 10px;
  border:1px solid #eaeaea;
  background:#fff;
  cursor:pointer;
  flex: 0 0 auto;
}
.portal-slider__btn:disabled{
  opacity:.35;
  cursor:default;
}
.portal-slider__track{
  overflow:hidden;
  flex: 1 1 auto;
}
.portal-slider__track{
  overflow-x:auto;
  overflow-y:hidden;
  scroll-behavior:smooth;
  -ms-overflow-style: none; /* IE/Edge */
  scrollbar-width: none;    /* Firefox */
}
.portal-slider__track::-webkit-scrollbar{ display:none; }

.portal-slider__items{
  display:flex;
  gap:14px;
  padding: 6px 2px;
}

/* Work cards inside sliders: keep a normal, readable width (avoid ultra-narrow cards)
   Card markup is <article class="work-card ..."> as direct children of .portal-slider__items. */
.portal-slider__track--works .portal-slider__items > .work-card{
  flex: 0 0 280px;
  max-width: 280px;
}

@media (max-width: 1100px){
  .portal-slider__track--works .portal-slider__items > .work-card{
    flex-basis: 260px;
    max-width: 260px;
  }
}

@media (max-width: 720px){
  .portal-slider__track--works .portal-slider__items > .work-card{
    flex-basis: 220px;
    max-width: 220px;
  }
}

/* Ensure author cards don't break layout */
.author-card{
  text-decoration:none;
  color: inherit;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.author-card__name{
  line-height: 1.2;
  word-break: break-word;
}
.author-card__btn{
  text-decoration:none;
  white-space: nowrap;
}

@media (max-width: 720px){
  .portal-slider__btn{ display:none; }
  .portal-slider__track{ overflow-x:auto; }
}

/* Empty state */
.portal-empty{
  padding: 12px 14px;
  border: 1px dashed #ddd;
  border-radius: 12px;
  color: #666;
  background: #fafafa;
}

/* Performance: home page must not show theme loader or wait for external Google Fonts. */
.home,
.home button,
.home input,
.home textarea,
.home select {
  font-family: "Open Sans Local", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.home h1,
.home h2,
.home h3,
.home h4,
.home h5,
.home h6,
.home .btn {
  font-family: "Poppins Local", "Open Sans Local", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.home .site-loader {
  display: none !important;
}
