:root {
    --ci-primary: #1f6b4a;
    --ci-primary-light: #2d8a62;
    --ci-accent: #c9a227;
    --ci-dark: #1a2e24;
    --ci-light: #ffffff;
    --ci-muted: #5c6f65;
    --ci-border: #d8e4dc;
    --ci-bg: #f4f8f5;
    --ci-surface: #ffffff;
    --ci-surface-alt: #fafcfa;
    --ci-radius: 12px;
    --ci-shadow: 0 8px 28px rgba(26, 46, 36, 0.07);
    --ci-hero-start: #0f3d2c;
    --ci-hero-mid: #1f6b4a;
    --ci-hero-end: #3d9e72;
}

* {
    box-sizing: border-box;
}

body.ceyloan-body {
    margin: 0;
    font-family: "DM Sans", "Noto Sans Sinhala", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ci-dark);
    background: var(--ci-bg);
    line-height: 1.5;
}

body.ci-locale-si {
    font-family: "Noto Sans Sinhala", "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body.ci-locale-si .ci-section-title,
body.ci-locale-si .ci-hero h2,
body.ci-locale-si .ci-brand-title {
    letter-spacing: 0;
}

[lang="si"] {
    font-family: "Noto Sans Sinhala", "DM Sans", sans-serif;
}

a {
    color: inherit;
}

.ci-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ci-container {
    width: min(1140px, 92vw);
    margin: 0 auto;
}

.ci-topbar {
    background: var(--ci-surface);
    border-bottom: 1px solid var(--ci-border);
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: 0 1px 0 rgba(26, 46, 36, 0.04);
}

.ci-topbar-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
}

.ci-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.ci-brand img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(31, 107, 74, 0.2);
}

.ci-brand-title {
    margin: 0;
    color: var(--ci-dark);
    font-size: 1.15rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ci-brand-subtitle {
    margin: 2px 0 0;
    color: var(--ci-muted);
    font-size: 0.8rem;
    font-weight: 400;
}

.ci-nav-toggle {
    display: none;
    border: 1px solid var(--ci-border);
    background: var(--ci-surface-alt);
    color: var(--ci-dark);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.ci-lang-switch {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--ci-border);
    background: var(--ci-surface-alt);
    border-radius: 999px;
}

.ci-lang-btn {
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ci-muted);
    line-height: 1.2;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.ci-lang-btn:hover {
    color: var(--ci-primary);
}

.ci-lang-btn.active {
    background: var(--ci-primary);
    color: #fff;
}

.ci-lang-btn[lang="si"] {
    font-family: "Noto Sans Sinhala", "DM Sans", sans-serif;
}

.ci-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.ci-nav a {
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #2d4036;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.ci-nav a:hover,
.ci-nav a.active {
    color: #fff;
    background: var(--ci-primary);
}

.ci-main {
    flex: 1;
    padding: 28px 0 40px;
}

.ci-hero {
    border-radius: calc(var(--ci-radius) + 4px);
    background: linear-gradient(135deg, var(--ci-hero-start) 0%, var(--ci-hero-mid) 55%, var(--ci-hero-end) 100%);
    color: var(--ci-light);
    padding: 32px 34px;
    box-shadow: var(--ci-shadow);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.ci-hero::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.ci-hero h2 {
    margin: 0 0 10px;
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
}

.ci-hero p {
    max-width: 720px;
    margin: 0;
    opacity: 0.94;
    font-size: 1.02rem;
    position: relative;
}

.ci-hero-actions {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
}

.ci-hero-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    transition: background 0.15s ease;
}

.ci-hero-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.ci-hero-btn-accent {
    background: var(--ci-accent);
    border-color: var(--ci-accent);
    color: #1a2e24;
}

.ci-hero-btn-accent:hover {
    background: #dbb42e;
}

.ci-grid {
    display: grid;
    gap: 20px;
}

.ci-grid-2 {
    grid-template-columns: 2fr 1fr;
}

.ci-card {
    background: var(--ci-surface);
    border: 1px solid var(--ci-border);
    border-radius: var(--ci-radius);
    box-shadow: var(--ci-shadow);
    overflow: hidden;
}

.ci-card-body {
    padding: 22px;
}

.ci-section-title {
    margin: 0 0 14px;
    font-size: 1.08rem;
    color: var(--ci-dark);
    font-weight: 700;
    position: relative;
    padding-left: 14px;
    letter-spacing: -0.01em;
}

.ci-section-title::before {
    content: "";
    width: 4px;
    border-radius: 999px;
    background: var(--ci-primary);
    position: absolute;
    left: 0;
    top: 0.15rem;
    bottom: 0.15rem;
}

.ci-post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.ci-post-item {
    border: 1px solid var(--ci-border);
    border-radius: var(--ci-radius);
    overflow: hidden;
    background: var(--ci-surface-alt);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ci-post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(26, 46, 36, 0.1);
    border-color: #b8cfc0;
}

.ci-post-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: #e8f0eb;
}

.ci-post-content {
    padding: 14px;
}

.ci-post-content h4 {
    margin: 0 0 6px;
    font-size: 0.98rem;
    line-height: 1.35;
    font-weight: 600;
}

.ci-post-content h4 a:hover {
    color: var(--ci-primary);
}

.ci-post-content p {
    margin: 0;
    color: var(--ci-muted);
    font-size: 0.84rem;
}

.ci-chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ci-chip {
    text-decoration: none;
    background: #edf5f0;
    color: var(--ci-primary);
    border: 1px solid #c5ddd0;
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 500;
    transition: 0.15s ease;
}

.ci-chip:hover {
    background: var(--ci-primary);
    color: #fff;
    border-color: var(--ci-primary);
}

.ci-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ci-list li + li {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--ci-border);
}

.ci-list a {
    text-decoration: none;
    color: var(--ci-dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.ci-list a:hover {
    color: var(--ci-primary);
}

.ci-sidebar-card {
    align-self: start;
    position: sticky;
    top: 88px;
}

.ci-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.ci-sidebar-section {
    border-top: 1px solid var(--ci-border);
}

.ci-recent-link {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 9px;
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid var(--ci-border);
    background: var(--ci-surface-alt);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.ci-recent-link:hover {
    transform: translateY(-1px);
    border-color: #a8c9b6;
    box-shadow: 0 6px 16px rgba(31, 107, 74, 0.12);
}

.ci-recent-thumb {
    width: 72px;
    height: 58px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--ci-border);
    background: #e8f0eb;
}

.ci-recent-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ci-recent-title {
    color: var(--ci-dark);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ci-recent-meta {
    font-size: 0.75rem;
    color: var(--ci-muted);
}

.ci-recent-link i {
    color: var(--ci-primary);
    font-size: 0.82rem;
}

.ci-album-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.ci-album-link {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 9px;
    border: 1px solid var(--ci-border);
    border-radius: 10px;
    text-decoration: none;
    background: var(--ci-surface);
    transition: 0.15s ease;
}

.ci-album-link:hover {
    border-color: #a8c9b6;
    box-shadow: 0 6px 14px rgba(26, 46, 36, 0.08);
}

.ci-album-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--ci-border);
    background: #e8f0eb;
}

.ci-album-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ci-album-title {
    color: var(--ci-dark);
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ci-album-meta {
    font-size: 0.75rem;
    color: var(--ci-muted);
}

.ci-album-link i {
    color: var(--ci-accent);
    font-size: 0.88rem;
}

.ci-meta {
    color: var(--ci-muted);
    font-size: 0.84rem;
}

.ci-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(31, 107, 74, 0.1);
    color: var(--ci-primary);
    margin-bottom: 8px;
}

.ci-article-hero {
    width: 100%;
    border-radius: var(--ci-radius);
    max-height: 420px;
    object-fit: cover;
    background: #e8f0eb;
}

.ci-article-content {
    line-height: 1.78;
    font-size: 1.02rem;
    color: #243830;
}

.ci-article-content img {
    max-width: 100%;
    border-radius: var(--ci-radius);
}

.ci-article-content a {
    color: var(--ci-primary);
}

.ci-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.ci-form input,
.ci-form textarea {
    width: 100%;
    border: 1px solid var(--ci-border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    background: #fff;
    font-family: inherit;
}

.ci-form input:focus,
.ci-form textarea:focus {
    outline: 0;
    border-color: var(--ci-primary);
    box-shadow: 0 0 0 3px rgba(31, 107, 74, 0.12);
}

.ci-btn {
    border: 0;
    background: var(--ci-primary);
    color: #fff;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    transition: background 0.15s ease;
}

.ci-btn:hover {
    background: var(--ci-primary-light);
}

.ci-btn-accent {
    background: var(--ci-accent);
    color: #1a2e24;
}

.ci-btn-accent:hover {
    background: #dbb42e;
}

.ci-social {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ci-social a,
.ci-social button.ci-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--ci-border);
    background: var(--ci-surface);
    color: #2d4036;
    font-weight: 500;
    font-size: 0.88rem;
}

.ci-social a:hover {
    border-color: var(--ci-primary);
    color: var(--ci-primary);
    background: #edf5f0;
}

.ci-social i {
    line-height: 1;
}

.ci-share-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ci-footer {
    background: var(--ci-dark);
    color: #d4e5dc;
    padding: 32px 0;
    margin-top: 24px;
}

.ci-footer-brand {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
}

.ci-footer p {
    margin: 0;
    opacity: 0.88;
    font-size: 0.92rem;
    max-width: 640px;
}

.ci-footer .ci-social {
    margin-bottom: 14px;
}

.ci-footer .ci-social a {
    background: rgba(255, 255, 255, 0.08);
    color: #e8f5ee;
    border-color: rgba(255, 255, 255, 0.15);
}

.ci-footer .ci-social a:hover {
    background: rgba(61, 158, 114, 0.35);
    border-color: rgba(61, 158, 114, 0.6);
    color: #fff;
}

.ci-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 30, 22, 0.92);
}

.ci-modal-content {
    width: min(900px, 92vw);
    max-height: 90vh;
    object-fit: contain;
    display: block;
    margin: 4vh auto 0;
}

.ci-modal-close {
    position: absolute;
    right: 18px;
    top: 14px;
    color: #fff;
    border: 0;
    background: none;
    font-size: 2rem;
    cursor: pointer;
}

.ci-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(26, 46, 36, 0.5);
    color: #fff;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.ci-modal-nav:hover {
    background: var(--ci-primary);
    border-color: rgba(255, 255, 255, 0.5);
}

.ci-modal-prev {
    left: 20px;
}

.ci-modal-next {
    right: 20px;
}

.ci-modal-counter {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 18px;
    color: #e5ebe8;
    background: rgba(26, 46, 36, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    font-size: 0.84rem;
    padding: 6px 12px;
}

.ci-pagination-wrap {
    display: flex;
    justify-content: center;
}

.ci-pagination {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ci-pagination li a,
.ci-pagination li span {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--ci-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    color: #2d4036;
    background: #fff;
}

.ci-pagination li a:hover {
    border-color: #a8c9b6;
    color: var(--ci-primary);
    background: #edf5f0;
}

.ci-pagination li.active span {
    border-color: var(--ci-primary);
    background: var(--ci-primary);
    color: #fff;
}

.ci-pagination li.disabled span {
    color: #98a89f;
    border-color: var(--ci-border);
    background: #f4f8f5;
    cursor: not-allowed;
}

@media (min-width: 901px) {
    .ci-nav {
        width: 100%;
        flex-basis: 100%;
        border-top: 1px solid var(--ci-border);
        padding-top: 10px;
        margin-top: 4px;
    }
}

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

    .ci-nav-toggle {
        display: inline-flex;
    }

    .ci-nav {
        display: none;
        width: 100%;
        padding-top: 8px;
        border-top: 1px solid var(--ci-border);
    }

    .ci-nav.is-open {
        display: flex;
    }

    .ci-topbar-row {
        flex-wrap: wrap;
    }

    .ci-sidebar-card {
        position: static;
    }

    .ci-lang-btn {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
}

@media (max-width: 520px) {
    .ci-hero {
        padding: 24px 20px;
    }

    .ci-recent-link {
        grid-template-columns: 64px 1fr;
    }

    .ci-recent-link i {
        display: none;
    }

    .ci-recent-thumb {
        width: 64px;
        height: 52px;
    }

    .ci-album-link {
        grid-template-columns: 52px 1fr;
    }

    .ci-album-thumb {
        width: 52px;
        height: 52px;
    }

    .ci-album-link i {
        display: none;
    }
}
