/* =========================
   Layout variables (НЕ цвета)
========================= */
:root{
  --maxw: 1420px;
  --pad: 18px;
  --gap: 18px;
  --radius: 16px;
}

/* =========================
   Reset
========================= */
*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height:1.55;
}

/* =========================
   Wrappers
========================= */
.site-wrapper{
  min-height:100%;
}

#page.site{
  width: min(var(--maxw), calc(100% - (var(--pad) * 2)));
  margin: 0 auto;
}

.header-wrapper{
  margin-top: var(--pad);
  background: var(--headerGrad);
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.main-wrapper{
  margin-top: var(--gap);
}

.footer-wrapper{
  margin-top: var(--gap);
  margin-bottom: var(--pad);
  background: var(--panel);
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* =========================
   Header
========================= */
.site-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: var(--gap);
  padding: 14px 16px;
}

.site-branding{
  display:flex;
  align-items:center;
  gap:12px;
}

.custom-logo{
  height:52px;
  width:auto;
}

.site-title{
  margin:0;
  font-size:18px;
}
.site-description{
  margin:0;
  font-size:13px;
  color: var(--muted);
}

/* =========================
   Navigation
========================= */
.main-navigation{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex:1;
}

.main-navigation ul{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  gap:10px;
}

.main-navigation a{
  padding:10px 12px;
  border-radius:12px;
  color: var(--text);
}

.main-navigation a:hover{
  background: rgba(255,255,255,.05);
}

.current-menu-item > a{
  background: rgba(255,122,42,.15);
  border:1px solid rgba(255,122,42,.35);
}

/* Fullwidth page template */
.site-main--fullwidth{
  width: 100%;
}

.site-main--fullwidth{
  padding: 22px;
}
@media (max-width: 920px){
  .site-main--fullwidth{
    padding: 16px;
  }
}

/* =========================
   Sidebar: Search widget (Gutenberg)
========================= */
.widget_search .wp-block-search__label{
  display:block;
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
}

.widget_search .wp-block-search__inside-wrapper{
  display:flex;
  gap: 10px;
  align-items:stretch;
}

.widget_search .wp-block-search__input{
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--panel2);
  color: var(--text);
  outline: none;
}

.widget_search .wp-block-search__input::placeholder{
  color: rgba(183,183,189,.75);
}

.widget_search .wp-block-search__input:focus{
  border-color: rgba(255,122,42,.45);
  box-shadow: 0 0 0 3px rgba(255,122,42,.15);
}

.widget_search .wp-block-search__button{
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 0;
  background: var(--buttonGrad);
  color: #111;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.widget_search .wp-block-search__button:hover{
  transform: translateY(-1px);
}

.widget_search .wp-block-search__button:active{
  transform: translateY(0);
}

/* На очень узких экранах — кнопка вниз */
@media (max-width: 420px){
  .widget_search .wp-block-search__inside-wrapper{
    flex-direction:column;
  }
  .widget_search .wp-block-search__button{
    width: 100%;
  }
}


/* =========================
   Footer
========================= */
.site-footer{
  padding:18px;
}

.site-info{
  font-size:13px;
  color: var(--muted);
}

/* =========================
   Responsive
========================= */
@media (max-width: 920px){
  .content-layout{
    flex-direction:column;
  }
  .widget-area{
    width:auto;
  }
}

/* =========================
   Comments
========================= */
.comments-area{
  margin-top: var(--gap);
  padding-top: 18px;
  border-top: 1px solid var(--stroke);
}

.comments-title{
  margin-bottom: 16px;
  font-size: 20px;
}

/* List */
.comment-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.comment{
  background: var(--panel2);
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 14px;
}

/* Nested comments */
.comment .children{
  margin-top: 12px;
  margin-left: 28px;
  padding-left: 14px;
  border-left: 2px solid rgba(255,122,42,.35);
}

/* Author / meta */
.comment-author{
  font-weight:600;
  margin-bottom: 4px;
}
.comment-author .avatar{
  border-radius:50%;
  margin-right:8px;
  vertical-align:middle;
}

.comment-metadata{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.comment-content{
  line-height:1.6;
}

/* Reply link */
.comment-reply-link{
  display:inline-block;
  margin-top: 10px;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
}
.comment-reply-link:hover{
  background: rgba(255,122,42,.20);
}

/* Navigation */
.comment-navigation{
  margin: 16px 0;
}

/* Closed notice */
.no-comments{
  margin-top: 14px;
  color: var(--muted);
}

/* =========================
   Comment Form
========================= */
.comment-respond{
  margin-top: 24px;
  padding: 18px;
  background: var(--panel);
  border:1px solid var(--stroke);
  border-radius: var(--radius);
}

.comment-form{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.comment-form-comment{
  grid-column: 1 / -1;
}

.comment-form input,
.comment-form textarea{
  width:100%;
}

.comment-form textarea{
  min-height: 140px;
}

.comment-form-cookies-consent{
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--muted);
}

.form-submit{
  grid-column: 1 / -1;
}

/* ======= home.php Для Blog ==================*/
.posts-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--gap);
}

.post-card{
  background: var(--panel);
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

/* Post card thumbnail: universal */
.post-thumb{
  display:block;
  width:100%;
  overflow:hidden;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
}

/* по умолчанию: ровная сетка */
.post-thumb img{
  display:block;
  width:100%;
  height: 220px;              /* базовая высота */
  object-fit: cover;          /* всегда заполняет красиво */
  object-position: 50% 20%;   /* чуть выше центра: лучше для людей/аватаров */
}

/* адаптив: на мобиле картинка чуть выше */
@media (max-width: 560px){
  .post-thumb img{
    height: 260px;
    object-position: 50% 18%;
  }
}

.post-thumb img{
  image-rendering: auto;
}

.post-body{
  padding:14px;
}

.post-category{
  font-size:12px;
  margin-bottom:6px;
}
.post-category a{
  color: var(--accent);
}

.post-title{
  margin:0 0 8px;
  font-size:18px;
}

.post-excerpt{
  font-size:14px;
  color: var(--muted);
}

/* =========================
   Single post layout
========================= */
/* =========================
   List excerpt (home/archive/search)
========================= */
.list-excerpt{
  color: var(--muted);
  margin: 10px 0 0;
}

/* =========================
   Single post: layout + featured image modes (fixed)
========================= */
.single-top{
  display:flex;
  gap: var(--gap);
  align-items:flex-start;
  margin-bottom: var(--gap);
}

.single-media{
  width: 44%;
  min-width: 320px;
}

/* Featured image wrapper */
.single-thumb{
  border-radius: var(--radius);
  overflow:hidden;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.03);
}

/* Default image behavior (height can be overridden per post via --thumb-h) */
.single-thumb img{
  display:block;
  width:100%;
  height: var(--thumb-h, 520px);
  object-fit: cover;
  object-position: 50% 20%;
}

/* ===== Focus (for COVER) — make it obvious and hard to override ===== */
.single-thumb--focus-top img{ object-position: 50% 0% !important; }
.single-thumb--focus-center img{ object-position: 50% 50% !important; }
.single-thumb--focus-bottom img{ object-position: 50% 100% !important; }

/* ===== Mode: CONTAIN (no crop). Use container alignment so Focus still works ===== */
.single-thumb--contain{
  display:flex;
  justify-content:center;
  background: #101012;
}
.single-thumb--contain img{
  width:100%;
  height:100%;
  object-fit: contain;
  object-position: 50% 50% !important; /* keep stable in contain */
}

/* Focus for CONTAIN = align image inside the frame */
.single-thumb--contain.single-thumb--focus-top{ align-items:flex-start; }
.single-thumb--contain.single-thumb--focus-center{ align-items:center; }
.single-thumb--contain.single-thumb--focus-bottom{ align-items:flex-end; }

/* ===== Mode: AUTO (natural height) ===== */
.single-thumb--auto img{
  height: auto;
  object-fit: initial;
  object-position: initial;
}

/* "Posted in ..." moved under thumbnail */
.single-meta-under-thumb{
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.single-meta-under-thumb a{ color: var(--accent); }
.single-meta-under-thumb a:hover{
  color: var(--accent2);
  text-decoration: underline;
}

/* Description panel */
.single-summary{
  flex: 1;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 16px;
}
.single-desc{ line-height: 1.7; }

/* Positions: right / left / below */
.single-top--right{ flex-direction: row; }
.single-top--left{ flex-direction: row-reverse; }
.single-top--below{ flex-direction: column; }
.single-top--below .single-media{ width:100%; min-width:0; }
.single-top--below .single-summary{ width:100%; }

/* Content safety: media doesn't overflow */
.entry-content img,
.entry-content video,
.entry-content iframe{
  max-width: 100%;
  height: auto;
}
.entry-content figure{
  margin: 0 0 16px;
}

@media (max-width: 920px){
  .single-top{ flex-direction: column; }
  .single-media{ width:100%; min-width:0; }
}

.entry-title--single{
  text-align:center;
  font-size: 28px;
  margin: 0 0 16px;
}

/*========== category =============== */
.category-header{
  margin-bottom: var(--gap);
}
.category-title{
  margin: 0 0 8px;
}
.category-description{
  color: var(--muted);
  max-width: 70ch;
}

/* Archive header */
.archive-header{
  margin-bottom: var(--gap);
}
.archive-description{
  color: var(--muted);
  max-width: 80ch;
}

/* No results block */
.no-results{
  background: rgba(255,255,255,.03);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 18px;
}
.no-results .page-title{
  margin: 0 0 10px;
}
.no-results .page-content p{
  color: var(--muted);
}
.no-results .wp-block-search__inside-wrapper,
.no-results form.search-form{
  margin-top: 12px;
}


/*========================= */
/* ======= Должно быть в низу ==================
   Sidebar widgets: FORCE colors
========================= */

/* Общий текст */
.widget,
.widget *{
  color: var(--text);
}

/* Ссылки */
.widget a{
  color: var(--accent);
  text-decoration: none;
}
.widget a:hover{
  color: var(--accent2);
  text-decoration: underline;
}

/* Заголовки виджетов */
.widget-title,
.widget h2,
.widget h3{
  color: var(--text);
}

/* Gutenberg списки */
.wp-block-latest-posts a,
.wp-block-latest-comments a,
.wp-block-categories a,
.wp-block-archives a{
  color: var(--accent);
}

.wp-block-latest-posts a:hover,
.wp-block-latest-comments a:hover,
.wp-block-categories a:hover,
.wp-block-archives a:hover{
  color: var(--accent2);
}

/* Даты, мета */
.wp-block-latest-comments__comment-date,
.wp-block-latest-posts__post-date{
  color: var(--muted);
}

/* Search input FIX */
.wp-block-search__input{
  color: var(--text) !important;
  background: var(--panel2);
}

.wp-block-search__input::placeholder{
  color: var(--muted);
}

/* Bullets */
.widget ul{
  padding-left: 18px;
}
.widget li::marker{
  color: var(--accent);
}