/* ===== News App Shared Styles ===== */

.news-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ---- Index page: row of 5 cards ---- */
.news-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

@media (max-width: 992px) {
    .news-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .news-row { grid-template-columns: 1fr; }
}

.news-card {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .2s ease, transform .2s ease;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.news-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    background: #f1f1f1;
}

.news-card-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1a1a1a;
    text-decoration: none;
}

.news-card-summary {
    font-size: 0.88rem;
    color: #555;
    flex: 1;
}

.news-card-date {
    font-size: 0.78rem;
    color: #999;
    margin-top: 10px;
}

/* ---- Pagination ---- */
.news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.news-pagination a,
.news-pagination span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
}

.news-pagination a:hover {
    background: #f0f0f0;
}

.news-pagination .current {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
    font-weight: 600;
}

.news-pagination .disabled {
    color: #bbb;
    border-color: #eee;
}

/* ---- Article blocks ---- */
.article-block {
    margin: 18px 0;
}

.block-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
    color: #111;
}

.block-small-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.block-paragraph {
    font-size: 1rem;
    line-height: 1.7;
    color: #2a2a2a;
    white-space: pre-line;
}

.block-full-image {
    width: 100%;
}

.block-full-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.block-caption {
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    margin-top: 6px;
}

.block-two-images {
    display: flex;
    gap: 16px;
}

.block-two-images .image-half {
    flex: 1 1 50%;
    width: 50%;
}

.block-two-images img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

@media (max-width: 576px) {
    .block-two-images {
        flex-direction: column;
    }
    .block-two-images .image-half {
        width: 100%;
    }
}

.block-line-break {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 28px 0;
}

.block-small-text {
    font-size: 0.85rem;
    font-style: italic;
    color: #777;
}

.block-styled-text {
    line-height: 1.6;
    white-space: pre-line;
}

/* ---- Builder page ---- */
.builder-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
}

@media (max-width: 900px) {
    .builder-layout { grid-template-columns: 1fr; }
}

.builder-preview {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 24px;
    background: #fff;
}

.builder-block-item {
    position: relative;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.builder-block-controls {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.builder-block-controls button,
.builder-block-controls a {
    font-size: 0.78rem;
    padding: 4px 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background: #fafafa;
    cursor: pointer;
}

.builder-sidebar {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 18px;
    background: #fafafa;
    position: sticky;
    top: 16px;
    align-self: start;
}

.builder-sidebar h3 {
    margin-top: 0;
}

.form-control, .form-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    background: #1a1a1a;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
}

.btn:hover { background: #333; }

.btn-secondary {
    background: #eee;
    color: #222;
}

.btn-secondary:hover { background: #ddd; }

.btn-danger {
    background: #c0392b;
}

.btn-danger:hover { background: #a93226; }
