/**
 * News Aggregator Blocks - Frontend Styles
 */

/* ============================================
   News Hero Block
   ============================================ */
.news-hero {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 40px;
}

.news-hero__item {
    display: grid;
    grid-template-columns: 0.75fr 1.25fr;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.news-hero__item:nth-child(even) {
    grid-template-columns: 1.25fr 0.75fr;
}

.news-hero__item:nth-child(even) .news-hero__image {
    order: 2;
}

.news-hero__image {
    position: relative;
    overflow: hidden;
    height: 100%;
}

.news-hero__image-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-hero__item:hover .news-hero__image-main {
    transform: scale(1.05);
}

.news-hero__image-logo {
    position: absolute;
    top: 10px;
    right: 10px;
    height: 14px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    filter: brightness(0) invert(1)
        drop-shadow(0 0 1px rgba(0,0,0,1))
        drop-shadow(0 0 2px rgba(0,0,0,0.8));
}

.news-hero__content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-hero__title {
    margin: 0 0 10px;
    font-size: 25px;
    line-height: 1.3;
    font-weight: 500;
}

.news-hero__title a {
    text-decoration: none;
}

.news-hero__title a:hover {
    color: var(--wp--preset--color--contrast);
}

.news-hero__meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.news-hero__date,
.news-hero__source {
    display: inline-flex;
    align-items: center;
}

.news-hero__source::after {
    content: '•';
    margin-left: 10px;
    color: #ccc;
}

.news-hero__meta > *:last-child.news-hero__source::after {
    content: none;
    margin-left: 0;
}

.news-hero__source-logo {
    height: 12px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    vertical-align: middle;
    margin-top: 4px;
}

.news-hero__excerpt {
    font-size: 15px;
    line-height: 1.5;
    color: #444;
}

.news-hero__link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-weight: 600;
}

.news-hero__link:hover {
    color: var(--wp--preset--color--contrast);
}

/* Responsive */
@media (max-width: 768px) {
    .news-hero__item {
        grid-template-columns: 1fr;
    }

    .news-hero__item:nth-child(even) {
        grid-template-columns: 1fr;
    }

    .news-hero__image {
        order: 1;
        aspect-ratio: 16/9;
    }

    .news-hero__content {
        order: 2;
        padding: 20px;
    }

    .news-hero__title {
        font-size: 22px;
    }
}

/* ============================================
   News Grid Block
   ============================================ */
.news-grid {
    width: 100%;
    max-width: 100%;
    display: grid;
    gap: var(--wp--style--block-gap, 30px);
    margin-bottom: 40px;
}

.news-grid--cols-1 { grid-template-columns: 1fr; }
.news-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.news-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.news-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

.news-grid__item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}

.news-grid__item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.news-grid__image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.news-grid__image-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-grid__item:hover .news-grid__image-main {
    transform: scale(1.05);
}

.news-grid__image-logo {
    position: absolute;
    top: 8px;
    right: 8px;
    height: 14px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
    filter: brightness(0) invert(1)
        drop-shadow(0 0 1px rgba(0,0,0,1))
        drop-shadow(0 0 2px rgba(0,0,0,0.8));
}

.news-grid__content {
    padding: 15px;
}

.news-grid__title {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 400;
}

.news-grid__title a {
    text-decoration: none;
}

.news-grid__title a:hover {
    color: var(--wp--preset--color--contrast);
}

.news-grid__meta {
    display: flex;
    flex-wrap: wrap;
    column-gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
}

.news-grid__date {
    color: #666;
}

.news-grid__source {
    color: #666;
}

.news-grid__source::after {
    content: '•';
    margin-left: 10px;
    color: #ccc;
}

.news-grid__meta > *:last-child.news-grid__source::after {
    content: none;
    margin-left: 0;
}

.news-grid__source-logo {
    height: 10px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
    vertical-align: middle;
    margin-top: 4px;
}

.news-grid__excerpt {
    font-size: 15px;
    line-height: 1.5;
    color: #444;
}

.news-grid__link {
    display: inline-block;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.news-grid__link:hover {
    color: var(--wp--preset--color--contrast);
}

/* Responsive */
@media (max-width: 1024px) {
    .news-grid--cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .news-grid--cols-3,
    .news-grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
    .news-grid__image { aspect-ratio: 16/9; }
}

@media (max-width: 480px) {
    .news-grid { grid-template-columns: 1fr; }
    .news-grid__image { aspect-ratio: 16/9; }
}

/* ============================================
   News List Block
   ============================================ */
.news-list-wrapper {
    width: 100%;
    max-width: 100%;
    margin-bottom: 40px;
}

.news-list__headline {
    margin: 0 0 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

.news-list__headline + .news-list__item {
    padding-top: 15px;
}

.news-list {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.news-list__item {
    display: flex;
    gap: 20px;
    padding: 15px 0;
    transition: opacity 0.2s ease;
}

.news-list__item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.news-list__item:hover {
    opacity: 0.85;
}

.news-list__image {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
}

.news-list__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-list__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-list__title {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 400;
}

.news-list__title a {
    text-decoration: none;
}

.news-list__title a:hover {
    color: var(--wp--preset--color--contrast);
}

.news-list__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
}

.news-list__date {
    color: #666;
}

.news-list__source {
    color: #666;
}

.news-list__source::after {
    content: '•';
    margin-left: 10px;
    color: #ccc;
}

.news-list__meta > *:last-child.news-list__source::after {
    content: none;
    margin-left: 0;
}
.news-list__source-logo {
    height: 12px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
    vertical-align: middle;
}
.news-list__excerpt {
    font-size: 13px;
    line-height: 1.4;
    color: #444;
}

/* Archive Link Button */
.news-list-wrapper .wp-block-button {
    margin-top: 20px;
}

/* Compact Mode */
.news-list--compact {
    box-sizing: border-box;
    padding: 15px;
}

.news-list--compact .news-list__item {
    padding: 10px 0;
    gap: 15px;
}

.news-list--compact .news-list__title {
    font-size: 15px;
    margin-bottom: 5px;
}

.news-list--compact .news-list__date {
    font-size: 11px;
}

/* Responsive */
@media (max-width: 480px) {
    .news-list__item {
        flex-direction: column;
    }

    .news-list__image {
        width: 100%;
        height: 150px;
    }
}

/* ============================================
   Empty State
   ============================================ */
.news-aggregator-empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 4px;
}

/* ============================================
   Admin Edit Links (für alle Blöcke)
   ============================================ */
.news-block__edit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #666;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.2s ease;
    margin-left: auto;
}

.news-block__edit-link:hover {
    color: #2271b1;
    background-color: rgba(34, 113, 177, 0.1);
}

.news-block__edit-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}
