/* =============================================================
   Copthill Class News — Frontend
   ============================================================= */

/* ── Password gate ─────────────────────────────────────────── */
.ccn-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    padding: 40px 24px;
}

.ccn-gate-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 44px 36px 36px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(1, 70, 118, 0.08);
}

.ccn-gate-icon {
    width: 52px;
    height: 52px;
    background: #014676;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: #bdbe55;
}

.ccn-gate h2 {
    font-size: 20px;
    font-weight: 600;
    color: #014676;
    margin: 0 0 6px;
    line-height: 1.2;
}

.ccn-gate-sub {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 26px;
    line-height: 1.6;
}

.ccn-error-msg {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
    text-align: left;
}

.ccn-field {
    position: relative;
    margin-bottom: 12px;
}

.ccn-field input[type="password"],
.ccn-field input[type="text"] {
    width: 100%;
    padding: 13px 46px 13px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    box-sizing: border-box;
}

.ccn-field input:focus { border-color: #014676; }

.ccn-pw-eye {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 4px;
    line-height: 0;
    transition: color 0.2s;
}

.ccn-pw-eye:hover { color: #014676; }

.ccn-submit {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 28px;
    background: #bdbe55;
    color: #014676;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.ccn-submit:hover { background: #a8a94a; }

/* ── Status bar ────────────────────────────────────────────── */
.ccn-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #0369a1;
    flex-wrap: wrap;
}

.ccn-bar-label { font-weight: 500; }

.ccn-signout-form { margin: 0; }

.ccn-signout-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: background 0.15s, color 0.15s;
}

.ccn-signout-btn:hover { color: #dc2626; background: #fef2f2; text-decoration: none; }

/* ── Post loop ─────────────────────────────────────────────── */
.ccn-posts { margin-bottom: 28px; }

.ccn-post-card {
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 0;
}

.ccn-post-card:first-child { padding-top: 0; }
.ccn-post-card:last-child { border-bottom: none; }

.ccn-post-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ccn-class-badge {
    display: inline-block;
    background: #014676;
    color: #bdbe55;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.ccn-post-date { font-size: 13px; color: #94a3b8; }

.ccn-post-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.ccn-post-title a {
    color: #014676;
    text-decoration: none;
    transition: opacity 0.15s;
}

.ccn-post-title a:hover { opacity: 0.7; }

.ccn-post-excerpt {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 10px;
}

.ccn-read-more {
    font-size: 14px;
    font-weight: 500;
    color: #014676;
    text-decoration: none;
    border-bottom: 1px solid #bdbe55;
    padding-bottom: 1px;
    transition: opacity 0.15s;
}

.ccn-read-more:hover { opacity: 0.7; }

/* ── Pagination ────────────────────────────────────────────── */
.ccn-pagination {
    margin-top: 24px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.ccn-pagination a,
.ccn-pagination span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    color: #014676;
    text-decoration: none;
    transition: background 0.15s;
}

.ccn-pagination span.current {
    background: #014676;
    color: #ffffff;
    border-color: #014676;
}

.ccn-pagination a:hover { background: #f0f9ff; }

/* ── Unlock more accordion ─────────────────────────────────── */
.ccn-unlock-more {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 4px;
    overflow: hidden;
}

.ccn-unlock-more summary {
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #014676;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.ccn-unlock-more summary::-webkit-details-marker { display: none; }

.ccn-unlock-more summary::before {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid #014676;
    border-bottom: 2px solid #014676;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.ccn-unlock-more[open] summary::before {
    transform: rotate(-135deg) translateY(-2px);
}

.ccn-unlock-inner {
    padding: 0 18px 18px;
    border-top: 1px solid #e2e8f0;
}

.ccn-unlock-inner .ccn-gate {
    min-height: auto;
    padding: 20px 0 0;
}

/* ── Empty state ───────────────────────────────────────────── */
.ccn-no-posts {
    padding: 40px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 15px;
}

/* ── Entry animation ───────────────────────────────────────── */
@keyframes ccn-slide-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

#ccn-posts.ccn-just-unlocked .ccn-post-card {
    animation: ccn-slide-in 0.4s ease both;
}

#ccn-posts.ccn-just-unlocked .ccn-post-card:nth-child(1) { animation-delay: 0s; }
#ccn-posts.ccn-just-unlocked .ccn-post-card:nth-child(2) { animation-delay: 0.06s; }
#ccn-posts.ccn-just-unlocked .ccn-post-card:nth-child(3) { animation-delay: 0.12s; }
#ccn-posts.ccn-just-unlocked .ccn-post-card:nth-child(4) { animation-delay: 0.18s; }
#ccn-posts.ccn-just-unlocked .ccn-post-card:nth-child(5) { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
    #ccn-posts.ccn-just-unlocked .ccn-post-card { animation: none; }
}
