/* ===================================
   ЄДИНА СИСТЕМА ТИПОГРАФІКИ ТА СТИЛІВ
   для всіх сторінок проекту
   =================================== */

/* ===== ПРИБИРАЄМО ЧЕРВОНЕ ПІДСВІЧУВАННЯ ===== */
/* Прибираємо стандартний outline/focus для всіх елементів */
*:focus,
*:active,
*:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Для кнопок */
button:focus,
button:active,
.btn:focus,
.btn:active {
    outline: none !important;
    box-shadow: none !important;
}

/* Для посилань */
a:focus,
a:active {
    outline: none !important;
    box-shadow: none !important;
}

/* Для input/textarea */
input:focus,
textarea:focus,
select:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Для Bootstrap елементів */
.form-control:focus,
.form-select:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: #E7685D !important;
}

/* Прибираємо tap highlight на мобільних */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* ===== БАЗОВІ НАЛАШТУВАННЯ ===== */
:root {
    /* Кольори */
    --primary-color: #E7685D;
    --primary-hover: #d45648;
    --text-color: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;

    /* Шрифти */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-headings: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Розміри шрифтів */
    --font-size-base: 16px;
    --font-size-small: 14px;
    --font-size-large: 18px;

    /* Заголовки */
    --h1-size: 2.5rem;      /* 40px */
    --h2-size: 2rem;        /* 32px */
    --h3-size: 1.75rem;     /* 28px */
    --h4-size: 1.5rem;      /* 24px */
    --h5-size: 1.25rem;     /* 20px */
    --h6-size: 1rem;        /* 16px */

    /* Висота рядка */
    --line-height-base: 1.6;
    --line-height-headings: 1.3;

    /* Відступи */
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-xxl: 3rem;     /* 48px */

    /* Тіні */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-primary: 0 4px 12px rgba(231, 104, 93, 0.2);

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Transition */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== БАЗОВИЙ ШРИФТ ===== */
html {
    font-size: var(--font-size-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-color);
    font-weight: 400;
}

/* ===== ЗАГОЛОВКИ ===== */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-family-headings);
    font-weight: 700;
    line-height: var(--line-height-headings);
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: var(--spacing-md);
}

h1, .h1 {
    font-size: var(--h1-size);
    margin-bottom: var(--spacing-lg);
}

h2, .h2 {
    font-size: var(--h2-size);
    margin-bottom: var(--spacing-lg);
}

h3, .h3 {
    font-size: var(--h3-size);
    margin-bottom: var(--spacing-md);
}

h4, .h4 {
    font-size: var(--h4-size);
    margin-bottom: var(--spacing-md);
}

h5, .h5 {
    font-size: var(--h5-size);
    margin-bottom: var(--spacing-sm);
}

h6, .h6 {
    font-size: var(--h6-size);
    margin-bottom: var(--spacing-sm);
}

/* Заголовки з primary кольором */
h1.primary, h2.primary, h3.primary, h4.primary, h5.primary, h6.primary {
    color: var(--primary-color);
}

/* ===== ПАРАГРАФИ ===== */
p {
    margin: 0 0 var(--spacing-md) 0;
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-color);
}

p.lead {
    font-size: var(--font-size-large);
    font-weight: 400;
    line-height: 1.8;
    color: var(--text-secondary);
}

p.small {
    font-size: var(--font-size-small);
    color: var(--text-secondary);
}

/* ===== ПОСИЛАННЯ ===== */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== СПИСКИ ===== */
ul, ol {
    margin: 0 0 var(--spacing-md) 0;
    padding-left: var(--spacing-lg);
}

li {
    margin-bottom: var(--spacing-xs);
    line-height: var(--line-height-base);
}

/* Список без маркерів */
ul.list-unstyled, ol.list-unstyled {
    list-style: none;
    padding-left: 0;
}

/* ===== КНОПКИ ===== */
.btn {
    display: inline-block;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 2px solid transparent;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--bg-white);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--bg-white);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: var(--font-size-large);
}

.btn-sm {
    padding: 0.375rem 1rem;
    font-size: var(--font-size-small);
}

/* ===== КАРТКИ ===== */
.card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-title {
    font-size: var(--h5-size);
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: var(--spacing-sm);
}

.card-text {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    line-height: var(--line-height-base);
}

/* ===== ТАБЛИЦІ ===== */
table {
    width: 100%;
    margin-bottom: var(--spacing-lg);
    border-collapse: collapse;
}

th, td {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 700;
    color: var(--text-color);
    background-color: var(--bg-light);
}

/* ===== BLOCKQUOTE ===== */
blockquote {
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md) var(--spacing-lg);
    border-left: 4px solid var(--primary-color);
    background-color: var(--bg-light);
    font-style: italic;
    color: var(--text-secondary);
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* ===== ЗОБРАЖЕННЯ ===== */
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

img.rounded {
    border-radius: var(--radius-md);
}

img.img-shadow {
    box-shadow: var(--shadow-md);
}

/* ===== КОНТЕЙНЕРИ ===== */
.container {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

.container-fluid {
    width: 100%;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

/* ===== СЕКЦІЇ ===== */
section {
    padding: var(--spacing-xxl) 0;
}

section.section-sm {
    padding: var(--spacing-xl) 0;
}

section.section-lg {
    padding: 4rem 0;
}

/* ===== UTILITY КЛАСИ ===== */

/* Відступи */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--spacing-xs) !important; }
.mt-2 { margin-top: var(--spacing-sm) !important; }
.mt-3 { margin-top: var(--spacing-md) !important; }
.mt-4 { margin-top: var(--spacing-lg) !important; }
.mt-5 { margin-top: var(--spacing-xl) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--spacing-xs) !important; }
.mb-2 { margin-bottom: var(--spacing-sm) !important; }
.mb-3 { margin-bottom: var(--spacing-md) !important; }
.mb-4 { margin-bottom: var(--spacing-lg) !important; }
.mb-5 { margin-bottom: var(--spacing-xl) !important; }

.pt-3 { padding-top: var(--spacing-md) !important; }
.pt-4 { padding-top: var(--spacing-lg) !important; }
.pt-5 { padding-top: var(--spacing-xl) !important; }

.pb-3 { padding-bottom: var(--spacing-md) !important; }
.pb-4 { padding-bottom: var(--spacing-lg) !important; }
.pb-5 { padding-bottom: var(--spacing-xl) !important; }

/* Кольори тексту */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-light { color: var(--text-light) !important; }
.text-dark { color: var(--text-color) !important; }

/* Розміри шрифту */
.text-small { font-size: var(--font-size-small) !important; }
.text-base { font-size: var(--font-size-base) !important; }
.text-large { font-size: var(--font-size-large) !important; }

/* Вирівнювання */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* Товщина шрифту */
.font-light { font-weight: 300 !important; }
.font-normal { font-weight: 400 !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    :root {
        --h1-size: 2rem;        /* 32px */
        --h2-size: 1.75rem;     /* 28px */
        --h3-size: 1.5rem;      /* 24px */
        --h4-size: 1.25rem;     /* 20px */
        --h5-size: 1.125rem;    /* 18px */
        --h6-size: 1rem;        /* 16px */
    }

    html {
        font-size: 14px;
    }

    section {
        padding: var(--spacing-xl) 0;
    }
}

@media (max-width: 576px) {
    :root {
        --h1-size: 1.75rem;     /* 28px */
        --h2-size: 1.5rem;      /* 24px */
        --h3-size: 1.25rem;     /* 20px */
    }

    .container {
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
    }
}
