/* Virtolit Theme - minimal, plugin-friendly styles
   IMPORTANT: Avoid aggressive global styles. Keep typography/layout only.
*/

:root{
  --vtheme-bg:#ffffff;
  --vtheme-text:#0f172a;
  --vtheme-muted:#64748b;
  --vtheme-border:#e5e7eb;
  --vtheme-card:#ffffff;
  --vtheme-shadow:0 10px 24px rgba(2,6,23,.08);
  --vtheme-radius:14px;

  /* All pages: 1320px */
  --vtheme-max:1320px;
  --vtheme-max-wide:1320px; /* залишено для сумісності, але тепер = 1320 */

  /* Default desktop container padding (ПК не міняємо) */
  --vtheme-pad:20px;

  /* Space between content and footer (bottom of main) */
  --vtheme-main-top:14px;      /* було 18px -> -~20% */
  --vtheme-main-bottom:40px;   /* Desktop default */
}

*,
*::before,
*::after{box-sizing:border-box;}

html{scroll-behavior:smooth;}

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

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

a{color:inherit;}
a:hover{color:inherit;}

.vtheme-skip-link{
  position:absolute;
  left:-9999px;
  top:0;
  background:#111827;
  color:#fff;
  padding:10px 12px;
  border-radius:10px;
  z-index:9999;
}
.vtheme-skip-link:focus{
  left:10px;
  top:10px;
}

/* Container */
.vtheme-container{
  max-width:var(--vtheme-max);
  margin:0 auto;
  padding:0 var(--vtheme-pad);
}

/* Tablet padding: 12px -> 8px */
@media (min-width: 600px) and (max-width: 859px){
  :root{
    --vtheme-pad:8px;
  }
}

/* Mobile padding: 6px -> 4px */
@media (max-width: 599px){
  :root{
    --vtheme-pad:4px;
    --vtheme-main-bottom:30px;
  }
}

/* Sticky footer layout:
   - site is a column flex container with min-height: 100vh
   - main grows to fill remaining height
   - footer naturally sits at the bottom when content is short
*/
.vtheme-site{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

/* Main spacing controlled via CSS vars */
.vtheme-main{
  flex:1 0 auto;
  padding:var(--vtheme-main-top) 0 var(--vtheme-main-bottom);
}

/* Header */
.vtheme-header{
  position:sticky;
  top:0;
  z-index:1000;
  background:rgba(255,255,255,.9);
  backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid var(--vtheme-border);
}
body.admin-bar .vtheme-header{ top:32px; }
@media (max-width: 782px){
  body.admin-bar .vtheme-header{ top:46px; }
}

.vtheme-header-inner{
  display:flex;
  align-items:center;
  justify-content:flex-start; /* меню не по центру */
  gap:14px;
  min-height:62px; /* хедер без збільшення */
}

.vtheme-brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  font-weight:800;
  letter-spacing:.2px;
}
.vtheme-brand:hover{text-decoration:none;}

/* ЛОГО/АВАТАР:
   Вимога: логотип/аватар відображається ЦІЛКОМ, без обрізання, незалежно від форми.
   - висота фіксована (щоб не “роздувати” хедер)
   - ширина автоматична (по реальному співвідношенню сторін картинки)
   - є max-width, щоб дуже широкі лого не “з’їдали” меню
*/
.vtheme-logo{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:32px;
  min-width:32px;
  max-width:126px;
  border:0;
  box-shadow:none;
  background:transparent;
  flex-shrink:0;
}

/* Картинка: не обрізаємо, показуємо повністю */
.vtheme-logo-img{
  height:32px;
  width:auto;
  max-width:126px;
  object-fit:contain;
  display:block;
}

/* Заглушка-літера (коли картинки нема) */
.vtheme-logo-letter{
  width:32px;
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background:#fff;
  font-size:14px;
  line-height:1;
  font-weight:900;
  color:var(--vtheme-text);
  user-select:none;
}

.vtheme-brand-title{
  display:none; /* controlled via body classes + media queries */
  font-size:18px;
  line-height:1.1;
  color:var(--vtheme-text);
  white-space:nowrap;
}
@media (max-width: 520px){
  .vtheme-brand-title{ font-size:16px; }
}

/* Site title visibility per device (set in admin: Header/Footer Virtolit) */
@media (min-width: 860px){
  body.vtheme-title-desktop-on .vtheme-brand-title{display:inline-block;}
}
@media (min-width: 600px) and (max-width: 859px){
  body.vtheme-title-tablet-on .vtheme-brand-title{display:inline-block;}
}
@media (max-width: 599px){
  body.vtheme-title-mobile-on .vtheme-brand-title{display:inline-block;}
}

.vtheme-nav{
  display:flex;
  align-items:center;
  gap:14px;

  margin-left:auto; /* меню хедера притискається до правої частини (біля "Кабінет") */
}

.vtheme-nav .menu{
  display:flex;
  align-items:center;
  gap:10px;
  list-style:none;
  margin:0;
  padding:0;
}
.vtheme-nav .menu a{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:9px 10px;
  border-radius:10px;
  text-decoration:none;
  color:var(--vtheme-text);
}
.vtheme-nav .menu a:hover{
  text-decoration:none;
  background:rgba(2,6,23,.04);
}

.vtheme-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

/* На мобільних/планшетах меню ховається, тому праву частину тримає actions */
@media (max-width: 859px){
  .vtheme-actions{ margin-left:auto; }
}

.vtheme-search{
  display:none;
}
.vtheme-search form{
  display:flex;
  align-items:center;
  gap:8px;
}
.vtheme-search input[type="search"]{
  width:220px;
  max-width:40vw;
  padding:9px 10px;
  border:1px solid var(--vtheme-border);
  border-radius:10px;
  background:#fff;
  color:var(--vtheme-text);
  outline:none;
}
.vtheme-search input[type="search"]:focus{
  border-color:#111827;
}

.vtheme-auth a{
  display:inline-flex;
  align-items:center;
  padding:9px 10px;
  border-radius:10px;
  text-decoration:none;
  border:1px solid var(--vtheme-border);
  background:#fff;
}
.vtheme-auth a:hover{
  text-decoration:none;
  border-color:#111827;
}

/* Mobile menu button */
.vtheme-burger{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  border-radius:12px;
  border:1px solid var(--vtheme-border);
  background:#fff;
  cursor:pointer;
}
.vtheme-burger:hover{border-color:#111827;}

.vtheme-mobile-panel{
  display:none;
  border-top:1px solid var(--vtheme-border);
  padding:10px 0 14px;
}
.vtheme-mobile-panel .menu{
  flex-direction:column;
  align-items:stretch;
  gap:6px;
}
.vtheme-mobile-panel .menu a{
  justify-content:space-between;
}

/* Responsive (ПК: бургер не показуємо) */
@media (min-width: 860px){
  .vtheme-search{display:block;}
  .vtheme-burger{display:none;}
  .vtheme-mobile-panel{display:none !important;}
}

@media (max-width: 859px){
  .vtheme-nav{display:none;}
  .vtheme-mobile-panel.is-open{display:block;}
}

/* Footer */
.vtheme-footer{
  border-top:1px solid var(--vtheme-border);
  background:#fff;
}

.vtheme-footer-inner{
  padding:20px 0;

  /* Ліворуч по горизонталі + по центру по вертикалі */
  display:flex;
  align-items:center;        /* вертикальний центр */
  justify-content:flex-start;/* ліворуч */
  gap:14px;
}

.vtheme-footer .menu{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  list-style:none;
  margin:0;
  padding:0;

  justify-content:flex-start;
}

.vtheme-footer .menu a{
  display:inline-flex;
  padding:8px 10px;
  border-radius:10px;
  text-decoration:none;
  border:1px solid var(--vtheme-border);
  background:#fff;
}
.vtheme-footer .menu a:hover{
  text-decoration:none;
  border-color:#111827;
}

.vtheme-footer-text{
  color:var(--vtheme-muted);
  font-size:14px;
  text-align:left;
}

/* Content defaults (keep minimal) */
.vtheme-entry{
  max-width:var(--vtheme-max);
}
.vtheme-entry h1, .vtheme-entry h2, .vtheme-entry h3{
  line-height:1.2;
  margin:0 0 12px;
}
.vtheme-entry p{
  margin:0 0 12px;
}

/* Virtolit pages: container controls width, plugin controls inner layout */
.vtheme-entry--wide{
  max-width:var(--vtheme-max-wide);
}

/* ==== Plugin compatibility notes ====
   Virtolit Suite Cabinet CSS (vcab.css) could contain theme-specific negative margins from previous themes.
   Keep Cabinet/Profile content safely below the sticky header on Virtolit Theme.
*/
body.vtheme-virtolit-page .vcab{
  max-width:none !important;
  width:100% !important;
}

.vcab{margin-top:8px !important;}
@media (min-width: 782px){
  .vcab{margin-top:8px !important;}
}
