@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Display:wght@300;400;500;600;700&display=swap');

/* This stylesheet only styles the .cms-page content — the shared
   navbar/footer chrome comes from index.css, loaded before this file. */

/* ── Content Grid Page ── */
.cms-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 140px 24px 80px;
    font-family: "Red Hat Display", 'Poppins', sans-serif;
    background-color: #f9fafb;
    color: #111827;
}

.cms-page img {
    display: block;
    max-width: 100%;
}

.cms-page button {
    font-family: inherit;
}

.cms-page a {
    text-decoration: none;
    color: inherit;
}

.cms-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 40px;
}

.cms-header-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cms-header h1 {
    font-size: 2.1rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
}

.cms-active-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eef2ff;
    color: #1b4965;
    font-size: 0.83rem;
    font-weight: 500;
    padding: 5px 13px;
    border-radius: 20px;
    width: fit-content;
}

.cms-clear-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #1b4965;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    width: 16px;
    height: 16px;
    transition: color 0.15s;
}

.cms-clear-tag:hover {
    color: #1b4965;
}

.cms-filter {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 0.92rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #374151;
    font-family: inherit;
}

.cms-filter:focus {
    border-color: #1b4965;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.cms-status {
    text-align: center;
    padding: 70px 0;
    color: #6b7280;
    font-size: 1rem;
}

.cms-error {
    color: rgb(195, 50, 50);
}

.cms-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* ── Pagination ── */
.cms-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.cms-page-btn {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    background: #fff;
    color: #111827;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.cms-page-btn:hover:not(:disabled) {
    background: #eef2ff;
    color: #4f46e5;
    border-color: #a5b4fc;
}

.cms-page-btn--active {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

.cms-page-btn--active:hover {
    background: #4338ca;
    border-color: #4338ca;
}

.cms-page-btn--next {
    font-size: 1.15rem;
    font-weight: 900;
}

.cms-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ── Content Card ── */
.content-card-wrapper {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-card {
    background: #fff;
    border-radius: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-image-wrap {
    width: 100%;
    height: 210px;
    overflow: hidden;
    background: #e5e7eb;
    flex-shrink: 0;
}

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

.content-card:hover .card-image {
    transform: scale(1.06);
}

.card-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

.card-body {
    padding: 18px 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.card-type-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 3px 10px;
    border-radius: 4px;
    width: fit-content;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.45;
    margin: 0;
}

.card-desc {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
    gap: 8px;
}

.card-date {
    font-size: 0.78rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.cms-read-more-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1b4965;
    cursor: pointer;
}

.card-bottom-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.card-views {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #9ca3af;
}

.card-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1b4965;
    background: none;
    border: 1px solid #e0e7ff;
    border-radius: 20px;
    padding: 3px 10px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    font-family: inherit;
}

.card-share-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.card-share-btn--copied {
    color: #16a34a;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

/* ── Scroll Animation ── */
.content-card-wrapper {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.content-card-wrapper.card-in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .cms-page {
        padding-top: 130px;
    }

    .cms-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 640px) {
    .cms-page {
        padding: 110px 16px 60px;
    }

    .cms-header {
        flex-direction: column;
        align-items: stretch;
    }

    .cms-header h1 {
        font-size: 1.65rem;
    }

    .cms-filter {
        width: 100%;
    }

    .cms-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}