/*
Theme Name: Ubuntu Mirror
Theme URI: https://example.com/ubuntu-mirror
Author: Your Name
Author URI: https://example.com
Description: Тема WordPress в стиле официального зеркала Ubuntu. Оранжево-фиолетовая палитра, адаптивная вёрстка.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: ubuntu-mirror
Tags: blog, custom-logo, custom-menu, featured-images
*/

:root {
    --ubuntu-orange: #E95420;
    --ubuntu-purple: #772953;
    --ubuntu-dark:   #2C001E;
    --ubuntu-light:  #F7F7F7;
    --ubuntu-gray:   #333333;
    --ubuntu-text:   #111111;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Ubuntu', 'Segoe UI', Tahoma, sans-serif;
    color: var(--ubuntu-text);
    background: #ffffff;
    line-height: 1.6;
}

a { color: var(--ubuntu-orange); text-decoration: none; }
a:hover { color: var(--ubuntu-purple); text-decoration: underline; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    background: var(--ubuntu-dark);
    color: #fff;
    padding: 20px 0;
    border-bottom: 4px solid var(--ubuntu-orange);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.site-title { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: 1px; }
.site-title a { color: #fff; }
.site-title a:hover { color: var(--ubuntu-orange); text-decoration: none; }
.site-description { margin: 4px 0 0; font-size: 14px; opacity: 0.8; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 25px; }
.main-nav a {
    color: #fff; font-weight: 500; text-transform: uppercase;
    font-size: 14px; letter-spacing: 0.5px; padding: 8px 0;
    border-bottom: 2px solid transparent; transition: all .2s;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    color: var(--ubuntu-orange);
    border-bottom-color: var(--ubuntu-orange);
    text-decoration: none;
}

.hero {
    background: linear-gradient(135deg, var(--ubuntu-purple), var(--ubuntu-orange));
    color: #fff; padding: 60px 0; text-align: center;
}
.hero h1 { font-size: 42px; margin: 0 0 10px; }
.hero p  { font-size: 18px; opacity: 0.95; }

.site-main { padding: 40px 0; display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
@media (max-width: 900px) { .site-main { grid-template-columns: 1fr; } }

article.post {
    background: #fff; border: 1px solid #e5e5e5; border-radius: 8px;
    padding: 25px; margin-bottom: 30px; transition: box-shadow .2s;
}
article.post:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
article.post h2 { margin-top: 0; font-size: 26px; }
article.post h2 a { color: var(--ubuntu-gray); }
article.post h2 a:hover { color: var(--ubuntu-orange); text-decoration: none; }

.post-meta { font-size: 13px; color: #888; margin-bottom: 15px; }
.post-thumbnail img { width: 100%; height: auto; border-radius: 6px; margin-bottom: 15px; }

.btn {
    display: inline-block; background: var(--ubuntu-orange); color: #fff !important;
    padding: 10px 22px; border-radius: 4px; font-weight: 600;
    text-transform: uppercase; font-size: 13px; letter-spacing: 0.5px; transition: background .2s;
}
.btn:hover { background: var(--ubuntu-purple); text-decoration: none; }

.widget {
    background: var(--ubuntu-light); border-left: 4px solid var(--ubuntu-orange);
    padding: 20px; margin-bottom: 25px; border-radius: 4px;
}
.widget-title { margin-top: 0; font-size: 18px; color: var(--ubuntu-purple); }
.widget ul { list-style: none; padding-left: 0; }
.widget ul li { padding: 6px 0; border-bottom: 1px dashed #ccc; }
.widget ul li:last-child { border-bottom: none; }

.site-footer {
    background: var(--ubuntu-dark); color: #ddd;
    padding: 30px 0; margin-top: 40px; text-align: center; font-size: 14px;
}
.site-footer a { color: var(--ubuntu-orange); }

.pagination { text-align: center; margin: 30px 0; }
.pagination .page-numbers {
    display: inline-block; padding: 8px 14px; margin: 0 3px;
    background: var(--ubuntu-light); border-radius: 4px; color: var(--ubuntu-gray);
}
.pagination .current { background: var(--ubuntu-orange); color: #fff; }

/* ---------- Репозитории (таблица как на официальном сайте) ---------- */
.repos-header { margin-bottom: 25px; }
.repos-intro { margin: 15px 0; }

.repos-search {
    margin: 20px 0;
}
.repos-search input {
    padding: 10px 14px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    width: 100%;
    max-width: 480px;
}
.repos-search input:focus {
    border-color: var(--ubuntu-orange);
    outline: none;
}

.repos-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
}

.repos-table thead {
    background: var(--ubuntu-purple);
    color: #fff;
}

.repos-table th,
.repos-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.repos-table tbody tr:hover {
    background: var(--ubuntu-light);
}

.repos-table td code {
    background: var(--ubuntu-light);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--ubuntu-purple);
}

.component-badge {
    display: inline-block;
    background: var(--ubuntu-orange);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin: 2px 4px 2px 0;
}

.repo-arch {
    color: #666;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 13px;
}

@media (max-width: 700px) {
    .repos-table thead { display: none; }
    .repos-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e5e5e5;
        border-radius: 6px;
        padding: 10px;
    }
    .repos-table td {
        display: block;
        border: none;
        padding: 6px 0;
    }
    .repos-table td::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: var(--ubuntu-purple);
    }
}
.repo-download {
    text-align: center;
    white-space: nowrap;
}

.btn-download-list {
    display: inline-block;
    padding: 6px 12px;
    background: var(--ubuntu-orange);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    transition: background .2s;
}

.btn-download-list:hover {
    background: var(--ubuntu-purple);
    text-decoration: none;
    color: #fff !important;
}
.repos-mirror-select {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.repos-mirror-select label {
    margin: 0;
    font-size: 15px;
}

.repos-mirror-select select {
    padding: 10px 14px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    min-width: 320px;
    background: #fff;
}

.repos-mirror-select select:focus {
    border-color: var(--ubuntu-orange);
    outline: none;
}
/* ---------- Проверка доступности зеркал ---------- */
.repos-actions {
    margin: 15px 0 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

#check-all-mirrors {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--ubuntu-orange);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

#check-all-mirrors:hover {
    background: var(--ubuntu-purple);
}

.repo-status {
    text-align: center;
    white-space: nowrap;
    width: 130px;
}

.mirror-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f0f0f0;
    transition: background .3s;
}

.mirror-status .status-icon {
    font-size: 16px;
    line-height: 1;
}

.mirror-status .status-text {
    color: #666;
}

.mirror-status.status-up {
    background: #e6f7e6;
}
.mirror-status.status-up .status-text {
    color: #008a20;
}

.mirror-status.status-down {
    background: #fdeaea;
}
.mirror-status.status-down .status-text {
    color: #c00;
}

@media (max-width: 700px) {
    .repo-status { width: auto; }
    .mirror-status { font-size: 12px; }
}
/* ---------- Оформление приветственной записи ---------- */
.single .post-content,
.page .post-content {
    font-size: 16px;
    line-height: 1.7;
}

.post-content .lead {
    font-size: 20px;
    color: var(--ubuntu-purple);
    font-weight: 500;
    border-left: 4px solid var(--ubuntu-orange);
    padding-left: 20px;
    margin: 30px 0;
}

.post-content h2 {
    margin-top: 45px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ubuntu-light);
    color: var(--ubuntu-purple);
}

.post-content h3 {
    color: var(--ubuntu-orange);
}

/* Карточки-фичи */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-card {
    background: var(--ubuntu-light);
    border-left: 4px solid var(--ubuntu-orange);
    border-radius: 8px;
    padding: 20px;
    transition: transform .2s, box-shadow .2s;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(233, 84, 32, 0.15);
}

.feature-card h3 {
    margin: 0 0 10px;
    font-size: 17px;
}

.feature-card p {
    margin: 0;
    font-size: 14px;
    color: #555;
}

/* Блоки кода */
.post-content pre {
    background: #2c001e;
    color: #f5f5f5;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
}

.post-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-family: 'Ubuntu Mono', 'Consolas', monospace;
}

.post-content code {
    background: var(--ubuntu-light);
    color: var(--ubuntu-purple);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* Таблица версий */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
}

.post-content table thead {
    background: var(--ubuntu-purple);
    color: #fff;
}

.post-content table th,
.post-content table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.post-content table tbody tr:hover {
    background: var(--ubuntu-light);
}

/* Цитата */
.post-content blockquote {
    border-left: 4px solid var(--ubuntu-orange);
    background: var(--ubuntu-light);
    padding: 15px 25px;
    margin: 25px 0;
    font-style: italic;
    color: #555;
    border-radius: 0 6px 6px 0;
}

/* Картинки в записи */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* Адаптив */
@media (max-width: 700px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
    .post-content h2 {
        font-size: 22px;
    }
}
/* ---------- Страница "Скачать Ubuntu" ---------- */
.download-header { margin-bottom: 25px; }
.download-intro { margin: 15px 0 25px; }

.download-picker {
    background: var(--ubuntu-light);
    border-left: 4px solid var(--ubuntu-orange);
    border-radius: 6px;
    padding: 25px;
    margin: 25px 0;
}

.picker-row {
    margin-bottom: 20px;
}
.picker-row:last-child { margin-bottom: 0; }

.picker-row > label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--ubuntu-purple);
}

.picker-row select {
    padding: 10px 14px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    min-width: 340px;
    max-width: 100%;
    background: #fff;
}
.picker-row select:focus {
    border-color: var(--ubuntu-orange);
    outline: none;
}

.picker-radios {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}
.picker-radios label {
    font-weight: normal;
    cursor: pointer;
}

/* Карточка результата */
.download-result {
    background: #fff;
    border: 2px solid var(--ubuntu-orange);
    border-radius: 10px;
    padding: 30px;
    margin: 30px 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 25px;
    align-items: center;
    box-shadow: 0 8px 24px rgba(233, 84, 32, 0.12);
}

.result-icon {
    font-size: 60px;
    line-height: 1;
}

.result-info h2 {
    margin: 0 0 6px;
    font-size: 22px;
    color: var(--ubuntu-purple);
}

.result-meta {
    margin: 0 0 12px;
    color: #666;
    font-size: 14px;
}

.result-file {
    margin: 0;
    font-size: 14px;
}
.result-file code {
    background: var(--ubuntu-light);
    padding: 4px 10px;
    border-radius: 4px;
    color: var(--ubuntu-purple);
    font-size: 13px;
    word-break: break-all;
}

.result-note {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fff8e1;
    border-left: 3px solid #f5a623;
    border-radius: 4px;
    font-size: 13px;
    color: #6a4e00;
    display: none;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.btn-download-iso {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--ubuntu-orange);
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s, transform .15s;
}
.btn-download-iso:hover {
    background: var(--ubuntu-purple);
    color: #fff !important;
    text-decoration: none;
    transform: translateY(-2px);
}

.btn-link-secondary {
    display: inline-block;
    text-align: center;
    padding: 8px 16px;
    color: var(--ubuntu-purple) !important;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid var(--ubuntu-purple);
    border-radius: 6px;
    white-space: nowrap;
}
.btn-link-secondary:hover {
    background: var(--ubuntu-purple);
    color: #fff !important;
    text-decoration: none;
}

@media (max-width: 800px) {
    .download-result {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .result-actions {
        align-items: center;
    }
    .picker-row select {
        min-width: 100%;
    }
}
/* ---------- Страница "Все файлы" ---------- */
.files-header { margin-bottom: 25px; }

.files-section { margin-bottom: 40px; }

.files-series-title {
    color: var(--ubuntu-purple);
    border-bottom: 2px solid var(--ubuntu-orange);
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-size: 22px;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
}

.files-table thead {
    background: var(--ubuntu-purple);
    color: #fff;
}

.files-table th,
.files-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.files-table tbody tr:hover {
    background: var(--ubuntu-light);
}

.file-name code {
    background: var(--ubuntu-light);
    color: var(--ubuntu-purple);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
    word-break: break-all;
}

.file-type, .file-arch {
    color: #666;
    white-space: nowrap;
}

.file-size {
    color: #888;
    font-family: 'Ubuntu Mono', monospace;
    white-space: nowrap;
}

.file-download .btn-download-list {
    display: inline-block;
    padding: 6px 14px;
    background: var(--ubuntu-orange);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s;
}
.file-download .btn-download-list:hover {
    background: var(--ubuntu-purple);
    color: #fff !important;
    text-decoration: none;
}

@media (max-width: 700px) {
    .files-table thead { display: none; }
    .files-table tr {
        display: block;
        border: 1px solid #eee;
        border-radius: 6px;
        margin-bottom: 10px;
        padding: 10px;
    }
    .files-table td {
        display: block;
        border: none;
        padding: 4px 0;
    }
}