/*
Theme Name: KFC Belarus
Description: Официальная тема для сайта KFC Belarus с оптимизированной производительностью
Version: 1.0.0
Author: KFC Belarus Team
Text Domain: kfc-belarus
Domain Path: /languages
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: restaurant, food, business, responsive, performance-optimized

This theme is optimized for performance with WebP images, critical CSS, and modern font loading.
*/

/* Критический CSS будет загружен инлайн через functions.php */
/* Основные стили загружаются асинхронно для оптимизации производительности */

@import url('assets/css/normalize.css');
@import url('assets/css/webflow.css');
@import url('assets/css/kfc-belarus.webflow.css');

/* Базовые стили для предотвращения FOUC */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

/* Загрузочный индикатор */
.loading {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.loaded {
  opacity: 1;
}

/* ==========================================================================
   Основные стили темы KFC Belarus
   ========================================================================== */

/* Переменные CSS */
:root {
  --kfc-red: #e4002b;
  --kfc-red-dark: #c8001f;
  --kfc-black: #000000;
  --kfc-white: #ffffff;
  --kfc-gray-light: #f5f5f5;
  --kfc-gray: #666666;
  --kfc-gray-dark: #333333;
  --font-primary: 'CeraCompactPro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-secondary: 'CeraPro', Georgia, serif;
  --container-width: 1200px;
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* Базовая типографика */
body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  color: var(--kfc-gray-dark);
  background-color: var(--kfc-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1rem 0;
  color: var(--kfc-black);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin: 0 0 1rem 0;
}

a {
  color: var(--kfc-red);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--kfc-red-dark);
  text-decoration: underline;
}

/* Контейнер */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Кнопки */
.btn {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--kfc-red);
  color: var(--kfc-white);
  border: none;
  border-radius: var(--border-radius);
  font-family: var(--font-primary);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover {
  background-color: var(--kfc-red-dark);
  color: var(--kfc-white);
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--kfc-red);
  border: 2px solid var(--kfc-red);
}

.btn-secondary:hover {
  background-color: var(--kfc-red);
  color: var(--kfc-white);
}

/* Хедер */
.site-header {
  background-color: var(--kfc-white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.site-logo img {
  max-height: 60px;
  width: auto;
}

/* Навигация */
.main-navigation {
  display: flex;
  align-items: center;
}

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

.main-navigation a {
  color: var(--kfc-gray-dark);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

.main-navigation a:hover {
  color: var(--kfc-red);
  text-decoration: none;
}

.main-navigation a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--kfc-red);
  transition: width 0.3s ease;
}

.main-navigation a:hover::after {
  width: 100%;
}

/* Мобильное меню */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--kfc-gray-dark);
}

/* Основной контент */
.site-main {
  min-height: 60vh;
  padding: 2rem 0;
}

.content-area {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

.no-sidebar .content-area {
  grid-template-columns: 1fr;
}

/* Посты */
.post {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--kfc-gray-light);
}

.post:last-child {
  border-bottom: none;
}

.entry-header {
  margin-bottom: 1.5rem;
}

.entry-title {
  margin-bottom: 0.5rem;
}

.entry-title a {
  color: var(--kfc-black);
  text-decoration: none;
}

.entry-title a:hover {
  color: var(--kfc-red);
}

.entry-meta {
  color: var(--kfc-gray);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.entry-meta a {
  color: var(--kfc-gray);
}

.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
}

/* Сайдбар */
.sidebar {
  background-color: var(--kfc-gray-light);
  padding: 2rem;
  border-radius: var(--border-radius);
}

.widget {
  margin-bottom: 2rem;
}

.widget:last-child {
  margin-bottom: 0;
}

.widget-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--kfc-black);
}

.widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.widget li:last-child {
  border-bottom: none;
}

/* Футер */
.site-footer {
  background-color: var(--kfc-black);
  color: var(--kfc-white);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-widget h3 {
  color: var(--kfc-white);
  margin-bottom: 1rem;
}

.footer-widget a {
  color: var(--kfc-gray);
}

.footer-widget a:hover {
  color: var(--kfc-white);
}

.site-info {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--kfc-gray-dark);
  color: var(--kfc-gray);
  font-size: 0.9rem;
}

/* Формы */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--kfc-gray);
  border-radius: var(--border-radius);
  font-family: var(--font-primary);
  font-size: 1rem;
  transition: var(--transition);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--kfc-red);
  box-shadow: 0 0 0 3px rgba(228, 0, 43, 0.1);
}

/* Адаптивность */
@media (max-width: 768px) {
  :root {
    --container-width: 100%;
  }
  
  .container {
    padding: 0 15px;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  
  .header-content {
    flex-wrap: wrap;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .main-navigation {
    display: none;
    width: 100%;
    order: 3;
  }
  
  .main-navigation.toggled {
    display: block;
  }
  
  .main-navigation ul {
    flex-direction: column;
    gap: 0;
    background-color: var(--kfc-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1rem;
    margin-top: 1rem;
  }
  
  .main-navigation li {
    border-bottom: 1px solid var(--kfc-gray-light);
  }
  
  .main-navigation li:last-child {
    border-bottom: none;
  }
  
  .main-navigation a {
    display: block;
    padding: 1rem 0;
  }
  
  .content-area {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .footer-widgets {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  .site-main {
    padding: 1rem 0;
  }
  
  .post {
    margin-bottom: 2rem;
  }
}

/* Утилиты */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Анимации */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Печать */
@media print {
  .site-header,
  .site-footer,
  .sidebar,
  .menu-toggle {
    display: none;
  }
  
  .content-area {
    grid-template-columns: 1fr;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }
  
  img {
    max-width: 100% !important;
  }
  
  a {
    color: var(--kfc-black) !important;
    text-decoration: underline;
  }
}
