/* Frontend Styles for RSS News Logger */

/* Container */
.rnl-news-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.rnl-news-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.rnl-news-col {
    padding: 0 15px;
    margin-bottom: 30px;
    box-sizing: border-box;
}

/* Column widths */
.rnl-col-1 { width: 100%; }
.rnl-col-2 { width: 50%; }
.rnl-col-3 { width: 33.333%; }
.rnl-col-4 { width: 25%; }

/* Card Layout */
.rnl-news-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.rnl-news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.rnl-card-image {
    position: relative;
    overflow: hidden;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #f5f5f5;
}

.rnl-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.rnl-news-card:hover .rnl-card-image img {
    transform: scale(1.05);
}

.rnl-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rnl-card-categories {
    margin-bottom: 10px;
}

.rnl-card-category {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rnl-card-title {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.4;
}

.rnl-card-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.rnl-card-title a:hover {
    color: #2271b1;
}

.rnl-card-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #666;
}

.rnl-card-date, .rnl-card-author {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rnl-card-excerpt {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.rnl-card-readmore {
    display: inline-block;
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s;
}

.rnl-card-readmore:hover {
    color: #135e96;
}

/* Grid Layout */
.rnl-layout-grid .rnl-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.rnl-grid-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.rnl-grid-image {
    overflow: hidden;
}

.rnl-grid-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s;
}

.rnl-grid-item:hover .rnl-grid-image img {
    transform: scale(1.05);
}

.rnl-grid-content {
    padding: 15px;
}

.rnl-grid-category {
    font-size: 11px;
    color: #2271b1;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
}

.rnl-grid-title {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.4;
}

.rnl-grid-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.rnl-grid-title a:hover {
    color: #2271b1;
}

.rnl-grid-date {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.rnl-grid-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* List Layout */
.rnl-layout-list .rnl-news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rnl-list-item {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rnl-list-image {
    flex-shrink: 0;
    width: 120px;
}

.rnl-list-image img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.rnl-list-content {
    flex: 1;
}

.rnl-list-title {
    margin: 0 0 8px;
    font-size: 16px;
}

.rnl-list-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.rnl-list-title a:hover {
    color: #2271b1;
}

.rnl-list-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.rnl-list-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* Carousel Layout */
.rnl-carousel-container {
    position: relative;
    overflow: hidden;
    margin: 20px 0;
}

.rnl-carousel-wrapper {
    position: relative;
    overflow: hidden;
}

.rnl-carousel-track {
    display: flex;
    transition: transform 0.5s ease;
    gap: 20px;
}

.rnl-carousel-slide {
    flex: 0 0 calc(33.333% - 14px);
    min-width: 0;
}

.rnl-carousel-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    height: 100%;
}

.rnl-carousel-image {
    overflow: hidden;
}

.rnl-carousel-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.rnl-carousel-content {
    padding: 15px;
}

.rnl-carousel-date {
    font-size: 11px;
    color: #999;
    margin-bottom: 8px;
}

.rnl-carousel-title {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.4;
}

.rnl-carousel-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.rnl-carousel-title a:hover {
    color: #2271b1;
}

.rnl-carousel-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.rnl-carousel-prev,
.rnl-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
    transition: background 0.3s;
}

.rnl-carousel-prev:hover,
.rnl-carousel-next:hover {
    background: rgba(0,0,0,0.8);
}

.rnl-carousel-prev {
    left: 10px;
}

.rnl-carousel-next {
    right: 10px;
}

.rnl-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.rnl-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.3s;
}

.rnl-carousel-dot.active {
    background: #2271b1;
}

/* No news */
.rnl-no-news {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
}

/* Responsive */
@media (max-width: 992px) {
    .rnl-col-3, .rnl-col-4 { width: 50%; }
    .rnl-carousel-slide { flex: 0 0 calc(50% - 10px); }
}

@media (max-width: 768px) {
    .rnl-col-2, .rnl-col-3, .rnl-col-4 { width: 100%; }
    .rnl-list-item { flex-direction: column; }
    .rnl-list-image { width: 100%; }
    .rnl-list-image img { height: 200px; }
    .rnl-carousel-slide { flex: 0 0 100%; }
    .rnl-carousel-prev, .rnl-carousel-next { display: none; }
}