.cg-page {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 180px);
    padding: 1.5rem 0 3rem;
}

.cg-page__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.cg-hero {
    text-align: center;
    margin-bottom: 1.75rem;
}

.cg-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.cg-hero h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.6rem, 3vw, 2.15rem);
    font-weight: 800;
    color: #0f172a;
}

.cg-lead {
    margin: 0 auto;
    max-width: 40rem;
    color: #475569;
    line-height: 1.55;
}

.cg-alert {
    margin: 0 auto 1.25rem;
    max-width: 40rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.cg-alert--success { background: #ecfdf5; border: 1px solid #bbf7d0; color: #166534; }
.cg-alert--danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.cg-form-card {
    max-width: 40rem;
    margin: 0 auto 2.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem 1.15rem 1.4rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.cg-form-card h2 {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
}

.cg-form-intro {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
}

.cg-form { display: grid; gap: 1rem; }

.cg-field label,
.cg-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #334155;
}

.cg-field input[type="email"],
.cg-field input[type="file"],
.cg-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.7rem 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.65rem;
    font-size: 1rem;
    background: #fff;
}

.cg-field textarea { min-height: 6.5rem; resize: vertical; }

.cg-hint {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}

.cg-login-hint { margin: 0.4rem 0 0; font-size: 0.8125rem; }
.cg-login-hint a { color: #2563eb; font-weight: 600; }

.cg-honeypot {
    position: absolute;
    left: -9999px;
    height: 0;
    overflow: hidden;
}

.cg-stars {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.cg-stars input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cg-stars label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    margin: 0;
    padding: 0 0.55rem;
    border-radius: 0.55rem;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #6b7280;
    cursor: pointer;
}

.cg-stars input:checked + label,
.cg-stars label:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.cg-preview {
    margin-top: 0.75rem;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    max-height: 220px;
}

.cg-preview img {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
}

.cg-submit {
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 0.7rem;
    background: #2563eb;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.cg-submit:hover { background: #1d4ed8; }

.cg-grid-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cg-grid-head h2 { margin: 0; font-size: 1.2rem; }
.cg-grid-head p { margin: 0; font-size: 0.8125rem; color: #64748b; }

.cg-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    border-radius: 0.85rem;
    background: #f8fafc;
}

.cg-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

@media (min-width: 640px) {
    .cg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cg-form-card { padding: 1.5rem 1.75rem 1.75rem; }
}

@media (min-width: 768px) {
    .cg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .cg-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
    .cg-card__body { padding: 0.6rem 0.7rem 0.75rem; }
    .cg-card__comment { font-size: 0.8rem; }
}

.cg-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.cg-card__image {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: #f1f5f9;
    cursor: zoom-in;
}

.cg-card__image img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.cg-card__body { padding: 0.85rem 0.95rem 1rem; }

.cg-card__stars {
    color: #e2e8f0;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.cg-card__stars .is-on { color: #f59e0b; }

.cg-card__comment {
    margin: 0 0 0.55rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #334155;
}

.cg-card__author {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #0f172a;
}

.cg-card__admin,
.cg-lightbox__admin {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.7rem;
}

.cg-card__admin-edit,
.cg-lightbox__edit,
.cg-card__admin-delete,
.cg-lightbox__delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.7rem;
    border-radius: 0.45rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.cg-card__admin-edit,
.cg-lightbox__edit {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

.cg-card__admin-delete,
.cg-lightbox__delete {
    background: #fff;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.cg-lightbox__admin {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid #1f2937;
}

.cg-lightbox__edit {
    background: #f8fafc;
}

.cg-lightbox__delete {
    background: #450a0a;
    border-color: #7f1d1d;
    color: #fecaca;
}

.cg-pager {
    display: none !important;
}

.cg-sentinel {
    height: 1px;
    pointer-events: none;
}

.cg-infinite-status {
    display: block;
    margin: 0.85rem 0 0;
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
    min-height: 1.25rem;
}

.cg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 23, 42, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.25rem 3.5rem 1.25rem;
    box-sizing: border-box;
}

.cg-lightbox[hidden] { display: none !important; }

.cg-lightbox__panel {
    display: flex;
    flex-direction: column;
    width: min(96vw, 1100px);
    max-height: calc(100vh - 1.5rem);
    background: #0b1220;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.cg-lightbox__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
    touch-action: none;
    cursor: zoom-in;
}

.cg-lightbox__stage.is-zoomed {
    cursor: grab;
}

.cg-lightbox__stage.is-zoomed:active {
    cursor: grabbing;
}

.cg-lightbox__image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 13rem);
    object-fit: contain;
    border-radius: 0;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: center center;
    will-change: transform;
}

.cg-lightbox__zoom {
    position: absolute;
    top: 0.65rem;
    left: 0.75rem;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.cg-lightbox__zoom button {
    width: 2.15rem;
    height: 2.15rem;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.cg-lightbox__zoom button:hover {
    background: #e2e8f0;
}

.cg-lightbox__zoom-label {
    min-width: 3.1rem;
    padding: 0 0.15rem;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}

.cg-lightbox__meta {
    flex: 0 0 auto;
    padding: 0.85rem 1rem 1rem;
    background: #111827;
    color: #e5e7eb;
}

.cg-lightbox__stars {
    color: #4b5563;
    letter-spacing: 0.08em;
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.cg-lightbox__stars .is-on { color: #f59e0b; }

.cg-lightbox__comment {
    margin: 0 0 0.45rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #f8fafc;
    white-space: pre-wrap;
    word-break: break-word;
}

.cg-lightbox__comment[hidden] { display: none !important; }

.cg-lightbox__author {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
}

.cg-lightbox__counter {
    margin: 0.4rem 0 0;
    font-size: 0.75rem;
    color: #94a3b8;
}

.cg-lightbox__close {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.cg-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cg-lightbox__nav[hidden] { display: none !important; }
.cg-lightbox__nav:hover { background: #fff; }
.cg-lightbox__nav--prev { left: 0.55rem; }
.cg-lightbox__nav--next { right: 0.55rem; }

@media (max-width: 640px) {
    .cg-lightbox {
        padding: 3rem 0.5rem 0.75rem;
        align-items: flex-end;
    }

    .cg-lightbox__panel {
        width: 100%;
        max-height: calc(100vh - 3.5rem);
        border-radius: 0.85rem 0.85rem 0.5rem 0.5rem;
    }

    .cg-lightbox__image {
        max-height: calc(100vh - 14.5rem);
    }

    .cg-lightbox__nav {
        width: 2.35rem;
        height: 2.35rem;
        font-size: 1.5rem;
        background: rgba(255, 255, 255, 0.82);
    }

    .cg-lightbox__nav--prev { left: 0.35rem; }
    .cg-lightbox__nav--next { right: 0.35rem; }

    .cg-lightbox__zoom {
        top: 0.55rem;
        left: 0.5rem;
    }

    .cg-lightbox__zoom button {
        width: 2rem;
        height: 2rem;
        font-size: 1.15rem;
    }
}

.hp-cg-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .hp-cg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.hp-cg-carousel {
    position: relative;
}

.hp-cg-carousel .swiper-slide {
    height: auto;
}

.hp-cg-carousel .hp-cg-card {
    border-radius: 0.55rem;
}

.hp-cg-carousel .hp-cg-card__meta {
    padding: 0.35rem 0.45rem 0.45rem;
}

.hp-cg-carousel .hp-cg-card__stars {
    font-size: 0.65rem;
}

.hp-cg-carousel .hp-cg-card__name {
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-cg-card {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    text-align: left;
    font: inherit;
    text-decoration: none;
    color: inherit;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: zoom-in;
}

.hp-cg-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.hp-cg-card__meta {
    padding: 0.55rem 0.7rem 0.7rem;
}

.hp-cg-card__stars {
    color: #e2e8f0;
    letter-spacing: 0.04em;
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
    line-height: 1;
}

.hp-cg-card__stars .is-on { color: #f59e0b; }

.hp-cg-card__name {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0f172a;
}

.hp-cg-empty {
    font-size: 0.875rem;
    color: #64748b;
    padding: 0.5rem 0;
}
