/*
Theme Name: IIPIT Educational
Theme URI: 
Author: Expert Developer
Author URI: 
Description: Строгая академичная тема по ГОСТ для образовательных организаций, специально для АНО ВО "ИИПИТ".
Version: 1.2
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: MIT
Text Domain: iipit
*/

/* ==============================================================================
   1. ПЕРЕМЕННЫЕ И НАСТРОЙКИ (Государственный стиль)
   ============================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@500;700;800&display=swap');

:root {
    --primary-color: #0b437e;
    --secondary-color: #166fb5;
    --text-main: #0f172a;
    --text-muted: #475569;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 16px 24px -6px rgba(15, 23, 42, 0.12), 0 4px 10px -3px rgba(15, 23, 42, 0.06);
    
    --radius-lg: 16px;
}

/* ==============================================================================
   2. БАЗОВЫЙ СБРОС И ТИПОГРАФИКА
   ============================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.65;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

/* ==============================================================================
   3. СТРУКТУРНЫЕ КЛАССЫ И СЕТКА
   ============================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

main.content {
    flex: 1;
    padding: 40px 0;
    background-color: var(--bg-white);
}

/* ==============================================================================
   4. КОМПОНЕНТЫ: ХЕДЕР И ФУТЕР
   ============================================================================== */
.site-header {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0 0 0;
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 15px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.header-logo h1 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.header-logo p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.header-nav-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Плагин BVI (Версия для слабовидящих) - плейсхолдер */
.bvi-button-placeholder {
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-main);
    transition: var(--transition);
}
.bvi-button-placeholder:hover {
    background-color: #e2e8f0;
}

.site-navigation {
    background-color: transparent;
}

.site-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.site-navigation ul li a {
    display: block;
    padding: 8px 16px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: 6px;
    transition: var(--transition);
}

.site-navigation ul li a:hover {
    color: var(--secondary-color);
    background-color: #f1f5f9;
    text-decoration: none;
}

.site-navigation ul li.current-menu-item a {
    color: var(--primary-color);
    background-color: #e2e8f0;
}

.moodle-button-wrapper {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 15px 20px;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.btn-moodle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #0b437e 0%, #166fb5 100%);
    color: #ffffff !important;
    padding: 10px 22px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(11, 67, 126, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-moodle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(11, 67, 126, 0.25);
    text-decoration: none;
}

.btn-library {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffffff;
    color: #0b437e !important;
    padding: 8px 20px;
    border: 2px solid #0b437e;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-library:hover {
    background: rgba(11, 67, 126, 0.05);
    transform: translateY(-2px);
    text-decoration: none;
}

.site-footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 60px 0 30px;
    margin-top: 60px;
    border-top: 1px solid #1e293b;
    font-size: 0.92rem;
}

.site-footer a {
    color: #cbd5e1;
    transition: var(--transition);
}

.site-footer a:hover {
    color: #38bdf8;
    text-decoration: none;
}

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

.footer-widgets h3 {
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-widgets h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #1e293b;
    padding-top: 25px;
    margin-top: 30px;
    font-size: 0.85rem;
    color: #64748b;
}

/* ==============================================================================
   5. ГЛАВНАЯ СТРАНИЦА
   ============================================================================== */
.hero-section {
    background: linear-gradient(135deg, #0b437e 0%, #1e3a8a 100%);
    color: #ffffff;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(22, 111, 181, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.hero-section h1 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: #ffffff;
    letter-spacing: -1px;
    line-height: 1.25;
}

.faculties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
    margin-top: 45px;
}

.faculty-card {
    background: var(--bg-white);
    border: 1px solid rgba(11, 67, 126, 0.06);
    border-radius: var(--radius-lg);
    padding: 35px 25px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.faculty-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
    border-color: rgba(11, 67, 126, 0.15);
}

.faculty-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
    margin-bottom: 15px;
}

.faculty-icon svg {
    width: 44px;
    height: 44px;
    stroke: var(--primary-color);
    stroke-width: 1.8;
    fill: none;
}

.faculty-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

/* ==============================================================================
   6. СВЕДЕНИЯ ОБ ОО (ПРИКАЗ 831)
   ============================================================================== */
.sveden-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.sveden-sidebar {
    flex: 0 0 300px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

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

.sveden-sidebar li {
    margin-bottom: 8px;
}

.sveden-sidebar li a {
    display: block;
    padding: 8px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-main);
}

.sveden-sidebar li a:hover,
.sveden-sidebar li a.active {
    background: var(--primary-color);
    color: var(--bg-white);
    border-color: var(--primary-color);
    text-decoration: none;
}

.sveden-content {
    flex: 1;
}

/* Таблицы для контента (ГОСТ) */
table.sveden-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table.sveden-table th, 
table.sveden-table td {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    text-align: left;
}

table.sveden-table th {
    background-color: var(--bg-light);
    font-weight: 600;
}

/* ==============================================================================
   7. ПРОГРАММЫ ДПО
   ============================================================================== */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.program-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.program-card-header {
    background-color: var(--primary-color);
    color: var(--bg-white);
    padding: 15px 20px;
}

.program-card-header h3 {
    margin: 0;
    color: var(--bg-white);
    font-size: 1.1rem;
}

.program-card-body {
    padding: 20px;
    flex: 1;
}

.program-card-footer {
    padding: 15px 20px;
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.btn-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--bg-white);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    color: var(--bg-white);
    text-decoration: none;
}

/* ==============================================================================
   8. АДАПТИВНОСТЬ
   ============================================================================== */
@media (max-width: 768px) {
    .sveden-layout {
        flex-direction: column;
    }
    
    .sveden-sidebar {
        flex: 1;
        width: 100%;
        position: static;
        margin-bottom: 30px;
    }
    
    .header-top {
        flex-direction: column;
        text-align: center;
    }
    
    .site-navigation ul {
        flex-direction: column;
    }
    
    .site-navigation ul li a {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    /* Уменьшение заголовков для мобильных */
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    /* ===== Таблицы: вертикальная карточная раскладка ===== */
    table.sveden-table,
    table.sveden-table thead,
    table.sveden-table tbody,
    table.sveden-table tr,
    table.sveden-table th,
    table.sveden-table td {
        display: block;
        width: 100%;
    }
    
    /* Скрываем заголовки таблицы (thead) */
    table.sveden-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    table.sveden-table tr {
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        overflow: hidden;
    }
    
    table.sveden-table th,
    table.sveden-table td {
        border: none;
        border-bottom: 1px solid var(--border-color);
        padding: 10px 15px;
        text-align: left;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    table.sveden-table th {
        background-color: var(--primary-color);
        color: #ffffff;
        font-size: 0.85rem;
        font-weight: 600;
    }
    
    table.sveden-table td {
        background-color: var(--bg-white);
        font-size: 0.9rem;
    }
    
    table.sveden-table tr:last-child td:last-child,
    table.sveden-table tr:last-child th:last-child {
        border-bottom: none;
    }
    
    /* Контактная страница: стек колонок */
    .container > div[style*="display: flex"] {
        flex-direction: column !important;
    }
    
    /* Карта на мобильных */
    div[style*="min-width: 400px"] {
        min-width: 100% !important;
        min-height: 300px !important;
    }
    
    /* Карточки программ */
    .programs-grid {
        grid-template-columns: 1fr;
    }
    
    /* Факультеты */
    .faculties-grid {
        grid-template-columns: 1fr;
    }
}

/* ==============================================================================
   9. МОДАЛЬНЫЕ ОКНА (ДЛЯ ПРОГРАММ)
   ============================================================================== */
.iipit-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.iipit-modal-content {
    background-color: var(--bg-white);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 650px;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.iipit-modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.iipit-modal-close:hover {
    color: var(--primary-color);
}

.iipit-modal h2 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-right: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.iipit-modal-info {
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.iipit-modal-info p {
    margin-bottom: 8px;
}

.iipit-modal-modules {
    background-color: var(--bg-light);
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 25px;
}

.iipit-modal-modules h4 {
    margin-bottom: 12px;
    color: var(--primary-color);
}

.iipit-modal-modules ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.iipit-modal-modules li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
}

.iipit-modal-modules li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-download {
    display: inline-block;
    background-color: #28a745;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-download:hover {
    background-color: #218838;
    color: #fff;
    text-decoration: none;
}

/* ==============================================================================
   10. СЕКЦИЯ ПРЕИМУЩЕСТВ НА ГЛАВНОЙ
   ============================================================================== */
.advantages-section {
    margin-top: 70px;
    background: #f8fafc;
    border: 1px solid rgba(11, 67, 126, 0.05);
    padding: 50px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.advantages-section h2 {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 40px;
}

.advantages-grid {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.advantage-card {
    flex: 1;
    min-width: 280px;
    background: #ffffff;
    border: 1px solid rgba(11, 67, 126, 0.04);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.advantage-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(11, 67, 126, 0.1);
}

.advantage-card h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.advantage-card h4 svg {
    color: #10b981;
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.advantage-card p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 0;
}

