/* Homepage Styles - Medical Theme */
/* Clean, professional design with cyan/teal accents */

/* Main Container */
.main-container {
    display: flex;
    margin: 0 auto;
    gap: 20px;
    padding: 0 15px;
    box-sizing: border-box;
    max-width: 1200px;
}

.content {
    flex: 1;
    overflow: hidden;
    background-color: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.08);
    border: 1px solid rgba(8, 145, 178, 0.1);
}

/* Carousel Styles */
.articles-carousel-section {
    width: 100%;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.carousel-wrapper {
    overflow: hidden;
    width: 100%;
    border-radius: 16px;
    border: 2px solid rgba(8, 145, 178, 0.15);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
}

.carousel-card {
    display: block;
    position: relative;
    width: 100%;
    height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.carousel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
    transition: background 0.3s ease;
}

.carousel-card:hover::before {
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.8) 100%);
}

.carousel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    color: white;
    z-index: 1;
}

.carousel-content h3 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 15px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.carousel-content p {
    font-size: 1.1em;
    margin-bottom: 15px;
    opacity: 0.95;
    line-height: 1.5;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.carousel-meta {
    display: flex;
    gap: 15px;
    align-items: center;
}

.carousel-date,
.carousel-category {
    background-color: rgba(8, 145, 178, 0.9);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.95);
    border: 2px solid rgba(8, 145, 178, 0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.8em;
    color: #0891b2;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.15);
}

.carousel-btn:hover {
    background: #0891b2;
    color: white;
    border-color: #0891b2;
    transform: translateY(-50%) scale(1.05);
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(8, 145, 178, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background-color: #0891b2;
    width: 28px;
    border-radius: 5px;
}

.carousel-dot:hover {
    background-color: rgba(8, 145, 178, 0.5);
}

/* Section Labels - Medical Style */
.hot-label,
.fresh-label,
.news-label {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: #fff;
    text-align: center;
    padding: 14px 0;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 25px;
    max-width: 80%;
    margin: 0 auto 25px auto;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.25);
    font-family: 'Inter', system-ui, sans-serif;
    letter-spacing: 0.5px;
}

.hot-label {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.news-label {
    background: linear-gradient(135deg, #0e7490, #0891b2);
    box-shadow: 0 4px 12px rgba(14, 116, 144, 0.25);
}

/* Fresh Articles */
.fresh-articles {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px 0;
    margin-bottom: 30px;
    max-width: 80%;
    margin: 0 auto;
}

.fresh-article {
    flex: 1 1 calc(33.333% - 40px);
    min-width: 280px;
    border: 1px solid rgba(8, 145, 178, 0.15);
    border-radius: 16px;
    overflow: hidden;
    background-color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.08);
}

.fresh-article:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(8, 145, 178, 0.15);
    border-color: rgba(8, 145, 178, 0.3);
}

.fresh-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.fresh-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
}

.fresh-content {
    padding: 15px;
    text-align: left;
}

.fresh-title {
    font-size: 1.25em;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    color: #134e4a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.fresh-summary {
    font-size: 0.95em;
    color: #7f8c8d;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

.fresh-time {
    font-size: 0.85em;
    color: #95a5a6;
    margin-top: 5px;
}

/* Featured/Hot Articles */
.featured-articles {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px 0;
    margin-bottom: 30px;
    max-width: 80%;
    margin: 0 auto;
}

.featured-article {
    flex: 1 1 calc(33.333% - 40px);
    min-width: 280px;
    border: 1px solid rgba(8, 145, 178, 0.15);
    border-radius: 16px;
    overflow: hidden;
    background-color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.08);
}

.featured-article:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(8, 145, 178, 0.15);
    border-color: rgba(8, 145, 178, 0.3);
}

.featured-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.featured-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
}

.featured-content {
    padding: 15px;
    text-align: left;
}

.featured-title {
    font-size: 1.25em;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    color: #134e4a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.featured-summary {
    font-size: 0.95em;
    color: #7f8c8d;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

.featured-date {
    font-size: 0.85em;
    color: #95a5a6;
}

/* News List - Grid Layout */
.news-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 80%;
    margin: 0 auto;
    padding: 0;
}

.news-item-list {
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 1px solid rgba(8, 145, 178, 0.15);
    border-radius: 16px;
    background-color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.08);
    height: 100%;
}

.news-item-list:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(8, 145, 178, 0.15);
    border-color: rgba(8, 145, 178, 0.3);
}

.news-link-list {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
}

.news-image-list {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

.news-content-list {
    flex: 1;
    min-width: 0;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.news-title-list {
    font-size: 1.15em;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    color: #134e4a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-summary-list {
    font-size: 0.95em;
    color: #7f8c8d;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

.news-date-list {
    font-size: 0.85em;
    color: #95a5a6;
}

.news-grid-mobile {
    display: none;
}

/* Ad Sidebar - Medical Style */
.ad-sidebar {
    margin-top: 15px;
    width: 300px;
    flex-shrink: 0;
    overflow-y: auto;
    height: calc(100vh - 100px);
    position: sticky;
    top: 80px;
    background-color: #fff;
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.08);
    border: 1px solid rgba(8, 145, 178, 0.1);
}

.ad-banner {
    margin-bottom: 20px;
}

.ad-banner img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
}

/* Tablet Styles - 2 columns */
@media (max-width: 1024px) and (min-width: 769px) {
    .news-list {
        grid-template-columns: repeat(2, 1fr);
        max-width: 90%;
    }

    .featured-articles,
    .fresh-articles {
        max-width: 90%;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        padding: 0 10px;
    }

    .content {
        padding: 15px;
    }

    .ad-sidebar {
        display: none;
    }

    .carousel-card {
        height: 300px;
    }

    .carousel-content h3 {
        font-size: 1.5em;
    }

    .carousel-content p {
        font-size: 0.95em;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5em;
    }

    .carousel-prev {
        left: 10px;
    }

    .carousel-next {
        right: 10px;
    }

    .hot-label,
    .fresh-label,
    .news-label {
        max-width: 100%;
        padding: 12px 15px;
        font-size: 1.1em;
        margin: 0 0 20px 0;
    }

    .news-list {
        display: none; /* Hide on mobile, use mobile view instead */
    }

    .news-grid-mobile {
        display: grid;
        grid-template-columns: 1fr;
        height: auto;
        max-width: 100%;
        margin-left: 10px;
        margin-right: 10px;
        margin-top: 20px;
        visibility: visible;
    }

    .news-item-mobile {
        display: flex;
        align-items: flex-start;
        height: auto;
        padding: 12px;
        box-sizing: border-box;
        gap: 12px;
        margin-top: 10px;
        position: relative;
        border: 1px solid rgba(8, 145, 178, 0.15);
        border-radius: 12px;
        background-color: #fff;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        box-shadow: 0 2px 8px rgba(8, 145, 178, 0.08);
    }

    .news-item-mobile:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(8, 145, 178, 0.15);
    }

    .news-separator {
        border: 0;
        height: 1px;
        background-color: #ecf0f1;
        margin: 10px 0;
    }

    .news-link-mobile {
        display: flex;
        gap: 12px;
        text-decoration: none;
        color: inherit;
        width: 100%;
    }

    .news-image-mobile {
        width: 35vw;
        height: 35vw;
        aspect-ratio: 1 / 1;
        flex-shrink: 0;
        object-fit: cover;
        border-radius: 8px;
    }

    .news-content-mobile {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .news-title-mobile {
        background-color: transparent;
        color: #2c3e50;
        font-weight: 600;
        padding: 0;
        text-align: left;
        font-size: 16px;
        margin-bottom: 5px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.3;
    }

    .news-date-mobile {
        background-color: rgba(8, 145, 178, 0.9);
        color: #fff;
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        position: absolute;
        right: 10px;
        bottom: 10px;
    }

    .featured-articles,
    .fresh-articles {
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
        gap: 15px;
    }

    .featured-article,
    .fresh-article {
        flex: 1 1 100%;
        min-width: 100%;
        margin-bottom: 15px;
    }

    .featured-image,
    .fresh-image {
        height: 150px;
    }

    .featured-title,
    .fresh-title {
        font-size: 1.1em;
    }

    .featured-summary,
    .fresh-summary {
        font-size: 0.9em;
    }

    .featured-date,
    .fresh-time {
        font-size: 0.8em;
    }
}

/* Pagination Styles */
.pagination {
    margin: 20px 0;
    text-align: center;
    display: flex;
    justify-content: center;
}

.pagination ul {
    list-style: none;
    padding: 0;
    display: inline-block;
}

.pagination ul li {
    display: inline;
    margin: 0 5px;
}

.pagination ul li a,
.pagination ul li span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid rgba(8, 145, 178, 0.3);
    border-radius: 20px;
    text-decoration: none;
    color: #134e4a;
    background-color: #fff;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination ul li a:hover {
    background-color: #0891b2;
    color: #fff;
    border-color: #0891b2;
}

.pagination ul li.active span {
    background-color: #0891b2;
    color: #fff;
    border-color: #0891b2;
    font-weight: 600;
}

.pagination ul li.disabled span {
    color: rgba(8, 145, 178, 0.3);
    border-color: rgba(8, 145, 178, 0.15);
    cursor: not-allowed;
    font-weight: 500;
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .carousel-card {
        height: 250px;
    }

    .carousel-content {
        padding: 20px;
    }

    .carousel-content h3 {
        font-size: 1.2em;
    }

    .carousel-content p {
        font-size: 0.85em;
        -webkit-line-clamp: 2;
    }

    .carousel-meta {
        font-size: 0.8em;
    }

    .news-image-mobile {
        width: 30vw;
        height: 30vw;
    }

    .news-title-mobile {
        font-size: 14px;
    }

    .featured-title,
    .fresh-title {
        font-size: 1em;
    }

    .featured-summary,
    .fresh-summary {
        font-size: 0.85em;
    }
}

/* Very small devices (старые iPhone SE, Galaxy S5) */
@media (max-width: 375px) {
    .main-container {
        padding: 0 5px;
    }

    .content {
        padding: 10px;
    }

    .carousel-card {
        height: 220px;
    }

    .carousel-content {
        padding: 15px;
    }

    .carousel-content h3 {
        font-size: 1em;
        line-height: 1.2;
    }

    .carousel-content p {
        font-size: 0.8em;
        -webkit-line-clamp: 1;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .hot-label,
    .fresh-label,
    .news-label {
        font-size: 1em;
        padding: 10px;
    }

    .news-image-mobile {
        width: 25vw;
        height: 25vw;
        min-width: 80px;
        min-height: 80px;
    }

    .news-title-mobile {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }

    .news-item-mobile {
        padding: 8px;
        gap: 8px;
    }
}

@media (min-width: 769px) {
    .mobile-ad {
        display: none;
    }
}
