/* css/style.css - ПОЛНОСТЬЮ АДАПТИВНЫЙ */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
    padding-bottom: 60px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

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

a {
    text-decoration: none;
    color: #3498db;
    transition: color 0.3s;
}

a:hover { color: #2980b9; }

/* ===== HEADER ===== */
header {
    background: #2c3e50;
    color: white;
    padding: 12px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

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

.logo h1 {
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 700;
    margin: 0;
}

.logo span {
    font-size: clamp(10px, 1.5vw, 14px);
    opacity: 0.8;
    display: none;
}

/* Мобильное меню - гамбургер */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 5px 10px;
}

nav {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: clamp(13px, 1.2vw, 15px);
    transition: all 0.3s;
    white-space: nowrap;
}

nav a:hover,
nav a.active {
    background: rgba(255,255,255,0.12);
    color: white;
}

/* ===== MAIN CONTENT ===== */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.content { min-width: 0; }

/* ===== ADMIN MESSAGE ===== */
.admin-message {
    background: #e8f4fd;
    border-left: 4px solid #3498db;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.message-icon {
    font-size: 28px;
    flex-shrink: 0;
    margin-top: 2px;
}

.admin-message h3 {
    font-size: clamp(15px, 1.5vw, 18px);
    margin: 0 0 3px 0;
    color: #2c3e50;
}

.admin-message p {
    margin: 0;
    color: #555;
    font-size: clamp(13px, 1.2vw, 15px);
}

/* ===== NEWS ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    gap: 10px;
}

.section-header h2 {
    font-size: clamp(20px, 2.5vw, 26px);
    color: #2c3e50;
    margin: 0;
}

.all-link {
    color: #3498db;
    font-size: clamp(13px, 1.2vw, 15px);
}

.news-item {
    background: white;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    gap: 18px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.news-thumb {
    width: 140px;
    min-height: 90px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.news-content {
    flex: 1;
    min-width: 0;
}

.news-meta {
    display: flex;
    gap: 12px;
    font-size: clamp(11px, 1vw, 13px);
    color: #888;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.category {
    background: #e8f4fd;
    color: #3498db;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: clamp(10px, 0.9vw, 12px);
    white-space: nowrap;
}

.news-content h3 {
    font-size: clamp(16px, 1.5vw, 20px);
    margin: 0 0 5px 0;
}

.news-content h3 a {
    color: #2c3e50;
}

.news-content h3 a:hover {
    color: #3498db;
}

.news-content p {
    color: #666;
    font-size: clamp(13px, 1.1vw, 15px);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar-block {
    background: white;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.sidebar-block h3 {
    font-size: clamp(16px, 1.5vw, 18px);
    margin: 0 0 15px 0;
    color: #2c3e50;
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 10px;
}

.place-mini-card {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    align-items: center;
}

.place-mini-card:last-child {
    border-bottom: none;
}

.place-mini-card img,
.no-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.place-mini-info {
    flex: 1;
    min-width: 0;
}

.place-mini-info h4 {
    font-size: clamp(13px, 1.1vw, 15px);
    margin: 0;
}

.place-mini-info h4 a {
    color: #2c3e50;
}

.place-category {
    font-size: clamp(11px, 0.9vw, 12px);
    color: #888;
}

.mini-rating .star {
    color: #ddd;
    font-size: clamp(12px, 1vw, 14px);
}

.mini-rating .star.filled {
    color: #f1c40f;
}

.sidebar-link {
    display: block;
    text-align: center;
    color: #3498db;
    margin-top: 12px;
    font-size: clamp(13px, 1.1vw, 14px);
}

/* ===== FOOTER ===== */
footer {
    background: #2c3e50;
    color: white;
    padding: 20px 0;
    margin-top: 30px;
    text-align: center;
    font-size: clamp(12px, 1vw, 14px);
}

footer p:last-child {
    opacity: 0.7;
    font-size: clamp(10px, 0.9vw, 12px);
    margin-top: 5px;
}

/* ===== FORMS ===== */
input,
textarea,
select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: clamp(14px, 1.2vw, 16px);
    margin-bottom: 12px;
    font-family: inherit;
    transition: border-color 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

button,
.btn {
    padding: 10px 25px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: clamp(14px, 1.2vw, 16px);
    transition: background 0.3s, transform 0.1s;
    font-weight: 500;
    touch-action: manipulation;
}

button:hover,
.btn:hover {
    background: #2980b9;
}

button:active,
.btn:active {
    transform: scale(0.97);
}

button.green { background: #27ae60; }
button.green:hover { background: #219a52; }
button.orange { background: #f39c12; }
button.orange:hover { background: #d68910; }
button.red { background: #e74c3c; }
button.red:hover { background: #c0392b; }

/* ===== COMMENTS ===== */
.comments-section {
    margin-top: 30px;
    background: white;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.comment {
    padding: 12px 0;
    border-bottom: 1px solid #f0f2f5;
}

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

.comment-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px;
    font-size: clamp(13px, 1vw, 14px);
    color: #888;
    margin-bottom: 3px;
}

.comment-header strong {
    color: #2c3e50;
}

.comment p {
    margin: 0;
    font-size: clamp(14px, 1.1vw, 15px);
}

.comment-form textarea {
    min-height: 80px;
}

/* ===== АДАПТИВНЫЕ БЛОКИ ===== */

/* Планшеты и маленькие ноутбуки */
@media (max-width: 1024px) {
    .main-grid {
        gap: 20px;
    }
    
    .news-thumb {
        width: 120px;
        height: 85px;
    }
}

/* Телефоны в горизонтальной ориентации и планшеты */
@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Гамбургер-меню */
    .menu-toggle {
        display: block;
    }
    
    nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px 0;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    nav.open {
        display: flex;
    }
    
    nav a {
        padding: 12px 15px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        white-space: normal;
        font-size: 15px;
    }
    
    .news-item {
        flex-direction: column;
        padding: 15px;
    }
    
    .news-thumb {
        width: 100%;
        height: 180px;
        min-height: 150px;
    }
    
    .admin-message {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 15px;
    }
    
    .sidebar-block {
        padding: 15px;
    }
}

/* Маленькие телефоны */
@media (max-width: 480px) {
    header .container {
        padding: 0 10px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .news-thumb {
        height: 150px;
    }
    
    .news-item {
        padding: 12px;
        border-radius: 8px;
    }
    
    .comments-section {
        padding: 15px;
    }
    
    input,
    textarea,
    select {
        font-size: 16px; /* Предотвращает зум на iOS */
        padding: 12px 14px;
    }
    
    button,
    .btn {
        width: 100%;
        padding: 14px;
        font-size: 16px;
        text-align: center;
    }
    
    .admin-message {
        padding: 12px;
        border-left-width: 3px;
    }
    
    .message-icon {
        font-size: 24px;
    }
    
    .place-mini-card {
        padding: 8px 0;
    }
    
    .place-mini-card img,
    .no-logo {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Очень маленькие экраны (до 360px) */
@media (max-width: 360px) {
    .logo h1 {
        font-size: 17px;
    }
    
    .news-thumb {
        height: 120px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== ДЛЯ ТАЧ-УСТРОЙСТВ ===== */
@media (hover: none) and (pointer: coarse) {
    /* Увеличиваем тач-области */
    a,
    button,
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    nav a {
        padding: 12px 16px;
    }
    
    /* Убираем hover-эффекты на тач-устройствах */
    .news-item:hover {
        transform: none;
    }
    
    .place-card:hover {
        transform: none;
    }
}

/* ===== АНИМАЦИИ ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.news-item,
.place-mini-card,
.comment {
    animation: fadeIn 0.3s ease-out;
}

/* ===== SKELETON LOADING (для кеша) ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f2f5 25%, #e0e2e5 50%, #f0f2f5 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.file-upload-wrapper {
    margin-bottom: 15px;
}

.file-upload-area {
    display: block;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px dashed #ddd;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    color: #555;
    font-size: 15px;
}

.file-upload-area:hover {
    border-color: #3498db;
    background: #e8f4fd;
}

.file-upload-area span {
    pointer-events: none; /* чтобы клик проходил на область */
}