/* ============================================================
   Республика МСУ — публичный портал (resources/views/welcome.blade.php)
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    background-color: #f5f7fa;
    color: #1a2c3e;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

.header {
    background: #ffffff;
    border-bottom: 3px solid #c7a12b;
    padding: 16px 0;
    position: relative;
}
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c7a12b, #8b6914, #c7a12b);
}
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.brand-area { flex: 1; }
.title-main {
    font-size: 1.4rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.logo-svg {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}
.title-main span {
    background: #c7a12b;
    color: #1a2c3e;
    padding: 2px 12px;
    font-weight: 900;
    font-size: 1.2rem;
    clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%);
}
.subhead {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
    color: #5a6874;
    border-left: 2px solid #c7a12b;
    padding-left: 10px;
    font-weight: 600;
}
.admin-link {
    background: transparent;
    border: 1.5px solid #c7a12b;
    padding: 6px 14px;
    color: #1a2c3e;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    border-radius: 40px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-section {
    background: #ffffff;
    border-bottom: 1px solid #e4e8ed;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-links {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 2px;
    padding: 8px 0;
    scrollbar-width: thin;
}
.nav-links::-webkit-scrollbar { height: 3px; }
.nav-btn {
    background: transparent;
    border: none;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 8px 16px;
    cursor: pointer;
    color: #4a5a68;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.nav-btn.active { color: #c7a12b; border-bottom-color: #c7a12b; }

.main-content { padding: 24px 0 48px; min-height: 70vh; }
.section { display: none; animation: fadeIn 0.3s ease; }
.section.active-section { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: translateY(0);} }
.section-header {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid #c7a12b;
    padding-left: 14px;
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) {
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
    .container { padding: 0 24px; }
}
.card {
    background: #ffffff;
    border: 1px solid #e4e8ed;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    scroll-margin-top: 80px;
    cursor: pointer;
}
.card:target {
    border-color: #c7a12b;
    box-shadow: 0 0 0 3px rgba(199, 161, 43, 0.3);
    animation: highlight 1s ease;
}
@keyframes highlight {
    0% { background: rgba(199, 161, 43, 0.2); }
    100% { background: transparent; }
}
.card:hover {
    border-color: #c7a12b;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.card-body { padding: 18px; flex: 1; }
.card-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #1a2c3e;
    line-height: 1.3;
    padding-right: 70px;
}
.card-date {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #7a8894;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #eef2f6;
    padding-bottom: 8px;
    flex-wrap: wrap;
}
.card-text { color: #4a5a68; line-height: 1.5; margin-bottom: 16px; font-size: 0.85rem; }
.card-text.clamped {
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.read-more-btn {
    display: inline-block;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 16px;
    color: #c7a12b;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
}
.read-more-btn:hover { text-decoration: underline; }

.copy-link-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f5f7fa;
    border: 1px solid #e4e8ed;
    border-radius: 40px;
    padding: 6px 12px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #4a5a68;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
}
.copy-link-btn:hover { background: #c7a12b; color: #1a2c3e; border-color: #c7a12b; }

.media-content {
    margin: 12px 0;
    background: #f5f7fa;
    border: 1px solid #e4e8ed;
    text-align: center;
    border-radius: 16px;
    overflow: hidden;
}
.media-content img { max-width: 100%; max-height: 180px; object-fit: cover; display: block; margin: 0 auto; }
.media-content iframe { width: 100%; height: 180px; border: none; }

.pdf-preview-container {
    width: 100%;
    background: #f5f7fa;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}
.pdf-preview-container canvas {
    display: block;
    width: 100%;
    height: auto;
    background: #fff;
}
.pdf-preview-container .pdf-fallback {
    padding: 20px;
    text-align: center;
    color: #4a5a68;
    font-size: 0.85rem;
}
.pdf-preview-container .pdf-fallback a {
    color: #c7a12b;
    font-weight: 700;
    text-decoration: none;
}

.badge {
    background: #f5f7fa;
    padding: 4px 12px;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #c7a12b;
    display: inline-block;
    border-left: 3px solid #c7a12b;
    border-radius: 0 30px 30px 0;
}
.ulus-badge, .nasleg-badge {
    background: #f5f7fa;
    padding: 2px 8px;
    font-size: 0.55rem;
    font-weight: 700;
    color: #c7a12b;
    margin-left: 6px;
    border-radius: 30px;
}
.nasleg-badge {
    background: #eef2f6;
    color: #4a5a68;
}

.share-single {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    margin-top: 16px;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    background: #1a2c3e;
    color: white;
    border: none;
    transition: all 0.2s;
    width: 100%;
}
.share-single:hover { background: #c7a12b; color: #1a2c3e; }

.share-modal, .item-modal, .pdf-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s;
}
.share-modal.active, .item-modal.active, .pdf-viewer-modal.active {
    visibility: visible;
    opacity: 1;
}
.share-modal-content {
    background: white;
    border-radius: 28px;
    max-width: 320px;
    width: 90%;
    padding: 20px;
    text-align: center;
}
.item-modal-content {
    background: white;
    border-radius: 28px;
    max-width: 700px;
    width: 92%;
    max-height: 90vh;
    padding: 24px;
    position: relative;
    overflow-y: auto;
    margin: 20px;
}
.item-modal-content .card {
    border: none;
    box-shadow: none;
    cursor: default;
    padding: 0;
}
.item-modal-content .card .copy-link-btn {
    position: absolute;
    top: 0;
    right: 0;
}
.item-modal-content .card .card-title {
    font-size: 1.8rem;
    padding-right: 0;
}
.item-modal-content .card .card-text {
    font-size: 1rem;
}
.item-modal-content .card .media-content img {
    max-height: 400px;
}
.item-modal-content .card .media-content iframe {
    height: 400px;
}
.item-modal-close {
    position: sticky;
    top: 0;
    float: right;
    background: #f5f7fa;
    border: none;
    font-size: 2rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    color: #1a2c3e;
    transition: 0.2s;
    z-index: 10;
    margin-bottom: 10px;
}
.item-modal-close:hover {
    background: #c7a12b;
    color: white;
}

.pdf-viewer-modal-content {
    background: #ffffff;
    border-radius: 28px;
    max-width: 900px;
    width: 92%;
    max-height: 90vh;
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
}
.pdf-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #e4e8ed;
    flex-shrink: 0;
}
.pdf-viewer-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #1a2c3e;
}
.pdf-viewer-header .pdf-viewer-actions {
    display: flex;
    gap: 10px;
}
.pdf-viewer-header .pdf-viewer-actions button {
    background: #f5f7fa;
    border: 1px solid #e4e8ed;
    border-radius: 40px;
    padding: 6px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.7rem;
    transition: 0.2s;
}
.pdf-viewer-header .pdf-viewer-actions button:hover {
    background: #c7a12b;
    color: white;
}
.pdf-viewer-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #1a2c3e;
    line-height: 1;
    padding: 0 8px;
}
.pdf-viewer-close:hover {
    color: #c7a12b;
}
.pdf-viewer-pages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.pdf-viewer-pages canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    background: white;
}
.pdf-viewer-loading {
    padding: 40px;
    text-align: center;
    color: #7a8894;
}

.contacts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}
.contacts-card {
    background: #ffffff;
    border: 1px solid #e4e8ed;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: 0.2s;
}
.contacts-card:hover {
    border-color: #c7a12b;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.contacts-card .icon {
    font-size: 2rem;
    color: #c7a12b;
    width: 50px;
    text-align: center;
    flex-shrink: 0;
}
.contacts-card .info {
    flex: 1;
}
.contacts-card .info .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #7a8894;
    font-weight: 600;
}
.contacts-card .info .value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a2c3e;
    margin-top: 2px;
}
.contacts-card .info .value a {
    color: inherit;
    text-decoration: none;
}
.contacts-card .info .value a:hover {
    color: #c7a12b;
}

.share-buttons-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
.share-modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    border-radius: 50px;
    border: 1px solid #e4e8ed;
    background: #f5f7fa;
    cursor: pointer;
    font-weight: 600;
}
.share-modal-btn.vk:hover { background: #0077FF; color: white; }
.share-modal-btn.max:hover { background: #007AFF; color: white; }
.share-modal-btn.mail:hover { background: #007AFF; color: white; }
.share-modal-btn.copy:hover { background: #c7a12b; color: white; }
.share-modal-close {
    background: #e4e8ed;
    border: none;
    padding: 8px;
    border-radius: 40px;
    width: 100%;
    cursor: pointer;
    font-weight: 600;
}

.mail-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s;
}
.mail-dialog.active { visibility: visible; opacity: 1; }
.mail-dialog-content {
    background: white;
    border-radius: 28px;
    max-width: 420px;
    width: 90%;
    padding: 20px;
}
.mail-dialog-content textarea {
    width: 100%;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid #e4e8ed;
    font-family: monospace;
    font-size: 0.7rem;
    margin-bottom: 12px;
    resize: vertical;
    background: #f5f7fa;
}
.mail-dialog-buttons { display: flex; gap: 10px; justify-content: flex-end; }
.mail-dialog-buttons button { padding: 8px 16px; border-radius: 40px; border: none; font-weight: 600; cursor: pointer; }
.btn-copy-mail { background: #c7a12b; color: #1a2c3e; }
.btn-close-mail { background: #e4e8ed; color: #1a2c3e; }

.search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    background: #ffffff;
    padding: 12px;
    border: 1px solid #e4e8ed;
    border-radius: 20px;
    align-items: center;
}
.search-bar input[type="text"],
.search-bar input[type="date"] {
    padding: 8px 14px;
    border-radius: 30px;
    border: 1px solid #e4e8ed;
    font-family: inherit;
    background: #f5f7fa;
    font-size: 0.8rem;
    color: #1a2c3e;
}
.search-bar input[type="text"] { flex: 1; min-width: 180px; }
.search-bar button { border: none; }

.filter-nav-buttons {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    margin-bottom: 20px;
    background: #ffffff;
    padding: 10px 12px;
    border: 1px solid #e4e8ed;
    border-radius: 60px;
}
.filter-btn {
    background: #f5f7fa;
    border: 1px solid #e4e8ed;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #4a5a68;
    cursor: pointer;
    border-radius: 40px;
    white-space: nowrap;
}
.filter-btn.active-filter { background: #c7a12b; color: #1a2c3e; }

.pagination-nav { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 30px 0; }
.page-link {
    background: #ffffff;
    border: 1px solid #e4e8ed;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.8rem;
    color: #4a5a68;
    text-decoration: none;
    border-radius: 40px;
}
.page-link.active { background: #c7a12b; color: #1a2c3e; border-color: #c7a12b; }
.page-link.disabled { opacity: 0.4; pointer-events: none; }
.page-ellipsis { padding: 8px 4px; color: #7a8894; }

.toast-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a2c3e;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    text-align: center;
}
.toast-message.show { opacity: 1; }

.footer {
    background: #1a2c3e;
    color: #a0b0bc;
    border-top: 3px solid #c7a12b;
    padding: 24px 0;
    text-align: center;
    font-size: 0.65rem;
    text-transform: uppercase;
}
@media (min-width: 768px) {
    .title-main { font-size: 2rem; }
    .title-main span { font-size: 1.6rem; }
    .logo-svg { width: 56px; height: 56px; }
    .share-single { width: auto; }
    .item-modal-content .card .card-title { font-size: 2.2rem; }
    .pdf-viewer-modal-content { max-width: 1000px; }
}
@media (max-width: 480px) {
    .card-title { font-size: 1rem; padding-right: 55px; }
    .copy-link-btn { padding: 4px 8px; font-size: 0.55rem; }
    .logo-svg { width: 36px; height: 36px; }
    .item-modal-content { padding: 16px; }
    .pdf-viewer-modal-content { padding: 12px; }
    .contacts-card .info .value { font-size: 1rem; }
}
