/* News Module Styles */
/* CSS Variables are loaded dynamically from database via ViewComponent */

.news-section {
    background: var(--bg-secondary, #f8f9fa);
    padding: 4rem 0;
    position: relative;
    margin: 0;
    width: 100%;
    overflow: hidden;
}

.container-fluid {
    margin: 0;
    width: 100%;
}

/* Başlık Stili */
.news-header {
    text-align: center;
    margin-bottom: 3rem;
}

/* Başlık stilleri artık common.css'den geliyor */

.news-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: var(--text-primary, #333);
}

/* Haberler Grid */
.news-grid {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    margin-bottom: 3rem;
    margin: 0;
    padding: 0 4rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
    width: 100%;
}

.news-grid::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

/* Navigasyon stilleri artık common.css'den geliyor */

/* Haber Card */
.news-card {
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 280px;
    flex-shrink: 0;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.news-card-image {
    height: 250px;
    overflow: hidden;
    position: relative;
    background-color: #d1d1d1;
    display: flex;
    /* align-items: center; */
    justify-content: center;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Logo gösterildiğinde contain yap ve arkaplan gri, ortala */
.news-card-image img[src*="kaakademi-logo"],
.news-card-image img[src*="logos"],
.news-card-image img.logo-image {
    object-fit: contain;
    width: auto;
    height: auto;
    max-width: 80%;
    max-height: 80%;
    padding: 15px;
    background-color: #d1d1d1;
    margin: auto;
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #333);
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-description {
    color: var(--text-secondary, #666);
    font-size: 0.75rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 4.5em;
    /* 3 satır için yaklaşık yükseklik */
}

/* Haber kartı açıklamasındaki medyaları gizle */
.news-card-description img,
.news-card-description video,
.news-card-description iframe,
.news-card-description embed,
.news-card-description object {
    display: none !important;
}

/* Haber kartı açıklamasındaki diğer HTML elementlerini gizle veya sınırla */
.news-card-description figure,
.news-card-description .wp-block-image,
.news-card-description .media-wrapper {
    display: none !important;
}

/* Rich text content styles */
.news-card-description h1,
.news-card-description h2,
.news-card-description h3,
.news-card-description h4,
.news-card-description h5,
.news-card-description h6 {
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.5rem 0;
    line-height: 1.3;
}

.news-card-description p {
    margin: 0.5rem 0;
    font-size: 0.75rem;
}

.news-card-description strong,
.news-card-description b {
    font-weight: 600;
}

.news-card-description em,
.news-card-description i {
    font-style: italic;
}

.news-card-description a {
    color: var(--primary-color, #007bff);
    text-decoration: none;
}

.news-card-description a:hover {
    text-decoration: underline;
}

.news-card-description img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0.5rem 0;
}

.news-card-description ul,
.news-card-description ol {
    margin: 0.5rem 0;
    padding-left: 1rem;
}

.news-card-description li {
    margin: 0.25rem 0;
    font-size: 0.75rem;
}

.news-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.news-card-date {
    color: var(--primary-color, #007bff);
    font-size: 0.75rem;
    font-weight: 500;
}

.news-card-button {
    background: var(--primary-color, #667eea);
    color: white;
    padding: var(--btn-padding, 0.6rem 1.2rem);
    border-radius: var(--btn-border-radius, 20px);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--primary-color, #667eea);
}

.news-card-button:hover {
    background: var(--primary-dark, #5a6fd8);
    border-color: var(--primary-dark, #5a6fd8);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    color: white;
    text-decoration: none;
}

/* Tüm Haberler Butonu */
.news-footer {
    margin-top: 2rem;
    text-align: center;
}

.all-news-button {
    background: var(--footer-gradient, linear-gradient(135deg, #333 0%, #555 100%));
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.all-news-button:hover {
    background: linear-gradient(135deg, #555 0%, #333 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    color: white;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .news-section {
        padding: 2rem 0;
    }

    .news-title {
        font-size: 1.5rem;
    }

    .news-grid {
        gap: 1rem;
        padding: 0 2rem;
    }

    .news-card-content {
        padding: 1rem;
    }

    .news-card-title {
        font-size: 1rem;
    }

    .news-card-description {
        font-size: 0.75rem;
    }

    .news-card-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .news-card-button {
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .news-title-decoration {
        flex-direction: column;
        gap: 0.5rem;
    }

    .decoration-line {
        width: 40px;
    }

    .news-title {
        font-size: 1.8rem;
    }
}

/* NewsList Module - Container Size Based Sizing */
/* Bu CSS kuralları NewsList modülünün eklendiği container'ın boyutuna göre otomatik boyutlanmasını sağlar */

.news-section {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.news-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 15px !important;
    box-sizing: border-box !important;
}

.news-grid {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.news-item {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.news-item img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
}

.news-navigation {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.news-navigation .btn {
    width: auto !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Module Preview Specific Overrides */
.module-preview .news-section,
.module-preview-item .news-section {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.module-preview .news-container,
.module-preview-item .news-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 10px !important;
}

.module-preview .news-grid,
.module-preview-item .news-grid {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    gap: 15px !important;
}

.module-preview .news-item,
.module-preview-item .news-item {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.module-preview .news-item img,
.module-preview-item .news-item img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
}

.module-preview .news-navigation,
.module-preview-item .news-navigation {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.module-preview .news-navigation .btn,
.module-preview-item .news-navigation .btn {
    width: auto !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Responsive adjustments for different container sizes */
@media (max-width: 768px) {
    .news-container {
        padding: 0 10px !important;
    }

    .news-grid {
        gap: 15px !important;
    }

    .module-preview .news-container,
    .module-preview-item .news-container {
        padding: 0 5px !important;
    }
}

/* News Index Page Grid System */
.news-grid-section {
    padding: 20px 0;
    background: white;
}

/* Grid sistemini düzelt - Bootstrap grid'i bozmasın */
#newsGrid {
    margin: 0 -15px;
}

#newsGrid .news-item {
    padding: 0 15px;
    margin-bottom: 30px;
}

/* News Index Page için özel grid - flex'i override et */
.news-grid-section .news-grid {
    display: block !important;
    overflow: visible !important;
    gap: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    scroll-behavior: auto !important;
    width: auto !important;
}

/* Bootstrap grid'i düzgün çalıştır */
.news-grid-section .row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-right: -15px !important;
    margin-left: -15px !important;
}

.news-grid-section .col-lg-3,
.news-grid-section .col-md-4,
.news-grid-section .col-sm-6 {
    position: relative !important;
    width: 100% !important;
    padding-right: 15px !important;
    padding-left: 15px !important;
}

@media (min-width: 992px) {
    .news-grid-section .col-lg-3 {
        flex: 0 0 25% !important;
        /* 4 sütun */
        max-width: 25% !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .news-grid-section .col-md-4 {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .news-grid-section .col-sm-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

/* News Index Page Styles */
.news-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.news-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="white" opacity="0.1"><polygon points="0,0 1000,0 1000,100 0,80"/></svg>') no-repeat center bottom;
    background-size: cover;
}

.news-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.news-hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.news-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* News specific breadcrumb overrides */
.news-hero .breadcrumb-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    backdrop-filter: blur(10px);
}

.news-hero .breadcrumb-item {
    color: rgba(255, 255, 255, 0.8);
}

.news-hero .breadcrumb-item.active {
    color: white;
    font-weight: 500;
}

.news-hero .breadcrumb-item+.breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.6);
    content: "›";
}

.news-hero .breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-hero .breadcrumb a:hover {
    color: white;
    text-decoration: underline;
}

/* Filtreler */
.news-filters {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.filters-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 2;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-box input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--primary-color, #667eea);
    color: white;
    padding: var(--btn-padding, 0.6rem 1.2rem);
    border-radius: var(--btn-border-radius, 20px);
    border: 1px solid var(--primary-color, #667eea);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-dark, #5a6fd8);
    border-color: var(--primary-dark, #5a6fd8);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .news-hero h1 {
        font-size: 2.5rem;
    }

    .news-hero p {
        font-size: 1rem;
    }

    .filters-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .filter-buttons {
        justify-content: center;
    }

    /* Mobilde 2 sütun */
    #newsGrid .news-item {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .news-hero {
        padding: 60px 0;
    }

    .news-hero h1 {
        font-size: 2rem;
    }

    .news-hero p {
        font-size: 0.9rem;
    }
}